svn path=/trunk/mcs/; revision=60765
[mono.git] / mcs / mcs / ChangeLog
1 2006-05-16  Raja R Harinath  <rharinath@novell.com>
2
3         * statement.cs (Goto.Resolve): Merge jump origins here ...
4         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
5
6         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
9         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
10         here, ...
11         * statement.cs (Goto.Resolve): ... not here.
12         (Goto.Emit): Remove CS1632 check.
13
14 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
15
16         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
17         error message.
18
19 2006-05-11  Raja R Harinath  <rharinath@novell.com>
20
21         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
22         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
23         (FlowBranchingException.Label): Likewise.
24
25         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
26         given value.
27         (MyBitVector.Or): Use it to avoid losing information (Count).
28         (FlowBranching.MergeOrigins): Likewise.
29
30         * flowanalysis.cs (UsageVector.IsDirty): Remove.
31         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
32         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
33         (UsageVector.ToString): Simplify.
34         (UsageVector.MergeSiblings): Move here from ...
35         (FlowBranching.Merge): ... here.
36         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
37         not a MyBitVector.
38
39 2006-05-10  Raja R Harinath  <rharinath@novell.com>
40
41         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
42         null bitvector is treated as all-true.
43
44         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
45         (MyBitVector): Rationalize invariants.  'vector != null' implies
46         that we have our own copy of the bitvector.  Otherwise,
47         'InheritsFrom == null' implies all inherited bits are true.
48
49 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
50
51         * statement.cs (LocalInfo): Add IsConstant.
52         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
53         local variable for constants.
54
55 2006-05-09  Raja R Harinath  <rharinath@novell.com>
56
57         * flowanalysis.cs (MyBitVector.Empty): New.
58         (MyBitVector): Don't allow InheritedFrom to be null.
59         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
60         (UsageVector, FlowBranching): Update to changes.
61
62         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
63         recursion.  The 'Parent == null' condition isn't sufficient for
64         anonymous methods.
65         (FlowBranching.AddBreakOrigin): Likewise.
66         (FlowBranching.AddContinueOrigin): Likewise.
67         (FlowBranching.AddReturnOrigin): Likewise.
68         (FlowBranching.StealFinallyClauses): Likewise.
69         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
70         (FlowBranching.CheckOutParameters): Likewise.
71         (FlowBranchingToplevel): Terminate all the above recursions here.
72         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
73         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
74
75         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
76         toplevel block.
77         (FlowBranchingToplevel): New.  Empty for now.
78         (FlowBranching.MergeTopBlock): Update.
79         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
80         branching for the anonymous delegate.
81         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
82
83         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
84         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
85         information at the start of the merge.  Reorganize.
86
87 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
88
89         * class.cs (MethodData.Define): Method cannot implement interface accessor.
90
91 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
92
93         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
94         to newly introduced ctor.
95
96         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
97         message to one place.
98         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
99         global namespace.
100
101 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
102
103         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
104
105         * ecore.cs (Expression.ResolveAsConstant): Updated.
106
107         * statement.cs (ResolveMeta): Updated.
108
109 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
110
111         * cs-parser.jay: __arglist cannot be used in initializer.
112
113 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
114
115         A fix for #77879
116         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
117         private types.
118
119 2006-05-05  Raja R Harinath  <rharinath@novell.com>
120
121         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
122         (LabeledStatement): Add 'name' parameter.
123         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
124         (Block.AddLabel): Update to changes.
125         * cs-parser.jay (labeled_statement): Likewise.
126
127         * flowanalysis.cs (BranchingType.Labeled): New.
128         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
129         (FlowBranchingLabeled): New.  Does nothing for now, but will
130         eventually handle 'goto' flows.
131         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
132         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
133         that's terminated ...
134         (Block.Resolve): ... here.
135
136         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
137         (UsageVector.MergeFinallyOrigins): Likewise.
138         (FlowBranching.InTryOrCatch): Likewise.
139         (FlowBranching.AddFinallyVector): Likewise.
140         (FlowBranchingException): Update to changes.
141
142         Fix #78290
143         * statement.cs (Return.Resolve): Move error checking to ...
144         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
145         (FlowBranchingException): Handle return origins like break and
146         continue origins.
147         (FlowBranching.UsageVector.CheckOutParameters): Remove.
148
149 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
150
151         A fix for #76122
152         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
153         filter.
154
155 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
156
157         A fix for #77543
158         * class.cs (MethodData.Define): Do public accessor check only when method
159         implements an interface.
160
161 2006-05-04  Raja R Harinath  <rharinath@novell.com>
162
163         Remove special handling of 'break'
164         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
165         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
166         (UsageVector.Break): Remove.
167         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
168         reachability.
169         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
170
171         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
172         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
173
174 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
175
176         A fix for #75726
177         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
178         be the interface member.
179
180 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
181
182         A fix for #60069
183         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
184         for emitting small (int) values.
185
186 2006-05-03  Raja R Harinath  <rharinath@novell.com>
187
188         Fix #59427
189         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
190         control-flow passes through the 'finally' after merging-in all the
191         control-flows from 'try' and the 'catch' clauses.
192
193         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
194         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
195         always true at the only non-recursive entry point.
196         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
197         FlowBranchingBreakable.
198         (FlowBranchingLoop): Remove.
199         * statement.cs (Return.DoResolve): Update to changes.
200
201         Fix #76471, #76665
202         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
203         (FlowBranching.CreateBranching): Handle it: create a
204         FlowBranchingContinuable.
205         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
206         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
207         except that it handles the 'continue' command.
208         (FlowBranching.UsageVector.MergeOrigins): Rename from
209         MergeBreakOrigins.
210         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
211         except that it overrides AddContinueOrigin.
212         (FlowBranchingException): Override AddContinueOrigin, similar to
213         AddBreakOrigin.
214         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
215         Create a new branching around the embedded statement.
216         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
217         control flow after the embedded statement.
218         (Continue.Resolve): Move all error checking to AddContinueOrigin.
219
220         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
221         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
222         FlowBranchingBreakable.
223         (FlowBranchingSwitch): Remove.
224
225         Fix test-503.cs
226         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
227         error reporting to ...
228         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
229         Rename from 'AddBreakVector'.  Add new location argument.  Return
230         a bool indicating whether the 'break' crosses an unwind-protect.
231         (FlowBranchingException.AddBreakOrigin): Add.
232         (FlowBranchingException.Merge): Propagate 'break's to surrounding
233         flowbranching after updating with the effects of the 'finally'
234         clause.
235         (FlowBranchingBreakable): New common base class for
236         FlowBranchingLoop and FlowBranchingSwitch.
237
238         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
239         embedded statement.
240         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
241
242 2006-05-02  Raja R Harinath  <rharinath@novell.com>
243
244         * statement.cs (Do.Resolve): If the loop is infinite, set the
245         barrier.
246         (While.Resolve, For.Resolve): Set a barrier after the embedded
247         statement.  There's no direct control flow that goes from the end
248         of the embedded statement to the end of the loop.
249         * flowanalysis.cs (FlowBranching.Infinite): Remove.
250         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
251         above ensure that the reachability is correctly computed.
252
253         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
254         (UsageVector.MergeBreakOrigins): If the current path is
255         unreachable, treat it as if all parameters/locals are initialized.
256         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
257         infinite loops before merging-in break origins.
258
259         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
260         (Reachability.Reachable): Split part into ...
261         (Reachability.Unreachable): ... this.  Simplify.
262         (Reachability.IsUnreachable): Use 'Unreachable' instead.
263
264         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
265         (Reachability.SetThrowsSometimes): Likewise.
266         (FlowBranchingBlock.MergeTopBlock): Don't compare against
267         TriState.Always, use corresponding property.
268         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
269         (Block.Resolve): Likewise.  Remove some redundant checks.
270
271 2006-05-02  Raja R Harinath  <harinath@gmail.com>
272
273         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
274         (Reachability.Meet): Don't bother checking AlwaysThrows --
275         barrier is always set.
276         (FlowBranchingBlock.Merge): Likewise.
277
278 2006-05-01  Raja R Harinath  <harinath@gmail.com>
279
280         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
281         checks for unreachable.
282
283 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
284
285         A fix for #77980
286         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
287
288         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
289         whether field is really assigned.
290
291 2006-04-30  Raja R Harinath  <harinath@gmail.com>
292
293         * flowanalysis.cs (Reachability): Make 4-argument constructor
294         private.
295         (Reachability.Meet): Rename from 'And'.  Remove static variant.
296         (Reachability.Always): Rename from the highly misleading
297         'Reachability.Never'.
298         (FlowBranching.Merge): Update to changes.  Mark an impossible
299         situation with a 'throw'.
300         (*): Update to changes.
301
302 2006-04-29  Raja R Harinath  <harinath@gmail.com>
303
304         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
305         Remove 'Undefined'.
306         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
307         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
308         (*): Update to changes.
309         * statement.cs: Update to changes.
310
311 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
312
313         A fix for #78049
314         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
315
316 2006-04-28  Raja R Harinath  <harinath@gmail.com>
317
318         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
319         dummy UsageVector.
320
321         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
322         argument to two arguments: an usage-vector and a bool.  Move call
323         to FlowBranching.Merge () ...
324         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
325
326         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
327         handling of loop and switch reachability to ...
328         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
329
330 2006-04-27  Raja R Harinath  <harinath@gmail.com>
331
332         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
333         handling to FlowBranchingLoop.InLoop.
334         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
335
336 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
337
338         A fix for #78115
339         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
340         anonymous method is allowed from AnonymousContainer here.
341
342         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
343
344 2006-04-24  Raja R Harinath  <rharinath@novell.com>
345
346         Fix #78156
347         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
348
349 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
350
351         A fix for #49011.
352         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
353         (DoubleConstant.Reduce): Ditto.
354
355 2006-04-23  Raja R Harinath  <rharinath@novell.com>
356
357         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
358         Remove 'lvalue_right_side' argument.  Move parts to ...
359         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
360         (LocalVariable.DoResolveLValue): ... these.
361
362 2006-04-21  Raja R Harinath  <rharinath@novell.com>
363
364         Fix cs1655.cs
365         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
366         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
367         (LocalVariableReference.DoResolveBase): Use it to implement new
368         CS1655 check.
369         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
370         (Argument.Resolve): Simplify.  Move CS1510 check ...
371         * ecore.cs (Expression.ResolveLValue): ... here.
372         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
373         (PropertyExpr.DoResolveLValue): Likewise.
374         (FieldExpr.Report_AssignToReadonly): Likewise.
375         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
376         LValueMemberAccess or LValueMemberOutAccess on instance depending
377         on it.
378         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
379         DoResolve as appropriate.
380
381 2006-04-20  Raja R Harinath  <rharinath@novell.com>
382
383         Fix #75800
384         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
385         implicit conversions on 'out' and 'ref' arguments.
386
387         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
388         improve clarity.  Remove dead code.
389
390         Fix #66031
391         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
392         (Catch.Resolve): Resolve VarBlock if it exists.
393
394 2006-04-19  Miguel de Icaza  <miguel@novell.com>
395
396         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
397         twice, this was some residual code, the enumerator was emitted
398         properly in the two branche of if later.
399
400 2006-04-19  Raja R Harinath  <rharinath@novell.com>
401
402         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
403         cast is never an lvalue.
404         (Cast.DoResolve, Cast.ResolveRest): Combine.
405         (Argument.Emit): Simplify slightly.  Move 'Expr is
406         IMemoryLocation' check ...
407         (Argument.Resolve): ... here.
408         (Argument.Error_LValueRequired): Remove.  Inline into only user.
409
410         Simplifications.  Fix cs0191-2.cs
411         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
412         CS1649 and CS1651 to ...
413         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
414         the actual selection of the error code and message to a lookup
415         table.  Add a dummy return value to simplify callsites.
416         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
417         readonly fields of other instances of the same type.  Move CS0197
418         warning from ...
419         * expression.cs (Argument.Resolve): ... here.  Simplify code.
420         Ensure that ec.InRefOutArgumentResolving is only set during LValue
421         resolution of an out or ref argument.  The code simplification
422         above uses this invariant.
423
424 2006-04-18  Raja R Harinath  <rharinath@novell.com>
425
426         Possibly fix #77752.  Fix cs1690-[4-7].cs.
427         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
428         CheckMarshallByRefAccess.  Drop parameter.
429         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
430         warning.
431         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
432         InstanceExpression.
433         * report.cs (AllWarnings): Add CS1690.
434         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
435         for ref access too.
436         (LocalVariableReference.DoResolveBase): Update.
437
438 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
439
440         * class.cs (MethodOrOperator): Moved common parts from method class.
441         detect obsolete attributes.
442         (Method.Define): Simplified as it reuses code from base.
443         (Constructor.ValidAttributeTargets): Fixed issue found during
444         refactoring.
445         (Destructor.ValidAttributeTargets): Fixed issue found during
446         refactoring.
447         (Operator): Finished refactoring set off by #78020. Operator class is now
448         ordinary method class.
449
450         * anonymous.cs: Updated.
451
452         * decl.cs (DeclSpace): Add IsGeneric
453
454 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
455
456         * class.cs (Constructor.Emit): Don't emit the attributes twice.
457
458 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
459
460         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
461         detect obsolete attributes.
462         (Method.CreateEmitContext): Moved to MethodOrOperator.
463
464 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
465
466         A fix for #78048.
467         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
468         customized exception to make crash detection easier.
469         (MethodOrOperator): Started to work on new base class for methods and
470         operators.
471         (Method): Derives from MethodOrOperator.
472         (Constructor.Emit): Emits its own attributes.
473         (AbstractPropertyEventMethod.Emit): Ditto.
474         (Operator): Derives from MethodOrOperator, will refactor fully in extra
475         patch.
476         (Operator.Emit): It's temporary more tricky than should be.
477         
478         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
479
480         * report.cs (InternalErrorException): Add ctor with inner exception.
481
482 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
483
484         A fix for #76744.
485         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
486         only not visible.
487
488 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
489
490         A fix for #77916.
491         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
492         array.
493
494 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
495
496         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
497         attribute is present and Guid not.
498         (Interface.ApplyAttributeBuilder): Ditto.
499
500         * attribute.cs: Add error message.
501
502 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
503
504         A fix for #78020.
505
506         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
507         sources (it's composite) so hold them in extra array as they are used in
508         Emit phase only. It worked in the previous versions by mistake.
509         (Attribute.Emit): Emit attribute for more owners when exist.
510
511         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
512         it has now different behaviour.
513
514 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
515
516         * constant.cs (Constant.IsDefaultInitializer): New method.
517
518         * class.cs: Updated.
519
520         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
521         re-initialize default values. It saves KBs almost for every assembly.
522         Thanks Zoltan for the idea.
523         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
524         (ArrayCreation.DoResolve): Resolve only once.
525         (ArrayCreation.Emit): Emit static initializer only when it is faster.
526         (ArrayCreation.GetAttributableValue): Cope with optimized values.
527
528 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
529
530         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
531         From #77961.
532
533 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
534
535         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
536         in an embedded statement too.
537
538 2006-04-01  Raja R Harinath  <rharinath@novell.com>
539
540         Fix #77958
541         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
542
543 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
544
545         A fix for #77966.
546
547         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
548         was not specified.
549
550         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
551
552 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
553
554         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
555         phase.
556
557         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
558         LocalTemporary change.
559
560         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
561         TypeContainer.
562         (ClassOrStruct.DefineFieldInitializers): Implemented static field
563         initializers optimization.
564         (ClassOrStruct.TypeAttr): Moved from modifiers.
565         (Constructor.CheckBase): Don't crash when static ctor has parameters.
566         (FieldBase.ResolveInitializer): Resolves initializer.
567         (FieldBase.HasDefaultInitializer): New property.
568
569         * cs-parser.jay: Removed message.
570
571         * expression.cs (CompilerGeneratedThis): New specialization.
572
573         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
574
575 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
576
577         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
578
579 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
580
581         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
582         be now EnumConstants only.
583
584 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
585
586         * attribute.cs, driver.cs: Reset more caches.
587
588 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
589
590         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
591
592 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
593
594         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
595         for easier reuse. Updated all overrides.
596         (IntegralConstant): New base class for all integral constants.
597         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
598         of the constant range, report custom error.
599         (UIntConstant.Reduce): Fixed uint conversion.
600
601         * ecore.cs, literal.cs: Reduce updates.
602
603 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
604
605         A fix for #75813.
606
607         * class.cs (Constructor.Define): Removed extra if for default ctors.
608         A patch from Atsushi Enomoto.
609
610 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
611
612         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
613         GetAttributableValue.
614
615         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
616         when required.
617
618         * convert.cs (ImplicitConversionRequired): Error message moved to
619         DoubleLiteral.
620
621         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
622         automatic implicit conversion of an output value.
623         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
624
625         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
626         conversion.
627         (TypeOf.GetAttributableValue): Add extra handling for object type.
628
629         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
630         special error message.
631
632 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
633
634         * class.cs (Constructor.Emit): Don't crash when struct ctor is
635         InternalCall.
636         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
637         compatible with MS runtime.
638
639 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
640
641         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
642         attribute arguments here.
643
644         * class.cs (Indexer.Define): The check was moved to attribute class.
645
646 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
647
648         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
649         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
650         easier.
651
652 2006-03-22  Raja R Harinath  <rharinath@novell.com>
653
654         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
655         mcs to keep code differences small.
656         * attribute.cs (Attribute.GetParameterDefaultValue): New.
657         * typemanager.cs (parameter_default_value_attribute_type): New.
658         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
659         CS1908 check.
660
661 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
662
663         * expression.cs (StringConcat.Append): Reverted back to no warning state.
664
665 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
666
667         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
668
669         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
670         the blocks too.
671
672 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
673
674         * doc-bootstrap.cs : fix build.
675
676 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
677
678         * expression.cs (StringConcat.Append): Issue a warning when empty string
679         is going to append.
680
681 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
682
683         * assign.cs (CompoundAssign.ResolveSource): Removed.
684
685         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
686         clean up.
687
688         * class.cs (TypeContainer.FindMethods): Removed.
689         (TypeContainer.CheckMemberUsage): Made static.
690
691         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
692
693         * constant.cs (CheckRange): Removed unused type argument.
694         (CheckUnsigned): Removed unused type argument.
695
696         * cs-parser.jay: Updated after MemberAccess clean up.
697         Uses Length for empty string test.
698
699         * cs-tokenizer.cs: Uses Length for empty string test.
700         (IsCastToken): Made static.
701         (is_hex): Made static.
702         (real_type_suffix): Made static.
703
704         * decl.cs (SetupCache): Made static.
705         (OnGenerateDocComment): Removed unused ds argument.
706
707         * delegate.cs (VerifyDelegate): Removed unused argument.
708
709         * doc.cs: Uses Length for empty string test.
710
711         * driver.cs: Uses Length for empty string test.
712
713         * enum.cs (IsValidEnumType): Made static
714
715         * expression.cs (EnumLiftUp): Removed unused argument.
716         (ResolveMethodGroup): Ditto.
717         (BetterConversion): Ditto.
718         (GetVarargsTypes): Ditto.
719         (UpdateIndices): Ditto.
720         (ValidateInitializers): Ditto.
721         (MemberAccess.ctor): Ditto.
722         (GetIndexersForType): Ditto.
723
724         * flowanalysis.cs: (MergeFinally): Removed unused argument.
725
726         * iterators.cs: Updated after MemberAccess clean up.
727
728         * location.cs: Uses Length for empty string test.
729
730         * namespace.cs: Uses Length for empty string test.
731
732          * report.cs (CheckWarningCode): Made static.
733
734         * statement.cs (LabeledStatement): Removed unused argument.
735
736         * typemanager.cs (FilterNone): Removed.
737
738 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
739
740         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
741         obsolete.
742
743         * class.cs: Updated.
744
745 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
746
747         * cs-parser.jay.cs: __arglist is not allowed for delegates.
748
749 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
750
751         A fix for #77822.
752
753         * expression.cs (VerifyArgumentsCompat): Reverted to double error
754         reporting, it's more tricky than I thought.
755
756 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
757
758         A fix for #77816.
759
760         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
761         host container.
762         (AnonymousMethod.ImplicitStandardConversionExists): New method.
763         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
764         Add more error reporting; Fixed issue with params.
765
766         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
767
768         * cs-parser.jay: AnonymousMethod requires host container.
769
770         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
771
772 2006-03-18  Raja R Harinath  <harinath@gmail.com>
773
774         * class.cs: Change 'TypeContainer ds' constructor argument to
775         'DeclSpace parent'.  Some classes were missed below due to
776         different naming convention.
777
778         * class.cs (MemberCore.Parent): Delete.  This makes the
779         ParentContainer changes below enforceable by the compiler.
780
781         Treat pointers to enclosing declaration space as 'DeclSpace', not
782         'TypeContainer'.
783         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
784         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
785
786         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
787         of TypeContainer.
788         (Block.AddThisVariable): Likewise.
789         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
790         (AbstractPropertyEventMethod.Emit): Likewise.
791         (AbstractPropertyEventMethod.EmitMethod): Likewise.
792         (GetMethod.Define, SetMethod.Define): Likewise.
793         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
794         (DelegateMethod.EmitMethod): Likewise.
795
796         Fix regression test-partial-13.cs.
797         Rationalize use of PartialContainer.  Ensure that the partial
798         class semantics can be tied to type-correctness, i.e., any
799         violation will cause a compile error.
800         * class.cs, const.cs: Access all fields that belong to class
801         TypeContainer via ParentContainer.  Arguments of EmitContexts and
802         Resolve()-like functions still use 'Parent'.
803
804         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
805         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
806         (PropertyMethod.CheckModifiers): Remove unused argument.
807         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
808         DeclSpace.
809
810 2006-03-17  Raja R Harinath  <harinath@gmail.com>
811
812         Make semantics of PartialContainer simpler.
813         * decl.cs (DeclSpace.IsPartial): Remove.
814         * class.cs (TypeContainer.IsPartial): Likewise.
815         (TypeContainer..ctor): Set PartialContainer to point to self.
816         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
817         (TypeContainer.FindNestedType): Likewise.
818         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
819
820 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
821
822         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
823
824 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
825
826         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
827         classes.
828
829 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
830
831         * class.cs (Operator.Define): An error for base conversion was not
832         reported correctly.
833
834 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
835
836         * iterator.cs : yield break is allowed in try statement which has
837           catch clauses. Fixed bug #77767.
838
839 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
840
841         A fix for #77593, #77574.
842
843         * class.cs (MethodCore.CheckBase): Another if for operator.
844
845 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
846
847         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
848         were not resolved
849
850         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
851         (DelegateCreation.ImplicitStandardConversionExists): New method for just
852         conversion test.
853         
854         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
855         not needed.
856
857         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
858         Updated after another emitcontext usage was clean up. It should help us to
859         synchronize with gmcs easier.
860
861 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
862
863         A fix for #77353.
864
865         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
866         (Event.Define): ditto
867         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
868
869         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
870         Removed redundant code and set NewSlot for Invoke method too.
871
872         * parameter.cs (Parameters.ctor): Add custom, type ctor.
873         (Parameters.MergeGenerated): New method. Use this method when you merge
874         compiler generated argument with user arguments.
875
876 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
877
878         * attribute.cs (ResolveAsTypeTerminal): Removed.
879
880         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
881         specialization for predefined types; 30% speed up.
882         Finally placed obsolete check to right place.
883         (Expression.ResolveType): Removed.
884
885         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
886         Updated after ResolveType was removed.
887
888         * expression.cs (Cast.ctor): Check void cast.
889         (Binary.ResolveAsTypeTerminal): Is never type.
890         (Conditional.ResolveAsTypeTerminal): Is never type.
891
892         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
893
894 2006-03-01  Raja R Harinath  <rharinath@novell.com>
895
896         Fix #77679.
897         * expression.cs (ParameterReference.DoResolveBase): Change return
898         type to bool.
899         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
900         Update.
901
902         Fix #77628.
903         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
904
905         Fix #77642.
906         * typemanager.cs (GetFullNameSignature): Don't nullref on
907         protected accessors.
908
909 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
910
911         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
912         these two separated members to simplify the code.
913         (Attribute.Resolve): Refactored to use new fields and methods.
914         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
915         implemented obsolete attribute checking.
916         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
917         implemented obsolete checking again. It look line never ending quest ;-)
918         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
919
920         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
921
922         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
923
924         *class.cs (Property.Define): Add RegisterProperty call.
925
926         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
927         argument groups (only 2).
928
929         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
930         encoding expression to arguments.
931         (Expression.ExprClassToResolveFlags): Just turned to property.
932
933         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
934         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
935         optimized as well as implemented support for zero-length attributes.
936
937         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
938         Add caching of PropertyInfo's.
939
940 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
941
942         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
943         error multiple times.
944
945 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
946
947         New partial class implementation.
948         A fix for #77027, #77029, #77403
949
950         * attribute.cs (Attributable): Made attributes protected.
951
952         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
953         the replacements of ClassPart and PartialContainer.
954         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
955         (TypeContainer.AddInterface): Ditto.
956         (TypeContainer.AddPartial): The main method for partial classes. It checks
957         for errors and merges ModFlags and attributes. At the end class is added to
958         partial_parts list.
959         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
960         required here.
961         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
962         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
963         from the rest of partial classes.
964         (TypeContainer.GetClassBases): Simplified.
965         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
966         DefineType.
967         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
968         (TypeContainer.HasExplicitLayout): Uses Flags now.
969         (PartialContainer): Removed.
970         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
971         (StaticClass): Was merged with Class.
972         (Class.GetClassBases): class and static class bases are verified here.
973         (Class.TypeAttr): Added static attributes when class is static.
974         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
975         (MemberBase): In some cases we need to call parent container for partial
976         class. It should be eliminated but it's not easy now.
977
978         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
979
980         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
981         partial classed to accumulate class comments.
982         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
983
984         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
985
986         * driver.cs (MainDriver): Tree.GetDecl was removed.
987
988         * modifiers.cs (Modifiers): Add partial modifier.
989
990         * tree.cs (Tree.decl): Removed.
991         (RootTypes): Started to use this class more often for root types
992         specializations.
993
994 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
995
996         A fix for #77615
997
998         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
999         external interface does not have an attribute.
1000
1001 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1002
1003         Another prerequisites for new partial classs implementation.
1004         
1005         * attribute.cs (Attribute.Equal): Implemented.
1006         (Attribute.Emit): Changed as attributes can be applied more than twice.
1007         (Attributes.Emit): Check for duplicate attributes here.
1008
1009         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1010         as a parameter, clean-up.
1011
1012 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1013
1014         A fix for #77485
1015
1016         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1017         contains obsolete attribute check which can in some cases look for base
1018         type of current class which is not initialized yet.
1019         (TypeContainer.BaseType): Replacement of ptype.
1020
1021         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1022
1023 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1024
1025         First of prerequisites for new partial classs implemention.
1026         
1027         * attribute.cs (Attributable): Extended by ResolveContext;
1028         Attributes finally have correct context for resolving in all cases.
1029         (AttachTo): Attribute owner is assigned here.
1030
1031         * codegen.cs (IResolveContext): Introduce new interface to hold
1032         all information needed in resolving phase.
1033         (EmitContext): Implements IResolveContext; more clean-up needed here.
1034         
1035         * decl.cs (MemberCore): Implemented IResolveContext.
1036
1037         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1038         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1039         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1040         Refactored to use new IResolveContext instead of EmitContext; cleanup
1041
1042 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1043
1044         * codegen.cs (EmitScopeInitFromBlock): check here the
1045         capture_context, there is no need to make two calls to the
1046         EmitContext. 
1047
1048         * anonymous.cs: Add some debugging messages that might help me
1049         track other instances of this problem in the future (the
1050         regression of test 467).
1051
1052         * cs-parser.jay: track the variable block, as we need to initalize
1053         any captured variables declared in this block for the "catch"
1054         portion of the "Try" statement.
1055
1056         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1057         scope initialization for captured variables. 
1058
1059         Also, move the emit for the variables after the block location has
1060         been marked.
1061
1062 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1063
1064         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1065
1066 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1067
1068         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1069         commit yesterday, the initialization for the roots is necessary.
1070         What is not necessary is the scope activation.
1071
1072 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1073
1074         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1075         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1076         CS0206 checks.
1077         (Argument.Resolve): Remove CS0206 checks.
1078
1079 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1080
1081         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1082         scopes for all the roots, the scopes will now be emitted when the
1083         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1084
1085         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1086         code.  This reduces a lot of existing cruft.
1087         
1088         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1089         that the ScopeInfo is generated as we enter the scope, not at the
1090         time of use, which is what we used to do before.
1091
1092         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1093         every time a Block is about to be emitted if we have a
1094         CaptureContext. 
1095
1096 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1097
1098         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1099         (Reset): Update.
1100         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1101
1102         * typemanager.cs (cons_param_array_attribute): Make private.
1103         (Reset): Set it to null.
1104         (InitCoreHelpers): Don't initialize it.
1105         (ConsParamArrayAttribute): New.  Initialize it as needed.
1106         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1107
1108 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1109
1110         * expression.cs: There might be errors reported during the
1111         selection of applicable methods.  If there are errors, do not
1112         continue execution as it will lead the compiler to crash.
1113
1114 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1115
1116         * expression.cs: Member access is not allowed on anonymous
1117         methods.  Fixes #77402.
1118
1119 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1120
1121         Fix #77401
1122         * cs-parser.jay (VariableDeclaration): Don't set
1123         current_array_type to null.
1124         (field_declaration, event_declaration, declaration_statement):
1125         Set it to null here.
1126
1127 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1128
1129         * typemanager.cs (GenericParameterPosition): New.
1130         * doc.cs: Use it.
1131
1132 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1133
1134         * doc.cs : To process "include" elements, first we should create
1135           another list than XmlNodeList, because it could result in node
1136           removal, which could result in that the XmlNodeList gives up
1137           yielding next node.
1138
1139           (Also made code identical to gmcs again.)
1140
1141 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1142
1143         * ecore.cs: Introduce an error report that we were not catching
1144         before, if not silent, we must report the error.  Gonzalo ran into
1145         it.
1146
1147 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1148
1149         A fix for bug: #76957
1150         
1151         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1152         ComputeMethodHost before creating the method, this is a new
1153         requirement. 
1154
1155         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1156         that this method references (RegisterScope).  The actual scope
1157         where the method is hosted is computed with the ComputeMethodHost
1158         before we create the method.
1159
1160         Moved the Deepest routine here.
1161
1162         (AnonymousContainer.ComputeMethodHost): New routine used to
1163         compute the proper ScopeInfo that will host the anonymous method.
1164
1165         (ScopeInfo): Deal with multiple roots.  The problem was that we
1166         did not have a unique root where all ScopeInfos could be hanged
1167         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1168         of roots.  
1169
1170         Remove AdjustMethodScope which is now computed at the end.  Remove
1171         LinkScope which did a partial link, instead link all ScopeInfos
1172         before code generation from the new "LinkScopes" routine. 
1173
1174         Simplify all the Add* routines as they no longer need to maintain
1175         the tree, they just need to record that they are using variables
1176         from a ScopeInfo.
1177
1178         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1179         routines to produce the forest of ScopeInfo trees.
1180
1181         * class.cs (TypeContainer.AppendMethod): This is just like
1182         AddMethod, but ensures that an interface implementation method
1183         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1184         methods, but at the end.
1185
1186         We use this functionality to ensure that the generated MoveNext
1187         method in the iterator class is resolved/emitted before the
1188         enumerator methods created.   
1189
1190         This is required because the MoveNext method computes the right
1191         ScopeInfo for the method.  And the other methods will eventually
1192         need to resolve and fetch information computed from the anonymous
1193         method. 
1194
1195 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1196             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1197
1198         Fix rest of #76995.
1199         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1200         the 'aliases' hash.
1201         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1202         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1203
1204 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1205
1206         Fix #76656, cs0231-2.cs.
1207         * cs-parser.jay (formal_parameter_list): Make error case catch
1208         more issues.
1209         (parenthesized_expression_0): Add CS1026 check.
1210         (invocation_expression): Remove unused { $$ = lexer.Location }.
1211
1212 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1213
1214         Fix #76824.
1215         * cs-parser.jay (statement_expression): Don't list out the
1216         individual statement-expressions.  Convert syntax error into
1217         CS0201 check.
1218
1219 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1220
1221         Fix #76874.
1222         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1223         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1224         CheckIntermediateModification.
1225         (FieldExpr.DoResolve): Add new two-argument version that
1226         allows us to resolve the InstanceExpression as an lvalue.
1227         The one-argument variant is now just a wrapper.
1228         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1229         Resolve the lhs as an lvalue if the it has a value type.
1230         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1231         from Assign.DoResolve.
1232         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1233         resolved as an lvalue.
1234         (PropertyExpr.DoResolve): Update.
1235         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1236         has a value type.  Move CS1612 check here from
1237         CheckIntermediateModification.
1238         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1239         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1240         'right_side' of a ResolveLValue on an 'out' argument.
1241         (EmptyExpression.LValueMemberAccess): New.  Used as the
1242         'right_side' of a propagated ResolveLValue on a value type.
1243         (LocalVariableReference.DoResolveBase): Recognize
1244         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1245         Add CS1654 check.
1246         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1247         EmptyExpression.Null.
1248
1249 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1250
1251         * typemanager.cs : added IsGenericParameter(). In mcs it always
1252           return false.
1253         * doc.cs : for generic parameters, use GenericParameterPosition,
1254           not FullName.
1255
1256 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1257
1258         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1259
1260 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1261
1262         This fixes the problem where we used ldfld instead of ldflda to
1263         load the "THIS" pointer on captured parameters, when THIS is a
1264         value type.  See bug #77205.
1265         
1266         * iterators.cs (CapturedThisReference.Emit): Pass false to
1267         EmitThis (we do not need the address).
1268
1269         * codegen.cs (EmitThis): it needs to know whether we need the
1270         address of `this' or not.  This is used by value types.  
1271
1272         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1273         every other call passes false.
1274
1275 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1276
1277         Fix #77221.
1278         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1279         GetOverride.
1280         * expression.cs (Invocation.OverloadResolve): Update.
1281         (Invocation.DoResolve): Avoid double resolution of invocation.
1282
1283 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1284
1285         Fix #77180.
1286         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1287         unary negation of floating point types as 0-expr; negation cannot
1288         overflow in floating point types.
1289
1290         Fix #77204.
1291         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1292         on operands of 'void' type.
1293
1294         Fix #77200.
1295         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1296         and ExclusiveOr for boolean constants too.
1297
1298 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1299
1300         Fix #75636.
1301         * expression.cs (Invocation.OverloadResolve): Replace reflected
1302         override methods with their base virtual methods, rather than
1303         skipping over them.
1304         * typemanager.cs (TypeManager.GetOverride): New.
1305
1306 2006-01-05  Jb Evain  <jbevain@gmail.com>
1307
1308         * class.cs (Property.Define, Indexer.Define): do not tag the
1309         properties as SpecialName | RTSpecialName.
1310
1311 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1312
1313         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1314         doing a low-level comparission of parameter types.  It was lacking
1315         a check for __argslist. 
1316
1317 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1318
1319         * expression.cs (ParameterReference.DoResolveBase): Allow
1320         reference parameters if they are local to this block. 
1321
1322         This allows the ref and out parameters of a delegate to be used in
1323         an anonymous method, for example:
1324
1325         delegate void set (out int x);
1326
1327         set s = delegate (out int x){
1328                 x = 0;
1329         };
1330
1331         This is used by functionality introduced late in the C# language.
1332         
1333         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1334         method that take ref and out parameters. 
1335
1336         Fixes #77119 which was a late change in the spec.
1337
1338 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1339
1340         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1341         parent if its the same scope.  Fixes #77060.
1342
1343 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1344
1345         * driver.cs: Report the case of no source files and no -out:
1346         argument provided.
1347
1348 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1349
1350         Fix #77035.
1351         * expression.cs (ComposedCast.GetSignatureForError): Define.
1352
1353 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1354
1355         Fix #76995
1356
1357         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1358         ListDictionary, to contain the ExternAliasEntry entries (in
1359         addition to the NamespaceEntry.aliases hashtable). This field is
1360         shared between the original entry and its doppelganger (bodyless 
1361         copy of it).
1362         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1363         extern_aliases field.
1364         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1365         lookup in extern_aliases.
1366
1367 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1368
1369         Fix #77006.
1370         * class.cs (TypeContainer.Mark_HasEquals): New.
1371         (TypeContainer.Mark_HasGetHashCode): New.
1372         (ClassPart): Override them.
1373         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1374
1375         Fix #77008.
1376         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1377         'parent' argument to the base constructor.
1378
1379         Remove all mention of TypeContainer from decl.cs.
1380         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1381         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1382         (DeclSpace.DeclSpace): Likewise.
1383         (DeclSpace.DefineMembers): Remove unused argument.
1384         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1385         debugging check -- we don't care if the debug code throws an
1386         InvalidCastException instead of an InternalErrorException.
1387         * class.cs (TypeContainer.DefineMembers): Update to changes.
1388         (TypeContainer.DoDefineMembers): Likewise.
1389         (TypeContainer.GetMethods): Likewise.
1390         (PropertyMember.Define): Likewise.
1391         (MemberBase.Parent): New property that forwards to
1392         MemberCore.Parent, but ensures that we get a TypeContainer.
1393         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1394         (RootContext.PopulateTypes): Likewise.  Remove special case code
1395         for !RootContext.StdLib: DefineMembers is idempotent.
1396
1397 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1398
1399         * convert.cs (ExplicitConversionCore): Check the return value from
1400         ExplicitConversionCore which can return null on failure.  Fixes #76914
1401
1402 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1403
1404         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1405
1406 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1407
1408         * doc.cs : The search for referenced namespace was insufficient to
1409           get global one as it used to do. Fixed bug #76965.
1410
1411 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1412
1413         * doc.cs : check name in cref in the last phase that whether it is
1414           namespace or not.
1415
1416 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1417
1418         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1419           Mono.C5.
1420
1421 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1422
1423         * doc.cs : so it turned out that we cannot skip override check for 
1424           interface members. Fixed bug #76954.
1425
1426 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1427
1428         * cs-tokenizer.cs : fixed bug #75984:
1429           - #warning and #error should not be handled when the source line
1430             is disabled.
1431           - #line is not checked strictly when the source line is disabled.
1432           - #define and #undef is on the other hand checked strictly at any
1433             state.
1434
1435 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1436
1437         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1438           CS1027 report.
1439
1440 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1441
1442         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1443
1444         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1445         event initializers.
1446         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1447         (FieldBase.Initializer): Initializer is now optional.
1448         (EventField.Define): Only event field can have initializer.
1449
1450         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1451
1452         * const.cs (Const): Reuse initializer.
1453
1454         * cs-parser.jay: Updated after FieldBase changes.
1455         Added current_array_type to simplify array initializers.
1456
1457         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1458
1459         * expression.cs, iterators.cs: Updated.
1460
1461         * namespace.cs (NamespaceEntry): Made UsingFound private.
1462
1463 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1464
1465         * parameterCollection.cs: Obsolete, removed.
1466         * parser.cs: Obsolete, removed.
1467
1468 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1469
1470         Fix #76849.
1471         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1472
1473         * enum.cs (Enum.Define): Set obsolete context here.
1474
1475 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1476
1477         * doc.cs :
1478           - FindDocumentedMember() now expects 1) paramList as null
1479             when "we don't have to check the number of parameters" and
1480             2) Type.EmptyTypes when "there is no arguments".
1481           - Introduced FoundMember struct to hold the exact type which was
1482             used to find the documented member (the above change broke
1483             test-xml-044; it might be better just to use DeclaringType than
1484             what MS does, like this change does, but it depends on usage.)
1485
1486 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1487
1488         * doc.cs : documented member might be from DeclaringType for nested
1489           types. Fixed bug #76782.
1490
1491 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1492
1493         * anonymous.cs: Have the param code handle leaving copies on the
1494         stack etc. Allows anonymous params to take part in the assignment
1495         code (++, +=, etc). Fixes bug #76550
1496
1497         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1498         it down to the anon code.
1499
1500         * iterators.cs: Use dummy var here
1501
1502         * codegen.cs: Handle new vars
1503
1504 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1505
1506         Fix #76849.
1507         * class.cs (MethodData.Define): Set proper Obsolete context.
1508
1509         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1510         obsolete context.
1511         (FieldExpr.DoResolve): Ditto.
1512
1513 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1514
1515         Fix #76849.
1516         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1517         parent is not obsolete.
1518
1519 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1520
1521         * doc.cs : (FindDocumentedMember) find parameterless members first
1522           and get CS0419 in the early stage. Fixed first case of bug #76727.
1523
1524 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1525
1526         Fix #76859.
1527         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1528         no error was reported.
1529
1530         *expression.cs (Binary.DoResolve): left can be null.
1531
1532 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1533
1534         Fix #76783.
1535         * class.cs (MethodData.Emit): Parameters should be labeled first.
1536
1537 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1538
1539         Fix #76761.
1540         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1541
1542 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1543
1544         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1545
1546         * class.cs (MethodCore): Parameter clean up.
1547         (IMethodData): Added ParameterInfo.
1548         (MethodData): Parameter clean up.
1549         (Indexer.Define): Parameter clean up.
1550
1551         * anonymous.cs,
1552         * codegen.cs,
1553         * cs-parser.jay,
1554         * decl.cs,
1555         * doc.cs,
1556         * ecore.cs,
1557         * flowanalysis.cs,
1558         * iterators.cs,
1559         * pending.cs,
1560         * statement.cs,
1561         * typemanager.cs: Parameter clean up.
1562
1563         * delegate.cs (Define): Get rid of duplicated code.
1564
1565         * expression.cs (ParameterReference): Removed useless parameters
1566         and simplified.
1567         (Invocation): Ditto.
1568
1569         * parameter.cs (ParamsParameter): New class, params specialization.
1570         (ArglistParameter): Attemp to separate arglist.
1571         (Parameter): Refactored to be reusable and faster.
1572         (Parameter.Modifier): Made understandable.
1573         (Parameters): Changed to be used as a class for `this' assembly
1574         parameters. Refactored to use new specialized classes.
1575
1576         * support.cs (ParameterData): Added Types property.
1577         (InternalParameters): Deleted.
1578
1579 2005-08-20  Martin Baulig  <martin@ximian.com>
1580
1581         Merging this patch from GMCS to fix #75867.
1582
1583         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1584         scope if we don't already have it.
1585
1586 2005-11-17  Martin Baulig  <martin@ximian.com>
1587
1588         * anonymous.cs
1589         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1590         inherit the scope from our parent.  Fixes #76653.
1591
1592 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1593
1594         * doc.cs : the previous patch does not actually fix the bug.
1595           PropertyInfo override check is now implemented and really fixed it.
1596         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1597
1598 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1599
1600         * doc.cs : apply "override filter" also to properties.
1601           Fixed bug #76730.
1602
1603 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1604
1605         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1606           no need to check overrides. For classes, omit those results from 
1607           interfaces since they must exist in the class. Fixed bug #76726.
1608
1609 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1610
1611         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1612           with different parameters. Fixed the second problem in #76685.
1613
1614 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1615
1616         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1617           get expected 'protected' access in CheckValidFamilyAccess()).
1618           Fixed bug #76692.
1619
1620 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1621
1622         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1623           Fixed bug #76705.  CS1569 was incorrectly commented out.
1624
1625 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1626
1627         * doc.cs : use Invocation.IsOverride() to do real override check.
1628         * expression.cs : made Invocation.IsOverride() internal.
1629
1630 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1631
1632         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1633           TypeBuilder.FindMembers() and filter overriden base members out.
1634           Fixed bug #76990.
1635
1636 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1637
1638         * doc.cs : ref/out parameters are represented as '@' (instead of
1639           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1640
1641 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1642
1643         * doc.cs : when there was no '.' in cref to methods in doc comment,
1644           then parameters were missing in the output. Fixed bug #76691.
1645
1646 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1647
1648         * driver.cs : don't output docs when there is an error.
1649           Fixed bug #76693.
1650
1651 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1652
1653         * doc.cs :
1654           Now it should detect indexers. Fixed primary concern in bug #76685.
1655           Fixed CS0419 message to not show the identical member signature in
1656           the message.
1657
1658 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1659
1660         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1661           instead of Type.FindMembers() since it does not handle events.
1662           Fixed bug #71604.
1663
1664 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1665
1666         * codegen.cs: Fixed typo (speficied -> specified).
1667
1668 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1669
1670         Fix #76369.
1671         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1672
1673 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1674
1675         * attribute.cs: Changed error message.
1676
1677         * cs-tokenizer.cs: One more check.
1678
1679 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1680
1681         * statement.cs (Block.Resolve): Ignore empty statement.
1682
1683 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1684
1685         * report.cs: Made error/warning methods more strict to avoid
1686         their misuse.
1687
1688         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1689         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1690         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1691         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1692
1693 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1694
1695         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1696         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1697
1698         * class.cs (TypeContainer.IsComImport): New property.
1699         (Constructor.Define): Create proper ctor for ComImport types.
1700
1701         * expression.cs (New.CheckComImport): Fixed.
1702
1703 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1704
1705         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1706         that a parameter has been captured does not mean that we do not
1707         have to do the rest of the processing.  This fixes the second part
1708         of #76592.  If there was another anonymous method capturing
1709         values in the past, the Scope would never be set for the second
1710         method that captured the same parameter.
1711
1712         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1713         properly manipulate the stack.   Second part of fix for #76592.
1714
1715         * expression.cs (New): Add support for invoking "new" on
1716         interfaces that have been flagged with the ComImport attribute and
1717         the CoClass.  Fixes #76637 
1718
1719         * statement.cs (Try.DoEmit): When a variable is captured, do not
1720         try to emit the vi.LocalBuilder variable as it has been captured.
1721         Create a temporary variable and store the results on the
1722         FieldBuilder.  Fixes #76642
1723
1724 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1725
1726         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1727
1728         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1729
1730         * expression.cs (Binary.DoResolve): Added && optimalization.
1731     
1732         * typemanager.cs (AddUserType): Removed useless argument.
1733
1734 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1735
1736         * statement.cs (Block.variables): Uses ListDictionary.
1737
1738 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1739
1740         Fix #75969.
1741         * class.cs (PartialContainer.EmitType): Customized to emit
1742         security attributes.
1743         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1744         for partial classes.
1745
1746 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1747
1748         Fix #76599.
1749         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1750         access has to be fixed.
1751         
1752         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1753
1754 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1755
1756         Fix #76590.
1757         * ecore.cs (NullCast.Reduce): Implemented.
1758
1759         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1760         constant type.
1761         
1762         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1763         properly.
1764         (Foreach.Resolve): Catch null properly.
1765
1766 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1767  
1768         * cs-tokenizer.cs: Warning text fix.
1769
1770         * driver.cs: AllWarningNumbers exposed on public interface.
1771
1772         * report.cs (): Reviewed warning numbers.
1773         (IsValidWarning): Use binary search.
1774
1775 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1776  
1777         * driver.cs: Implemeted resource visibility.
1778         (Resources): New class for code sharing between /res: and
1779         /linkres:
1780  
1781 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1782
1783         Fix #76568.
1784         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1785         folding.
1786         
1787         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1788         contants only.
1789         
1790         * ecore.cs (NullCast): Child is contant only.
1791         
1792         * literal.cs (NullLiteral.Reduce): null can be converted to any
1793         reference type.
1794
1795 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1796
1797         * driver.cs: Use Encoding.Default as default code page instead
1798           of ISO-28591.
1799
1800 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1801
1802         Fix #76085.
1803         * expression.cs (Invocation.Error_InvalidArguments): Handle
1804         __arglist parameters.
1805         (Invocation.VerifyArgumentsCompat): Likewise.
1806         * support.cs (ReflectionParameters.GetSignatureForError): Print
1807         __arglist parameters.
1808         (InternalParamters.GetSignatureForError): Likewise.
1809         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1810
1811 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1812
1813         * attribute.cs (GetPropertyValue): Made public.
1814
1815         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1816         Resolve.
1817         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1818         attribute.
1819         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1820         is not defined.
1821         
1822         * driver.cs: Reflect method name change.
1823         
1824         * statement.cs (Try.Resolve): Warn when try has both general
1825         exception handlers.
1826         
1827         * typemanager.cs: runtime_compatibility_attr_type new predefined
1828         type.
1829
1830 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1831
1832         Fix #76419.
1833         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1834         treat it as an empty parameter list.
1835
1836 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1837
1838         Fix #76271.     
1839         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1840         ResolveAsTypeStep silent.
1841         * statement.cs (Block.AddConstant): Mark block as used.
1842         (Block.ResolveMeta): Avoid piling on error messages
1843         if a constant initializer resolution fails.
1844
1845 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1846
1847         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1848         Remove.
1849         (NamespaceEntry.VerifyAllUsing): New.
1850         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1851         behaviour.  Delegates actual resolution of alias to ...
1852         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1853         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1854         Update.
1855         * driver.cs (Driver.MainDriver): Update.
1856         
1857         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1858         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1859         property.
1860         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1861         Remove.
1862         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1863         RootNamespace.DefineNamespacesForAll.
1864
1865 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1866
1867         * typemanager.cs (assemblies, external_aliases, modules)
1868         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1869         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1870         overhead.  Move resposibility ...
1871         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1872         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1873
1874 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1875
1876         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1877         cached_namespaces.  Improve usage.
1878         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1879         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1880         Move from GlobalRootNamespace and simplify.
1881         (RootNamespace.Global): Make instance variable.
1882         (RootNamespace.RootNamespace): Add "alias name" parameter.
1883         (GlobalRootNamespace): Simplify drastically.
1884         (Namespace.Lookup): Don't use GetNamespace.
1885         * typemanager.cs (GetRootNamespace): Rename from
1886         ComputeNamespaceForAlias.
1887         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1888
1889 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1890
1891         * anonymous.cs (AnonymousContainer): Don't crash when container
1892         doesn't exist.
1893
1894 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1895
1896         * expression.cs (Binary.DoResolve): Warn when comparing same
1897         values.
1898
1899 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1900
1901         Fix #76486.
1902         * expression.cs (Binary.DoResolve): It looks like there are no
1903         convetsion rules in enum context.
1904
1905 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1906
1907         Add support for extern alias qualifiers.
1908         * typemanager.cs: Move some LookupTypeReflection code
1909         to namespace.cs, to have cleaner code. Added some methods
1910         to help us keep track of the extern aliased references.
1911         * driver.cs: Add suport for extern alias assemblies on command
1912         line and check for their warnings/errors. Also keep track of the
1913         extern aliased assemblies.
1914         * namespace.cs: Move the global functionality of Namespace
1915         to GlobalRootNamespace/RootNamespace. Now the global namespace
1916         is GlobalRootNamespace.Globa. Also the code moved from 
1917         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1918         Finally added LocalAliasEntry (AliasEntry before) and
1919         ExternAliasEntry, to handle alias statements.
1920         * cs-parser.jay: Add support in the grammar for extern alias
1921         statement.
1922         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1923         Update callings to Namespace (now in GlobalRootNamespace).
1924
1925 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1926
1927         Fix #76371.
1928         * class.cs (TypeContainer.DefineType): Move updating of
1929         topological sort earlier in the code.
1930         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1931
1932 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1933
1934         Fix #76273.
1935         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1936         
1937         * constant.cs (Constant.TryReduce): Moved from Cast class.
1938         (Reduce): Made little bit more OO and fixed missing conversions.
1939         
1940         * ecore.cs (Reduce): Implemented.
1941         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1942         
1943         * literal.cs (Reduce): Implemented.
1944         
1945         * class.cs: Reverted Miguel's wrong commit.
1946
1947 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1948
1949         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1950
1951 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1952
1953         * cs-parser.jay, expression.cs : CS0214 was missing error location
1954           for constants. Fixed bug #76404.
1955
1956 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1957
1958         Fix #76370.
1959         * convert.cs (ExplicitConversionCore): Fixed object->enum
1960         conversion.
1961
1962 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1963
1964         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1965         InstanceExpression.
1966         (PropertyExpr.EmitCall): Likewise.
1967         * expression.cs (Invocation.EmitArguments): Handle case where
1968         arguments == null.
1969         (Invocation.EmitCall): Avoid allocating temporary variable if
1970         there are no arguments.
1971
1972 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1973
1974         Fix #76323.
1975         * convert.cs (ImplicitConversionStandard): Move conversion of
1976         void* to arbitrary pointer types ...
1977         (ExplicitConversionStandard): .. here.
1978         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1979         error to always print typenames.
1980
1981 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1982
1983         * convert.cs (GetConversionOperator): Rename from
1984         GetConversionOperators.  Move operator selection code from ...
1985         (UserDefinedConversion): ... here.
1986
1987 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1988
1989         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1990         conversion.
1991
1992 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1993
1994         * assign.cs (Assign.DoResolve): Error method changed.
1995
1996         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1997         
1998         * const.cs (ResolveValue): Reset in_transit immediately.
1999         
2000         * constant.cs: Error method changed.
2001         
2002         * convert.cs: Removed useless location parameter.
2003         (ExplicitNumericConversion): Don't do double enum check.
2004         (ExplicitConversionCore): Renamed from ExplicitConversion.
2005         (ExplicitUnsafe): Extracted from ExplicitConversion.
2006         (ExplicitConversion): Uses for error reporting.
2007         
2008         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2009         error messages.
2010         (ResolveBoolean): Uses common error method.
2011         (CastToDecimal): Get rid of ec.
2012         (CastFromDecimal): Optimized.
2013         (ConvCast): Get rid of ec.
2014         
2015         * enum.cs (ResolveValue): Reset in_transit immediately.
2016         (Emit): Return after first error.
2017         
2018         * expression.cs: Convert changes.
2019         
2020         * literal.cs: Error method changed.
2021         
2022         * statement.cs: Error method changed.
2023
2024 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2025
2026         * support.cs (SeekableStreamReader.Position): Don't error out when
2027         the requested position is just beyond the end of the current
2028         buffered data.
2029
2030 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2031
2032         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2033         try to keep in sync with the byte count of the underlying Stream.
2034         However, this limits us to a window size of 2048 characters: i.e.,
2035         the maximum lookahead of our lexer/parser can be 2048 characters.
2036
2037 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2038
2039         Fix #76255.
2040         * driver.cs: Fix compilation files with full root path.
2041
2042 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2043
2044         * report.cs (SymbolRelatedToPreviousError): Format the output so
2045         it does not use an open parenthesis that is never closed. 
2046
2047         * driver.cs: Follow coding guidelines
2048
2049 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2050
2051         Fix #72930.
2052         * const.cs (Const.ResolveValue): Check for assigning non-null
2053         value to reference type.
2054
2055 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2056
2057         * anonymous.cs: Implemented ExprClassName.
2058         
2059         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2060         delegate.
2061         
2062         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2063         check.
2064         
2065         * class.cs (StaticClass.DefineContainerMembers): Report protected
2066         members as error.
2067         
2068         * codegen.cs: if(ed) PRODUCTION.
2069         
2070         * convert.cs (Error_CannotImplicitConversion): Better error
2071         distinction.
2072         
2073         * cs-parser.jay: More error checks.
2074         
2075         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2076         
2077         * driver.cs (CSCParseOption): Enabled wrong option check.
2078         
2079         * ecore.cs (Expression.ExprClassName): Turned to property.
2080         (MemberExpr.CheckIntermediateModification): For checking boxed
2081         value types     modification.
2082         
2083         * statement.cs (Fixed.Resolve): Expression type must be
2084         convertible to fixed type.
2085         (CollectionForeach.GetEnumeratorFilter,TryType):
2086         Small refactoring for easier error checking.
2087
2088 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2089
2090         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2091         attributes.
2092         
2093         * class.cs (GeneratedBaseInitializer): New class for customization
2094         compiler generated initializers.
2095         (MemberBase.DoDefine): Check Obsolete attribute here.
2096         (FieldMember.DoDefine): Ditto.
2097         
2098         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2099         constants.
2100         
2101         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2102         (MemberCore.GetObsoleteAttribute): Removed argument.
2103         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2104         (MemberCore.CheckObsoleteType): New helper.
2105         
2106         * delegate.cs,
2107         * enum.cs,
2108         * statement.cs: Updates after MemberCore changes.
2109         
2110         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2111         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2112         
2113         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2114         obsolete attribute for compiler construct.
2115         (As.DoResolve): Cache result.
2116         
2117         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2118
2119 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2120
2121         Fix #76133.
2122         * expression.cs (This.VerifyFixed): In a value type T, the type of
2123         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2124         value type R, 'this' is treated as a value parameter.
2125
2126 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2127
2128         * statement.cs (Lock): Use the TemporaryVariable class instead of
2129         manually using local variables as those do not work when variables
2130         are captured.
2131
2132         * ecore.cs: Moved the TemporaryVariable class from being a nested
2133         class inside Foreach to be a public class that can be employed in
2134         other places. 
2135
2136 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2137
2138         * cs-parser.jay: interface_accessors replaced by
2139         accessor_declarations.
2140
2141         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2142         location.
2143         
2144         * statement.cs (GotoCase.Resolve): Convert null constant to
2145         null case.
2146         (SwitchLabel.ResolveAndReduce): Ditto.
2147         (SwitchLabel.NullStringCase): Custom null stamp.
2148         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2149         
2150         typemanager.cs (CSharpSignature): Don't skip first argument
2151         for full names.
2152
2153 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2154
2155         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2156
2157         * location.cs (InEmacs): in this mode, do not report column
2158         location as it confuses Emacs.
2159
2160 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2161
2162         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2163         expression.cs, iterators.cs, literal.cs: Store constants and
2164         literals location.
2165         
2166         * class.cs (MemberBase.ShortName): Pass location.
2167         
2168         * cs-parser.jay: Some location fixes.
2169         
2170         * ecore.cs (Expression.Location): Made virtual.
2171
2172 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2173
2174         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2175         if the underlying types are the same, otherwise we need to produce
2176         code that will do the proper cast.
2177
2178         This was exposed by Marek's constant rewrite which produced
2179         invalid code for the call site:
2180
2181         enum X : long { a }
2182         void Method (X v) {}
2183
2184         Method ((X) 5)
2185
2186         This fixes test-49.cs
2187
2188 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2189
2190         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2191           Type/Object should be allowed as well. Fixed bug #75968.
2192
2193 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2194
2195         * expression.cs : (Binary.DoResolve): when one is enum constant and
2196           another is constant 0, then return enum one *as enum type*.
2197           Fixed bug 74846.
2198
2199 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2200
2201         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2202         internal.
2203
2204         Fix #75941.
2205         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2206         flow-branching for LocalVariableReferences in case we were invoked
2207         from a MemberAccess.
2208         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2209         Carved out of ...
2210         (LocalVariableReference.DoResolveBase): ... this.
2211         (MemberAccess.Resolve): Do the check that was disabled during
2212         SimpleNameResolve.
2213
2214 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2215
2216         * class.cs :
2217           (PartialContainer.Create): check abstract/sealed/static strictly
2218           but abstract/sealed can exist only at one side. Fixed bug #75883.
2219
2220 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2221
2222         Fix #75945.
2223         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2224         specified, don't default to UnmanagedType.I4.
2225
2226 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2227
2228         * expression.cs : conditional operator should check possibly
2229           incorrect assign expression. Fixed bug #75946.
2230
2231 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2232
2233         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2234           Reverting the change. gmcs is much complex than mcs on this matter.
2235
2236 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2237
2238         * cs-tokenizer.cs : To read another token ahead of the actual 
2239           consumption, use new SavedToken and cache token instead of moving
2240           back the stream with SeekableStreamReader (it seemed problematic).
2241         * cs-parser.jay,
2242           driver.cs : Thus use StreamReader directly.
2243         * support.cs : Thus removed SeekableStreamReader.
2244
2245 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2246
2247         Fix #75934.
2248         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2249         (ScopeInfo.EmitScopeType): Use it to construct field names from
2250         names of captured locals.
2251
2252         Fix #75929.
2253         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2254         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2255         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2256         (ExplicitConversion): Remove enum cases already handled by
2257         implicit conversion.  Move implicit conversion check to the beginning.
2258         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2259         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2260         Don't treat System.Enum as a struct.
2261
2262 2005-08-30  Jb Evain  <jbevain@gmail.com>
2263
2264         * attribute.cs: handles as expression in parameters.
2265
2266 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2267
2268         Fix #75802.
2269         * class.cs (TypeContainer.VerifyClsName): Don't use a
2270         PartialContainer when verifying CLS compliance.
2271         (AbstractPropertyEventMethod): Set Parent here, ...
2272         (PropertyMethod): ... not here.
2273
2274 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2275
2276         * attribute.cs : escaped attribute name should not be allowed to be
2277           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2278
2279 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2280
2281         Fix #75927.
2282         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2283         when converting a long constant to unsigned long.
2284         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2285         detect where IsApplicable and VerifyArgumentsCompat disagree.
2286
2287 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2288         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2289
2290         Fix #75848.
2291         * class.cs (TypeContainer.CanElideInitializer): New helper.
2292         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2293         can safely emitting the initializer of a field.
2294
2295 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2296
2297         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2298           allowed inside a switch (without loop). Fixed bug #75433.
2299
2300 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2301
2302         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2303         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2304
2305 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2306
2307         * driver.cs : kinda reverting the default encoding changes (not exact 
2308           revert since I noticed that "codepage:reset" might not work fine).
2309
2310 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2311
2312         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2313           Location. Now getter and setter store location correctly.
2314           (errors/cs0111-12.cs now reports the expected location.)
2315
2316 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2317
2318         * driver.cs : Use default encoding on the environment.
2319           Removed (now that) extra parameter for SeekableStreamReader.
2320         * support.cs : (SeekableStreamReader) third .ctor() argument for
2321           StreamReader is not required (always true). preamble size could
2322           be acquired in simpler and safe way.
2323
2324 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2325
2326         * cs-parser.jay: report CS0642 at warning level 3
2327           and report CS0642 for an if else statement also
2328           fixes bug #74745. Patch by John Luke (and a bit
2329           modified by me).
2330           Removed extra CS0642 warning check for "while",
2331           "for" and "fixed".
2332         * statement.cs: In Block.Resolve(), CS0642 check
2333           is reimplemented to check a sequence of an empty
2334           statement and a block.
2335
2336           Both fix bug #66777.
2337
2338 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2339
2340         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2341         detection until I fix it.
2342         
2343         * cs-tokenizer.cs: Changed error message.
2344         
2345         * cs-parser.jay: Fixed 2 error locations.
2346         
2347         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2348         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2349         properties.
2350         
2351         * enum.cs (GetSignatureForError): Fixed.
2352         
2353         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2354         method detection.
2355         
2356         * class.cs,
2357         * typemanager.cs (RegisterProperty): Removed.
2358         
2359         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2360
2361 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2362
2363         Fix #75874.
2364         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2365         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2366
2367 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2368
2369         * expression.cs : tiny fix is required for not warning positive ulong.
2370           See test-441.cs.
2371
2372 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2373
2374         * expression.cs : add CS0652 check for constant and integral
2375           expression. Fixed bug #53974.
2376
2377 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2378
2379         * expression.cs : in DoNumericPromotions(), check if there is implicit
2380           conversion overload for string (to check CS0034). Fixed bug #52492.
2381
2382 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2383
2384         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2385
2386 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2387
2388         * ecore.cs : report location when it is *not* Null.
2389
2390 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2391
2392         * codegen.cs,
2393           ecore.cs,
2394           flowanalysis.cs,
2395           expression.cs:
2396           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2397           correctly. Fixed bug #75721.
2398
2399 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2400
2401         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2402         loop that performs 'min (pos, char_count)'.
2403
2404         Fix #75862.
2405         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2406         converted value in Operator.OnesComplement.
2407
2408 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2409
2410         * anonymous.cs: If the anon method is pulled into a helper class,
2411         it needs to be `internal' not `private'. Fixes runtime behavior on
2412         msft. bug #75704
2413
2414 2005-08-20  Martin Baulig  <martin@ximian.com>
2415
2416         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2417         scope if we don't already have it.
2418
2419         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2420         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2421         fixes #75867.
2422
2423 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2424
2425         Fix #75803
2426         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2427         is a partial class.
2428
2429 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2430
2431         The big constants rewrite
2432         Fix #75746, #75685 and more
2433         As a side effect saved 1MB for MWF ;-)
2434         
2435         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2436         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2437         enum based for corlib compilation.
2438         
2439         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2440         subtractions.
2441         
2442         * class.cs (FixedField.Define): Use ResolveAsConstant.
2443         
2444         * const.cs (IConstant): Interface constants and enums.
2445         (Const.ResolveValue): New method for constant resolvning.
2446         (ExternalConstant): Constants from imported assemblies.
2447         
2448         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2449         conversion; like enums.
2450         (Constant.ToType): Converts this constant to different type.
2451         (Constant.Increment): Adds 1.
2452         
2453         * convert.cs (ImplicitConversionRequired): Simplified.
2454         
2455         * cs-parser.jay: Create EnumMember directly.
2456         
2457         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2458         
2459         * doc.cs (GenerateEnumDocComment): Removed.
2460         
2461         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2462         (ConvertIntLiteral): Removed.
2463         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2464         
2465         * enum.cs (EnumMember): Implement IConstant.
2466         (Enum.IsValidEnumConstant): Removed.
2467         (Enum.GetNextDefaultValue): Removed.
2468         (Enum.FindMembers): Updated.
2469         (Enum.GenerateDocComment): Iterate enum members.
2470         
2471         * expression.cs (Cast.TryReduce): Handle enums correctly.
2472         (New.Constantify): Made public.
2473         (MemberAccess.DoResolve): Removed contant specific if(s).
2474         
2475         * literal.cs (NullLiteral): Implement new abstract methods.
2476         
2477         * statement.cs (GotoCase.Resolve): Use new constant methods.
2478         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2479         
2480         * typemanager.cs (LookupEnum): Removed.
2481         (IsEnumType): Fixed to work with corlib.
2482         (RegisterConstant): Removed.
2483         (LookupConstant): Removed.
2484         (GetConstant): Changed to work with IConstant.
2485
2486 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2487
2488         * location.cs : Fixed overflown (>255) column number.
2489
2490 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2491
2492         First cut of the qualified-alias-member feature.
2493         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2494         token.
2495         * cs-parser.jay (DOUBLE_COLON): New token.
2496         (namespace_or_type_name): Add rule for recognizing
2497         qualified-alias-members.
2498         (primary_expression): Likewise.
2499         (element_access): Allow QualifiedAliasMember as a possible
2500         type-bearing expression.
2501         (local_variable_type, local_variable_pointer_type): Likewise.
2502         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2503         aliases in the current and enclosing namespace declarations.
2504         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2505         * decl.cs (MemberName.is_double_colon): New.
2506         (MemberName.MemberName): Add new constructor for alias-member.
2507         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2508         * expression.cs (QualifiedAliasMember): New expression type.
2509
2510 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2511
2512         * location.cs : it borked when no argument was specified.
2513
2514 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2515
2516         * location.cs : tiny ToString() format fix.
2517
2518 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2519
2520         * statement.cs : oops, it was missing.
2521
2522 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2523
2524         A set of fixes for precise line/column location.
2525
2526         * location.cs :
2527           "token" field now holds a file/line "delta", a line number offset 
2528           from the segment, and a column number. See also:
2529           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2530           December/009508.html
2531           Removed static IsNull. Use instance IsNull property instead.
2532         * cs-tokenizer.cs :
2533           For some tokens it stores Location. For Identifier it stores
2534           LocatedToken which is a pair of string name and location.
2535           Column numbers are adjusted only at getChar().
2536         * report.cs :
2537           Use Location.ToString() for reporting (it now contains column).
2538         * cs-parser.jay :
2539           Largely modified to use LocatedToken instead of
2540           string (IDENTIFIER), and to acquire Location from some tokens.
2541         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2542           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2543           codegen.cs :
2544           Now MemberName holds Location. DeclSpace.ctor() receives Location
2545           as a parameter. Removed extra parameters to all derived classes.
2546           Replaced Location.IsNull() with instance property.
2547         * assign.cs, expression.cs :
2548           Added .ctor() overload that omits Location.
2549         * attribute.cs :
2550           Added "nameEscaped" flag that indicates the identifier was escaped
2551           in the source file. This fixes bug #57047.
2552
2553 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2554
2555         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2556         New method, looking for lo-case imported cls type.
2557
2558         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2559         here.
2560
2561         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2562
2563         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2564
2565         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2566         all_imported_types.
2567         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2568
2569         Optimized to save 3.5 MB for SWF compilation.
2570
2571 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2572
2573         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2574         (PartialContainer.Create): Moved logic AddToContainer.
2575         (PartialContainer.MarkForDuplicationCheck): Shares name.
2576         
2577         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2578         place.
2579         
2580         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2581         initialization.
2582         (Namespace.GetSignatureForError): New method.
2583         
2584         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2585         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2586
2587 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2588
2589         Fix #75669.
2590         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2591         member lookup rather than qualifier_type, since qualifier_type can
2592         be null.
2593
2594 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2595
2596         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2597         enum member.
2598
2599 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2600
2601         * statement.cs: Copy the local exception into the exception
2602         captured local.  Fixes 75674
2603
2604 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2605
2606         Fix #75658.
2607         * expression.cs (Invocation.OverloadResolve): Don't report error
2608         CS1501 if error CS1502 has been reported.
2609         (New.DoResolve): Delegate CS1501 reporting to
2610         Invocation.OverloadResolve.
2611
2612         Fix #75656.
2613         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2614         invariant-meaning-in-block property in an enclosing block if
2615         necessary.
2616
2617 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2618
2619         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2620         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2621         (Switch.CheckSwitch): Just save 50kb for SWF.
2622
2623 2005-07-27  Martin Baulig  <martin@ximian.com>
2624
2625         * anonymous.cs (CaptureContext.AddField): Added
2626         `AnonymousContainer am' argument; compute its toplevel scope if
2627         it's not already computed.  Fixes #75649.
2628
2629 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2630
2631         Fix #75628.
2632         * class.cs (Constructor.Emit): Reset block to null if the block
2633         resolve fails.
2634
2635 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2636
2637         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2638
2639 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2640
2641         * class.cs (MethodData.Define): Check whether accessor implementing
2642         interface is public.
2643
2644         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2645
2646 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2647
2648         Fix #57245
2649         * namespace.cs (LookupType): Moved same type check to...
2650         
2651         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2652         with the same name.
2653
2654 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2655
2656         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2657         already found a typebuilder.
2658         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2659         MemberNames, not strings.
2660
2661         * const.cs (Error_ExpressionMustBeConst): 
2662         Rename from Error_EpressionMustBeConst.
2663         * const.cs, class.cs, statement.cd: Update.
2664
2665 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2666
2667         Fix #65573
2668
2669         * const.cs (Const.LookupConstantValue): Report missing contant expression
2670         everytime.
2671         (Error_EpressionMustBeConstant): Only one error method.
2672
2673         * class.cs, statement.c: Updated.
2674
2675 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2676
2677         * statement.cs (Block.Flags): Add back HasVarargs.
2678         (Block.flags): Make protected.
2679         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2680
2681         * typemanager.cs (types, typecontainers, user_types): Remove.
2682         (UserTypes, TypeContainers): Likewise.
2683         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2684         (CleanUp, Reset): Update.
2685         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2686         (GetNestedType): Use Type.GetNestedType.
2687         (CoreLookupType): Take two arguments, the namespace and the
2688         basename of the type.  Update to use the Namespace.Lookup
2689         mechanism.
2690         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2691         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2692         string concatenation and substring matches.
2693         * class.cs, enum.cs, delegate.cs: Update to changes.
2694
2695 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2696
2697         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2698         Expression and made virtual.
2699
2700         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2701         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2702
2703         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2704
2705         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2706         error message.
2707
2708         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2709         change.
2710
2711 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2712
2713         Fix #57707
2714         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2715         AssemblyCultureAttribute is not used on executable.
2716
2717         * rootcontext.cs,
2718         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2719
2720 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2721
2722         Fix #60638.
2723         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2724         New.  Reports CS0252/CS0253.
2725         Mostly taken from preliminary patch by Duncak Mak.
2726         (Binary.DoResolveOperator): Store results of operator lookup.
2727         Use them to detect if we need to warn about unintended reference
2728         comparisons.
2729
2730 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2731
2732         Fix #72969.
2733         * namespace.cs (Namespace.Lookup): Add back location parameter.
2734         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2735         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2736
2737         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2738         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2739         (Namespace.LookupType): ... this.
2740         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2741         of namespaces.
2742         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2743         purported to handle pointers.
2744         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2745         CoreLookupType.
2746
2747 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2748
2749         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2750         type as namespace.
2751
2752 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2753
2754         * namespace.cs (Namespace.Lookup): Drop location parameter.
2755         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2756         (NamespaceEntry.Lookup): ... this.
2757         (NamespaceEntry.Error_AmbiguousTypeReference):
2758         Move here from DeclSpace.
2759         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2760         names ...
2761         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2762         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2763         Move to NamespaceEntry.
2764         * delegate.cs, expression.cs: Update to changes.
2765
2766 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2767
2768         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2769         CheckAttributeType and refactored.
2770         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2771         ResolveAsTypeTerminal error handling.
2772         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2773         handling.
2774         (GetSignatureForError): Print errors in same way.
2775
2776         * class.cs,
2777         * codegen.cs: Reflect attribute GetSignatureForError change.
2778
2779         * ecore.cs,
2780         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2781
2782         * namespace.cs (UsingEntry): Refactored to make fields private.
2783
2784         * assign.cs,
2785         statement.cs: Error_UnexpectedKind has extra parameter.
2786
2787 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2788
2789         * ecore.cs (IAlias): Remove.
2790         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2791         that implement the interface.
2792         * namespace.cs (Namespace): Likewise.
2793         (Namespace.declspaces): Renamed from 'defined_names'.
2794         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2795         DeclSpace instead of an IAlias.
2796         * tree.cs (Tree.AddDecl): Update.
2797
2798 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2799
2800         * statement.cs (Block.Flags); Remove HasVarargs.
2801         (Block.HasVarargs): Move to ToplevelBlock.
2802         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2803         (Block.Variables): Make protected.  Initialize variable hashtable
2804         if necessary.
2805         (Block.AddVariable): Update.
2806         (Block.Resolve): Update to changes.
2807         (ToplevelBlock.HasVarargs): New boolean.
2808         (ToplevelBlock.ThisVariable): Move here from Block.
2809         (ToplevelBlock.AddThisVariable): Likewise.
2810         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2811         * expression.cs (This.ResolveBase): Update to changes.
2812         (ArglistAccess.DoResolve): Likewise.
2813
2814 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2815
2816         Fix #75321
2817         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2818
2819         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2820         not used and not used & assigned.
2821         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2822
2823 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2824
2825         Fix #75053
2826         * expression.cs (Is.DoResolve): null is never provided type.
2827
2828 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2829
2830         Fix #52496
2831         * cs-parser.jay: Less strict event error rule to catch more errors.
2832
2833 2005-07-08  Martin Baulig  <martin@ximian.com>
2834
2835         Fix test-iter-10.cs - distinguish whether we `yield' in a property
2836         gettter (allowed) or setter (not allowed).
2837
2838         * class.cs (Accessor): Implement IIteratorContainer.
2839         (Accessor.Yields): New public field.
2840         (PropertyBase.PropertyMethod.Define): Handle iterators on a
2841         per-accessor basis.
2842
2843         * cs-parser.jay
2844         (get_accessor_declaration, set_accessor_declaration): Set the
2845         `yields' flag on the accessor, not the property.
2846         (property_declaration): Do the iterators check on a per-accessor
2847         basis and not for the whole property.
2848
2849 2005-07-08  Martin Baulig  <martin@ximian.com>
2850
2851         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2852         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2853
2854 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2855
2856         Fix #74975
2857         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2858         (ExtractSecurityPermissionSet): Cope with self referencing security
2859         attributes properly.
2860
2861         * driver.cs (SetOutputFile): Made public property OutputFile.
2862
2863 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2864
2865         Fix #75486.
2866         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2867         has_nonstatic_fields.  Make into a FieldBase pointer.
2868         (TypeContainer.AddField): Add CS0282 check.
2869         (TypeContainer.EmitType): Update.
2870
2871 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2872
2873         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2874         compare if they start with __.
2875
2876 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2877
2878         * statement.cs (Switch.SwitchGoverningType): Only look at
2879         UserCasts that don't need implicit standard conversions to one of
2880         the allowed switch types (Fixes test-322.cs).
2881         (LocalInfo.Resolve): Re-enable sanity-test.
2882
2883 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2884
2885         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2886         
2887         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2888         
2889         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2890
2891 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2892
2893         Fix #75472.
2894         * ecore.cs (SimpleName.GetSignatureForError): Add.
2895         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2896         (MemberAccess.GetSignatureForError): Add.
2897
2898 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2899  
2900         The big error and warning messages review.
2901         
2902         * anonymous.cs,
2903         * assign.cs,
2904         * attribute.cs,
2905         * class.cs,
2906         * codegen.cs,
2907         * convert.cs,
2908         * cs-parser.jay,
2909         * cs-tokenizer.cs,
2910         * decl.cs,
2911         * delegate.cs,
2912         * doc.cs,
2913         * driver.cs,
2914         * ecore.cs,
2915         * enum.cs,
2916         * expression.cs,
2917         * flowanalysis.cs,
2918         * iterators.cs,
2919         * literal.cs,
2920         * location.cs,
2921         * modifiers.cs,
2922         * namespace.cs,
2923         * parameter.cs,
2924         * pending.cs,
2925         * report.cs,
2926         * rootcontext.cs,
2927         * statement.cs,
2928         * support.cs,
2929         * tree.cs,
2930         * typemanager.cs: Updated.
2931         
2932         * class.cs: (MethodCore.SetYields): Moved here to share.
2933         (PropertyMethod.Define): Moved iterator setup here.
2934         
2935         * iterators.cs: Add orig_method to have full access to parent
2936         container.
2937
2938 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2939
2940         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2941         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2942         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2943         variable of struct type.
2944         * expression.cs (Unary.ResolveOperator): Update to change.
2945         (Indirection.VerifyFixed): Likewise.
2946         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2947         (ParameterReference.VerifyFixed): Value parameters are fixed.
2948         (This.VerifyFixed): Treat 'this' as a value parameter.
2949         * statement.cs (LocalInfo.IsFixed): Remove.
2950
2951 2005-07-01  Martin Baulig  <martin@ximian.com>
2952
2953         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2954         `ec.EmitThis ()' to get the correct scope.
2955
2956 2005-07-01  Martin Baulig  <martin@ximian.com>
2957
2958         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2959         instance is a ParameterReference; fixes #75299.
2960
2961 2005-07-01  Martin Baulig  <martin@ximian.com>
2962
2963         Reverted Marek's latest patch (r46725):
2964         - it contains structural changes which are neither mentioned in
2965           the ChangeLog nor explained anywhere; for example the additional
2966           argument of EmitContext's and Iterator's .ctor's and the
2967           TypeContainer.DefineMembers() change.
2968         - structural changes like this should go in in seperate patches
2969           and not be hidden in a huge patch which just seems to affect
2970           warnings and errors.
2971           a big and hard to understand patch.
2972         - it breaks iterators and causes regressions, for instance in
2973           test-iter-03.cs.      
2974
2975 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2976
2977         Fix #75412.
2978         * expression.cs (Indexers.map): Remove.
2979         (Indexers.Append): Filter out inaccessible setters and getters.
2980         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2981
2982         Fix #75283.
2983         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2984         Refactored from ...
2985         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2986         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2987         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2988         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2989
2990 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2991
2992         Fix #75322
2993         * class.cs (FieldBase.GetInitializerExpression): One more field
2994         for backup.
2995
2996 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2997
2998         * pending.cs: Do not define a proxy if the base method is virtual,
2999         it will be picked up by the runtime (bug 75270).
3000
3001 2005-06-08  Martin Baulig  <martin@ximian.com>
3002
3003         The big Iterators rewrite :-)
3004
3005         * iterators.cs: Rewrite this to use the anonymous methods framework.
3006
3007         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3008         before the TypeContainers; see 2test-21.cs.
3009
3010         * class.cs
3011         (TypeContainer.DefineType): Don't create a new EmitContext if we
3012         already have one (this only happens if we're an Iterator).
3013         (TypeContainer.Define): Also call Define() on all our iterators.
3014         (Method.CreateEmitContext): Added support for iterators.
3015
3016         * anonymous.cs
3017         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3018         (AnonymousContainer.CreateMethodHost): Moved here from
3019         AnonymousMethod and made abstract.
3020         (AnonymousContainer.CreateScopeType): New abstract method.
3021         (AnonymousContainer.IsIterator): New public property.
3022         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3023         get the ScopeTypeBuilder rather than manually defining it here. 
3024         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3025         iterators here.
3026
3027         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3028         before RootContext.DefineTypes().
3029
3030         * codegen.cs (EmitContext.RemapToProxy): Removed.
3031         (EmitContext.CurrentAnonymousMethod): Changed type from
3032         AnonymousMethod -> AnonymousContainer.
3033         (EmitContext.ResolveTopBlock): Protect from being called twice.
3034         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3035         (EmitContext.EmitThis): Removed the iterators hacks; use the
3036         anonymous methods framework for that.
3037
3038         * statement.cs
3039         (ToplevelBlock.Container): Make this a property, not a field.
3040         (ToplevelBlock.ReParent): New public method; move the
3041         ToplevelBlock into a new container.
3042         (Foreach.TemporaryVariable): Simplify.
3043
3044 2005-06-05  Martin Baulig  <martin@ximian.com>
3045
3046         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3047         (Block.AddTemporaryVariable): New public method; creates a new
3048         `LocalInfo' for a temporary variable.
3049         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3050         variables here.
3051         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3052         non-iterator variables.
3053
3054 2005-06-05  Martin Baulig  <martin@ximian.com>
3055
3056         * statement.cs (Foreach.TemporaryVariable): Create the
3057         LocalBuilder in the Emit phase and not in Resolve since in some
3058         situations, we don't have an ILGenerator during Resolve; see
3059         2test-19.cs for an example.
3060
3061 2005-06-04  Martin Baulig  <martin@ximian.com>
3062
3063         **** Merged r45395 from GCS ****
3064
3065         The big Foreach rewrite - Part II.
3066
3067         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3068         with `PropertyInfo ienumerator_getcurrent'.
3069
3070         * codegen.cs (VariableStorage): Removed.
3071
3072         * statement.cs
3073         (Foreach): Derive from Statement, not ExceptionStatement.
3074         (Foreach.CollectionForeach): New nested class.  Moved all the code
3075         dealing with collection foreach here.
3076         (Foreach.ForeachHelperMethods): Removed.
3077         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3078
3079 2005-05-23  Martin Baulig  <martin@ximian.com>
3080
3081         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3082         don't need to.  Fix #75014.
3083
3084 2005-05-20  Martin Baulig  <martin@ximian.com>
3085
3086         Merged r44808 from GMCS.
3087
3088         * class.cs (TypeContainer.CircularDepException): Removed.
3089         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3090         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3091         (CS0146) and interface (CS0529) dependencies here.
3092
3093 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3094
3095         * expression.cs (Invocation.EmitCall): Fix initialization
3096         'this_call' to reflect current behaviour.  Fix indentation.
3097
3098         * convert.cs (FindMostEncompassedType): Add two trivial special
3099         cases (number_of_types == 0 || number_of_types == 1).
3100         (FindMostEncompasingType): Likewise.
3101
3102 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3103
3104         Some cleanups preparing for the fix of #75283.
3105         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3106         error testing.
3107         (EventExpr.InstanceResolve): Likewise.
3108         (EventExpr.DoResolve): Remove redundant checks.
3109
3110 2005-06-10  Duncan Mak  <duncan@novell.com>
3111
3112         * cs-tokenizer.cs (process_directives): New flag for controlling
3113         the processing of preprocessor directives.
3114         (x_token): After seeing a '#', return Token.NONE instead of going
3115         to handle_preprocessing_directive() when not processing
3116         directives. This avoids unnecessary processing during the token peek in
3117         is_punct().
3118
3119         This fixes #74939.
3120
3121         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3122         the existing error reporting methods instead of Report.Error.
3123
3124         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3125         after Raja's rewrite.
3126
3127 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3128
3129         * class.cs: Small fix.
3130
3131 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3132
3133         Fix #75160.
3134         * class.cs (GetPartialBases): Fix return value check of
3135         part.GetClassBases.
3136
3137 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3138
3139         Ensure that partial classes are registered in their enclosing
3140         namespace.  Initial part of fix of #75160.
3141         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3142         Register declspace with namespace here, not in
3143         DeclSpace.RecordDecl.
3144         * cs-parser.jay: Pass namespace to RecordDecl.
3145         * class.cs (PartialContainer.Create): Likewise.
3146         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3147         called.
3148         * decl.cs (Declspace.RecordDecl): Remove.
3149         * namespace.cs (NamespaceEntry.DefineName): Remove.
3150
3151 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3152
3153         * rootcontext.cs: Reset TargetExt as well.
3154
3155 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3156
3157         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3158         -langversion:ISO-1.
3159
3160 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3161
3162         Fix #75080, cs0119.cs.
3163         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3164         of ...
3165         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3166         allowing ExprClass.Type and ExprClass.Namespace for
3167         ResolveFlags.VariableOrValue.
3168         (Expression.Resolve) [1-argument variant]: Change default resolve
3169         flags based on language version.
3170         (Expression.Error_UnexpectedKind): Use a simple string array
3171         rather than an ArrayList.
3172         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3173         not ExprClass.Type.
3174         (TypeOfVoid.DoResolve): Likewise.
3175         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3176         flags argument -- it always has the same value.
3177
3178 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3179
3180         Fix #75081.
3181         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3182         Use it in the error message.
3183         * assign.cs, expression.cs, statement.cs: Update.
3184
3185 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3186
3187         Fix #75088.
3188         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3189         the "almostMatchedMember" case too.
3190         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3191         that failed the accessibility checks to 'almost_match'.
3192
3193 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3194
3195         * attribute.cs: Use internal MethodBuilder methods to set
3196         ExactSpelling and SetLastError on PInvoke methods, instead
3197         of passing them via charset.  Fixes #75060.
3198
3199 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3200
3201         * parameter.cs (Parameter): Remove TODO comment.
3202         (Parameter.DefineParameter): Remove Location parameter.
3203         (Parameters.LabelParameters): Likewise.
3204         * class.cs (Constructor.Emit): Update to change.
3205         (MethodData.Emit): Likewise.
3206         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3207         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3208
3209 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3210
3211         * parameter.cs,
3212           Removed Parameters.Location and added Parameter.Location instead.
3213           Removed Location parameter from Emit() and GetSignature().
3214         * anonymous.cs,
3215           class.cs,
3216           cs-parser.jay,
3217           delegate.cs,
3218           iterators.cs,
3219           statement.cs :
3220           Modified all related calls.
3221
3222 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3223
3224         Improve user-defined conversion handling.
3225         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3226         applicable operators.
3227         (AddConversionOperators): New.  Helper for GetConversionOperators.
3228         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3229         there is only one most encompassed/encompassing type.
3230         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3231         "applicable operator" handling.
3232         (UserConversion): Move cache here from GetConversionOperators.
3233         Directly cache the chosen operator, rather than the whole
3234         MethodGroup.
3235         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3236         case.  Allow conversion of decimal to sbyte and byte too.
3237         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3238         New static methods.  Used to avoid allocating EmptyExpressions in
3239         convert.cs.
3240
3241 2005-05-24  Duncan Mak  <duncan@novell.com>
3242
3243         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3244         another class, used in Convert.ExplicitNumericConversion.
3245         (CastToDecimal): New class, similar to above, but casts to
3246         System.Decimal, used in Convert.ImplicitNumericConversion and also
3247         in explicit convesion from double/float to decimal.
3248
3249         * convert.cs (ImplicitNumericConversion): Handle implicit
3250         conversions to System.Decimal.
3251         (ExplicitNumericConversion): handle explicit conversions to
3252         System.Decimal.
3253
3254         This fixes #68711.
3255         
3256 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3257
3258         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3259         know the type at this stage, just break through.   Fixes #75008 
3260
3261 2005-05-19  Martin Baulig  <martin@ximian.com>
3262
3263         * delegate.cs
3264         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3265         to disable error reporting.
3266
3267         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3268         here since we don't want to report an error; see the new test-336.cs.
3269
3270 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3271
3272         * statement.cs (ToplevelBlock.GetParameterReference)
3273         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3274         Move here from class Block.
3275         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3276         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3277
3278 2005-05-18  Martin Baulig  <martin@ximian.com>
3279
3280         Fix #74978.
3281
3282         * flowanalysis.cs
3283         (FlowBranching.Reachability): Add non-static public And() and Or()
3284         methods.
3285         (FlowBranchingSwitch): New class; do the `break_origins' thing
3286         like in FlowBranchingLoop.
3287         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3288         reachability, not just locals and parameters.
3289         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3290         switch; MergeBreakOrigins() now takes care of that.
3291
3292 2005-05-18  Martin Baulig  <martin@ximian.com>
3293
3294         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3295         a loop and may leave it, reset the barrier; fixes #74974.
3296
3297 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3298         
3299         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3300         is back.
3301         
3302         * cs-parser.jay: Catch more lexical errors.
3303         
3304         * report.cs: Add one more Error method.
3305         
3306         * rootcontext.cs,
3307         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3308
3309 2005-05-17  Martin Baulig  <martin@ximian.com>
3310
3311         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3312         #70970. 
3313
3314 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3315
3316         Fix test-382.cs.  Emit values of decimal constants.
3317         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3318         Carved out of ...
3319         (TypeContainer.AddField): ... this.
3320         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3321         with initializers to include 'Const's.
3322         (ClassPart.RegisterFieldForInitialization): Forward to
3323         PartialContainer.
3324         * const.cs (Const.Const): Pass initializer to base class.
3325         (Const.Define): In case of decimal constants, register them for
3326         initialization in a static constructor.
3327
3328 2005-05-14  Martin Baulig  <martin@ximian.com>
3329
3330         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3331         do not call ResolveUnreachable() on unreachable statements in
3332         here, see the comment in the source code.
3333
3334 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3335
3336         Fix #74934.
3337         * expression.cs (BinaryResolveOperator): If one of the operands of
3338         an equality comparison is 'null' and the other is a pointer type,
3339         convert the null to a NullPointer.
3340         * convert.cs (ImplicitReferenceConversion): If the expression is a
3341         NullLiteral and the target type is a pointer type, return a
3342         NullPointer instead.
3343         (ImplicitConversionStandard): Likewise.
3344
3345 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3346         
3347         * cs-parser.jay: Set readonly context based on special constructs.
3348         
3349         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3350         readonly variable error handling.
3351         
3352         * rootcontext.cs (EmitCode): Don't verify members when error
3353         occurred.
3354         
3355         * statement.cs (LocalInfo): Add reaodnly context information.
3356         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3357
3358 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3359
3360         * statement.cs (Block.Resolve): Revert change below.  Modify fix
3361         for #74041 to initialize 'resolved' to false only for explicit
3362         blocks.  Fixes #74873.
3363
3364 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3365
3366         Fix #74920.
3367         * typemanager.cs (unmanaged_enclosing_types): New.
3368         (IsUnmanagedType): Avoid infloops by using
3369         'unmanaged_enclosing_types' to talk with recursive invocations.
3370
3371 2005-05-13  Martin Baulig  <martin@ximian.com>
3372
3373         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3374         instance variable, not a local.  Fix #74873.
3375         (Block.ResolveUnreachable): Set it to true here.
3376
3377 2005-05-11  Duncan Mak  <duncan@novell.com>
3378
3379         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3380         continuing to process for 'arg'.
3381         (handle_preprocessing_directive): Check the argument of the #endif
3382         directive and report error CS1025 if there are any trailing
3383         characters.
3384
3385         According to the C# spec, having even whitespace after the #endif
3386         directive is illegal; however, because we call arg.TrimEnd ()
3387         beforehand, we have the same behavior as csc, allowing whitespace
3388         after the directive.
3389
3390         Fixes #74892.
3391
3392 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3393
3394         Fix #74863.
3395         
3396         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3397         (Constructor.GetObsoleteAttribute): Implemented correctly.
3398
3399 2005-05-10  Martin Baulig  <martin@ximian.com>
3400
3401         * support.cs (ReflectionParameters.ParameterModifier): Use
3402         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3403         and `ParameterAttributes.In'.  Fixes #74884.
3404
3405 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3406
3407         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3408         
3409         * expression.cs (Argument.GetParameterModifier): Turned to property.
3410         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3411         
3412         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3413         its C# equivalent.
3414         
3415 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3416
3417         Fix #74852.
3418         * decl.cs (MemberCache.AddMethods): Register override methods,
3419         rather than non-override methods.
3420         * typemanager.cs (RegisterOverride): New.
3421         (IsOverride): Update.
3422
3423 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3424
3425         Fix #73105.
3426         
3427         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3428         recursive declaration.
3429         
3430         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3431         
3432 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3433
3434         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3435         
3436         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3437
3438 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3439
3440         Fix #74797.
3441         * decl.cs (DeclSpace.FamilyAccessible): 
3442         Use TypeManager.IsNestedFamilyAccessible.
3443
3444         Fix reopened #64812.
3445         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3446         internal'.
3447
3448 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3449             Abin Thomas  <projectmonokochi@rediffmail.com>
3450             Anoob V E  <projectmonokochi@rediffmail.com>
3451             Harilal P R  <projectmonokochi@rediffmail.com>
3452
3453         Fix #64812.
3454         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3455         allow access to all static members.
3456
3457 2005-05-04  Martin Baulig  <martin@ximian.com>
3458
3459         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3460
3461 2005-05-04  Martin Baulig  <martin@ximian.com>
3462
3463         Fix #74655.
3464
3465         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3466         section at the end; make things work if `default' is not the last
3467         section.        
3468
3469 2005-05-04  Martin Baulig  <martin@ximian.com>
3470
3471         Fix #70400.
3472
3473         * statement.cs (Switch): Replaced the `got_default' field with a
3474         `default_section' one.
3475         (Switch.CheckSwitch): Set `default_section' here.
3476         (Switch.Resolve): If we're a constant switch and the constant is
3477         not found, use the default section.
3478
3479 2005-05-03  Martin Baulig  <martin@ximian.com>
3480
3481         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3482
3483         * statement.cs (Foreach.ArrayForeach): New nested class.
3484         (Foreach.TemporaryVariable): New nested class.
3485         (Foreach.EmitArrayForeach): Removed; this is now in the new
3486         ArrayForeach class.
3487
3488 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3489
3490         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3491         more conservative.
3492         (VerifyPendingMethods): Revert change below.
3493
3494         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3495         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3496         that used to trigger warning -28.  Remove warning -28.
3497         * expression.cs (Invocation.OverloadResolve): Use
3498         TypeManager.IsOverride to distinguish override methods.
3499
3500         Fix #74773.
3501         * pending.cs (VerifyPendingMethods): If a base type implements the
3502         requested interface, don't bother checking individual methods of
3503         the base type.  As a side-effect, this prevents the creation of
3504         unnecessary proxies.
3505
3506 2005-05-02  Martin Baulig  <martin@ximian.com>
3507
3508         Fix #70182.
3509
3510         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3511         Also `And' the locals if the old vector is null.
3512         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3513         null; in this case we basically reset all the variables.        
3514
3515 2005-05-02  Martin Baulig  <martin@ximian.com>
3516
3517         Fix #74529.
3518
3519         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3520         Added `FlowBranching branching' argument; always `and' the
3521         variables instead of `or'ing them unless we're an infinite loop.
3522
3523         * statement.cs (While.Resolve): Create a new sibling unless we're
3524         infinite.       
3525
3526 2005-05-02  Martin Baulig  <martin@ximian.com>
3527
3528         Fix #70140.
3529
3530         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3531         arguments; use it instead of creating a new TopLevelBlock.
3532         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3533         our ConstructorInitializer.
3534
3535         * statement.cs
3536         (TopLevelBlock.TopLevelBranching): New public property.
3537         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3538         and create our `TopLevelBranching'.
3539
3540         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3541         anonymous method host, use `block.TopLevelBranching' rather than
3542         creating a new branching.
3543
3544 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3545
3546         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3547         a ScopeInfo, if any of the current children is a child of the new
3548         entry, move those children there.
3549
3550 2005-04-30  Martin Baulig  <martin@ximian.com>
3551
3552         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3553         at the beginning of a SwitchSection.  Fix #73335.
3554
3555 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3556
3557         Fix #74378
3558         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3559         
3560         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3561         (FieldExpr.DoResolve): Obsolete members are ignored for field
3562         initializers.
3563         
3564 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3565
3566         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3567         of arrays detection.
3568
3569         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3570         verification.
3571         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3572
3573         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3574         arrays report.
3575
3576 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3577
3578         * cs-parser.jay: Use the prefered version of -unsafe in error
3579         message.
3580
3581 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3582
3583         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3584         circumstances.
3585
3586 2005-04-20  John Luke  <john.luke@gmail.com>
3587
3588         * driver.cs: fix typo in error message, --outout to --output
3589
3590 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3591
3592         * codegen.cs (InRefOutArgumentResolving): New field.
3593         
3594         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3595         fields outside contructor.
3596         
3597         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3598         
3599 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3600
3601         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3602         parameter code was not completed ever, so it was not as up-to-date
3603         as local variables.  Must finish it.
3604
3605         The bug fix was to compare the Toplevel of the block, not the
3606         current block.  Thanks for Ben for pointing this out. 
3607
3608 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3609
3610         * decl.cs (AddMethods): Use the declaring type of the problem
3611         method to determine if we want to squash a warning.
3612
3613 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3614
3615         * attribute.cs: Removed debug output.
3616
3617         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3618         
3619         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3620         Report.Stderr.
3621         
3622 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3623
3624         Fix #74481.
3625         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3626         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3627         all null comparisons against reference types.
3628
3629 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3630
3631         Fix# 74565
3632         * class.cs (TypeContainer.CircularDepException) New nested
3633         exception class.
3634         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3635         (TypeContainer.DefineType): Removed error, reset InTransit before
3636         exit.
3637         (Class.DefineType): Throw exception when is in Transit.
3638         Catch exception and report error.
3639         (Struct.DefineType): Throw exception when is in Transit.
3640         Catch exception and report error.
3641         (Interface.DefineType): Throw exception when is in Transit.
3642         Catch exception and report error.
3643
3644         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3645         handle nested exception handlers.
3646
3647         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3648         a catch.
3649
3650         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3651         InFinally and InCatch storage.
3652
3653         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3654         (Catch.Resolve): Set and Restore ec.InCatch.
3655         (Try.Resolve): Set and Restore ec.InFinally.
3656         (Try.HasCatch): True when try has catch.
3657
3658 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3659
3660         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3661           for the same event member, so exclude such cases from warning 419.
3662           Fixed bug #74633.
3663
3664 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3665
3666         * expression.cs (Binary.ResolveOperator): Apply patch from John
3667         Luke to fix bug 59864: operators &, | and ^ on enumerations
3668         require that the same enum type on both sides.
3669
3670         * driver.cs: Add warnings to old flag usage, this is to assist
3671         people who produce Makefiles and hope that the Makefiles will be
3672         used on Windows.
3673
3674         * class.cs (TypeContainer.EmitType): Moved the definition of the
3675         special $PRIVATE$ field from the resolve phase to the Emit phase.
3676         During resolve we do not know if we are a struct with
3677         HasExplicitLayout, we know this only after the attributes for the
3678         type are emitted.
3679
3680         Set the FieldOffset to zero on the dummy field that we create for
3681         the class.   Fixes 74590.
3682
3683 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3684
3685         Fix #73834.
3686         * ecore.cs (PropertyExpr.resolved): New.
3687         (DoResolve): Use it to handle a case of double resolution here.
3688         Handle a case of identical-name-and-type-name.
3689         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3690         resolution by storing the results of expression resolution back
3691         into the "probes" array.
3692
3693 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3694
3695         Fix cs0208-7.cs and cs0208-8.cs.
3696         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3697         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3698         error reporting to point out the reason a struct is not unmanaged.
3699
3700 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3701
3702         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3703           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3704
3705 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3706
3707         Fix #74528.
3708         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3709         IdenticalNameAndTypeName here.
3710         (EventExpr.InstanceResolve): Likewise.
3711
3712 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3713
3714         C# 2.0 DefaultCharSetAttribute implementation
3715         
3716         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3717         which allows us to set GlobalNamespace for every resolve.
3718         (Attribute.ResolveArguments): Cut from Resolve.
3719         (Attribute.GetCharSetValue): Returns CharSet named argument.
3720         (Attribute.DefinePInvokeMethod): Gets default charset from
3721         module settings.
3722         (GlobalAttribute.ResolveAsTypeStep): Override.
3723         (GlobalAttribute.ResolveArguments): Override.
3724         
3725         * class.cs (TypeAttr): Is protected.
3726         
3727         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3728         (ModuleClass.DefaultCharSetType): New memeber.
3729         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3730         
3731         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3732         charset from module.
3733         
3734         * delegate.cs (TypeAttr): Override.
3735         (Delegate.DefineType): Use this TypeAttr.
3736         
3737         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3738         at very early stage (before types are defined) to resolve model
3739         module attributes. It will probably not work with corlib but it
3740         should be ok.
3741         
3742         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3743         charset from module.
3744         
3745         * typemanager.cs (default_charset_type): New type.
3746
3747 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3748
3749         * decl.cs (MemberCache.AddMethods): Don't warn if
3750         System.Object.Finalize has buggy MethodAttributes.
3751
3752         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3753         removed below.
3754
3755 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3756
3757         * doc.cs : detect ambiguous reference to overloaded members.
3758           Fixed bug #71603. MS 1.1 csc does not detect it.
3759
3760 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3761
3762         * doc.cs : delegates must not be referenced with parameters.
3763           Fixed bug #71605.
3764
3765 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3766
3767         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3768
3769 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3770
3771         * driver.cs (MainDriver): Stop processing if the CLS stage found
3772         errors. 
3773
3774         (CompilerCallableEntryPoint.InvokeCompiler): Always
3775         reset after execution;   Take a TextWriter argument for the
3776         output.
3777
3778         * report.cs: Use the error stream instead of hardcoding stderr. 
3779
3780 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3781
3782         * class.cs: Reduce code paths to test, too small of an
3783         optimization to make it worth the extra testing.  Always perform
3784         it. 
3785
3786 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3787
3788         Fix #74510.
3789         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3790         operators that had errors reported on them.
3791
3792 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3793
3794         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3795         argument types.
3796         (Attribute.Resolve): Add named argument type checking.
3797         
3798         * class.cs (FixedField.Define): Use IsPrimitiveType
3799         
3800         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3801         
3802         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3803         unsafe parameter types.
3804         
3805         * statement.cs (Using.ResolveExpression): Add better error description.
3806         
3807         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3808         
3809 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3810
3811         Fix #74484.
3812         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3813         AttributeUsageAttribute in the emitcontext of the attribute class,
3814         not in the emitcontext of the attributable entity it was attached to.
3815         * cs-parser.jay: Use 'current_class', not 'current_container',
3816         when creating a GlobalAttribute.
3817
3818 2005-04-08  Alp Toker  <alp@atoker.com>
3819
3820         * pending.cs: The fix to #58413 failed to compile methods implementing
3821         interfaces with/without params modifiers and vice versa, even though
3822         params modifiers aren't part of the signature. Make the modifier check
3823         less strict as in csc.
3824
3825 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3826             Anoob V E  <projectmonokochi@rediffmail.com>
3827             Harilal P R  <projectmonokochi@rediffmail.com>
3828
3829         Fix #58413.
3830         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3831         modifiers of pending methods.
3832         (PendingImplementation.PendingImplementation): Initialize it.
3833         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3834         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3835         with ParameterData.  Add check for modifiers.
3836         * class.cs (MethodData.Define): Update to changes.
3837
3838 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3839
3840         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3841
3842 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3843
3844         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3845         property.
3846         
3847         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3848         
3849         * rootcontext.cs,
3850         * typemanager.cs: Registered RequiredAttributeAttribute.
3851         
3852 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3853
3854         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3855         Warning CS0169 is back at level 3.
3856         (IMethodData.SetMemberIsUsed): New method.
3857         
3858         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3859         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3860         
3861         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3862
3863         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3864         contants.
3865         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3866         is used.
3867         
3868         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3869         is used.
3870         
3871         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3872         to avoid the problems with nested types.
3873
3874 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3875             Anoob V.E  <projectmonokochi@rediffmail.com>
3876             Harilal P.R  <projectmonokochi@rediffmail.com>
3877             Raja R Harinath  <rharinath@novell.com>
3878
3879         Fix #73820.
3880         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3881         attribute.
3882         * typemanager (GetConstructor): Make public.
3883
3884 2005-04-05  John Luke  <john.luke@gmail.com>
3885             Raja R Harinath  <rharinath@novell.com>
3886
3887         Fix #62232.
3888         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3889         struct too.  Return false quicker in a few cases.
3890         (VerifyUnManaged): Use it.
3891
3892 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3893
3894         Fix #74041.
3895         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3896         not 'unreachable_seen'.
3897
3898 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3899
3900         * attribute.cs (Attribute.GetValue): Removed unused.
3901         
3902         * codegen.cs (CodeGen.TrimExt): Removed unused.
3903         
3904         * cs-parser.jay (output): Removed unused.
3905         
3906         * cs-tokenizer.cs (hex_digits): Removed unused.
3907         
3908         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3909         
3910         * expression.cs (Indirection.LoadExprValue): Removed unused.
3911         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3912         
3913         * iterators.cs (Iterator.param_types): Removed unused.
3914         
3915         * statement.cs (Goto.block): Removed unused.
3916         (ToplevelBlock.did): Removed unused.
3917         (Switch.ResolveConstantSwitch): Removed unused.
3918
3919 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
3920
3921         * rootcontext.cs: Allow mcs to bootstrap with the compilation
3922         resetting thingy.
3923
3924 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3925
3926         Fix #74232 and cs0208-3.cs.
3927         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3928         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3929         unmanaged type.  Don't use FieldBuilders when 't' is a
3930         TypeBuilder.  Use ModFlags and MemberType fields.
3931         * class.cs (MemberBase.member_type): Rename from MemberType.
3932         (MemberBase.MemberType): New property.  Determines member_type on
3933         demand.
3934         (MemberBase.DoDefine): Don't initialize MemberType here.
3935         (FieldMember.Define): Likewise.
3936
3937 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
3938
3939         Fix #74241
3940         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3941         Attributes are emitted there.
3942         
3943 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3944
3945         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3946         keyword in 'partial enum' too.
3947         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3948         is not allowed).
3949         Report from Kamil Skalski <nazgul@omega.pl>.
3950
3951         Fix #74309.
3952         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3953         have partial containers too.
3954
3955         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3956         in block' checks to Block.CheckInvariantMeaningInBlock.
3957         * statement.cs (Block.GetKnownVariableInfo): Make private.
3958         (Block.IsVariableUsedInChildBlock): Remove.
3959         (Block.IsVariableUsedInBlock): Likewise.
3960         (Block.CheckInvariantMeaningInBlock): New.  Show location of
3961         conflicting declaration.
3962         (Block.AddVariable): Make error messages less long-winded and more
3963         specific.  Show location of conflicting declaration.
3964         * parameter.cs (Parameters.Location): New readonly property.
3965
3966 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3967
3968         Clean up semantics of invoking ResolveMemberAccess.
3969         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3970         can have an instance, ensure that we pass in a non-TypeExpression
3971         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
3972         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3973         argument.  Update to changes and simplify.
3974         (FieldExpr.Emitinstance): Remove CS0120 check.
3975         (PropertyExpr.EmitInstance): Likewise.
3976         * expression.cs (Argument.Resolve): Likewise.
3977         (Invocation.DoResolve): Update to changes in semantics of
3978         InstanceExpression.
3979
3980 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
3981
3982         Fix #74241
3983         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3984         customization.
3985         
3986         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3987
3988 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3989
3990         Fix difference in behaviour with commandline invocation.
3991         * driver.cs (Driver.Reset): New.
3992         (CompilerCallableEntryPoint): Call it.
3993
3994         * statement.cs (If.Resolve): Avoid spurious "uninitialized
3995         variable" warnings if the boolean expression failed to resolve.
3996
3997 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
3998
3999         * attribute.cs: Fix the union of several permissions when some of them
4000         are unrestricted (so the result isn't an unrestricted permission set).
4001         Fix #74036.
4002
4003 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4004
4005         * ecore.cs (MemberExpr): New class.  Convert from interface
4006         IMemberExpr.
4007         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4008         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4009         error checks.
4010         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4011         (MethodGroupExpr.IsExplicitImpl): Remove.
4012         (Expression.GetFieldFromEvent): Remove.
4013         (SimpleName.MemberStaticCheck): Remove.
4014         (SimpleName.DoSimpleNameResolve): Update to changes.
4015         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4016         (MemberAccess.IdenticalNameAndTypeName): Remove.
4017         (MemberAccess.error176): Move to MemberExpr.
4018         (MemberAccess.DoResolve): Update to changes.
4019         (BaseAccess.DoResolve): Likewise.
4020
4021 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4022
4023         C# 2.0 Conditional attribute class implementation
4024         
4025         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4026         Analyzes class whether it has attribute which has ConditionalAttribute
4027         and its condition is not defined.
4028         
4029         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4030         (Class.IsExcluded): New method. Search for at least one defined
4031         condition in ConditionalAttribute of attribute class.
4032
4033 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4034
4035         * ecore.cs (PropertyExpr): Derive from Expression, not
4036         ExpressionStatement.
4037         (PropertyExpr.EmitStatement): Remove.
4038
4039 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4040
4041         Fix #74060.
4042         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4043         internal field "value__" of an enum be private.  The examples for
4044         "value__" that I found on MSDN all used FieldAttributes.Private.
4045
4046         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4047         Don't mention IL method attribute names.
4048
4049         Fix #47991.  Remove a TODO.
4050         * statement.cs (Block.Toplevel): Make into a field.
4051         (Block.Parameters): Move into ToplevelBlock.
4052         (Block.known_variables): Rename from child_variable_names.
4053         (Block.Block): Remove variants that take Parameters.  Initialize
4054         'Toplevel' with the immediately surrounding toplevel block.
4055         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4056         LocalInfo parameter.
4057         (Block.GetKnownVariableInfo): New.
4058         (Block.IsVariableNameUsedInChildBlock): Update.
4059         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4060         the block, even though it may not be in scope.
4061         (Block.AddVariable): Remove Parameters parameter.  Use
4062         Toplevel.Parameters instead.
4063         (Block.AddConstant): Remove Parameters parameter.
4064         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4065         (Block.IsParamaterReference): Likewise.
4066         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4067         (ToplevelBlock.Parameters): New.  Moved from Block.
4068         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4069         initialize Parameters to a non-null value.
4070         * cs-parser.jay: Update to changes.
4071         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4072         simple names that mean different things in the same block.  Use
4073         Block.IsVariableNameUsedInBlock.
4074
4075 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4076
4077         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4078         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4079         GetTypeHandle.  It is possible for a reflected type to derive from
4080         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4081         System.Array during mscorlib compilation).
4082         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4083         contain a method_hash, don't create one either.  Don't create a
4084         deep copy of the base cache's method_hash.
4085         (MemberCache.SetupCache): Rename back from DeepCopy.
4086         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4087         already initialized.  If we see an override function, add its
4088         underlying base virtual function to the member_hash too.
4089
4090         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4091
4092 2005-03-26  Raja R Harinath  <harinath@acm.org>
4093
4094         Fix #73038.
4095         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4096         fails to resolve, ensure that the LHS is still resolved as an
4097         lvalue.
4098
4099 2005-03-25  Raja R Harinath  <harinath@acm.org>
4100
4101         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4102         ec.ContainerType.
4103         (Enum.current_ec): Remove.
4104         (Enum.LookupEnumValue): Remove EmitContext argument.
4105         Just uses the one created during DefineType.
4106         (Enum.FindMembers): Update.
4107         * expression.cs (MemberAccess.DoResolve): Update.
4108
4109 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4110
4111         * assign.cs (Assign.DoResolve): Check for CS1717 when
4112         source and target are same (uses Equals).
4113
4114         * expression.cs (LocalVariableReference, ParameterReference,
4115         This): Implemented Equals, GetHashCode.
4116
4117         * statement.cs (Block.GetParameterReference): Removed useless
4118         local variable.
4119
4120 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4121
4122         Fix cs0128.cs
4123         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4124         blocks before deciding whether the error is cs0136 or cs0128.
4125
4126         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4127         (using_alias_directive, using_namespace_directive): Pass
4128         MemberName, not an expression to Namespace.UsingAlias and
4129         Namespace.Using.
4130         (MakeName): Use the MemberName of the namespace.
4131         * namespace.cs (Namespace.MemberName): New.
4132         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4133         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4134         Likewise.
4135         * decl.cs (MemberName.Name): Make readonly.
4136         (MemberName.FromDotted): New "constructor".
4137         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4138         (MemberCore.Name): Compute from MemberName on demand.
4139         (MemberCore.SetMemberName): Provide a way to change the
4140         MemberName.
4141         (MemberCore.AddToContainer): Don't take a fullname parameter.
4142         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4143         fully qualified name of the container to the member name.
4144         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4145         only if the type is a member of the root container.
4146         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4147         MemberName.Left rather than searching for an embedded ".".
4148         (PartialContainer.CreatePart): Update to changes in RootContext.
4149         (MemberBase.ShortName): Turn into a property.  Use
4150         MemberCore.SetMemberName.
4151         (MemberBase.ExplicitInterfaceName): Remove.
4152         (MemberBase.UpdateMemberName): Remove.
4153         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4154         (PropertyBase.SetMemberName): New override.
4155         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4156         (Tree.GetDecl): New.
4157         (Tree.AllDecls): Rename from Decls.
4158         * attribute.cs, enum.cs, report.cs: Update to changes.
4159         * driver.cs (MainDriver): Use MemberName.FromDotted on
4160         RootContext.MainClass.
4161
4162 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4163
4164         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4165         checks.
4166
4167         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4168
4169 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4170
4171         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4172         property accessor modifiers.
4173
4174         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4175         fixed buffer attribute (CS1716).
4176         (PropertyMethod.HasCustomAccessModifier): When property accessor
4177         has custom modifier.
4178
4179         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4180         modifiers.
4181         (PropertyExpr.DoResolveLValue): Add CS0272.
4182
4183 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4184
4185         * convert.cs: When converting to a pointer, use the proper Conv.U
4186         or Conv.I depending on the source data type.
4187
4188         * cs-tokenizer.cs: Make the size for large decimal constants,
4189         fixes #72957.
4190
4191 2005-03-17  Martin Baulig  <martin@ximian.com>
4192
4193         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4194         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4195
4196 2005-03-17  Martin Baulig  <martin@ximian.com>
4197
4198         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4199         to bool so we can return an error condition.
4200         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4201         returned an error.
4202
4203 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4204
4205         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4206         attributes.
4207
4208 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4209
4210         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4211         Refactor to avoid traversing the list of assemblies, and to avoid
4212         string concatenation.
4213         * typemanager.cs (guid_attr_type): Remove.
4214         (negative_hits, pointers, references): Remove hashes.
4215         (type_hash): New.
4216         (GetConstructedType): New.  Uses type_hash to handle constructed
4217         types (arrays, references, pointers).
4218         (GetReferenceType, GetPointerType): Use it.
4219         (GetNestedType): New.  Uses type_hash to handle nested types of
4220         reflected types.
4221         (LookupType, LookupTypeDirect): Remove.
4222         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4223         'types' hash and LookupTypeReflection directly.
4224         (params_string, params_object): Use GetConstructedType.
4225         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4226         top-level types.
4227         (Namespace.Lookup): Use cached_types.
4228         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4229         provided by old TypeManager.LookupType.
4230         * rootcontext.cs (MakeFQN): Remove.
4231         * decl.cs (DeclSpace.MakeFQN): Likewise.
4232         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4233         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4234         TypeManager.GetConstructedType.
4235         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4236
4237 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4238
4239         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4240         indexers.
4241
4242         * cs-parser.jay: Reports CS1527 for any namespace element.
4243
4244         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4245         Added CS0407.
4246
4247         * expression.cs (ParameterReference.IsAssigned): Changed error to
4248         CS0269.
4249         (Error_WrongNumArguments): Moved CS0245 detection here.
4250
4251         * statement.cs (Return.Resolve): Add CS1622 report.
4252
4253 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4254
4255         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4256
4257 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4258
4259         * attribute.cs expression.cs: Get rid of some allocations.
4260
4261 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4262
4263         * doc.cs : just eliminate the latest change.
4264
4265 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4266
4267         * doc.cs : commented out the latest change. It breaks xml-030.cs
4268
4269 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4270
4271         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4272           fail. So invoke CreateType() in FindDocumentedType().
4273
4274 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4275
4276         * cs-tokenizer.cs : added IsKeyword().
4277         * doc.cs : Detect keyword incorrectly used as identifier.
4278           Allow identifiers prefixed by @.
4279
4280 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4281
4282         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4283         It caused exception in namespace resolving (again!).
4284         
4285         * class.cs (Class.ctor): Removed exit.
4286         (PropertyMethod.ctor): ditto.
4287         
4288         * codegen.cs (Codegen.Reset): Reset static data.
4289         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4290         
4291         * cs-tokenizer.cs (Cleanup): Removed.
4292         
4293         * driver.cs (GetSystemDir): Rewrote to one line command.
4294         It caused problem with unloaded dynamic modules.
4295         (UnixParseOption): Removed Exit.
4296         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4297         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4298         Now can be mcs used as library.
4299         
4300         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4301         empty location.
4302         
4303         * location.cs (Reset): Reset static data.
4304         
4305         * namespace.cs (Reset): Reset static data.
4306         
4307         * report.cs (Report.Reset): Reset static data.
4308         
4309         * rootcontext.cs (RootContext.Reset): Reset static data.
4310         
4311         * tree.cs (RootTypes.ctor): Use Location.Null
4312         
4313         * typemanager.cs (TypeManager.Reset): Reset static data.
4314         (CoreLookupType): Removed Exit.
4315         (TypeHandle.Reset): Reset static data.
4316         
4317 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4318
4319         Fix #73516.
4320         * typemanager.cs (ComputeNamespaces): Import namespaces from
4321         referenced modules too.
4322
4323 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4324
4325         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4326         than '.'.
4327
4328 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4329
4330         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4331         enclosing DeclSpace.  This ensures that a name-lookup populates
4332         more caches and there are fewer 'TypeExpression's.  Carve out
4333         nested type lookup into ...
4334         (LookupNestedTypeInHierarchy): ... this.
4335
4336 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4337
4338         Clean up a few partial-class semantics.  
4339         Fixes test-357.cs and cs1618-2.cs.
4340         * cs-parser.jay (struct_declaration): Use 'current_class' as
4341         parent of newly-created struct.  Remove call to Register ().
4342         Use 'pop_current_class' to complete handing the current struct.
4343         (interface_declaration): Likewise.
4344         (class_declaration): Likewise.
4345         (enum_declaration): Use 'current_class' as parent of newly created
4346         enum.
4347         (delegate_declaration): Likewise.
4348         (pop_current_class): New function.  This is used to handle closing
4349         up the 'current_class' and 'current_container', and pointing them
4350         to the enclosing class/container.
4351         (CSharpParser): Initialize 'current_class' too.
4352         * decl.cs (MemberCore): Add check for invariant: a partial
4353         container is not a parsed entity, and thus does not enclose any
4354         parsed members.
4355         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4356         (DeclSpace.BaseTypeExpr): Use it.
4357         (DeclSpace.LookupType): Add check for invariant.
4358         * class.cs (TypeContainer): Add check for invariant: a nested
4359         class should have the same NamespaceEntry as its enclosing class.
4360         (TypeContainer.EmitFieldInitializers): Make virtual.
4361         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4362         MemberCore.
4363         (TypeContainer.Register): Remove.
4364         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4365         null.  Use TypeResolveEmitContext for resolving base types and
4366         interfaces.  Move initialization of Parts.TypeBuilder here from
4367         ...
4368         (TypeContainer.DefineNestedTypes): ... here.
4369         (PartialContainer): Take a Namespace not a NamespaceEntry.
4370         (PartialContainer.Create): Don't use Register.  Call the
4371         appropriate Add... function directly.
4372         (ClassPart): Take both the PartialContainer and the enclosing
4373         class as constructor arguments.
4374         (ClassPart.EmitFieldInitializers): Override.
4375         (ClassPart.PartFindNestedTypes): Remove.
4376         (FieldBase.GetInitializerExpression): Resolve the initializer
4377         expression in the emit context of the enclosing class.
4378         * tree.cs (RootTypes): Remove Register ().
4379         
4380 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4381
4382         * cs-parser.jay: Removed CS0134.
4383         
4384         * driver.cs: Removed CS1901.
4385         
4386         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4387         for predefined types.
4388
4389 2005-03-07  Duncan Mak  <duncan@novell.com>
4390
4391         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4392         well. Fixes bug #73454.
4393
4394 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4395
4396         * cs-tokenizer.cs (xtoken): Add CS1035.
4397         
4398         * class.cs (MethodData.Define): Add CS0683.
4399         (FieldMember.ctor): Add CS0681.
4400
4401 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4402
4403         * ecore.cs (SimpleName.DoResolve): Rename from
4404         SimpleName.DoResolveAllowStatic.
4405         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4406         Pass 'intermediate' flag to MemberStaticCheck.
4407         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4408         of "intermediate" lookups via MemberAccess.
4409         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4410         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4411
4412 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4413
4414         Fix #73394.
4415         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4416         slipped in because of variable names that are identical to a
4417         builtin type's BCL equivalent ('string String;', 'int Int32;').
4418         (PropertyExpr.EmitInstance): Likewise.
4419
4420 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4421
4422         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4423         
4424         * report.cs (warning_ignore_table): Made public.
4425
4426 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4427
4428         Fix #73282.
4429         * class.cs (MethodData.Emit): Pass 'container' to
4430         container.GetObsoleteAttribute instead of 'container.Parent'.
4431
4432 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4433
4434         * cs-parser.jay: Add 1534 error test.
4435
4436         * iterators.cs (Yield.CheckContext): Add error 1629.
4437         (Iterator.ctor): Save unsafe modifier.
4438         (MoveNextMethod.DoEmit): Restore unsafe context.
4439
4440         * namespace.cs (UsingAlias): Better error message.
4441
4442 2005-03-03  Dan Winship  <danw@novell.com>
4443
4444         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4445         the warning message [#73219]
4446
4447 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4448
4449         Fix compile with MCS 1.0.0.0.
4450         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4451         w_restore to not depend on string constant folding.
4452
4453 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4454
4455         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4456         CS0246 check to users who passed 'silent = false'.
4457         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4458         check.
4459         (SimpleName.SimpleNameResolve): Update.
4460         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4461         (MemberAccess.IdenticalNameAndTypeName): Update.
4462         * doc.cs (FindDocumentedTypeNonArray): Update.
4463
4464 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4465
4466         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4467         * parameters.cs (ComputeAndDefineParameters): Remove.
4468         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4469         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4470         Use GetParameterInfo.
4471
4472 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4473
4474         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4475
4476 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4477
4478         Unify DeclSpace.LookupType and DeclSpace.FindType.
4479         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4480         is in charge of defining nested types on demand.
4481         (DeclSpace.LookupType): Use it when the current_type is a
4482         TypeBuilder.  Use LookupTypeDirect for reflected types.
4483         (DeclSpace.FindType): Remove.
4484         (DeclSpace.LookupInterfaceOrClass): Likewise.
4485         (DeclSpace.DefineTypeAndParents): Likewise.
4486         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4487         DeclSpace.LookupType.
4488         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4489         * typemanager.cs (LookupType): Simplify.
4490         (AddUserType): Remove type from negative_hits.
4491         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4492         * class.cs (TypeContainer.FindMembers): Move handling of nested
4493         types ...
4494         (TypeContainer.FindMembers_NestedTypes): ... here.
4495         (TypeContainer.FindNestedType): Implement override.
4496         (ClassPart.FindNestedType): Delegate to PartialContainer.
4497         (ClassPart.PartFindNestedType): Looks up the nested types of the
4498         part alone.
4499
4500 2005-03-02  Martin Baulig  <martin@ximian.com>
4501
4502         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4503         static constructor in static classes.
4504
4505 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4506
4507         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4508         sizeParamIndex is not specified.
4509
4510 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4511
4512         Fix #73117
4513         * report.cs (WarningMessage.IsEnabled): Missing null check.
4514
4515 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4516
4517         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4518         in the fields and not in the properties.
4519
4520 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4521
4522         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4523         fields as well.
4524
4525 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4526
4527         * attribute.cs: Small refactoring (improved robustness).
4528         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4529         (ValidateGuid): Removed.
4530         (Resolve): Removed referenced to above mentioned.
4531         (GetAttributeUsage): Made private and changed to work without
4532         class assistance.
4533         (GetIndexerAttributeValue): Don't crash.
4534         (GetConditionalAttributeValue): Ditto.
4535         (GetClsCompliantAttributeValue): Ditto.
4536         (ExtractSecurityPermissionSet): All attributes exceptions are
4537         error 648.
4538         (GetPropertyValue): New helper.
4539         (GetMethodImplOptions): New method.
4540         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4541         some missing properties.
4542         
4543         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4544         (Method.ApplyAttributeBuilder): Updated.
4545         
4546         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4547         exception.
4548
4549 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4550
4551         Fix #73052.
4552         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4553         non-simple types (array, pointer, reference).
4554
4555 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4556
4557         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4558
4559         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4560         for operators.
4561         (Method.CheckBase): Catch wrong destructor here.
4562         (MethodData.Define): Add errors 550, 668.
4563
4564         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4565
4566         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4567
4568         * pending.cs (VerifyPendingMethods): Add error 551.
4569
4570         * typemanager.cs (CSharpName): Next error report helper.
4571
4572 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4573
4574         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4575         attributes. Removed useless attribute double check.
4576         It saves almost 2MBs for corlib.
4577
4578 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4579
4580         Fix #72924.
4581         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4582         called twice in case of error.
4583
4584 2005-02-23  Chris Toshok  <toshok@ximian.com>
4585
4586         Fix compiler portions of #72827.
4587         * statement.cs (Block.Emit): call Begin/EndScope on the
4588         EmitContext instead of the ILGenerator.
4589
4590         * codegen.cs (EmitContext.BeginScope): new method, call
4591         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4592         we have one.)
4593         (EmitContext.BeginScope): same, but EndScope and CloseScope
4594
4595         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4596         offset and call the superclass's OpenScope(int) with it.
4597         (SymbolWriter.CloseScope): get the current il
4598         offset and call superclass's CloseScope(int) with it.
4599
4600 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4601
4602         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4603         CS1677 for out and ref as well.
4604
4605         * class.cs (Method.Define): Add error CS1599 detection.
4606         
4607         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4608         
4609         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4610         
4611         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4612         
4613         * support.cs.cs (ModifierDesc): New helper method.
4614
4615 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4616             Abin Thomas  <projectmonokochi@rediffmail.com>
4617             Anoob V E  <projectmonokochi@rediffmail.com>
4618             Harilal P R  <projectmonokochi@rediffmail.com>
4619
4620         Fix #57851, #72718.
4621         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4622         MemberLookup (used for error reporting) actually returns a result.
4623         Fix error report number (122, not 112).
4624
4625 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4626             Anoob V E  <projectmonokochi@rediffmail.com>
4627             Harilal P R  <projectmonokochi@rediffmail.com>
4628
4629         Fix #71134.
4630         * pending.cs (PendingImplementation.GetAbstractMethods):
4631         Find NonPublic members too.
4632
4633 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4634
4635         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4636         Fixed error 217.
4637         
4638         * class.cs (MethodCore.CheckMethodAgainstBase):
4639         Add error 239 report.
4640
4641 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4642
4643         Fix #68955.
4644         * expression.cs (Invocation.IsApplicable): Make public.
4645         (Invocation.IsParamsMethodApplicable): Likewise.
4646         * delegate.cs (Delegate.VerifyApplicability): Don't use
4647         Invocation.VerifyArgumentCompat for parameter applicability
4648         testing.  Use Invocation.IsApplicable and
4649         Invocation.IsParamsMethodApplicable.
4650
4651 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4652
4653         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4654         
4655         * class.cs (Operator.Define): Add error 217 report.
4656         
4657 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4658
4659         * namespace.cs (UsingEntry.Resolve): Undo change below.
4660
4661 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4662
4663         Fix #72756.
4664         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4665         disable the error message when the extended MemberLookup also
4666         fails.
4667         (Expression.MemberLookupFinal): Update.
4668         (SimpleName.DoSimpleNameResolve): Update.
4669         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4670         Don't use MemberLookupFinal.
4671         (New.DoResolve): Update.
4672         (BaseAccess.CommonResolve): Update.
4673
4674 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4675
4676         Fix #72732.
4677         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4678         occured previously, don't resolve again.
4679
4680 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4681
4682         Fix #69949
4683         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4684         argument. Call ResolveAttributeUsage for unresolved.
4685         when types doesn't match ctor arguments.
4686         
4687         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4688         for nested attribute classes.
4689         (Class.attribute_usage): Removed.
4690         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4691         for attribute class.
4692         
4693         * ecore.cs (IsAttribute): Removed.
4694         
4695         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4696         
4697         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4698         now normal types.
4699         (attribute_types): Removed.
4700         (EmitCode): Global attributes are emited as the latest.
4701
4702 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4703
4704         * class.cs (EmitFieldInitializers): Don't emit field initializer
4705         for default values when optimilization is on.
4706         
4707         * constant.cs (Constant.IsDefaultValue): New property.
4708         
4709         * driver.cs: Add /optimize handling.
4710         
4711         * constant.cs,
4712         * ecore.cs,
4713         * literal.cs: Implement new IsDefaultValue property.
4714         
4715         * rootcontext.cs (Optimize): New field, holds /optimize option.
4716
4717 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4718
4719         Fix crasher in re-opened #72347.
4720         * namespace.cs (Namespace.Lookup): Return null if
4721         DeclSpace.DefineType returns null.
4722
4723         Fix #72678.
4724         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4725
4726 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4727
4728         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4729         now returns null if it cannot resolve to an lvalue.
4730         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4731         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4732         returned null.  Remove check for SimpleName.
4733         (EventExpr.DoResolveLValue): New.
4734         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4735         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4736         error from ...
4737         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4738         avoid CS0131 error.
4739         (Unary.ResolveOperator): Move CS0211 check ...
4740         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4741         CS0131 error.
4742         (Unary.DoResolveLValue): Simplify.
4743         (AddressOf.DoResolveLValue): New.
4744         (ArrayAccess.DoResolveLValue): New.
4745
4746 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4747
4748         * attribute.cs (Attribute.Resolve): Add arguments casting for
4749         when types doesn't match ctor arguments.
4750
4751 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4752
4753         Fix parts of #63202.
4754         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4755         lookup of operator in base type.  Ensure that all checks happen
4756         when the operator resolves to an "op_..." method.
4757
4758 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4759
4760         Fix #71992.
4761         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4762         'ignore_cs0104' parameter.  Pass it to ...
4763         (NamespaceEntry.Lookup): ... this.
4764         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4765         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4766         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4767         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4768         Update.  Request that cs0104 errors be ignored.
4769         (ComposedCast.ResolveAsTypeStep): Update.
4770
4771 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4772
4773         Fix #59209.
4774         * expression.cs (Invocation.BetterFunction): Remove support for
4775         comparing virtual functions and their overrides.
4776         (Invocation.IsOverride): New.
4777         (Invocation.OverloadResolve): Don't consider 'override' functions
4778         during candidate selection.  Store them in a lookaside list.
4779         If the selected method is a 'virtual' function, use the list to
4780         find any overrides that are closer to the LHS type.
4781
4782 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4783
4784         * expression.cs (New.DoResolve): Add complex core type reduction.
4785         (New.Constantify): Converts complex core type syntax like 'new int ()'
4786         to simple constant.
4787         
4788 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4789
4790         * decl.cs (EntryType.EntryType): New constructor to create an
4791         updated copy of a cache entry.
4792         (MemberCache.AddMethods): Use it.
4793         (MemberCache.ClearDeclaredOnly): Remove.
4794         (MemberCache.MemberCache): Update.
4795
4796 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4797
4798         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4799         variable.  This one is represents the actual low-level declaration
4800         of the method, as opposed to the semantic level `IsStatic'.   
4801
4802         An anonymous method which is hosted into a static method might be
4803         actually an instance method.  IsStatic would reflect the
4804         container, while MethodIsStatic represents the actual code
4805         generated.
4806
4807         * expression.cs (ParameterReference): Use the new MethodIsStatic
4808         instead of IsStatic.
4809
4810         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4811         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4812         set on the current EmitContext. 
4813
4814         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4815         resolve our casted expression as an LValue.  This triggers the
4816         proper LValue processing that is later required by Assign.
4817
4818         This fixes 72347.
4819
4820         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4821
4822 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4823
4824         C# 2.0 Fixed buffer implementation
4825
4826         * anonymous.cs: Update after RegisterHelperClass renaming.
4827
4828         * attribute.cs (AttributeTester.fixed_buffer_cache):
4829         Cache of external fixed buffers.
4830         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4831         implementation if field is fixed buffer else null.
4832
4833         * class.cs
4834         (TypeContainer.AddField): Accept FieldMember instead of Field.
4835         (FieldBase.IsFieldClsCompliant): Extracted code from
4836         VerifyClsCompliance descendant customization.
4837         (FixedField): New class handles fixed buffer fields.
4838         (FixedFieldExternal): Keeps information about imported fixed
4839         buffer.
4840         (IFixedField): Make access to internal or external fixed buffer
4841         same.
4842
4843         * cs-parser.jay: Add fixed buffer parsing.
4844
4845         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4846         buffer.
4847
4848         * expression.cs (Indirection): Extended implementation to accept
4849         fixed buffer field.
4850         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4851         (ElementAccess.MakePointerAccess): Get type as parameter.
4852         (DoResolve): Add fixed buffer field expression conversion.
4853         (DoResolveLValue): Ditto.
4854         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4855         (ArrayPtr): Derives from FixedBufferPtr.
4856         (ArrayPtr.Emit): Add extra emit for array elements.
4857
4858         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4859
4860         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4861         for compiler generated types.
4862         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4863
4864         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4865         and consume less memory.
4866         (Fixed.Resolve): Add fixed buffer case.
4867
4868         * typemanager.cs (compiler_generated_attr_ctor,
4869         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4870         (HasElementType): Add our own implementation to work on every
4871         runtime.
4872
4873 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4874
4875         * anonymous.cs (CaptureContext): Track whether `this' has been
4876         referenced.   
4877
4878         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4879         only captured `this' if it was implicitly done (instance
4880         methods/variables were used). 
4881
4882         * codegen.cs (EmitContext.CaptureThis): New method to flag that
4883         `this' must be captured.
4884
4885 2005-01-30  Miguel de Icaza  <miguel@novell.com>
4886  
4887         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4888         is null it means that there has been no need to capture anything,
4889         so we just create a sibling.
4890
4891         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4892
4893         Just a partial fix.  The other half is fairly elusive.
4894         
4895 2005-02-10  Raja R Harinath  <rharinath@novell.com>
4896
4897         Fix #52586, cs0121-4.cs.
4898         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
4899         and return a hashtable.
4900         (MemberCache.ClearDeclaredOnly): New.
4901         (MemberCache.MemberCache): Update to change.  Make a deep copy of
4902         the method_hash of a base type too.
4903         (MemberCache.AddMethods): Adapt to having a deep copy of the base
4904         type methods.  Overwrite entries with the same MethodHandle so
4905         that the ReflectedType is correct.  The process leaves in base
4906         virtual functions and their overrides as distinct entries.
4907         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
4908         matters since it was boxed in a ArrayList before.
4909         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4910         modifier.
4911         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
4912         case of a virtual function and its override (choose the overload
4913         as better).
4914         (Invocation.OverloadResolve): Avoid 'override' members during
4915         'applicable_type' calculation.
4916
4917 2005-02-09  Raja R Harinath  <rharinath@novell.com>
4918
4919         Combine two near-redundant caches.
4920         * typemanager.cs (method_params): Rename from method_internal_params.
4921         (TypeManager.GetParameterData): New.  Replace
4922         Invocation.GetParameterData.
4923         (TypeManager.LookupParametersByBuilder): Remove.
4924         * expression.cs (Invocation.method_parameter_cache): Remove.
4925         (Invocation.GetParameterData): Remove.
4926         Update to changes.
4927         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4928         Update to changes.
4929
4930 2005-02-08  Raja R Harinath  <rharinath@novell.com>
4931
4932         Fix #72015.
4933         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4934         TypeManager.multicast_delegate_type is null, resolve it by looking
4935         up "System.MulticastDelegate".
4936         * rootcontext.cs (RootContext.ResolveCore): Simplify.
4937
4938 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
4939             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
4940             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
4941
4942         Fix cs0164.cs.
4943         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4944         (LabeledStatement.AddReference): New.  Set 'referenced'.
4945         (Goto.Resolve): Use it.
4946
4947 2005-02-05  John Luke  <john.luke@gmail.com>
4948
4949         * driver.cs: remove duplicate -doc line in Usage ()
4950
4951 2005-02-04  Raja R Harinath  <rharinath@novell.com>
4952
4953         * location.cs (Location.AddFile): Fix CS2002 error report.
4954
4955 2005-02-02  Martin Baulig  <martin@ximian.com>
4956
4957         * delegate.cs (Delegate.DefineType): Report an internal error if
4958         TypeManager.multicast_delegate_type is null.  See bug #72015 for
4959         details.        
4960
4961 2005-02-02  Raja R Harinath  <rharinath@novell.com>
4962
4963         Fix a crasher in a variant of #31984.
4964         * const.cs (Constant.CheckBase): New override that defers the
4965         new-or-override check in case the base type hasn't been populated
4966         yet.
4967         (Constant.Define): Ensure the new-or-override check is performed.
4968
4969 2005-02-01  Duncan Mak  <duncan@ximian.com>
4970
4971         * const.cs (LookupConstantValue): Check that `ce' is not null
4972         before calling GetValue ().
4973
4974 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4975
4976         Fix test-334.cs (#69519).
4977         * cs-parser.jay (using_alias_directive): Pass in an expression to
4978         NamespaceEntry.UsingAlias.
4979         (using_namespace_directive): Pass in an expression to
4980         NamespaceEntry.Using.
4981         (namespace_name): Don't flatten to a string.
4982         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4983         (NamespaceEntry.AliasEntry.Resolve): Lookup using
4984         ResolveAsTypeStep.
4985         (NamespaceEntry.UsingEntry): Likewise.
4986         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4987         changes.
4988         (NamespaceEntry.LookupForUsing): Remove.
4989         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4990         names.
4991         (NamespaceEntry.Lookup): Remove support for dotted names.
4992
4993 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4994
4995         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4996         split into two.
4997         (NamespaceEntry.ImplicitParent): Compute on demand.
4998         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4999         parallels the current.
5000         (NamespaceEntry.LookupForUsing): Use it.
5001         (NamespaceEntry.Lookup): If the current namespace-entry is
5002         implicit, don't search aliases and using tables.
5003
5004 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5005
5006         Fix #31984.
5007         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5008         BaseCache here.
5009         (TypeContainer.BaseCache): Compute on demand.
5010         (TypeContainer.FindMembers): Define constants and types if they're
5011         not already created.
5012         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5013         check.
5014         * const.cs (Constant.Define): Make idempotent.
5015
5016 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5017
5018         * pending.cs: Produce better code (no nops produced by using Ldarg
5019         + value).
5020         
5021         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5022         i - 1' it should be arg + 1.
5023
5024         Fixes bug #71819.
5025
5026 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5027
5028         * attribute.cs (Attribute.CheckAttributeType): Make private
5029         non-virtual.
5030         (Attribute.ResolveType): Make virtual.
5031         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5032         handling of RootContext.Tree.Types.
5033
5034 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5035
5036         Update attribute-handling to use the SimpleName/MemberAccess
5037         mechanisms.
5038         * cs-parser.jay (attribute): Pass in an expression to the
5039         constructors of Attribute and GlobalAttribute.
5040         * attribute.cs (Attribute): Take an expression for the name.
5041         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5042         passed in attribute name expression.
5043         (Attribute.CheckAttributeType): Use it.
5044         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5045         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5046         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5047         argument to prevent error messages if the lookup fails.
5048
5049 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5050
5051         * expression.cs (Indirection): Implemented IVariable interface
5052         to support indirection in AddressOf operator.
5053         (PointerArithmetic.Emit): Add optimalization for case where
5054         result can be precomputed.
5055
5056 2005-01-26  Martin Baulig  <martin@ximian.com>
5057
5058         * class.cs (TypeContainer.AttributeTargets): Return the correct
5059         AttributeTargets depending on our `Kind' instead of throwing an
5060         exception; fixes #71632.
5061
5062 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5063
5064         Fix #71257
5065         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5066         constant members.
5067
5068 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5069
5070         Fix #71602.
5071         * expression.cs (MemberAccess.DoResolve): Don't complain with
5072         cs0572 when the LHS of a member access has identical name and type
5073         name.
5074
5075 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5076
5077         Fix #71651, #71675
5078         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5079         CreatePermission.
5080         Create custom PermissionSet only for PermissionSetAttribute.
5081
5082 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5083
5084         Fix #71649
5085         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5086         delegates in static class.
5087
5088 2005-01-24  Martin Baulig  <martin@ximian.com>
5089
5090         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5091         merging an implicit block, just use its reachability.
5092
5093         * statement.cs (Block.Resolve): Make the unreachable code check
5094         work wrt. implicit blocks; see test-337 from #63842.
5095
5096 2005-01-21  Alp Toker  <alp@atoker.com>
5097  
5098         * cs-parser.jay: destructor_declaration's container is PartialContainer
5099         not Class when partial types are used, so use Kind prop instead of
5100         'is'.
5101         
5102 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5103
5104         * cs-parser.jay: Improve error reporting when an interface
5105         declares new types.
5106
5107 2005-01-20  Dick Porter  <dick@ximian.com>
5108
5109         * support.cs: SeekableStreamReader fix from Sandor Dobos
5110         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5111         chars are read.  Fixes bug 70369.
5112
5113 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5114
5115         * cs-parser.jay (catch_clause): Simplify current_block handling
5116         somewhat.
5117
5118 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5119
5120         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5121         code with ImplicitStandardConversion to handle the implicit
5122         conversion of method groups into valid delegate invocations. 
5123
5124         The problem is that in parameter handling we were using this code
5125         path.  Fixes bug #64698
5126
5127 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5128
5129         * cs-parser.jay: Fix several infelicities.
5130         - Avoid assigning to the parser value stack.  Code like 
5131           '$3 = null' is unclean.  Synthesize a value for the code block
5132           instead. 
5133         - Avoid using oob_stack for storing location information.  Use ...
5134         (_mark_): ... this.  New (empty) rule.  Saves the current location
5135         in $$.
5136         (foreach_statement): Avoid using oob_stack for current_block
5137         handling.  Use technique used in for_statement and
5138         using_statement.  Synthesize a value for the code block to store
5139         additional intermediate information.
5140
5141 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5142
5143         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5144         of a different type is only allowed to private fields of a
5145         containing type, not on fields of a base class.
5146
5147         See test-174.cs and error cs0122-9.cs
5148
5149 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5150
5151         Fix test-335.cs (bug #58126).
5152         * cs-parser.jay (argument): Split out non-expression parts of the
5153         rule into 'non_simple_argument'.
5154         (invocation_expression): Support parenthesized invocations with
5155         multiple arguments, and with single non-simple arguments.
5156
5157 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5158
5159         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5160         places.
5161
5162 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5163
5164         Fix cs0038-1.cs, cs1640-6.cs.
5165         * ecore.cs (Expression.Resolve): Remove special-case for
5166         SimpleName in error-handling.
5167         (Expression.almostMatchedMembers): Relax access permission to
5168         protected.
5169         (Expression.MemberLookupFailed): Handle duplicates in
5170         almostMatchedMembers list.
5171         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5172         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5173         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5174         overload if the passed in MemberInfo is a MethodBase.
5175
5176 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5177
5178         Fix #70749
5179         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5180         for non-CAS & merge permission sets properly.
5181
5182 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5183
5184         Improve standard-compliance of simple name and member access 
5185         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5186         * ecore.cs (FullNamedExpression): New abstract base class 
5187         for Namespaces and TypeExpressions.
5188         (ResolveFlags.SimpleName): Remove.
5189         (SimpleName): Remove support for dotted names.
5190         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5191         DeclSpace.FindType and DeclSpace.LookupType.
5192         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5193         (Expression.ExprClassName): Make member function.
5194         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5195         a namespace.  Remove creation of dotted "SimpleName"s.
5196         (MemberAccess.DoResolve): Likewise.
5197         * decl.cs (DeclSpace.Cache): Make private.
5198         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5199         (DeclSpace.FindType): Update.
5200         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5201         FullNamedExpression.
5202         * namespace.cs (Namespace): Derive from FullNamedExpression
5203         so that it can be part of expression resolution.
5204         (Namespace.Lookup): Return an FullNamedExpression.
5205         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5206         namespace.
5207         * rootcontext.cs (NamespaceLookup): Remove.
5208         (LookupType): Move to DeclSpace.
5209         * attribute.cs (CheckAttributeType): Update.
5210         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5211         (FindDocumentedTypeNonArray): Likewise.
5212
5213 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5214
5215         Fix cs0509.cs, cs1632.cs.
5216         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5217         is the same as IsInterface.
5218         (TypeContainer.GetClassBases): Likewise.
5219         * statement.cs (LabeledStatement.ig): New field.
5220         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5221         label.
5222         (LabeledStatement.DoEmit): Check that the label was created with
5223         the same ILGenerator.
5224
5225 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5226
5227         Fix #71058
5228         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5229         accessors to its properties.
5230
5231         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5232         from accessors to property.
5233         
5234 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5235
5236         Fix #70722
5237         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5238         only for overrides.
5239         
5240 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5241
5242         * attribute.cs: Check for null and empty strings.  
5243
5244         I have lost another battle to Paolo.
5245
5246 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5247
5248         Fix #70942
5249         * class.cs (PropertyMethod): Set Parent field in ctors.
5250         (SetMethod.InternalParameters): Add unsafe switch hack.
5251         Override MarkForDuplicationCheck where it is appropriate.
5252
5253         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5254         It says whether container allows members with the same name.
5255         Base default is no.
5256         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5257         Removed is_method parameter.
5258
5259 2005-01-06  Duncan Mak  <duncan@ximian.com>
5260
5261         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5262         because the previous change led to incorrect reporting of CS1032
5263         ("Cannot define/undefine preprocessor symbols after first token in
5264         file"). Instead of using `tokens_seen' as the only flag that
5265         triggers CS1040, introduce `comments_seen'. This new flag is used
5266         to signify having seen comments on the current line, so it is
5267         unset after a newline.
5268
5269 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5270
5271         * doc.cs : When searching for a type, find nested type too.
5272           This fixes bug #71040.
5273
5274 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5275
5276         * doc.cs :
5277           - Warn missing member comment on those classes which also does not
5278             have doc comments. Fixed bug #71041.
5279           - Don't warn missing doc comment on default constructor.
5280             Fixed bug #71042.
5281
5282 2005-01-06  Duncan Mak  <duncan@ximian.com>
5283
5284         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5285         comments, set `tokens_seen' to true. This allows us to detect
5286         misplaced preprocessor directives (i.e. not at the beginning of
5287         the a line, nor after whitespaces). In that case, report error
5288         CS1040. This fixes bug #56460.
5289
5290         * cs-parser.jay (interface_member_declaration): Add checks for
5291         IsExplicitImpl, and report CS0541 error if an interface member is
5292         defined as an explicit interface declaration.
5293
5294 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5295
5296         Fix #70817
5297         * class.cs (PropertyMethod): Set Parent field in ctors.
5298         (SetMethod.InternalParameters): Add unsafe switch hack.
5299         
5300         * decl.cs (MemberCore.Parent): Cannot be readonly.
5301
5302 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5303
5304         * decl.cs (DeclSpace.ResolveType): Remove.
5305         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5306         Merge in code from ...
5307         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5308         * class.cs, enum.cs: Update to changes.
5309
5310 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5311
5312         * anonymous.cs: Ensure that we init the scope of our parent if it
5313         has not been initialized yet.
5314
5315 2004-12-30  Duncan Mak  <duncan@ximian.com>
5316
5317         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5318         if field.FieldBuilder is null. Fixes #70758.
5319
5320         * convert.cs: Fixed some typos and updated some of the comments.
5321         (ImplicitStandardConversionExists):
5322         (TryImplicitIntConversion): If `target_type' is an interface and
5323         the type of `ic' implements this interface, return true or a new
5324         BoxedCast instead of null. This fixes #70468.
5325
5326 2004-12-29  Duncan Mak  <duncan@ximian.com>
5327
5328         * expression.cs (Argument.Emit): Check that Expr is
5329         IMemoryLocation before casting to it, and report CS1510 otherwise.
5330
5331         This fixes #70402.
5332
5333 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5334
5335         * statement.cs (Block.ThisVariable): remove the recursion here, to
5336         make the --profile more sane.
5337
5338 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5339
5340         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5341         assembly, by JB Evain.
5342
5343 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5344
5345         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5346           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5347         "parent" refers to enclosing type/class.  "base" refers to superclass.
5348
5349 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5350
5351         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5352         Ensure that we only have GlobalAttributes.
5353         * attribute.cs (Attribute.Emit): Make non-virtual.
5354         (GlobalAttribute.Emit): Remove.
5355         (Attribute.Resolve): Make virtual.
5356         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5357         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5358         the argument. Don't create one.
5359         (Attribute.GetObsoleteAttribute): Likewise.
5360         (Attribute.GetClsCompliantAttributeValue): Likewise.
5361         * class.cs, decl.cs: Update to changes.
5362
5363 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5364
5365         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5366         
5367         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5368         
5369         * statement.cs (Foreach.Resolve): Add error 186 report.
5370
5371 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5372
5373         * expression.cs (Conditional.DoResolve): Add warning 429.
5374         
5375         * statement.cs (If.Resolve): Add warning 665.
5376
5377 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5378
5379         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5380         except when in the parser, and in GlobalAttribute.
5381         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5382         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5383         RootContext.Tree.Types.NamespaceEntry once work is done.
5384         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5385         and resets RootContext.Tree.Types.NamespaceEntry.
5386
5387 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5388
5389         * cs-parser.jay: Don't create a block for every variable.
5390
5391 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5392
5393         * location.cs: Provide extra information.
5394
5395         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5396         variables from the captured environment, it is the ldarg_0.
5397
5398 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5399
5400         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5401         find a conclusion.
5402         
5403         * class.cs: Changed warning level for 169 to avoid developer
5404         displeasure from warning flooding. It will be changed back when they
5405         fix most of current BCL warnings.
5406         
5407         * RootContext.cs: Pushed default WarningLevel to 3.
5408         
5409         * statement.cs: Removed unused variable.
5410
5411 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5412
5413         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5414         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5415         Add error 502 report.
5416         (StaticClass.DefineType): Add error 441 report.
5417         (Class.AllowedModifiersProp): New virtual property as temporary
5418         extension to AllowedModifiers.
5419         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5420         to share implementation with StaticClass and don't call virtual
5421         methods from ctor.
5422         
5423         * driver.cs (MainDriver): Add error 1558 test.
5424
5425         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5426         report. Moved error 36 test here.
5427
5428         * statement.cs (Throw.Resolve): Add error 724 report.
5429
5430         * typemanager.cs: Add out_attribute_type core type.
5431         
5432 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5433
5434         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5435         3018 report.
5436         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5437
5438         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5439         3017 report.
5440         
5441         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5442
5443         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5444         Add error 3023 report.
5445         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5446
5447         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5448         implementation.
5449
5450 2004-12-12  John Luke  <john.luke@gmail.com>
5451
5452         * driver.cs (AddArgs): take -- into account when
5453         adding arguments, fixes bug 65710 
5454
5455 2004-12-12  Martin Baulig  <martin@ximian.com>
5456
5457         * expression.cs (Unary.TryReduceNegative): Added support for
5458         SByteConstant and ByteConstant.
5459         (Unary.Reduce): Check error values from TryReduceNegative().
5460
5461 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5462
5463         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5464         and report exception as error 182.
5465
5466 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5467
5468         * driver.cs (Main): Fix message when there are warnings.
5469
5470 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5471
5472         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5473
5474 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5475
5476         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5477         Reduced number of warnings.
5478         
5479         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5480
5481 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5482
5483         * driver.cs: Removed message.
5484
5485         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5486
5487 2004-12-08    <vargaz@freemail.hu>
5488
5489         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5490
5491 2004-12-08  Martin Baulig  <martin@ximian.com>
5492
5493         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5494         instead of a CS3002 for properties and indexer.
5495
5496 2004-12-08  Martin Baulig  <martin@ximian.com>
5497
5498         * decl.cs (MemberName.ToString): Make this work again.
5499
5500 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5501
5502         * attribute.cs (Resolve): Add error 591 detection.
5503
5504         * class.cs (FieldMember.Define): Add error 1547 detection.
5505         (Indexer.Define): Add error 620 detection.
5506         (Operator.Define): Add error 590 detection.
5507
5508         * ecore.cs: Missing argument for error 79.
5509
5510         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5511         detection.
5512
5513 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5514
5515         Fix #70106
5516         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5517         only.
5518
5519 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5520
5521         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5522           Some operator comments were suppressed.
5523         * doc.cs : Implicit/explicit operator name in doc comments are like
5524           "op_Explicit(type)~returnType", so added suffix handling.
5525
5526 2004-12-07  Martin Baulig  <martin@ximian.com>
5527
5528         * decl.cs
5529         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5530         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5531         (DeclSpace.ec): New protected field; store the EmitContext here.
5532         (DeclSpace.EmitContext): New public property; moved here from
5533         `TypeContainer'.
5534         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5535         EmitContext.
5536
5537         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5538         (Enum.Emit): Don't create a new EmitContext.
5539
5540         * delegate.cs (Delegate.DefineType): Always create the
5541         EmitContext.
5542
5543         * iterators.cs (Iterators.DefineIterator): Create a new
5544         EmitContext and store it in `ec'.
5545
5546 2004-08-24  Martin Baulig  <martin@ximian.com>
5547
5548         * typemanager.cs
5549         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5550         this for accessibility checks.
5551         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5552         IsNestedFamilyAccessible.
5553         (TypeManager.IsSubclassOf): New method, do what the name actually
5554         says.   
5555
5556 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5557
5558         Fix crash on cs0657-17.cs.
5559         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5560         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5561         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5562         the case where the NamespaceEntry gets overwritten.
5563
5564 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5565
5566         Fixed #69195, #56821
5567         * ecore.cs (ResolveBoolean): Tiny refactoring.
5568
5569         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5570         of right expression resolving when left is false constant and
5571         operator is LogicalAnd OR true constant and operator is LogicalOr.
5572
5573         * statement.cs (ResolveUnreachable): Always reports warning.
5574
5575 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5576
5577         * class.cs: Distinguish between 1721 and 1722 (just a little help
5578         for the programmer).
5579
5580 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5581
5582         * delegate.cs: Only allow this on new versions of the language. 
5583
5584 2004-12-02  Duncan Mak  <duncan@ximian.com>
5585
5586         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5587         Expression class.
5588         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5589         here as a static method. Take an additional bool out parameter
5590         `must_do_cs1540_check' for signaling to InstanceResolve.
5591         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5592         member field from PropertyExpr class and made it an argument of
5593         the method instead.
5594         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5595         check for MarshalByRefObject, and report CS0122 instead of CS1540.
5596         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5597         and `remove_accessor' as well as InstanceResolve: report CS0122
5598         where applicable.
5599
5600         Fixes #70129.
5601
5602 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5603
5604         Fix test-327.cs, test-328.cs, and put in early infrastructure
5605         for eventually fixing #52697.
5606         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5607         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5608         from other methods.
5609         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5610         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5611         (VerifyUsing, error246): Update.
5612         * rootcontext.cs (RootContext.NamespaceLookup): Just use
5613         'NamespaceEntry.LookupNamespaceOrType'.
5614
5615 2004-12-03  Martin Baulig  <martin@ximian.com>
5616
5617         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5618         method as our child, call AnonymousMethod.Compatible() on it.
5619
5620 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5621
5622         Disable XML documentation support in 'basic' profile.
5623         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
5624         Redirect XmlElement to System.Object.
5625         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
5626         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
5627         * mcs.exe.sources: Add doc-bootstrap.cs.
5628         * doc-bootstrap.cs: New file.  Contains empty stub implementation
5629         of doc.cs.
5630
5631 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
5632
5633         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5634           comments are allowed.
5635
5636 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5637
5638         * delegate.cs: Add checks for subtypes in paramaters and return values
5639         in VerifyMethod () to add support for Covariance/Contravariance
5640         in delegates.
5641         
5642 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5643
5644         * report.cs: Remove extra closing parenthesis.
5645
5646         * convert.cs (Error_CannotImplicitConversion): If the name of the
5647         types are the same, provide some extra information.
5648
5649         * class.cs (FieldBase): Use an unused bit field from the field to
5650         encode the `has_offset' property from the FieldMember.  This saves
5651         a couple of Ks on bootstrap compilation.
5652
5653         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5654         method as our child, return the AnonymousMethod resolved
5655         expression.
5656
5657         * expression.cs (New.DoResolve): Allow return values from
5658         NewDelegate to also include AnonymousMethods.
5659
5660         Fixes #70150.
5661
5662 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
5663
5664         Fix bug #70102
5665         * attribute.cs (Resolve): Improved implementation of params
5666         attribute arguments.
5667
5668         * support.cs (ParameterData): Add HasParams to be faster.
5669
5670 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
5671
5672         all things are for /doc support:
5673
5674         * doc.cs: new file that supports XML documentation generation.
5675         * mcs.exe.sources: added doc.cs.
5676         * driver.cs:
5677           Handle /doc command line option.
5678           Report error 2006 instead of 5 for missing file name for /doc.
5679           Generate XML documentation when required, after type resolution.
5680         * cs-tokenizer.cs:
5681           Added support for picking up documentation (/// and /** ... */),
5682           including a new XmlCommentState enumeration.
5683         * cs-parser.jay:
5684           Added lines to fill Documentation element for field, constant,
5685           property, indexer, method, constructor, destructor, operator, event
5686           and class, struct, interface, delegate, enum.
5687           Added lines to warn incorrect comment.
5688         * rootcontext.cs :
5689           Added Documentation field (passed only when /doc was specified).
5690         * decl.cs:
5691           Added DocComment, DocCommentHeader, GenerateDocComment() and
5692           OnGenerateDocComment() and some supporting private members for
5693           /doc feature to MemberCore.
5694         * class.cs:
5695           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5696         * delegate.cs:
5697           Added overriden DocCommentHeader.
5698         * enum.cs:
5699           Added overriden DocCommentHeader and GenerateDocComment().
5700
5701 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
5702
5703         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5704         unwrapping the enumeration values, chain to
5705         DoConstantNumericPromotions again, so we can promote things to the
5706         fundamental types (takes care of enums that are bytes, sbytes).
5707
5708         Fixes bug #62054.
5709
5710 2004-12-01  Raja R Harinath  <rharinath@novell.com>
5711
5712         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5713         Fix long-standing bug in type-lookup.  Use FindType instead of
5714         LookupType when ec.ResolvingTypeTree.
5715         (Attribute.ResolveType, Attribute.Resolve)
5716         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5717         Update to changes.
5718         (Attributes.Search): Remove internal version.  Update.
5719         (Attributes.SearchMulti): Update.
5720         (Attributes.GetClsCompliantAttribute): Remove.
5721         (Attributes.GetIndexerNameAttribute): Remove.
5722         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5723         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5724         * class.cs (Indexer.Define): Likewise.
5725
5726 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
5727
5728         Fix bug #68790
5729         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5730         MarshallByReference members access.
5731
5732         * expression.cs: Use CheckMarshallByRefAccess;
5733         Better error CS0197 message.
5734
5735         * report.cs: Print whole related error message.
5736
5737 2004-11-30  Raja R Harinath  <rharinath@novell.com>
5738
5739         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
5740         the current directory to help debugging.
5741
5742 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5743
5744         * class (GetClassBases): Better error 60 report.
5745         (EventProperty): Disabled warning 67 detection.
5746
5747 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5748
5749         Fix bug #60324
5750         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5751
5752         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5753         precise values.
5754
5755 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5756
5757         Fix bug #49488
5758         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5759
5760         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5761
5762 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
5763
5764         * attribute.cs (Attribute.Resolve): Refine error reporting and
5765         report a cs0117 if the identifier does not exist, to distinguish
5766         from 0617 which is a miss-use of the actual identifier.
5767
5768         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5769         between cs0070 and cs0079.
5770
5771         * class.cs (MemberBase.DoDefine): When reporting a wrong
5772         accessibility level, we use MethodCore to compare instead of
5773         Method (this was a regression in some refactoring effort).
5774
5775         So now we correctly report cs0056 again.
5776
5777         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5778         testing the target_type (which was known to be object_type) and
5779         not the source type (which is anonymous_method).
5780
5781         Fixed reporting of error cs1660.
5782
5783         * expression.cs (UserCast.Source): Expose the underlying cast.
5784
5785         * statement.cs (Switch.SwitchGoverningType): Sort the list of
5786         allowed types to find a match to int32 first (most common).
5787
5788         In addition, it ignores any ImplicitUserConversions that did an
5789         internal implicit conversion (as the switch statement allows only
5790         one integral conversion to exist).
5791
5792         * class.cs (PartialContainer.Create): rename `name' to
5793         `member_name' for clarity.  Then replace the string calls with a
5794         call to MemberName.GetPartialName, as now using
5795         MemberName.ToString is an error (this is due to the side effects
5796         it had, that were fixed in the past).
5797
5798         This will restore the error reporting on a number of partial class
5799         errors that were missusing this (and getting an exception as a
5800         results, which is now just a plain textual warning, because
5801         yyparse debug output would crash otherwise).
5802
5803 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5804
5805         * Makefile (PROGRAM_INSTALL_DIR): Remove.
5806
5807 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5808
5809         * rootcontext.cs (LookupType): Make sure to cache lookups that
5810         don't give us a negative result. This saves about 5% of corlib
5811         compilation time.
5812
5813 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5814
5815         * report.cs (AbstractMessage.Print): messages are sent to stderr
5816
5817         * class.cs (TypeContainer.GetClassBases): It is an error to have a
5818         non-interface in the list of interfaces (at this point, either
5819         parent was properly set, or a base class is being listed in the
5820         interfaces section).
5821
5822         This flags error 1722, and resolves the crash from bug 69259.
5823
5824 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5825
5826         * statement.cs (Using.EmitExpressionFinally): make this work right
5827         for valuetypes. Fixes 69926.
5828
5829 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5830
5831         * const.cs (Const.ChangeType): Cope with the "0 literal can be
5832         converted to an enum" here, before we try to change the underlying
5833         type.  This code exists, but it is a different code path than the
5834         one used while encoding constants.
5835
5836         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5837         old bug: when converting from the null literal to a pointer,
5838         return an EmptyCast, not the NullLiteral.
5839
5840         This fixes #69921, the recent null_type changes probably made this
5841         bug more prominent.
5842
5843         (ImplicitReferenceConversionExists): In addition, resynchronized
5844         the code here, so it matches the same code in
5845         ImplicitReferenceConversionExists for the `from any class-type S
5846         to any interface-type T'.
5847         
5848
5849 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
5850
5851         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5852
5853 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
5854
5855         * cs-parser.jay: Use verbosity accordingly. 
5856
5857 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5858
5859         * expression.cs (Unary.ResolveOperator): Do not report warning;
5860         AddressOf reads from variable.
5861         
5862         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5863
5864 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5865
5866         Fix bug #69462
5867
5868         * attribute.cs (Attributable): Removed CheckTargets.
5869         (Attributes.Emit): Explicit attribute targets are tested here.
5870
5871         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5872         not enabled for interfaces.
5873
5874         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5875         (GetAssemblyName): Ouch next bug there.
5876
5877 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5878
5879         * expression.cs: Error 275 added.
5880         
5881 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
5882
5883         Fix bug #69177 (Implemented decimal constant support)
5884
5885         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5886         (BinaryFold): Add DecimalConstant.
5887
5888         * const.cs (Define): Decimal constant 
5889         (is not constant.
5890         (ChangeType): Add decimal type handling.
5891         (LookupConstantValue): Don't set value for decimal type but
5892         emit DecimalConstantAttribute. Needed for constant optimization.
5893
5894         * constant.cs (ToDecimal): New method.
5895         (ConvertToDecimal): New method.
5896         (IntConstant): Implemented ConvertToDecimal.
5897         (DecimalConstant.Emit): Emit optimized version for decimals in
5898         int range.
5899
5900         * expression.cs (ResolveOperator): Changed order of constant
5901         reduction to work correctly with native types which have
5902         overloaded operators.
5903         (ResolveMemberAccess): Extract constant value from attribute
5904         for decimal type.
5905
5906         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
5907
5908         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
5909         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
5910         (ChangeType): Decimal is special.
5911         (TypeToCoreType): Add decimal type.
5912
5913 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
5914
5915         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
5916         decimal types.
5917
5918 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
5919
5920         * class.cs (EventField.ApplyAttributeBuilder): Fix error
5921         test cs1667-5.cs.
5922
5923 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
5924
5925         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
5926
5927         * pending.cs (PendingImplementation): Grab only interfaces.
5928
5929 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
5930
5931         * statement.cs (ForeachHelperMethods): Add location member and
5932         error 202 detection.
5933
5934 2004-11-19  Raja R Harinath  <rharinath@novell.com>
5935
5936         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
5937         automatically handled by executable.make.
5938         (PROGRAM): Make profile-specific.
5939
5940 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
5941
5942         * expression.cs (DoResolveBase): Fixed wrong warning for out
5943         variables.
5944
5945 2004-11-18  Martin Baulig  <martin@ximian.com>
5946
5947         Merged latest changes into gmcs.  Please keep this comment in
5948         here, it makes it easier for me to see what changed in MCS since
5949         the last time I merged.
5950
5951 2004-11-17  Raja R Harinath  <rharinath@novell.com>
5952
5953         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
5954         (TypeHandle.GetMemberCache): New.
5955         (TypeHandle.TypeHandle): Update.
5956         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
5957         (TypeManager.LookupParentInterfacesCache):
5958         Rename from LookupInterfaceCache.  Optimize slightly.
5959         (TypeManager.MemberLookup_FindMembers): Update.
5960         * decl.cs (MemberCache.MemberCache): Set Container to null in the
5961         multi-type variant.
5962         (AddCacheContents): Rename from AddHashtable.
5963         * class.cs (TypeContainer.parent_container): Remove.
5964         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
5965         (TypeContainer.DoDefineMembers): Don't initialize it.
5966         Update to name changes.
5967         
5968 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
5969
5970         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
5971         that factors the code to check access modifiers on override.  
5972
5973         (PropertyBase): Use the code here.
5974
5975         Patch from Lluis S'anchez, fixes bug #69361.
5976
5977 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
5978
5979         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
5980         routine that is used to report the use of a captured variable
5981         whose address has been taken.
5982
5983         There are two checks: one when variables are being captured and
5984         the other check is when the address of a variable is taken. 
5985         
5986         (because an anonymous methods might be resolved before *or* after
5987         the address has been taken) and 
5988
5989         * expression.cs (Conditional.DoResolve): Remove the special
5990         casing that Martin added to trueExpr and falseExpr being both
5991         NullLiteral.  We get the right behavior now just by introducing
5992         the null_type into the compiler. 
5993
5994         * convert.cs (ExplicitConversion): Change the code to use
5995         null_type instead of testing `expr is NullLiteral'.
5996         (ImplicitConversionStandard): use null_type too.
5997         (ImplicitReferenceConversionExists): use null_type too.
5998         (ImplicitReferenceConversion): use null_type too.
5999
6000         * literal.cs: The type of `NullLiteral' is now null_type instead
6001         of object_type. 
6002         (Resolve): Set the type here.
6003
6004         * typemanager.cs: Introduce null_type.
6005
6006 2004-11-17  Martin Baulig  <martin@ximian.com>
6007
6008         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6009         direction, like FindMembers() does.  Fixes #69546, testcase is in
6010         test-315.cs.    
6011
6012 2004-11-16  Martin Baulig  <martin@ximian.com>
6013
6014         This is based on a patch from Marek Safar, see bug #69082.
6015         Fixes bugs #63705 and #67130.
6016
6017         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6018         method; create a MemberCache for an interface type and cache the
6019         result.
6020
6021         * decl.cs (IMemberContainer.ParentContainer): Removed.
6022         (IMemberContainer.ParentCache): New property.
6023         (MemberCache.SetupCacheForInterface): Removed.
6024         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6025         to create a cache for an interface's "parent".
6026
6027         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6028         interfaces too.
6029
6030 2004-11-16  Martin Baulig  <martin@ximian.com>
6031
6032         Merged back from gmcs; these changes already went into gmcs a
6033         couple of weeks ago.
6034
6035         * typemanager.cs
6036         (TypeManager.AddUserType): Removed the `ifaces' argument.
6037         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6038         `TypeExpr []'.
6039         (TypeManager.AddUserInterface): Removed.
6040         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6041         `TypeExpr []'.
6042         (TypeManager.GetInterfaces): Likewise.
6043         (TypeManager.GetExplicitInterfaces): Likewise.
6044
6045         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6046
6047         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6048         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6049
6050 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6051
6052         * statement.cs: Avoid adding bools to a hashtable.
6053
6054 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6055
6056         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6057         calling an unsafe method from a safe location.
6058
6059 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6060
6061         Fix #69167
6062         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6063
6064 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6065
6066         * namespace.cs (VerifyUsing): use GetPartialName instead of
6067         ToString. 
6068
6069 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6070
6071         * statement.cs (Return.Resolve): Fix regression in typo: if
6072         `in_exc', we have to request a NeedReturnLabel, this was a typo
6073         introduced in the anonymous method check-in.  Fixes #69131.
6074
6075         * Indexers were using the ShortName when defining themselves,
6076         causing a regression in the compiler bootstrap when applying the
6077         patch from 2004-11-02 (first part), now they use their full name
6078         and the bug is gone.
6079
6080 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6081
6082         * driver.cs: Strip the path from the names of embedded resources. Fixes
6083         #68519.
6084
6085 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6086
6087         Fix error message regression: cs0104-2.cs.
6088         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6089         (AliasEntry.Resolve): Update.
6090         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6091         'silent' flag.
6092         (RootContext.LookupType): Update.
6093
6094 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6095
6096         * cs-parser.jay: Add support for handling accessor modifiers
6097         * class: Add support port accessor modifiers and error checking,
6098         define PropertyMethod.Define as virtual (not abstract anymore)
6099         * ecore.cs: Add checking for proeprties access with access modifiers
6100         * iterators.cs: Modify Accessor constructor call based in the modified
6101         constructor
6102 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6103
6104         * expression.cs (StringConcat): Handle being called twice,
6105         as when we have a concat in a field init with more than two
6106         ctors in the class
6107
6108 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6109
6110         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6111         special case explicit implementations, we should always produce
6112         the .property or .event declaration.
6113         
6114         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6115         since it will not return correct data if people use this
6116         unresolved in the presence of using statements (see test-313).
6117
6118         * class.cs (MethodData.Define): If we are an explicit interface
6119         implementation, set the method name to the full name of the
6120         interface plus the name of the method.  
6121
6122         Notice that using the method.MethodName.GetFullName() does not
6123         work, as it will only contain the name as declared on the source
6124         file (it can be a shorthand in the presence of using statements)
6125         and not the fully qualifed type name, for example:
6126
6127         using System;
6128
6129         class D : ICloneable {
6130                 object ICloneable.Clone ()  {
6131                 }
6132         }
6133
6134         Would produce a method called `ICloneable.Clone' instead of
6135         `System.ICloneable.Clone'.
6136
6137         * namespace.cs (Alias.Resolve): Use GetPartialName.
6138         
6139 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6140
6141         * cs-parser.jay: Add error 1055 report.
6142
6143 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6144
6145         * assign.cs (Assign.DoResolve): Only do the transform of
6146         assignment into a New if the types are compatible, if not, fall
6147         through and let the implicit code deal with the errors and with
6148         the necessary conversions. 
6149
6150 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6151
6152         * cs-parser.jay: Add error 1031 report.
6153
6154         * cs-tokenizer.cs: Add location for error 1038.
6155
6156 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6157
6158         * cs-parser.jay: Add error 1016 report.
6159
6160 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6161
6162         * cs-parser.jay: Add errors 1575,1611 report.
6163
6164 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6165
6166         * cs-parser.jay: Add error 1001 report.
6167
6168 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6169
6170         Fix #68850
6171         * attribute.cs (GetMarshal): Add method argument for
6172         caller identification.
6173
6174         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6175         agument for GetMarshal and RuntimeMissingSupport.
6176
6177 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6178
6179         * attribute.cs (ExtractSecurityPermissionSet): Removed
6180         TypeManager.code_access_permission_type.
6181
6182         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6183
6184 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6185
6186         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6187         for obsolete use of a variable here.   Fixes regression on errors
6188         cs0619-25 and cs0619-26.
6189
6190 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6191
6192         Fix #62358, implemented security attribute encoding.
6193
6194         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6195         Tests permitted SecurityAction for assembly or other types.
6196         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6197         data from SecurityPermissionAttribute to PermisionSet class.
6198
6199         * class.cs (ApplyAttributeBuilder): Added special handling
6200         for System.Security.Permissions.SecurityAttribute based types.
6201
6202         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6203         special handling for System.Security.Permissions.SecurityAttribute
6204         based types.
6205
6206         * enum.cs (ApplyAttributeBuilder): Added special handling
6207         for System.Security.Permissions.SecurityAttribute based types.
6208
6209         * parameter.cs (ApplyAttributeBuilder): Added special handling
6210         for System.Security.Permissions.SecurityAttribute based types.
6211
6212         * rootcontext.cs: Next 2 core types.
6213
6214         * typemanager.cs (TypeManager.security_permission_attr_type):
6215         Built in type for the SecurityPermission Attribute.
6216         (code_access_permission_type): Build in type.
6217
6218 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6219
6220         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6221         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6222         all of this information into
6223         EmitContext.EmitCapturedVariableInstance.
6224         
6225         * codegen.cs (EmitCapturedVariableInstance): move here the
6226         funcionality of emitting an ldarg.0 in the presence of a
6227         remapping.   This centralizes the instance emit code.
6228
6229         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6230         then emit a load of this: it means that we have reached the
6231         topmost ScopeInfo: the one that contains the pointer to the
6232         instance of the class hosting the anonymous method.
6233
6234         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6235         captures to the topmost CaptureContext.
6236
6237 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6238
6239         * expression.cs (LocalVariableReference): Move the knowledge about
6240         the iterators into codegen's EmitCapturedVariableInstance.
6241
6242 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6243
6244         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6245         all code paths return a value from an anonymous method (it is the
6246         same as the 161 error, but for anonymous methods).
6247
6248 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6249
6250         The introduction of anonymous methods in the compiler changed
6251         various ways of doing things in the compiler.  The most
6252         significant one is the hard split between the resolution phase
6253         and the emission phases of the compiler.
6254
6255         For instance, routines that referenced local variables no
6256         longer can safely create temporary variables during the
6257         resolution phase: they must do so from the emission phase,
6258         since the variable might have been "captured", hence access to
6259         it can not be done with the local-variable operations from the runtime.
6260         
6261         * statement.cs 
6262
6263         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6264         is a toplevel block.
6265
6266         (ToplevelBlock): A new kind of Block, these are the blocks that
6267         are created by the parser for all toplevel method bodies.  These
6268         include methods, accessors and anonymous methods.
6269
6270         These contain some extra information not found in regular blocks:
6271         A pointer to an optional CaptureContext (for tracking captured
6272         local variables and parameters).  A pointer to the parent
6273         ToplevelBlock.
6274         
6275         (Return.Resolve): Catch missmatches when returning a value from an
6276         anonymous method (error 1662).
6277         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6278         phase.
6279
6280         (Break.Resolve): ditto.
6281
6282         (SwitchLabel): instead of defining the labels during the
6283         resolution phase, we now turned the public ILLabel and ILLabelCode
6284         labels into methods called GetILLabelCode() and GetILLabel() that
6285         only define the label during the Emit phase.
6286
6287         (GotoCase): Track the SwitchLabel instead of the computed label
6288         (its contained therein).  Emit the code by using
6289         SwitchLabel.GetILLabelCode ().
6290
6291         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6292         whether the Local has been captured or not.
6293
6294         (LocalInfo.IsCaptured): New property, used to tell whether the
6295         local has been captured.
6296         
6297         * anonymous.cs: Vastly updated to contain the anonymous method
6298         support.
6299
6300         The main classes here are: CaptureContext which tracks any
6301         captured information for a toplevel block and ScopeInfo used to
6302         track the activation frames for various local variables.   
6303
6304         Each toplevel block has an optional capture context associated
6305         with it.  When a method contains an anonymous method both the
6306         toplevel method and the anonymous method will create a capture
6307         context.   When variables or parameters are captured, they are
6308         recorded on the CaptureContext that owns them, for example:
6309
6310         void Demo () {
6311              int a;
6312              MyDelegate d = delegate {
6313                  a = 1;
6314              }
6315         }
6316
6317         Here `a' will be recorded as captured on the toplevel
6318         CapturedContext, the inner captured context will not have anything
6319         (it will only have data if local variables or parameters from it
6320         are captured in a nested anonymous method.
6321
6322         The ScopeInfo is used to track the activation frames for local
6323         variables, for example:
6324
6325         for (int i = 0; i < 10; i++)
6326                 for (int j = 0; j < 10; j++){
6327                    MyDelegate d = delegate {
6328                         call (i, j);
6329                    }
6330                 }
6331
6332         At runtime this captures a single captured variable `i', but it
6333         captures 10 different versions of the variable `j'.  The variable
6334         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6335         recorded on a child.  
6336
6337         The toplevel ScopeInfo will also track information like the `this'
6338         pointer if instance variables were referenced (this is necessary
6339         as the anonymous method lives inside a nested class in the host
6340         type of the method). 
6341
6342         (AnonymousMethod): Expanded to track the Toplevel, implement
6343         `AnonymousMethod.Compatible' to tell whether an anonymous method
6344         can be converted to a target delegate type. 
6345
6346         The routine now also produces the anonymous method content
6347
6348         (AnonymousDelegate): A helper class that derives from
6349         DelegateCreation, this is used to generate the code necessary to
6350         produce the delegate for the anonymous method that was created. 
6351
6352         * assign.cs: API adjustments for new changes in
6353         Convert.ImplicitStandardConversionExists.
6354
6355         * class.cs: Adjustments to cope with the fact that now toplevel
6356         blocks are of type `ToplevelBlock'. 
6357
6358         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6359         insteda of standard blocks.
6360
6361         Flag errors if params arguments are passed to anonymous methods.
6362
6363         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6364         `CurrentAnonymousMethod' which points to the current Anonymous
6365         Method.  The variable points to the AnonymousMethod class that
6366         holds the code being compiled.  It is set in the new EmitContext
6367         created for the anonymous method.
6368
6369         (EmitContext.Phase): Introduce a variable and an enumeration to
6370         assist in enforcing some rules about when and where we are allowed
6371         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6372         only one that enfonces this right now).
6373
6374         (EmitContext.HaveCaptureInfo): new helper method that returns
6375         whether we have a CapturedContext initialized.
6376
6377         (EmitContext.CaptureVariable): New method used to register that a
6378         LocalInfo must be flagged for capturing. 
6379
6380         (EmitContext.CapturedParameter): New method used to register that a
6381         parameters must be flagged for capturing. 
6382         
6383         (EmitContext.CapturedField): New method used to register that a
6384         field must be flagged for capturing. 
6385
6386         (EmitContext.HaveCapturedVariables,
6387         EmitContext.HaveCapturedFields): Return whether there are captured
6388         variables or fields. 
6389
6390         (EmitContext.EmitMethodHostInstance): This is used to emit the
6391         instance for the anonymous method.  The instance might be null
6392         (static methods), this (for anonymous methods that capture nothing
6393         and happen to live side-by-side with the current method body) or a
6394         more complicated expression if the method has a CaptureContext.
6395
6396         (EmitContext.EmitTopBlock): Routine that drives the emission of
6397         code: it will first resolve the top block, then emit any metadata
6398         and then emit the code.  The split is done so that we can extract
6399         any anonymous methods and flag any captured variables/parameters.
6400         
6401         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6402         during this phase, the ILGenerator should not be used as labels
6403         and local variables declared here might not be accessible to any
6404         code that is part of an anonymous method.  
6405
6406         Exceptions to this include the temporary variables that are
6407         created by some statements internally for holding temporary
6408         variables. 
6409         
6410         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6411         metadata for a cb
6412
6413         (EmitContext.TemporaryReturn): This method is typically called
6414         from the Emit phase, and its the only place where we allow the
6415         ReturnLabel to be defined other than the EmitMeta.  The reason is
6416         that otherwise we would have to duplicate a lot of logic in the
6417         Resolve phases of various methods that today is on the Emit
6418         phase. 
6419
6420         (EmitContext.NeedReturnLabel): This no longer creates the label,
6421         as the ILGenerator is not valid during the resolve phase.
6422
6423         (EmitContext.EmitThis): Extended the knowledge in this class to
6424         work in anonymous methods in addition to iterators. 
6425
6426         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6427         code is necessary on the stack to access the instance to a local
6428         variable (the variable will be accessed as a field).
6429
6430         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6431         EmitContext.EmitAddressOfParameter): Routines to support
6432         parameters (not completed at this point). 
6433         
6434         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6435         will also remove the parameters.
6436
6437         * convert.cs (Convert): Define a `ConstantEC' which points to a
6438         null.  This is just to prefity some code that uses
6439         ImplicitStandardConversion code and do not have an EmitContext
6440         handy.
6441
6442         The idea is to flag explicitly that at that point in time, it is
6443         known that the conversion will not trigger the delegate checking
6444         code in implicit conversions (which requires a valid
6445         EmitContext). 
6446
6447         Everywhere: pass new EmitContext parameter since
6448         ImplicitStandardConversionExists now requires it to check for
6449         anonymous method conversions. 
6450
6451         (Convert.ImplicitStandardConversionExists): If the type of an
6452         expression is the anonymous_method_type, and the type is a
6453         delegate, we invoke the AnonymousMethod.Compatible method to check
6454         whether an implicit conversion is possible. 
6455
6456         (Convert.ImplicitConversionStandard): Only do implicit method
6457         group conversions if the language level is not ISO_1.
6458
6459         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6460         MethodInfo for the Invoke method.  used by Delegate and
6461         AnonymousDelegate.
6462
6463         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6464         method conversions if the target type is a delegate.
6465
6466         Removed extra debugging nops.
6467
6468         (LocalVariableReference): Turn the `local_info' into a public
6469         field. 
6470
6471         Add `prepared' field, the same hack used for FieldExprs to cope
6472         with composed assignments, as Local variables do not necessarily
6473         operate purely on the stack as they used to: they can be captured
6474         fields. 
6475
6476         Add `temp' for a temporary result, like fields.
6477
6478         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6479
6480         It now copes with Local variables that are captured and emits the
6481         proper instance variable to load it from a field in the captured
6482         case. 
6483
6484         (ParameterReference.DoResolveBase): During the resolve phase,
6485         capture parameters if we are in an anonymous method.
6486
6487         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6488         anonymous method, use the EmitContext helper routines to emit the
6489         parameter reference.
6490
6491         * iterators.cs: Set RemapToProxy to true/false during the
6492         EmitDispose class.
6493
6494         * parameters.cs (GetParameterByName): New helper method. 
6495
6496         * typemanager.cs (anonymous_method_type) a new type that
6497         represents an anonyous method.  This is always an internal type,
6498         used as a fencepost to test against the anonymous-methodness of an
6499         expression. 
6500         
6501 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6502
6503         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6504         561 report.
6505         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6506
6507 2004-10-18  Martin Baulig  <martin@ximian.com>
6508
6509         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6510         `Type' directly, but call ResolveType() on it.
6511         (Catch.Resolve): Likewise.
6512         (Foreach.Resolve): Likewise.
6513
6514 2004-10-18  Martin Baulig  <martin@ximian.com>
6515
6516         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6517         `Type' directly, but call ResolveType() on it.
6518         (Probe.DoResolve): Likewise.
6519         (ArrayCreation.LookupType): Likewise.
6520         (TypeOf.DoResolve): Likewise.
6521         (SizeOf.DoResolve): Likewise.
6522
6523 2004-10-18  Martin Baulig  <martin@ximian.com>
6524
6525         * expression.cs (Invocation.BetterFunction): Put back
6526         TypeManager.TypeToCoreType().
6527
6528 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6529
6530         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6531         the ResolveType.
6532
6533 2004-10-18  Martin Baulig  <martin@ximian.com>
6534
6535         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
6536         `Type' directly, but call ResolveType() on it.
6537
6538 2004-10-18  Martin Baulig  <martin@ximian.com>
6539
6540         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6541         `Type' directly, but call ResolveType() on it.
6542         (MemberBase.DoDefine): Likewise.
6543
6544         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6545         `Type' directly, but call ResolveType() on it.
6546         (ComposedCast.DoResolveAsTypeStep): Likewise.
6547
6548         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6549         `Type' directly, but call ResolveType() on it.
6550
6551 2004-10-17  John Luke  <john.luke@gmail.com>
6552
6553         * class.cs (Operator.GetSignatureForError): use CSharpName
6554
6555         * parameter.cs (Parameter.GetSignatureForError): Returns
6556         correct name even if was not defined.
6557
6558 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6559
6560         Fix #65816.
6561         * class.cs (TypeContainer.EmitContext): New property.
6562         (DefineNestedTypes): Create an emitcontext for each part.
6563         (MethodCore.DoDefineParameters): Use container's emitcontext.
6564         Pass type array to InternalParameters.
6565         (MemberBase.DoDefine): Use container's emitcontext.
6566         (FieldMember.Define): Likewise.
6567         (Event.Define): Likewise.
6568         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6569         Pass type array to InternalParameters.
6570         (SetIndexerMethod.GetParameterInfo): Likewise.
6571         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6572         * delegate.cs (Define): Pass emitcontext to
6573         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6574         array to InternalParameters.
6575         * expression.cs (ParameterReference.DoResolveBase): Pass
6576         emitcontext to GetParameterInfo.
6577         (ComposedCast.DoResolveAsTypeStep): Remove check on
6578         ec.ResolvingTypeTree.
6579         * parameter.cs (Parameter.Resolve): Change argument to
6580         EmitContext.  Use ResolveAsTypeTerminal.
6581         (Parameter.GetSignature): Change argument to EmitContext.
6582         (Parameters.ComputeSignature): Likewise.
6583         (Parameters.ComputeParameterTypes): Likewise.
6584         (Parameters.GetParameterInfo): Likewise.
6585         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6586         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6587         * support.cs (InternalParameters..ctor): Remove variant that takes
6588         a DeclSpace.
6589         * typemanager.cs (system_intptr_expr): New.
6590         (InitExpressionTypes): Initialize it.
6591
6592 2004-10-12  Chris Toshok  <toshok@ximian.com>
6593
6594         * cs-parser.jay: fix location for try_statement and catch_clause.
6595
6596 2004-10-11  Martin Baulig  <martin@ximian.com>
6597
6598         * report.cs: Don't make --fatal abort on warnings, we have
6599         -warnaserror for that.
6600
6601 2004-10-07  Raja R Harinath  <rharinath@novell.com>
6602
6603         More DeclSpace.ResolveType avoidance.
6604         * decl.cs (MemberCore.InUnsafe): New property.
6605         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
6606         with newly created EmitContext.
6607         (FieldMember.Define): Likewise.
6608         * delegate.cs (Delegate.Define): Likewise.
6609         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6610         only if normal name-lookup fails.
6611         (TypeExpr.DoResolve): Enable error-checking.
6612         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6613         (SizeOf.DoResolve): Likewise.
6614         (ComposedCast.DoResolveAsTypeStep): Likewise.
6615         (StackAlloc.DoResolve): Likewise.
6616         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6617         (Block.Unsafe): New property.
6618         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6619         (Unsafe): Set 'unsafe' flag of contained block.
6620         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6621         (Fixed.Resolve): Likewise.
6622         (Catch.Resolve): Likewise.
6623         (Using.ResolveLocalVariableDecls): Likewise.
6624         (Foreach.Resolve): Likewise.
6625
6626 2004-10-05  John Luke <john.luke@gmail.com>
6627
6628         * cs-parser.jay: add location to error CS0175
6629
6630 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
6631
6632         * ecore.cs (Expression.Constantity): Add support for turning null
6633         into a constant.
6634
6635         * const.cs (Const.Define): Allow constants to be reference types
6636         as long as the value is Null.
6637
6638 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
6639
6640         * namespace.cs (NamespaceEntry.Using): No matter which warning
6641         level is set, check if this namespace name has already been added.
6642
6643 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
6644
6645         * expression.cs: reftype [!=]= null should always use br[true,false].
6646         # 67410
6647
6648 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
6649
6650         Fix #67108
6651         * attribute.cs: Enum conversion moved to 
6652         GetAttributeArgumentExpression to be applied to the all
6653         expressions.
6654
6655 2004-10-01  Raja R Harinath  <rharinath@novell.com>
6656
6657         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6658         * class.c (TypeContainer.DefineType): Flag error if
6659         base types aren't accessible due to access permissions.
6660         * decl.cs (DeclSpace.ResolveType): Move logic to
6661         Expression.ResolveAsTypeTerminal.
6662         (DeclSpace.ResolveTypeExpr): Thin layer over
6663         Expression.ResolveAsTypeTerminal.
6664         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6665         Refactor code into NestedAccess.  Use it.
6666         (DeclSpace.NestedAccess): New.
6667         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6668         argument to silence errors.  Check access permissions.
6669         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6670         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6671         (Cast.DoResolve): Likewise.
6672         (New.DoResolve): Likewise.
6673         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6674         (TypeOf.DoResolve): Likewise.
6675
6676         * expression.cs (Invocation.BetterConversion): Return the Type of
6677         the better conversion.  Implement section 14.4.2.3 more faithfully.
6678         (Invocation.BetterFunction): Make boolean.  Make correspondence to
6679         section 14.4.2.2 explicit.
6680         (Invocation.OverloadResolve): Update.
6681         (Invocation): Remove is_base field.
6682         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
6683         (Invocation.Emit): Likewise.
6684
6685 2004-09-27  Raja R Harinath  <rharinath@novell.com>
6686
6687         * README: Update to changes.
6688
6689 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
6690
6691         * cs-parser.jay: Reverted 642 warning fix.
6692
6693 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6694
6695         Fix bug #66615
6696         * decl.cs (FindMemberWithSameName): Indexer can have more than
6697         1 argument.
6698
6699 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6700
6701         * expression.cs (LocalVariableReference.DoResolveLValue):
6702         Do not report warning 219 for out values.
6703         (EmptyExpression.Null): New member to avoid extra allocations.
6704
6705 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6706
6707         * cs-parser.jay: Fix wrong warning 642 report.
6708
6709         * cs-tokenizer.cs (CheckNextToken): New helper;
6710         Inspect next character if is same as expected.
6711
6712 2004-09-23  Martin Baulig  <martin@ximian.com>
6713
6714         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6715         (Convert.ImplicitReferenceConversionExists): Likewise.
6716
6717 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6718
6719         * class.cs (Operator.Define): Add error 448 and 559 report.
6720
6721 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6722
6723         * class.cs (MemberBase.IsTypePermitted): New protected
6724         method for checking error CS0610.
6725
6726 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6727
6728         * class.cs (TypeContainer.HasExplicitLayout): New property
6729         Returns whether container has StructLayout attribute set Explicit.
6730         (FieldMember): New abstract class for consts and fields.
6731         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6732         (Field): Reuse FieldMember.
6733
6734         * const.cs (Const): Reuse FieldMember.
6735
6736         * rootcontext.cs: EmitConstants call moved to class.
6737
6738 2004-09-22  Martin Baulig  <martin@ximian.com>
6739
6740         Thanks to Peter Sestoft for this bug report.
6741
6742         * expression.cs (Conditional): If both the `trueExpr' and the
6743         `falseExpr' is a NullLiteral, return a NullLiteral.
6744
6745 2004-09-22  Martin Baulig  <martin@ximian.com>
6746
6747         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6748         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6749         for the "get_Current" call.
6750
6751 2004-09-22  Martin Baulig  <martin@ximian.com>
6752
6753         Marek and me just fixed one of our oldest bugs: #28562 :-)
6754
6755         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6756
6757         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6758         we're an EnumConstant, just return that.
6759         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6760         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
6761         to get the value which'll actually be written into the attribute.
6762         However, we have to use GetValue() to access the attribute's value
6763         in the compiler.        
6764
6765 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6766
6767         * constant.cs (Constant.IsNegative): New abstract property
6768         IsNegative.
6769
6770         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6771         (StackAlloc.DoResolve): Reused IsNegative.
6772
6773 2004-09-21  Martin Baulig  <martin@ximian.com>
6774
6775         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
6776         if we're used in an iterator, we may be called from different
6777         methods.
6778
6779         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
6780         we actually have an exception block.
6781
6782 2004-09-20  John Luke <jluke@cfl.rr.com>
6783
6784         * class.cs, cs-parser.jay: Improve the error report for 1520:
6785         report the actual line where the error happens, not where the
6786         class was declared.
6787
6788         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
6789         Pass location information that was available elsewhere.
6790
6791 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
6792
6793         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
6794         runtime to delay sign assemblies.
6795
6796 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
6797
6798         * cs-parser.jay: Do not report the stack trace, this is barely
6799         used nowadays.
6800
6801 2004-08-22  John Luke  <john.luke@gmail.com>
6802  
6803         * driver.cs : check that a resource id is not already used
6804         before adding it, report CS1508 if it is, bug #63637
6805
6806 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
6807
6808         * ecore.cs: Removed dead code.
6809
6810 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
6811
6812         * class.cs: Do not report warning CS0067 on the interfaces.
6813
6814 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6815
6816         * cs-parser.jay: Add error 504 report.
6817
6818 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6819
6820         * rootcontext.cs: WarningLevel is 4 by default now.
6821
6822         * statement.cs (Fixed.Resolve): Do not null
6823         VariableInfo.
6824
6825 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6826
6827         Fixed bug #55780
6828         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
6829         deep search when property is not virtual.
6830         (PropertyExpr.ResolveAccessors): Make one call for both
6831         accessors.
6832
6833 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6834
6835         Fixed bug #65766
6836         * statement.cs: Error 152 report constains also location.
6837
6838 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6839
6840         Fixed bug #65766
6841         * const.cs: Explicitly set constant as static.
6842
6843 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6844
6845         Fixed bug #64226
6846         * cs-parser.jay: Add error 1017 report.
6847
6848 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6849
6850         Fixed bug #59980, #64224
6851         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
6852
6853         * typemanager.cs (IsSpecialMethod): Simplified
6854
6855 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6856
6857         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
6858         condition with better params.
6859
6860 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6861
6862         Fixed bug #65238
6863         * attribute.cs (Resolve): Property has to have both
6864         accessors.
6865
6866 2004-09-14  Martin Baulig  <martin@ximian.com>
6867
6868         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6869
6870 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6871
6872         Fixed bug #61902
6873         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6874         called and is obsolete then this member suppress message
6875         when call is inside next [Obsolete] method or type.
6876
6877         * expression.cs: Use TestObsoleteMethodUsage member.
6878
6879 2004-09-14  Martin Baulig  <martin@ximian.com>
6880
6881         * cs-parser.jay: Sync a bit with the GMCS version.
6882
6883 2004-09-14  Martin Baulig  <martin@ximian.com>
6884
6885         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
6886         (CSharpParser.yacc_verbose_flag): New public field.
6887
6888         * genericparser.cs: Removed.
6889
6890 2004-09-14  Raja R Harinath  <rharinath@novell.com>
6891
6892         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
6893
6894 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
6895
6896         * class.cs (MethodCore.CheckBase): Fix bug #65757.
6897
6898 2004-09-10  Martin Baulig  <martin@ximian.com>
6899
6900         Backported my MemberName changes from GMCS into MCS.
6901
6902         - we are now using a special `MemberName' class instead of using
6903         strings; in GMCS, the `MemberName' also contains the type
6904         arguments.
6905
6906         - changed the grammar rules a bit:
6907           * the old `member_name' is now a `namespace_or_type_name':
6908             The rule is that we use `namespace_or_type_name' everywhere
6909             where we expect either a "member name" (GetEnumerator) or a
6910             "member name" with an explicit interface name
6911             (IEnumerable.GetEnumerator).
6912             In GMCS, the explicit interface name may include type arguments
6913             (IEnumerable<T>.GetEnumerator).
6914           * we use `member_name' instead of just `IDENTIFIER' for
6915             "member names":
6916             The rule is that we use `member_name' wherever a member may
6917             have type parameters in GMCS.       
6918
6919         * decl.cs (MemberName): New public class.
6920         (MemberCore.MemberName): New public readonly field.
6921         (MemberCore.ctor): Take a `MemberName' argument, not a string.
6922         (DeclSpace): Likewise.
6923
6924         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
6925         * enum.cs (Enum.ctor): Likewise.
6926
6927         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
6928         MemberName.     
6929         (AliasEntry.ctor): Take a MemberName, not an Expression.
6930         (AliasEntry.UsingAlias): Likewise.
6931
6932         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
6933         (IMethodData.MemberName): Changed type from string to MemberName.
6934         (MemberBase.ExplicitInterfaceName): Likewise.
6935         (AbstractPropertyEventMethod.SetupName): Make this private.
6936         (AbstractPropertyEventMethod.ctor): Added `string prefix'
6937         argument; compute the member name here.
6938         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
6939         on the `member.MemberName' and the `prefix'.
6940
6941         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
6942         not `type_name'.
6943         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
6944         thus, we get a `MemberName' instead of a `string'.  These
6945         declarations may have type parameters in GMCS.
6946         (interface_method_declaration, delegate_declaration): Likewise.
6947         (class_declaration, interface_declaration): Likewise.
6948         (method_header): Use `namespace_or_type_name' instead of
6949         `member_name'.  We may be an explicit interface implementation.
6950         (property_declaration, event_declaration): Likewise.
6951         (member_name): This is now just an `IDENTIFIER', not a
6952         `namespace_or_type_name'.
6953         (type_name, interface_type): Removed.
6954         (namespace_or_type_name): Return a MemberName, not an Expression.
6955         (primary_expression): Use `member_name' instead of `IDENTIFIER';
6956         call GetTypeExpression() on the MemberName to get an expression.
6957         (IndexerDeclaration.interface_type): Changed type from string to
6958         MemberName.
6959         (MakeName): Operate on MemberName's instead of string's.
6960
6961 2004-09-13  Raja R Harinath  <rharinath@novell.com>
6962
6963         Fix bug #55770.
6964         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
6965         (NamespaceEntry.Lookup): Add new argument to flag if we want the
6966         lookup to avoid symbols introduced by 'using'.
6967         * rootcontext.cs (NamespaceLookup): Update.
6968
6969 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6970
6971         * class.cs (TypeContainer.DoDefineMembers): Do not call
6972         DefineDefaultConstructor for static classes.
6973
6974 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6975
6976         * attribute.cs (Attribute.Resolve): Add error 653 report.
6977
6978         * class.cs (Class.ApplyAttributeBuilder): Add error 641
6979         report.
6980         (Method.ApplyAttributeBuilder): Add error 685 report.
6981         (Operator.Define): Add error 564 report.
6982
6983         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6984
6985         * expression.cs (Invocation.DoResolve): Add error
6986         245 and 250 report.
6987
6988         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6989         error 674 report.
6990
6991 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6992
6993         * class.cs (ConstructorInitializer.Resolve):
6994         Wrong error number (515->516).
6995
6996 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6997
6998         * class.cs (Indexer.Define): Add error 631 report.
6999
7000 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7001
7002         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7003
7004 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7005
7006         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7007
7008 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7009
7010         * cs-parser.jay: Added error CS0241 report.
7011
7012 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7013
7014         * cs-parser.jay (fixed_statement): Introduce a scope for the
7015         declaration in the 'fixed' statement.
7016
7017 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7018
7019         * cs-parser.jay: Added CS0230 error report.
7020
7021 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7022
7023         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7024
7025 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7026
7027         * expression.cs (Argument.Resolve): Added error CS0192 and
7028         CS0199 report.
7029
7030 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7031
7032         C# 2.0 #pragma warning feature
7033
7034         * cs-tokenizer.cs (PreProcessPragma): New method; 
7035         Handles #pragma directive.
7036
7037         * report.cs (WarningRegions): New class; Support
7038         class for #pragma warning directive. It tests whether
7039         warning is enabled for a given line.
7040
7041 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7042
7043         * const.cs: Add more descriptive error report, tahnks to
7044         Sebastien. 
7045
7046 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7047
7048         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7049
7050 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7051
7052         * expression.cs: Apply patch from Ben: Remove dead code from
7053         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7054         as that code just threw an exception anwyays.
7055
7056         * const.cs: Remove the call to the turnintoconstant, for details
7057         see bug: #63144
7058         
7059         * literal.cs: The type of the null-literal is the null type;  So
7060         we use a placeholder type (literal.cs:System.Null, defined here)
7061         for it.
7062
7063         * expression.cs (Conditional.DoResolve): Remove some old code that
7064         is no longer needed, conversions have been fixed.
7065
7066         (ArrayCreationExpression.DoResolve): Return false if we fail to
7067         resolve the inner expression.
7068
7069 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7070
7071         Fix test-290.cs.
7072         * cs-parser.jay (delegate_declaration): Record a delegate
7073         declaration as a type declaration.
7074         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7075
7076 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7077
7078         * parameter.cs: Do not crash if the type can not be resolved. 
7079
7080         * expression.cs: Report errors with unsafe pointers, fixes #64896
7081
7082 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7083
7084         * expression.cs: Pointer arith always needs to do a conv.i
7085         if the operand is a long. fix 65320
7086
7087 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7088
7089         Fixed cs0619-37.cs, cs0619-38.cs
7090
7091         * enum.cs (GetObsoleteAttribute): Removed.
7092
7093         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7094         on Enum member is double staged. The first is tested member
7095         and then enum.
7096
7097 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7098
7099         Fixed #56986, #63631, #65231
7100
7101         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7102         adds member to name container.
7103         (TypeContainer.AddToTypeContainer): New method, adds type to
7104         name container.
7105         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7106         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7107         AddOperator): Simplified by reusing AddToMemberContainer.
7108         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7109         instead of field.
7110         (Method.CheckForDuplications): Fixed implementation to test all
7111         possibilities.
7112         (MemberBase): Detection whether member is explicit interface
7113         implementation is now in constructor.
7114         (MemberBase.UpdateMemberName): Handles IndexerName.
7115         (Accessor): Changed to keep also location information.
7116         (AbstractPropertyEventMethod): Is derived from MemberCore.
7117         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7118         will be emited or not.
7119         (PropertyBase.AreAccessorsDuplicateImplementation):
7120         Tests whether accessors are not in collision with some method.
7121         (Operator): Is derived from MethodCore to simplify common
7122         operations.
7123
7124         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7125         must be performed.
7126         (DeclSpace.AddToContainer): Adds the member to defined_names
7127         table. It tests for duplications and enclosing name conflicts.
7128
7129         * enum.cs (EnumMember): Clean up to reuse the base structures
7130
7131 2004-09-03  Martin Baulig  <martin@ximian.com>
7132
7133         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7134         into TypeContainer, to make partial classes work again.
7135
7136 2004-09-03  Martin Baulig  <martin@ximian.com>
7137
7138         * rootcontext.cs (RootContext.V2): Removed.
7139
7140 2004-03-23  Martin Baulig  <martin@ximian.com>
7141
7142         * expression.cs (Invocation.OverloadResolve): Added `bool
7143         may_fail' argument and use it instead of the Location.IsNull() hack.
7144
7145 2004-09-03  Martin Baulig  <martin@ximian.com>
7146
7147         Merged latest changes into gmcs.  Please keep this comment in
7148         here, it makes it easier for me to see what changed in MCS since
7149         the last time I merged.
7150
7151 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7152
7153         Fix #61128.
7154         * expression.cs (BetterConversion): Don't allow either conversion 
7155         to be null.  Remove redundant implicit conversion test when 'q ==
7156         null' -- when this function is invoked, we already know that the
7157         implicit conversion exists.
7158         (BetterFunction): Assume that 'best' is non-null.  Remove
7159         redundant reimplementation of IsApplicable when 'best' is null.
7160         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7161         number of arguments.
7162         (IsAncestralType): Extract from OverloadResolve.
7163         (OverloadResolve): Make robust to the MethodGroupExpr being
7164         unsorted.  Implement all the logic of Section 14.5.5.1, and
7165         support overloading of methods from multiple applicable types.
7166         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7167
7168         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7169         (RealError, Warning): Append type of report to related symbol.
7170
7171 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7172
7173         * enum.cs: Fixed CLS-Compliance checks for enum members.
7174         Error tests cs3008-8.cs, cs3014-8.cs
7175
7176 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7177
7178         Fixed bug #62342, #63102
7179         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7180         like ImplementMethod.
7181
7182 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7183
7184         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7185         Fixed bug #65170.
7186
7187 2004-09-02  Martin Baulig  <martin@ximian.com>
7188
7189         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7190         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7191         on the MethodBase.
7192
7193 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7194
7195         C# 2.0 Static classes implemented
7196
7197         * class.cs (TypeContainer): instance_constructors,
7198         initialized_fields, initialized_static_fields,
7199         default_constructor, base_inteface_types are protected to be
7200         accessible from StaticClass.
7201         (TypeContainer.DefineDefaultConstructor): New virtual method
7202         for custom default constructor generating
7203         (StaticClass): New class to handle "Static classes" feature.
7204
7205         * cs-parser.jay: Handle static keyword on class like instance
7206         of StaticClass.
7207
7208         * driver.cs: Added "/langversion" command line switch with two
7209         options (iso-1, default).
7210
7211 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7212
7213         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7214
7215 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7216
7217         * delegate.cs: Style.
7218
7219 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7220
7221         * delegate.cs: Add seperate instance expr field for miguel.
7222
7223 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7224
7225         * PointerArithmetic (Resolve): make sure we are not doing
7226         pointer arith on void*. Also, make sure we are resolved
7227         by not setting eclass until resolve.
7228
7229         All callers: Make sure that PointerArithmetic gets resolved.
7230
7231 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7232
7233         * ArrayCreation (LookupType): If the type does not resolve 
7234         to an array, give an error.
7235
7236 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7237
7238         * statement.cs (Try.Resolve): Fixed bug #64222
7239
7240 2004-08-27  Martin Baulig  <martin@ximian.com>
7241
7242         * class.cs
7243         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7244         crash here.     
7245
7246 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7247
7248         * ecore.cs (Constantify): Get underlying type via
7249         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7250         Windows in special cases.
7251
7252 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7253
7254         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7255         for obtaining also private methods.
7256         (GetRemoveMethod): Used GetRemoveMethod (true)
7257         for obtaining also private methods.
7258
7259 2004-08-24  Martin Baulig  <martin@ximian.com>
7260
7261         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7262         MethodAttributes.HideBySig for operators.
7263
7264 2004-08-23  Martin Baulig  <martin@ximian.com>
7265
7266         Back to the old error reporting system :-)
7267
7268         * report.cs (Message): Removed.
7269         (Report.MessageData, ErrorData, WarningData): Removed.
7270         (Report.Error, Warning): Back to the old system.
7271
7272 2004-08-23  Martin Baulig  <martin@ximian.com>
7273
7274         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7275
7276         * class.cs (TypeContainer.ParentContainer): New public virtual
7277         method; replaces the explicit interface implementation.
7278         (ClassPart.ParentContainer): Override.
7279
7280 2004-08-23  Martin Baulig  <martin@ximian.com>
7281
7282         * statement.cs (Switch): Added support for constant switches; see
7283         #59428 or test-285.cs.
7284
7285 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7286
7287         Fixed bug #62740.
7288         * statement.cs (GetEnumeratorFilter): Removed useless
7289         logic because C# specs is strict. GetEnumerator must be
7290         public.
7291
7292 2004-08-22  Martin Baulig  <martin@ximian.com>
7293
7294         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7295         a switch and may break, reset the barrier.  Fixes #59867.
7296
7297 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7298
7299         CLS-Compliance speed up (~5% for corlib)
7300
7301         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7302         New method. Tests container for CLS-Compliant names
7303
7304         * class.cs (TypeContainer.VerifyClsName): New method.
7305         Checks whether container name is CLS Compliant.
7306         (Constructor): Implements IMethodData.
7307
7308         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7309         low-case table for CLS Compliance test.
7310         (MemberCache.VerifyClsParameterConflict): New method.
7311         Checks method parameters for CS3006 error.
7312
7313         * enum.cs (EnumMember): Is derived from MemberCore.
7314         (Enum.VerifyClsName): Optimized for better performance.
7315
7316 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7317
7318         * report.cs: Renamed Error_T to Error and changed all
7319         references.
7320
7321 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7322
7323         * class.cs (TypeContainer.IndexerArrayList): New inner class
7324         container for indexers.
7325         (TypeContainer.DefaultIndexerName): New constant for default
7326         indexer name. Replaced all "Item" with this constant.
7327         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7328
7329         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7330         DefaultMemberAttribute constructor.
7331
7332 2004-08-05  Martin Baulig  <martin@ximian.com>
7333
7334         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7335         Fix bug #59429.
7336
7337 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7338
7339         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7340         multi platforms problem.
7341
7342         * compiler.csproj: Included shared files.
7343
7344 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7345
7346         Fix bug 60333, 55971 in the more general way
7347         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7348         Added arg_type argument for constant conversion.
7349         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7350
7351 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7352
7353         Fix bug #59760
7354         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7355         OperatorArrayList, MethodCoreArrayList for typecontainer
7356         containers. Changed class member types to these new types.
7357         (MethodArrayList.DefineMembers): Added test for CS0659.
7358
7359 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7360
7361         * cfold.cs: Synchronize the folding with the code in expression.cs
7362         Binary.DoNumericPromotions for uint operands.
7363
7364         * attribute.cs: Revert patch from Raja, it introduced a regression
7365         while building Blam-1.2.1 (hard to isolate a test case).
7366
7367 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7368
7369         Fix for #55382
7370         * class.cs:
7371         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7372         name collision.
7373         (MethodCore.parent_method): New member. The method we're overriding
7374         if this is an override method.
7375         (MethodCore.CheckBase): Moved from Method class and made common.
7376         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7377         private.
7378         (MethodCore.CheckForDuplications): New abstract method. For custom
7379         member duplication search in a container
7380         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7381         method and its return type.
7382         (Event.conflict_symbol): New member. Symbol with same name in the
7383         parent class.
7384
7385         * decl.cs:
7386         (MemberCache.FindMemberWithSameName): New method. The method
7387         is looking for conflict with inherited symbols.
7388
7389 2004-08-04  Martin Baulig  <martin@ximian.com>
7390
7391         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7392
7393         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7394
7395 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7396
7397         * report.cs (Message): New enum for better error, warning reference in
7398         the code.
7399         (MessageData): New inner abstract class. It generally handles printing of
7400         error and warning messages.
7401         Removed unused Error, Warning, Message methods.
7402
7403 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7404
7405         Fix for cs0592-8.cs test
7406         * attribute.cs
7407         (Attributable.ValidAttributeTargets): Made public.
7408         (Attribute.ExplicitTarget): New member for explicit target value.
7409         (Attribute.CheckTargets): Now we translate explicit attribute
7410         target to Target here.
7411
7412 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7413
7414         * ecore.cs (MethodGroupExpr): new IsBase property.
7415
7416         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7417
7418         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7419         rather than an instance expr.
7420
7421         (DelegateCreation.Emit): Use the method group rather than
7422         the instance expression. Also, if you have base.Foo as the
7423         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7424
7425         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7426
7427         (NewDelegate.DoResolve): Only check for the existance of Invoke
7428         if the method is going to be needed. Use MethodGroupExpr.
7429
7430         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7431
7432         * expression.cs: For pointer arith., make sure to use
7433         the size of the type, not the size of the pointer to
7434         the type.
7435
7436 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7437
7438         Fix for #60722
7439         * class.cs (Class): Added error CS0502 test.
7440
7441 2004-08-03  John Luke  <jluke@cfl.rr.com>
7442             Raja R Harinath  <rharinath@novell.com>
7443
7444         Fix for #60997.
7445         * attribute.cs (Attribute.complained_before): New flag.
7446         (Attribute.ResolveType, Attribute.Resolve),
7447         (Attribute.DefinePInvokeMethod): Set it.
7448         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7449         
7450 2004-08-03  Martin Baulig  <martin@ximian.com>
7451
7452         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7453         use a user-defined operator; we still need to do numeric
7454         promotions in case one argument is a builtin type and the other
7455         one has an implicit conversion to that type.  Fixes #62322.
7456
7457 2004-08-02  Martin Baulig  <martin@ximian.com>
7458
7459         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7460         (LocalInfo.IsThis): New public property.
7461         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7462
7463 2004-08-01  Martin Baulig  <martin@ximian.com>
7464
7465         * class.cs (TypeContainer.GetClassBases): Don't set the default
7466         here since we may get called from GetPartialBases().
7467         (TypeContainer.DefineType): If GetClassBases() didn't return a
7468         parent, use the default one.
7469
7470 2004-07-30  Duncan Mak  <duncan@ximian.com>
7471
7472         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7473
7474 2004-07-30  Martin Baulig  <martin@ximian.com>
7475
7476         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7477
7478         * class.cs (SourceMethod): New public class, derive from the
7479         symbol writer's ISourceMethod.
7480         (Method): Use the new symbol writer API.
7481
7482         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7483         as argument and use the new symbol writer.
7484
7485         * location.cs
7486         (SourceFile): Implement the symbol writer's ISourceFile.
7487         (Location.SymbolDocument): Removed.
7488         (Location.SourceFile): New public property.
7489
7490         * symbolwriter.cs: Use the new symbol writer API.
7491
7492 2004-07-30  Raja R Harinath  <rharinath@novell.com>
7493
7494         * Makefile (install-local): Remove.  Functionality moved to
7495         executable.make.
7496
7497 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
7498
7499         * Makefile: Install mcs.exe.config file together with mcs.exe.
7500         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7501         correct runtime version.
7502         
7503 2004-07-25  Martin Baulig  <martin@ximian.com>
7504
7505         * class.cs
7506         (TypeContainer.RegisterOrder): Removed, this was unused.
7507         (TypeContainer, interface_order): Removed.
7508         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7509         TypeContainer as argument since we can also be called with a
7510         `PartialContainer' for a partial class/struct/interface.
7511         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7512         of checking whether we're an `Interface' - we could be a
7513         `PartialContainer'.
7514         (PartialContainer.Register): Override; call
7515         AddClass()/AddStruct()/AddInterface() on our parent.
7516
7517         * cs-parser.jay (interface_member_declaration): Add things to the
7518         `current_container', not the `current_class'.
7519
7520         * rootcontext.cs (RegisterOrder): The overloaded version which
7521         takes an `Interface' was unused, removed.
7522
7523         * typemanager.cs (TypeManager.LookupInterface): Return a
7524         `TypeContainer', not an `Interface'.
7525         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7526         contain a `PartialContainer' for an interface, so check it's
7527         `Kind' to figure out what it is.
7528
7529 2004-07-25  Martin Baulig  <martin@ximian.com>
7530
7531         * class.cs (Class.DefaultTypeAttributes): New public constant.
7532         (Struct.DefaultTypeAttributes): Likewise.
7533         (Interface.DefaultTypeAttributes): Likewise.
7534         (PartialContainer.TypeAttr): Override this and add the
7535         DefaultTypeAttributes.
7536
7537 2004-07-25  Martin Baulig  <martin@ximian.com>
7538
7539         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7540         we can just use the `Parent' field instead.
7541
7542 2004-07-25  Martin Baulig  <martin@ximian.com>
7543
7544         * class.cs (TypeContainer.Emit): Renamed to EmitType().
7545
7546 2004-07-25  Martin Baulig  <martin@ximian.com>
7547
7548         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7549         our parts before defining any methods.
7550         (TypeContainer.VerifyImplements): Make this virtual.
7551         (ClassPart.VerifyImplements): Override and call VerifyImplements()
7552         on our PartialContainer.
7553
7554 2004-07-25  Martin Baulig  <martin@ximian.com>
7555
7556         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7557
7558         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7559         argument, we can just use the `Parent' field instead.
7560
7561         * class.cs
7562         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
7563         (MemberBase.DoDefine): Likewise.
7564
7565 2004-07-24  Martin Baulig  <martin@ximian.com>
7566
7567         * decl.cs (MemberCore.Parent): New public field.
7568         (DeclSpace.Parent): Moved to MemberCore.
7569
7570         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7571         (MemberBase.ctor): Added TypeContainer argument, pass it to our
7572         parent's .ctor.
7573         (FieldBase, Field, Operator): Likewise.
7574         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7575         (EventField, Event): Likewise.
7576
7577 2004-07-23  Martin Baulig  <martin@ximian.com>
7578
7579         * class.cs (PartialContainer): New public class.
7580         (ClassPart): New public class.
7581         (TypeContainer): Added support for partial classes.
7582         (TypeContainer.GetClassBases): Splitted some of the functionality
7583         out into GetNormalBases() and GetPartialBases().
7584
7585         * cs-tokenizer.cs (Token.PARTIAL): New token.
7586         (Tokenizer.consume_identifier): Added some hacks to recognize
7587         `partial', but only if it's immediately followed by `class',
7588         `struct' or `interface'.
7589
7590         * cs-parser.jay: Added support for partial clases.
7591
7592 2004-07-23  Martin Baulig  <martin@ximian.com>
7593
7594         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7595         a `DeclSpace' and also made it readonly.
7596         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7597         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7598         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7599
7600         * cs-parser.jay: Pass the `current_class', not the
7601         `current_container' (at the moment, this is still the same thing)
7602         to a new Method, Property, Event, Indexer or Constructor.
7603
7604 2004-07-23  Martin Baulig  <martin@ximian.com>
7605
7606         * cs-parser.jay (CSharpParser): Added a new `current_class' field
7607         and removed the `current_interface' one.
7608         (struct_declaration, class_declaration, interface_declaration):
7609         Set `current_class' to the newly created class/struct/interface;
7610         set their `Bases' and call Register() before parsing their body.
7611
7612 2004-07-23  Martin Baulig  <martin@ximian.com>
7613
7614         * class.cs (Kind): New public enum.
7615         (TypeContainer): Made this class abstract.
7616         (TypeContainer.Kind): New public readonly field.
7617         (TypeContainer.CheckDef): New public method; moved here from
7618         cs-parser.jay.
7619         (TypeContainer.Register): New public abstract method.
7620         (TypeContainer.GetPendingImplementations): New public abstract
7621         method.
7622         (TypeContainer.GetClassBases): Removed the `is_class' and
7623         `is_iface' parameters.
7624         (TypeContainer.DefineNestedTypes): Formerly known as
7625         DoDefineType().
7626         (ClassOrStruct): Made this class abstract.
7627
7628         * tree.cs (RootTypes): New public type. 
7629
7630 2004-07-20  Martin Baulig  <martin@ximian.com>
7631
7632         * tree.cs (Tree.RecordNamespace): Removed.
7633         (Tree.Namespaces): Removed.
7634
7635         * rootcontext.cs (RootContext.IsNamespace): Removed.
7636
7637         * cs-parser.jay (namespace_declaration): Just create a new
7638         NamespaceEntry here.
7639
7640 2004-07-20  Martin Baulig  <martin@ximian.com>
7641
7642         * statement.cs (ExceptionStatement): New abstract class.  This is
7643         now used as a base class for everyone who's using `finally'.
7644         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
7645         our local variables before using them.
7646
7647         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
7648         virtual method.  This is used by Yield.Resolve() to "steal" an
7649         outer block's `finally' clauses.
7650         (FlowBranchingException): The .ctor now takes an ExceptionStatement
7651         argument.
7652
7653         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
7654         version which takes an ExceptionStatement.  This version must be
7655         used to create exception branchings.
7656
7657         * iterator.cs
7658         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
7659         (Iterator.EmitMoveNext): Added exception support; protect the
7660         block with a `fault' clause, properly handle 'finally' clauses.
7661         (Iterator.EmitDispose): Run all the `finally' clauses here.
7662
7663 2004-07-20  Martin Baulig  <martin@ximian.com>
7664
7665         * iterator.cs: This is the first of a set of changes in the
7666         iterator code.  Match the spec more closely: if we're an
7667         IEnumerable, then GetEnumerator() must be called.  The first time
7668         GetEnumerator() is called, it returns the current instance; all
7669         subsequent invocations (if any) must create a copy.
7670
7671 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
7672
7673         * expression.cs: Resolve the constant expression before returning
7674         it. 
7675
7676 2004-07-19  Martin Baulig  <martin@ximian.com>
7677
7678         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
7679         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
7680         the return type of the new EmitContext.
7681
7682 2004-07-18  Martin Baulig  <martin@ximian.com>
7683
7684         * class.cs (Property.Define): Fix iterators.
7685
7686         * iterators.cs (Iterator.Define): Moved the
7687         `container.AddInterator (this)' call here from the .ctor; only do
7688         it if we resolved successfully.
7689
7690 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
7691
7692         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
7693         `true' for preprocessing directives that we parse.  The return
7694         value indicates whether we should return to regular tokenizing or
7695         not, not whether it was parsed successfully.
7696
7697         In the past if we were in: #if false ... #line #endif, we would
7698         resume parsing after `#line'.  See bug 61604.
7699
7700         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
7701         building: IsEnumType should return true only for enums, not for
7702         enums or System.Enum itself.  This fixes #61593.
7703
7704         Likely what happened is that corlib was wrong: mcs depended on
7705         this bug in some places.  The bug got fixed, we had to add the
7706         hack, which caused bug 61593.
7707
7708         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
7709         that was a workaround for the older conditions.
7710
7711 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
7712
7713         * assign.cs: IAssignMethod has a new interface, as documented
7714         inline. All assignment code now uses this new api.
7715
7716         * ecore.cs, expression.cs: All classes which implement
7717         IAssignMethod now use the new interface.
7718
7719         * expression.cs (Invocation): add a hack to EmitCall so that
7720         IndexerAccess can be the target of a compound assignment without
7721         evaluating its arguments twice.
7722
7723         * statement.cs: Handle changes in Invocation api.
7724
7725 2004-07-16  Martin Baulig  <martin@ximian.com>
7726
7727         * iterators.cs: Rewrote this.  We're now using one single Proxy
7728         class for both the IEnumerable and the IEnumerator interface and
7729         `Iterator' derives from Class so we can use the high-level API.
7730
7731         * class.cs (TypeContainer.AddIterator): New method.
7732         (TypeContainer.DoDefineType): New protected virtual method, which
7733         is called from DefineType().
7734         (TypeContainer.DoDefineMembers): Call DefineType() and
7735         DefineMembers() on all our iterators.
7736         (TypeContainer.Emit): Call Emit() on all our iterators.
7737         (TypeContainer.CloseType): Call CloseType() on all our iterators.
7738
7739         * codegen.cs (EmitContext.CurrentIterator): New public field.
7740
7741 2004-07-15  Martin Baulig  <martin@ximian.com>
7742
7743         * typemanager.cs
7744         (TypeManager.not_supported_exception_type): New type.   
7745
7746 2004-07-14  Martin Baulig  <martin@ximian.com>
7747
7748         * iterators.cs: Use real error numbers.
7749
7750 2004-07-14  Martin Baulig  <martin@ximian.com>
7751
7752         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7753         requires this to be a System.Collection.IEnumerable and not a
7754         class implementing that interface.
7755         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
7756
7757 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
7758
7759         * class.cs: Fixed previous fix, it broke some error tests.
7760
7761 2004-07-12  Martin Baulig  <martin@ximian.com>
7762
7763         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7764         Fixes #61293.
7765
7766 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
7767
7768         * assign.cs (LocalTemporary): Add new argument: is_address,If
7769         `is_address' is true, then the value that we store is the address
7770         to the real value, and not the value itself.
7771         
7772         * ecore.cs (PropertyExpr): use the new local temporary
7773         stuff to allow us to handle X.Y += z (where X is a struct)
7774
7775 2004-07-08  Martin Baulig  <martin@ximian.com>
7776
7777         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7778         not always return, just like we're doing in Using.Resolve().
7779
7780 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
7781
7782         * cs-parser.jay (fixed_statement): flag this as Pinned.
7783
7784 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
7785
7786         * typemanager.cs (TypeManager): Removed MakePinned method, this
7787         mechanism is replaced with the .NET 2.x compatible mechanism of
7788         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7789
7790         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
7791         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7792         `IsFixed' property which has a different meaning.
7793
7794 2004-07-02  Raja R Harinath  <rharinath@novell.com>
7795
7796         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7797         visible from inside a nested class, not just the names of the
7798         immediately enclosing class.
7799         Fix for bug #60730.
7800
7801 2004-06-24  Raja R Harinath  <rharinath@novell.com>
7802
7803         * expression.cs (BetterConversion): Remove buggy special-case
7804         handling of "implicit constant expression conversions".  At this
7805         point, we already know that the conversion is possible -- we're
7806         only checking to see which is better.
7807
7808 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7809
7810         * cs-parser.jay: Added error CS0210 test.
7811
7812 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7813
7814         * cs-parser.jay: Added error CS0134 test.
7815
7816 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7817
7818         Fix bug #52507
7819         * cs-parser.jay: Added error CS0145 test.
7820
7821 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7822
7823         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7824
7825 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
7826         
7827         * expression.cs (StackAlloc.Resolve): The argument may not
7828         be a constant; deal with this case.
7829         
7830 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
7831
7832         * attribute.cs (IndexerName_GetIndexerName): Renamed to
7833         GetIndexerAttributeValue.
7834         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7835
7836         * class.cs (Indexer.Define): Added error tests for CS0415,
7837         CS0609.
7838
7839 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
7840
7841         * attribute.cs (Attribute.Resolve): Keep field code in sync with
7842         property code.
7843
7844 2004-06-23  Martin Baulig  <martin@ximian.com>
7845
7846         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7847         neither return nor throw, reset the barrier as well.  Fixes #60457.
7848
7849 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
7850
7851         * class.cs : EventAttributes is now set to None by default.
7852           This fixes bug #60459.
7853
7854 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7855
7856         Fix bug #60219
7857         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7858         Don't throw exception but return null (it's sufficient now).
7859
7860 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7861
7862         * typemanager.cs (GetArgumentTypes): Faster implementation.
7863
7864 2004-06-18  Martin Baulig  <martin@ximian.com>
7865
7866         * attribute.cs (Attribute.Resolve): Check whether we're an
7867         EmptyCast which a Constant child.  Fixes #60333.
7868
7869 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
7870
7871         * statement.cs (EmitCollectionForeach): Account for the fact that
7872         not all valuetypes are in areas which we can take the address of.
7873         For these variables, we store to a temporary variable. Also, make
7874         sure that we dont emit a `callvirt' on a valuetype method.
7875
7876 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7877
7878         * expression.cs (StackAlloc.DoReSolve): Added test for
7879         negative parameter (CS0247).
7880
7881 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7882
7883         Fix bug #59792
7884         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7885
7886 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7887
7888         Fix bug #59781
7889         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7890         ulong.
7891
7892 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7893
7894         Fix bug #58254 & cs1555.cs, cs1556.cs
7895         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7896
7897 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7898
7899         * cs-parser.jay: Added error CS1669 test for indexers.
7900
7901 2004-06-11  Martin Baulig  <martin@ximian.com>
7902
7903         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7904         call this twice: for params and varargs methods.
7905
7906 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7907
7908         * class.cs:
7909         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7910
7911 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7912
7913         * attribute.cs (Attribute.GetValidTargets): Made public.
7914
7915         * class.cs: 
7916         (AbstractPropertyEventMethod): New class for better code sharing.
7917         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7918         CS1667 report.
7919         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7920
7921 2004-06-11  Raja R Harinath  <rharinath@novell.com>
7922
7923         Fix bug #59477.
7924         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
7925         that the call to Resolve is part of a MemberAccess.
7926         (Expression.Resolve): Use it for SimpleName resolution.
7927         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
7928         Add 'intermediate' boolean argument.
7929         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
7930         error message when the SimpleName can be resolved ambiguously
7931         between an expression and a type.
7932         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
7933         public.
7934         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
7935         call on the left-side.
7936
7937 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7938
7939         * class.cs:
7940         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
7941
7942 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7943
7944         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
7945
7946 2004-06-11  Martin Baulig  <martin@ximian.com>
7947
7948         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
7949         varargs methods if applicable.
7950
7951 2004-06-11  Martin Baulig  <martin@ximian.com>
7952
7953         * expression.cs (Invocation.EmitCall): Don't use
7954         `method.CallingConvention == CallingConventions.VarArgs' since the
7955         method could also have `CallingConventions.HasThis'.
7956
7957 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7958
7959         * class.cs (Event.GetSignatureForError): Implemented.
7960         Fixed crash in error test cs3010.cs
7961
7962 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
7963
7964         * cs-tokenizer.cs: Change the way we track __arglist to be
7965         consistent with the other keywords.
7966
7967 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
7968
7969         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
7970         tomorrow.
7971
7972 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
7973
7974         * codegen.cs: Check that all referenced assemblies have a strongname
7975         before strongnaming the compiled assembly. If not report error CS1577.
7976         Fix bug #56563. Patch by Jackson Harper.
7977         * typemanager.cs: Added a method to return all referenced assemblies.
7978         Fix bug #56563. Patch by Jackson Harper.
7979
7980 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
7981
7982         * class.cs:
7983         (Method.ApplyAttributeBuilder): Moved and added conditional
7984         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
7985
7986         * delegate.cs:
7987         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
7988
7989 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
7990
7991         Fixed #59640
7992         * class.cs: (EventField.attribute_targets): Changed default target.
7993
7994 2004-06-08  Martin Baulig  <martin@ximian.com>
7995
7996         * expression.cs (Invocation.EmitCall): Enable varargs methods.
7997
7998 2004-06-08  Martin Baulig  <martin@ximian.com>
7999
8000         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8001
8002 2004-06-07  Martin Baulig  <martin@ximian.com>
8003
8004         Added support for varargs methods.
8005
8006         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8007         keyword.
8008
8009         * cs-parser.jay: Added support for `__arglist'.
8010
8011         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8012
8013         * expression.cs (Argument.AType): Added `ArgList'.
8014         (Invocation): Added support for varargs methods.
8015         (ArglistAccess): New public class.
8016         (Arglist): New public class.
8017
8018         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8019
8020         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8021         a method's top-level block if the method has varargs.
8022
8023         * support.cs (ReflectionParameters, InternalParameters): Added
8024         support for varargs methods.    
8025
8026 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8027
8028         * class.cs: Provide location in indexer error report.
8029
8030         * driver.cs: Use standard names.
8031
8032         * namespace.cs: Catch the use of using after a namespace has been
8033         declared also on using aliases.
8034
8035 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8036
8037         Bug #50820.
8038         * typemanager.cs (closure_private_ok, closure_invocation_type)
8039         (closure_qualifier_type, closure_invocation_assembly)
8040         (FilterWithClosure): Move to ...
8041         (Closure): New internal nested class.
8042         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8043         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8044         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8045         (MemberLookup, MemberLookupFailed): Use it.
8046         * expression.cs (New.DoResolve): Treat the lookup for the
8047         constructor as being qualified by the 'new'ed type.
8048         (Indexers.GetIndexersForTypeOrInterface): Update.
8049
8050 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8051
8052         * attribute.cs
8053         (GetConditionalAttributeValue): New method. Returns
8054         condition of ConditionalAttribute.
8055         (SearchMulti): New method.  Returns all attributes of type 't'.
8056         Use it when attribute is AllowMultiple = true.
8057         (IsConditionalMethodExcluded): New method.
8058
8059         * class.cs
8060         (Method.IsExcluded): Implemented. Returns true if method has conditional
8061         attribute and the conditions is not defined (method is excluded).
8062         (IMethodData): Extended interface for ConditionalAttribute support.
8063         (PropertyMethod.IsExcluded): Implemented.
8064
8065         * decl.cs
8066         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8067
8068         * expression.cs
8069         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8070         on the method.
8071
8072 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8073
8074         * expression.cs (ArrayCreationExpression): Make this just an
8075         `expression'. It can't be a statement, so the code here was
8076         dead.
8077
8078 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8079
8080         Fixed #59072
8081         * typemanager.cs (GetFullNameSignature): New method for
8082         MethodBase types.
8083
8084 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8085
8086         Fixed #56452
8087         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8088         Use this method when MethodBuilder is null.
8089         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8090         Added test for error CS0626 (MONO reports error for this situation).
8091         (IMethodData.GetSignatureForError): Extended interface.
8092
8093 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8094
8095         * attribute.cs
8096         (AttributeTester.GetObsoleteAttribute): Returns instance of
8097         ObsoleteAttribute when type is obsolete.
8098
8099         * class.cs
8100         (TypeContainer.VerifyObsoleteAttribute): Override.
8101         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8102         (MethodCode.VerifyObsoleteAttribute): Override.
8103         (MemberBase.VerifyObsoleteAttribute): Override.
8104
8105         * decl.cs
8106         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8107         and report proper error.
8108
8109         *delegate.cs
8110         Delegate.VerifyObsoleteAttribute): Override.
8111
8112         * ecore.cs
8113         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8114         and report proper error.
8115         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8116
8117         * enum.cs
8118         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8119         and enum member.
8120
8121         * expression.cs
8122         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8123         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8124         Added test for ObsoleteAttribute.
8125
8126         * statement.cs
8127         (Catch): Derived from Statement.
8128
8129 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8130  
8131         Fixed bug #59071 & cs0160.cs
8132  
8133         * statement.cs (Try.Resolve): Check here whether order of catch
8134         clauses matches their dependencies.
8135
8136 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8137
8138         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8139         caused a regression: #59343.  Referencing nested classes from an
8140         assembly stopped working.
8141
8142 2004-05-31  Martin Baulig  <martin@ximian.com>
8143
8144         MCS is now frozen for beta 2.
8145
8146 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8147
8148         * convert.cs: add a trivial cache for overload operator resolution.
8149
8150 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8151
8152         * decl.cs: If possible, use lookuptypedirect here. We can only do
8153         this if there is no `.' after the namespace. Avoids using
8154         LookupType, which does lots of slow processing.
8155         (FindNestedType) New method, does what it says :-).
8156         * namespace.cs: use LookupTypeDirect.
8157         * rootcontext.cs: use membercache, if possible.
8158         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8159
8160 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8161
8162         * expression.cs:
8163         According to the spec, 
8164
8165         In a member access of the form E.I, if E is a single identifier,
8166         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8167         field, property, localvariable, or parameter with the same type as
8168         the meaning of E as a type-name (§3.8), then both possible
8169         meanings of E are permitted.
8170
8171         We did not check that E as a simple-name had the same type as E as
8172         a type name.
8173
8174         This trivial check gives us 5-7% on bootstrap time.
8175
8176 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8177
8178         * expression.cs (Invocation.OverloadResolve): Avoid the
8179         use of hashtables and boxing here by allocating on demand.
8180
8181 2004-05-30  Martin Baulig  <martin@ximian.com>
8182
8183         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8184         we're doing a silent lookup.  Don't try to lookup nested types in
8185         TypeManager.object_type (thanks to Ben Maurer).
8186
8187 2004-05-30  Martin Baulig  <martin@ximian.com>
8188
8189         Committing a patch from Ben Maurer.
8190
8191         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8192
8193 2004-05-29  Martin Baulig  <martin@ximian.com>
8194
8195         * class.cs (IMethodData.ShouldIgnore): New method.
8196
8197         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8198         `Location' argument, we don't need it anywhere.  Use
8199         `IMethodData.ShouldIgnore ()' instead of
8200         `MethodData.GetMethodFlags ()'.
8201         (TypeManager.AddMethod): Removed.
8202         (TypeManager.AddMethod2): Renamed to AddMethod.
8203
8204 2004-05-29  Martin Baulig  <martin@ximian.com>
8205
8206         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8207
8208         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8209         converting from a class type S to an interface type and we already
8210         have an object on the stack, don't box it again.  Fixes #52578.
8211
8212 2004-05-29  Martin Baulig  <martin@ximian.com>
8213
8214         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8215         Added support for `params' parameters.  Fixes #59267.
8216
8217 2004-05-29  Martin Baulig  <martin@ximian.com>
8218
8219         * literal.cs (NullPointer): Provide a private .ctor which sets
8220         `type' to TypeManager.object_type.  Fixes #59048.
8221
8222 2004-05-29  Martin Baulig  <martin@ximian.com>
8223
8224         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8225         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8226
8227         * ecore.cs (EventExpr.instance_expr): Make the field private.
8228
8229 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8230
8231         Fixed bug #50080 & cs0214-2.cs
8232         * expression.cs (Cast.DoResolve): Check unsafe context here.
8233         
8234         * statement.cs (Resolve.DoResolve): Likewise.
8235
8236 2004-05-26  Martin Baulig  <martin@ximian.com>
8237
8238         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8239
8240         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8241         (RootContext.LookupType): Pass down the `silent' flag.
8242
8243 2004-05-25  Martin Baulig  <martin@ximian.com>
8244
8245         * expression.cs
8246         (MethodGroupExpr.IdenticalTypeName): New public property.
8247         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8248         expression actually refers to a type.
8249
8250 2004-05-25  Martin Baulig  <martin@ximian.com>
8251
8252         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8253         for #56176 and made it actually work.
8254
8255 2004-05-25  Martin Baulig  <martin@ximian.com>
8256
8257         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8258         (FieldExpr, PropertyExpr): Override and implement
8259         CacheTemporaries.  Fixes #52279.
8260
8261 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8262
8263         * location.cs: In the new compiler listing a file twice is a
8264         warning, not an error.
8265
8266 2004-05-24  Martin Baulig  <martin@ximian.com>
8267
8268         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8269         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8270
8271 2004-05-24  Martin Baulig  <martin@ximian.com>
8272
8273         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8274         walking the `using' list.  Fixes #53921.
8275
8276 2004-05-24  Martin Baulig  <martin@ximian.com>
8277
8278         * const.cs (Const.LookupConstantValue): Added support for
8279         EmptyCast's; fixes #55251.
8280
8281 2004-05-24  Martin Baulig  <martin@ximian.com>
8282
8283         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8284         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8285         which does the CS0135 check.  The reason is that we first need to
8286         check whether the variable actually exists.
8287
8288 2004-05-24  Martin Baulig  <martin@ximian.com>
8289
8290         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8291         than RootContext.LookupType() to find the explicit interface
8292         type.  Fixes #58584.
8293
8294 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8295
8296         * Makefile: Simplify.  Use executable.make.
8297         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8298
8299 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8300
8301         * decl.cs:
8302         * enum.cs:
8303         Use the invariant culture when doing String.Compare for CLS case
8304         sensitivity.
8305         
8306 2004-05-23  Martin Baulig  <martin@ximian.com>
8307
8308         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8309         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8310
8311         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8312         
8313 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8314
8315         * class.cs (MemberBase.Define): Reuse MemberType member for 
8316         resolved type. Other methods can use it too.
8317
8318 2004-05-23  Martin Baulig  <martin@ximian.com>
8319
8320         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8321         the variable also exists in the current block (otherwise, we need
8322         to report a CS0103).  Fixes #58670.
8323
8324 2004-05-23  Martin Baulig  <martin@ximian.com>
8325
8326         * flowanalysis.cs (Reachability.Reachable): Compute this
8327         on-the-fly rather than storing it as a field.
8328
8329 2004-05-23  Martin Baulig  <martin@ximian.com>
8330
8331         * flowanalysis.cs (Reachability.And): Manually compute the
8332         resulting `barrier' from the reachability.      
8333        
8334 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8335
8336         Fix bug #57835
8337         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8338         instance of ObsoleteAttribute when symbol is obsolete.
8339
8340         * class.cs
8341         (IMethodData): Extended interface for ObsoleteAttribute support.
8342
8343 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8344
8345         * attribute.cs: Fix bug #55970
8346
8347 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8348
8349         Fix bug #52705
8350         * attribute.cs
8351         (GetObsoleteAttribute): New method. Creates the instance of
8352         ObsoleteAttribute.
8353         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8354         ObsoleteAttribute when member is obsolete.
8355         (AttributeTester.Report_ObsoleteMessage): Common method for
8356         Obsolete error/warning reporting.
8357
8358         * class.cs
8359         (TypeContainer.base_classs_type): New member for storing parent type.
8360
8361         * decl.cs
8362         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8363         for this MemberCore.
8364
8365 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8366
8367         * attribute.cs, const.cs: Fix bug #58590
8368
8369 2004-05-21  Martin Baulig  <martin@ximian.com>
8370
8371         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8372         out parameters if the end of the method is unreachable.  Fixes
8373         #58098. 
8374
8375 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8376
8377         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8378         Hari was right, why extra method.
8379
8380 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8381
8382         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8383
8384 2004-05-20  Martin Baulig  <martin@ximian.com>
8385
8386         Merged this back from gmcs to keep the differences to a minumum.
8387
8388         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8389         instead of a Declspace.
8390         (Attribute.ResolveType): Likewise.
8391         (Attributes.Search): Likewise.
8392         (Attributes.Contains): Likewise.
8393         (Attributes.GetClsCompliantAttribute): Likewise.
8394
8395         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8396         argument.
8397         (MethodData.ApplyAttributes): Take an EmitContext instead of a
8398         DeclSpace.
8399
8400 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8401
8402         Fix bug #58688 (MCS does not report error when the same attribute
8403         is assigned twice)
8404
8405         * attribute.cs (Attribute.Emit): Distinction between null and default.
8406
8407 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8408
8409         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8410         of a top-level attribute without an attribute target.
8411         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8412         Make non-static.
8413         (Attribute.Conditional_GetConditionName), 
8414         (Attribute.Obsolete_GetObsoleteMessage): Update.
8415         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8416         part of ScanForIndexerName.
8417         (Attribute.CanIgnoreInvalidAttribute): New function.
8418         (Attribute.ScanForIndexerName): Move to ...
8419         (Attributes.ScanForIndexerName): ... here.
8420         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8421         (Attributes.Search): New internal variant that can choose not to
8422         complain if types aren't resolved.  The original signature now
8423         complains.
8424         (Attributes.GetClsCompliantAttribute): Use internal variant, with
8425         complaints suppressed.
8426         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8427         only if it not useful.
8428         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8429         top-level for attributes that are shared between the assembly
8430         and a top-level class.
8431         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8432         * class.cs: Update to reflect changes.
8433         (DefineIndexers): Fuse loops.
8434         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8435         a couple more variants of attribute names.
8436
8437 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8438
8439         Fix bug #52585 (Implemented explicit attribute declaration)
8440
8441         * attribute.cs:
8442         (Attributable.ValidAttributeTargets): New abstract method. It gets
8443         list of valid attribute targets for explicit target declaration.
8444         (Attribute.Target): It holds target itself.
8445         (AttributeSection): Removed.
8446         (Attribute.CheckTargets): New method. It checks whether attribute
8447         target is valid for the current element.
8448
8449         * class.cs:
8450         (EventProperty): New class. For events that are declared like
8451         property (with add and remove accessors).
8452         (EventField): New class. For events that are declared like field.
8453         class.cs
8454
8455         * cs-parser.jay: Implemented explicit attribute target declaration.
8456
8457         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8458         Override ValidAttributeTargets.
8459
8460         * parameter.cs:
8461         (ReturnParameter): Class for applying custom attributes on 
8462         the return type.
8463         (ParameterAtribute): New class. Class for applying custom
8464         attributes on the parameter type.
8465
8466 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8467
8468         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8469         definitions. 
8470
8471         (Method): Allow UNSAFE here.
8472
8473         * modifiers.cs: Support unsafe reporting.
8474
8475 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8476
8477         * decl.cs: Fix bug #58478.
8478
8479 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8480
8481         * statement.cs: When checking for unreachable code on an EmptyStatement,
8482         set the location. Fixes bug #58488.
8483
8484 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8485
8486         * driver.cs: Add -pkg handling.
8487
8488         From Gonzalo: UseShelLExecute=false
8489
8490 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8491
8492         * attribute.cs:
8493         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8494         for attribute.
8495         (Attribute.IsClsCompliaceRequired): Moved to base for better
8496         accesibility.
8497         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8498         when attribute is AttributeUsageAttribute.
8499         (Attribute.GetValidTargets): Simplified.
8500         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8501         attribute for this type.
8502         (Attribute.ApplyAttributes): Method renamed to Emit and make
8503         non-static.
8504         (GlobalAttributeSection): New class for special handling of global
8505         attributes (assembly, module).
8506         (AttributeSection.Emit): New method.
8507
8508         * class.cs: Implemented Attributable abstract methods.
8509         (MethodCore.LabelParameters): Moved to Parameter class.
8510         (Accessor): Is back simple class.
8511         (PropertyMethod): Implemented Attributable abstract class.
8512         (DelegateMethod): Implemented Attributable abstract class.
8513         (Event): New constructor for disctintion between normal Event
8514         and Event with accessors.
8515
8516         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8517
8518         * codegen.cs, const.cs, decl.cs, delegate.cs:
8519         (CommonAssemblyModulClass): Implemented Attributable abstract class
8520         and simplified.
8521
8522         * enum.cs: Implement IAttributeSupport interface.
8523         (EnumMember): New class for emum members. Implemented Attributable
8524         abstract class
8525
8526         * parameter.cs:
8527         (ParameterBase): Is abstract.
8528         (ReturnParameter): New class for easier [return:] attribute handling.
8529
8530         * typemanager.cs: Removed builder_to_attr.
8531
8532 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8533
8534         Fix bug #57151.
8535         * attribute.cs (Attribute.GetPositionalValue): New function.
8536         * class.cs (TypeContainer.VerifyMembers): New function.
8537         (TypeContainer.Emit): Use it.
8538         (ClassOrStruct): New base class for Class and Struct.
8539         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8540         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8541         class.
8542         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8543         then each non-static field should have a FieldOffset attribute.
8544         Otherwise, none of the fields should have a FieldOffset attribute.
8545         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8546         and FieldOffset attributes.
8547         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8548         (TypeManager.field_offset_attribute_type): New core types.
8549         (TypeManager.InitCoreTypes): Initialize them.
8550
8551 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8552
8553         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8554         Return correct type.
8555         From bug #58270.
8556
8557 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8558
8559         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8560         be implicitly converted to ulong.
8561         
8562         * expression.cs: The logic for allowing operator &, | and ^ worked
8563         was wrong, it worked before because we did not report an error in
8564         an else branch.  Fixes 57895.
8565
8566         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8567         allow volatile fields to be reference types.
8568
8569 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8570
8571         * driver.cs: Add support for /debug-
8572
8573 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8574
8575         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8576         Add a 'complain' parameter to silence errors.
8577         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8578         silently overlooked type-resolutions.
8579         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8580         to reflect changes.
8581         (Attributes.Search): New function.
8582         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8583         (Attributes.GetAttributeFullName): Remove hack.
8584         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
8585         Update to reflect changes.
8586         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8587         Use Attributes.Search instead of nested loops.
8588
8589 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
8590
8591         * decl.cs:
8592         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8593         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8594         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8595
8596         * report.cs: (Report.Warning): Renamed to Warning_T because of
8597         parameter collision.
8598
8599 2004-05-05  Raja R Harinath  <rharinath@novell.com>
8600
8601         * expression.cs (MemberAccess.ResolveMemberAccess):
8602         Exit with non-zero status after Report.Error.
8603         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8604         Likewise.
8605         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8606
8607 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8608
8609         * support.cs: Don't hang when the file is empty.
8610
8611 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8612
8613         * support.cs: In SeekableStreamReader, compute the preamble size of the
8614           underlying stream. Position changes should take into account that initial
8615           count of bytes.
8616
8617 2004-05-03  Todd Berman  <tberman@sevenl.net>
8618
8619         * driver.cs: remove unused GetSysVersion function.
8620
8621 2004-05-03  Todd Berman  <tberman@sevenl.net>
8622
8623         * driver.cs: Remove the hack from saturday, as well as the hack
8624         from jackson (LoadAssemblyFromGac), also adds the CWD to the
8625         link_paths to get that bit proper.
8626
8627 2004-05-01  Todd Berman  <tberman@sevenl.net>
8628
8629         * driver.cs: Try a LoadFrom before a Load, this checks the current
8630         path. This is currently a bug in mono that is be fixed, however, this
8631         provides a workaround for now. This will be removed when the bug
8632         is fixed.
8633
8634 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
8635
8636         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8637         incomplete key pairs (#57941).
8638
8639 2004-05-01  Todd Berman  <tberman@sevenl.net>
8640
8641         * driver.cs: Remove '.' from path_chars, now System.* loads properly
8642         from the GAC
8643
8644 2004-04-30  Jackson Harper  <jackson@ximian.com>
8645
8646         * codegen.cs: Open keys readonly.
8647         
8648 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8649
8650         * typemanager.cs: don't report cyclic struct layout when a struct
8651         contains 2 or more fields of the same type. Failed for Pango.AttrShape
8652         which has 2 Pango.Rectangle fields.
8653
8654 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8655
8656         * expression.cs: Handle IntPtr comparisons with IL code
8657         rather than a method call.
8658
8659 2004-04-29  Martin Baulig  <martin@ximian.com>
8660
8661         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
8662         the list of PropertyInfo's in class hierarchy and find the
8663         accessor.  Fixes #56013.
8664
8665 2004-04-29  Martin Baulig  <martin@ximian.com>
8666
8667         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8668
8669 2004-04-29  Martin Baulig  <martin@ximian.com>
8670
8671         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8672
8673         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8674
8675 2004-04-29  Martin Baulig  <martin@ximian.com>
8676
8677         * class.cs (ConstructorInitializer.Resolve): Check whether the
8678         parent .ctor is accessible.  Fixes #52146.
8679
8680 2004-04-29  Martin Baulig  <martin@ximian.com>
8681
8682         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8683
8684         * statement.cs (Using.EmitLocalVariableDecls): Use
8685         TypeManager.idisposable_type, not typeof (IDisposable).
8686         (Foreach.EmitCollectionForeach): Added support for valuetypes.
8687
8688 2004-04-29  Martin Baulig  <martin@ximian.com>
8689
8690         * class.cs (Event.Define): Don't emit the field and don't set
8691         RTSpecialName and SpecialName for events on interfaces.  Fixes
8692         #57703. 
8693
8694 2004-04-29  Raja R Harinath  <rharinath@novell.com>
8695
8696         Refactor Attribute.ApplyAttributes.
8697         * attribute.cs (Attributable): New base class for objects that can
8698         have Attributes applied on them.
8699         (Attribute): Make AttributeUsage fields public.
8700         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8701         (Attribute.IsInternalCall): New property.
8702         (Attribute.UsageAttr): Convert to a public read-only property.
8703         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8704         (Attribute.ResolveType, Attribute.Resolve)
8705         (Attribute.ScanForIndexerName): Update to reflect changes.
8706         (Attribute.CheckAttributeTarget): Re-format.
8707         (Attribute.ApplyAttributes): Refactor, to various
8708         Attributable.ApplyAttributeBuilder methods.
8709         * decl.cs (MemberCore): Make Attributable.
8710         * class.cs (Accessor): Make Attributable.
8711         (MethodData.ApplyAttributes): Use proper attribute types, not
8712         attribute names.
8713         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8714         (TypeContainer.ApplyAttributeBuilder)
8715         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8716         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
8717         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8718         (Operator.ApplyAttributeBuilder): New factored-out methods.
8719         * const.cs (Const.ApplyAttributeBuilder): Likewise.
8720         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8721         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8722         * parameter.cs (ParameterBase): New Attributable base class
8723         that can also represent Return types.
8724         (Parameter): Update to the changes.
8725
8726 2004-04-29  Jackson Harper  <jackson@ximian.com>
8727
8728         * driver.cs: Prefer the corlib system version when looking for
8729         assemblies in the GAC. This is still a hack, but its a better hack
8730         now.
8731         
8732 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
8733
8734         * decl.cs, enum.cs: Improved error 3005 reporting.
8735   
8736         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8737         (related_symbols): New private member for list of symbols
8738         related to reported error/warning.
8739         
8740         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8741
8742 2004-04-29  Martin Baulig  <martin@ximian.com>
8743
8744         * ecore.cs (Expression.Constantify): If we're an enum and
8745         TypeManager.TypeToCoreType() doesn't give us another type, use
8746         t.UnderlyingSystemType.  Fixes #56178.  
8747
8748 2004-04-29  Martin Baulig  <martin@ximian.com>
8749
8750         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8751         interfaces and for each interface, only add members directly
8752         declared in that interface.  Fixes #53255.
8753
8754 2004-04-28  Martin Baulig  <martin@ximian.com>
8755
8756         * expression.cs (ConditionalLogicalOperator): Use a temporary
8757         variable for `left' to avoid that we evaluate it more than once;
8758         bug #52588.
8759
8760 2004-04-28  Martin Baulig  <martin@ximian.com>
8761
8762         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8763         `void[]' (CS1547).
8764
8765 2004-04-28  Martin Baulig  <martin@ximian.com>
8766
8767         * statement.cs (LocalInfo.Resolve): Check whether the type is not
8768         void (CS1547).
8769
8770         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8771         whether the type is not void (CS1547).
8772
8773 2004-04-28  Martin Baulig  <martin@ximian.com>
8774
8775         * expression.cs (Unary.DoResolveLValue): Override this and report
8776         CS0131 for anything but Operator.Indirection.
8777
8778 2004-04-28  Martin Baulig  <martin@ximian.com>
8779
8780         Committing a patch from Ben Maurer; see bug #50820.
8781
8782         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8783         check for classes.
8784
8785         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8786         classes.        
8787
8788 2004-04-28  Martin Baulig  <martin@ximian.com>
8789
8790         Committing a patch from Ben Maurer; see bug #50820.
8791
8792         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8793         check for classes.
8794
8795         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8796         classes.        
8797
8798 2004-04-28  Martin Baulig  <martin@ximian.com>
8799
8800         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8801         (Block.AddLabel): Call DoLookupLabel() to only search in the
8802         current block.
8803
8804 2004-04-28  Martin Baulig  <martin@ximian.com>
8805
8806         * cfold.cs (ConstantFold.BinaryFold): Added special support for
8807         comparing StringConstants and NullLiterals in Equality and Inequality.
8808
8809 2004-04-28  Jackson Harper  <jackson@ximian.com>
8810
8811         * driver.cs: Attempt to load referenced assemblies from the
8812         GAC. This is the quick and dirty version of this method that
8813         doesnt take into account versions and just takes the first
8814         canidate found. Will be good enough for now as we will not have more
8815         then one version installed into the GAC until I update this method.
8816
8817 2004-04-28  Martin Baulig  <martin@ximian.com>
8818
8819         * typemanager.cs (TypeManager.CheckStructCycles): New public
8820         static method to check for cycles in the struct layout.
8821
8822         * rootcontext.cs (RootContext.PopulateTypes): Call
8823         TypeManager.CheckStructCycles() for each TypeContainer.
8824         [Note: We only need to visit each type once.]
8825
8826 2004-04-28  Martin Baulig  <martin@ximian.com>
8827
8828         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8829
8830         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8831         success and added `out object value'.  Use a `bool resolved' field
8832         to check whether we've already been called rather than
8833         `ConstantValue != null' since this breaks for NullLiterals.
8834
8835 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8836
8837         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8838         setting of this flag, since the 'set' method may be non-public.
8839
8840 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8841
8842         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8843         check on current_vector.Block.
8844
8845 2004-04-27  Martin Baulig  <martin@ximian.com>
8846
8847         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8848         a field initializer.  Fixes #56459.
8849
8850 2004-04-27  Martin Baulig  <martin@ximian.com>
8851
8852         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8853         we're not attempting to use an indexer.  Fixes #52154.
8854
8855 2004-04-27  Martin Baulig  <martin@ximian.com>
8856
8857         * statement.cs (Return): Don't create a return label if we don't
8858         need it; reverts my change from January 20th.  Thanks to Ben
8859         Maurer for this.
8860
8861 2004-04-27  Martin Baulig  <martin@ximian.com>
8862
8863         According to the spec, `goto' can only leave a nested scope, but
8864         never enter it.
8865
8866         * statement.cs (Block.LookupLabel): Only lookup in the current
8867         block, don't recurse into parent or child blocks.
8868         (Block.AddLabel): Check in parent and child blocks, report
8869         CS0140/CS0158 if we find a duplicate.
8870         (Block): Removed this indexer for label lookups.
8871         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8872         this already does the error reporting for us.
8873
8874         * flowanalysis.cs
8875         (FlowBranching.UsageVector.Block): New public variable; may be null.
8876         (FlowBranching.CreateSibling): Added `Block' argument.
8877         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
8878         label for the target of a `goto' and check whether we're not
8879         leaving a `finally'.
8880
8881 2004-04-27  Martin Baulig  <martin@ximian.com>
8882
8883         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8884         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8885         just for returns).
8886
8887 2004-04-27  Martin Baulig  <martin@ximian.com>
8888
8889         * statement.cs (Block.AddLabel): Also check for implicit blocks
8890         and added a CS0158 check.
8891
8892 2004-04-27  Martin Baulig  <martin@ximian.com>
8893
8894         * flowanalysis.cs (FlowBranchingLoop): New class.
8895         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8896         UsageVector's instead of an ArrayList.
8897         (FlowBranching.Label): Likewise.
8898         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8899         (FlowBranching.AddBreakVector): New method.
8900
8901 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
8902
8903         * attribute.cs: Small regression fix: only convert the type if we
8904         the type is different, fixes System.Drawing build.
8905
8906 2004-04-27  Martin Baulig  <martin@ximian.com>
8907
8908         * attribute.cs (Attribute.Resolve): If we have a constant value
8909         for a named field or property, implicity convert it to the correct
8910         type.
8911
8912 2004-04-27  Raja R Harinath  <rharinath@novell.com>
8913
8914         * statement.cs (Block.Block): Implicit blocks share
8915         'child_variable_names' fields with parent blocks.
8916         (Block.AddChildVariableNames): Remove.
8917         (Block.AddVariable): Mark variable as "used by a child block" in
8918         every surrounding block.
8919         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8920         been used in a child block, complain about violation of "Invariant
8921         meaning in blocks" rule.
8922         * cs-parser.jay (declare_local_variables): Don't use
8923         AddChildVariableNames.
8924         (foreach_statement): Don't create an implicit block: 'foreach'
8925         introduces a scope.
8926
8927 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
8928
8929         * convert.cs (ImplicitNumericConversion): 0 is also positive when
8930         converting from 0L to ulong.  Fixes 57522.
8931
8932 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8933
8934         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8935         derived class hides via 'new' keyword field from base class (test-242.cs).
8936         TODO: Handle this in the more general way.
8937         
8938         * class.cs (CheckBase): Ditto.
8939
8940 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8941
8942         * decl.cs (caching_flags): New member for storing cached values
8943         as bit flags.
8944         (MemberCore.Flags): New enum where bit flags for caching_flags
8945         are defined.
8946         (MemberCore.cls_compliance): Moved to caching_flags.
8947         (DeclSpace.Created): Moved to caching_flags.
8948
8949         * class.cs: Use caching_flags instead of DeclSpace.Created
8950         
8951 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
8952
8953         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8954         if we are only a derived class, not a nested class.
8955
8956         * typemanager.cs: Same as above, but do this at the MemberLookup
8957         level (used by field and methods, properties are handled in
8958         PropertyExpr).   Allow for the qualified access if we are a nested
8959         method. 
8960
8961 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
8962
8963         * class.cs: Refactoring.
8964         (IMethodData): New inteface; Holds links to parent members
8965         to avoid member duplication (reduced memory allocation).
8966         (Method): Implemented IMethodData interface.
8967         (PropertyBase): New inner classes for get/set methods.
8968         (PropertyBase.PropertyMethod): Implemented IMethodData interface
8969         (Event): New inner classes for add/remove methods.
8970         (Event.DelegateMethod): Implemented IMethodData interface.
8971
8972         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8973         EmitContext (related to class.cs refactoring).
8974
8975 2004-04-21  Raja R Harinath  <rharinath@novell.com>
8976
8977         * delegate.cs (Delegate.VerifyApplicability): If the number of
8978         arguments are the same as the number of parameters, first try to
8979         verify applicability ignoring  any 'params' modifier on the last
8980         parameter.
8981         Fixes #56442.
8982
8983 2004-04-16  Raja R Harinath  <rharinath@novell.com>
8984
8985         * class.cs (TypeContainer.AddIndexer): Use
8986         'ExplicitInterfaceName' to determine if interface name was
8987         explicitly specified.  'InterfaceType' is not initialized at this time.
8988         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
8989         Indexers array is already in the required order.  Initialize
8990         'IndexerName' only if there are normal indexers.
8991         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8992         (TypeContainer.Emit): Emit DefaultMember attribute only if
8993         IndexerName is initialized.
8994         Fixes #56300.
8995
8996 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
8997
8998         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8999         Fixes #57007
9000
9001 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9002
9003         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9004         attributes.
9005         Fix for #56456.
9006
9007         * attribute.cs (Attribute.Resolve): Check for duplicate named
9008         attributes.
9009         Fix for #56463.
9010
9011 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9012
9013         * iterators.cs (MarkYield): track whether we are in an exception,
9014         and generate code accordingly.  Use a temporary value to store the
9015         result for our state.
9016
9017         I had ignored a bit the interaction of try/catch with iterators
9018         since their behavior was not entirely obvious, but now it is
9019         possible to verify that our behavior is the same as MS .NET 2.0
9020
9021         Fixes 54814
9022
9023 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9024
9025         * iterators.cs: Avoid creating temporaries if there is no work to
9026         do. 
9027
9028         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9029         Enumerations, use TypeManager.EnumToUnderlying and call
9030         recursively. 
9031
9032         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9033         bug #57013
9034
9035         (This.Emit): Use EmitContext.EmitThis to emit our
9036         instance variable.
9037
9038         (This.EmitAssign): Ditto.
9039
9040         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9041         codepaths, we will move all the functionality into
9042         Mono.CSharp.This 
9043
9044         (FieldExpr.EmitAssign): Ditto.
9045
9046         This fixes several hidden bugs that I uncovered while doing a code
9047         review of this today.
9048
9049         * codegen.cs (EmitThis): reworked so the semantics are more clear
9050         and also support value types "this" instances.
9051
9052         * iterators.cs: Changed so that for iterators in value types, we
9053         do not pass the value type as a parameter.  
9054
9055         Initialization of the enumerator helpers is now done in the caller
9056         instead of passing the parameters to the constructors and having
9057         the constructor set the fields.
9058
9059         The fields have now `assembly' visibility instead of private.
9060
9061 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9062
9063         * expression.cs (Argument.Resolve): Check if fields passed as ref
9064         or out are contained in a MarshalByRefObject.
9065
9066         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9067         another compiler type.
9068
9069 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9070
9071         * class.cs (Indexer.Define): use the new name checking method.
9072         Also, return false on an error.
9073         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9074         (is_identifier_[start/part]_character): make static.
9075
9076 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9077
9078         * expression.cs (Binary.ResolveOperator): Do no append strings
9079         twice: since we can be invoked more than once (array evaluation)
9080         on the same concatenation, take care of this here.  Based on a fix
9081         from Ben (bug #56454)
9082
9083 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9084
9085         * codegen.cs: Fix another case where CS1548 must be reported (when 
9086         delay-sign isn't specified and no private is available #56564). Fix
9087         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9088         error when MCS is used on the MS runtime and we need to delay-sign 
9089         (which seems unsupported by AssemblyBuilder - see #56621).
9090
9091 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9092
9093         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9094         (TypeManager.ComputeNamespaces): Faster implementation for
9095         Microsoft runtime.
9096
9097         * compiler.csproj: Updated AssemblyName to mcs.
9098
9099 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9100
9101         * rootcontext.cs: Add new types to the boot resolution.
9102
9103         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9104         MulticastDelegate is not allowed.
9105
9106         * typemanager.cs: Add new types to lookup: System.TypedReference
9107         and ArgIterator.
9108
9109         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9110         check for TypedReference or ArgIterator, they are not allowed. 
9111
9112         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9113         makes us properly catch 1510 in some conditions (see bug 56016 for
9114         details). 
9115
9116 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9117
9118         * CryptoConvert.cs: update from corlib version
9119         with endian fixes.
9120
9121 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9122
9123         * class.cs (Indexer.Define): Check indexername declaration
9124
9125 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9126
9127         * attribute.cs (IsClsCompliant): Fixed problem with handling
9128         all three states (compliant, not-compliant, undetected).
9129
9130 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9131
9132         * attribute.cs (Attribute): Location is now public.
9133         (Resolve): Store resolved arguments (pos_values) in attribute class.
9134         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9135         (GetClsCompliantAttributeValue): New method that gets
9136         CLSCompliantAttribute value.
9137         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9138         if exists else null.
9139         (AttributeTester): New class for CLS-Compliant verification routines.
9140
9141         * class.cs (Emit): Add CLS-Compliant verification.
9142         (Method.GetSignatureForError): Implemented.
9143         (Constructor.GetSignatureForError): Implemented
9144         (Constructor.HasCompliantArgs): Returns if constructor has
9145         CLS-Compliant arguments.
9146         (Constructor.Emit): Override.
9147         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9148         is needed to test only parameters.
9149         (FieldBase.GetSignatureForError): Implemented.
9150         (TypeContainer): New member for storing base interfaces.
9151         (TypeContainer.FindMembers): Search in base interfaces too.
9152
9153         * codegen.cs (GetClsComplianceAttribute): New method that gets
9154         assembly or module CLSCompliantAttribute value.
9155         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9156         for assembly.
9157         (ModuleClass.Emit): Add error 3012 test.
9158
9159         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9160
9161         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9162         state for all decl types.
9163         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9164         if CLS-Compliant tests are required.
9165         (IsClsCompliaceRequired): New method. Analyze whether code
9166         must be CLS-Compliant.
9167         (IsExposedFromAssembly): New method. Returns true when MemberCore
9168         is exposed from assembly.
9169         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9170         value or gets cached value.
9171         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9172         is explicitly marked with CLSCompliantAttribute.
9173         (IsIdentifierClsCompliant): New abstract method. This method is
9174         used to testing error 3005.
9175         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9176         for identifier and parameters CLS-Compliant testing.
9177         (VerifyClsCompliance): New method. The main virtual method for
9178         CLS-Compliant verifications.
9179         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9180         null. I don't know why is null (too many public members !).
9181         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9182         and get value of first CLSCompliantAttribute that found.
9183
9184         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9185         (VerifyClsCompliance): Override and add extra tests.
9186
9187         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9188         clscheck- disable CLS-Compliant verification event if assembly is has
9189         CLSCompliantAttribute(true).
9190
9191         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9192         ApllyAttribute is now called in emit section as in the other cases.
9193         Possible future Emit integration.
9194         (IsIdentifierClsCompliant): New override.
9195         (VerifyClsCompliance): New override.
9196         (GetEnumeratorName): Returns full enum name.
9197
9198         * parameter.cs (GetSignatureForError): Implemented.
9199
9200         * report.cs (WarningData): New struct for Warning message information.
9201         (LocationOfPreviousError): New method.
9202         (Warning): New method. Reports warning based on the warning table.
9203         (Error_T): New method. Reports error based on the error table.
9204
9205         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9206         verifications are done here.
9207
9208         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9209
9210         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9211         CLSCompliantAttribute.
9212         (all_imported_types): New member holds all imported types from other
9213         assemblies.
9214         (LoadAllImportedTypes): New method fills static table with exported types
9215         from all referenced assemblies.
9216         (Modules): New property returns all assembly modules.
9217
9218 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9219
9220         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9221         throwing a parser error.
9222
9223         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9224         which removes the hardcoded get_/set_ prefixes for properties, as
9225         IL allows for the properties to be named something else.  
9226
9227         Bug #56013
9228
9229         * expression.cs: Do not override operand before we know if it is
9230         non-null.  Fix 56207
9231
9232 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9233
9234         * typemanager.cs: support for pinned variables.
9235
9236 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9237
9238         * decl.cs, typemanager.cs: Avoid using an arraylist
9239         as a buffer if there is only one result set.
9240
9241 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9242
9243         * expression.cs: Make sure you cant call a static method
9244         with an instance expression, bug #56174.
9245
9246 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9247
9248         * class.cs (IsDuplicateImplementation): Improve error reporting to
9249         flag 663 (method only differs in parameter modifier).
9250
9251         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9252         in preprocessor directives.
9253
9254         * location.cs (LookupFile): Allow for the empty path.
9255
9256         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9257         better approach for some of that patch, but its failing with the
9258         CharSet enumeration.  For now try/catch will do.
9259
9260         * typemanager.cs: Do not crash if a struct does not have fields.
9261         Fixes 56150.
9262
9263 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9264
9265         * expression.cs: cs0213, cant fix a fixed expression.
9266         fixes 50231.
9267
9268 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9269
9270         * cs-parser.jay: detect invalid embeded statements gracefully.
9271         bug #51113.
9272
9273 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9274
9275         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9276         As a regex:
9277         s/
9278         the invocation type may not be a subclass of the tye of the item/
9279         The type of the item must be a subclass of the invocation item.
9280         /g
9281
9282         Fixes bug #50820.
9283
9284 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9285
9286         * attribute.cs: Added methods to get a string and a bool from an
9287         attribute. Required to information from AssemblyKeyFileAttribute,
9288         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9289         * codegen.cs: Modified AssemblyName creation to include support for
9290         strongnames. Catch additional exceptions to report them as CS1548.
9291         * compiler.csproj: Updated include CryptoConvert.cs.
9292         * compiler.csproj.user: Removed file - user specific configuration.
9293         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9294         Mono.Security assembly. The original class is maintained and tested in
9295         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9296         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9297         like CSC 8.0 (C# v2) supports.
9298         * Makefile: Added CryptoConvert.cs to mcs sources.
9299         * rootcontext.cs: Added new options for strongnames.
9300
9301 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9302
9303         * driver.cs: For --expect-error, report error code `2'
9304         if the program compiled with no errors, error code `1' if
9305         it compiled with an error other than the one expected.
9306
9307 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9308
9309         * compiler.csproj: Updated for Visual Studio .NET 2003.
9310         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9311         * compiler.sln: Updated for Visual Studio .NET 2003.
9312
9313 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9314
9315         * expression.cs: Fix bug #47234. We basically need to apply the
9316         rule that we prefer the conversion of null to a reference type
9317         when faced with a conversion to 'object' (csc behaviour).
9318
9319 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9320
9321         * statement.cs: Shorter form for foreach, eliminates
9322         a local variable. r=Martin.
9323
9324 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9325
9326         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9327         checks if we can use brtrue/brfalse to test for 0.
9328         * expression.cs: use the above in the test for using brtrue/brfalse.
9329         cleanup code a bit.
9330
9331 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9332
9333         * expression.cs: Rewrite string concat stuff. Benefits:
9334
9335         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9336         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9337         rather than a concat chain.
9338
9339         * typemanager.cs: Add lookups for more concat overloads.
9340
9341 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9342
9343         * expression.cs: Emit shorter il code for array init.
9344
9345         newarr
9346         dup
9347         // set 1
9348
9349         // set 2
9350
9351         newarr
9352         stloc.x
9353
9354         ldloc.x
9355         // set 1
9356
9357         ldloc.x
9358         // set 2
9359
9360 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9361
9362         * statement.cs: Before, two switch blocks would be merged if the
9363         total size of the blocks (end_item - begin_item + 1) was less than
9364         two times the combined sizes of the blocks.
9365
9366         Now, it will only merge if after the merge at least half of the
9367         slots are filled.
9368
9369         fixes 55885.
9370
9371 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9372
9373         * class.cs : csc build fix for GetMethods(). See bug #52503.
9374
9375 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9376
9377         * expression.cs: Make sure fp comparisons work with NaN.
9378         This fixes bug #54303. Mig approved this patch a long
9379         time ago, but we were not able to test b/c the runtime
9380         had a related bug.
9381
9382 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9383
9384         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9385
9386 2004-03-19  Martin Baulig  <martin@ximian.com>
9387
9388         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9389         error here and not in our caller.
9390
9391 2004-03-19  Martin Baulig  <martin@ximian.com>
9392
9393         * interface.cs: Completely killed this file.
9394         (Interface): We're now a TypeContainer and live in class.cs.
9395
9396         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9397         argument; we're now also called for interfaces.
9398         (TypeContainer.DefineMembers): Allow this method being called
9399         multiple times.
9400         (TypeContainer.GetMethods): New public method; formerly known as
9401         Interface.GetMethod().  This is used by PendingImplementation.
9402         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9403         it's now private and non-static.
9404         (Interface): Moved this here; it's now implemented similar to
9405         Class and Struct.
9406         (Method, Property, Event, Indexer): Added `bool is_interface'
9407         argument to their .ctor's.
9408         (MemberBase.IsInterface): New public field.
9409
9410         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9411         instances instead of InterfaceMethod, InterfaceProperty, etc.
9412         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9413         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9414
9415 2004-03-19  Martin Baulig  <martin@ximian.com>
9416
9417         * class.cs (MethodCore.IsDuplicateImplementation): New private
9418         method which does the CS0111 checking.
9419         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9420         Use IsDuplicateImplementation().
9421
9422 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9423
9424         * decl.cs (FindMemberToOverride): New method to find the correct
9425         method or property to override in the base class.
9426         * class.cs
9427             - Make Method/Property use the above method to find the
9428               version in the base class.
9429             - Remove the InheritableMemberSignatureCompare as it is now
9430               dead code.
9431
9432         This patch makes large code bases much faster to compile, as it is
9433         O(n) rather than O(n^2) to do this validation.
9434
9435         Also, it fixes bug 52458 which is that nested classes are not
9436         taken into account when finding the base class member.
9437
9438         Reviewed/Approved by Martin.
9439
9440 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9441
9442         * interface.cs: In all interface classes removed redundant
9443         member initialization.
9444
9445 2004-03-16  Martin Baulig  <martin@ximian.com>
9446
9447         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9448
9449 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9450
9451         * decl.cs (DefineTypeAndParents): New helper method to define a
9452         type's containers before the type itself is defined;  This is a
9453         bug exposed by the recent changes to Windows.Forms when an
9454         implemented interface was defined inside a class that had not been
9455         built yet.   
9456
9457         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9458
9459         (Check): Loop correctly to report errors modifiers
9460         (UNSAFE was not in the loop, since it was the same as TOP).
9461
9462         * interface.cs: Every interface member now takes a ModFlags,
9463         instead of a "is_new" bool, which we set on the base MemberCore. 
9464
9465         Every place where we called "UnsafeOk" in the interface, now we
9466         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9467         the unsafe settings from the member declaration instead of the
9468         container interface. 
9469
9470         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9471
9472         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9473         `set_indexer_name' to the pending bits (one per type).
9474
9475         We fixed a bug today that was picking the wrong method to
9476         override, since for properties the existing InterfaceMethod code
9477         basically ignored the method name.  Now we make sure that the
9478         method name is one of the valid indexer names.
9479
9480 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9481  
9482         * support.cs (SeekableStreamReader): Keep track of stream byte
9483         positions and don't mix them with character offsets to the buffer.
9484
9485         Patch from Gustavo Giráldez
9486
9487 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9488
9489         * interface.cs (InterfaceSetGetBase): Removed double member
9490         initialization, base class does it as well.
9491
9492 2004-03-13  Martin Baulig  <martin@ximian.com>
9493
9494         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9495         when compiling corlib.
9496
9497 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9498
9499         * convert.cs (ExplicitConversion): We were reporting an error on
9500         certain conversions (object_type source to a value type, when the
9501         expression was `null') before we had a chance to pass it through
9502         the user defined conversions.
9503
9504         * driver.cs: Replace / and \ in resource specifications to dots.
9505         Fixes 50752
9506
9507         * class.cs: Add check for duplicate operators.  Fixes 52477
9508
9509 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9510
9511         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9512         that are in the middle of the statements, not only at the end.
9513         Fixes #54987
9514
9515         * class.cs (TypeContainer.AddField): No longer set the
9516         `HaveStaticConstructor' flag, now we call it
9517         `UserDefineStaticConstructor' to diferentiate the slightly
9518         semantic difference.
9519
9520         The situation is that we were not adding BeforeFieldInit (from
9521         Modifiers.TypeAttr) to classes that could have it.
9522         BeforeFieldInit should be set to classes that have no static
9523         constructor. 
9524
9525         See:
9526
9527         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9528
9529         And most importantly Zoltan's comment:
9530
9531         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9532
9533         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9534          before its static fields are used', i.e. initialization does not need
9535          to be triggered by the first access to the type. Setting this flag
9536          helps the JIT to compile better code, since it can run the static
9537          constructor at JIT time, and does not need to generate code to call it
9538          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9539          this flag for lots of classes like String. 
9540          
9541          csc sets this flag if the type does not have an explicit static 
9542          constructor. The reasoning seems to be that if there are only static
9543          initalizers for a type, and no static constructor, then the programmer
9544          does not care when this initialization happens, so beforefieldinit
9545          can be used.
9546          
9547          This bug prevents the AOT compiler from being usable, since it 
9548          generates so many calls to mono_runtime_class_init that the AOT code
9549          is much slower than the JITted code. The JITted code is faster, 
9550          because it does not generate these calls if the vtable is type is
9551          already initialized, which is true in the majority of cases. But the
9552          AOT compiler can't do this."
9553
9554 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9555
9556         * class.cs (MethodData.Emit): Refactor the code so symbolic
9557         information is generated for destructors;  For some reasons we
9558         were taking a code path that did not generate symbolic information
9559         before. 
9560
9561 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9562
9563         * class.cs: Create a Constructor.CheckBase method that
9564         takes care of all validation type code. The method
9565         contains some code that was moved from Define.
9566
9567         It also includes new code that checks for duplicate ctors.
9568         This fixes bug #55148.
9569
9570 2004-03-09  Joshua Tauberer <tauberer@for.net>
9571
9572         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9573         a { ... }-style array creation invokes EmitStaticInitializers
9574         which is not good for reference-type arrays.  String, decimal
9575         and now null constants (NullCast) are not counted toward
9576         static initializers.
9577
9578 2004-03-05  Martin Baulig  <martin@ximian.com>
9579
9580         * location.cs (SourceFile.HasLineDirective): New public field;
9581         specifies whether the file contains or is referenced by a "#line"
9582         directive.
9583         (Location.DefineSymbolDocuments): Ignore source files which
9584         either contain or are referenced by a "#line" directive.        
9585
9586 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9587
9588         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9589         direct access to our parent, so check the method inline there.
9590
9591 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9592
9593         * expression.cs (Invocation.EmitCall): Miguel's last commit
9594         caused a regression. If you had:
9595
9596             T t = null;
9597             t.Foo ();
9598
9599         In Foo the implict this would be null.
9600
9601 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9602
9603         * expression.cs (Invocation.EmitCall): If the method is not
9604         virtual, do not emit a CallVirt to it, use Call.
9605
9606         * typemanager.cs (GetFullNameSignature): Improve the method to
9607         cope with ".ctor" and replace it with the type name.
9608
9609         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9610         as an argument the ConstructorBuilder where it is being defined,
9611         to catch the recursive constructor invocations.
9612
9613 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9614
9615         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9616         routines to check if a type is an enumerable/enumerator allow
9617         classes that implement the IEnumerable or IEnumerator interfaces.
9618
9619         * class.cs (Property, Operator): Implement IIteratorContainer, and
9620         implement SetYields.
9621
9622         (Property.Define): Do the block swapping for get_methods in the
9623         context of iterators.   We need to check if Properties also
9624         include indexers or not.
9625
9626         (Operator): Assign the Block before invoking the
9627         OperatorMethod.Define, so we can trigger the Iterator code
9628         replacement. 
9629
9630         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9631         Property and Operator classes are not created when we parse the
9632         declarator but until we have the block completed, so we use a
9633         singleton SimpleIteratorContainer.Simple to flag whether the
9634         SetYields has been invoked.
9635
9636         We propagate this setting then to the Property or the Operator to
9637         allow the `yield' to function.
9638
9639 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9640
9641         * codegen.cs: Implemented attribute support for modules.
9642         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9643         Assembly/Module functionality.
9644
9645         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9646         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9647         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9648
9649 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9650
9651         * interface.cs (FindMembers): The operation is performed on all base
9652         interfaces and not only on the first. It is required for future CLS Compliance patch.
9653
9654 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9655
9656         * statement.cs, codegen.cs:
9657         This patch deals with patterns such as:
9658
9659         public class List : IEnumerable {
9660
9661                 public MyEnumerator GetEnumerator () {
9662                         return new MyEnumerator(this);
9663                 }
9664
9665                 IEnumerator IEnumerable.GetEnumerator () {
9666                         ...
9667                 }
9668                 
9669                 public struct MyEnumerator : IEnumerator {
9670                         ...
9671                 }
9672         }
9673
9674         Before, there were a few things we did wrong:
9675         1) we would emit callvirt on a struct, which is illegal
9676         2) we emited ldarg when we needed to emit ldarga
9677         3) we would mistakenly call the interface methods on an enumerator
9678         type that derived from IEnumerator and was in another assembly. For example:
9679
9680         public class MyEnumerator : IEnumerator
9681
9682         Would have the interface methods called, even if there were public impls of the
9683         method. In a struct, this lead to invalid IL code.
9684
9685 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9686
9687         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9688           renamed to Emit.
9689
9690         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9691
9692 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9693
9694         * cs-parser.jay: Fix small regression: we were not testing V2
9695         compiler features correctly.
9696
9697         * interface.cs: If the emit context is null, then create one
9698
9699 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9700
9701         * decl.cs (GetSignatureForError): New virtual method to get full name
9702           for error messages.
9703
9704         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9705           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9706
9707         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9708           Duplicated members and code in these classes has been removed.
9709           Better encapsulation in these classes.
9710
9711 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9712
9713         * assign.cs (Assign.DoResolve): When dealing with compound
9714         assignments, there is a new rule in ECMA C# 2.4 (might have been
9715         there before, but it is documented here) that states that in:
9716
9717         a op= b;
9718
9719         If b is of type int, and the `op' is a shift-operator, then the
9720         above is evaluated as:
9721
9722         a = (int) a op b 
9723
9724         * expression.cs (Binary.ResolveOperator): Instead of testing for
9725         int/uint/long/ulong, try to implicitly convert to any of those
9726         types and use that in pointer arithmetic.
9727
9728         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9729         method to print information for from the type, not from the
9730         null-method we were given.
9731
9732 2004-02-01  Duncan Mak  <duncan@ximian.com>
9733
9734         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9735         parsing for cmd, fixes bug #53694.
9736
9737 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9738
9739         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9740         in the member name duplication tests. Property and operator name duplication
9741         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9742
9743 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9744
9745         * interface.cs (PopulateMethod): Fixed crash when interface method
9746         returns not existing type (error test cs0246-3.cs).
9747
9748 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9749
9750         * cs-parser.jay (interface_accessors): Re-write actions to also
9751         store attributes attached to get and set methods. Fix spelling
9752         while at it.
9753
9754         (inteface_property_declaration): Modify accordingly.
9755
9756         (InterfaceAccessorInfo): New helper class to store information to pass
9757         around between rules that use interface_accessors.
9758
9759         * interface.cs (Emit): Apply attributes on the get and set
9760         accessors of properties and indexers too.
9761
9762         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9763         right MethodBuilder when applying attributes to the get and set accessors.
9764
9765 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9766
9767         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9768
9769 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9770
9771         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9772
9773 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9774
9775         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9776         changes that treat `yield' specially when present before `break'
9777         or `return' tokens.
9778
9779         * cs-tokenizer.cs: yield is no longer a keyword.
9780
9781 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9782
9783         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9784         setting for default constructors.
9785         For default constructors are almost every time set wrong Modifier. The
9786         generated IL code has been alright. But inside mcs this values was
9787         wrong and this was reason why several of my CLS Compliance tests
9788         failed.
9789
9790 2004-01-22  Martin Baulig  <martin@ximian.com>
9791
9792         * cs-parser.jay (namespace_or_type_name): Return an Expression,
9793         not a QualifiedIdentifier.  This is what `type_name_expression'
9794         was previously doing.
9795         (type_name_expression): Removed; the code is now in
9796         `namespace_or_type_name'.
9797         (qualified_identifier): Removed, use `namespace_or_type_name'
9798         instead.
9799         (QualifiedIdentifier): Removed this class.      
9800
9801 2004-01-22  Martin Baulig  <martin@ximian.com>
9802
9803         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9804         not a string as alias name.
9805
9806 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
9807
9808         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9809         #52730 bug, and instead compute correctly the need to use a
9810         temporary variable when requesting an address based on the
9811         static/instace modified of the field and the constructor.
9812  
9813 2004-01-21  Martin Baulig  <martin@ximian.com>
9814
9815         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9816         class and namespace before looking up aliases.  Fixes #52517.
9817
9818 2004-01-21  Martin Baulig  <martin@ximian.com>
9819
9820         * flowanalysis.cs (UsageVector.Merge): Allow variables being
9821         assinged in a 'try'; fixes exception4.cs.
9822
9823 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9824         * class.cs : Implemented parameter-less constructor for TypeContainer
9825
9826         * decl.cs: Attributes are now stored here. New property OptAttributes
9827
9828         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9829
9830         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9831
9832 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9833
9834         * typemanager.cs (CSharpSignature): Now reports also inner class name.
9835           (CSharpSignature): New method for indexer and property signature.
9836
9837 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9838
9839         * pending.cs (IsVirtualFilter): Faster implementation.
9840
9841 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9842
9843         * typemanager.cs: Avoid inclusion of same assembly more than once.
9844
9845 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9846
9847         * cs-parser.jay: Fixed problem where the last assembly attribute
9848           has been applied also to following declaration (class, struct, etc.)
9849           
9850 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9851
9852         * class.cs: Added error CS0538, CS0539 reporting.
9853         Fixed crash on Microsoft runtime when field type is void.
9854
9855         * cs-parser.jay: Added error CS0537 reporting.
9856
9857         * pending.cs: Added error CS0535 reporting.
9858         Improved error report for errors CS0536, CS0534.
9859
9860 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
9861
9862         Merge a few bits from the Anonymous Method MCS tree.
9863
9864         * statement.cs (ToplevelBlock): New class for toplevel methods,
9865         will hold anonymous methods, lifted variables.
9866
9867         * cs-parser.jay: Create toplevel blocks for delegates and for
9868         regular blocks of code. 
9869
9870 2004-01-20  Martin Baulig  <martin@ximian.com>
9871
9872         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9873         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9874         and `NeedExplicitReturn'; added `IsLastStatement'.
9875         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9876         have a `ReturnLabel' or we're not unreachable.
9877
9878         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9879         child's reachability; don't just override ours with it.  Fixes
9880         #58058 (lluis's example).
9881         (FlowBranching): Added public InTryOrCatch(), InCatch(),
9882         InFinally(), InLoop(), InSwitch() and
9883         BreakCrossesTryCatchBoundary() methods.
9884
9885         * statement.cs (Return): Do all error checking in Resolve().
9886         Unless we are the last statement in a top-level block, always
9887         create a return label and jump to it.
9888         (Break, Continue): Do all error checking in Resolve(); also make
9889         sure we aren't leaving a `finally'.
9890         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9891         statement in a top-level block.
9892         (Block.Flags): Added `IsDestructor'.
9893         (Block.IsDestructor): New public property.
9894
9895 2004-01-20  Martin Baulig  <martin@ximian.com>
9896
9897         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9898
9899 2004-01-20  Martin Baulig  <martin@ximian.com>
9900
9901         * statement.cs (Statement.ResolveUnreachable): New public method.
9902         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9903         (Block.Resolve): Resolve unreachable statements.
9904
9905 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9906
9907         * expression.cs: We need to fix the case where we do
9908         not have a temp variable here.
9909
9910         * assign.cs: Only expression compound assignments need
9911         temporary variables.
9912
9913 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9914
9915         * flowanalysis.cs: Reduce memory allocation in a few ways:
9916           - A block with no variables should not allocate a bit
9917             vector for itself.
9918           - A method with no out parameters does not need any tracking
9919             for assignment of the parameters, so we need not allocate
9920             any data for it.
9921           - The arrays:
9922                 public readonly Type[] VariableTypes;
9923                 public readonly string[] VariableNames;
9924             Are redundant. The data is already stored in the variable
9925             map, so we need not allocate another array for it.
9926           - We need to add alot of checks for if (params | locals) == null
9927             due to the first two changes.
9928
9929 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9930
9931         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9932         implement IMemoryLocation, we store a copy on a local variable and
9933         take the address of it.  Patch from Benjamin Jemlich
9934
9935         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9936         to use a special "type_name_expression" rule which reduces the
9937         number of "QualifiedIdentifier" classes created, and instead
9938         directly creates MemberAccess expressions.
9939
9940 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9941
9942         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9943         that fixes #52853.  Null literal assignment to ValueType
9944
9945         * class.cs (MethodData.Emit): Instead of checking the name of the
9946         method to determine if its a destructor, create a new derived
9947         class from Method called Destructor, and test for that.  
9948
9949         * cs-parser.jay: Create a Destructor object instead of a Method.  
9950
9951         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9952
9953         Fixes: 52933
9954
9955 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9956
9957         * expression.cs (Binary.ResolveOperator): Perform an implicit
9958         conversion from MethodGroups to their delegate types on the
9959         Addition operation.
9960
9961         * delegate.cs: Introduce a new class DelegateCreation that is the
9962         base class for `NewDelegate' and `ImplicitDelegateCreation',
9963         factor some code in here.
9964
9965         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9966         conversion from MethodGroups to compatible delegate types. 
9967
9968         * ecore.cs (Expression.Resolve): Do not flag error 654
9969         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9970         we allow conversions from MethodGroups to delegate types now.
9971
9972         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9973         assignments in v2 either.
9974
9975 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9976
9977         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9978         static read-only fields in ctors.
9979
9980         Applied patch from Benjamin Jemlich 
9981
9982         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9983
9984 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9985
9986         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9987         here to return true, as they can be used like this:
9988
9989                 (XXX) int.MEMBER ()
9990
9991         Fixed 49836 and all the other dups
9992
9993 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9994
9995         * driver.cs: Implement /win32res and /win32icon.
9996
9997 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9998
9999         * cs-parser.jay: Add a rule to improve error handling for the
10000         common mistake of placing modifiers after the type.
10001
10002 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10003
10004         * cs-parser.jay (interface_event_declaration): Catch
10005         initialization of events on interfaces, and report cs0068
10006
10007         * cs-parser.jay (interface_event_declaration): Catch
10008         initialization of events. 
10009
10010         * ecore.cs: Better report missing constructors.
10011
10012         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10013         the error reporting done in the wrong place.  Fix.
10014
10015         * expression.cs (Binary.ResolveOperator): Catch the 
10016         operator + (E x, E y) error earlier, and later allow for implicit
10017         conversions in operator +/- (E e, U x) from U to the underlying
10018         type of E.
10019
10020         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10021         52596, if the container class is abstract, the default constructor
10022         is protected otherwise its public (before, we were always public).
10023
10024         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10025         fixed statement.
10026
10027         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10028         Jemlich that fixes bug #52597, MCS was generating invalid code for
10029         idisposable structs.   Thanks to Ben for following up with this
10030         bug as well.
10031
10032 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10033
10034         * driver.cs: Allow assemblies without code to be generated, fixes
10035         52230.
10036
10037 2004-01-07  Nick Drochak <ndrochak@gol.com>
10038
10039         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10040
10041 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10042
10043         * cs-parser.jay: Add rules to improve error reporting if fields or
10044         methods are declared at the namespace level (error 116)
10045
10046         * Add rules to catch event add/remove
10047
10048 2004-01-04  David Sheldon <dave-mono@earth.li>
10049
10050   * expression.cs: Added matching ")" to error message for 
10051   CS0077
10052
10053 2004-01-03 Todd Berman <tberman@gentoo.org>
10054
10055         * ecore.cs, attribute.cs:
10056         Applying fix from #52429.
10057
10058 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10059
10060         * ecore.cs, expression.cs, statement.cs:
10061         Total rewrite of how we handle branching. We
10062         now handle complex boolean expressions with fewer
10063         jumps. As well if (x == 0) no longer emits a ceq.
10064
10065         if (x is Foo) is much faster now, because we generate
10066         better code.
10067
10068         Overall, we get a pretty big improvement on our benchmark
10069         tests. The code we generate is smaller and more readable.
10070
10071         I did a full two-stage bootstrap. The patch was reviewed
10072         by Martin and Miguel.
10073
10074 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10075
10076         * cs-parser.jay: Make primary_expression not take a QI.
10077         we dont need this because the member_access rule covers
10078         us here. So we replace the rule with just IDENTIFIER.
10079
10080         This has two good effects. First, we remove a s/r conflict.
10081         Second, we allocate many fewer QualifiedIdentifier objects.
10082
10083 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10084
10085         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10086         set the correct information via SRE. This prevents
10087         hanging on the MS runtime. Fixes #29374.
10088
10089 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10090
10091         * convert.cs: correctly handle conversions to value types
10092         from Enum and ValueType as unboxing conversions.
10093
10094         Fixes bug #52569. Patch by Benjamin Jemlich.
10095
10096 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10097
10098         * expression.cs (BetterConversion): Prefer int -> uint
10099         over int -> ulong (csc's behaviour). This fixed bug #52046.
10100
10101 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10102
10103         * decl.cs (MemberCache.FindMembers): now returns a
10104         MemberInfo [].
10105
10106         * typemanager.cs: In general, go with with ^^.
10107         (CopyNewMethods): take an IList.
10108         (RealMemberLookup): Only allocate an arraylist
10109         if we copy from two sets of methods.
10110
10111         This change basically does two things:
10112         1) Fewer array lists allocated due to CopyNewMethods.
10113         2) the explicit cast in MemberList costed ALOT.
10114
10115 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10116
10117         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10118         a hashtable to avoid needless string allocations when an identifier is
10119         used more than once (the common case).
10120
10121 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10122
10123         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10124         is broken, it will not return anything. So, we
10125         have to use the information we have in mcs to
10126         do the task.
10127
10128         * typemanager.cs: Add a cache for GetInterfaces,
10129         since this will now be used more often (due to ^^)
10130
10131         (GetExplicitInterfaces) New method that gets the
10132         declared, not effective, interfaces on a type
10133         builder (eg, if you have interface IFoo, interface
10134         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10135         { IBar }.
10136
10137         This patch makes MCS able to bootstrap itself on
10138         Windows again.
10139
10140 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10141
10142         * expression.cs: Remove the Nop's that Miguel put
10143         in by mistake.
10144
10145 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10146
10147         * report.cs, codegen.cs: Give the real stack trace to
10148         the error when an exception is thrown.
10149
10150 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10151
10152         * decl.cs: only allocate hashtables for ifaces if 
10153         it is an iface!
10154
10155 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10156
10157         * expression.cs: fix the error from cs0121-2.cs
10158         (a parent interface has two child interfaces that
10159         have a function with the same name and 0 params
10160         and the function is called through the parent).
10161
10162 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10163
10164         * class.cs, rootcontext.cs, typmanager.cs: do not
10165         leak pointers.
10166
10167 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10168
10169         * codegen.cs: remove stack for the ec flow branching.
10170         It is already a linked list, so no need.
10171
10172 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10173
10174         * Makefile: Allow custom profiler here.
10175
10176 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10177
10178         * typemanager.cs (LookupType):
10179           - Use a static char [], because split takes
10180             a param array for args, so it was allocating
10181             every time.
10182           - Do not store true in a hashtable, it boxes.
10183
10184 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10185
10186         * flowanalysis.cs: bytify common enums.
10187
10188 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10189
10190         * modifiers.cs: Add a new set of flags for the
10191         flags allowed on explicit interface impls.
10192         * cs-parser.jay: catch the use of modifiers in
10193         interfaces correctly.
10194         * class.cs: catch private void IFoo.Blah ().
10195
10196         All related to bug #50572.
10197
10198 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10199
10200         * decl.cs: Rewrite the consistant accessability checking.
10201         Accessability is not linear, it must be implemented in
10202         a tableish way. Fixes #49704.
10203
10204 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10205
10206         * expression.cs: Handle negation in a checked context.
10207         We must use subtraction from zero. Fixes #38674.
10208
10209 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10210
10211         * class.cs: Ignore static void main in DLLs.
10212         * rootcontext.cs: Handle the target type here,
10213         since we are have to access it from class.cs
10214         * driver.cs: account for the above.
10215
10216 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10217
10218         * report.cs: Give line numbers and files if available.
10219
10220 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10221
10222         * driver.cs: Implement /addmodule.
10223
10224         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10225         ModuleBuilders.
10226
10227 2003-12-20  Martin Baulig  <martin@ximian.com>
10228
10229         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10230         (FieldBase.IsAssigned): Removed this field.
10231         (FieldBase.SetAssigned): New public method.
10232         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10233
10234 2003-12-20  Martin Baulig  <martin@ximian.com>
10235
10236         * expression.cs (LocalVariableReference.DoResolve): Don't set
10237         `vi.Used' if we're called from DoResolveLValue().
10238
10239         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10240         returns the usage vector it just merged into the current one -
10241         pass this one to UsageWarning().
10242         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10243         of the `EmitContext', don't call this recursively on our children.
10244
10245 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10246
10247         * driver.cs: Implement /target:module.
10248
10249 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10250
10251         * support.cs (CharArrayHashtable): New helper class.
10252
10253         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10254         char arrays, not strings, so we can avoid creating a string in
10255         consume_identifier if the identifier is a keyword.
10256
10257 2003-12-16  Martin Baulig  <martin@ximian.com>
10258
10259         * statement.cs (LocalInfo.Assigned): Removed this property.
10260         (LocalInfo.Flags): Removed `Assigned'.
10261         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10262         and uses flow analysis.
10263         (Block.UsageWarning): Made this method private.
10264         (Block.Resolve): Call UsageWarning() if appropriate.
10265
10266         * expression.cs (LocalVariableReference.DoResolve): Always set
10267         LocalInfo.Used here.
10268
10269 2003-12-13  Martin Baulig  <martin@ximian.com>
10270
10271         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10272         any value here; we're now using flow analysis to figure out
10273         whether a statement/block returns a value.
10274
10275 2003-12-13  Martin Baulig  <martin@ximian.com>
10276
10277         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10278         working again.
10279         (FlowBranching.MergeFinally): Don't call
10280         `branching.CheckOutParameters()' here, this is called in
10281         MergeTopBlock().
10282         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10283         when adding the `finally' vector.       
10284
10285 2003-12-13  Martin Baulig  <martin@ximian.com>
10286
10287         * flowanalysis.cs
10288         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10289         actually work and also fix #48962.
10290
10291 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10292
10293         * decl.cs: Do not check System.Object for nested types,
10294         since we know it does not have any. Big bang for buck:
10295
10296         BEFORE:
10297            Run 1:   8.35 seconds
10298            Run 2:   8.32 seconds
10299            corlib:  17.99 seconds
10300         AFTER:
10301            Run 1:   8.17 seconds
10302            Run 2:   8.17 seconds
10303            corlib:  17.39 seconds
10304
10305 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10306
10307         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10308         time we are returning 0 members, so we save alot here.
10309
10310 2003-12-11  Martin Baulig  <martin@ximian.com>
10311
10312         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10313         `MergeChild()', also just take the `FlowBranching' as argument;
10314         call Merge() on it and return the result.
10315         (FlowBranching.Merge): We don't need to do anything if we just
10316         have one sibling.
10317
10318 2003-12-11  Martin Baulig  <martin@ximian.com>
10319
10320         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10321         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10322         Maurer for this idea.
10323
10324 2003-12-11  Martin Baulig  <martin@ximian.com>
10325
10326         * flowanalysis.cs (MergeResult): This class is now gone; we now
10327         use the `UsageVector' for this.  The reason for this is that if a
10328         branching just has one sibling, we don't need to "merge" them at
10329         all - that's the next step to do.
10330         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10331         `MergeResult'.
10332
10333 2003-12-11  Martin Baulig  <martin@ximian.com>
10334
10335         Reworked flow analyis and made it more precise and bug-free.  The
10336         most important change is that we're now using a special `Reachability'
10337         class instead of having "magic" meanings of `FlowReturns'.  I'll
10338         do some more cleanups and optimizations and also add some more
10339         documentation this week.
10340
10341         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10342         largely reworked this class.
10343         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10344         the new `Reachability' class instead of having "magic" values here.
10345         (FlowBranching): We're now using an instance of `Reachability'
10346         instead of having separate `Returns', `Breaks' etc. fields.
10347
10348         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10349         based on flow analysis; ignore the return value of block.Emit ().
10350
10351 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10352
10353         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10354         if they are private.
10355
10356 2003-12-09  Martin Baulig  <martin@ximian.com>
10357
10358         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10359         call them directly on the UsageVector.
10360
10361 2003-12-09  Martin Baulig  <martin@ximian.com>
10362
10363         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10364         Changed return type from `FlowReturns' to `Reachability'.
10365
10366 2003-12-09  Martin Baulig  <martin@ximian.com>
10367
10368         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10369         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10370         `Reachable' fields with a single `Reachability' one.
10371
10372 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10373
10374         * class.cs (FindMembers): Remove foreach's.
10375
10376         Bootstrap times:
10377
10378         BEFORE
10379                 Run 1:   8.74 seconds
10380                 Run 2:   8.71 seconds
10381
10382         AFTER
10383                 Run 1:   8.64 seconds
10384                 Run 2:   8.58 seconds
10385
10386
10387 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10388
10389         * cs-parser.jay:
10390         * gen-treedump.cs:
10391         * statement.cs:
10392         This patch does a few things:
10393                 1. EmptyStatement is now a singleton, so it is never reallocated.
10394                 2. All blah is EmptyStatement constructs have been changed to
10395                    blah == EmptyStatement.Value, which is much faster and valid
10396                    now that EmptyStatement is a singleton.
10397                 3. When resolving a block, rather than allocating a new array for
10398                    the non-empty statements, empty statements are replaced with
10399                    EmptyStatement.Value
10400                 4. Some recursive functions have been made non-recursive.
10401         Mainly the performance impact is from (3), however (1) and (2) are needed for
10402         this to work. (4) does not make a big difference in normal situations, however
10403         it makes the profile look saner.
10404
10405         Bootstrap times:
10406
10407         BEFORE
10408         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10409         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10410         Total memory allocated: 56397 KB
10411
10412         AFTER
10413         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10414         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10415         Total memory allocated: 55666 KB
10416
10417 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10418
10419         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10420         than the hashtable in a hashtable version
10421
10422         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10423         we always end up concating a string. This results in a huge perf
10424         loss, because many strings have to be tracked by the GC. In this
10425         patch, we first use a hashtable that works with two keys, so that
10426         the strings do not need to be concat'ed.
10427
10428         Bootstrap times:
10429         BEFORE
10430                 Run 1:   8.74 seconds
10431                 Run 2:   8.71 seconds
10432
10433         AFTER
10434                 Run 1:   8.65 seconds
10435                 Run 2:   8.56 seconds
10436
10437 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10438
10439         * Makefile: Add a new target `do-time' that does a quick and simple
10440         profile, leaving easy to parse output.
10441
10442 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10443
10444         * codegen.cs (Init): Create the dynamic assembly with 
10445         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10446
10447 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10448
10449         * support.cs: Make the PtrHashtable use only one
10450         instance of its comparer.
10451
10452 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10453
10454         * typemanager.cs: Fix lookup of GetNamespaces.
10455
10456 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10457
10458         * expression.cs: Removed redundant line.
10459
10460         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10461         ArrayLists, use for loops with bounds.  
10462
10463         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10464         arraylist.
10465
10466         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10467         arraylists, use for loop with bounds.
10468
10469         The above three changes give us a 0.071 second performance
10470         improvement out of 3.294 seconds down to 3.223.  On my machine
10471         the above changes reduced the memory usage by 1,387 KB during
10472         compiler bootstrap.
10473
10474         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10475         QualifiedIdentifiers.  Before we created a new string through
10476         concatenation, and mostly later on, the result would be
10477         manipulated by DecomposeQI through string manipulation.
10478
10479         This reduced the compiler memory usage for bootstrapping from
10480         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10481         compile times in 0.05 seconds.
10482
10483 2003-11-28  Dick Porter  <dick@ximian.com>
10484
10485         * support.cs: Do string compares with the Invariant culture.
10486
10487         * rootcontext.cs: 
10488         * gen-treedump.cs: 
10489         * expression.cs: 
10490         * driver.cs: 
10491         * decl.cs: 
10492         * codegen.cs: 
10493         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10494         the comparison is done with the Invariant culture.
10495
10496 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10497
10498         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10499         GetEnumerator method.
10500
10501         (ProbeCollectionType): Iterate starting at the most specific type
10502         upwards looking for a GetEnumerator
10503
10504         * expression.cs: Shift count can be up to 31 for int/uint and 63
10505         for long/ulong.
10506
10507 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10508
10509         * statement.cs (Block.LookupLabel): Also look for the label on the
10510         children blocks.  Use a hash table to keep track of visited
10511         nodes. 
10512
10513         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10514         we actually did transform the other operand, otherwise fall back
10515         to the common codepath that casts to long.
10516
10517         * cs-tokenizer.cs: Use the same code pattern as the int case.
10518         Maybe I should do the parsing myself, and avoid depending on the
10519         Parse routines to get this done.
10520
10521 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10522
10523         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10524         which fixes bug 51347.  This time test it.
10525
10526         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10527         attributes for example can not tell the difference between these.
10528         The difference was only a syntax feature of the language. 
10529
10530         * attribute.cs: Apply attributes to delegates.
10531
10532         * delegate.cs: Call the apply attributes method.
10533
10534 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10535
10536         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10537         comparing 0 vs Byte.MinValue, not the value
10538
10539         (ImplicitConversionRequired): When reporting a conversion error,
10540         use error 31 to print out the constant error instead of the
10541         simpler 29.
10542
10543         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10544         which fixes bug 51347.
10545
10546 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10547
10548         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10549         which fixes the -warnaserror command line option.
10550
10551 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10552
10553         * cfold.cs (DoNumericPromotions): During constant folding of
10554         additions on UIntConstant, special case intconstants with
10555         IntConstants like we do on the expression binary operator. 
10556
10557 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10558
10559         * convert.cs (ImplicitReferenceConversion): We were missing a case
10560         (System.Enum are not value types or class types, so we need to
10561         classify them separatedly).
10562
10563         * driver.cs: We do not support error 2007.
10564
10565 2003-11-12 Jackson Harper <jackson@ximian.com>
10566
10567         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10568         system directory. Also use the full file name so users can
10569         libraries names mscorlib-o-tron.dll in a non system dir.
10570
10571 2003-11-10  Martin Baulig  <martin@ximian.com>
10572
10573         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10574         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10575         calling `ResolveType()' on them, directly assign their `Type'.
10576
10577 2003-11-08  Martin Baulig  <martin@ximian.com>
10578
10579         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10580         return value and the `out parent' parameter.
10581         (TypeContainer.DefineType): Moved the CS0644 check into
10582         GetClassBases().  Don't pass the interface types to the
10583         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10584         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10585
10586         * ecore.cs (TypeExpr.IsAttribute): New property.
10587         (TypeExpr.GetInterfaces): New method.
10588
10589         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10590         TypeExpr instead of a Type.
10591         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10592         (Interface.DefineType): Don't pass the interface types to the
10593         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10594         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10595
10596         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10597         instead of a `Type[]'.
10598         (TypeManager.RegisterBuilder): Likewise.
10599         (TypeManager.AddUserInterface): Likewise.
10600         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10601         `Type[]' and also return a `TypeExpr[]'.
10602         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10603
10604 2003-11-08  Martin Baulig  <martin@ximian.com>
10605
10606         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10607         Expression.     
10608
10609 2003-11-08  Martin Baulig  <martin@ximian.com>
10610
10611         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10612         TypeManager.ResolveExpressionTypes().
10613
10614         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10615         instead of an Expression.
10616         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10617         (TypeExpression): New public class; formerly known as `TypeExpr'.
10618
10619         * expression.cs (ComposedCast): Derive from TypeExpr.
10620
10621         * typemanager.cs (TypeManager.system_*_expr): These are now
10622         TypExpr's instead of Expression's.
10623         (TypeManager.ResolveExpressionTypes): New public static function;
10624         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10625         of them.        
10626
10627 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10628
10629         * expression.cs (New.DoResolve): Do not dereference value that
10630         might be a null return.
10631
10632         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10633         sure that the constant value has the right type.  Fixes an
10634         unreported bug, similar to 50425.
10635
10636         * const.cs (Const.LookupConstantValue): Call
10637         ImplicitStandardConversionExists before doing a conversion to
10638         avoid havng the TypeManager.ChangeType do conversions.
10639
10640         Reduced the number of casts used
10641
10642         (Const.ChangeType): New routine to enable reuse of the constant
10643         type changing code from statement.
10644
10645         * typemanager.cs (ChangeType): Move common initialization to
10646         static global variables.
10647
10648         Fixes #50425.
10649
10650         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10651         every value type to go through, even if it was void.  Fix that. 
10652
10653         * cs-tokenizer.cs: Use is_identifier_start_character on the start
10654         character of the define, and the is_identifier_part_character for
10655         the rest of the string.
10656
10657 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
10658
10659         * expression.cs (UnaryMutator.EmitCode): When I updated
10660         LocalVariableReference.DoResolve, I overdid it, and dropped an
10661         optimization done on local variable references.
10662
10663 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
10664
10665         * ecore.cs: Convert the return from Ldlen into an int.
10666
10667 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
10668
10669         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10670         the accessibility, this is a special case for toplevel non-public
10671         classes (internal for instance).
10672
10673 2003-10-20  Nick Drochak <ndrochak@gol.com>
10674
10675         * ecore.cs: Fix typo and build.  Needed another right paren.
10676
10677 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
10680         `internal' case regular and protected, but not allowing protected
10681         to be evaluated later.  Bug 49840
10682
10683 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
10684
10685         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10686         to kb.Nlast, and not the kb.nFirst to isolate the switch
10687         statement.
10688
10689         Extract the underlying type, so enumerations of long/ulong are
10690         treated like long/ulong.
10691
10692 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
10693
10694         * expression.cs (New): Overload the meaning of RequestedType to
10695         track the possible creation of the NewDelegate type, since
10696         DoResolve is invoked more than once for new constructors on field
10697         initialization.
10698
10699         See bugs: #48800 and #37014
10700
10701         * cs-parser.jay (declare_local_constants): Take an arraylist
10702         instead of a single constant.
10703
10704         (local_constant_declaration): It should take a
10705         constant_declarators, not a constant_declarator.  Fixes 49487
10706
10707         * convert.cs: Fix error report.
10708
10709 2003-10-13 Jackson Harper <jackson@ximian.com>
10710
10711         * typemanager.cs (TypeToCoreType): Add float and double this fixes
10712         bug #49611
10713
10714 2003-10-09  Martin Baulig  <martin@ximian.com>
10715
10716         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10717         to the .ctor.
10718         (MethodCore.DoDefineParameters): Removed the TypeContainer
10719         argument; use the DeclSpace which was passed to the .ctor instead.
10720         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10721         TypeContainer; we only need a DeclSpace here.
10722
10723 2003-10-09  Martin Baulig  <martin@ximian.com>
10724
10725         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10726         to the .ctor.
10727         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10728         EmitContext's .ctor.    
10729
10730 2003-10-09  Martin Baulig  <martin@ximian.com>
10731
10732         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10733         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10734         AsAccessible(), moved them as well.
10735
10736         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10737
10738 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10739
10740         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10741
10742 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10743
10744         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10745         generation for >=, as spotted by Paolo, bug 48679.  
10746         Patch from David Waite.
10747
10748         * cs-tokenizer.cs: Add handling for #pragma.
10749
10750         * cs-parser.jay: Allow for both yield and yield return in the
10751         syntax.  The anti-cobolization of C# fight will go on!
10752
10753         * class.cs (TypeBuilder.DefineType): Catch error condition here
10754         (Parent.DefineType erroring out and returning null).
10755
10756         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10757         coping with enumerations variables, we were mistakenly processing
10758         them as a regular value type instead of built-in types.  Fixes the
10759         bug #48063
10760
10761         * typemanager.cs (IsBuiltinOrEnum): New method.
10762
10763 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10764
10765         * cs-parser.jay: Upgrade: yield now needs the return clause.
10766
10767 2003-09-19  Martin Baulig  <martin@ximian.com>
10768
10769         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10770         `MemberCache parent' argument.  Normally, an interface doesn't
10771         have a parent type except System.Object, but we use this in gmcs
10772         for generic type parameters.
10773
10774 2003-09-18  Martin Baulig  <martin@ximian.com>
10775
10776         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10777         on `type.IsInterface'; don't check whether the type has a parent
10778         to determine whether it's an interface.
10779
10780 2003-09-15  Martin Baulig  <martin@ximian.com>
10781
10782         * class.cs (TypeContainer.DefineType): Added an error flag to
10783         avoid reporting duplicate CS0146's ("class definition is
10784         circular.").
10785
10786         * driver.cs (Driver.MainDriver): Abort if
10787         RootContext.ResolveTree() reported any errors.
10788
10789 2003-09-07  Martin Baulig  <martin@ximian.com>
10790
10791         * report.cs (Error, Warning): Added overloaded versions which take
10792         a `params object[] args' and call String.Format().
10793
10794 2003-09-07  Martin Baulig  <martin@ximian.com>
10795
10796         * decl.cs (DeclSpace..ctor): Don't call
10797         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10798         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10799         (DeclSpace.RecordDecl): New method.
10800
10801         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10802
10803 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10804
10805         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10806         value attributes to be applied to ParameterBuilders.
10807
10808         * class.cs (MethodCore.LabelParameters): Make static and more
10809         generic so that it can be used from other places - like interface
10810         methods, for instance.
10811
10812         * interface.cs (Interface.Emit): Call LabelParameters before
10813         emitting attributes on the InterfaceMethod.
10814
10815 2003-08-26  Martin Baulig  <martin@ximian.com>
10816
10817         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10818         resolving aliases; fixes #47927.
10819
10820 2003-08-26  Martin Baulig  <martin@ximian.com>
10821
10822         * statement.cs (Using.DoResolve): This is internally emitting a
10823         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10824         do not always return.  Fixes #47681.
10825
10826 2003-08-26  Martin Baulig  <martin@ximian.com>
10827
10828         * decl.cs (MemberCore): Moved WarningNotHiding(),
10829         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10830         into MemberBase.
10831         (AdditionResult): Make this nested in DeclSpace.
10832         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10833         argument; call NamespaceEntry.Define() unless we're nested in a
10834         class or struct.
10835
10836         * namespace.cs (Namespace.DefineName): New public function.  This
10837         is called from DeclSpace's .ctor to add 
10838         (Namespace.Lookup): Include DeclSpaces in the lookup.
10839
10840         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10841
10842         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10843
10844 2003-08-25  Martin Baulig  <martin@ximian.com>
10845
10846         * convert.cs (Convert.ExplicitReferenceConversion): When
10847         converting from an interface type to a class, unbox if the target
10848         type is a struct type.  Fixes #47822.
10849
10850 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10851
10852         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10853         #47854.
10854
10855 2003-08-22  Martin Baulig  <martin@ximian.com>
10856
10857         * class.cs (TypeManager.DefineType): When defining a nested type,
10858         call DefineType() on our parent; fixes #47801.
10859
10860 2003-08-22  Martin Baulig  <martin@ximian.com>
10861
10862         * class.cs (MethodData.Define): While checking if a method is an
10863         interface implementation, improve the test a bit more to fix #47654.
10864
10865 2003-08-22  Martin Baulig  <martin@ximian.com>
10866
10867         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10868         correctly; fixes #47722.
10869
10870 2003-08-22  Martin Baulig  <martin@ximian.com>
10871
10872         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10873         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10874
10875         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10876
10877 2003-08-22  Martin Baulig  <martin@ximian.com>
10878
10879         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10880         can only be assigned in static constructors.  Fixes #47161.
10881
10882 2003-08-22  Martin Baulig  <martin@ximian.com>
10883
10884         Rewrote and improved the flow analysis code.
10885
10886         * flowbranching.cs (FlowBranching): Make this class abstract.
10887         (FlowBranching.CreateBranching): New static function to create a
10888         new flow branching.
10889         (FlowBranchingBlock, FlowBranchingException): New classes.
10890         (FlowBranching.UsageVector.Type): New public readonly field.
10891         (FlowBranching.UsageVector.Breaks): Removed the setter.
10892         (FlowBranching.UsageVector.Returns): Removed the setter.
10893         (FlowBranching.UsageVector): Added Break(), Return(),
10894         NeverReachable() and Throw() methods to modify the reachability.
10895         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10896         done by FlowBranching.Merge().
10897         (FlowBranching.UsageVector.MergeChild): New method; merges the
10898         merge result into the current vector.
10899         (FlowBranching.Merge): New abstract method to merge a branching.
10900
10901 2003-08-12  Martin Baulig  <martin@ximian.com>
10902
10903         * expression.cs (Indirection.CacheTemporaries): Create the
10904         LocalTemporary with the pointer type, not its element type.
10905
10906 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10907
10908         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10909         token was a keyword or not.
10910
10911         Add `error' options where an IDENTIFIER was expected;  Provide
10912         CheckToken and CheckIdentifierToken convenience error reporting
10913         functions. 
10914
10915         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10916
10917         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10918         NameSpaceEntry NameSpaceEntry.
10919
10920         (LookupInterfaceOrClass): Avoid creating a full qualified name
10921         from namespace and name: avoid doing lookups when we know the
10922         namespace is non-existant.   Use new Tree.LookupByNamespace which
10923         looks up DeclSpaces based on their namespace, name pair.
10924
10925         * driver.cs: Provide a new `parser verbose' to display the
10926         exception thrown during parsing.  This is turned off by default
10927         now, so the output of a failure from mcs is more graceful.
10928
10929         * namespace.cs: Track all the namespaces defined in a hashtable
10930         for quick lookup.
10931
10932         (IsNamespace): New method
10933
10934 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10935
10936         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10937         we know that we need to concatenate (full typename can never be
10938         null). 
10939
10940         * class.cs: ditto.
10941
10942         * statement.cs: Use a bitfield;  Do not initialize to null things
10943         which are done by the constructor by default.
10944
10945         * cs-parser.jay: bug fix, parameter was 4, not 3.
10946
10947         * expression.cs: Just use the property;
10948
10949         * statement.cs: No need for GetVariableInfo method.
10950
10951 2003-08-08  Martin Baulig  <martin@ximian.com>
10952
10953         * flowanalysis.cs (FlowReturns): This is now nested in the
10954         `FlowBranching' class.
10955         (MyBitVector): Moved this here from statement.cs.
10956         (FlowBranching.SiblingType): New enum type.
10957         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10958
10959 2003-08-07  Martin Baulig  <martin@ximian.com>
10960
10961         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10962         `FlowBranching' class and called `BranchingType'.
10963
10964 2003-08-07  Martin Baulig  <martin@ximian.com>
10965
10966         * flowanalysis.cs: Moved all the control flow analysis code into
10967         its own file.
10968
10969 2003-08-07  Martin Baulig  <martin@ximian.com>
10970
10971         * assign.cs (Assign.DoResolve): `target' must either be an
10972         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10973         #37319.
10974
10975 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10976
10977         * expression.cs (BinaryMethod): This kind of expression is created by the
10978         Binary class if it determines that the operator has to be handled
10979         by a method.
10980
10981         (BinaryDelegate): This kind of expression is created if we are
10982         dealing with a + or - operator on delegates.
10983
10984         (Binary): remove method, argumetns, and DelegateOperator: when
10985         dealing with methods, 
10986
10987         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10988
10989         * statement.cs (Block): use bitfields for the three extra booleans
10990         we had in use.   Remove unused topblock parameter.
10991
10992         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10993
10994         * assign.cs: Drop extra unneeded tests.
10995
10996 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10997
10998         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10999
11000         * statement.cs (Foreach): Use VariableStorage instead of
11001         LocalBuilders.   
11002
11003         * codegen.cs (VariableStorage): New class used by clients that
11004         require a variable stored: locals or fields for variables that
11005         need to live across yield.
11006
11007         Maybe provide a convenience api for EmitThis+EmitLoad?
11008
11009         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11010         these bad boys.
11011
11012 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11013
11014         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11015         RemapParameterLValue): New methods that are used to turn a
11016         precomputed FieldInfo into an expression like this:
11017
11018                 instance.FieldInfo
11019
11020         The idea is to use this instead of making LocalVariableReference
11021         have more than one meaning.
11022
11023         * cs-parser.jay: Add error production to BASE.
11024
11025         * ecore.cs: Deal with TypeManager.GetField returning null, which
11026         is now a valid return value.
11027
11028         (FieldExprNoAddress): New expression for Fields whose address can
11029         not be taken.
11030
11031         * expression.cs (LocalVariableReference): During the resolve
11032         phases, create new expressions if we are in a remapping context.
11033         Remove code that dealt with remapping here.
11034
11035         (ParameterReference): same.
11036
11037         (ProxyInstance): New expression, like the `This' expression, but
11038         it is born fully resolved.  We know what we are doing, so remove
11039         the errors that are targeted to user-provided uses of `this'.
11040
11041         * statement.cs (Foreach): our variable is now stored as an
11042         Expression;  During resolution, follow the protocol, dont just
11043         assume it will return this.
11044
11045 2003-08-06  Martin Baulig  <martin@ximian.com>
11046
11047         * support.cs (SeekableStreamReader.cs): New public class.
11048
11049         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11050         SeekableStreamReader instead of the normal StreamReader.
11051
11052 2003-08-04  Martin Baulig  <martin@ximian.com>
11053
11054         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11055         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11056         deambiguate casts and delegate invocations.
11057         (parenthesized_expression): Use the new tokens to ensure this is
11058         not a cast of method invocation.
11059
11060         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11061         when reading a `)' and Deambiguate_CloseParens () was previously
11062         called.
11063
11064         * expression.cs (ParenthesizedExpression): New class.  This is
11065         just used for the CS0075 test.
11066         (Binary.DoResolve): Check for CS0075.   
11067
11068 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11069
11070         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11071         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11072         reference comparison.
11073
11074         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11075         examine the ReturnType for equality - this is necessary in the
11076         cases of implicit and explicit operators whose signature also
11077         includes the return type.
11078
11079 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11080
11081         * namespace.cs: Cache the result of the namespace computation,
11082         instead of computing it every time.
11083
11084 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11085
11086         * decl.cs: Use a global arraylist that we reuse over invocations
11087         to avoid excesive memory consumption.  Reduces memory usage on an
11088         mcs compile by one meg (45 average).
11089
11090         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11091         private, work around that.
11092
11093 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11094
11095         * literal.cs (IntLiteral): Define Zero and One static literals. 
11096
11097         * cs-parser.jay (integer_literal): use static literals to reduce
11098         memory usage for the most used literals (0, 1 and -1).  211kb
11099         reduced in memory usage.
11100
11101         Replace all calls to `new ArrayList' with `new
11102         ArrayList(4)' which is a good average number for most allocations,
11103         and also requires only 16 bytes of memory for its buffer by
11104         default. 
11105
11106         This reduced MCS memory usage in seven megabytes for the RSS after
11107         bootstrapping.
11108
11109 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11110
11111         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11112         handle params methods the correct way by forming only one
11113         applicable set with params and normal methods in them. Earlier we
11114         were looking at params methods only if we found no normal methods
11115         which was not the correct thing to do.
11116
11117         (Invocation.BetterFunction): Take separate arguments indicating
11118         when candidate and the best method are params methods in their
11119         expanded form.
11120
11121         This fixes bugs #43367 and #46199.
11122
11123         * attribute.cs: Documentation updates.
11124
11125         (CheckAttribute): Rename to CheckAttributeTarget.
11126         (GetValidPlaces): Rename to GetValidTargets.
11127
11128         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11129         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11130
11131         Fixes bug #44468.
11132
11133 2003-07-28  Martin Baulig  <martin@ximian.com>
11134
11135         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11136         name when looking up the base class of a nested class.  Fixes #46977.
11137
11138 2003-07-26  Martin Baulig  <martin@ximian.com>
11139
11140         * expression.cs (Indexers.Indexer): New nested struct; contains
11141         getter, setter and the indexer's type.
11142         (Indexers.Properties): This is now an ArrayList of
11143         Indexers.Indexer's.
11144         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11145         indexer doesn't have any getters.
11146
11147         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11148         for embedded property and indexer assignments.
11149
11150 2003-07-26  Martin Baulig  <martin@ximian.com>
11151
11152         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11153         preprocessor directive is not the first non-whitespace character
11154         on a line.
11155
11156 2003-07-26  Martin Baulig  <martin@ximian.com>
11157
11158         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11159         namespace parsing, follow the spec more closely.
11160
11161         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11162         NamespaceEntry.Lookup().
11163
11164 2003-07-25  Martin Baulig  <martin@ximian.com>
11165
11166         * MethodCore.cs (OverridesSomething): New public field; it's set
11167         from TypeContainer.DefineMembers if this method overrides
11168         something (which doesn't need to be a method).  Fix #39462.
11169
11170 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11171
11172         * typemanager.cs (GetMembers): Ensure that the list of members is
11173         reversed. This keeps things in sync.
11174
11175         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11176         find an AttributeUsage attribute.
11177
11178         * expression.cs (Invocation.OverloadResolve): Perform the check
11179         which disallows Invoke to be directly called on a Delegate.
11180
11181         (Error_InvokeOnDelegate): Report error cs1533.
11182
11183 2003-07-25  Martin Baulig  <martin@ximian.com>
11184
11185         * expression.cs (Indexers.GetIndexersForType): Only look in the
11186         interface hierarchy if the requested type is already an
11187         interface.  Fixes #46788 while keeping #46502 fixed.
11188
11189 2003-07-25  Martin Baulig  <martin@ximian.com>
11190
11191         * class.cs (TypeContainer.DefineMembers): Check whether all
11192         readonly fields have been assigned and report warning CS0649 if
11193         not.
11194
11195         * statement.cs (LocalInfo.IsFixed): Always return true if this is
11196         a valuetype.
11197
11198 2003-07-24  Ravi Pratap  <ravi@ximian.com>
11199
11200         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11201         returned from GetMethods to make things consistent with the
11202         assumptions MCS makes about ordering of methods.
11203
11204         This should comprehensively fix bug #45127 and it does :-)
11205
11206         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11207         ordering is actually reverse.
11208
11209         * Clean up some debug messages I left lying around.
11210
11211         * interface.cs (Populate*): Get rid of code which emits attributes
11212         since the stage in which we emit attributes is the 'Emit' stage,
11213         not the define stage.
11214
11215         (Emit): Move attribute emission for interface members here.
11216
11217 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11218
11219         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11220         closely: we eliminate methods in base types when we have an
11221         applicable method in a top-level type.
11222
11223         Please see section 14.5.5.1 for an exact description of what goes
11224         on. 
11225
11226         This fixes bug #45127 and a host of other related to corlib compilation.
11227
11228         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11229         array is the method corresponding to the top-level type (this is
11230         because of the changes made to icall.c) so we change this
11231         accordingly.
11232
11233         (MethodGroupExpr.Name): This too.
11234
11235         * typemanager.cs (GetElementType): New method which does the right
11236         thing when compiling corlib. 
11237
11238         * everywhere: Make use of the above in the relevant places.
11239
11240 2003-07-22  Martin Baulig  <martin@ximian.com>
11241
11242         * cs-parser.jay (invocation_expression): Moved
11243         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11244         `cast_expression', but create a InvocationOrCast which later
11245         resolves to either an Invocation or a Cast.
11246
11247         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11248         method; call this before EmitStatement() to make sure that this
11249         expression can be used as a statement.
11250
11251         * expression.cs (InvocationOrCast): New class; resolves to either
11252         an Invocation or a Cast.
11253
11254         * statement.cs (StatementExpression): Call ResolveStatement() on
11255         the ExpressionStatement before emitting it.
11256
11257 2003-07-21  Martin Baulig  <martin@ximian.com>
11258
11259         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11260         `ref' and `out' attributes match; fixes #46220.
11261         (MemberAccess.ResolveMemberAccess): You can't reference a type
11262         through an expression; fixes #33180.
11263         (Indexers.GetIndexersForType): Don't return the indexers from
11264         interfaces the class implements; fixes #46502.
11265
11266 2003-07-21  Martin Baulig  <martin@ximian.com>
11267
11268         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11269         CS0661 checks; fixes bug #30442.
11270
11271 2003-07-21  Martin Baulig  <martin@ximian.com>
11272
11273         * decl.cs (AdditionResult): Added `Error'.
11274
11275         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11276
11277         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11278         makes cs0031.cs actually work.
11279
11280 2003-07-20  Martin Baulig  <martin@ximian.com>
11281
11282         * namespace.cs: Fixed that bug which caused a crash when compiling
11283         the debugger's GUI.
11284
11285 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11286
11287         * typemanager.cs (LookupTypeReflection): Never expose types which
11288         are NotPublic, NestedPrivate, NestedAssembly, or
11289         NestedFamANDAssem.  We used to return these, and later do a check
11290         that would report a meaningful error, but the problem is that we
11291         would not get the real match, if there was a name override.
11292
11293 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11294
11295         * namespace.cs (Namespace, Name): Do not compute the namespace
11296         name dynamically, compute it in the constructor.  This reduced
11297         memory usage by 1697 KB.
11298
11299         * driver.cs: Use --pause to pause at the end.
11300
11301 2003-07-17  Peter Williams  <peter@newton.cx>
11302
11303         * Makefile: Change the name of the test target so that it doesn't
11304         conflict with the recursive test target.
11305
11306 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11307
11308         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11309         AddressOf): Do not use EmitThis, that was wrong, use the actual
11310         this pointer.
11311
11312 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11313
11314         * class.cs (MethodData.Define): While checking if a method is an
11315         interface implementation, improve the test: If we are not public
11316         (use new test here: use the computed MethodAttributes directly,
11317         instead of the parsed modifier flags) check if the `implementing'
11318         method comes from an interface or not.
11319
11320         * pending.cs (VerifyPendingMethods): Slightly better error
11321         message.
11322
11323         * makefile: add test target that does the mcs bootstrap.
11324
11325 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11326
11327         * interface.cs (Define): Do nothing here since there are no
11328         members to populate etc. Move the attribute emission out of here
11329         since this was just totally the wrong place to put it. Attribute
11330         application happens during the 'Emit' phase, not in the 'Define'
11331         phase.
11332
11333         (Emit): Add this method and move the attribute emission here
11334
11335         * rootcontext.cs (EmitCode): Call the Emit method on interface
11336         types too.
11337
11338 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11339
11340         * expression.cs (OverloadResolve): Report error only if Location
11341         is not 'Null' which means that there was a probe going on.
11342
11343 2003-07-14  Martin Baulig  <martin@ximian.com>
11344
11345         * expression.cs (ConditionalLogicalOperator): New public class to
11346         implement user defined conditional logical operators.
11347         This is section 14.11.2 in the spec and bug #40505.
11348
11349 2003-07-14  Martin Baulig  <martin@ximian.com>
11350
11351         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11352
11353 2003-07-14  Martin Baulig  <martin@ximian.com>
11354
11355         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11356
11357         * ecore.cs (IVariable.VerifyFixed): New interface method.
11358
11359         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11360         operator, check whether the variable is actually fixed.  Fixes bug
11361         #36055.  Set a variable definitely assigned when taking its
11362         address as required by the spec.
11363
11364         * statement.cs (LocalInfo.IsFixed): New field.
11365         (LocalInfo.MakePinned): Set `IsFixed' to true.
11366
11367 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11368
11369         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11370         for .ctors, ensure that we only ask for members declared in the
11371         attribute type (BindingFlags.DeclaredOnly).
11372
11373         Fixes bug #43632.
11374
11375         * expression.cs (Error_WrongNumArguments): Report error 1501
11376         correctly the way CSC does.
11377
11378 2003-07-13  Martin Baulig  <martin@ximian.com>
11379
11380         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11381         lookup on the fully qualified name, to make things like "X.X" work
11382         where "X.X" is a fully qualified type name, but we also have a
11383         namespace "X" in the using list.  Fixes #41975.
11384
11385 2003-07-13  Martin Baulig  <martin@ximian.com>
11386
11387         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11388         function. If we're a CompoundAssign, we need to create an embedded
11389         CompoundAssign, not an embedded Assign.
11390         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11391         Fixes #45854.
11392
11393 2003-07-13  Martin Baulig  <martin@ximian.com>
11394
11395         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11396         work to fix bug #46088.
11397
11398 2003-07-13  Ravi Pratap <ravi@ximian.com>
11399
11400         * class.cs (Operator.Emit): Do not emit attributes here - it is
11401         taken care of by the Method class that we delegate too. This takes
11402         care of bug #45876.
11403
11404 2003-07-10  Martin Baulig  <martin@ximian.com>
11405
11406         * expression.cs (TypeOfVoid): New class.
11407         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11408
11409 2003-07-10  Martin Baulig  <martin@ximian.com>
11410
11411         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11412         bug #35957.
11413
11414 2003-07-10  Martin Baulig  <martin@ximian.com>
11415
11416         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11417         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11418
11419         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11420
11421         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11422
11423 2003-07-10  Martin Baulig  <martin@ximian.com>
11424
11425         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11426         of decimal.  Fixes #42850.
11427
11428         NOTE: I also fixed the created byte blob, but this doesn't work on
11429         the MS runtime and csc never produces any byte blobs for decimal
11430         arrays.
11431
11432 2003-07-10  Martin Baulig  <martin@ximian.com>
11433
11434         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11435         structs; fixes #32068.
11436         (Block.AddChildVariableNames): Fixed #44302.
11437
11438 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11439
11440         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11441
11442 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11443
11444         * attribute.cs: And this test is onger needed.
11445
11446 2003-07-08  Martin Baulig  <martin@ximian.com>
11447
11448         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11449         inaccessible types.  Fixes #36313.
11450
11451         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11452
11453         * namespace.cs (NamespaceEntry): Create implicit entries for all
11454         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11455         implicit entries for N1.N2 and N1.
11456
11457 2003-07-08  Martin Baulig  <martin@ximian.com>
11458
11459         Rewrote the handling of namespaces to fix a lot of the issues
11460         wrt. `using' aliases etc.
11461
11462         * namespace.cs (Namespace): Splitted this class into a
11463         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11464
11465         * typemanager.cs (TypeManager.IsNamespace): Removed.
11466         (TypeManager.ComputeNamespaces): Only compute namespaces from
11467         loaded assemblies here, not the namespaces from the assembly we're
11468         currently compiling.
11469
11470 2003-07-08  Martin Baulig  <martin@ximian.com>
11471
11472         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11473
11474 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11475
11476         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11477         already fixed it.  
11478
11479         I thought about the memory savings here, but LookupTypeReflection
11480         is used under already very constrained scenarios.  Compiling
11481         corlib or mcs only exposes one hit, so it would not really reduce
11482         any memory consumption.
11483
11484 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11485
11486         * typemanager.cs: fixes bug #45889 by only adding public types from
11487         other assemblies to the list of known types.
11488
11489 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11490
11491         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11492         on the type we resolved.
11493
11494 2003-07-05  Martin Baulig  <martin@ximian.com>
11495
11496         * pending.cs (PendingImplementation.ParentImplements): Don't
11497         create the proxy if the parent is abstract.
11498
11499         * class.cs (TypeContainer.DefineIndexers): Process explicit
11500         interface implementations first.  Fixes #37714.
11501
11502 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11503
11504         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11505         defined recursively;  but since we modify the input parameters
11506         (left is set to `this' temporarily), we reset this value if the
11507         left_is_explicit is false, which gives the original semantics to
11508         the code.  
11509
11510         * literal.cs (NullPointer): new class used to represent a null
11511         literal in a pointer context.
11512
11513         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11514         type is a pointer, use a NullPointer object instead of a
11515         NullLiteral.   Closes 43687
11516
11517         (ExplicitConversion): Convert pointer values using
11518         the conv opcode to the proper type.
11519
11520         * ecore.cs (New): change ValueTypeVariable property into a method,
11521         that returns whether the valuetype is suitable for being used.
11522
11523         * expression.cs (Binary.DoNumericPromotions): Only return if we
11524         the int constant was a valid uint, and we can return both left and
11525         right as uints.  If not, we continue processing, to trigger the
11526         type conversion.  This fixes 39018.
11527
11528         * statement.cs (Block.EmitMeta): During constant resolution, set
11529         the CurrentBlock property on the emitcontext, so that we resolve
11530         constants propertly.
11531
11532 2003-07-02  Martin Baulig  <martin@ximian.com>
11533
11534         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11535         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11536
11537         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11538         than emitting it here.
11539
11540         * statement.cs: Fixed some more flow analysis bugs.
11541
11542 2003-07-02  Martin Baulig  <martin@ximian.com>
11543
11544         * class.cs (MethodData.Define): When implementing interface
11545         methods, set Final unless we're Virtual.
11546
11547         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11548         check work for interface methods.
11549
11550 2003-07-01  Martin Baulig  <martin@ximian.com>
11551
11552         * ecore.cs (EmitContext.This): Replaced this property with a
11553         GetThis() method which takes a Location argument.  This ensures
11554         that we get the correct error location for a CS0188.
11555
11556 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11557
11558         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11559         ImplicitStandardConversion.
11560
11561         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11562
11563 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11564
11565         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11566         optimization.
11567
11568 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11569
11570         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11571         constructors.
11572
11573         (MethodData.Define): Turn off initlocals for unsafe methods.
11574
11575 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11576
11577         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11578         complete;  Fixes #37521.
11579
11580         * delegate.cs: Use Modifiers.TypeAttr to compute the
11581         TypeAttributes, instead of rolling our own.  This makes the flags
11582         correct for the delegates.
11583
11584 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11585
11586         * class.cs (Constructor.Define): Set the private flag for static
11587         constructors as well.
11588
11589         * cs-parser.jay (statement_expression): Set the return value to
11590         null, to avoid a crash when we catch an error.
11591
11592 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11593
11594         * cs-parser.jay: Applied patch from Jackson that adds support for
11595         extern and unsafe modifiers to destructor declarations.
11596
11597         * expression.cs: Report error 21 if the user is trying to index a
11598         System.Array.
11599
11600         * driver.cs: Add an error message, suggested by the bug report.
11601
11602         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11603         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11604
11605 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11606
11607         * namespace.cs: Add some information to reduce FAQs.
11608
11609 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11610
11611         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11612         underlying enumeration types.  Fixes #43915.
11613
11614         * expression.cs: Treat ushort/short as legal values to be used in
11615         bitwise operations.
11616
11617 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11618
11619         * delegate.cs: transfer custom attributes for paramenters from
11620         the delegate declaration to Invoke and BeginInvoke.
11621
11622 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11623
11624         * attribute.cs: handle custom marshalers and emit marshal info
11625         for fields, too.
11626
11627 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11628
11629         * makefile.gnu: Added anonymous.cs to the compiler sources.
11630
11631 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11632
11633         * iterators.cs: Change the name of the proxy class to include two
11634         underscores.
11635
11636         * cs-parser.jay: Update grammar to include anonymous methods.
11637
11638         * anonymous.cs: new file.
11639
11640 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * class.cs (Field.Define): Add missing test for pointers and
11643         safety. 
11644
11645 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11646
11647         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11648         we use the stobj opcode.
11649
11650         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11651         since it wasn't the correct fix. 
11652
11653         It still is puzzling that we are required to use stobj for IntPtr
11654         which seems to be a ValueType.
11655
11656 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11657
11658         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11659         during regular simple name resolution.   Now, the trick is that
11660         instead of returning for processing the simplename, we do a
11661         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11662         contextual lookup type).   If a match is found, return that, if
11663         not, return for further composition.
11664
11665         This fixes long-standing 30485.
11666
11667         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11668         using the address to initialize an object, do an Stobj instead of
11669         using the regular Stelem.
11670
11671         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11672         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11673         Because if we are a BaseIndexerAccess that value will be true.
11674         Fixes 43643.
11675
11676         * statement.cs (GotoCase.Resolve): Return after reporting an
11677         error, do not attempt to continue. 
11678
11679         * expression.cs (PointerArithmetic.Emit): If our operand is a
11680         long, convert our constants to match the operand before
11681         multiplying.  Convert to I type before adding.   Fixes 43670.
11682
11683 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11684
11685         * enum.cs (ImplicitConversionExists) : Rename to
11686         ImplicitEnumConversionExists to remove ambiguity. 
11687
11688         * ecore.cs (NullCast): New type of cast expression class which
11689         basically is very similar to EmptyCast with the difference being
11690         it still is a constant since it is used only to cast a null to
11691         something else
11692         (eg. (string) null)
11693
11694         * convert.cs (ImplicitReferenceConversion): When casting a null
11695         literal, we return a NullCast.
11696
11697         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11698         should be around anymore.
11699
11700         The renaming (reported was slightly wrong). Corrections:
11701
11702         ConvertImplicitStandard -> ImplicitConversionStandard
11703         ConvertExplicitStandard -> ExplicitConversionStandard
11704
11705         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11706         before passing them in !
11707
11708         * convert.cs (ImplicitConversionStandard): When comparing for
11709         equal expr and target types, ensure that expr is not a
11710         NullLiteral.
11711
11712         In general, we must not be checking (expr_type ==
11713         target_type) in the top level conversion methods
11714         (ImplicitConversion, ExplicitConversion etc). This checking is
11715         done in the methods that they delegate to.
11716
11717 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11718
11719         * convert.cs: Move Error_CannotConvertType,
11720         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11721         ImplicitNumericConversion, ImplicitConversionExists,
11722         ImplicitUserConversionExists, StandardConversionExists,
11723         FindMostEncompassedType, FindMostSpecificSource,
11724         FindMostSpecificTarget, ImplicitUserConversion,
11725         ExplicitUserConversion, GetConversionOperators,
11726         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11727         TryImplicitIntConversion, Error_CannotConvertImplicit,
11728         ConvertImplicitRequired, ConvertNumericExplicit,
11729         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11730         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11731         its own file.
11732
11733         Perform the following renames:
11734
11735         StandardConversionExists -> ImplicitStandardConversionExists
11736         ConvertImplicit -> ImplicitConversion
11737         ConvertImplicitStandard -> ImplicitStandardConversion
11738         TryImplicitIntConversion -> ImplicitIntConversion
11739         ConvertImplicitRequired -> ImplicitConversionRequired
11740         ConvertNumericExplicit -> ExplicitNumericConversion
11741         ConvertReferenceExplicit -> ExplicitReferenceConversion
11742         ConvertExplicit -> ExplicitConversion
11743         ConvertExplicitStandard -> ExplicitStandardConversion
11744
11745 2003-05-19  Martin Baulig  <martin@ximian.com>
11746
11747         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11748         (TypeInfo): Added support for structs having structs as fields.
11749
11750         * ecore.cs (FieldExpr): Implement IVariable.
11751         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11752         VariableInfo for the field.
11753
11754 2003-05-18  Martin Baulig  <martin@ximian.com>
11755
11756         * expression.cs (This.DoResolve): Report a CS0027 if we're
11757         emitting a field initializer.
11758
11759 2003-05-18  Martin Baulig  <martin@ximian.com>
11760
11761         * expression.cs (This.ResolveBase): New public function.
11762         (This.DoResolve): Check for CS0188.
11763
11764         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11765         This.Resolve().
11766
11767         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11768         `instance_expression' to null if we don't have any non-static
11769         methods.
11770
11771 2003-05-18  Martin Baulig  <martin@ximian.com>
11772
11773         Reworked the way how local variables and parameters are handled by
11774         the flow analysis code.
11775
11776         * statement.cs (TypeInfo, VariableMap): New public classes.
11777         (VariableInfo): New public class.  This is now responsible for
11778         checking whether a variable has been assigned.  It is used for
11779         parameters and local variables.
11780         (Block.EmitMeta): Take the InternalParameters as argument; compute
11781         the layout of the flow vectors here.
11782         (Block.LocalMap, Block.ParameterMap): New public properties.
11783         (FlowBranching): The .ctor doesn't get the InternalParameters
11784         anymore since Block.EmitMeta() now computes the layout of the flow
11785         vector.
11786         (MyStructInfo): This class is now known as `StructInfo' and nested
11787         in `TypeInfo'; we don't access this directly anymore.
11788
11789         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11790         property and removed IsAssigned(), IsFieldAssigned(),
11791         SetAssigned() and SetFieldAssigned(); we now call them on the
11792         VariableInfo so we don't need to duplicate this code everywhere.
11793
11794         * expression.cs (ParameterReference): Added `Block block' argument
11795         to the .ctor.
11796         (LocalVariableReference, ParameterReference, This): The new
11797         VariableInfo class is now responsible for all the definite
11798         assignment stuff.
11799
11800         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11801         IsParameterAssigned, SetParameterAssigned): Removed.
11802
11803 2003-05-18  Martin Baulig  <martin@ximian.com>
11804
11805         * typemanager.cs (InitCoreTypes): Try calling
11806         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11807         the 3-args-version.  Corlib now also needs our `void_type'.
11808         (GetMethod): Added overloaded version which takes an optional
11809         `bool report_errors' to allow lookups of optional methods.
11810
11811 2003-05-12  Martin Baulig  <martin@ximian.com>
11812
11813         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11814         only used for locals and not for parameters.
11815
11816 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11817
11818         * support.cs (InternalParameters.ParameterType): Return the
11819         ExternalType of the parameter.
11820
11821         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11822         they were unused.
11823
11824 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11825
11826         * class.cs (MethodData.Define): Do not set the `newslot' on
11827         interface members, if they are also flagged as "override".
11828
11829         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11830         better code for ++i and i++.  This only works for static fields
11831         and local variables.
11832
11833         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11834         want to pull the DeclSpace out of the builder_to_declspace instead
11835         of the TypeBuilder (like in TypeContainer.FindMembers).
11836
11837         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11838         instead of LookupTypeContainer.  Fixes the crash on .NET for
11839         looking up interface members.
11840
11841         * const.cs: Create our own emit context during the Definition
11842         stage, so that constants are evaluated in the proper context, when
11843         a recursive definition happens.
11844
11845 2003-05-11  Martin Baulig  <martin@ximian.com>
11846
11847         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11848         new block for a switch section.
11849         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11850         the adding/lookup in the switch block.  Fixes #39828.
11851
11852 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11853
11854         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11855         functionality: I needed to convert the data after I had performed
11856         the add/sub operation into the operands type size.
11857
11858         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11859         pass the type for the box operation, otherwise the resulting
11860         object would have been of type object.
11861
11862         (BoxedCast): Add constructor to specify the type to box as.
11863
11864 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11865
11866         * iterators.cs: I was reusing the `count' variable inadvertently,
11867         take steps to not allow this to happen.
11868
11869 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11870
11871         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11872         by creating an array at the point where the params starts and
11873         putting all those arguments there, then adjusting the size of the
11874         array.
11875
11876 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11877
11878         * expression.cs (New.AddressOf): Implement interface
11879         IMemoryLocation.  This is used when the `new' operator is used in
11880         the context of an invocation to a method on a value type.
11881
11882         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11883         example. 
11884
11885         * namespace.cs: Also check the using aliases here.
11886
11887         * driver.cs: Move the test for using validity after the types have
11888         been entered, so we do a single pass that also includes the using
11889         aliases. 
11890
11891         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11892         in the regular case.   CreateSiblingForFinally is doing extra
11893         error checking.
11894
11895         * attribute.cs (GetAttributeArgumentExpression): Store the result
11896         on an out value, and use the return value to indicate failure
11897         instead of using null (which is a valid return for Constant.GetValue).
11898
11899         * statement.cs: Perform the analysis flow for the increment
11900         portion after the statement, because this will be the real flow of
11901         execution.  Fixes #42385
11902
11903         * codegen.cs (EmitContext.EmitArgument,
11904         EmitContext.EmitStoreArgument): New helper functions when the
11905         RemapToProxy flag is set.
11906
11907         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11908         function.
11909
11910         Add support for remapping parameters. 
11911
11912         * iterators.cs: Propagate parameter values;  Store parameter
11913         values in the proxy classes.
11914
11915 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11916
11917         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11918         need a proxy reference;  I do not know what I was thinking
11919
11920         * cs-parser.jay (constructor_initializer): catch another error,
11921         and display nice message.
11922
11923         (field_declaration): catch void field declaration
11924         to flag a better error. 
11925
11926         * class.cs (MemberBase.CheckBase): Report an error instead of a
11927         warning if a new protected member is declared in a struct. 
11928         (Field.Define): catch the error of readonly/volatile.
11929
11930         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11931
11932         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11933         volatile variable is taken
11934
11935 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11936
11937         * statement.cs (Fixed.Resolve): Report an error if we are not in
11938         an unsafe context.
11939
11940 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11941
11942         * typemanager.cs: reuse the code that handles type clashes for
11943         delegates and enumerations.
11944
11945         * class.cs (Report28): Always report.
11946
11947         * expression.cs (EncodeAsAttribute): Allow nulls here.
11948
11949 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11950
11951         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11952         the functionality for testing whether an expression is valid for
11953         an attribute here.  Also handle the case of arrays of elements
11954         being stored. 
11955
11956         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11957         encoding a linear array into an array of objects that are suitable
11958         to be passed to an CustomAttributeBuilder.
11959
11960         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11961
11962         * ecore.cs: (FieldExpr): Handle field remapping here.
11963
11964         * iteratators.cs: Pass the instance variable (if the method is an
11965         instance method) to the constructors, so we can access the field
11966         variables on the class.
11967
11968         TODO: Test this with structs.  I think the THIS variable on
11969         structs might have to be a pointer, and not a refenrece
11970
11971 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11972
11973         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11974         local variables to fields in a proxy class.
11975
11976         * iterators.cs (PopulateProxy): Rename our internal fields to
11977         <XXX>.  
11978         Create a <THIS> field if we are an instance method, so we can
11979         reference our parent container variables.
11980         (MapVariable): Called back from the EmitContext code to enter a
11981         new variable to field mapping into the proxy class (we just create
11982         a FieldBuilder).
11983
11984         * expression.cs
11985         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11986         for using the remapped locals to fields.
11987
11988         I placed the code here, because that gives the same semantics to
11989         local variables, and only changes the Emit code.
11990
11991         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11992         statements inside iterators.
11993         (VariableInfo): Add a FieldBuilder for the cases when we are
11994         remapping local variables to fields in a proxy class
11995
11996         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11997         current_block != null.
11998
11999         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12000         not cope with strings, as it has been moved to the
12001         TableSwitchEmit.  Fixed bug in switch generation.
12002
12003         * expression.cs (New.DoResolve): Provide more context for the user
12004         when reporting an error.
12005
12006         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12007         pointers. 
12008
12009         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12010         check the permissions for it.  Note than in a type-resolution
12011         context the check was already present in DeclSpace.ResolveType,
12012         but was missing from the MemberAccess.
12013
12014         (ArrayCreation.CheckIndices): warn if the user has
12015         more nested levels of expressions, but there are no more
12016         dimensions specified.  Avoids crash on bug 41906.
12017
12018 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12019
12020         * statement.cs (Block): replace Implicit bool, for a generic
12021         flags.   
12022         New flag: `Unchecked'.  This is used during the EmitMeta phase
12023         (which is out-of-line with the regular Resolve/Emit process for a
12024         statement, as this is done ahead of time, but still gets a chance
12025         to call constant resolve).
12026
12027         (Block.Flags): new enum for adding a new flag.
12028
12029         (Block.EmitMeta): track the state of unchecked.
12030
12031         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12032         to enable constant resolution to work there as well.
12033
12034 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12035
12036         * typemanager.cs (ienumerable_type): Also look up
12037         System.Collections.IEnumerable. 
12038
12039 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12040
12041         TODO: Test more than one conditional per method.
12042
12043         * class.cs (Indexer.Define): Report the location where the user is
12044         referencing the unsupported feature.
12045
12046         (MethodData): Overload the use of `conditionals' to
12047         minimize the creation of needless ArrayLists.   This saves roughly
12048         212kb on my machine.
12049
12050         (Method): Implement the new IIteratorContainer interface.
12051         (Method.SetYields): Implement the method by setting the ModFlags
12052         to contain METHOD_YIELDS.
12053
12054         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12055         which just got set to null.
12056
12057         * iterators.cs: New file.
12058
12059         (Yield, YieldBreak): New statements.
12060
12061         * statement.cs (Return.Resolve): Flag an error if we are used in
12062         an iterator method.
12063
12064         * codegen.cs (InIterator): New flag set if the code is being
12065         compiled in an iterator method.
12066
12067         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12068         internal modifier, and we just use it to avoid adding extra
12069         fields, as this is seldom used.  
12070
12071         * cs-parser.jay: Add yield_statement (yield and yield break).
12072
12073         * driver.cs: New flag -v2 to turn on version 2 features. 
12074
12075         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12076         hashtable when v2 is enabled.
12077
12078 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12079
12080         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12081         there is already a namespace defined with this name.
12082
12083         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12084         people upgraded their corlibs.
12085
12086         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12087         always use fully qualified types, no need to use the compiler
12088         front end.
12089
12090         (TypeManager.IsNamespace): Use binarysearch.
12091
12092         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12093         AddDelegate): I did not quite use the new IsValid API properly: I
12094         have to pass the short-name and the fullname.  I was passing only
12095         the basename instead of the fullname sometimes. 
12096
12097         (TypeContainer.DefineType): call NamespaceClash.
12098
12099         * interface.cs (Interface.DefineType): use NamespaceClash before
12100         defining the type.
12101
12102         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12103         defining the type.
12104
12105         * enum.cs: (Enum.DefineType): use NamespaceClash before
12106         defining the type.
12107
12108         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12109         speed increase.  First, use the negative_hits cache when we get a
12110         negative.  Second, add the type with its full original name
12111         instead of the new . and + encoded name (reflection uses + to
12112         separate type from a nested type).  Use LookupTypeReflection
12113         directly which bypasses the type->name hashtable (that we already
12114         know does not contain the type.
12115
12116         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12117         location/container type. 
12118
12119         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12120
12121 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12122
12123         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12124
12125         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12126         method is being referenced in the method group from a static
12127         context, and report error 120 if so.
12128
12129         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12130         Error118. 
12131
12132         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12133         is created, we create the A namespace).
12134
12135         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12136         Fixes #41591
12137
12138 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12139
12140         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12141         invocation to ModuleBuilder.GetType with the same values will
12142         return a new type instance, so we need to cache its return
12143         values. 
12144
12145         * expression.cs (Binary.ResolveOperator): Only allow the compare
12146         operators on enums if they are of the same type.
12147
12148         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12149         types of ValueType on their own case.  Before we were giving them
12150         the same treatment as objects.
12151
12152         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12153         fullname.  Short name is used to compare against container name.
12154         Fullname is used to check against defined namespace names.
12155
12156         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12157         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12158
12159         (Method.CheckBase): Call parent.
12160         (MemberBase.CheckBase): Check for protected members on sealed
12161         classes.
12162         (PropertyBase.CheckBase): Call parent.
12163         (Field.Define): Call parent.
12164
12165         * report.cs: Negative error codes are now mapped to 8000 - code,
12166         so that the display is render more nicely.
12167
12168         * typemanager.cs: Do not use try/catch, instead report a regular
12169         error. 
12170
12171         (GetPointerType, GetReferenceType): These methods provide
12172         mechanisms to obtain the T* and T& from a T.  We had the code
12173         previously scattered around the code base, and it also used
12174         TypeManager.LookupType that would go through plenty of caches.
12175         This one goes directly to the type source.
12176
12177         In some places we did the Type.GetType followed by
12178         ModuleBuilder.GetType, but not in others, so this unifies the
12179         processing as well.
12180
12181         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12182         statements now that we have namespace information.
12183
12184         * typemanager.cs (IsNamespace): New method, returns whether the
12185         string presented is a namespace or not.
12186
12187         (ComputeNamespaces): New public entry point, computes the list of
12188         available namespaces, using the GetNamespaces API call in Mono, or
12189         the slower version in MS.NET.   
12190
12191         Now before we start the semantic analysis phase, we have a
12192         complete list of namespaces including everything that the user has
12193         provided.
12194
12195         Deleted old code to cache namespaces in .nsc files.
12196
12197 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12198
12199         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12200         class/struct location definition Location for the implicit
12201         constructor location.
12202
12203         (Operator.Define): Use the location of the operator for the
12204         implicit Method definition.
12205
12206         (Constructor.Emit): use the constructor location for the implicit
12207         base initializer constructor.
12208
12209         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12210         and the Expression class now contains two new methods:
12211
12212         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12213         isolate type lookup from the rest of the resolution process.
12214
12215         Since we use Expressions to hold type definitions due to the way
12216         we parse the input we have historically overloaded Resolve to
12217         perform the Type lookups if a special flag is passed.  Now this is
12218         eliminated and two methods take their place. 
12219
12220         The differences in the two methods between xStep and xTerminal is
12221         that xStep is involved in our current lookup system that uses
12222         SimpleNames to compose a name, while xTerminal is used just to
12223         catch the case where the simplename lookup failed.
12224
12225 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12226
12227         * expression.cs (ResolveMemberAccess): Remove redundant code.
12228         TypeExpr expressions are always born fully resolved.
12229
12230         * interface.cs (PopulateMethod): Do not lookup the types twice.
12231         We were doing it once during SemanticAnalysis and once during
12232         PopulateMethod.
12233
12234         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12235         in local variable type definitions, were being returned as a
12236         SimpleName (we decomposed everything into a string), that is
12237         because primary_expression was being used instead of a type in the
12238         grammar (reduce/reduce conflicts).
12239
12240         The part that was wrong is that we converted the expression into a
12241         string (an oversimplification in one hand, compounded with primary
12242         expressions doing string concatenation).
12243
12244         So things like:
12245
12246         A.B.C [] x;
12247
12248         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12249         using clauses from working on this particular context.  And a type
12250         was being matched directly against "A.B.C[]".
12251
12252         We now use the correct approach, and allow for ComposedCast to be
12253         part of the unary expression.  So the "A.B.C []" become a composed
12254         cast of "A.B.C" (as a nested group of MemberAccess with a
12255         SimpleName at the end) plus the rank composition "[]". 
12256
12257         Also fixes 35567
12258
12259 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12260
12261         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12262         for the access level checking.
12263
12264         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12265         `TypeContainer container', because I kept getting confused when I
12266         was debugging this code.
12267
12268         * expression.cs (Indexers): Instead of tracking getters/setters,
12269         we now track them in parallel.  We create one arraylist less, but
12270         most importantly it is possible now for the LValue code to find a
12271         matching get for a set.
12272
12273         (IndexerAccess.DoResolveLValue): Update the code.
12274         GetIndexersForType has been modified already to extract all the
12275         indexers from a type.  The code assumed it did not.
12276
12277         Also make the code set the correct return type for the indexer.
12278         This was fixed a long time ago for properties, but was missing for
12279         indexers.  It used to be void_type.
12280
12281         (Binary.Emit): Test first for doubles instead of
12282         floats, as they are more common.
12283
12284         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12285         when dealing with floats and the <=, >= operators.  This fixes bug
12286         #39314 
12287
12288         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12289         to load the array value by emitting a load on the foreach variable
12290         type.  This was incorrect.  
12291
12292         We now emit the code to load an element using the the array
12293         variable type, and then we emit the conversion operator.
12294
12295         Fixed #40176
12296
12297 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12298
12299         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12300
12301 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12302
12303         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12304         test for protection before we test for signatures. 
12305
12306         (MethodSignature.ToString): implement.
12307
12308         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12309         to the case where we reduced into a LongConstant.
12310
12311         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12312         depend on whether the information is acurrate, because the
12313         Microsoft runtime will always claim that the array type is public,
12314         regardless of the real state.
12315
12316         If the type is a pointer, another problem happens: the type is
12317         reported as non-public in Microsoft.  
12318
12319         In both cases we have to call CheckAccessLevel recursively with
12320         the underlying type as the argument to be tested.
12321
12322 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12323
12324         * assign.cs (Assign.Emit): If we are dealing with a compound
12325         assignment expression, we should use the code path that stores the
12326         intermediate result in a temporary value.  This fixes #40903.
12327
12328         *expression.cs (Indirection.ToString): Provide ToString method for
12329         debugging. 
12330
12331 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12332
12333         * class.cs: Null out fields holding references to Block objects so
12334         they can be garbage collected.
12335
12336         * expression.cs (OverloadResolve): Remove unused local.
12337
12338 2003-04-07  Martin Baulig  <martin@ximian.com>
12339
12340         * codegen.cs (EmitContext.CurrentFile): New public field.
12341         (EmitContext.Mark): Use the CurrentFile to check whether the
12342         location is in the correct file.
12343         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12344
12345 2003-04-07  Martin Baulig  <martin@ximian.com>
12346
12347         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12348
12349         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12350         location.  [FIXME: The location argument which gets passed to this
12351         method is sometimes wrong!]
12352
12353 2003-04-07  Nick Drochak <ndrochak@gol.com>
12354
12355         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12356
12357 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12358
12359         * expression.cs (Indirection.EmitAssign): We were using the
12360         temporary, but returning immediately instead of continuing the
12361         EmitAssing flow.
12362
12363 2003-04-06  Martin Baulig  <martin@ximian.com>
12364
12365         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12366         if it's a nested child, but also deriving from the outer class.
12367         See test 190.cs.
12368
12369         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12370         nested child, but also deriving from the outer class.  See
12371         test-190.cs.
12372         (FilterWithClosure): We may access private members of the outer
12373         class if we're a nested child and deriving from the outer class.
12374         (RealMemberLookup): Only set `closure_private_ok' if the
12375         `original_bf' contained BindingFlags.NonPublic.
12376
12377 2003-04-05  Martin Baulig  <martin@ximian.com>
12378
12379         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12380
12381 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12382
12383         * class.cs (Event.Define): Do not allow abstract events to have
12384         initializers. 
12385
12386 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12389         block in event declarations.
12390
12391         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12392         value type, get its address.
12393
12394         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12395         leaving a class on the stack instead of a boolean value (int
12396         0/1).  Change the code so we compare against null, and then the
12397         result against zero.
12398
12399         * class.cs (TypeContainer.GetClassBases): We were checking for the
12400         parent class being sealed too late.
12401
12402         * expression.cs (Binary.Emit): For <= and >= when dealing with
12403         floating point values, use cgt.un and clt.un instead of cgt and
12404         clt alone.
12405
12406 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12407
12408         * statement.cs: Apply the same optimization as MS: skip the 
12409         GetEnumerator returning an IEnumerator, and use the one returning a 
12410         CharEnumerator instead. This allows us to avoid the try-finally block 
12411         and the boxing.
12412
12413 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12414
12415         * cs-parser.jay: Attributes cannot be applied to
12416                          namespaces. Fixes #40473
12417
12418 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12419
12420         * class.cs:
12421         (Add*): check if the name is valid using the full name for constants,
12422         fields, properties and events.
12423
12424 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12425
12426         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12427         char constants to be part of the enumeration.
12428
12429         * expression.cs (Conditional.DoResolve): Add support for operator
12430         true. Implements the missing functionality from 14.12
12431
12432         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12433         operator true/false as required by the spec.
12434
12435         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12436         implicit conversion to boolean.
12437
12438         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12439         also one where the type implements `operator true'. 
12440
12441         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12442         get an expression that will invoke operator true based on an
12443         expression.  
12444
12445         (GetConversionOperators): Removed the hack that called op_True
12446         here.  
12447
12448         (Expression.ResolveBoolean): Move this from Statement.
12449
12450 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12451
12452         * ecore.cs (FieldExpr): do not allow initialization of initonly
12453         fields on derived classes
12454
12455 2003-03-13  Martin Baulig  <martin@ximian.com>
12456
12457         * statement.cs (Block.Emit): Call ig.BeginScope() and
12458         ig.EndScope() when compiling with debugging info; call
12459         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12460
12461 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12462
12463         * expression.cs (Indexers): Do not construct immediately, allow
12464         for new members to be appended as we go.  Fixes 38143
12465
12466 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12467
12468         * expression.cs: save/restore context when resolving an unchecked
12469         expression.
12470
12471 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * cfold.cs: Catch division by zero in modulus operator during
12474         constant folding.
12475
12476 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12477
12478         * interface.cs (Interface.DefineMembers): Avoid defining members
12479         twice. 
12480
12481 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12482
12483         * driver.cs: handle the +/- options for -noconfig
12484
12485         * statement.cs (Unckeched.Resolve): Also track the state of
12486         unchecked in the Resolve phase.
12487
12488 2003-02-27  Martin Baulig  <martin@ximian.com>
12489
12490         * ecore.cs (Expression.MemberLookup): Don't create a
12491         MethodGroupExpr for something which is not a method.  Fixes #38291.
12492
12493 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12494
12495         * class.cs (MemberBase.CheckParameters): Also check that the type
12496         is unmanaged if it is a pointer.
12497
12498         * expression.cs (SizeOf.Resolve): Add location information.
12499
12500         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12501         a managed type is declared.
12502
12503         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12504         parameter modifiers as well.  Fixes bug 38606
12505
12506         * class.cs: Very sad.  Am backing out the speed up changes
12507         introduced by the ArrayList -> Array in the TypeContainer, as they
12508         were not actually that much faster, and introduced a bug (no error
12509         reports on duplicated methods).
12510
12511         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12512         source first, this will guarantee that we have a valid expression
12513         before calling in lower levels functions that will require a
12514         resolved object.  Then use this original_source in the
12515         target.ResolveLValue instead of the original source that was
12516         passed to us.
12517
12518         Another change.  Use target.Resolve instead of LValueResolve.
12519         Although we are resolving for LValues, we will let the Assign code
12520         take care of that (it will be called again from Resolve).  This
12521         basically allows code like this:
12522
12523         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12524         class Y { void A (X x) { x [0] += o; }
12525
12526         The problem was that the indexer was trying to resolve for
12527         set_Item (idx, object o) and never finding one.  The real set_Item
12528         was set_Item (idx, X).  By delaying the process we get the right
12529         semantics. 
12530
12531         Fixes bug 36505
12532
12533 2003-02-23  Martin Baulig  <martin@ximian.com>
12534
12535         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12536         while calling DoEmit ().
12537
12538         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12539         source files; if you use the #line directive inside a method, the
12540         compiler stops emitting line numbers for the debugger until it
12541         reaches the end of the method or another #line directive which
12542         restores the original file.
12543
12544 2003-02-23  Martin Baulig  <martin@ximian.com>
12545
12546         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12547
12548 2003-02-23  Martin Baulig  <martin@ximian.com>
12549
12550         * statement.cs (Block.AddChildVariableNames): We need to call this
12551         recursively, not just for our immediate children.
12552
12553 2003-02-23  Martin Baulig  <martin@ximian.com>
12554
12555         * class.cs (Event.Define): Always make the field private, like csc does.
12556
12557         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12558         actually work, fixes bug #37521.
12559
12560 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12561
12562         * delegate.cs: When creating the various temporary "Parameters"
12563         classes, make sure that we call the ComputeAndDefineParameterTypes
12564         on those new parameters (just like we do with the formal ones), to
12565         allow them to be resolved in the context of the DeclSpace.
12566
12567         This fixes the bug that Dick observed in Bugzilla #38530.
12568
12569 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * expression.cs (ResolveMemberAccess): When resolving a constant,
12572         do not attempt to pull a constant if the value was not able to
12573         generate a valid constant.
12574
12575         * const.cs (LookupConstantValue): Do not report more errors than required.
12576
12577 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12578
12579         * expression.cs: fixes bug #38328.
12580
12581 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12582
12583         * class.cs: Changed all the various members that can be part of a
12584         class from being an ArrayList to be an Array of the right type.
12585         During the DefineType type_list, interface_list, delegate_list and
12586         enum_list are turned into types, interfaces, delegates and enums
12587         arrays.  
12588
12589         And during the member population, indexer_list, event_list,
12590         constant_list, field_list, instance_constructor_list, method_list,
12591         operator_list and property_list are turned into their real arrays.
12592
12593         Although we could probably perform this operation earlier, for
12594         good error reporting we need to keep the lists and remove the
12595         lists for longer than required.
12596
12597         This optimization was triggered by Paolo profiling the compiler
12598         speed on the output of `gen-sample-program.pl' perl script. 
12599
12600         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12601         not crash in methods like MemberLookupFailed that use this field.  
12602
12603         This problem arises when the compiler fails to resolve a type
12604         during interface type definition for example.
12605
12606 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12607
12608         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12609         inherit from System.Object, so we have to stop at null, not only
12610         when reaching System.Object.
12611
12612 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12613
12614         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12615         DeclaredOnly because the parent indexer might have had a different
12616         name, but did not loop until the top of the hierarchy was reached.
12617
12618         The problem this one fixes is 35492: when a class implemented an
12619         indexer from an interface, we were getting the interface method
12620         (which was abstract) and we were flagging an error (can not invoke
12621         abstract method).
12622
12623         This also keeps bug 33089 functioning, and test-148 functioning.
12624
12625         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12626         out if a method is special is to see if it is declared in a
12627         property or event, or whether it is one of the predefined operator
12628         names.   This should fix correctly #36804.
12629
12630 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12631
12632         The goal here is to remove the dependency on EmptyCast.Peel ().
12633         Killing it completely.
12634
12635         The problem is that currently in a number of places where
12636         constants are expected, we have to "probe" for an EmptyCast, and
12637         Peel, which is not the correct thing to do, as this will be
12638         repetitive and will likely lead to errors. 
12639
12640         The idea is to remove any EmptyCasts that are used in casts that
12641         can be reduced to constants, so we only have to cope with
12642         constants. 
12643
12644         This bug hunt was triggered by Bug 37363 and the desire to remove
12645         the duplicate pattern where we were "peeling" emptycasts to check
12646         whether they were constants.  Now constants will always be
12647         constants.
12648
12649         * ecore.cs: Use an enumconstant here instead of wrapping with
12650         EmptyCast.  
12651
12652         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12653         throwing me off.  By handling this we can get rid of a few hacks.
12654
12655         * statement.cs (Switch): Removed Peel() code.
12656
12657 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12658
12659         * class.cs: Location information for error 508
12660
12661         * expression.cs (New.DoResolve): Add a guard against double
12662         resolution of an expression.  
12663
12664         The New DoResolve might be called twice when initializing field
12665         expressions (see EmitFieldInitializers, the call to
12666         GetInitializerExpression will perform a resolve on the expression,
12667         and later the assign will trigger another resolution
12668
12669         This leads to bugs (#37014)
12670
12671         * delegate.cs: The signature for EndInvoke should contain any ref
12672         or out parameters as well.  We were not doing this in the past. 
12673
12674         * class.cs (Field.Define): Do not overwrite the type definition
12675         inside the `volatile' group.  Turns out that volatile enumerations
12676         were changing the type here to perform a validity test, which
12677         broke conversions. 
12678
12679 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12680
12681         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12682         and structs, we do not want to load the instance variable
12683
12684         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12685         enum_type has to be handled like an object reference (implicit
12686         conversions exists from this to object), but the regular IsClass
12687         and IsValueType tests will never return true for this one.
12688
12689         Also we use TypeManager.IsValueType instead of type.IsValueType,
12690         just for consistency with the rest of the code (this is only
12691         needed if we ever use the construct exposed by test-180.cs inside
12692         corlib, which we dont today).
12693
12694 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12695
12696         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12697         just InternalCall.
12698
12699 2003-02-09  Martin Baulig  <martin@ximian.com>
12700
12701         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12702         (Namespace.DefineNamespaces): New static public method; this is
12703         called when we're compiling with debugging to add all namespaces
12704         to the symbol file.
12705
12706         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12707         pass it to the Namespace's .ctor.
12708
12709         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12710         and MethodBase arguments; pass the namespace ID to the symwriter;
12711         pass the MethodBase instead of the token to the symwriter.
12712         (SymbolWriter.DefineNamespace): New method to add a namespace to
12713         the symbol file.
12714
12715 2003-02-09  Martin Baulig  <martin@ximian.com>
12716
12717         * symbolwriter.cs: New file.  This is a wrapper around
12718         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12719         methods here in near future.
12720
12721 2003-02-09  Martin Baulig  <martin@ximian.com>
12722
12723         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12724         ILGenerator.MarkSequencePoint() which are actually used by the
12725         symbol writer.
12726
12727 2003-02-09  Martin Baulig  <martin@ximian.com>
12728
12729         * location.cs (SourceFile): New public sealed class.  This
12730         contains the name and an index which is used in the location's token.
12731         (Location): Reserve an appropriate number of bits in the token for
12732         the source file instead of walking over that list, this gives us a
12733         really huge performance improvement when compiling with debugging.
12734
12735         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12736         `SourceFile' argument instead of a string.
12737         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12738         but don't parse/tokenize here, we need to generate the list of all
12739         source files before we do that.
12740         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12741         the files.
12742
12743         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12744         instead of a string.
12745
12746         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12747         of a string.
12748
12749 2003-02-09  Martin Baulig  <martin@ximian.com>
12750
12751         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12752         filename on `#line default'.
12753
12754 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12755
12756         * statement.cs: don't clear the pinned var when the fixed statement
12757         returns from the method (fixes bug#37752).
12758
12759 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12760
12761         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12762         to IsValueType.
12763
12764 2003-02-07  Martin Baulig  <martin@ximian.com>
12765
12766         * driver.cs: Removed the `--debug-args' command line argument.
12767
12768         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12769         automatically by the AsssemblyBuilder.
12770         (CodeGen.InitializeSymbolWriter): We don't need to call any
12771         initialization function on the symbol writer anymore.  This method
12772         doesn't take any arguments.
12773
12774 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12775
12776         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12777         from referenced assemblies as well.
12778
12779 2003-02-02  Martin Baulig  <martin@ximian.com>
12780
12781         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12782
12783 2003-02-02  Martin Baulig  <martin@ximian.com>
12784
12785         * class.cs (Constructor.Emit): Open the symbol writer before
12786         emitting the constructor initializer.
12787         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12788         single-stepping through constructor initializers.
12789
12790 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12791
12792         * class.cs: Handle error 549: do not allow virtual methods in
12793         sealed classes. 
12794
12795 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12796
12797         * decl.cs: Check access levels when resolving types
12798
12799 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12800
12801         * statement.cs: Add parameters and locals set in catch blocks that might 
12802         return to set vector
12803
12804 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12805
12806         * class.cs (Operator): Set the SpecialName flags for operators.
12807
12808         * expression.cs (Invocation.DoResolve): Only block calls to
12809         accessors and operators on SpecialName methods.
12810
12811         (Cast.TryReduce): Handle conversions from char constants.
12812
12813
12814 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12815
12816         * statement.cs: small memory and time optimization in FlowBranching.
12817
12818 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12819
12820         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12821         problem that the last fix but in the other sid (Set).
12822
12823         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12824         access when there is no indexer in the hierarchy.
12825
12826 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12827
12828         * class.cs: Combine some if statements.
12829
12830 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12831
12832         * driver.cs: fixed bug #37187.
12833
12834 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12835
12836         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12837         any indexer, it's needed to build a list with all the indexers in the
12838         hierarchy (AllGetters), else we have problems. Fixes #35653.
12839
12840 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12841
12842         * class.cs (MethodData.Define): It is wrong for an interface
12843         implementation to be static in both cases: explicit and implicit.
12844         We were only handling this in one case.
12845
12846         Improve the if situation there to not have negations.
12847
12848         * class.cs (Field.Define): Turns out that we do not need to check
12849         the unsafe bit on field definition, only on usage.  Remove the test.
12850
12851 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12852
12853         * driver.cs: use assembly.Location instead of Codebase (the latest
12854         patch made mcs fail when using MS assemblies).
12855
12856 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12857
12858         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12859         get the path to *corlib.dll.
12860
12861 2003-01-21  Nick Drochak <ndrochak@gol.com>
12862
12863         * cs-tokenizer.cs:
12864         * pending.cs:
12865         * typemanager.cs: Remove compiler warnings
12866
12867 2003-01-20  Duncan Mak  <duncan@ximian.com>
12868
12869         * AssemblyInfo.cs: Bump the version number to 0.19.
12870
12871 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12872
12873         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12874
12875 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12876
12877         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12878
12879 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12880
12881         * cs-parser.jay: Small fix: we were not comparing the constructor
12882         name correctly.   Thanks to Zoltan for the initial pointer.
12883
12884 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12885
12886         * cs-tokenizer.cs: Set file name when specified with #line
12887
12888 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12889
12890         * cs-parser.jay: Only perform the constructor checks here if we
12891         are named like the class;  This will help provider a better
12892         error.  The constructor path is taken when a type definition is
12893         not found, but most likely the user forgot to add the type, so
12894         report that rather than the constructor error.
12895
12896 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12897
12898         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12899         allocations.
12900
12901 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12902
12903         * cs-parser.jay: Add cleanup call.
12904
12905 2003-01-13  Duncan Mak  <duncan@ximian.com>
12906
12907         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12908         consistent with other methods.
12909
12910 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12911
12912         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12913
12914 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12915
12916         * attribute.cs: only set GuidAttr to true when we have a
12917         GuidAttribute.
12918
12919 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12920
12921         * ecore.cs:
12922         * expression.cs:
12923         * typemanager.cs: fixes to allow mcs compile corlib with the new
12924         Type.IsSubclassOf fix.
12925
12926 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12927
12928         * expression.cs (LocalVariableReference.DoResolve): Classify a
12929         constant as a value, not as a variable.   Also, set the type for
12930         the variable.
12931
12932         * cs-parser.jay (fixed_statement): take a type instead of a
12933         pointer_type, so we can produce a better error message later.
12934
12935         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12936         as an error.  
12937
12938         (For.DoEmit): Make inifinite loops have a
12939         non-conditional branch back.
12940
12941         (Fixed.DoEmit): First populate the pinned variables, then emit the
12942         statement, then clear the variables.  Before I was emitting the
12943         code once for each fixed piece.
12944
12945
12946 2003-01-08  Martin Baulig  <martin@ximian.com>
12947
12948         * statement.cs (FlowBranching.MergeChild): A break in a
12949         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12950
12951 2003-01-08  Martin Baulig  <martin@ximian.com>
12952
12953         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12954         lives in the same number space than `param_map'.  Fixes #36154.
12955
12956 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12957
12958         * cs-parser.jay (constructor_declaration): Set the
12959         Constructor.ModFlags before probing for it.  This makes the
12960         compiler report 514, 515 and 132 (the code was there, but got
12961         broken). 
12962
12963         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12964         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12965         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12966
12967 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12968
12969         * enum.cs: create the enum static fields using the enum type.
12970
12971 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12972
12973         * class.cs: don't try to create the ParamBuilder for the return
12974         type if it's not needed (and handle it breaking for the ms runtime
12975         anyway).
12976
12977 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12978
12979         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12980
12981 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12982
12983         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12984         the command.   This showed up while compiling the JANET source
12985         code, which used \r as its only newline separator.
12986
12987 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12988
12989         * class.cs (Method.Define): If we are an operator (because it
12990         reuses our code), then set the SpecialName and HideBySig.  #36128
12991
12992 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12993
12994         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12995         exception, report error 120 `object reference required'.
12996
12997         * driver.cs: Add --pause option, used during to measure the size
12998         of the process as it goes with --timestamp.
12999
13000         * expression.cs (Invocation.DoResolve): Do not allow methods with
13001         SpecialName to be invoked.
13002
13003 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13004
13005         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13006         number before adding it.
13007
13008 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13009
13010         * ecore.cs (StandardImplicitConversion): When in an unsafe
13011         context, we allow conversion between void * to any other pointer
13012         type. This fixes bug #35973.
13013
13014 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13015
13016         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13017         is not thrown when extensionless outputs are used 
13018
13019 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13020
13021         * rootcontext.cs: fixed compilation of corlib.
13022
13023 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13024
13025         * attribute.cs (Attributes.Contains): Add new method.
13026
13027         * class.cs (MethodCore.LabelParameters): if the parameter is an
13028         `out' parameter, check that no attribute `[In]' has been passed.
13029
13030         * enum.cs: Handle the `value__' name in an enumeration.
13031
13032 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13033
13034         * decl.cs: Added special case to allow overrides on "protected
13035         internal" methods
13036
13037 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13038
13039         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13040         since it makes much more sense.
13041
13042         (Attributes.ctor): Don't require a Location parameter.
13043
13044         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13045
13046         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13047         since we already have that information per attribute.
13048
13049         * everywhere : make appropriate changes.
13050
13051         * class.cs (LabelParameters): Write the code which actually
13052         applies attributes to the return type. We can't do this on the MS
13053         .NET runtime so we flag a warning in the case an exception is
13054         thrown.
13055
13056 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13057
13058         * const.cs: Handle implicit null conversions here too.
13059
13060 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13061
13062         * class.cs (MethodCore.LabelParameters): Remove the extra
13063         Type [] parameter since it is completely unnecessary. Instead
13064         pass in the method's attributes so that we can extract
13065         the "return" attribute.
13066
13067 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13068
13069         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13070         of ignoring it and letting the compile continue.
13071
13072         * typemanager.cs (ChangeType): use an extra argument to return an
13073         error condition instead of throwing an exception.
13074
13075 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13076
13077         * expression.cs (Unary.TryReduce): mimic the code for the regular
13078         code path.  Perform an implicit cast in the cases where we can
13079         implicitly convert to one of the integral types, and then reduce
13080         based on that constant.   This fixes bug #35483.
13081
13082 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13083
13084         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13085
13086 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13087
13088         * namespace.cs: fixed bug #35489.
13089
13090 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13091
13092         * class.cs: Remove some dead code.
13093
13094         * cs-parser.jay: Estimate the number of methods needed
13095         (RootContext.MethodCount);
13096
13097         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13098         numbers instead of StringBuilders.
13099
13100         * support.cs (PtrHashtable): Add constructor with initial size;
13101         We can now reduce reallocations of the method table.
13102
13103 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13104
13105         * attribute.cs (ApplyAttributes): Keep track of the emitted
13106         attributes on a per-target basis. This fixes bug #35413.
13107
13108 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13109
13110         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13111         default to the Windows 1252 encoding.
13112
13113         (UnixParseOption): Support version, thanks to Alp for the missing
13114         pointer. 
13115
13116         * AssemblyInfo.cs: Add nice assembly information.
13117
13118         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13119         (bug 35169).
13120
13121         * cs-parser.jay: Allow a trailing comma before the close bracked
13122         in the attribute_section production.
13123
13124         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13125         address of the instance was being taken, I will take this out,
13126         because we take the address of the object immediately here.
13127
13128 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13129
13130         * typemanager.cs (AreMultipleAllowed): Take care of the most
13131         obvious case where attribute type is not in the current assembly -
13132         stupid me ;-)
13133
13134 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13135
13136         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13137         definitions, instead of doing that afterwards.  
13138
13139         Also we use a nice little hack, depending on the constructor, we
13140         know if we are a "composed" name or a simple name.  Hence, we
13141         avoid the IndexOf test, and we avoid 
13142
13143         * codegen.cs: Add code to assist in a bug reporter to track down
13144         the source of a compiler crash. 
13145
13146 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13147
13148         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13149         types have been emitted for a given element and flag an error
13150         if something which does not have AllowMultiple set is used more
13151         than once.
13152
13153         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13154         attribute types and their corresponding AllowMultiple properties
13155
13156         (AreMultipleAllowed): Check the property for a given type.
13157
13158         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13159         property in the case we have a TypeContainer.
13160
13161         (Attributes.AddAttribute): Detect duplicates and just skip on
13162         adding them. This trivial fix catches a pretty gross error in our
13163         attribute emission - global attributes were being emitted twice!
13164
13165         Bugzilla bug #33187 is now fixed.
13166
13167 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13170         instead of pp_and).
13171
13172         * expression.cs (Binary.ResolveOperator): I can only use the
13173         Concat (string, string, string) and Concat (string, string,
13174         string, string) if the child is actually a concatenation of
13175         strings. 
13176
13177 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13178
13179         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13180         context where we need a 2-character lookahead.
13181
13182         * pending.cs (PendingImplementation): Rework so we can keep track
13183         of interface types all the time, and flag those which were
13184         implemented by parents as optional.
13185
13186 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13187
13188         * expression.cs (Binary.ResolveOperator): Use
13189         String.Concat(string,string,string) or
13190         String.Concat(string,string,string,string) when possible. 
13191
13192         * typemanager: More helper methods.
13193
13194
13195 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13196
13197         * pending.cs: remove the bogus return from GetMissingInterfaces()
13198         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13199
13200 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13201
13202         * namespace.cs: avoid duplicated 'using xxx' being added to
13203         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13204         when we get more than one 'using' statement for the same namespace.
13205         Report a CS0105 warning for it.
13206
13207 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13208
13209         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13210         of calling getChar/putback, uses internal knowledge of it.    
13211
13212         (xtoken): Reorder tokenizer so most common patterns are checked
13213         first.  This reduces the compilation time in another 5% (from 8.11s
13214         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13215
13216         The parsing time is 22% of the compilation in mcs, and from that
13217         64% is spent on the tokenization process.  
13218
13219         I tried using a binary search for keywords, but this is slower
13220         than the hashtable.  Another option would be to do a couple of
13221         things:
13222
13223                 * Not use a StringBuilder, instead use an array of chars,
13224                   with a set value.  Notice that this way we could catch
13225                   the 645 error without having to do it *afterwards*.
13226
13227                 * We could write a hand-parser to avoid the hashtable
13228                   compares altogether.
13229
13230         The identifier consumption process takes 37% of the tokenization
13231         time.  Another 15% is spent on is_number.  56% of the time spent
13232         on is_number is spent on Int64.Parse:
13233
13234                 * We could probably choose based on the string length to
13235                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13236                   computations. 
13237
13238         Another 3% is spend on wrapping `xtoken' in the `token' function.
13239
13240         Handle 0xa0 as whitespace (#34752)
13241
13242 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13243
13244         * typemanager.cs (IsCLRType): New routine to tell whether a type
13245         is one of the builtin types.  
13246
13247         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13248         typecode in more places instead of doing pointer comparissions.
13249         We could leverage some knowledge about the way the typecodes are
13250         laid out.
13251
13252         New code to cache namespaces in assemblies, it is currently not
13253         invoked, to be used soon.
13254
13255         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13256
13257         * expression.cs (Binary.ResolveOperator): specially handle
13258         strings, and do not perform user-defined operator overloading for
13259         built-in types.
13260
13261 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13262
13263         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13264         internalcall as it is a pretty simple operation;  Avoid whenever
13265         possible to call Char.IsLetter.
13266
13267         (consume_identifier): Cut by half the number of
13268         hashtable calls by merging the is_keyword and GetKeyword behavior.
13269
13270         Do not short-circuit, because if we do, we
13271         report errors (ie, #if false && true would produce an invalid
13272         directive error);
13273
13274
13275 2002-11-24  Martin Baulig  <martin@ximian.com>
13276
13277         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13278         check constant ranges and report a CS0221.  Fixes #33186.
13279
13280 2002-11-24  Martin Baulig  <martin@ximian.com>
13281
13282         * cs-parser.jay: Make this work for uninitialized variable
13283         declarations in the `for' initializer.  Fixes #32416.
13284
13285 2002-11-24  Martin Baulig  <martin@ximian.com>
13286
13287         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13288         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13289
13290 2002-11-24  Martin Baulig  <martin@ximian.com>
13291
13292         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13293         argument; if true, we also check for user-defined conversions.
13294         This is only needed if both arguments are of a user-defined type.
13295         Fixes #30443, added test-175.cs.
13296         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13297
13298         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13299
13300 2002-11-24  Martin Baulig  <martin@ximian.com>
13301
13302         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13303         function to get the store opcode.
13304         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13305         only emit the Ldelema if the store opcode is Stobj.  You must run
13306         both test-34 and test-167 to test this.  Fixes #34529.
13307
13308 2002-11-23  Martin Baulig  <martin@ximian.com>
13309
13310         * ecore.cs (Expression.MemberLookup): Added additional
13311         `qualifier_type' argument which is used when we're being called
13312         from MemberAccess.DoResolve() and null if we're called from a
13313         SimpleName lookup.
13314         (Expression.MemberLookupFailed): New method to report errors; this
13315         does the CS1540 check and reports the correct error message.
13316
13317         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13318         argument for the CS1540 check and redone the way how we're dealing
13319         with private members.  See the comment in the source code for details.
13320         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13321         `closure_start_type' to `closure_qualifier_type' and check whether
13322         it's not null.  It was not this filter being broken, it was just
13323         being called with the wrong arguments.
13324
13325         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13326         and pass it the correct `qualifier_type'; this also does the error
13327         handling for us.
13328
13329 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13330
13331         * expression.cs (Invocation.EmitParams): If the we are dealing
13332         with a non-built-in value type, load its address as well.
13333
13334         (ArrayCreation): Use a a pretty constant instead
13335         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13336         static initializers.  
13337
13338         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13339         because they are not really value types, just glorified integers. 
13340
13341         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13342
13343         * ecore.cs: Remove redundant code for enumerations, make them use
13344         the same code path as everything else, fixes the casting issue
13345         with enumerations in Windows.Forms.
13346
13347         * attribute.cs: Do only cast to string if it is a string, the
13348         validation happens later.
13349
13350         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13351         people upgrade their corlibs.
13352
13353         * ecore.cs: Oops, enumerations were not following the entire code path
13354
13355 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13356
13357         * typemanager.cs (FilterWithClosure): Commented out the test for
13358         1540 in typemanager.cs, as it has problems when accessing
13359         protected methods from a parent class (see test-174.cs). 
13360
13361         * attribute.cs (Attribute.ValidateGuid): new method.
13362         (Attribute.Resolve): Use above.
13363
13364 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13365
13366         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13367
13368         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13369         handling for enumerations, as we only needed the TypeContainer
13370         functionality to begin with (this is required for the fix below to
13371         work for enums that reference constants in a container class for
13372         example). 
13373
13374         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13375
13376         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13377         a valid TypeBuilder to perform lookups on.o
13378
13379         * class.cs (InheritableMemberSignatureCompare): Use true in the
13380         call to GetGetMethod and GetSetMethod, because we are comparing
13381         the signature, and we need to get the methods *even* if they are
13382         private. 
13383
13384         (PropertyBase.CheckBase): ditto.
13385
13386         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13387         GotoCase.Resolve): Use Peel on EmpytCasts.
13388
13389         * ecore.cs (EmptyCast): drop child, add Peel method.
13390
13391 2002-11-17  Martin Baulig  <martin@ximian.com>
13392
13393         * ecore.cs (EmptyCast.Child): New public property.
13394
13395         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13396         label resolved to an EmptyCast.  Fixes #34162.
13397         (GotoCase.Resolve): Likewise.
13398         (Block.EmitMeta): Likewise.
13399
13400 2002-11-17  Martin Baulig  <martin@ximian.com>
13401
13402         * expression.cs (Invocation.BetterConversion): Prefer int over
13403         uint; short over ushort; long over ulong for integer literals.
13404         Use ImplicitConversionExists instead of StandardConversionExists
13405         since we also need to check for user-defined implicit conversions.
13406         Fixes #34165.  Added test-173.cs.
13407
13408 2002-11-16  Martin Baulig  <martin@ximian.com>
13409
13410         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13411         with the `true' and `false' literals.  Fixes #33151.
13412
13413 2002-11-16  Martin Baulig  <martin@ximian.com>
13414
13415         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13416         October 22nd; don't do the cs1540 check for static members.
13417
13418         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13419         now using our own filter here and doing the cs1540 check again.
13420
13421 2002-11-16  Martin Baulig  <martin@ximian.com>
13422
13423         * support.cs (InternalParameters): Don't crash if we don't have
13424         any fixed parameters.  Fixes #33532.
13425
13426 2002-11-16  Martin Baulig  <martin@ximian.com>
13427
13428         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13429         when looking up static methods to make this work on Windows.
13430         Fixes #33773.
13431
13432 2002-11-16  Martin Baulig  <martin@ximian.com>
13433
13434         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13435         a setter rather than using PropertyInfo.CanWrite.
13436
13437 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13438
13439         * class.cs: Allow acces to block member by subclasses. Fixes build
13440         breaker.
13441
13442 2002-11-14  Martin Baulig  <martin@ximian.com>
13443
13444         * class.cs (Constructor.Emit): Added the extern/block check.
13445         Fixes bug #33678.
13446
13447 2002-11-14  Martin Baulig  <martin@ximian.com>
13448
13449         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13450         iteration while looking for indexers, this is needed because the
13451         indexer may have a different name in our base classes.  Fixed the
13452         error reporting (no indexers at all, not get accessor, no
13453         overloaded match).  Fixes bug #33089.
13454         (IndexerAccess.DoResolveLValue): Likewise.
13455
13456 2002-11-14  Martin Baulig  <martin@ximian.com>
13457
13458         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13459         indexers.  Fixes the first part of bug #33089.
13460         (MethodSignature.InheritableMemberSignatureCompare): Added support
13461         for properties.
13462
13463 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13464
13465         * attribute.cs (Attribute.Resolve): Catch the
13466         NullReferenceException and report it since it isn't supposed to
13467         happen. 
13468
13469 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13470
13471         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13472         LogicalOr and LogicalAnd that can benefit from recursively
13473         handling EmitBranchable.  The code now should be nice for Paolo.
13474
13475 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13476
13477         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13478         the Type lookups, as we perform quite a number of lookups on
13479         non-Types.  This can be removed once we can deterministically tell
13480         whether we have a type or a namespace in advance.
13481
13482         But this might require special hacks from our corlib.
13483
13484         * TODO: updated.
13485
13486         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13487         and double which avoids a conversion from an integer to a double.
13488
13489         * expression.cs: tiny optimization, avoid calling IsConstant,
13490         because it effectively performs the lookup twice.
13491
13492 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13493
13494         But a bogus return here to keep the semantics of the old code
13495         until the Mono runtime is fixed.
13496
13497         * pending.cs (GetMissingInterfaces): New method used to remove all
13498         the interfaces that are already implemented by our parent
13499         classes from the list of pending methods. 
13500
13501         * interface.cs: Add checks for calls after ResolveTypeExpr.
13502
13503 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13504
13505         * class.cs (Class.Emit): Report warning 67: event not used if the
13506         warning level is beyond 3.
13507
13508         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13509         being a NullLiteral.
13510
13511         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13512         specifiers. 
13513
13514         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13515         path that might fail if a type can not be resolved.
13516
13517         * expression.cs (Binary.Emit): Emit unsigned versions of the
13518         operators. 
13519
13520         * driver.cs: use error 5.
13521
13522 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13523
13524         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13525
13526 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * cs-parser.jay (switch_section): A beautiful patch from Martin
13529         Baulig that fixed 33094.
13530
13531 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13534         Check whether the base is abstract and report an error if so.
13535
13536         * expression.cs (IndexerAccess.DoResolveLValue,
13537         IndexerAccess.DoResolve): ditto. 
13538
13539         (Invocation.DoResolve): ditto.
13540
13541         (Invocation.FullMethodDesc): Improve the report string.
13542
13543         * statement.cs (Block): Eliminate IsVariableDefined as it is
13544         basically just a wrapper for GetVariableInfo.
13545
13546         * ecore.cs (SimpleName): Use new 
13547
13548         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13549         type, as we return the actual parameter ref/unref state on a
13550         different call.
13551
13552 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13553
13554         * support.cs: Return proper flags REF/OUT fixing the previous
13555         commit.  
13556
13557         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13558         not used to mean `ref' but `ref or out' in ParameterReference
13559
13560         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13561         full type signature instead of calling TypeManger.CSharpName
13562         ourselves. 
13563
13564         * support.cs (InternalParameters.ParameterDesc): Do not compare
13565         directly to the modflags, because REF/OUT will actually be bitsets
13566         if set. 
13567
13568         * delegate.cs (VerifyMethod): Check also the modifiers.
13569
13570         * cs-tokenizer.cs: Fix bug where floating point values with an
13571         exponent where a sign was missing was ignored.
13572
13573         * driver.cs: Allow multiple assemblies to be specified in a single
13574         /r: argument
13575
13576 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13577
13578         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13579         because identifiers after a parenthesis would end up in this kind
13580         of production, and we needed to desamiguate it for having casts
13581         like:
13582
13583                 (UserDefinedType *) xxx
13584
13585 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13586
13587         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13588         we should set on the Bindingflags.NonPublic, but not turn on
13589         private_ok.  private_ok controls whether a Private member is
13590         returned (this is chekced on the filter routine), while the
13591         BindingFlags.NonPublic just controls whether private/protected
13592         will be allowed.   This fixes the problem part of the problem of
13593         private properties being allowed to be used in derived classes.
13594
13595         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13596         so we can call the children DoResolveLValue method (this will
13597         properly signal errors on lvalue assignments to base properties)
13598
13599         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13600         getter are null, and we have a property info, we know that this
13601         happened because the lookup failed, so we report an error 122 for
13602         protection level violation.
13603
13604         We also silently return if setter and getter are null in the
13605         resolve functions, this condition only happens if we have flagged
13606         the error before.  This is the other half of the problem. 
13607
13608         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13609         not have accessibility information, that is why we were returning
13610         true in the filter function in typemanager.cs.
13611
13612         To properly report 122 (property is inaccessible because of its
13613         protection level) correctly, we report this error in ResolveAccess
13614         by failing if both the setter and the getter are lacking (ie, the
13615         lookup failed). 
13616
13617         DoResolve and DoLResolve have been modified to check for both
13618         setter/getter being null and returning silently, the reason being
13619         that I did not want to put the knowledge about this error in upper
13620         layers, like:
13621
13622         int old = Report.Errors;
13623         x = new PropertyExpr (...);
13624         if (old != Report.Errors)
13625                 return null;
13626         else
13627                 return x;
13628
13629         So the property expr is returned, but it is invalid, so the error
13630         will be flagged during the resolve process. 
13631
13632         * class.cs: Remove InheritablePropertySignatureCompare from the
13633         class, as we no longer depend on the property signature to compute
13634         whether it is possible to implement a method or not.
13635
13636         The reason is that calling PropertyInfo.GetGetMethod will return
13637         null (in .NET, in Mono it works, and we should change this), in
13638         cases where the Get Method does not exist in that particular
13639         class.
13640
13641         So this code:
13642
13643         class X { public virtual int A { get { return 1; } } }
13644         class Y : X { }
13645         class Z : Y { public override int A { get { return 2; } } }
13646
13647         Would fail in Z because the parent (Y) would not have the property
13648         defined.  So we avoid this completely now (because the alternative
13649         fix was ugly and slow), and we now depend exclusively on the
13650         method names.
13651
13652         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13653         reference method, instead of using the property.
13654
13655         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13656         routines are gone now.
13657
13658         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13659         names, they were incorrectly named.
13660
13661         * cs-tokenizer.cs: Return are more gentle token on failure. 
13662
13663         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13664         had an out-of-sync index variable, which caused it to remove from
13665         the list of pending methods the wrong method sometimes.
13666
13667 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13668
13669         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13670         CanWrite, because those refer to this particular instance of the
13671         property, and do not take into account the fact that we can
13672         override single members of a property.
13673
13674         Constructor requires an EmitContext.  The resolution process does
13675         not happen here, but we need to compute the accessors before,
13676         because the resolution does not always happen for properties.
13677
13678         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13679         subclass, before we did not update this flag, but we did update
13680         bindingflags. 
13681
13682         (GetAccessors): Drop this routine, as it did not work in the
13683         presence of partially overwritten set/get methods. 
13684
13685         Notice that this broke the cs1540 detection, but that will require
13686         more thinking. 
13687
13688 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13689
13690         * class.cs:
13691         * codegen.cs:
13692         * driver.cs: issue a warning instead of an error if we don't support
13693         debugging for the platform. Also ignore a couple of errors that may
13694         arise when trying to write the symbols. Undo my previous patch.
13695
13696 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13697
13698         * driver.cs: ignore /debug switch except for Unix platforms.
13699
13700 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13701
13702         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13703
13704 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13705
13706         * driver.cs: Do not make mcs-debug conditional, so we do not break
13707         builds that use it.
13708
13709         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13710         review this patch.  But basically after all the children variables
13711         have been merged, the value of "Breaks" was not being set to
13712         new_breaks for Switch blocks.  I think that it should be set after
13713         it has executed.  Currently I set this to the value of new_breaks,
13714         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13715         conservative, but I do not understand this code very well.
13716
13717         I did not break anything in the build, so that is good ;-)
13718
13719         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13720
13721 2002-10-20  Mark Crichton  <crichton@gimp.org>
13722
13723         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13724
13725 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13726
13727         * cfold.cs: Fixed compile blocker.
13728
13729 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13730
13731         * driver.cs: I was chekcing the key, not the file.
13732
13733 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13734
13735         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13736         message that we were generating - we just need to silently return
13737         a null.
13738
13739 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13740
13741         * class.cs (Event.Define): Change my previous commit, as this
13742         breaks the debugger.  This is a temporary hack, as it seems like
13743         the compiler is generating events incorrectly to begin with.
13744
13745         * expression.cs (Binary.ResolveOperator): Added support for 
13746         "U operator - (E x, E y)"
13747
13748         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13749         y)".
13750
13751         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13752         init-only variables, but this path did not take into account that
13753         there might be also instance readonly variables.  Correct this
13754         problem. 
13755
13756         This fixes bug 32253
13757
13758         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13759         delegates as well.
13760
13761         * driver.cs: Change the extension for modules to `netmodule'
13762
13763         * cs-parser.jay: Improved slightly the location tracking for
13764         the debugger symbols.
13765
13766         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13767         modifiers that were specified instead of the hardcoded value
13768         (FamAndAssem).  This was basically ignoring the static modifier,
13769         and others.  Fixes 32429.
13770
13771         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13772         fixed a bug in the process (32476)
13773
13774         * expression.cs (ArrayAccess.EmitAssign): Patch from
13775         hwang_rob@yahoo.ca that fixes bug 31834.3
13776
13777 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13778
13779         * driver.cs: Make the module extension .netmodule.
13780
13781 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13782
13783         * driver.cs: Report an error if the resource file is not found
13784         instead of crashing.
13785
13786         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13787         false, like Emit does.
13788
13789 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13790
13791         * typemanager.cs: Remove unused private member.  Also reported mcs
13792         bug to report this as a warning like csc.
13793
13794 2002-10-15  Martin Baulig  <martin@gnome.org>
13795
13796         * statement.cs (Statement.Emit): Made this a virtual method; emits
13797         the line number info and calls DoEmit().
13798         (Statement.DoEmit): New protected abstract method, formerly knows
13799         as Statement.Emit().
13800
13801         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13802
13803 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13804
13805         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13806         have fixed a remaining problem: not every AddXXXX was adding a
13807         fully qualified name.  
13808
13809         Now everyone registers a fully qualified name in the DeclSpace as
13810         being defined instead of the partial name.  
13811
13812         Downsides: we are slower than we need to be due to the excess
13813         copies and the names being registered this way.  
13814
13815         The reason for this is that we currently depend (on the corlib
13816         bootstrap for instance) that types are fully qualified, because
13817         we dump all the types in the namespace, and we should really have
13818         types inserted into the proper namespace, so we can only store the
13819         basenames in the defined_names array.
13820
13821 2002-10-10  Martin Baulig  <martin@gnome.org>
13822
13823         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13824         from bug #31834, see the bug report for a testcase which is
13825         miscompiled.
13826
13827 2002-10-10  Martin Baulig  <martin@gnome.org>
13828
13829         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13830         flow analysis code for this.
13831
13832         * statement.cs (Do, While, For): Tell the flow analysis code about
13833         infinite loops.
13834         (FlowBranching.UsageVector): Added support for infinite loops.
13835         (Block.Resolve): Moved the dead code elimination here and use flow
13836         analysis to do it.
13837
13838 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13839
13840         * class.cs (Field.Define): Catch cycles on struct type
13841         definitions. 
13842
13843         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13844         fields if the fields are static.  We only need to check instance
13845         fields. 
13846
13847         * expression.cs (As.DoResolve): Test for reference type.
13848
13849         * statement.cs (Using.ResolveExpression): Use
13850         ConvertImplicitRequired, not ConvertImplicit which reports an
13851         error on failture
13852         (Using.ResolveLocalVariableDecls): ditto.
13853
13854         * expression.cs (Binary.ResolveOperator): Report errors in a few
13855         places where we had to.
13856
13857         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13858
13859 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13860
13861         * expression.cs: Use StoreFromPtr instead of extracting the type
13862         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13863
13864         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13865         an enumeration value to a System.Enum, but System.Enum is not a
13866         value type, but an class type, so we need to box.
13867
13868         (Expression.ConvertExplicit): One codepath could return
13869         errors but not flag them.  Fix this.  Fixes #31853
13870
13871         * parameter.cs (Resolve): Do not allow void as a parameter type.
13872
13873 2002-10-06  Martin Baulig  <martin@gnome.org>
13874
13875         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13876         if it's a class type and not a struct.  Fixes #31815.
13877
13878 2002-10-06  Martin Baulig  <martin@gnome.org>
13879
13880         * statement.cs: Reworked the flow analysis code a bit to make it
13881         usable for dead code elimination.
13882
13883 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13884
13885         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13886
13887 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13888
13889         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13890         to fix the test 165, will investigate deeper.
13891
13892 2002-10-04  Martin Baulig  <martin@gnome.org>
13893
13894         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13895         finally blocks actually work.
13896         (Try.Resolve): We don't need to create a sibling for `finally' if
13897         there is no finally block.
13898
13899 2002-10-04  Martin Baulig  <martin@gnome.org>
13900
13901         * class.cs (Constructor.Define): The default accessibility for a
13902         non-default constructor is private, not public.
13903
13904 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13905
13906         * class.cs (Constructor): Make AllowedModifiers public, add
13907         EXTERN.
13908
13909         * cs-parser.jay: Perform the modifiers test here, as the
13910         constructor for the Constructor class usually receives a zero
13911         because of the way we create it (first we create, later we
13912         customize, and we were never checking the modifiers).
13913
13914         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13915         is a version of LookupTypeReflection that includes the type-name
13916         cache.  This can be used as a fast path for functions that know
13917         the fully qualified name and are only calling into *.GetType() to
13918         obtain a composed type.
13919
13920         This is also used by TypeManager.LookupType during its type
13921         composition.
13922
13923         (LookupType): We now also track the real type name, as sometimes
13924         we can get a quey for the real type name from things like
13925         ComposedCast.  This fixes bug 31422.
13926
13927         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13928         complete type fullname, it does not have to go through the type
13929         resolution system to obtain the composed version of the type (for
13930         obtaining arrays or pointers).
13931
13932         (Conditional.Emit): Use the EmitBoolExpression to
13933         generate nicer code, as requested by Paolo.
13934
13935         (ArrayCreation.CheckIndices): Use the patch from
13936         hwang_rob@yahoo.ca to validate the array initializers. 
13937
13938 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13939
13940         * class.cs (ConstructorInitializer.Emit): simplify code by using
13941         Invocation.EmitCall, and at the same time, fix the bugs in calling
13942         parent constructors that took variable arguments. 
13943
13944         * ecore.cs (Expression.ConvertNumericExplicit,
13945         Expression.ImplicitNumericConversion): Remove the code that
13946         manually wrapped decimal (InternalTypeConstructor call is now gone
13947         as well).
13948
13949         * expression.cs (Cast.TryReduce): Also handle decimal types when
13950         trying to perform a constant fold on the type.
13951
13952         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13953
13954         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13955         that only turned off an error report, and did nothing else. 
13956
13957 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13958
13959         * driver.cs: Handle and ignore /fullpaths
13960
13961 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13962
13963         * expression.cs (Binary.ResolveOperator): Catch the case where
13964         DoNumericPromotions returns true, 
13965
13966         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13967
13968 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13969
13970         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13971         report error 70.
13972
13973 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13974
13975         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13976         conversion exists, but it is also required that the conversion be
13977         performed.  This manifested in "(Type64Enum) 2".  
13978
13979         * class.cs (TypeManager.AddMethod): The fix is not to change
13980         AddEnum, because that one was using a fully qualified name (every
13981         DeclSpace derivative does), but to change the AddMethod routine
13982         that was using an un-namespaced name.  This now correctly reports
13983         the duplicated name.
13984
13985         Revert patch until I can properly fix it.  The issue
13986         is that we have a shared Type space across all namespaces
13987         currently, which is wrong.
13988
13989         Options include making the Namespace a DeclSpace, and merge
13990         current_namespace/current_container in the parser.
13991
13992 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13993
13994         * cs-parser.jay: Improve error reporting when we get a different
13995         kind of expression in local_variable_type and
13996         local_variable_pointer_type. 
13997
13998         Propagate this to avoid missleading errors being reported.
13999
14000         * ecore.cs (ImplicitReferenceConversion): treat
14001         TypeManager.value_type as a target just like object_type.   As
14002         code like this:
14003
14004         ValueType v = 1;
14005
14006         Is valid, and needs to result in the int 1 being boxed before it
14007         is assigned to the value type v.
14008
14009         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14010         to validate the enumeration name.
14011
14012         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14013         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14014         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14015
14016         * ecore.cs (TryImplicitIntConversion): When doing an
14017         implicit-enumeration-conversion, check if the type is 64-bits and
14018         perform a conversion before passing to EnumConstant.
14019
14020 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14021
14022         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14023         report ambiguous type references.  Unlike the MS version, we
14024         report what the ambiguity is.   Innovation at work ;-)
14025
14026         (DeclSpace.FindType): Require a location argument to
14027         display when we display an ambiguous error.
14028
14029         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14030
14031         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14032
14033         * expression.cs (EmitDynamicInitializers): Apply patch from
14034         hwang_rob@yahoo.ca that fixes the order in which we emit our
14035         initializers. 
14036
14037 2002-09-21  Martin Baulig  <martin@gnome.org>
14038
14039         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14040         delegate takes no arguments.
14041
14042 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14043
14044         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14045         from integers.
14046
14047         * expression.cs: Extract the underlying type.
14048
14049         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14050
14051         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14052
14053 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14054
14055         * class.cs (TypeContainer.DefineType): We can not use the nice
14056         PackingSize with the size set to 1 DefineType method, because it
14057         will not allow us to define the interfaces that the struct
14058         implements.
14059
14060         This completes the fixing of bug 27287
14061
14062         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14063         means also structs.  This fixes part of the problem. 
14064         (Expresion.ImplicitReferenceConversionExists): ditto.
14065
14066         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14067         error if there were no errors reported during the type lookup
14068         process, to avoid duplicates or redundant errors.  Without this
14069         you would get an ambiguous errors plus a type not found.  We have
14070         beaten the user enough with the first error.  
14071
14072         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14073         reference. 
14074
14075         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14076         during the resolution process, stop the lookup, this avoids
14077         repeated error reports (same error twice).
14078
14079         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14080
14081         * typemanager.cs (LookupType): Redo the type lookup code to match
14082         the needs of System.Reflection.  
14083
14084         The issue is that System.Reflection requires references to nested
14085         types to begin with a "+" sign instead of a dot.  So toplevel
14086         types look like: "NameSpace.TopLevelClass", and nested ones look
14087         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14088         levels. 
14089
14090 2002-09-19  Martin Baulig  <martin@gnome.org>
14091
14092         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14093         says that a method always returns or always throws an exception,
14094         don't report the CS0161.
14095
14096         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14097         set `Returns = new_returns'.
14098
14099 2002-09-19  Martin Baulig  <martin@gnome.org>
14100
14101         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14102         to an enum constant, check for a CS0176.
14103
14104 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14105
14106         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14107         for operators that must be in pairs and report errors.
14108
14109         * ecore.cs (SimpleName.DoResolveType): During the initial type
14110         resolution process, when we define types recursively, we must
14111         check first for types in our current scope before we perform
14112         lookups in the enclosing scopes.
14113
14114         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14115
14116         (Invocation.VerifyArgumentsCompat): Call
14117         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14118         I thought we were supposed to always call this, but there are a
14119         few places in the code where we dont do it.
14120
14121 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * driver.cs: Add support in -linkres and -resource to specify the
14124         name of the identifier.
14125
14126 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14127
14128         * ecore.cs (StandardConversionExists): Sync with the conversion
14129         code: allow anything-* to void* conversions.
14130
14131         (FindMostSpecificSource): Use an Expression argument
14132         instead of a Type, because we might be handed over a Literal which
14133         gets a few more implicit conversions that plain types do not.  So
14134         this information was being lost.
14135
14136         Also, we drop the temporary type-holder expression when not
14137         required.
14138
14139 2002-09-17  Martin Baulig  <martin@gnome.org>
14140
14141         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14142         this is an explicit interface implementation.
14143
14144 2002-09-17  Martin Baulig  <martin@gnome.org>
14145
14146         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14147         different `IndexerName' attributes.
14148
14149         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14150         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14151         virtual CommonResolve().
14152
14153 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14154
14155         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14156         and convert that to the UnderlyingType.
14157
14158         * statement.cs (Foreach.Resolve): Indexers are just like variables
14159         or PropertyAccesses.
14160
14161         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14162         inside quoted strings, we were not doing this before.
14163
14164 2002-09-16  Martin Baulig  <martin@gnome.org>
14165
14166         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14167         resolve it.  This is needed for the definite assignment check of the
14168         instance expression, fixes bug #29846.
14169         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14170
14171 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14172
14173         * parameter.cs: Fix compile error.  Cannot reference static member
14174         from an instance object.  Is this an mcs bug?
14175
14176 2002-09-14  Martin Baulig  <martin@gnome.org>
14177
14178         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14179         multiple times.  Fixes bug #30295, added test-166.cs.
14180
14181 2002-09-14  Martin Baulig  <martin@gnome.org>
14182
14183         * statement.cs (Block.Emit): Don't emit unreachable code.
14184         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14185         `break' statements.
14186         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14187
14188 2002-09-14  Martin Baulig  <martin@gnome.org>
14189
14190         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14191         is set.
14192
14193 2002-09-14  Martin Baulig  <martin@gnome.org>
14194
14195         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14196         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14197         be false on the ms runtime.
14198
14199 2002-09-13  Martin Baulig  <martin@gnome.org>
14200
14201         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14202         the CS0038 error message.
14203
14204 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14205
14206         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14207         constant inside, return it.
14208
14209 2002-09-12  Martin Baulig  <martin@gnome.org>
14210
14211         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14212         implicit conversion can be done between enum types.
14213
14214         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14215         check whether an implicit conversion to the current enum's UnderlyingType
14216         exists and report an error if not.
14217
14218         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14219         without debugging support.
14220
14221         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14222         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14223
14224 2002-09-12  Martin Baulig  <martin@gnome.org>
14225
14226         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14227
14228         * ecore.cs (IMemberExpr.DeclaringType): New property.
14229         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14230         nonstatic member of an outer type (CS0038).
14231
14232 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14233
14234         * driver.cs: Activate the using-error detector at warning level
14235         4 (at least for MS-compatible APIs).
14236
14237         * namespace.cs (VerifyUsing): Small buglett fix.
14238
14239         * pending.cs (PendingImplementation): pass the container pointer. 
14240
14241         * interface.cs (GetMethods): Allow for recursive definition.  Long
14242         term, I would like to move every type to support recursive
14243         definitions, not the current ordering mechanism that we have right
14244         now.
14245
14246         The situation is this: Attributes are handled before interfaces,
14247         so we can apply attributes to interfaces.  But some attributes
14248         implement interfaces, we will now handle the simple cases
14249         (recursive definitions will just get an error).  
14250
14251         * parameter.cs: Only invalidate types at the end if we fail to
14252         lookup all types.  
14253
14254 2002-09-09  Martin Baulig  <martin@gnome.org>
14255
14256         * ecore.cs (PropertyExpr.Emit): Also check for
14257         TypeManager.system_int_array_get_length so this'll also work when
14258         compiling corlib.  Fixes #30003.
14259
14260 2002-09-09  Martin Baulig  <martin@gnome.org>
14261
14262         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14263         and throw an exception if we can't get the type's size.  Fixed #30040,
14264         added test-165.cs.
14265
14266 2002-09-09  Martin Baulig  <martin@gnome.org>
14267
14268         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14269
14270         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14271         context.  Fixes bug #30027.
14272
14273         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14274         virtual functions.  Fixes bug #30043, added test-164.cs.
14275
14276 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14277
14278         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14279
14280 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14281
14282         * driver.cs: Use an object to get the windows codepage since it's not a
14283         static property.
14284
14285 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14286
14287         * statement.cs (For.Emit): for infinite loops (test == null)
14288         return whether there is a break inside, not always "true".
14289
14290         * namespace.cs (UsingEntry): New struct to hold the name of the
14291         using definition, the location where it is defined, and whether it
14292         has been used in a successful type lookup.
14293
14294         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14295         strings.
14296
14297         * decl.cs: ditto.
14298
14299 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14300
14301         * attribute.cs : Fix incorrect code which relied on catching
14302         a NullReferenceException to detect a null being passed in
14303         where an object was expected.
14304
14305 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14306
14307         * statement.cs (Try): flag the catch variable as assigned
14308
14309         * expression.cs (Cast): Simplified by using ResolveType instead of
14310         manually resolving.
14311
14312         * statement.cs (Catch): Fix bug by using ResolveType.
14313
14314 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14315
14316         * expression.cs (BetterConversion): Special case for when we have
14317         a NullLiteral as the argument and we have to choose between string
14318         and object types - we choose string the way csc does.
14319
14320         * attribute.cs (Attribute.Resolve): Catch the
14321         NullReferenceException and report error #182 since the Mono
14322         runtime no more has the bug and having this exception raised means
14323         we tried to select a constructor which takes an object and is
14324         passed a null.
14325
14326 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14327
14328         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14329         message (1502, 1503) when we can't locate a method after overload
14330         resolution. This is much more informative and closes the bug
14331         Miguel reported.
14332
14333         * interface.cs (PopulateMethod): Return if there are no argument
14334         types. Fixes a NullReferenceException bug.
14335
14336         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14337         expressions too. Previously we were checking only in one place for
14338         positional arguments leaving out named arguments.
14339
14340         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14341         type to the enum type is not allowed. Remove code corresponding to
14342         that.
14343
14344         (ConvertNumericExplicit): Allow explicit conversions from
14345         the underlying type to enum type. This precisely follows the spec
14346         and closes a bug filed by Gonzalo.
14347
14348 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14349
14350         * compiler.csproj:
14351         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14352
14353 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14354
14355         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14356         it was important that we stored the right value after the
14357         reduction in `converted'.
14358
14359 2002-09-04  Martin Baulig  <martin@gnome.org>
14360
14361         * location.cs (Location.SymbolDocument): Use full pathnames for the
14362         source files.
14363
14364 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14367         of the expression resolve mechanism, because that will catch the
14368         SimpleName error failures.
14369
14370         (Conditional): If we can not resolve the
14371         expression, return, do not crash.
14372
14373 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14374
14375         * cs-tokenizer.cs:
14376         (location): display token name instead of its number.
14377
14378 2002-08-28  Martin Baulig  <martin@gnome.org>
14379
14380         * expression.cs (Binary.ResolveOperator): Don't silently return
14381         but return an error if an operator cannot be applied between two
14382         enum types.
14383
14384 2002-08-28  Martin Baulig  <martin@gnome.org>
14385
14386         * class.cs (Constructor.Define): Set the permission attributes
14387         correctly instead of making all constructors public.
14388
14389 2002-08-28  Martin Baulig  <martin@gnome.org>
14390
14391         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14392         for private members before reporting a CS0103; if we find anything,
14393         it's a CS0122.
14394
14395 2002-08-28  Martin Baulig  <martin@gnome.org>
14396
14397         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14398         to check whether `closure_start_type == closure_invocation_type',
14399         we also need to check whether `m.DeclaringType == closure_invocation_type'
14400         before bypassing the permission checks.  We might be accessing
14401         protected/private members from the base class.
14402         (TypeManager.RealMemberLookup): Only set private_ok if private
14403         members were requested via BindingFlags.NonPublic.
14404
14405         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14406
14407         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14408         MethodGroupExpr.IsExplicitImpl if appropriate.
14409         (Invocation.DoResolve): Don't report the CS0120 for explicit
14410         interface implementations.
14411
14412 2002-08-27  Martin Baulig  <martin@gnome.org>
14413
14414         * expression.cs (Invocation.DoResolve): If this is a static
14415         method and we don't have an InstanceExpression, we must report
14416         a CS0120.
14417
14418 2002-08-25  Martin Baulig  <martin@gnome.org>
14419
14420         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14421         `==' between a valuetype and an object.
14422
14423 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14424
14425         * ecore.cs (TypeExpr): Provide a ToString method.
14426
14427 2002-08-24  Martin Baulig  <martin@gnome.org>
14428
14429         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14430         now called proggie.dbg and it's a binary file.
14431
14432 2002-08-23  Martin Baulig  <martin@gnome.org>
14433
14434         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14435
14436 2002-08-23  Martin Baulig  <martin@gnome.org>
14437
14438         * struct.cs (MyStructInfo.ctor): Make this work with empty
14439         structs; it's not allowed to use foreach() on null.
14440
14441 2002-08-23  Martin Baulig  <martin@gnome.org>
14442
14443         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14444         writer the full pathname of the generated assembly.
14445
14446 2002-08-23  Martin Baulig  <martin@gnome.org>
14447
14448         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14449         A `finally' block never returns or breaks; improved handling of
14450         unreachable code.
14451
14452 2002-08-23  Martin Baulig  <martin@gnome.org>
14453
14454         * statement.cs (Throw.Resolve): Allow `throw null'.
14455
14456 2002-08-23  Martin Baulig  <martin@gnome.org>
14457
14458         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14459         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14460         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14461         MemberLookup would return a wrong event if this is an explicit
14462         interface implementation and the class has an event with the same
14463         name.
14464
14465 2002-08-23  Martin Baulig  <martin@gnome.org>
14466
14467         * statement.cs (Block.AddChildVariableNames): New public method.
14468         (Block.AddChildVariableName): Likewise.
14469         (Block.IsVariableNameUsedInChildBlock): Likewise.
14470         (Block.AddVariable): Check whether a variable name has already
14471         been used in a child block.
14472
14473         * cs-parser.jay (declare_local_variables): Mark all variable names
14474         from the current block as being used in a child block in the
14475         implicit block.
14476
14477 2002-08-23  Martin Baulig  <martin@gnome.org>
14478
14479         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14480         find the symbol writer.
14481
14482         * driver.cs: csc also allows the arguments to /define being
14483         separated by commas, not only by semicolons.
14484
14485 2002-08-23  Martin Baulig  <martin@gnome.org>
14486
14487         * interface.cs (Interface.GetMembers): Added static check for events.
14488
14489 2002-08-15  Martin Baulig  <martin@gnome.org>
14490
14491         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14492         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14493
14494         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14495         why the MethodData.EmitDestructor() change was necessary.
14496
14497 2002-08-20  Martin Baulig  <martin@gnome.org>
14498
14499         * class.cs (TypeContainer.FindMembers): Added static check for events.
14500
14501         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14502
14503         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14504         use Type.GetEvents(), not Type.FindMembers().
14505
14506 2002-08-20  Martin Baulig  <martin@gnome.org>
14507
14508         * decl.cs (MemberCache): Added a special method cache which will
14509         be used for method-only searched.  This ensures that a method
14510         search will return a MethodInfo with the correct ReflectedType for
14511         inherited methods.      
14512
14513 2002-08-20  Martin Baulig  <martin@gnome.org>
14514
14515         * decl.cs (DeclSpace.FindMembers): Made this public.
14516
14517 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14518
14519         * delegate.cs: fixed build on windows.
14520         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14521
14522 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14523
14524         * ecore.cs (StandardConversionExists): Return a false
14525         if we are trying to convert the void type to anything else
14526         since that is not allowed.
14527
14528         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14529         we flag error 70 in the event an event is trying to be accessed
14530         directly from outside the declaring type.
14531
14532 2002-08-20  Martin Baulig  <martin@gnome.org>
14533
14534         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14535         MemberCache from typemanager.cs to decl.cs.
14536
14537 2002-08-19  Martin Baulig  <martin@gnome.org>
14538
14539         * class.cs (TypeContainer): Implement IMemberContainer.
14540         (TypeContainer.DefineMembers): Create the MemberCache.
14541         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14542         return public members if BindingFlags.Public was given, check
14543         whether members are static.
14544
14545 2002-08-16  Martin Baulig  <martin@gnome.org>
14546
14547         * decl.cs (DeclSpace.Define): Splitted this in Define and
14548         DefineMembers.  DefineMembers is called first and initializes the
14549         MemberCache.
14550
14551         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14552         DefineMembers() on all our DeclSpaces.
14553
14554         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14555         but call DefineMembers() on all nested interfaces.  We call their
14556         Define() in our new Define() function.
14557
14558         * interface.cs (Interface): Implement IMemberContainer.
14559         (Interface.Define): Moved all code except the attribute stuf to
14560         DefineMembers().
14561         (Interface.DefineMembers): Initialize the member cache.
14562
14563         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14564         need this anymore since we can use MemberCache.FindMembers directly.
14565
14566 2002-08-19  Martin Baulig  <martin@gnome.org>
14567
14568         * typemanager.cs (MemberCache): When creating the cache for an
14569         interface type, add all inherited members.
14570         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14571         to `out bool used_cache' and documented it.
14572         (TypeManager.MemberLookup): If we already used the cache in the first
14573         iteration, we don't need to do the interfaces check.
14574
14575 2002-08-19  Martin Baulig  <martin@gnome.org>
14576
14577         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14578         here from IMemberFinder and don't implement this interface anymore.
14579         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14580
14581         * typemanager.cs (IMemberFinder): This interface is now only used by
14582         classes which actually support the member cache.
14583         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14584         since we only put DeclSpaces into this Hashtable.
14585         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14586         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14587
14588 2002-08-16  Martin Baulig  <martin@gnome.org>
14589
14590         * typemanager.cs (ICachingMemberFinder): Removed.
14591         (IMemberFinder.MemberCache): New property.
14592         (TypeManager.FindMembers): Merged this with RealFindMembers().
14593         This function will never be called from TypeManager.MemberLookup()
14594         so we can't use the cache here, just the IMemberFinder.
14595         (TypeManager.MemberLookup_FindMembers): Check whether the
14596         IMemberFinder has a MemberCache and call the cache's FindMembers
14597         function.
14598         (MemberCache): Rewrote larger parts of this yet another time and
14599         cleaned it up a bit.
14600
14601 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14602
14603         * driver.cs (LoadArgs): Support quoting.
14604
14605         (Usage): Show the CSC-like command line arguments.
14606
14607         Improved a few error messages.
14608
14609 2002-08-15  Martin Baulig  <martin@gnome.org>
14610
14611         * typemanager.cs (IMemberContainer.Type): New property.
14612         (IMemberContainer.IsInterface): New property.
14613
14614         The following changes are conditional to BROKEN_RUNTIME, which is
14615         defined at the top of the file.
14616
14617         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14618         class'es members, but add all members from TypeHandle.ObjectType
14619         if we're an interface.
14620         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14621         is the current type.
14622         (MemberCache.CacheEntry.Container): Removed this field.
14623         (TypeHandle.GetMembers): Include inherited members.
14624
14625 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14626
14627         * typemanager.cs: fixed compilation and added a comment on a field that
14628         is never used.
14629
14630 2002-08-15  Martin Baulig  <martin@gnome.org>
14631
14632         * class.cs (ConstructorInitializer.Resolve): In the
14633         Expression.MemberLookup call, use the queried_type as
14634         invocation_type.
14635
14636         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14637         declared' attribute, it's always true.
14638         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14639         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14640         temporary wrapper for FindMembers which tells MemberLookup whether
14641         members from the base classes are included in the return value.
14642         This will go away soon.
14643         (TypeManager.MemberLookup): Use this temporary hack here; once the
14644         new MemberCache is completed, we don't need to do the DeclaredOnly
14645         looping here anymore since the MemberCache will take care of this.
14646         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14647         (MemberCache): When creating the MemberCache for a class, get
14648         members from the current class and all its base classes.
14649         (MemberCache.CacheEntry.Container): New field.  This is a
14650         temporary hack until the Mono runtime is fixed to distinguish
14651         between ReflectedType and DeclaringType.  It allows us to use MCS
14652         with both the MS runtime and the unfixed Mono runtime without
14653         problems and without accecting performance.
14654         (MemberCache.SearchMembers): The DeclaredOnly looping from
14655         TypeManager.MemberLookup is now done here.      
14656
14657 2002-08-14  Martin Baulig  <martin@gnome.org>
14658
14659         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14660         Type.GetFields on dynamic types but get the fields from the
14661         corresponding TypeContainer.
14662         (MyStructInfo.GetStructInfo): Added check for enum types.
14663
14664         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14665         (MemberList.SyncRoot): Implemented.
14666         (TypeManager.FilterWithClosure): No need to check permissions if
14667         closure_start_type == closure_invocation_type, don't crash if
14668         closure_invocation_type is null.
14669
14670 2002-08-13  Martin Baulig  <martin@gnome.org>
14671
14672         Rewrote TypeContainer.FindMembers to use a member cache.  This
14673         gives us a speed increase of about 35% for the self-hosting MCS
14674         build and of about 15-20% for the class libs (both on GNU/Linux).
14675
14676         * report.cs (Timer): New class to get enhanced profiling.  This
14677         whole class is "TIMER" conditional since it remarkably slows down
14678         compilation speed.
14679
14680         * class.cs (MemberList): New class.  This is an IList wrapper
14681         which we're now using instead of passing MemberInfo[]'s around to
14682         avoid copying this array unnecessarily.
14683         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14684         (ICachingMemberFinder, IMemberContainer): New interface.
14685         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14686         has already been checked, otherwise use it for the name comparision.
14687         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14688         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14689         if possible.  Returns a MemberList, not a MemberInfo [].
14690         (TypeHandle): New class, implements IMemberContainer.  We create
14691         one instance of this class per type, it contains a MemberCache
14692         which is used to do the member lookups.
14693         (MemberCache): New class.  Each instance of this class contains
14694         all members of a type and a name-based hash table.
14695         (MemberCache.FindMembers): This is our new member lookup
14696         function.  First, it looks up all members of the requested name in
14697         the hash table.  Then, it walks this list and sorts out all
14698         applicable members and returns them.
14699
14700 2002-08-13  Martin Baulig  <martin@gnome.org>
14701
14702         In addition to a nice code cleanup, this gives us a performance
14703         increase of about 1.4% on GNU/Linux - not much, but it's already
14704         half a second for the self-hosting MCS compilation.
14705
14706         * typemanager.cs (IMemberFinder): New interface.  It is used by
14707         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14708         Enum, Delegate or Interface.
14709         (TypeManager.finder_to_member_finder): New PtrHashtable.
14710         (TypeManager.finder_to_container): Removed.
14711         (TypeManager.finder_to_delegate): Removed.
14712         (TypeManager.finder_to_interface): Removed.
14713         (TypeManager.finder_to_enum): Removed.
14714
14715         * interface.cs (Interface): Implement IMemberFinder.
14716
14717         * delegate.cs (Delegate): Implement IMemberFinder.
14718
14719         * enum.cs (Enum): Implement IMemberFinder.
14720
14721         * class.cs (TypeContainer): Implement IMemberFinder.
14722
14723 2002-08-12  Martin Baulig  <martin@gnome.org>
14724
14725         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14726
14727 2002-08-12  Martin Baulig  <martin@gnome.org>
14728
14729         * ecore.cs (ITypeExpression): New interface for expressions which
14730         resolve to a type.
14731         (TypeExpression): Renamed to TypeLookupExpression.
14732         (Expression.DoResolve): If we're doing a types-only lookup, the
14733         expression must implement the ITypeExpression interface and we
14734         call DoResolveType() on it.
14735         (SimpleName): Implement the new ITypeExpression interface.
14736         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14737         hack, the situation that we're only looking up types can't happen
14738         anymore when this method is called.  Moved the type lookup code to
14739         DoResolveType() and call it.
14740         (SimpleName.DoResolveType): This ITypeExpression interface method
14741         is now doing the types-only lookup.
14742         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14743         (ResolveFlags): Added MaskExprClass.
14744
14745         * expression.cs (MemberAccess): Implement the ITypeExpression
14746         interface.
14747         (MemberAccess.DoResolve): Added support for a types-only lookup
14748         when we're called via ITypeExpression.DoResolveType().
14749         (ComposedCast): Implement the ITypeExpression interface.
14750
14751         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14752         Expression.Resolve() with ResolveFlags.Type instead.
14753
14754 2002-08-12  Martin Baulig  <martin@gnome.org>
14755
14756         * interface.cs (Interface.Define): Apply attributes.
14757
14758         * attribute.cs (Attribute.ApplyAttributes): Added support for
14759         interface attributes.
14760
14761 2002-08-11  Martin Baulig  <martin@gnome.org>
14762
14763         * statement.cs (Block.Emit): Only check the "this" variable if we
14764         do not always throw an exception.
14765
14766         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14767         whether the property has a set accessor.
14768
14769 2002-08-11  Martin Baulig  <martin@gnome.org>
14770
14771         Added control flow analysis support for structs.
14772
14773         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14774         with control flow analysis turned off.
14775         (IVariable): New interface.
14776         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14777         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14778         (FieldExpr.DoResolve): Resolve the instance expression with flow
14779         analysis turned off and do the definite assignment check after the
14780         resolving when we know what the expression will resolve to.
14781
14782         * expression.cs (LocalVariableReference, ParameterReference):
14783         Implement the new IVariable interface, only call the flow analysis
14784         code if ec.DoFlowAnalysis is true.
14785         (This): Added constructor which takes a Block argument.  Implement
14786         the new IVariable interface.
14787         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14788         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14789         This does the definite assignment checks for struct members.
14790
14791         * class.cs (Constructor.Emit): If this is a non-static `struct'
14792         constructor which doesn't have any initializer, call
14793         Block.AddThisVariable() to tell the flow analysis code that all
14794         struct elements must be initialized before control returns from
14795         the constructor.
14796
14797         * statement.cs (MyStructInfo): New public class.
14798         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14799         argument to this indexer.  If non-zero, check an individual struct
14800         member, not the whole struct.
14801         (FlowBranching.CheckOutParameters): Check struct members.
14802         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14803         overloaded versions of these methods which take an additional
14804         `int field_idx' argument to check struct members.
14805         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14806         overloaded versions of these methods which take an additional
14807         `string field_name' argument to check struct member.s
14808         (VariableInfo): Implement the IVariable interface.
14809         (VariableInfo.StructInfo): New public property.  Returns the
14810         MyStructInfo instance of the variable if it's a struct or null.
14811         (Block.AddThisVariable): New public method.  This is called from
14812         Constructor.Emit() for non-static `struct' constructor which do
14813         not have any initializer.  It creates a special variable for the
14814         "this" instance variable which will be checked by the flow
14815         analysis code to ensure that all of the struct's fields are
14816         initialized before control returns from the constructor.
14817         (UsageVector): Added support for struct members.  If a
14818         variable/parameter is a struct with N members, we reserve a slot
14819         in the usage vector for each member.  A struct is considered fully
14820         initialized if either the struct itself (slot 0) or all its
14821         members are initialized.
14822
14823 2002-08-08  Martin Baulig  <martin@gnome.org>
14824
14825         * driver.cs (Driver.MainDriver): Only report an error CS5001
14826         if there were no compilation errors.
14827
14828         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14829         `UnsafeContext' property to determine whether the parent is in
14830         unsafe context rather than checking the parent's ModFlags:
14831         classes nested in an unsafe class are unsafe as well.
14832
14833 2002-08-08  Martin Baulig  <martin@gnome.org>
14834
14835         * statement.cs (UsageVector.MergeChildren): Distinguish between
14836         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14837         we return.  Added test17() and test18() to test-154.cs.
14838
14839 2002-08-08  Martin Baulig  <martin@gnome.org>
14840
14841         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14842         Family access, make sure the invoking type isn't a subclass of the
14843         queried type (that'd be a CS1540).
14844
14845         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14846         this method which takes an additional `Type invocation_type'.
14847
14848         * expression.cs (BaseAccess.DoResolve): Use the base type as
14849         invocation and query type.
14850         (MemberAccess.DoResolve): If the lookup failed and we're about to
14851         report a CS0122, try a lookup with the ec.ContainerType - if this
14852         succeeds, we must report a CS1540.
14853
14854 2002-08-08  Martin Baulig  <martin@gnome.org>
14855
14856         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14857         (MethodGroupExpr): Implement the IMemberExpr interface.
14858
14859         * expression (MemberAccess.ResolveMemberAccess): No need to have
14860         any special code for MethodGroupExprs anymore, they're now
14861         IMemberExprs.   
14862
14863 2002-08-08  Martin Baulig  <martin@gnome.org>
14864
14865         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14866         Family, FamANDAssem and FamORAssem permissions.
14867         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14868
14869 2002-08-08  Martin Baulig  <martin@gnome.org>
14870
14871         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14872         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14873         or loop block.
14874
14875 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14876
14877         * driver.cs: implemented /resource option to embed managed resources.
14878
14879 2002-08-07  Martin Baulig  <martin@gnome.org>
14880
14881         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14882         (FieldBase.HasFieldInitializer): New public property.
14883         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14884         returns the field initializer and makes sure it is only resolved once.
14885         (TypeContainer.EmitFieldInitializers): Call
14886         FieldBase.GetInitializerExpression to get the initializer, this ensures
14887         that it isn't resolved multiple times.
14888
14889         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14890         the resolving process (SimpleName/MemberLookup) that we're currently
14891         emitting a field initializer (which must not access any instance members,
14892         this is an error CS0236).
14893
14894         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14895         argument, if the `IsFieldInitializer' flag is set, we must report and
14896         error CS0236 and not an error CS0120.   
14897
14898 2002-08-07  Martin Baulig  <martin@gnome.org>
14899
14900         * ecore.cs (IMemberExpr): New public interface.
14901         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14902         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14903         if the expression is an IMemberExpr.
14904
14905         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14906         to be null, implicitly default to `this' if we're non-static in
14907         this case.  Simplified the code a lot by using the new IMemberExpr
14908         interface.  Also fixed bug #28176 here.
14909
14910 2002-08-06  Martin Baulig  <martin@gnome.org>
14911
14912         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14913         ParameterReferences during semantic analysis so that we can do a
14914         type-only search when resolving Cast, TypeOf and SizeOf.
14915         (block): Pass the `current_local_parameters' to the Block's
14916         constructor.
14917
14918         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14919         argument to the constructor.
14920         (ConstructorInitializer.Resolve): Create a temporary implicit
14921         block with the parameters.
14922
14923         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14924         references here if we aren't doing a type-only search.
14925
14926         * statement.cs (Block): Added constructor which takes a
14927         `Parameters parameters' argument.
14928         (Block.Parameters): New public property.
14929
14930         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14931         to `Parameters' and made it public readonly.
14932
14933 2002-08-06  Martin Baulig  <martin@gnome.org>
14934
14935         * ecore.cs (Expression.Warning): Made this public as well.
14936
14937         * report.cs (Report.Debug): Print the contents of collections.
14938
14939 2002-08-06  Martin Baulig  <martin@gnome.org>
14940
14941         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14942         used to tell Resolve() which kinds of expressions it may return.
14943         (Expression.Resolve): Added overloaded version of this method which
14944         takes a `ResolveFlags flags' argument.  This can be used to tell
14945         Resolve() which kinds of expressions it may return.  Reports a
14946         CS0118 on error.
14947         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14948         ResolveFlags.SimpleName.
14949         (Expression.Error118): Added overloaded version of this method which
14950         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14951         which kinds of expressions are allowed.
14952
14953         * expression.cs (Argument.ResolveMethodGroup): New public method.
14954         Resolves an argument, but allows a MethodGroup to be returned.
14955         This is used when invoking a delegate.
14956
14957         * TODO: Updated a bit.
14958
14959 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14960
14961         Fixed compilation with csc.
14962
14963         * ecore.cs: Expression.Error made public. Is this correct? Should
14964         Warning be made public too?
14965
14966         * expression.cs: use ea.Location instead of ea.loc.
14967         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14968
14969 2002-08-06  Martin Baulig  <martin@gnome.org>
14970
14971         * ecore.cs (Expression.loc): Moved the location here instead of
14972         duplicating it in all derived classes.
14973         (Expression.Location): New public property.
14974         (Expression.Error, Expression.Warning): Made them non-static and
14975         removed the location argument.
14976         (Expression.Warning): Added overloaded version which takes an
14977         `int level' argument.
14978         (Expression.Error118): Make this non-static and removed the
14979         expression and location arguments.
14980         (TypeExpr): Added location argument to the constructor.
14981
14982         * expression.cs (StaticCallExpr): Added location argument to
14983         the constructor.
14984         (Indirection, PointerArithmetic): Likewise.
14985         (CheckedExpr, UnCheckedExpr): Likewise.
14986         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14987         (StringPtr): Likewise.
14988
14989
14990 2002-08-05  Martin Baulig  <martin@gnome.org>
14991
14992         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14993
14994         * assign.cs (Assign.DoResolve): Check whether the source
14995         expression is a value or variable.
14996
14997         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14998         while resolving the corresponding blocks.
14999
15000         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15001         an error, don't silently return null.
15002
15003         * statement.cs (Block.AddVariable): Do the error reporting here
15004         and distinguish between CS0128 and CS0136.
15005         (Block.DoResolve): Report all unused labels (warning CS0164).
15006         (LabeledStatement): Pass the location to the constructor.
15007         (LabeledStatement.HasBeenReferenced): New property.
15008         (LabeledStatement.Resolve): Set it to true here.
15009
15010         * statement.cs (Return.Emit): Return success even after reporting
15011         a type mismatch error (CS0126 or CS0127), this is what csc does and
15012         it avoids confusing the users with any consecutive errors.
15013
15014 2002-08-05  Martin Baulig  <martin@gnome.org>
15015
15016         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15017
15018         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15019
15020         * expression.cs (MemberAccess.DoResolve): Silently return if an
15021         error has already been reported.
15022
15023         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15024         error has already been reported.
15025
15026 2002-08-05  Martin Baulig  <martin@gnome.org>
15027
15028         * statement.cs (UsageVector): Only initialize the `parameters'
15029         vector if we actually have any "out" parameters.
15030
15031 2002-08-05  Martin Baulig  <martin@gnome.org>
15032
15033         * expression.cs (Binary.ResolveOperator): When combining delegates,
15034         they must have the same type.
15035
15036 2002-08-05  Martin Baulig  <martin@gnome.org>
15037
15038         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15039         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15040         work with the ms runtime and we also don't need it: if we're a
15041         PropertyBuilder and not in the `indexer_arguments' hash, then we
15042         are a property and not an indexer.
15043
15044         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15045         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15046         since the latter one doesn't work with the ms runtime.
15047
15048 2002-08-03  Martin Baulig  <martin@gnome.org>
15049
15050         Fixed bugs #27998 and #22735.
15051
15052         * class.cs (Method.IsOperator): New public field.
15053         (Method.CheckBase): Report CS0111 if there's already a method
15054         with the same parameters in the current class.  Report CS0508 when
15055         attempting to change the return type of an inherited method.
15056         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15057         and it's not marked abstract or extern.
15058         (PropertyBase): New abstract base class for Property and Indexer.
15059         (PropertyBase.CheckBase): Moved here from Property and made it work
15060         for indexers.
15061         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15062         the same so we can reuse it there.
15063         (Property, Indexer): Derive from PropertyBase.
15064         (MethodSignature.inheritable_property_signature_filter): New delegate
15065         to find properties and indexers.
15066
15067         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15068         argument and improved error reporting.
15069
15070         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15071         EmptyReadOnlyParameters and made it a property.
15072
15073         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15074         version of this method which takes a `PropertyInfo indexer'.
15075         (TypeManager.RegisterIndexer): New method.
15076
15077         * class.cs: Added myself as author of this file :-)
15078
15079 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15080
15081         * class.cs: fixed compilation on windoze.
15082
15083 2002-08-03  Martin Baulig  <martin@gnome.org>
15084
15085         * interface.cs (Interface.GetInterfaceBases): Check whether all
15086         base interfaces are at least as accessible than the current one.
15087
15088         * class.cs (TypeContainer.GetClassBases): Check whether base types
15089         are at least as accessible than the current type.
15090         (TypeContainer.AsAccessible): Implemented and made non-static.
15091         (MemberBase.CheckParameters): Report errors if the accessibility
15092         checks fail.
15093
15094         * delegate.cs (Delegate.Delegate): The default visibility is
15095         internal for top-level types and private for nested types.
15096         (Delegate.Define): Report errors if the accessibility checks fail.
15097
15098         * enum.cs (Enum.Enum): The default visibility is internal for
15099         top-level types and private for nested types.
15100         (Enum.DefineType): Compute the correct visibility.
15101
15102         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15103         function which takes a `bool is_toplevel' instead of a TypeContainer.
15104
15105         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15106         builtin type.
15107
15108 2002-08-02  Martin Baulig  <martin@gnome.org>
15109
15110         * expression.cs (LocalVariableReferenc): Added constructor which
15111         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15112         (LocalVariableReference.IsReadOnly): New property.
15113         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15114         variable is readonly, use our own readonly flag to do this; you can
15115         use the new constructor to get a writable reference to a read-only
15116         variable.
15117
15118         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15119         reference to the local variable.
15120
15121 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * rootcontext.cs (ResolveCore): Also include System.Exception
15124
15125         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15126         we reach an EmptyStatement.
15127
15128         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15129         is also fine.
15130
15131         * expression.cs (Binary.ResolveOperator): Check error result in
15132         two places.
15133
15134         use brtrue/brfalse directly and avoid compares to null.
15135
15136 2002-08-02  Martin Baulig  <martin@gnome.org>
15137
15138         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15139         Fixes bug #28407, added test-155.cs.
15140
15141 2002-08-01  Martin Baulig  <martin@gnome.org>
15142
15143         * class.cs (Event.EmitDefaultMethod): Make this work with static
15144         events.  Fixes #28311, added verify-3.cs.
15145
15146 2002-08-01  Martin Baulig  <martin@gnome.org>
15147
15148         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15149         `is_disposable' fields.
15150         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15151         `hm.is_disposable' if we're using the collection pattern.
15152         (Foreach.EmitCollectionForeach): Use the correct type for the
15153         enumerator's local variable, only emit the try/finally block if
15154         necessary (fixes #27713).
15155
15156 2002-08-01  Martin Baulig  <martin@gnome.org>
15157
15158         * ecore.cs (Expression.report118): Renamed to Error118 and made
15159         it public static.
15160
15161         * statement.cs (Throw.Resolve): Check whether the expression is of
15162         the correct type (CS0118) and whether the type derives from
15163         System.Exception (CS0155).
15164         (Catch.Resolve): New method.  Do the type lookup here and check
15165         whether it derives from System.Exception (CS0155).
15166         (Catch.CatchType, Catch.IsGeneral): New public properties.
15167
15168         * typemanager.cs (TypeManager.exception_type): Added.
15169
15170 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15171
15172         * driver.cs: Updated About function.
15173
15174 2002-07-31  Martin Baulig  <martin@gnome.org>
15175
15176         Implemented Control Flow Analysis.
15177
15178         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15179         (EmitContext.CurrentBranching): Added.
15180         (EmitContext.StartFlowBranching): Added.
15181         (EmitContext.EndFlowBranching): Added.
15182         (EmitContext.KillFlowBranching): Added.
15183         (EmitContext.IsVariableAssigned): Added.
15184         (EmitContext.SetVariableAssigned): Added.
15185         (EmitContext.IsParameterAssigned): Added.
15186         (EmitContext.SetParameterAssigned): Added.
15187         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15188         Added control flow analysis stuff here.
15189
15190         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15191         resolve the expression as lvalue.
15192         (LocalVariableReference.DoResolve): Check whether the variable has
15193         already been assigned.
15194         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15195         the parameter as assigned here.
15196         (ParameterReference.DoResolve): Check whether the parameter has already
15197         been assigned.
15198         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15199         expression as lvalue.
15200
15201         * statement.cs (FlowBranching): New class for the flow analysis code.
15202         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15203         (LabeledStatement.IsDefined): New public property.
15204         (LabeledStatement.AddUsageVector): New public method to tell flow
15205         analyis that the label may be reached via a forward jump.
15206         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15207         flow analysis.
15208         (VariableInfo.Number): New public field.  This is used by flow analysis
15209         to number all locals of a block.
15210         (Block.CountVariables): New public property.  This is the number of
15211         local variables in this block (including the locals from all parent
15212         blocks).
15213         (Block.EmitMeta): Number all the variables.
15214
15215         * statement.cs: Added flow analysis support to all classes.
15216
15217 2002-07-31  Martin Baulig  <martin@gnome.org>
15218
15219         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15220         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15221         then use this argument.
15222
15223         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15224
15225         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15226         use this to specify /define options.
15227
15228 2002-07-29  Martin Baulig  <martin@gnome.org>
15229
15230         * statement.cs (Fixed): Moved all code that does variable lookups
15231         and resolvings from Emit to Resolve.
15232
15233         * statement.cs (For): Moved all code that does variable lookups
15234         and resolvings from Emit to Resolve.
15235
15236         * statement.cs (Using): Moved all code that does variable lookups
15237         and resolvings from Emit to Resolve.
15238
15239 2002-07-29  Martin Baulig  <martin@gnome.org>
15240
15241         * attribute.cs (Attribute.Resolve): Explicitly catch a
15242         System.NullReferenceException when creating the
15243         CustromAttributeBuilder and report a different warning message.
15244
15245 2002-07-29  Martin Baulig  <martin@gnome.org>
15246
15247         * support.cs (ParameterData.ParameterName): Added method to
15248         get the name of a parameter.
15249
15250         * typemanager.cs (TypeManager.IsValueType): New public method.
15251
15252 2002-07-29  Martin Baulig  <martin@gnome.org>
15253
15254         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15255         is a flag which specifies that it's either ref or out.
15256         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15257         the out parameter to `out Parameter.Modifier mod', also set the
15258         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15259
15260         * support.cs (InternalParameters.ParameterModifier): Distinguish
15261         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15262         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15263
15264         * expression.cs (Argument.GetParameterModifier): Distinguish
15265         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15266         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15267
15268 2002-07-29  Martin Baulig  <martin@gnome.org>
15269
15270         * expression.cs (ParameterReference.ParameterReference): Added
15271         `Location loc' argument to the constructor.
15272
15273         * cs-parser.jay: Pass location to ParameterReference.
15274
15275 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15276
15277         * statement.cs (Try): Initialize the location.
15278
15279         * cs-parser.jay: pass location to Try.
15280
15281         * expression.cs (Unary.Reduce): Change the prototype to return
15282         whether a constant fold could be performed or not.  The result is
15283         returned in an out parameters.  In the case of Indirection and
15284         AddressOf, we want to perform the full tests.
15285
15286 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15287
15288         * statement.cs (Statement.Emit): Flag dead code.
15289
15290 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15291
15292         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15293
15294 2002-07-27  Martin Baulig  <martin@gnome.org>
15295
15296         * class.cs (MethodData.Define): Put back call to
15297         TypeManager.AddMethod(), accidentally commented this out.
15298
15299         * report.cs (Debug): New public method to print debugging information,
15300         this is `[Conditional ("DEBUG")]'.
15301
15302 2002-07-26  Martin Baulig  <martin@gnome.org>
15303
15304         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15305         (switch_statement): Push the current_block to the switch_stack and
15306         pop it again when we're done with the switch.
15307         (switch_section): The new block is a child of the current_block.
15308         Fixes bug #24007, added test-152.cs.
15309
15310 2002-07-27  Martin Baulig  <martin@gnome.org>
15311
15312         * expression.cs (Invocation.EmitArguments): When calling a varargs
15313         function with only its fixed arguments, we need to pass an empty
15314         array.
15315
15316 2002-07-27  Martin Baulig  <martin@gnome.org>
15317
15318         Mono 0.13 has been released.
15319
15320 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15321
15322         * driver.cs: Rename --resource to --linkres, because that is what
15323         we do currently, we dont support --resource yet.
15324
15325         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15326
15327 2002-07-25  Martin Baulig  <martin@gnome.org>
15328
15329         * class.cs (MethodData): New public class.  This is a `method builder'
15330         class for a method or one accessor of a Property/Indexer/Event.
15331         (MethodData.GetMethodFlags): Moved here from MemberBase.
15332         (MethodData.ApplyAttributes): Likewise.
15333         (MethodData.ApplyObsoleteAttribute): Likewise.
15334         (MethodData.ApplyConditionalAttribute): Likewise.
15335         (MethodData.ApplyDllImportAttribute): Likewise.
15336         (MethodData.CheckAbstractAndExternal): Likewise.
15337         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15338         (MethodData.Emit): Formerly known as Method.Emit().
15339         (MemberBase): Moved everything which was specific to a single
15340         accessor/method to MethodData.
15341         (Method): Create a new MethodData and call Define() and Emit() on it.
15342         (Property, Indexer, Event): Create a new MethodData objects for each
15343         accessor and call Define() and Emit() on them.
15344
15345 2002-07-25  Martin Baulig  <martin@gnome.org>
15346
15347         Made MethodCore derive from MemberBase to reuse the code from there.
15348         MemberBase now also checks for attributes.
15349
15350         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15351         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15352         as virtual.
15353         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15354         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15355         (MemberBase.ApplyAttributes): New virtual method; applies the
15356         attributes to a method or accessor.
15357         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15358         (MemberBase.ApplyConditionalAttribute): Likewise.
15359         (MemberBase.ApplyDllImportAttribute): Likewise.
15360         (MemberBase.CheckAbstractAndExternal): Likewise.
15361         (MethodCore.ParameterTypes): This is now a property instead of a
15362         method, it's initialized from DoDefineParameters().
15363         (MethodCore.ParameterInfo): Removed the set accessor.
15364         (MethodCore.DoDefineParameters): New protected virtual method to
15365         initialize ParameterTypes and ParameterInfo.
15366         (Method.GetReturnType): We can now simply return the MemberType.
15367         (Method.GetMethodFlags): Override the MemberBase version and add
15368         the conditional flags.
15369         (Method.CheckBase): Moved some code from Define() here, call
15370         DoDefineParameters() here.
15371         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15372         here to avoid some larger code duplication.
15373         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15374         ensure that abstract and external accessors don't declare a body.
15375
15376         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15377         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15378         lookup in the attribute's parent classes, so we need to abort as soon
15379         as we found the first match.
15380         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15381         the attribute has no arguments.
15382
15383         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15384         of a Method.
15385
15386 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15387
15388         * cs-parser.jay: reverted previous patch.
15389
15390 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15391
15392         * cs-parser.jay: fixed bug #22119.
15393
15394 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15395
15396         * attribute.cs: fixed compilation. The error was:
15397         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15398         be assigned to before control leaves the current method."
15399         [FIXME:  Filed as bug #28186: MCS must report this error.]
15400
15401 2002-07-25  Martin Baulig  <martin@gnome.org>
15402
15403         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15404         method to pull the condition name ouf of a Conditional attribute.
15405         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15406         the obsolete message and error flag out of an Obsolete attribute.
15407
15408         * class.cs (Method.GetMethodFlags): New public method to get the
15409         TypeManager.MethodFlags for this method.
15410         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15411         private methods.
15412         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15413         if we're overriding a virtual function, set the new private variable
15414         `parent_method'; call the new TypeManager.AddMethod().
15415
15416         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15417         the MethodBuilder and the Method in a PtrHashtable.
15418         (TypeManager.builder_to_method): Added for this purpose.
15419         (TypeManager.MethodFlags): Added IsObsoleteError.
15420         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15421         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15422         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15423         the message from the attribute.
15424
15425 2002-07-24  Martin Baulig  <martin@gnome.org>
15426
15427         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15428         preprocessor directives, ensure that the argument to #define/#undef is
15429         exactly one identifier and that it's actually an identifier.
15430
15431         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15432         did not work ....
15433
15434 2002-07-24  Martin Baulig  <martin@gnome.org>
15435
15436         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15437         initialize it to TypeManager.object_type in the constructor.
15438         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15439         of the `hm.get_current' method if we're using the collection pattern.
15440         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15441         for the explicit conversion to make it work when we're using the collection
15442         pattern and the `Current' property has a different return type than `object'.
15443         Fixes #27713.
15444
15445 2002-07-24  Martin Baulig  <martin@gnome.org>
15446
15447         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15448         does not match, but don't report any errors.  This method is called in
15449         order for all methods in a MethodGroupExpr until a matching method is
15450         found, so we don't want to bail out if the first method doesn't match.
15451         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15452         matches, report the 123.  Fixes #28070.
15453
15454 2002-07-24  Martin Baulig  <martin@gnome.org>
15455
15456         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15457         TypeManager.TypeToCoreType() to the top of the method so the
15458         following equality checks will work.  Fixes #28107.
15459
15460 2002-07-24  Martin Baulig  <martin@gnome.org>
15461
15462         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15463         operand is of type uint, and the other operand is of type sbyte,
15464         short or int, the operands are converted to type long." -
15465         Actually do what this comment already told us.  Fixes bug #28106,
15466         added test-150.cs.
15467
15468 2002-07-24  Martin Baulig  <martin@gnome.org>
15469
15470         * class.cs (MethodBase): New abstract class.  This is now a base
15471         class for Property, Indexer and Event to avoid some code duplication
15472         in their Define() and DefineMethods() methods.
15473         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15474         generic methods for Define() and DefineMethods().
15475         (FieldBase): Derive from MemberBase, not MemberCore.
15476         (Property): Derive from MemberBase, not MemberCore.
15477         (Property.DefineMethod): Moved all the code from this method to the
15478         new MethodBase.DefineAccessor(), just call it with appropriate
15479         argumetnts.
15480         (Property.Define): Call the new Property.DoDefine(), this does some
15481         sanity checks and we don't need to duplicate the code everywhere.
15482         (Event): Derive from MemberBase, not MemberCore.
15483         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15484         accessors, this will also make them work with interface events.
15485         (Indexer): Derive from MemberBase, not MemberCore.
15486         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15487         (Indexer.Define): Use the new MethodBase functions.
15488
15489         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15490         argument to the constructor.
15491         (Interface.FindMembers): Added support for interface events.
15492         (Interface.PopluateEvent): Implemented.
15493
15494         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15495
15496 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15497
15498         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15499         but this is required to check for a method name being the same as
15500         the containing class.  
15501
15502         Handle this now.
15503
15504 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15505
15506         * interface.cs: initialize variable.
15507
15508 2002-07-23  Martin Baulig  <martin@gnome.org>
15509
15510         Implemented the IndexerName attribute in interfaces.
15511
15512         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15513         name if this is an explicit interface implementation.
15514         (Indexer.InterfaceIndexerName): New public variable.  If we're
15515         implementing an interface indexer, this is the IndexerName in that
15516         interface.  Otherwise, it's the IndexerName.
15517         (Indexer.DefineMethod): If we're implementing interface indexer,
15518         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15519         and Pending.ImplementIndexer methods.
15520         (Indexer.Define): Also define the PropertyBuilder if we're
15521         implementing an interface indexer and this is neither an explicit
15522         interface implementation nor do the IndexerName match the one in
15523         the interface.
15524
15525         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15526         If a method is defined here, then we always need to create a proxy
15527         for it.  This is used when implementing interface indexers.
15528         (Pending.IsInterfaceIndexer): New public method.
15529         (Pending.ImplementIndexer): New public method.
15530         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15531         This is used when implementing interface indexers to define a proxy
15532         if necessary.
15533         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15534         define a proxy if necessary.
15535
15536         * interface.cs (Interface.IndexerName): New public variable.
15537         (Interface.PopulateIndexer): Set the IndexerName.
15538         (Interface.DefineIndexers): New private method.  Populate all the
15539         indexers and make sure their IndexerNames match.
15540
15541         * typemanager.cs (IndexerPropertyName): Added support for interface
15542         indexers.
15543
15544 2002-07-22  Martin Baulig  <martin@gnome.org>
15545
15546         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15547         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15548         ret if HasReturnLabel.
15549         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15550         variables.
15551
15552         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15553         and set the ec.LoopBeginTryCatchLevel.
15554         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15555         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15556         the current ec.TryCatchLevel, the branch goes out of an exception
15557         block.  In this case, we need to use Leave and not Br.
15558
15559 2002-07-22  Martin Baulig  <martin@gnome.org>
15560
15561         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15562         block unless the block does not always return or it is contained in
15563         another try { ... } catch { ... } block.  Fixes bug #26506.
15564         Added verify-1.cs to the test suite.
15565
15566 2002-07-22  Martin Baulig  <martin@gnome.org>
15567
15568         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15569         then we do not always return.  Fixes bug #24985.
15570
15571 2002-07-22  Martin Baulig  <martin@gnome.org>
15572
15573         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15574         lookup on a per-class level; ie. walk up the class hierarchy until we
15575         found at least one applicable method, then choose the best among them.
15576         Fixes bug #24463 and test-29.cs.
15577
15578 2002-07-22  Martin Baulig  <martin@gnome.org>
15579
15580         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15581         return types of the methods.  The return type is not part of the
15582         signature and we must not check it to make the `new' modifier work.
15583         Fixes bug #27999, also added test-147.cs.
15584         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15585
15586         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15587         on the method's return type.
15588
15589 2002-07-21  Martin Baulig  <martin@gnome.org>
15590
15591         * assign.cs: Make this work if the rightmost source is a constant and
15592         we need to do an implicit type conversion.  Also adding a few more tests
15593         to test-38.cs which should have caught this.
15594
15595         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15596         target in the makefile for this.  The makefile.gnu is primarily intended
15597         for end-users who don't want to debug the compiler.
15598
15599 2002-07-21  Martin Baulig  <martin@gnome.org>
15600
15601         * assign.cs: Improved the Assign class so it can now handle embedded
15602         assignments (X = Y = Z = something).  As a side-effect this'll now also
15603         consume less local variables.  test-38.cs now passes with MCS, added
15604         a few new test cases to that test.
15605
15606 2002-07-20  Martin Baulig  <martin@gnome.org>
15607
15608         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15609         instructions.  Fixes bug #27977, also added test-146.cs.
15610
15611 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15612
15613         * cs-tokenizer.cs: fixed getHex ().
15614
15615 2002-07-19  Martin Baulig  <martin@gnome.org>
15616
15617         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15618         not Type.GetType() to lookup the array type.  This is needed when
15619         we're constructing an array of a user-defined type.
15620         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15621         single-dimensional arrays, but also for single-dimensial arrays of
15622         type decimal.
15623
15624 2002-07-19  Martin Baulig  <martin@gnome.org>
15625
15626         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15627         this function is called, it's not allowed to share LocalBuilders
15628         among ILGenerators.
15629
15630 2002-07-19  Martin Baulig  <martin@gnome.org>
15631
15632         * expression.cs (Argument.Resolve): Report an error 118 when trying
15633         to pass a type as argument.
15634
15635 2002-07-18  Martin Baulig  <martin@gnome.org>
15636
15637         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15638         Conv_R_Un for the signed `long' type.
15639
15640 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15643         `expr' for the temporary result, as that will fail if we do
15644         multiple resolves on the same expression.
15645
15646 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15647
15648         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15649         ec.TypeContainer for looking up aliases. 
15650
15651         * class.cs (TypeContainer): Remove LookupAlias from here.
15652
15653         * decl.cs (DeclSpace); Move here.
15654
15655 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15656
15657         * class.cs (FindMembers): Only call filter if the constructor
15658         bulider is not null.
15659
15660         Also handle delegates in `NestedTypes' now.  Now we will perform
15661         type lookups using the standard resolution process.  This also
15662         fixes a bug.
15663
15664         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15665         This uses Expressions (the limited kind that can be parsed by the
15666         tree) instead of strings.
15667
15668         * expression.cs (ComposedCast.ToString): Implement, used to flag
15669         errors since now we have to render expressions.
15670
15671         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15672         FormArrayType. 
15673
15674         * ecore.cs (SimpleName.ToString): ditto.
15675
15676         * cs-parser.jay: Instead of using strings to assemble types, use
15677         Expressions to assemble the type (using SimpleName, ComposedCast,
15678         MemberAccess).  This should fix the type lookups in declarations,
15679         because we were using a different code path for this.
15680
15681         * statement.cs (Block.Resolve): Continue processing statements
15682         even when there is an error.
15683
15684 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15685
15686         * class.cs (Event.Define): Also remove the `remove' method from
15687         the list of pending items.
15688
15689         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15690         generate more compact code. 
15691
15692 2002-07-17  Martin Baulig  <martin@gnome.org>
15693
15694         * const.cs (Const.LookupConstantValue): Add support for constant
15695         `unchecked' and `checked' expressions.
15696         Also adding test case test-140.cs for this.
15697
15698 2002-07-17  Martin Baulig  <martin@gnome.org>
15699
15700         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15701         check whether mi.ReturnType implements the IEnumerator interface; the
15702         `==' and the IsAssignableFrom() will fail in this situation.
15703
15704 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15705
15706         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15707         here too.
15708
15709 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15710
15711         * expression.cs: fixed bug #27811.
15712
15713 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15714
15715         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15716         Molaro: when we are a ref, the value already contains a pointer
15717         value, do not take the address of it.
15718
15719 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15720         * removed mb-parser.jay and mb-tokenizer.cs
15721
15722 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15723
15724         * expression.cs: check against the building corlib void type.
15725
15726 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15727
15728         * ecore.cs: fix for valuetype static readonly fields: when 
15729         initializing them, we need their address, not the address of a copy.
15730
15731 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15732
15733         * typemanager.cs: register also enum_type in corlib.
15734
15735 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15736
15737         * class.cs: allow calling this (but not base) initializers in structs.
15738
15739 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15740
15741         * ecore.cs: make sure we compare against the building base types
15742         in GetTypeSize ().
15743
15744 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15745
15746         * typemanager.cs: fix TypeToCoreType() to handle void and object
15747         (corlib gets no more typerefs after this change).
15748
15749 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15750
15751         * expression.cs (ArrayCreation.EmitArrayArguments): use
15752         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15753
15754         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15755         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15756         array indexes, the runtime actually forbids them.
15757
15758         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15759         for array arguments here.
15760
15761         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15762         instead of the default for ValueTypes.
15763
15764         (New.DoEmit): Use IsValueType instead of
15765         IsSubclassOf (value_type)
15766         (New.DoResolve): ditto.
15767         (Invocation.EmitCall): ditto.
15768
15769         * assign.cs (Assign): ditto.
15770
15771         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15772         Statements *are* currently doing part of their resolution during
15773         Emit.  
15774
15775         Expressions do always resolve during resolve, but statements are
15776         only required to propagate resolution to their children.
15777
15778 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15779
15780         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15781
15782         (LoadAssembly): Do not add the dll if it is already specified
15783
15784         (MainDriver): Add the System directory to the link path at the end,
15785         after all the other -L arguments. 
15786
15787         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15788         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15789         ldelem.u1) and using the opposite for sbytes.
15790
15791         This fixes Digger, and we can finally run it.
15792
15793         * driver.cs (UnixParseOption): Move the option parsing here.  
15794         (CSCParseOption): Implement CSC-like parsing of options.
15795
15796         We now support both modes of operation, the old Unix way, and the
15797         new CSC-like way.  This should help those who wanted to make cross
15798         platform makefiles.
15799
15800         The only thing broken is that /r:, /reference: and /lib: are not
15801         implemented, because I want to make those have the same semantics
15802         as the CSC compiler has, and kill once and for all the confussion
15803         around this.   Will be doing this tomorrow.
15804
15805         * statement.cs (Unsafe.Resolve): The state is checked during
15806         resolve, not emit, so we have to set the flags for IsUnsfe here.
15807
15808 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15809
15810         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15811         not catch the Error_ObjectRefRequired in SimpleName (as it is
15812         possible to have a class/instance variable name that later gets
15813         deambiguated), we have to check this here.      
15814
15815 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15816
15817         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15818         make static and put into Expression.
15819
15820         (Event.Define): Register the private field of the event with the 
15821         TypeManager so that GetFieldFromEvent can get at it.
15822
15823         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15824         keep track of the private field associated with an event which
15825         has no accessors.
15826
15827         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15828         private field.
15829
15830         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15831
15832 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15833
15834         * expression.cs (Binary.EmitBranchable): this routine emits the
15835         Binary expression in a branchable context.  This basically means:
15836         we need to branch somewhere, not just get the value on the stack.
15837
15838         This works together with Statement.EmitBoolExpression.
15839
15840         * statement.cs (Statement.EmitBoolExpression): Use
15841         EmitBranchable. 
15842
15843 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15844
15845         * statement.cs (For): Reduce the number of jumps in loops.
15846
15847         (For): Implement loop inversion for the For statement.
15848
15849         (Break): We can be breaking out of a Try/Catch controlled section
15850         (foreach might have an implicit try/catch clause), so we need to
15851         use Leave instead of Br.
15852
15853         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15854         now).  If the instace expression supports IMemoryLocation, we use
15855         the AddressOf method from the IMemoryLocation to extract the
15856         address instead of emitting the instance.
15857
15858         This showed up with `This', as we were emitting the instance
15859         always (Emit) instead of the Address of This.  Particularly
15860         interesting when This is a value type, as we dont want the Emit
15861         effect (which was to load the object).
15862
15863 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15864
15865         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15866
15867         * statement.cs (Checked): Set the CheckedState during the resolve
15868         process too, as the ConvCast operations track the checked state on
15869         the resolve process, and not emit.
15870
15871         * cs-parser.jay (namespace_member_declaration): Flag that we have
15872         found a declaration when we do.  This is used to flag error 1529
15873
15874         * driver.cs: Report ok when we display the help only.
15875
15876 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15877
15878         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15879
15880 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * cs-tokenizer.cs (define): We also have to track locally the
15883         defines.  AllDefines is just used for the Conditional Attribute,
15884         but we also need the local defines for the current source code. 
15885
15886 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15887
15888         * statement.cs (While, For, Do): These loops can exit through a
15889         Break statement, use this information to tell whether the
15890         statement is the last piece of code.
15891
15892         (Break): Flag that we break.
15893
15894         * codegen.cs (EmitContexts): New `Breaks' state variable.
15895
15896 2002-07-03  Martin Baulig  <martin@gnome.org>
15897
15898         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15899         modifiers in method declarations in structs.  Otherwise, you won't
15900         be able to override things like Object.Equals().
15901
15902 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15903
15904         * class.cs (Method, Property, Indexer): Do not allow the public
15905         modifier to be used in explicit interface implementations.
15906
15907         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15908         override modifiers in method declarations in structs
15909
15910 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15911
15912         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15913         integer or real overflow, report an error
15914
15915 2002-07-02  Martin Baulig  <martin@gnome.org>
15916
15917         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15918         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15919         to tell the runtime about our newly created System.Object and
15920         System.ValueType types.
15921
15922 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15923
15924         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15925         struct instead of Ldarg/Starg.
15926
15927 2002-07-02  Martin Baulig  <martin@gnome.org>
15928
15929         * expression.cs (Indirection.Indirection): Call
15930         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15931
15932 2002-07-02  Martin Baulig  <martin@gnome.org>
15933
15934         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15935         ValueType, call TypeManager.TypeToCoreType() on it.
15936         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15937         the OpCodes.Newarr argument.
15938
15939 2002-07-02  Martin Baulig  <martin@gnome.org>
15940
15941         * expression.cs (Invocation.EmitCall): When compiling corlib,
15942         replace all calls to the system's System.Array type to calls to
15943         the newly created one.
15944
15945         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15946         System.Array methods.
15947         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15948         from the system's System.Array type which must be replaced.
15949
15950 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15951
15952         * typemanager.cs: load unverifiable_code_ctor so we can build
15953         corlib using the correct type. Avoid using GetTypeCode() with
15954         TypeBuilders.
15955         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15956         TypeManager.object_type to allow building corlib.
15957
15958 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15959
15960         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15961
15962 2002-07-01  Martin Baulig  <martin@gnome.org>
15963
15964         * class.cs: Make the last change actually work, we need to check
15965         whether `ifaces != null' to avoid a crash.
15966
15967 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15968
15969         * class.cs: when we build structs without fields that implement
15970         interfaces, we need to add the interfaces separately, since there is
15971         no API to both set the size and add the interfaces at type creation
15972         time.
15973
15974 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15975
15976         * expression.cs: the dimension arguments to the array constructors
15977         need to be converted if they are a long.
15978
15979 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15980
15981         * class.cs: don't emit ldarg.0 if there is no parent constructor
15982         (fixes showstopper for corlib).
15983
15984 2002-06-29  Martin Baulig  <martin@gnome.org>
15985
15986         MCS now compiles corlib on GNU/Linux :-)
15987
15988         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15989         ie. check for MethodImplOptions.InternalCall.
15990
15991         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15992         and TypeManager.attribute_type are null, so we must explicitly check
15993         whether parent is not null to find out whether it's an attribute type.
15994         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15995         and SetBuilder, not only if the property is neither abstract nor external.
15996         This is necessary to set the MethodImplOptions on the accessor methods.
15997         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15998         SetBuilder, see Property.Emit().
15999
16000         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16001         populate "System.Object", "System.ValueType" and "System.Attribute" since
16002         they've already been populated from BootCorlib_PopulateCoreTypes().
16003
16004 2002-06-29  Martin Baulig  <martin@gnome.org>
16005
16006         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16007         is the NullLiteral, we also need to make sure that target_type is not
16008         an enum type.   
16009
16010 2002-06-29  Martin Baulig  <martin@gnome.org>
16011
16012         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16013         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16014         before calling BootstrapCorlib_ResolveDelegate ().
16015
16016 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16017
16018         * statement.cs: fixed build-breaker. All tests passed ok.
16019
16020 2002-06-27  Martin Baulig  <martin@gnome.org>
16021
16022         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16023         for System.Decimal when compiling corlib.
16024
16025 2002-06-27  Martin Baulig  <martin@gnome.org>
16026
16027         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16028         switch blocks which contain nothing but a default clause.
16029
16030 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16031
16032        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16033
16034 2002-06-27  Martin Baulig  <martin@gnome.org>
16035
16036         * ecore.cs (PropertyExpr.PropertyExpr): Call
16037         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16038
16039         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16040         is already a TypeBuilder.
16041
16042 2002-06-27  Martin Baulig  <martin@gnome.org>
16043
16044         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16045         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16046         the "from an array-type to System.Array" case.  This makes it work
16047         when compiling corlib.
16048
16049 2002-06-27  Martin Baulig  <martin@gnome.org>
16050
16051         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16052         non-static PropertyExpr, set its InstanceExpression.  This makes
16053         the `ICollection.Count' property work in System/Array.cs.
16054
16055 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16056
16057         * driver.cs: Made error handling more consistent.  Errors now
16058         tracked by Report class, so many methods which used to return int
16059         now return void.  Main() now prints success/failure and 
16060         errors/warnings message.
16061
16062         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16063         the magic number return values (123 and 124).  Now, if the
16064         expected error occurs, the compiler exits with success (exit value
16065         0).  If the compilation completes without seeing that particular
16066         error, the compiler exits with failure (exit value 1).  The
16067         makefile in mcs/errors has been changed to handle the new behaviour.
16068
16069         * report.cs: Made 'expected error' number a property and renamed
16070         it from 'Probe' to 'ExpectedError'.
16071
16072         * genericparser.cs: Removed error handling support, since it is
16073         now all done by Report class.
16074
16075         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16076         class, so parse() no longer returns an int.
16077
16078         * namespace.cs: Use Report.Error instead of GenericParser.error
16079
16080 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16081
16082         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16083         TypeContainer.AddOperator): At the front of the list put the
16084         explicit implementations, so they get resolved/defined first. 
16085
16086 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16087
16088         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16089         interface type is implemented by this TypeContainer.  Used during
16090         explicit interface implementation.
16091
16092         (Property.Define, Indexer.Define, Method.Define): Validate that
16093         the given interface in the explicit implementation is one of the
16094         base classes for the containing type.
16095
16096         Also if we are explicitly implementing an interface, but there is
16097         no match in the pending implementation table, report an error.
16098
16099         (Property.Define): Only define the property if we are
16100         not explicitly implementing a property from an interface.  Use the
16101         correct name also for those properties (the same CSC uses,
16102         although that is really not needed).
16103
16104         (Property.Emit): Do not emit attributes for explicitly implemented
16105         properties, as there is no TypeBuilder.
16106
16107         (Indexer.Emit): ditto.
16108
16109         Hiding then means that we do not really *implement* a pending
16110         implementation, which makes code fail.
16111
16112 2002-06-22  Martin Baulig  <martin@gnome.org>
16113
16114         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16115         the return value of Object.GetType().  [FIXME: we need to do this whenever
16116         we get a type back from the reflection library].
16117
16118 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16119
16120         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16121
16122 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16123
16124         * attribute.cs: Return null if we can not look up the type.
16125
16126         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16127         the interface types found.
16128
16129         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16130         interface types found.
16131
16132         * typemanager.cs (GetInterfaces): Make this routine returns alll
16133         the interfaces and work around the lame differences between
16134         System.Type and System.Reflection.Emit.TypeBuilder in the results
16135         result for GetInterfaces.
16136
16137         (ExpandInterfaces): Given an array of interface types, expand and
16138         eliminate repeated ocurrences of an interface.  This expands in
16139         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16140         be IA, IB, IC.
16141
16142 2002-06-21  Martin Baulig  <martin@gnome.org>
16143
16144         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16145         on System.Enum.
16146
16147 2002-06-21  Martin Baulig  <martin@gnome.org>
16148
16149         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16150         and called with one of the core types, return the corresponding typebuilder for
16151         that type.
16152
16153         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16154         element type.
16155
16156 2002-06-21  Martin Baulig  <martin@gnome.org>
16157
16158         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16159         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16160         (Expression.ConvertReferenceExplicit): Likewise.
16161
16162         * expression.cs (ElementAccess.DoResolve): Likewise.
16163         (ElementAccess.DoResolveLValue): Likewise.
16164
16165 2002-06-10  Martin Baulig  <martin@gnome.org>
16166
16167         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16168         add the "value" parameter to the parameter list.
16169
16170         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16171         to our caller.
16172
16173 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16174
16175         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16176         the argument to an int, uint, long or ulong, per the spec.  Also
16177         catch negative constants in array creation.
16178
16179 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16180
16181         * class.cs: do not allow the same interface to appear twice in
16182         the definition list.
16183
16184 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16185
16186         * ecore.cs: don't use ldlen with System.Array.
16187
16188 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16189
16190         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16191
16192 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16193
16194         * modifiers.cs: produce correct field attributes for protected
16195         internal. Easy fix so miguel can work on ther harder stuff:-)
16196
16197 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16198
16199         * pending.cs: New file.  Move the code from class.cs here.
16200         Support clearning the pending flag for all methods (when not doing
16201         explicit interface implementation).
16202
16203 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16204
16205         * rootcontext.cs: added a couple more types needed to bootstrap.
16206
16207 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16208
16209         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16210         constructor in the type, instead of any constructor in the type
16211         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16212         a bug in the Mono runtime when applying the params attribute). 
16213
16214 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16215         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16216
16217 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16218
16219         * expression.cs (Unary.ResolveOperator): Use TypeManager
16220         to resolve the type.
16221
16222 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16223
16224         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16225         attached.
16226
16227         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16228         with each member too.
16229
16230         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16231         field builders too - this takes care of the enum member case.
16232
16233 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16234
16235         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16236         address-of operator on both value types and pointers.
16237
16238 2002-06-10  Martin Baulig  <martin@gnome.org>
16239
16240         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16241         PropertyBuilder to the `property_builders' list.
16242
16243         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16244         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16245         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16246         find any indexers which are inherited from an interface.
16247
16248 2002-06-09  Martin Baulig  <martin@gnome.org>
16249
16250         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16251         the same type as the constant if necessary.  There's also a test-130.cs
16252         for this.
16253
16254         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16255
16256         * typemanager.cs (TypeManager.ChangeType): Previously known as
16257         Enum.ChangeEnumType().
16258
16259 2002-06-09  Martin Baulig  <martin@gnome.org>
16260
16261         * expression.cs (Cast.TryReduce): Added support for consts.
16262
16263 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16264
16265         * class.cs (Accessor): Hold attributes information so we can pass
16266         it along.
16267
16268         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16269         Modify to pass in attributes attached to the methods.
16270
16271         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16272
16273         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16274         to handle the Accessor kind :-)
16275
16276         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16277
16278 2002-06-08  Martin Baulig  <martin@gnome.org>
16279
16280         * expression.cs (Unary.TryReduceNegative): Added support for
16281         ULongConstants.
16282
16283 2002-06-08  Martin Baulig  <martin@gnome.org>
16284
16285         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16286         name can't be found in the `defined_names' - the caller will do a
16287         MemberLookup in this case and thus find methods in System.Enum
16288         such as Enum.IsDefined().
16289
16290 2002-06-08  Martin Baulig  <martin@gnome.org>
16291
16292         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16293         Convert.ChangeType() which works with TypeBuilder created types.
16294         (Enum.LookupEnumValue, Enum.Define): Use it here.
16295
16296         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16297         `TypeBuilder.BaseType != null' check.
16298         (TypeContainer.FindMembers): Only lookup parent members if we
16299         actually have a parent.
16300         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16301         (ConstructorInitializer.Resolve): Likewise.
16302
16303         * interface.cs (Interface.FindMembers): Added
16304         `TypeBuilder.BaseType != null' check.
16305
16306         * rootcontext.cs (RootContext.ResolveCore): Added
16307         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16308         classes_second_stage.
16309
16310         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16311         debug_type and trace_type when compiling with --nostdlib.       
16312
16313 2002-06-07  Martin Baulig  <martin@gnome.org>
16314
16315         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16316         (AddField): Set it to true when adding a non-static field.
16317         (DefineType): Use `have_nonstatic_fields' to find out whether we
16318         have non-static fields, not `Fields != null'.
16319
16320 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16321
16322         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16323         dereferencing a null on the static-field code path)
16324
16325 2002-05-30  Martin Baulig  <martin@gnome.org>
16326
16327         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16328         to take command line arguments.  Use reflection to call the new
16329         custom `Initialize' function on the symbol writer and pass it the
16330         command line arguments.
16331
16332         * driver.cs (--debug-args): New command line argument to pass command
16333         line arguments to the symbol writer.
16334
16335 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16336
16337         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16338         the target type for indexers and properties.  Thanks to Joe for
16339         catching this.
16340
16341 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16342
16343         * typemanager.cs (MethodFlags): returns the method flags
16344         (Obsolete/ShouldIgnore) that control warning emission and whether
16345         the invocation should be made, or ignored. 
16346
16347         * expression.cs (Invocation.Emit): Remove previous hack, we should
16348         not do this on matching a base type, we should do this based on an attribute
16349
16350         Only emit calls to System.Diagnostics.Debug and
16351         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16352         on the command line.
16353
16354         * rootcontext.cs: Global settings for tracing and debugging.
16355
16356         * cs-tokenizer.cs (define): New utility function to track
16357         defines.   Set the global settings for TRACE and DEBUG if found.
16358
16359 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16360
16361         * interface.cs (Populate*): Pass in the TypeContainer as well as
16362         the DeclSpace as parameters so that we can create EmitContexts and
16363         then use that to apply attributes etc.
16364
16365         (PopulateMethod, PopulateEvent, PopulateProperty)
16366         (PopulateIndexer): Apply attributes everywhere.
16367
16368         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16369         etc.
16370
16371         (ApplyAttributes): Update accordingly.
16372
16373         We now apply interface attributes for all members too.
16374
16375 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16376
16377         * class.cs (Indexer.Define); Correctly check if we are explicit
16378         implementation (instead of checking the Name for a ".", we
16379         directly look up if the InterfaceType was specified).
16380
16381         Delay the creation of the PropertyBuilder.
16382
16383         Only create the PropertyBuilder if we are not an explicit
16384         interface implementation.   This means that explicit interface
16385         implementation members do not participate in regular function
16386         lookups, and hence fixes another major ambiguity problem in
16387         overload resolution (that was the visible effect).
16388
16389         (DefineMethod): Return whether we are doing an interface
16390         implementation. 
16391
16392         * typemanager.cs: Temporary hack until we get attributes in
16393         interfaces (Ravi is working on that) and we get IndexerName
16394         support in interfaces.
16395
16396         * interface.cs: Register the indexers as properties.
16397
16398         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16399         warning, I have verified that this is a bug in the .NET runtime
16400         (JavaScript suffers of the same problem).
16401
16402         * typemanager.cs (MemberLookup): When looking up members for
16403         interfaces, the parent of an interface is the implicit
16404         System.Object (so we succeed in searches of Object methods in an
16405         interface method invocation.  Example:  IEnumerable x;  x.ToString
16406         ()) 
16407
16408 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16409
16410         * class.cs (Event): Events should also register if they do
16411         implement the methods that an interface requires.
16412
16413         * typemanager.cs (MemberLookup); use the new GetInterfaces
16414         method. 
16415
16416         (GetInterfaces): The code used to lookup interfaces for a type is
16417         used in more than one place, factor it here. 
16418
16419         * driver.cs: Track the errors at the bottom of the file, we kept
16420         on going.
16421
16422         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16423         instance if the method we are calling is static!
16424
16425 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16426
16427         * attribute.cs (ApplyAttributes): Make this function filter out
16428         the IndexerName attribute (as that attribute in reality is never
16429         applied) and return the string constant for the IndexerName
16430         attribute. 
16431
16432         * class.cs (TypeContainer.Emit): Validate that all the indexers
16433         have the same IndexerName attribute, and if so, set the
16434         DefaultName attribute on the class. 
16435
16436         * typemanager.cs: The return value might contain other stuff (not
16437         only methods).  For instance, consider a method with an "Item"
16438         property and an Item method.
16439
16440         * class.cs: If there is a problem with the parameter types,
16441         return. 
16442
16443 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16444
16445         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16446         looks at user defined conversion after making a call to 
16447         StandardConversionExists - we need this for overload resolution.
16448
16449         * expression.cs : Update accordingly the various method calls.
16450
16451         This fixes 2 bugs filed against implicit user defined conversions 
16452
16453 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16454
16455         * statement.cs: Track the result of the assignment.
16456
16457 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16458
16459         * expression.cs (MemberAccess): Improved error reporting for
16460         inaccessible members.
16461
16462 2002-05-22  Martin Baulig  <martin@gnome.org>
16463
16464         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16465         itself with debugging support.
16466
16467 2002-05-22  Martin Baulig  <martin@gnome.org>
16468
16469         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16470         Removed, this isn't needed anymore.
16471
16472 2002-05-20  Martin Baulig  <martin@gnome.org>
16473
16474         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16475         be underlying type for an enum.
16476
16477 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16478
16479         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16480         that splits out the loading of just the core types.
16481
16482         * rootcontext.cs (ResolveCore): Split the struct resolution in
16483         two, so we can load the enumeration underlying types before any
16484         enums are used.
16485
16486         * expression.cs (Is): Bandaid until we fix properly Switch (see
16487         bug #24985 for details).
16488
16489         * typemanager.cs (ImplementsInterface): The hashtable will contain
16490         a null if there are no interfaces implemented.
16491
16492 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16493
16494         * cs-parser.jay (indexer_declarator): It is fine to have array
16495         parameters
16496
16497 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16498
16499         * typemanager.cs: (RegisterBuilder): New function used to register
16500         TypeBuilders that implement interfaces.  Since
16501         TypeBuilder.GetInterfaces (as usual) does not work with lame
16502         Reflection.Emit. 
16503         (AddUserType): register interfaces.
16504
16505         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16506         dealing with TypeBuilder.  Also, arrays are showing up as
16507         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16508         methods can not be invoked on them!
16509
16510         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16511         (ImplicitReferenceConversionExists): Split out from
16512         StandardConversionExists. 
16513
16514         * expression.cs (As): We were only implementing one of the three
16515         cases for the as operator.  We now implement them all.
16516         (Is): Implement the various other cases for Is as well.
16517
16518         * typemanager.cs (CACHE): New define used to control if we want or
16519         not the FindMembers cache.  Seems to have a negative impact on
16520         performance currently
16521
16522         (MemberLookup): Nested types have full acess to
16523         enclosing type members
16524
16525         Remove code that coped with instance/static returns for events, we
16526         now catch this in RealFindMembers.
16527
16528         (RealFindMembers): only perform static lookup if the instance
16529         lookup did not return a type or an event.  
16530
16531 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16532
16533         * assign.cs (CompoundAssign): We pass more semantic information
16534         now to Compound Assignments than we did before: now we have all
16535         the information at hand, and now we resolve the target *before* we
16536         do the expression expansion, which allows the "CacheValue" method
16537         to have the effect we intended (before, a [x] += 1 would generate
16538         two differen ArrayAccess expressions from the ElementAccess,
16539         during the resolution process).
16540
16541         (CompoundAssign.DoResolve): Resolve target and original_source here.
16542
16543 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16544
16545         * expression.cs (ArrayAccess): dropped debugging information. 
16546
16547         * typemanager.cs: Small bug fix: I was always returning i_members,
16548         instead of one of i_members or s_members (depending on which had
16549         the content).
16550
16551         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16552         method is invoked before any code generation takes place, and it
16553         is a mechanism to inform that the expression will be invoked more
16554         than once, and that the method should use temporary values to
16555         avoid having side effects
16556
16557         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16558
16559         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16560         implementation.
16561
16562         * expression.cs (Indirection, ArrayAccess): Add support for
16563         CacheTemporaries in these two bad boys. 
16564
16565         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16566         ldobj or ldind_ref.  
16567         (StoreFromPtr): Handle stobj as well.
16568
16569         * expression.cs (UnaryMutator): Share more code.
16570
16571         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16572         down: I was not tracking the Filter function as well, which
16573         was affecting the results of the cache.
16574
16575 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16576
16577         * attribute.cs: Remove the hack to handle the CharSet property on
16578         StructLayouts. 
16579
16580 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16581
16582         * attribute.cs (DoResolve): More uglyness, we now only try to
16583         resolve the attribute partially, to extract the CharSet
16584         information (only if we are a StructLayout attribute).  Otherwise 
16585
16586         (GetExtraTypeInfo): Add some code to conditionally kill in the
16587         future this.   I am more and more convinced that the .NET
16588         framework has special code to handle the attribute setting on
16589         certain elements.
16590
16591         * expression.cs (IsParamsMethodApplicable): Revert my previous
16592         foreach change here, it was wrong.
16593
16594 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16595
16596         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16597         (pp_expr): do not abort on unknown input, just return.
16598         (eval): abort if there are pending chars.
16599
16600         * attribute.cs (Attribute.Resolve): Positional parameters are
16601         optional.  Deal with that case.
16602
16603         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16604         the Ansi/Unicode/Auto information for the type.
16605
16606         (TypeContainer.DefineType): instantiate the EmitContext here, as
16607         we will be using it during the type definition (to resolve
16608         attributes) and during the emit phase.
16609
16610         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16611         to pull type information out of the attributes
16612
16613         (Attribute.Resolve): track the constructor builder, and allow for
16614         multiple invocations (structs and classes will use this).
16615
16616         * ecore.cs (MemberLookupFinal): new version with all the
16617         parameters customizable.
16618
16619         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16620         constructors.  Return if the result value is null (as the error
16621         would have been flagged already by MemberLookupFinal)
16622
16623         Do not allow instances of abstract classes or interfaces to be
16624         created.
16625
16626         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16627         We have to compare the assembly property here when dealing with
16628         FamANDAssem and Assembly access modifiers, because we might be
16629         creating an assembly from *modules* (that means that we are not
16630         getting TypeBuilders for types defined in other modules that are
16631         part of this assembly).
16632
16633         (Method.Emit): If the method is marked abstract and has a body,
16634         emit an error. 
16635
16636         (TypeContainer.DefineMembers): If both the defined member and the
16637         parent name match are methods, then do not emit any warnings: let
16638         the Method.Define routine take care of flagging warnings.  But if
16639         there is a mismatch (method overrides something else, or method is
16640         overriwritten by something, then emit warning).
16641
16642         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16643         set to null, this means `do not check for the return type on the
16644         signature'. 
16645
16646         (Method.Define): set the return type for the method signature to
16647         null, so that we get methods with the same name and parameters and
16648         different return types.  This is used to flag warning 114 (you are
16649         hiding a method, and you probably want to use the new/override
16650         keywords instead).
16651
16652         * typemanager.cs (MemberLookup): Implemented proper access
16653         control, closing a long standing set of bug reports.  The problem
16654         was that the Framework only has two bits: Public and NonPublic,
16655         and NonPublic includes private and protected methods, but we need
16656         to enforce the FamANDAssem, FamOrAssem and Family. 
16657
16658 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16659
16660         * statement.cs (GotoCase): Return true: Ammounts to giving up
16661         knowledge on whether we return or not, and letting the other case
16662         be responsible for it.
16663
16664 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16665
16666         * driver.cs: Do not load directories for each file processed, only
16667         do it if there is a pattern.
16668
16669         * ecore.cs: Report readonly assigns here as well, as we might have
16670         been resolved only by MemberAccess.
16671
16672         (SimpleName.SimpleNameResolve): Also be useful for LValue
16673         resolution.   We need this to propagate assign to local readonly variables
16674
16675         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16676         do not want to reuse potential criteria memory.
16677
16678         * class.cs (MyEventBuilder): Set reflected_type;
16679
16680         * ecore.cs (Constantify): Added support for constifying bools.
16681
16682         (RootContext.LookupType): Added a cache for values looked up in
16683         the declaration space.
16684
16685         * typemanager.cs (FindMembers): Now is a front-end to
16686         RealFindMembers, and provides a two-level hashtable-based cache to
16687         the request.  
16688
16689         15% performance improvement: from 22.5 to 19.2 seconds.
16690
16691         * expression.cs (IsParamsMethodApplicable): use foreach.
16692         (Invocation.DoResolve): ditto.
16693         (New.DoResolve): ditto.
16694         (ArrayCreation.DoResolve): ditto.
16695
16696         * ecore.cs (FindMostEncompassingType): use foreach.
16697
16698         * delegate.cs (NewDelegate.DoResolve): Use foreach
16699
16700         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16701         (RemoveMethods): use foreach.
16702
16703         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16704         nested foreach statements instead of for, and also break out of
16705         the inner loop once a match is found.
16706
16707         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16708
16709 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16710
16711         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16712         we actually unwrap the expression to allow for extra information
16713         to be extracted. 
16714
16715         * expression.cs: Use Shr_Un on unsigned operations. 
16716
16717 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16718
16719         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16720         applicable operators was not being considered correctly. This closes
16721         the bug Miguel reported.
16722
16723 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16724
16725         * attribute.cs: check that the type derives from System.Attribute
16726         and report the correct error in that case (moved the duplicate code to
16727         its own method, too).
16728
16729 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16730
16731         * attribute.cs: lookup attribute type name as the spec says: first the
16732         bare attribute name and then name + "Attribute" (nant compiles with
16733         mcs after this fix).
16734
16735 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16738         Because of the way we parse things, we should try to see if a
16739         UIntConstant can fit in an integer.
16740
16741 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16742
16743         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16744         when we are in an explicit context.
16745
16746         (ConvertReferenceExplicit): When converting from Iface type S to Class
16747         T make sure the rules are implemented as an OR.
16748
16749         * parameter.cs (ParameterType): Make it a property for now although the
16750         purpose really isn't anything immediate.
16751
16752         * expression.cs (Is*Applicable): Do better checking on the parameter type
16753         of a ref/out parameter. The ones from the system assemblies are already 
16754         marked with the correct type so we don't need to do any correction.
16755
16756         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16757         the object type is standard too so include that.
16758
16759 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16760
16761         * ecore.cs (StandardConversionExists): Augment with missing code:
16762         deal with IntConstant, LongConstants and Enumerations.
16763
16764         * assign.cs: Report the error, instead of failing silently
16765
16766         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16767         typecontainer that they are declared, because the
16768         typecontainer/namespace will have the list of using clauses that
16769         need to be applied.
16770
16771         Assembly Attributes were escaping the normal registration
16772         mechanism. 
16773
16774         (EmitCode): Apply attributes within an EmitContext that represents
16775         the container they were declared on.
16776
16777         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16778
16779 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16780
16781         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16782         Revamp completely - make much cleaner as we now operate only
16783         on a set of Types.
16784
16785         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16786         to implement the logic detailed in the spec more correctly.
16787
16788         (UserDefinedConversion): Update accordingly.
16789
16790 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16791
16792         * statement.cs: Return flow analysis information up.
16793
16794         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16795         and the default.
16796
16797         (token): Do not consume an extra character before calling
16798         decimal_digits.
16799
16800 2002-05-06  Piers Haken <piersh@friskit.com>
16801
16802         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16803
16804 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16805
16806         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16807         EmitContext during the instance constructor initializer
16808         resolution, to stop access to instance variables.
16809
16810         This is mandated by the spec, last paragraph of the `constructor
16811         initializers' section. 
16812
16813 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16814
16815         * cs-parser.jay, class.cs (Accessor): new class used to represent
16816         an accessor (get or set).  In the past we used `null' to represent
16817         a missing accessor.  But this is ambiguous because there was no
16818         way to tell in abstract indexers/properties if one of them was
16819         specified.
16820
16821         Now there is a way of addressing that.
16822
16823         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16824         instead of FindMembers.
16825
16826         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16827         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16828
16829         * attribute.cs: Treat indexers and properties as the same in terms
16830         of applying attributes
16831
16832         * ecore.cs (FindMostEncompassedType): Use statically initialized
16833         EmptyExpressions()s like we do elsewhere to avoid creating useless
16834         objects (and we take this out of the tight loop).
16835
16836         (GetConversionOperators): Move the code to extract the actual
16837         operators to a separate routine to clean things up.
16838
16839 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16840
16841         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16842         events are always registered FieldBuilders.
16843
16844         * class.cs (FieldBase): New class shared by Fields 
16845
16846         * delegate.cs: If we are a toplevel delegate, use our full name.
16847         If we are a nested delegate, then only use our tail name.
16848
16849 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16850
16851         * expression.cs (IsApplicable): Ensure that we add the "&" to
16852         ref/out types before comparing it with the type of the argument.
16853
16854         (IsParamsMethodApplicable): Ditto.
16855
16856         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16857         silly me ;-)
16858
16859         * delegate.cs : Handle the case when we have more than one applicable
16860         method. Flag an error only when we finish checking all.
16861
16862 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16863
16864         * expression.cs: Add support for boolean static initializers.
16865
16866 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16867
16868         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16869
16870         * parameter.cs (ComputeParameterTypes,
16871         ComputeAndDefineParameterTypes): Better error handling: now we
16872         clear the `types' cache if we fail during any of the type lookups.
16873         We also return the status code correctly to our caller
16874
16875         * delegate.cs: If we fail to define a delegate, abort the extra
16876         steps. 
16877
16878         * expression.cs (Binary.ResolveOperator): for
16879         operator==(object,object) and operator !=(object, object) we also
16880         have to verify that there is an implicit conversion from one to
16881         the other.
16882
16883         (ArrayAccess.DoResolve): Array Access can operate on
16884         non-variables. 
16885
16886 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16887
16888         * assign.cs (CompoundAssign): A new class used as a "flag" that
16889         the assignment actually is happening as part of a compound
16890         assignment operator.
16891
16892         During compound assignment, a few new rules exist to enable things
16893         like:
16894
16895         byte b |= 1 + 2
16896
16897         From the spec:
16898
16899         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16900         to the type of x) if y is implicitly convertible to the type of x,
16901         and the operator is a builtin operator and the return type of the
16902         operator is explicitly convertible to the type of x. 
16903
16904         * rootcontext.cs: Reset warning level to 2.  4 catches various
16905         "interesting" features in mcs, we must clean this up at some
16906         point, but currently am trying to kill other bugs ;-)
16907
16908         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16909         in container classes as well.  
16910
16911         * expression.cs (Binary.ResolveOperator): Handle string case
16912         before anything else (as operator overloading does emit an error
16913         before doing anything else).
16914
16915         This code could go away when we move to a table driven model, but
16916         i could not come up with a good plan last night.
16917
16918 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16919
16920         * typemanager.cs (CSharpName): reimplementation using regex.
16921         * class.cs: added null check for fields in Emit
16922         * rootcontext.cs: set warninglevel to 4
16923
16924 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16925
16926         * typemanager.cs (CSharpName): reimplemented with Lupus
16927         suggestion.
16928
16929 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16930
16931         * statement.cs (If): correclty implement Resolve, because we were
16932         not catching sem errors in there.  The same process is needed
16933         everywhere else. 
16934         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16935
16936
16937         (Statement.Warning_DeadCodeFound): Factorize code.
16938         (While): Report dead code here too.
16939
16940         (Statement): Added Resolve virtual method to allow
16941         for resolution split from the emit code.
16942
16943 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16944
16945         * statement.cs (EmitBoolExpression): No longer try to resolve the
16946         expression here.    
16947         (MakeBoolean): New utility function that resolve, implicitly
16948         converts to boolean and tags the expression. 
16949
16950
16951         (If, Do): Implement dead code elimination.
16952         (While): Implement loop inversion
16953
16954         (Do, While, For, If): Resolve the expression prior to calling our
16955         code generation.
16956
16957 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16958
16959         * class.cs:
16960           - added method Report28 (warning: program has more than one entry point)
16961           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16962           - modified method Method.Define, the part at the end of the method
16963
16964         * rootcontext.cs: added static public Location EntryPointLocation;
16965           
16966         * ../errors/cs0028.cs : Add test case for the above warning.              
16967
16968         * typemanager.cs:
16969           - modified method CSharpName to allow arrays of primitive type to
16970             be printed nicely (e.g. instead of System.Int32[][] it now prints
16971             int[][])
16972           - added method CSharpSignature: returns the signature of a method
16973             in string format to be used in reporting errors, warnings, etc.
16974
16975         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16976         with String.Empty.
16977
16978 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16979
16980         * delegate.cs (Define): Fix extremely silly bug where I was
16981         setting the type of the 'object' parameter of the BeginInvoke
16982         method to System.IAsyncResult instead of System.Object ;-)
16983
16984 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16985
16986         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16987         here. 
16988
16989         (Constructor.Emit): return if we fail to initialize the
16990         constructor.  Another door closed!  
16991
16992         * expression.cs (New.DoResolve): Improve error message (from -6 to
16993         1501).  Use DeclaredOnly lookup to find the exact constructor.
16994
16995         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16996         loop.  This is useful.
16997
16998         * cs-parser.jay: Adjust the default parameters so that destructors
16999         have the proper signature.
17000
17001 2002-04-26  Martin Baulig  <martin@gnome.org>
17002
17003         * driver.cs (LoadAssembly): If `assembly' contains any characters
17004         which are only valid in path names and not in assembly names
17005         (currently slash, backslash and point), use Assembly.LoadFrom ()
17006         instead of Assembly.Load () on the `assembly' (before iteration
17007         over the link_paths).
17008
17009 2002-04-26  Martin Baulig  <martin@gnome.org>
17010
17011         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17012
17013 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17014
17015         * class.cs (Property): use the new typemanager.MemberLookup
17016
17017         (TypeContainer.MemberLookup): Implement using the
17018         TypeManager.MemberLookup now. 
17019
17020         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17021         and return MemberInfos, so that these can be used without an
17022         EmitContext (what we had before).
17023
17024 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17025
17026         * expression.cs: Fix the case where the argument to params if the
17027         type of the params.  I omitted handling this before.   Fixed
17028
17029 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17030
17031         * driver.cs: Call BootCorlib_PopulateCoreType
17032
17033         * class.cs (Property.CheckBase): Check for properties only, not
17034         for all members. 
17035
17036         * interface.cs: Temporary hack: try/catch around the
17037         CustomAttributeBuilder, because I am getting an exception that I
17038         do not understand.
17039
17040         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17041         types whose definitions are required to be there (attributes are
17042         defined before standard types).
17043
17044         Compute definitions as we boot the various types, as they are used
17045         immediately (value_type class will need object_type, but if we do
17046         not initialize object_type, we will pass a null, which will let
17047         the runtime pick the System.Object from the existing corlib, which
17048         is not what we want).
17049
17050 2002-04-22  Patrik Torstensson <totte@labs2.com>
17051
17052         * cs-tokenizer.cs: fixed a number of trim() issues.
17053
17054 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17055
17056         * expression.cs (Argument.Type): Ensure that we return the correct
17057         type when we have out or ref parameters [in which case we 
17058         append a "&"].
17059
17060 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17061
17062         * class.cs (Property, Indexer): Allow extern modifier in there. 
17063
17064         * typemanager.cs (InitBaseTypes): Initializes object_type and
17065         value_type, since those will be used early on during the bootstrap
17066         process to compile corlib.
17067
17068         (InitCoreTypes): Move code from here to InitBaseTypes.
17069
17070 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17071
17072         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17073         single-dimension arrays as using the ldlen opcode.  
17074
17075         Daniel Lewis discovered this optimization.  
17076
17077         * typemanager.cs: Add signature for System.Array::get_Length
17078
17079 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17080
17081         * statement.cs: report the error when the foreach does not apply to an
17082         array nor a collection.
17083
17084 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * expression.cs: Add implicit conversions to the operator ~.
17087
17088         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17089
17090         * typemanager.cs: Locate the decimal constructor.
17091
17092 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17093
17094         * attribute.cs: use the new property of TypeOf.
17095         * expression.cs: added 'get' property around typearg.
17096
17097         These changes fix a build breaker reported by NickD. Is this the
17098         correct way to fix?  If not, please, revert my changes and make it
17099         work :-).
17100
17101 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17102
17103         * attribute.cs: Add support for typeof in attribute invocations.
17104         I am not sure that this is right though.
17105
17106 2002-04-14  Duncan Mak  <duncan@ximian.com>
17107
17108         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17109         Binary.Operator.Division case.
17110
17111 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17112
17113         * class.cs (DefineType): Ensure that we do a proper check on
17114         attribute types and also register it with the TypeManager.
17115
17116         (TypeContainer.Targets): The default for attribute types is
17117         AttributeTargets.All.
17118
17119         * attribute.cs (ApplyAttributes): Registering the attribute type
17120         is done elsewhere, not when we discover we have a Usage attribute.
17121
17122 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17123
17124         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17125         and get rid of is_delegate parameter.
17126
17127         * everywhere : update.
17128
17129 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17130
17131         * cs-parser.jay (compilation_unit): Revamp completely to use
17132         some new ideas that I got from Rhys' grammar to solve the problems
17133         with assembly level attributes.
17134
17135         (outer_declaration): New grammar production.
17136
17137         (attribute_sections): Add.
17138
17139         (opt_attributes): Base on attribute_sections
17140
17141         (namespace_declaration): Allow opt_attributes to tackle the case
17142         when we have assembly level attributes - we are clever in this
17143         regard now ;-)
17144
17145         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17146         attributes in the non-global context.
17147
17148         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17149         instead of SetGlobalAttributes.
17150
17151         * class.cs, rootcontext.cs : Ensure we define and generate 
17152         attribute types before anything else.
17153
17154         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17155         and flag the new error -20 for the case when the attribute type
17156         does not have valid targets specified. csc does not catch this.
17157
17158         * ../errors/errors.txt : update for error # -20
17159
17160 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17161
17162         * support.cs (InternalParameters.ParameterModifier): Do some null
17163         checking and return sane values.
17164
17165         * class.cs (Method.Define): If we are a PInvoke method, ensure
17166         that we are static and extern. Report error # 601
17167
17168         * ../errors/cs0601.cs : Add test case for the above error.
17169
17170 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17171
17172         * rootcontext.cs (attribute_types): We need to keep type of
17173         all attribute types separately and emit code for them first.
17174
17175         (RegisterAttribute) : Implement.
17176
17177         * class.cs (DefineType): Check if the current Type is a custom
17178         attribute type and register it accordingly.
17179
17180         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17181         adding the first attribute twice and rename to
17182
17183         (SetGlobalAttributes): this.
17184
17185         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17186         lookups.
17187
17188         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17189         if we are processing global arguments. Hmm, I am unsure of this.
17190
17191 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17192
17193         * expression.cs: added static array of strings to avoid calling
17194         Enum.ToString () for Operator in Binary. Significant recover of
17195         performance.
17196
17197 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17198
17199         * class.cs (FindMembers): Allow the Builders of the various
17200         members to be null.  If they are skip them.  This only happens
17201         during the PInvoke declaration.
17202
17203 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17204
17205         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17206         failure, so we do not keep going afterwards.
17207
17208         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17209         wanted to pass `false' as the `is_delegate' argument.  If this is
17210         the case, why not use delegate_type == null to mean `is_delegate =
17211         false' and anything else as is_delegate = true.
17212
17213 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17214
17215         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17216         code for the section, not the beginning of the tests.
17217
17218 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17219
17220         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17221
17222         * expression.cs (Binary): same.  Warn about errors where we have
17223         Enum/Enum in operator + as well.
17224
17225 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17226
17227         * statement.cs:
17228                 - added support for switch(bool)
17229                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17230                 - add TableSwitchEmit() to handle table-based switch statements
17231
17232 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17233
17234         * expression.cs (Invocation.OverloadResolve): Factor out code which
17235         does parameter compatibility checking with arguments so that we can 
17236         re-use the code even from Delegate.VerifyApplicability
17237
17238         (VerifyArgumentsCompat): Move above code here.
17239
17240         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17241         and instead make a call to the above method.
17242
17243 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17244
17245         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17246         We use it to keep track of classes which are attribute types.
17247
17248 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17249
17250         * delegate.cs (Delegate.Define): Correctly define the types in the
17251         presence of fixed and array parameters.
17252
17253         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17254         doing FindMembers.
17255
17256         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17257         include NonPublic after the first iteration.
17258
17259         * class.cs (Indexer.CheckBase): Only check if both parents are
17260         non-null. 
17261
17262         * cs-parser.jay (accessor_body): If empty, set to null.
17263
17264         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17265         same code path here to resolve constants names that we did have in
17266         MemberAccess.DoResolve.  There is too much code duplicated here.
17267
17268 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17269
17270         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17271
17272         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17273         to MakeUnionSet.
17274
17275         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17276         tokens, numbers and strings.
17277
17278         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17279         parenthesis.
17280
17281         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17282         asyncronous parameters and the regular parameters.  
17283
17284         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17285         specify the target directory.
17286
17287         * expression.cs: (This.DoResolve): Simplify
17288         (As.Emit): Optimize, do not generate IsInst if the expression is
17289         always of the given type.
17290
17291         (Is.DoResolve): Bug fix, we were reporting both always/never for
17292         the is expression.
17293
17294         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17295         creating too many unnecessary arrays.
17296
17297 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17298
17299         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17300         fields instead of rolling our own initializer.   Takes care of all
17301         implicit conversions, and drops unnecessary static checks/argument.
17302
17303 2002-03-31  Dick Porter  <dick@ximian.com>
17304
17305         * driver.cs: use the GetDirectories() return values properly, and
17306         use "/" as path separator.
17307
17308 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17309
17310         * expression.cs (Unary): Optimize - - expr into expr.
17311         (Binary): Optimize a + (-b) into a -b.
17312
17313         * codegen.cs (CodeGen): Made all methods static.
17314
17315 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17316
17317         * rootcontext.cs: 
17318
17319         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17320         TypeBuilder property.
17321
17322         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17323         instead. 
17324
17325         * tree.cs: Removed the various RecordXXXX, and replaced with a
17326         single RecordDecl.  Removed all the accessor methods, and just
17327         left a single access point Type 
17328
17329         * enum.cs: Rename DefineEnum to DefineType.
17330
17331         * decl.cs: New abstract method `DefineType' used to unify the
17332         Defines for Enumerations, Interfaces, TypeContainers and
17333         Delegates.
17334
17335         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17336         LookupBaseClasses method that used to live in class.cs and
17337         interface.cs here, and renamed to FindType.
17338
17339         * delegate.cs: Implement DefineType.  Take advantage of the
17340         refactored pattern for locating the parent builder without taking
17341         the parent_builder argument (which we know does not work if we are
17342         nested, and triggering a toplevel definition).
17343
17344 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17345
17346         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17347         accessibility of a member has changed during override and report
17348         an error if so.
17349
17350         * class.cs (Method.Define, Property.Define): Only complain on
17351         overrides if the method is private, any other accessibility is
17352         fine (and since we just checked the permission is the same, we are
17353         good to go).
17354
17355         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17356         and elif are processed always.  The other pre-processing
17357         directives are only processed if we are "taking" the path
17358
17359 2002-03-29  Martin Baulig  <martin@gnome.org>
17360
17361         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17362         current location is not Null.
17363
17364         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17365         a separate method so we can profile it.
17366
17367         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17368         `span.Seconds' are just seconds, but no minutes or hours.
17369         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17370
17371 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17372
17373         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17374         Remove the gratuitous set of Final:
17375
17376                                 // If an interface implementation, then we can set Final.
17377                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17378                                     implementing.DeclaringType.IsInterface)
17379                                         flags |= MethodAttributes.Final;
17380
17381         I do not know what I was smoking when I used that.
17382
17383
17384         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17385         step into fixing the name resolution issues for delegates and
17386         unifying the toplevel name resolution.
17387
17388 2002-03-28  Martin Baulig  <martin@gnome.org>
17389
17390         * class.cs (Method.Emit): If we have a symbol writer, call its
17391         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17392         tell it about the current method.
17393
17394         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17395         writer that we're going to emit the first byte of IL code for a new
17396         statement (a new source line).
17397         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17398         EmitContext.Mark() before emitting any code.
17399
17400         * location.cs (SymbolDocument): Return null when we're Null.
17401
17402         * statement.cs (Statement): Moved the `Location loc' variable here.
17403         (Statement.EmitBoolExpression): If we have a symbol writer, call
17404         ec.Mark() before emitting any code to tell it that we're at the
17405         beginning of a new statement.
17406         (StatementExpression): Added `Location' argument to the constructor.
17407         (Block): Added public readonly variable `StartLocation' and public
17408         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17409         (Block): Added constructor which takes a start and end location.
17410         (Block.SetEndLocation): New method. This sets the end location.
17411         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17412         local variables we create.
17413         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17414         each statement and do also mark the begin and end of the block.
17415
17416         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17417         tell it the current lexer.Location, use Location.Null for the end of the
17418         block.
17419         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17420         current block, set its end location using SetEndLocation().
17421         (statement_expression): StatementExpression constructor now takes the
17422         lexer.Location as additional argument.
17423         (for_statement, declare_local_variables): Likewise.
17424         (declare_local_variables): When creating a new implicit block, use the
17425         new Block constructor and pass it the lexer.Location.
17426
17427 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17428
17429         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17430         members also on the parent interfaces recursively.
17431
17432 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17433
17434         * report.cs: Use new formats, since Gonzalo finished the missing
17435         bits. 
17436
17437         * expression.cs (Binary.ResolveOperator): added missing operator|
17438         operator& and operator^ for bool/bool.
17439
17440         * cs-parser.jay: CheckDef now takes a Location argument that is
17441         used to report errors more precisly (instead of reporting the end
17442         of a definition, we try to track something which is a lot closer
17443         to the source of the problem).
17444
17445         * cs-tokenizer.cs: Track global token use, so we can properly flag
17446         the use of #define/#undef after the first token has been seen.
17447
17448         Also, rename the reportXXXX to Error_DescriptiveName
17449
17450         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17451         TypeContainer, so that Enum and Interface can use this too.
17452
17453         * class.cs (TypeContainer.LookupInterfaceOrClass,
17454         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17455         `builder' argument.  Typically this was used to pass the parent
17456         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17457         the definition).  
17458
17459         The problem is that a nested class could trigger the definition of
17460         a toplevel class, and the builder would be obviously wrong in that
17461         case. 
17462
17463         So we drop this argument, and we compute dynamically the
17464         TypeBuilder/ModuleBuilder (the correct information was available
17465         to us anyways from DeclSpace.Parent)
17466
17467         * interface.cs (Interface.DefineInterface): Drop builder
17468         parameter cleanup like class.cs
17469
17470         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17471         like class.cs
17472
17473         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17474         values. 
17475
17476         (Try.Emit): Propagate the returns value from the statement.
17477
17478         (Return.Emit): Even if we are leavning 
17479
17480         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17481
17482         * modifiers.cs: Fix the computation of MethodAttributes flags.
17483
17484 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17485
17486         * driver.cs: allow compilation of files that start with '/'.
17487         Add a default case when checking the argument of --target.
17488
17489 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17490
17491         * interface.cs: Implement the same search algorithm for types in
17492         the interface code.
17493
17494         * delegate.cs: Do not allow multiple definition.
17495
17496         * Recovered ChangeLog that got accidentally amputated
17497
17498         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17499
17500         * rootcontext.cs: Load manually enum to allow core classes to
17501         contain enumerations.
17502
17503         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17504         Update to new static methods in TypeManager.
17505
17506         * typemanager.cs (GetMethod, GetConstructor): Use our
17507         implementation of FindMembers to find the members, since during
17508         corlib compilation, the types are TypeBuilders and GetMethod and
17509         GetConstructor do not work.
17510
17511         Make all methods in TypeManager static.
17512
17513         (InitCodeHelpers): Split the functionality from
17514         the InitCodeTypes function.
17515
17516         * driver.cs: Call InitCodeHelpers after we have populated the
17517         types. 
17518
17519         * cs-parser.jay (delegate_declaration): we did not used to compute
17520         the delegate name correctly for void delegates.
17521
17522 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17523
17524         * rootcontext.cs (RootContext): Init the interface_resolve_order
17525         and type_container_resolve_order always.
17526
17527         (ResolveCore, BootstrapCorlib_ResolveClass,
17528         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17529         compiler when compiling with --nostdlib
17530
17531         * class.cs (TypeContainer.DefineType): Check that our parent is
17532         not null.  This test is most important when we are bootstraping
17533         the core types.
17534
17535         * codegen.cs: Split out the symbol writing code.
17536
17537 2002-03-25  Martin Baulig  <martin@gnome.org>
17538
17539         * driver.cs (-g): Made -g an alias for --debug.
17540
17541 2002-03-24  Martin Baulig  <martin@gnome.org>
17542
17543         * codegen.cs (SymbolWriter): New public variable. Returns the
17544         current symbol writer.
17545         (CodeGen): Added `bool want_debugging_support' argument to the
17546          constructor. If true, tell the ModuleBuild that we want debugging
17547         support and ask it for the ISymbolWriter.
17548         (Save): If we have a symbol writer, call it's Close() method after
17549         saving the assembly.
17550
17551         * driver.c (--debug): New command line argument to create a
17552         debugger information file.
17553
17554         * location.cs (SymbolDocument): New public property. Returns an
17555         ISymbolDocumentWriter object for the current source file or null
17556         if we don't have a symbol writer.
17557
17558 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17559
17560         * driver.cs (LoadAssembly): Correctly return when all the paths
17561         have been tried and not before.
17562
17563         * statement.cs (Switch.Emit): return the actual coverage for this
17564         statement (returns/not-returns)
17565
17566         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17567         switch of the statement if we are the last switch section.  That
17568         kills two problems: try/catch problems (we used to emit an empty
17569         nop at the end) and switch statements where all branches would
17570         return. 
17571
17572 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17573
17574         * driver.cs: Add default assemblies (the equivalent to the
17575         Microsoft CSC.RSP file)
17576
17577         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17578         also update tokens_seen and set it to false.
17579
17580         * driver.cs: Implement --recurse for Mike.
17581
17582         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17583         correctly splitting out the paths.
17584
17585 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17586
17587         * interface.cs (Interface.PopulateProperty): Instead of using
17588         `parent' as the declaration space for the set parameters, use
17589         `this' 
17590
17591         * support.cs (InternalParameters): InternalParameters constructor
17592         takes a DeclSpace instead of a TypeContainer.
17593
17594         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17595         types are being initialized, load the address of it before calling
17596         the function.  
17597
17598         (New): Provide a mechanism to disable the generation of local
17599         value type temporaries when the caller will be providing us with
17600         an address to store it.
17601
17602         (ArrayCreation.EmitDynamicInitializers): Use it.
17603
17604 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17605
17606         * expression.cs (Invocation.EmitArguments): Only probe for array
17607         property if there is more than one argument.  Sorry about that.
17608
17609         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17610         empty param arrays.
17611
17612         * class.cs (Method.LabelParameters): Fix incorrect code path that
17613         prevented the `ParamArrayAttribute' from being applied to the
17614         params attribute.
17615
17616 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17617
17618         * support.cs (ReflectionParameters): Correctly compute whether the
17619         last argument is a params array.  Fixes the problem with
17620         string.Split ('a')
17621
17622         * typemanager.cs: Make the assemblies array always be non-null
17623         (empty, but non-null)
17624
17625         * tree.cs (RecordDecl): New function that abstracts the recording
17626         of names.  This reports error 101, and provides a pointer to the
17627         previous declaration.  Fixes a crash in the compiler.
17628
17629         * cs-parser.jay (constructor_declaration): Update to new grammar,
17630         and provide a constructor_body that can be empty.
17631
17632 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17633
17634         * driver.cs: Add support for --resources.
17635
17636         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17637         Make all types for the various array helper methods be integer.
17638
17639         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17640         CheckState to ConvCast.
17641
17642         (ConvCast): Now it takes a `checked' state argument, to avoid
17643         depending on the emit context for the conversion, and just using
17644         the resolve time setting.
17645
17646         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17647         instead of Invocation.EmitArguments.  We do not emit the original
17648         arguments, instead we emit those which have been converted to
17649         unsigned int expressions.
17650
17651         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17652
17653         * codegen.cs: ditto.
17654
17655         * expression.cs (LocalVariableReference): Drop the use of the
17656         Store function that depended on the variable index.
17657
17658         * statement.cs (VariableInfo): Drop the `Idx' property from this
17659         class, as this is not taking into account the indexes for
17660         temporaries tat we generate during the execution, getting the
17661         indexes wrong.
17662
17663         * class.cs: First emit class initializers, then call the parent
17664         constructor. 
17665
17666         * expression.cs (Binary): Fix opcode emision.
17667         (UnaryMutator.EmitCode): Support checked code generation
17668
17669         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17670         matches for events for both the Static and Instance scans,
17671         pointing to the same element.   Fix that.
17672
17673 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17674
17675         * rootcontext.cs (ResolveTree): Always set the
17676         interface_resolve_order, because nested interfaces will be calling
17677         into us.
17678
17679         * class.cs (GetInterfaceOrClass): Track the same resolution
17680         process used by TypeManager.LookupType.  This fixes the nested
17681         type lookups in class declarations (separate path from
17682         LookupType). 
17683
17684         (TypeContainer.DefineType): Also define nested interfaces.
17685         (TypeContainer.RegisterOrder): New public function used to
17686         register the order in which child interfaces need to be closed.
17687
17688         Nested interfaces need to be closed after their parents have been
17689         created. 
17690
17691         * interface.cs (InterfaceAttr): Put all the logic for computing
17692         the interface attribute here. 
17693
17694         (DefineInterface): Register our interface order with the
17695         RootContext or with the TypeContainer depending on the case.
17696
17697 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17698
17699         * cs-parser.jay: rework foreach statement to work with the new
17700         changes to the policy on SimpleNames.
17701
17702         * report.cs: support Stacktrace on warnings as well.
17703
17704         * makefile: drop --unsafe and /unsafe from the compile.
17705
17706 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17707
17708         * ecore.cs (StandardConversionExists): Modify to take an Expression
17709         as the first parameter. Ensure we do null -> reference type conversion
17710         checking.
17711
17712         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17713         temporary Expression objects.
17714
17715 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17716
17717         * interface.cs: workaround bug in method overloading resolution
17718         (there is already a bugzilla bug for it).
17719
17720 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17721
17722         We could also solve this problem by having a separate path for
17723         performing type lookups, instead of DoResolve, we could have a
17724         ResolveType entry point, and only participating pieces of the
17725         production (simplename, deref, array) would implement this. 
17726
17727         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17728         signal SimpleName to only resolve type names and not attempt to
17729         resolve anything else.
17730
17731         * expression.cs (Cast): Set the flag.
17732
17733         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17734
17735         * class.cs: Only report 108 if there is no `new' modifier.
17736
17737         * cs-parser.jay: rework foreach statement to work with the new
17738         changes to the policy on SimpleNames.
17739
17740         * report.cs: support Stacktrace on warnings as well.
17741
17742         * makefile: drop --unsafe and /unsafe from the compile.
17743
17744 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17745
17746         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17747         lookups here, instead of doing that at parse time.  This means
17748         that our grammar will not introduce `LocalVariableReferences' as
17749         expressions at this point.  That solves the problem of code like
17750         this:
17751
17752         class X {
17753            static void Main ()
17754            { int X = 1;
17755             { X x = null }}}
17756
17757         This is only half the fix.  The full fix requires parameters to
17758         also be handled in this way.
17759
17760         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17761         makes the use more obvious of the DeclSpace.  The
17762         ec.TypeContainer.TypeBuilder is now only used to pull the
17763         TypeBuilder for it.
17764
17765         My theory is that I can get rid of the TypeBuilder completely from
17766         the EmitContext, and have typecasts where it is used (from
17767         DeclSpace to where it matters).  
17768
17769         The only pending problem is that the code that implements Aliases
17770         is on TypeContainer, and probably should go in DeclSpace.
17771
17772         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17773         lookups here, instead of doing that at parse time.  This means
17774         that our grammar will not introduce `LocalVariableReferences' as
17775         expressions at this point.  That solves the problem of code like
17776         this:
17777
17778         class X {
17779            static void Main ()
17780            { int X = 1;
17781             { X x = null }}}
17782
17783         This is only half the fix.  The full fix requires parameters to
17784         also be handled in this way.
17785
17786         * class.cs (Property.DefineMethod): When implementing an interface
17787         method, set newslot, when implementing an abstract method, do not
17788         set the flag (before we tried never setting it, or always setting
17789         it, which is the difference).
17790         (Indexer.DefineMethod): same.
17791         (Method.DefineMethod): same.
17792
17793         * ecore.cs: Only set the status used flag if we get back a Field.
17794
17795         * attribute.cs: Temporary hack, so Paolo can keep working.
17796
17797 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17798
17799         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17800         the unmanaged type in the case we have a MarshalAs attribute.
17801
17802         (Resolve): Handle the case when we are parsing the special MarshalAs
17803         attribute [we need to store the unmanaged type to use later]
17804
17805         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17806         MarshalAs Attribute.
17807
17808         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17809         on parameters and accordingly set the marshalling info.
17810
17811 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17812
17813         * class.cs: Optimizing slightly by removing redundant code after
17814         we switched to the `NoTypes' return value.
17815         (Property.DefineMethod): use NoTypes here too.
17816
17817         This fixes the bug I introduced in my last batch of changes.
17818
17819 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17820
17821         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17822
17823         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17824         Enums since those are types too. 
17825
17826         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17827
17828         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17829         thanks to a call during the lookup process.
17830
17831 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17832
17833         * statement.cs (Foreach): Lots of work to accomodate a particular
17834         kind of foreach statement that I had not kept in mind.  It is
17835         possible to have foreachs on classes that provide a GetEnumerator
17836         method that return objects that implement the "pattern" for using
17837         a foreach, there is no need to support GetEnumerator
17838         specifically. 
17839
17840         This is needed to compile nant.
17841
17842         * decl.cs: Only report 114 if the member is not `Finalize' and if
17843         the warning level is at least 2.
17844
17845         * class.cs: Moved the compare function from Method to
17846         MethodSignature. 
17847
17848         (MethodSignature.InheritableMemberSignatureCompare): Add new
17849         filter function that is used to extract inheritable methods from a
17850         class. 
17851
17852         (Method.Define): Use the new `inheritable_method_signature_filter'
17853         delegate
17854
17855         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17856         command. 
17857
17858 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17859
17860         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17861
17862         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17863
17864         * expression.cs: Pass location information to
17865         ConvertImplicitStandard. 
17866
17867         * class.cs: Added debugging code to track return values from
17868         interfaces. 
17869
17870 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17871
17872         * expression.cs (Is.DoResolve): If either side of the `is' is an
17873         interface, do not flag the warning.
17874
17875         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17876         for interfaces
17877
17878         * report.cs: Allow for --fatal to be used with --probe.
17879
17880         * typemanager.cs (NoTypes): Move the definition for the empty Type
17881         array here. 
17882
17883         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17884         properties. 
17885         (TypeContainer.DefineProxy): New function used to proxy to parent
17886         implementations when implementing interfaces.
17887         (TypeContainer.ParentImplements): used to lookup if our parent
17888         implements a public function that is required by an interface.
17889         (TypeContainer.VerifyPendingMethods): Hook this up.
17890
17891         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17892         `modules' and `assemblies' arraylists into arrays.  We only grow
17893         these are the very early start up of the program, so this improves
17894         the speedof LookupType (nicely measured).
17895
17896         * expression.cs (MakeByteBlob): Replaced unsafe code with
17897         BitConverter, as suggested by Paolo.
17898
17899         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17900         folding of string concatenation, but if either side is a string,
17901         and the other is not, then return null, and let the runtime use
17902         the concatenation on the string plus the object (using
17903         `Object.ToString'). 
17904
17905 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17906
17907         Constant Folding has been implemented now.
17908
17909         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17910         the error instead on types that are not supported in one's
17911         complement. 
17912
17913         * constant.cs (Constant and all children): New set of functions to
17914         perform implict and explicit conversions.
17915
17916         * ecore.cs (EnumConstant): Implement the new functions to perform
17917         conversion by proxying to the child expression.
17918
17919         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17920         own separate setting that can not be turned off from the command
17921         line using --unchecked or --checked and is only controlled using
17922         the checked/unchecked statements and expressions.  This setting is
17923         used by the constant folder to flag errors.
17924
17925         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17926         ConstantCheckState as well.   
17927
17928         During Resolve, they also have to flag the state, because the
17929         constant folder runs completely in the Resolve phase.
17930
17931         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17932         well.
17933
17934 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17935
17936         * cfold.cs: New file, this file contains the constant folder.
17937
17938         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17939         argument to track whether we are using the resulting address to
17940         load or store a value and provide better error messages. 
17941
17942         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17943         new AddressOf arguments.
17944
17945         * statement.cs (Foreach.EmitCollectionForeach): Update
17946
17947         * expression.cs (Argument.Emit): Call AddressOf with proper
17948         arguments to track usage.
17949
17950         (New.DoEmit): Call AddressOf with new arguments.
17951
17952         (Unary.Emit): Adjust AddressOf call.
17953
17954 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17955
17956         * cs-parser.jay (member_access): Change the case for pre-defined types
17957         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17958         this suggestion.
17959
17960         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17961         a method body.
17962
17963         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17964         essentially like methods and apply attributes like MethodImplOptions to them too.
17965
17966         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17967         not being null.
17968
17969         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17970         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17971         is the DeclSpace.
17972
17973         * Update code everywhere accordingly.
17974
17975         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17976
17977         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17978
17979 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17980
17981         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17982         try performing lookups against those instead of jumping straight into using
17983         the 'using' clauses.
17984
17985         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17986
17987         (LookupType): Perform lookups in implicit parents too.
17988
17989         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17990         sequence as RootContext.LookupType. 
17991
17992         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17993         the various cases of namespace lookups into this method.
17994
17995 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17996
17997         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17998         in positional arguments)
17999
18000         * class.cs (Operator): Update the AllowedModifiers to contain
18001         extern. 
18002
18003         * cs-parser.jay: Update operator declaration to allow for the
18004         operator body to be empty.
18005
18006         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18007         values. 
18008
18009 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18010
18011         * class.cs (Method.Emit): Label parameters.
18012
18013         * driver.cs: Return 1 or 0 as the program exit code.
18014
18015 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18016
18017         * expression.cs: Special case the `null' object when trying to
18018         auto-compute the type, as anything can be explicitly converted to
18019         that. 
18020
18021         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18022         spotting this Paolo.
18023
18024         (Expression.ImplicitNumericConversion): Perform comparissions of
18025         the type using the underlying type in the case of an enumeration
18026         rather than using the enumeration type for the compare.
18027
18028         Cope with the underlying == type case, which is not possible to
18029         catch before. 
18030
18031         (Expression.ConvertNumericExplicit): Perform comparissions of
18032         the type using the underlying type in the case of an enumeration
18033         rather than using the enumeration type for the compare.
18034
18035         * driver.cs: If the user does not supply an extension, assume .exe
18036
18037         * cs-parser.jay (if_statement): Rewrote so that we can track the
18038         location for the if statement.
18039
18040         * expression.cs (Binary.ConstantFold): Only concat strings when
18041         the operation is "+", not everything ;-)
18042
18043         * statement.cs (Statement.EmitBoolExpression): Take a location
18044         argument. 
18045         (If, While, Do): Track location.
18046
18047         * expression.cs (Binary.ResolveOperator): In the object + string
18048         case, I was missing a call to ConvertImplicit
18049
18050 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18051
18052         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18053         Location arguments. Ensure we use RootContext.LookupType to do our work
18054         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18055
18056         * interface.cs (PopulateMethod): Handle the type of the parameter being
18057         null gracefully.
18058
18059         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18060         have a params method with no fixed arguments and a call is made with no
18061         arguments.
18062
18063 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18064
18065         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18066         the verbatim-string-literal
18067
18068         * support.cs (InternalParameters.ParameterModifier): handle null
18069         fixed parameters.
18070         (InternalParameters.ParameterType): ditto.
18071
18072         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18073         duplicating the name of the variable parameter.
18074         (GetParameterByName): Fix bug where we were not looking up array
18075         paramters if they were the only present (thanks Paolo!).
18076         (GetParameterInfo): We only have an empty set of types if both
18077         fixed and array are set to null.
18078         (GetParameterInfo-idx): Handle FixedParameter == null
18079
18080         * cs-parser.jay: Handle the case where there is no catch
18081         statements (missing null test).
18082
18083 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18084
18085         * driver.cs (MainDriver): Be conservative on our command line
18086         handling.
18087
18088         Catch DirectoryNotFoundException when calling GetFiles.
18089
18090         (SplitPathAndPattern): Used to split the input specification into
18091         a path and a pattern that we can feed to Directory.GetFiles.
18092
18093 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18094
18095         * statement.cs (Fixed): Implement the last case of the Fixed
18096         statement (string handling).
18097
18098         * expression.cs (StringPtr): New class used to return a char * to
18099         a string;  Used by the Fixed statement.
18100
18101         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18102
18103         * expression.cs (Binary.ResolveOperator): Remove redundant
18104         MemberLookup pn parent type.
18105         Optimize union call, we do not need a union if the types are the same.
18106         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18107         type.
18108
18109         Specialize the use of MemberLookup everywhere, instead of using
18110         the default settings. 
18111
18112         (StackAlloc): Implement stackalloc keyword.
18113
18114         * cs-parser.jay: Add rule to parse stackalloc.
18115
18116         * driver.cs: Handle /h, /help, /?
18117
18118         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18119         before we supported unsafe code.
18120
18121         * makefile: add --unsafe to the self compilation of mcs.
18122
18123 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18124
18125         * expression.cs (PointerArithmetic): New class that is used to
18126         perform pointer arithmetic.
18127         (Binary.Resolve): Handle pointer arithmetic
18128         Handle pointer comparission.
18129         (ArrayPtr): Utility expression class that is used to take the
18130         address of an array.
18131
18132         (ElementAccess): Implement array access for pointers
18133
18134         * statement.cs (Fixed): Implement fixed statement for arrays, we
18135         are missing one more case before we are done.
18136
18137         * expression.cs (Indirection): Implement EmitAssign and set the
18138         ExprClass to Variable.  This allows pointer dereferences to be
18139         treated as variables, and to have values assigned to them.
18140
18141         * ecore.cs (Expression.StoreFromPtr): New utility function to
18142         store values dereferencing.
18143
18144 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18145
18146         * expression.cs (Binary.ResolveOperator): Ensure that we are
18147         not trying to operate on a void type - this fixes the reported
18148         bug.
18149
18150         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18151         the parent implementation is sealed.
18152
18153         * ../errors/cs0239.cs : Add.
18154
18155         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18156
18157         * typemanager.cs (unverifiable_code_type): Corresponds to 
18158         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18159         which have unsafe code in them.
18160
18161         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18162         unsafe context.
18163
18164 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18165
18166         * cs-tokenizer.cs: Add support for @"litreal strings"
18167
18168         Make tokenizer accept pre-processor directives
18169         on any column (remove the old C-like limitation). 
18170
18171         * rootcontext.cs (EmitCode): Emit any global attributes.
18172         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18173
18174         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18175
18176         * cs-parser.jay: Add support for global attributes.  
18177
18178 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18179
18180         * expression.cs (Indirection): New helper class.  Unary will
18181         create Indirection classes to be able to implement the
18182         IMemoryLocation interface on it.
18183
18184 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18185
18186         * cs-parser.jay (fixed_statement): reference the right statement.
18187
18188         * statement.cs (Fixed.Emit): Finish implementing the fixed
18189         statement for the &x case.
18190
18191 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18192
18193         * class.cs (Property.Define, Method.Define): Remove newslot when
18194         `implementing'.  
18195
18196         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18197         wrong.  NewSlot should only be used if the `new' keyword is present.
18198
18199         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18200         locating our system dir.  Sorry about this.
18201
18202 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18203
18204         * driver.cs (GetSystemDir): Compute correctly the location of our
18205         system assemblies.  I was using the compiler directory instead of
18206         the library directory.
18207
18208 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18209
18210         * expression.cs (BetterFunction): Put back in what Miguel commented out
18211         since it is the correct fix. The problem is elsewhere ;-)
18212
18213         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18214         parameters of the parms method are themselves compatible or not !
18215
18216         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18217         to check that a class implements an interface before saying that an implicit
18218         conversion was allowed. Use ImplementsInterface to do the checking.
18219
18220 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18221
18222         * class.cs (Method.Define): Track whether we are an explicit
18223         implementation or not.  And only call DefineMethodOverride if we
18224         are an explicit implementation.
18225
18226         (Property.DefineMethod): Ditto.
18227
18228 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18229
18230         * expression.cs (BetterFunction): Catch hideous bug which was
18231          preventing us from detecting ambiguous calls due to implicit casts i.e
18232         cs0121.
18233
18234 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18235
18236         * support.cs (Pair): Remove un-needed method.  I figured why I was
18237         getting the error in cs-parser.jay, the variable in a foreach loop
18238         is readonly, and the compiler does not really treat this as a variable.
18239
18240         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18241         instead of EQUALS in grammar.  
18242
18243         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18244
18245         * expression.cs (Unary.DoResolve): Check whether the argument is
18246         managed or not.
18247
18248 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18249
18250         * support.cs: Api for Pair to set a value.  Despite the fact that
18251         the variables are public the MS C# compiler refuses to compile
18252         code that accesses the field if the variable is part of a foreach
18253         statement. 
18254
18255         * statement.cs (Fixed): Begin implementation of the fixed
18256         statement.
18257
18258         (Block.AddVariable): Return the VariableInfo on success and null
18259         on failure instead of true/false. 
18260
18261         * cs-parser.jay (foreach): Catch errors on variables already
18262         defined (we were ignoring this value before) and properly unwind
18263         the block hierarchy
18264
18265         (fixed_statement): grammar for the fixed statement.
18266
18267 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18268
18269         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18270         pointer types to be incretemented.
18271
18272         (SizeOf): Implement.
18273
18274         * cs-parser.jay (pointer_member_access): Implement
18275         expr->IDENTIFIER production.
18276
18277         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18278         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18279         on safe contexts.
18280
18281         (Unary): Implement indirection.
18282
18283         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18284         use in non-unsafe context).
18285
18286         (SimpleName.DoResolve): Check for pointers in field access on safe
18287         contexts. 
18288
18289         (Expression.LoadFromPtr): Factor the load-indirect code in this
18290         function.  This was duplicated in UnboxCast and ParameterReference
18291
18292 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18293
18294         * expression.cs (ComposedCast): report an error if a pointer cast
18295         is used in a safe region.
18296
18297         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18298         pointer type casts in unsafe context.
18299
18300         * codegen.cs (EmitContext): Set up IsUnsafe.
18301
18302         * cs-parser.jay (non_expression_type): Add productions for pointer
18303         casts. 
18304
18305         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18306         code.  We should not use force into static mode if the method is
18307         not virtual.  Fixes bug in MIS
18308
18309         * statement.cs (Do.Emit, While.Emit, For.Emit,
18310         Statement.EmitBoolExpression): Add support to Do and While to
18311         propagate infinite loop as `I do return' semantics.
18312
18313         Improve the For case to also test for boolean constants.
18314
18315         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18316         to the list of attributes we can add.
18317
18318         Remove `EmitContext' argument.
18319
18320         * class.cs (Method.Define): Apply parameter attributes.
18321         (Constructor.Define): Apply parameter attributes.
18322         (MethodCore.LabelParameters): Move here the core of labeling
18323         parameters. 
18324
18325         * support.cs (ReflectionParameters.ParameterModifier,
18326         InternalParameters.ParameterModifier): Use IsByRef on the type and
18327         only return the OUT bit for these parameters instead of in/out/ref
18328         flags.
18329
18330         This is because I miss-understood things.  The ParameterInfo.IsIn
18331         and IsOut represent whether the parameter has the [In] and [Out]
18332         attributes set.  
18333
18334 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * ecore.cs (FieldExpr.Emit): Release temporaries.
18337
18338         * assign.cs (LocalTemporary.Release): new function.
18339
18340         * codegen.cs (EmitContext.GetTemporaryStorage,
18341         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18342         temporary storage.  Now we can "put back" localbuilders when we
18343         are done with them
18344
18345 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18346
18347         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18348         need to make a copy of the variable to generate verifiable code.
18349
18350 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18351
18352         * driver.cs: Compute dynamically the system directory.
18353
18354         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18355         Slower, but more generally useful.  Used by the abstract
18356         registering implementation. 
18357
18358         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18359         the rules for the special rule on Type/instances.  First check if
18360         we have the same name, and if so, try that special static path
18361         rather than the instance path.
18362
18363 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18364
18365         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18366         for, while and if.
18367
18368         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18369         Enum, ValueType, Delegate or Array for non-corlib compiles.
18370
18371         * cs-tokenizer.cs: Catch long identifiers (645)
18372
18373         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18374         piece of code.
18375
18376         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18377         fix, we were returning too early, so we were not registering
18378         pending methods from abstract classes.
18379
18380         Do not register pending methods if the class is abstract.
18381
18382         * expression.cs (Conditional.DoResolve): Report circular implicit
18383         conversions when we neecd to compute it for conditional
18384         expressions. 
18385
18386         (Is.DoResolve): If the expression is always of the provided type,
18387         flag warning 183.  If the expression can not ever be of the
18388         provided type flag warning 184.
18389
18390         * class.cs: Catch 169 as well.
18391
18392         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18393         read. 
18394
18395 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18396
18397         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18398
18399 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18400
18401         * interface.cs: (PopulateMethod): Check for pointers being defined
18402         only if the unsafe context is active.
18403         (PopulateProperty): ditto.
18404         (PopulateIndexer): ditto.
18405
18406         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18407         specified.  If pointers are present, make sure that they are
18408         present in an unsafe context.
18409         (Constructor, Constructor.Define): ditto.
18410         (Field, Field.Define): ditto.
18411         (Property, Property.Define): ditto.
18412         (Event, Event.Define): ditto.
18413
18414         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18415         hashtable if there are classes or structs defined.
18416
18417         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18418         code, as the constant resolution moved.
18419
18420         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18421         the metadata, so we can flag error 133. 
18422
18423         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18424         pointer is being declared in an unsafe context.
18425
18426 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18427
18428         * modifiers.cs (Modifiers.Check): Require a Location argument.
18429         Report error 227 for Unsafe use.
18430
18431         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18432
18433         * statement.cs (For.Emit): If the test is null, then report that
18434         we do `return', as we wont reach anything afterwards.
18435
18436         (Switch.SwitchGoverningType): Track the expression that matched
18437         the conversion.
18438
18439         * driver.cs: Allow negative numbers as an error code to flag.
18440
18441         * cs-parser.jay: Handle 1551.
18442
18443         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18444
18445 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18446
18447         * cs-parser.jay: Report 1518 (type declaration can only contain
18448         class, struct, interface, enum or delegate)
18449
18450         (switch_label): Report 1523 (keywords `case' or `default' must
18451         preced code)
18452
18453         (opt_switch_sections): Report 1522 (empty switch)
18454
18455         * driver.cs: Report 1515 (response file specified multiple times)
18456         Report 1516 (Source file specified multiple times).
18457
18458         * expression.cs (Argument.Resolve): Signal 1510
18459
18460         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18461         access not allowed in static code)
18462
18463 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18464
18465         * typemanager.cs (IsPointerType): Utility method which we are going
18466         to need a lot.
18467
18468         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18469         the object type, so we take care of that.
18470
18471         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18472
18473         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18474         added to non-params parameters :-)
18475
18476         * typemanager.cs (CSharpName): Include 'void' type too. 
18477
18478         (void_ptr_type): Include in the set of core types.
18479
18480         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18481         duplicating code.
18482
18483         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18484         an unsafe context.
18485
18486         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18487         completely forgotten about it.
18488
18489 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18490
18491         * cs-parser.jay (pointer_type): Add. This begins our implementation
18492         of parsing rules for unsafe code.
18493
18494         (unsafe_statement): Implement.
18495
18496         (embedded_statement): Modify to include the above.
18497
18498         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18499
18500         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18501         if the current context is an unsafe one.
18502
18503         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18504         are handled differently, we need separate rules for them.
18505
18506         (local_variable_declaration): Update to use local_variable_pointer_type
18507         to allow variable declarations of unmanaged pointer types.
18508
18509         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18510         in unsafe contexts.
18511
18512         * ../errors/cs0214.cs : Add.
18513
18514 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18515
18516         * makefile: remove 'response' file when cleaning.
18517
18518 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18519
18520         * cs-parser.jay: Report 1524.
18521
18522 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18523
18524         * typemanager.cs (RegisterMethod): drop checking if we have
18525         registered this from here
18526
18527 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18528
18529         * class.cs (Method.EmitDestructor): Implement calling our base
18530         destructor. 
18531
18532         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18533         value of InFinally.
18534
18535         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18536         this routine and will wrap the call in a try/catch block.  Deal
18537         with the case.
18538
18539 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18540
18541         * ecore.cs (Expression.MemberLookup): instead of taking a
18542         parameter `same_type' that was used to tell whether we could
18543         access private members we compute our containing type from the
18544         EmitContext.
18545
18546         (FieldExpr): Added partial support for volatile fields.  This does
18547         not work for volatile fields exposed from assemblies, as I can not
18548         figure out how to extract the modreq from it.
18549
18550         Updated all the source files to use this.
18551
18552         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18553         because it is referenced by MemberLookup very often. 
18554
18555 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18556
18557         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18558         TypeBuilder.GetCustomAttributes to retrieve what we need.
18559
18560         Get rid of redundant default_member_attr_type as this is the same as
18561         default_member_type which already exists.
18562
18563         * interface.cs, attribute.cs : Update accordingly.
18564
18565 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18566
18567         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18568         work for TYpeBuilders though.  Ravi, can you please fix this?
18569
18570         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18571
18572         * expression.cs (Argument.Emit): Handle the case of ref objects
18573         being passed to ref functions;  
18574
18575         (ParameterReference.EmitLoad): Loads the content of the pointer
18576         without dereferencing.
18577
18578 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18579
18580         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18581
18582 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18583
18584         * class.cs (Indexer.DefineMethod): Incorporate the interface
18585         type in the name of the method if we are doing explicit interface
18586         implementation.
18587
18588         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18589
18590         (BetterConversion): Fix extremely trivial bug where we were referring to
18591         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18592         again !
18593
18594         * ../errors/bug16.cs : Add although we have fixed it.
18595
18596 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18597
18598         * expression.cs (BaseIndexer): Begin implementation.
18599
18600         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18601
18602         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18603         production directly to remove a shift/reduce, and implement
18604         explicit interface implementation.
18605
18606         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18607         after a floating point suffix.
18608
18609         * expression.cs (DoNumericPromotions): Improved the conversion for
18610         uint/uint.  If we have a constant, we avoid doing a typecast to a
18611         larger type.
18612
18613         * class.cs (Indexer): Implement explicit interface implementation
18614         for indexers.
18615
18616 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18617
18618         * class.cs: make the default instance constructor public and hidebysig.
18619
18620 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18621
18622         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18623         so we can call it from elsewhere.
18624
18625         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18626         we emit it internally if the class has a defined indexer; otherwise the user
18627         emits it by decorating the class definition with the DefaultMemberAttribute.
18628
18629         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18630         attribute is not used on a type which defines an indexer.
18631
18632         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18633         character when we skip whitespace.
18634
18635         * ../errors/cs0646.cs : Add.
18636
18637 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18638
18639         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18640         again. 
18641
18642         * makefile: Add practical target `mcs3.exe' which builds the third
18643         generation compiler. 
18644
18645         * expression.cs (New): Fix structures constructor calling.
18646
18647         * class.cs (Property, Method, Indexer): Emit Final flag on the
18648         method if we are an interface implementation and we are not
18649         abstract. 
18650
18651         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18652         whether this property is referencing a `base' method.
18653
18654         * expression.cs (Invocation.EmitCall): take an extra argument:
18655         is_base, this is used to determine whether the `call' or
18656         `callvirt' opcode should be used.
18657
18658
18659         * delegate.cs: update EmitCall.
18660
18661         * class.cs (Method.Define): Set NewSlot for the cases where we are
18662         not implementing an interface method.
18663
18664         (Property.Define): ditto.
18665
18666 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18667
18668         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18669         'r'.  Allows mcs to parse itself fully.
18670
18671 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18672
18673         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18674         of the number of initializers that require the InitializeArray method.
18675
18676         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18677         update the above field where necessary.
18678
18679         (MakeByteBlob): Update accordingly.
18680
18681         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18682         greater than 2.
18683
18684         (EmitDynamicInitializers): Update in accordance with the new optimization.
18685
18686         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18687         same OpCode applies.
18688
18689         * cs-parser.jay : Fix some glaring errors I introduced.
18690
18691 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18692
18693         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18694         so that we can check for name clashes there too.
18695
18696         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18697         for interface indexers.
18698
18699         * interfaces.cs (Define): Emit the default member attribute.
18700
18701         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18702         variable was being referred to while setting the value ;-)
18703
18704 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18705
18706         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18707         byte-by-byte information when we know the data is zero.
18708
18709         Make the block always a multiple of 4, because
18710         DefineInitializedData has a bug.
18711
18712         * assign.cs: Fix, we should assign from the temporary, not from
18713         the source. 
18714
18715         * expression.cs (MakeByteBlob): Fix my incorrect code.
18716
18717 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18718
18719         * typemanager.cs (EnumToUnderlying): This function is used to get
18720         the underlying type from an enumeration, because it does not
18721         always work. 
18722
18723         * constant.cs: Use the I4_S form for values between -128 and 127.
18724
18725         * statement.cs (Block.LookupLabel): Looks up a label.
18726         (Block): Drop support for labeled blocks.
18727
18728         (LabeledStatement): New kind of statement that represents a label
18729         only.
18730
18731         (Goto): Finally implement this bad boy.
18732
18733         * cs-parser.jay: Update to reflect new mechanism to implement
18734         labels.
18735
18736 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18737
18738         * codegen.cs (EmitContext.This): a codegen property that keeps the
18739         a single instance of this instead of creating many different this
18740         instances. 
18741
18742         * delegate.cs (Delegate.DoResolve): Update to use the property;
18743
18744         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18745
18746         * expression.cs (BaseAccess.DoResolve): Ditto.
18747
18748 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18749
18750         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18751         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18752
18753         (InitCoreTypes): Update accordingly.
18754
18755         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18756         so we can quickly store the state.
18757
18758         (ApplyAttributes): Set the correct implementation flags
18759         for InternalCall methods.
18760
18761 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18762
18763         * expression.cs (EmitCall): if a method is not virtual, then do
18764         not use callvirt on it.
18765
18766         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18767         user defined stuff) requires the use of stobj, which takes an
18768         address on the stack instead of an array and an index.  So emit
18769         the Ldelema operation for it.
18770
18771         (EmitStoreOpcode): Use stobj for valuetypes.
18772
18773         (UnaryMutator.EmitCode): Use the right 1 value depending on
18774         whether we are dealing with int64/uint64, float or doubles.
18775
18776         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18777         constructors that I implemented last night.
18778
18779         (Constructor.IsDefault): Fix to work properly for static
18780         constructors.
18781
18782         * cs-parser.jay (CheckDef): report method signature errors.
18783         Update error number 103 to be 132.
18784
18785         * decl.cs: New AdditionResult enumeration value: MethodExists.
18786         Although we do this check for methods later on in the semantic
18787         analysis, catching repeated default constructors is so easy that
18788         we catch these here. 
18789
18790         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18791         promotions code.
18792
18793         (ParameterReference.EmitAssign, Emit): handle
18794         bools as bytes.
18795
18796         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18797         (ArrayAccess.EmitStoreOpcode): ditto.
18798
18799         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18800
18801         * expression.cs (MakeByteBlob): Complete all the missing types
18802         (uint, short, ushort, byte, sbyte)
18803
18804         * class.cs: Only init instance field initializers on instance
18805         constructors. 
18806
18807         Rename `constructors' to instance_constructors. 
18808
18809         (TypeContainer.AddConstructor): Only add constructors to the list
18810         if it is not static.
18811
18812         Make sure that we handle default_static_constructor independently
18813         everywhere where we handle instance_constructors
18814
18815 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18816
18817         * class.cs: Do not lookup or create a base initializer for a
18818         static constructor.
18819
18820         (ConstructorInitializer.Resolve): use the proper type to lookup
18821         for constructors.
18822
18823         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18824
18825         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18826         in DeclSpace. 
18827
18828         * decl.cs: CloseType is now an virtual method, the default
18829         implementation just closes this type.
18830
18831 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18832
18833         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18834         to PreserveSig by default. Also emit HideBySig on such methods.
18835
18836         Basically, set the defaults to standard values.
18837
18838         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18839         argument, if candidate is better, it can't be worse than the best !
18840
18841         (Invocation): Re-write bits to differentiate between methods being
18842         applicable in their expanded form and their normal form - for params
18843         methods of course.
18844
18845         Get rid of use_standard everywhere as only standard conversions are allowed
18846         in overload resolution. 
18847
18848         More spec conformance.
18849
18850 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18851
18852         * driver.cs: Add --timestamp, to see where the compiler spends
18853         most of its time.
18854
18855         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18856         `this' in static code.
18857
18858         (SimpleName.DoResolve): Implement in terms of a helper function
18859         that allows static-references to be passed upstream to
18860         MemberAccess.
18861
18862         (Expression.ResolveWithSimpleName): Resolve specially simple
18863         names when called by MemberAccess to implement the special
18864         semantics. 
18865
18866         (Expression.ImplicitReferenceConversion): Handle conversions from
18867         Null to reference types before others, as Null's type is
18868         System.Object. 
18869
18870         * expression.cs (Invocation.EmitCall): Handle the special case of
18871         calling methods declared on a reference type from a ValueType
18872         (Base classes System.Object and System.Enum)
18873
18874         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18875         the left hand side is a TypeExpr, not on every enumeration. 
18876
18877         (Binary.Resolve): If types are reference types, then do a cast to
18878         object on operators != and == of both arguments.
18879
18880         * typemanager.cs (FindMembers): Extract instance and static
18881         members if requested.
18882
18883         * interface.cs (PopulateProperty): Use void_type instead of null
18884         as the return type for the setter method.
18885
18886         (PopulateIndexer): ditto.
18887
18888 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18889
18890         * support.cs (ReflectionParameters): Fix minor bug where we
18891         were examining the wrong parameter for the ParamArray attribute.
18892
18893         Cope with requests for the type of the parameter at position
18894         greater than the params parameter's. We now return the element
18895         type of the params array as that makes more sense.
18896
18897         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18898         accordingly as we no longer have to extract the element type
18899         ourselves.
18900
18901         (Invocation.OverloadResolve): Update.
18902
18903 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18904
18905         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18906         against IEnumerator, test whether the return value is a descendant
18907         of the IEnumerator interface.
18908
18909         * class.cs (Indexer.Define): Use an auxiliary method to implement
18910         the other bits of the method definition.  Begin support for
18911         explicit interface implementation.
18912
18913         (Property.DefineMethod): Use TypeManager.void_type instead of null
18914         for an empty return value.
18915
18916 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18917
18918         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18919         dealing with a FieldExpr which is composed of a FieldBuilder, in
18920         the code path we did extract the constant, but we should have
18921         obtained the underlying value to be able to cast it (otherwise we
18922         end up in an infinite loop, this is what Ravi was running into).
18923
18924         (ArrayCreation.UpdateIndices): Arrays might be empty.
18925
18926         (MemberAccess.ResolveMemberAccess): Add support for section
18927         14.5.4.1 that deals with the special case of E.I when E is a type
18928         and something else, that I can be a reference to a static member.
18929
18930         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18931         handle a particular array type to create byte blobs, it is just
18932         something we dont generate byteblobs for.
18933
18934         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18935         arguments. 
18936
18937         * location.cs (Push): remove the key from the hashtable that we
18938         are about to add.   This happens for empty files.
18939
18940         * driver.cs: Dispose files after we have parsed them.
18941
18942         (tokenize): new function that only runs the tokenizer on its
18943         input, for speed testing.
18944
18945 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18946
18947         * class.cs (Event.Define): Define the private field only if there
18948         are no accessors defined.
18949
18950         * expression.cs (ResolveMemberAccess): If there is no associated
18951         field with the event, that means we have an event defined with its
18952         own accessors and we should flag error cs0070 since transforming
18953         ourselves into a field is not valid in that case.
18954
18955         * ecore.cs (SimpleName.DoResolve): Same as above.
18956
18957         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18958         and charset to sane values.
18959
18960 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18961
18962         * assign.cs (DoResolve): Perform check on events only if they 
18963         are being accessed outside the declaring type.
18964
18965         * cs-parser.jay (event_declarations): Update rules to correctly
18966         set the type of the implicit parameter etc.
18967
18968         (add_accessor, remove_accessor): Set current local parameters.
18969
18970         * expression.cs (Binary): For delegate addition and subtraction,
18971         cast the return value from the method into the appropriate delegate
18972         type.
18973
18974 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18975
18976         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18977         of these as the workaround is unnecessary.
18978
18979         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18980         delegate data - none of that is needed at all.
18981
18982         Re-write bits to extract the instance expression and the delegate method
18983         correctly.
18984
18985         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18986         on delegates too.
18987
18988         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18989         of attaching attributes instead of duplicating code everywhere.
18990
18991         * everywhere : Update code to do attribute emission using the above method.
18992
18993 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18994
18995         * expression.cs (IsParamsMethodApplicable): if there are not
18996         parameters, return immediately.
18997
18998         * ecore.cs: The 0 literal can be implicity converted to an enum
18999         type. 
19000
19001         (SimpleName.DoResolve): First lookup the type, then lookup the
19002         members. 
19003
19004         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19005         want to get its address.  If the InstanceExpression is not
19006         addressable, store the result in a temporary variable, then get
19007         the address of it.
19008
19009         * codegen.cs: Only display 219 errors on warning level or above. 
19010
19011         * expression.cs (ArrayAccess): Make it implement the
19012         IMemoryLocation interface.
19013
19014         (Binary.DoResolve): handle the operator == (object a, object b)
19015         and operator != (object a, object b) without incurring into a
19016         BoxedCast (because 5 != o should never be performed).
19017
19018         Handle binary enumerator operators.
19019
19020         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19021         value type, otherwise use Ldelem_ref.
19022
19023         Use precomputed names;
19024
19025         (AddressOf): Implement address of
19026
19027         * cs-parser.jay (labeled_statement): Fix recursive block
19028         addition by reworking the production.
19029
19030         * expression.cs (New.DoEmit): New has a special case:
19031                 
19032                  If we are dealing with a ValueType, we have a few
19033                  situations to deal with:
19034                 
19035                     * The target of New is a ValueType variable, that is
19036                       easy, we just pass this as the variable reference
19037                 
19038                     * The target of New is being passed as an argument,
19039                       to a boxing operation or a function that takes a
19040                       ValueType.
19041                 
19042                       In this case, we need to create a temporary variable
19043                       that is the argument of New.
19044
19045
19046 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19047
19048         * rootcontext.cs (LookupType): Check that current_type is not null before
19049         going about looking at nested types.
19050
19051         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19052         not implement the IAssignMethod interface any more.
19053
19054         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19055         where we tranform them into FieldExprs if they are being resolved from within
19056         the declaring type.
19057
19058         * ecore.cs (SimpleName.DoResolve): Do the same here.
19059
19060         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19061
19062         * ../errors/bug10.cs : Add.
19063
19064         * ../errors/cs0070.cs : Add.
19065
19066         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19067
19068         * assign.cs : Get rid of EventIsLocal everywhere.
19069
19070 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19071
19072         * ecore.cs (ConvertIntLiteral): finished the implementation.
19073
19074         * statement.cs (SwitchLabel): Convert the value we are using as a
19075         key before looking up the table.
19076
19077 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19078
19079         * codegen.cs (EmitTopBlock): Require a Location argument now.
19080
19081         * cs-parser.jay (constructor_declarator): We need to setup
19082         current_local_parameters before we parse the
19083         opt_constructor_initializer, to allow the variables to be bound
19084         to the constructor arguments.
19085
19086         * rootcontext.cs (LookupType): First lookup nested classes in our
19087         class and our parents before we go looking outside our class.
19088
19089         * expression.cs (ConstantFold): Extract/debox the values at the
19090         beginnning. 
19091
19092         * rootcontext.cs (EmitCode): Resolve the constants first before we
19093         resolve the types.  This is not really needed, but it helps debugging.
19094
19095         * statement.cs: report location.
19096
19097         * cs-parser.jay: pass location to throw statement.
19098
19099         * driver.cs: Small bug fix.
19100
19101         * report.cs: Updated format to be 4-zero filled digits.
19102
19103 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19104
19105         * expression.cs (CheckIndices): Fix minor bug where the wrong
19106         variable was being referred to ;-)
19107
19108         (DoEmit): Do not call EmitStaticInitializers when the 
19109         underlying type is System.Object.
19110
19111 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19112
19113         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19114         and do the usual workaround for SRE.
19115
19116         * class.cs (MyEventBuilder.EventType): New member to get at the type
19117         of the event, quickly.
19118
19119         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19120
19121         * assign.cs (Assign.DoResolve): Handle the case when the target
19122         is an EventExpr and perform the necessary checks.
19123
19124         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19125         interface.
19126
19127         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19128
19129         (EventExpr): Set the type in the constructor itself since we 
19130         are meant to be born fully resolved.
19131
19132         (EventExpr.Define): Revert code I wrote earlier.
19133                 
19134         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19135         instance expression is null. The instance expression is a This in that case
19136         or a null, depending on whether it is a static method or not.
19137
19138         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19139         refers to more than one method.
19140
19141         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19142         and accordingly flag errors.
19143
19144 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19145
19146         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19147
19148 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19149
19150         * location.cs (ToString): Provide useful rutine.
19151
19152 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19153
19154         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19155         objects, return the actual integral boxed.
19156
19157         * statement.cs (SwitchLabel): define an ILLabel for each
19158         SwitchLabel. 
19159
19160         (Switch.CheckSwitch): If the value is a Literal, extract
19161         the underlying literal.
19162
19163         Also in the unused hashtable we had, add the SwitchLabel so we can
19164         quickly look this value up.
19165
19166         * constant.cs: Implement a bunch of new constants.  Rewrite
19167         Literal based on this.  Made changes everywhere to adapt to this.
19168
19169         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19170         dereferencing array only once, and also copes with enumrations.
19171
19172         bytes are two bytes wide, not one.
19173
19174         (Cast): Perform constant conversions.
19175
19176         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19177         wrappers to the literals here.
19178
19179         * expression.cs (DoNumericPromotions): long literals can converted
19180         to ulong implicity (this is taken care of elsewhere, but I was
19181         missing this spot).
19182
19183         * ecore.cs (Expression.Literalize): Make the return type Literal,
19184         to improve type checking.
19185
19186         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19187
19188 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * literal.cs: Revert code from ravi that checked the bounds.  The
19191         bounds are sane by the definition of the type itself. 
19192
19193         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19194         need to actually look up in our parent hierarchy for interfaces
19195         implemented. 
19196
19197         * const.cs: Use the underlying type for enumerations
19198
19199         * delegate.cs: Compute the basename for the delegate creation,
19200         that should fix the delegate test case, and restore the correct
19201         Type Lookup semantics in rootcontext
19202
19203         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19204         referencing a nested type with the Reflection API is using the "+"
19205         sign. 
19206
19207         * cs-parser.jay: Do not require EOF token at the end.
19208
19209 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19210
19211         * rootcontext.cs (LookupType): Concatenate type names with
19212         a '.' instead of a '+' The test suite passes again.
19213
19214         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19215         field of the enumeration.
19216
19217         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19218         the case when the member is an EventExpr.
19219
19220         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19221         static has an associated instance expression.
19222
19223         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19224
19225         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19226
19227         * class.cs (Event.Define): Register event and perform appropriate checks
19228         for error #111.
19229
19230         We define the Add and Remove methods even if the use provides none because
19231         in that case, we provide default implementations ourselves.
19232
19233         Define a private field of the type of the event. This is done by the CSC compiler
19234         and we should be doing it too ;-)
19235
19236         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19237         More methods we use in code we generate.
19238
19239         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19240         is important.
19241
19242         (InitCoreTypes): Update accordingly for the above.
19243
19244         * class.cs (Event.Emit): Generate code for default accessors that we provide
19245
19246         (EmitDefaultMethod): Do the job in the above.
19247
19248         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19249         appropriate place.
19250
19251 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19252
19253         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19254         builders even if we were missing one.
19255
19256         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19257         pass the Basename as our class name instead of the Name.  The
19258         basename will be correctly composed for us.
19259
19260         * parameter.cs (Paramters): Now takes a Location argument.
19261
19262         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19263         make all the code call directly LookupType in RootContext and take
19264         this chance to pass the Location information everywhere.
19265
19266         * Everywhere: pass Location information.
19267
19268 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19269
19270         * class.cs (Constructor.Define): Updated way of detecting the
19271         length of the parameters.
19272
19273         (TypeContainer.DefineType): Use basename as the type name for
19274         nested types.
19275
19276         (TypeContainer.Define): Do not recursively define types here, as
19277         definition is taken care in order by the RootContext.
19278
19279         * tree.cs: Keep track of namespaces in a per-file basis.
19280
19281         * parameter.cs (Parameter.ComputeSignature): Update to use
19282         DeclSpace. 
19283
19284         (Parameters.GetSignature): ditto.
19285
19286         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19287         instead of a TypeContainer.
19288
19289         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19290         resolve names.  Because we need to be resolve in our context, not
19291         our parents.
19292
19293         * driver.cs: Implement response files.
19294
19295         * class.cs (TypeContainer.DefineType): If we are defined, do not
19296         redefine ourselves.
19297
19298         (Event.Emit): Emit the code for add/remove handlers.
19299         (Event.Define): Save the MethodBuilders for add/remove.
19300
19301         * typemanager.cs: Use pair here too.
19302
19303         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19304         DictionaryEntry requires the first argument to be non-null.  
19305
19306         (enum_declaration): Compute full name for registering the
19307         enumeration.
19308
19309         (delegate_declaration): Instead of using
19310         formal_parameter_list, use opt_formal_parameter_list as the list
19311         can be empty.
19312
19313         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19314         (EventParsing): New property that controls whether `add' and
19315         `remove' are returned as tokens or identifiers (for events);
19316
19317 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19318
19319         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19320         use MyEventBuilder only and let it wrap the real builder for us.
19321
19322         (MyEventBuilder): Revamp constructor etc.
19323
19324         Implement all operations that we perform on EventBuilder in precisely the same
19325         way here too.
19326
19327         (FindMembers): Update to use the EventBuilder member.
19328
19329         (Event.Emit): Update accordingly.
19330
19331 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19332
19333         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19334         by calling the appropriate methods.
19335
19336         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19337         useful.
19338
19339         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19340
19341 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19342
19343         * delegate.cs (Delegate.Populate): Check that the return type
19344         and various parameters types are indeed accessible.
19345
19346         * class.cs (Constructor.Define): Same here.
19347
19348         (Field.Define): Ditto.
19349
19350         (Event.Define): Ditto.
19351
19352         (Operator.Define): Check that the underlying Method defined itself
19353         correctly - so it's MethodBuilder should not be null.
19354
19355         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19356         expression happens to be null.
19357
19358         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19359         members but as of now we don't seem to be able to do anything really useful with it.
19360
19361         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19362         not the EventBuilder.
19363
19364 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19365
19366         * cs-tokenizer.cs: Add support for defines.
19367         Add support for #if, #elif, #else, #endif
19368
19369         (eval_var): evaluates a variable.
19370         (eval): stubbed for evaluating functions.
19371
19372         * cs-parser.jay: Pass the defines information
19373
19374         * driver.cs: Add --define command line option.
19375
19376         * decl.cs: Move MemberCore here.
19377
19378         Make it the base class for DeclSpace.  This allows us to catch and
19379         report 108 and 109 for everything now.
19380
19381         * class.cs (TypeContainer.Define): Extract all the members
19382         before populating and emit the warning 108 (new keyword required
19383         to override) instead of having each member implement this.
19384
19385         (MemberCore.Define): New abstract method, we will be using this in
19386         the warning reporting engine in Populate.
19387
19388         (Operator.Define): Adjust to new MemberCore protocol. 
19389
19390         * const.cs (Const): This does not derive from Expression, it is a
19391         temporary object we use to create fields, it is a MemberCore. 
19392
19393         * class.cs (Method.Define): Allow the entry point to be in a
19394         specific class.
19395
19396         * driver.cs: Rewrite the argument handler to clean it up a bit.
19397
19398         * rootcontext.cs: Made it just an auxiliary namespace feature by
19399         making everything static.
19400
19401         * driver.cs: Adapt code to use RootContext type name instead of
19402         instance variable.
19403
19404         * delegate.cs: Remove RootContext argument.
19405
19406         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19407         argument. 
19408
19409         * class.cs (Event.Define): The lookup can fail.
19410
19411         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19412
19413         * expression.cs: Resolve the this instance before invoking the code.
19414
19415 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19416
19417         * cs-parser.jay: Add a production in element_access that allows
19418         the thing to become a "type" reference.  This way we can parse
19419         things like "(string [])" as a type.
19420
19421         Note that this still does not handle the more complex rules of
19422         casts. 
19423
19424
19425         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19426
19427         * ecore.cs: (CopyNewMethods): new utility function used to
19428         assemble the list of methods from running FindMembers.
19429
19430         (MemberLookup): Rework FindMembers so that 
19431
19432 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19433
19434         * class.cs (TypeContainer): Remove Delegates who fail to be
19435         defined.
19436
19437         * delegate.cs (Populate): Verify that we dont get null return
19438         values.   TODO: Check for AsAccessible.
19439
19440         * cs-parser.jay: Use basename to emit error 574 (destructor should
19441         have the same name as container class), not the full name.
19442
19443         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19444         possible representation.  
19445
19446         Also implements integer type suffixes U and L.
19447
19448 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19449
19450         * expression.cs (ArrayCreation.DoResolve): We need to do the
19451         argument resolution *always*.
19452
19453         * decl.cs: Make this hold the namespace.  Hold the root context as
19454         well.
19455         (LookupType): Move here.
19456
19457         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19458
19459         * location.cs (Row, Name): Fixed the code, it was always returning
19460         references to the first file.
19461
19462         * interface.cs: Register properties defined through interfaces.
19463
19464         * driver.cs: Add support for globbing on the command line
19465
19466         * class.cs (Field): Make it derive from MemberCore as well.
19467         (Event): ditto.
19468
19469 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19470
19471         * class.cs (Event::Define): Check that the type of the event is a delegate
19472         type else flag error #66.
19473
19474         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19475         same.
19476
19477         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19478         values of EntryPoint, CharSet etc etc.
19479
19480         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19481
19482         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19483         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19484         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19485         which needs this to do its work.
19486
19487         * ../errors/cs0066.cs : Add.
19488
19489 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19490
19491         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19492         helper functions.
19493
19494         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19495         clears out the parameters field.
19496         (MemberSignatureCompare): Cleanup
19497
19498         (MemberCore): New base class used to share code between MethodCore
19499         and Property.
19500
19501         (RegisterRequiredImplementations) BindingFlags.Public requires
19502         either BindingFlags.Instace or Static.  Use instance here.
19503
19504         (Property): Refactored code to cope better with the full spec.
19505
19506         * parameter.cs (GetParameterInfo): Return an empty array instead
19507         of null on error.
19508
19509         * class.cs (Property): Abstract or extern properties have no bodies.
19510
19511         * parameter.cs (GetParameterInfo): return a zero-sized array.
19512
19513         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19514         method modifier validation to the typecontainer so we can reuse
19515         this on properties.
19516
19517         (MethodCore.ParameterTypes): return an empty sized array of types.
19518
19519         (Property.Define): Test property modifier validity.
19520
19521         Add tests for sealed/override too.
19522
19523         (Method.Emit): abstract or extern methods have no bodies.
19524
19525 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19526
19527         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19528         thing.
19529
19530         (Method::Define, ::Emit): Modify accordingly.
19531
19532         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19533
19534         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19535
19536         * makefile: Pass in /unsafe.
19537
19538 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19539
19540         * class.cs (MakeKey): Kill routine.
19541
19542         * class.cs (TypeContainer.Define): Correctly define explicit
19543         method implementations (they require the full interface name plus
19544         the method name).
19545
19546         * typemanager.cs: Deply the PtrHashtable here and stop using the
19547         lame keys.  Things work so much better.
19548
19549         This of course broke everyone who depended on `RegisterMethod' to
19550         do the `test for existance' test.  This has to be done elsewhere.
19551
19552         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19553         the object stupid Equals method (because, that like fails all over
19554         the place).  We still do not use it.
19555
19556         * class.cs (TypeContainer.SetRequiredInterface,
19557         TypeContainer.RequireMethods): Killed these two routines and moved
19558         all the functionality to RegisterRequiredImplementations.
19559
19560         (TypeContainer.RegisterRequiredImplementations): This routine now
19561         registers all the implementations required in an array for the
19562         interfaces and abstract methods.  We use an array of structures
19563         which can be computed ahead of time to reduce memory usage and we
19564         also assume that lookups are cheap as most classes will not
19565         implement too many interfaces.
19566
19567         We also avoid creating too many MethodSignatures.
19568
19569         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19570         clear the "pending" bit if we find that there are problems with
19571         the declaration.
19572
19573         (TypeContainer.VerifyPendingMethods): Update to report errors of
19574         methods that look like implementations but are not.
19575
19576         (TypeContainer.Define): Add support for explicit interface method
19577         implementation. 
19578
19579 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19580
19581         * typemanager.cs: Keep track of the parameters here instead of
19582         being a feature of the TypeContainer.
19583
19584         * class.cs: Drop the registration of parameters here, as
19585         InterfaceMethods are also interface declarations.
19586
19587         * delegate.cs: Register methods with the TypeManager not only with
19588         the TypeContainer.  This code was buggy.
19589
19590         * interface.cs: Full registation here.
19591
19592 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * expression.cs: Remove reducer for binary expressions, it can not
19595         be done this way.
19596
19597         * const.cs: Put here the code that used to go into constant.cs
19598
19599         * constant.cs: Put here the code for constants, this is a new base
19600         class for Literals.
19601
19602         * literal.cs: Make Literal derive from Constant.
19603
19604 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * statement.cs (Return.Emit): Report error 157 if the user
19607         attempts to return from a finally block.
19608
19609         (Return.Emit): Instead of emitting a return, jump to the end of
19610         the function.
19611
19612         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19613         LocalBuilder to store the result of the function.  ReturnLabel is
19614         the target where we jump.
19615
19616
19617 2001-12-09  Radek Doulik  <rodo@ximian.com>
19618
19619         * cs-parser.jay: remember alias in current namespace
19620
19621         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19622         namespaces
19623
19624         * class.cs (LookupAlias): lookup alias in my_namespace
19625
19626         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19627         aliases hashtable
19628         (LookupAlias): lookup alias in this and if needed in parent
19629         namespaces
19630
19631 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19632
19633         * support.cs: 
19634
19635         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19636         making things static.  I need this to avoid passing the
19637         TypeContainer when calling ParameterType.
19638
19639         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19640         that did string manipulation to compute the type and then call
19641         GetType.  Use Parameter.ParameterType instead.
19642
19643         * cs-tokenizer.cs: Consume the suffix for floating values.
19644
19645         * expression.cs (ParameterReference): figure out whether this is a
19646         reference parameter or not.  Kill an extra variable by computing
19647         the arg_idx during emission.
19648
19649         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19650         function that returns whether a parameter is an out/ref value or not.
19651
19652         (Parameter.ParameterType): The type of the parameter (base,
19653         without ref/out applied).
19654
19655         (Parameter.Resolve): Perform resolution here.
19656         (Parameter.ExternalType): The full type (with ref/out applied).
19657
19658         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19659         support for expressions on the using statement.
19660
19661 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19662
19663         * statement.cs (Using.EmitLocalVariableDecls): Split the
19664         localvariable handling of the using statement.
19665
19666         (Block.EmitMeta): Keep track of variable count across blocks.  We
19667         were reusing slots on separate branches of blocks.
19668
19669         (Try.Emit): Emit the general code block, we were not emitting it. 
19670
19671         Check the type of the declaration to be an IDisposable or
19672         something that can be implicity converted to it. 
19673
19674         Emit conversions if required.
19675
19676         * ecore.cs (EmptyExpression): New utility class.
19677         (Expression.ImplicitConversionExists): New utility function.
19678
19679 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19680
19681         * statement.cs (Using): Implement.
19682
19683         * expression.cs (LocalVariableReference): Support read only variables.
19684
19685         * statement.cs: Remove the explicit emit for the Leave opcode.
19686         (VariableInfo): Add a readonly field.
19687
19688 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19689
19690         * ecore.cs (ConvCast): new class used to encapsulate the various
19691         explicit integer conversions that works in both checked and
19692         unchecked contexts.
19693
19694         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19695         properly generate the overflow opcodes.
19696
19697 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19698
19699         * statement.cs: The correct type for the EmptyExpression is the
19700         element_type, not the variable type.  Ravi pointed this out.
19701
19702 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19703
19704         * class.cs (Method::Define): Handle PInvoke methods specially
19705         by using DefinePInvokeMethod instead of the usual one.
19706
19707         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19708         above to do the task of extracting information and defining the method.
19709
19710 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19711
19712         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19713         of the condition for string type.
19714
19715         (Emit): Move that here. 
19716
19717         (ArrayCreation::CheckIndices): Keep string literals in their expression
19718         form.
19719
19720         (EmitDynamicInitializers): Handle strings appropriately.
19721
19722 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19723
19724         * codegen.cs (EmitContext): Replace multiple variables with a
19725         single pointer to the current Switch statement.
19726
19727         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19728         EmitContext.
19729
19730 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19731
19732         * statement.cs 
19733
19734         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19735         default'.
19736
19737         (Foreach.Emit): Foreach on arrays was not setting
19738         up the loop variables (for break/continue).
19739
19740         (GotoCase): Semi-implented.
19741
19742 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19743
19744         * attribute.cs (CheckAttribute): Handle system attributes by using
19745         Attribute.GetAttributes to examine information we need.
19746
19747         (GetValidPlaces): Same here.
19748
19749         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19750
19751         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19752
19753         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19754
19755         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19756
19757         (Method::Emit): Handle the case when we are a PInvoke method.
19758
19759 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19760
19761         * expression.cs: Use ResolveWithSimpleName on compound names.
19762
19763 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19764
19765         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19766         before trying to reduce it.
19767
19768         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19769
19770         * constant.cs (LookupConstantValue): Implement.
19771
19772         (EmitConstant): Use the above in emitting the constant.
19773
19774         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19775         that are user-defined by doing a LookupConstantValue on them.
19776
19777         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19778         too, like above.
19779
19780 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19781
19782         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19783
19784         (BaseAccess.DoResolve): Implement.
19785
19786         (MemberAccess.DoResolve): Split this routine into a
19787         ResolveMemberAccess routine that can be used independently
19788
19789 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19790
19791         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19792         As that share bits of the implementation.  Is returns a boolean,
19793         while As returns the Type that is being probed.
19794
19795 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19796
19797         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19798         instead of a Literal - much easier.
19799
19800         (EnumInTransit): Remove - utterly useless :-)
19801
19802         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19803
19804         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19805
19806         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19807         chain when we have no associated expression.
19808
19809 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19810
19811         * constant.cs (Define): Use Location while reporting the errror.
19812
19813         Also emit a warning when 'new' is used and there is no inherited
19814         member to hide.
19815
19816         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19817         populated.
19818
19819         (LookupEnumValue): Implement to lookup an enum member's value and define it
19820         if necessary.
19821
19822         (Populate): Re-write accordingly to use the above routine.
19823
19824 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19825
19826         * expression.cs (This): Fix prototype for DoResolveLValue to
19827         override the base class DoResolveLValue.
19828
19829         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19830         declarations) 
19831
19832         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19833         (we need to load the address of the field here).  This fixes
19834         test-22. 
19835
19836         (FieldExpr.DoResolveLValue): Call the DoResolve
19837         function to initialize the Instance expression.
19838
19839         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19840         correctly the GetEnumerator operation on a value type.
19841
19842         * cs-parser.jay: Add more simple parsing error catches.
19843
19844         * statement.cs (Switch): Add support for string switches.
19845         Handle null specially.
19846
19847         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19848
19849 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19850
19851         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19852
19853         (declare_local_constant): New helper function.
19854
19855         * statement.cs (AddConstant): Keep a separate record of constants
19856
19857         (IsConstant): Implement to determine if a variable is a constant.
19858
19859         (GetConstantExpression): Implement.
19860
19861         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19862
19863         * statement.cs (IsVariableDefined): Re-write.
19864
19865 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19866
19867         * class.cs (TypeContainer::FindMembers): Look for constants
19868         in the case when we are looking for MemberTypes.Field
19869
19870         * expression.cs (MemberAccess::DoResolve): Check that in the
19871         case we are a FieldExpr and a Literal, we are not being accessed
19872         by an instance reference.
19873
19874         * cs-parser.jay (local_constant_declaration): Implement.
19875
19876         (declaration_statement): Implement for constant declarations.
19877
19878 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19879
19880         * statement.cs (Switch): Catch double defaults.
19881
19882         (Switch): More work on the switch() statement
19883         implementation.  It works for integral values now, need to finish
19884         string support.
19885
19886
19887 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19888
19889         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19890         integer literals into other integer literals.  To be used by
19891         switch. 
19892
19893 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19894
19895         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19896         some memory.
19897
19898         (EmitDynamicInitializers): Cope with the above since we extract data
19899         directly from ArrayData now.
19900
19901         (ExpectInitializers): Keep track of whether initializers are mandatory
19902         or not.
19903
19904         (Bounds): Make it a hashtable to prevent the same dimension being 
19905         recorded for every element in that dimension.
19906
19907         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19908         from being found.
19909
19910         Also fix bug which was causing the indices to be emitted in the reverse
19911         order.
19912
19913 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19914
19915         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19916         unfinished.  They do not work, because the underlying code is
19917         sloppy.
19918
19919 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19920
19921         * cs-parser.jay: Remove bogus fixme.
19922
19923         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19924         on Switch statement.
19925
19926 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19927
19928         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19929         the same. 
19930
19931         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19932         parameter. Apparently, any expression is allowed. 
19933
19934         (ValidateInitializers): Update accordingly.
19935
19936         (CheckIndices): Fix some tricky bugs thanks to recursion.
19937
19938         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19939         I was being completely brain-dead.
19940
19941         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19942         and re-write acordingly.
19943
19944         (DelegateInvocation): Re-write accordingly.
19945
19946         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19947
19948         (MakeByteBlob): Handle types more correctly.
19949
19950         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19951         initialization from expressions but it is incomplete because I am a complete
19952         Dodo :-|
19953
19954 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19955
19956         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19957         on If.  Basically, we have to return `true' (ie, we do return to
19958         our caller) only if both branches of the if return.
19959
19960         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19961         short-circuit operators, handle them as short circuit operators. 
19962
19963         (Cast.DoResolve): Resolve type.
19964         (Cast.Cast): Take an expression as the target type.
19965
19966         * cs-parser.jay (cast_expression): Remove old hack that only
19967         allowed a limited set of types to be handled.  Now we take a
19968         unary_expression and we resolve to a type during semantic
19969         analysis.
19970
19971         Use the grammar productions from Rhys to handle casts (this is
19972         not complete like Rhys syntax yet, we fail to handle that corner
19973         case that C# has regarding (-x), but we will get there.
19974
19975 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19976
19977         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19978         field which is an array type.
19979
19980         * cs-parser.jay (declare_local_variables): Support array initialization too.
19981
19982         * typemanager.cs (MakeKey): Implement.
19983
19984         (everywhere): Use the above appropriately.
19985
19986         * cs-parser.jay (for_statement): Update for array initialization while
19987         declaring variables.
19988
19989         * ecore.cs : The error message was correct, it's the variable's names that
19990         were misleading ;-) Make the code more readable.
19991
19992         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19993         the correct type etc.
19994
19995         (ConvertExplicit): Handle Enum types by examining the underlying type.
19996
19997 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19998
19999         * parameter.cs (GetCallingConvention): Always return
20000         CallingConventions.Standard for now.
20001
20002 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20003
20004         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20005         and `r' after calling DoNumericPromotions.
20006
20007         * ecore.cs: Fix error message (the types were in the wrong order).
20008
20009         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20010         BindingFlags.Instance as well 
20011
20012         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20013         implicit int literal conversion in an empty cast so that we
20014         propagate the right type upstream.
20015
20016         (UnboxCast): new class used to unbox value types.
20017         (Expression.ConvertExplicit): Add explicit type conversions done
20018         by unboxing.
20019
20020         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20021         the target type before applying the implicit LongLiterals to ULong
20022         literal cast.
20023
20024 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20025
20026         * cs-parser.jay (for_statement): Reworked the way For works: now
20027         we declare manually any variables that are introduced in
20028         for_initializer to solve the problem of having out-of-band code
20029         emition (that is what got for broken).
20030
20031         (declaration_statement): Perform the actual variable declaration
20032         that used to be done in local_variable_declaration here.
20033
20034         (local_variable_declaration): Do not declare anything, just pass
20035         the information on a DictionaryEntry
20036
20037 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20038
20039         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20040         re-write of the logic to now make it recursive.
20041
20042         (UpdateIndices): Re-write accordingly.
20043
20044         Store element data in a separate ArrayData list in the above methods.
20045
20046         (MakeByteBlob): Implement to dump the array data into a byte array.
20047
20048 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20049
20050         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20051         into CheckIndices.
20052
20053         * constant.cs (Define): Implement.
20054
20055         (EmitConstant): Re-write fully.
20056
20057         Pass in location info.
20058
20059         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20060         respectively.
20061
20062         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20063         DictionaryEntry since we need location info too.
20064
20065         (constant_declaration): Update accordingly.
20066
20067         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20068         code into another method : UpdateIndices.
20069
20070 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20071
20072         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20073         some type checking etc.
20074
20075 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20076
20077         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20078         bits to provide dimension info if the user skips doing that.
20079
20080         Update second constructor to store the rank correctly.
20081
20082 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20083
20084         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20085         and try to implement.
20086
20087         * ../errors/cs0150.cs : Add.
20088
20089         * ../errors/cs0178.cs : Add.
20090
20091 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20092
20093         * statement.cs: Implement foreach on multi-dimensional arrays. 
20094
20095         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20096         name of the params argument.
20097
20098         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20099         initializing the array.
20100
20101         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20102         we can use this elsewhere.
20103
20104         * statement.cs: Finish implementation of foreach for single
20105         dimension arrays.
20106
20107         * cs-parser.jay: Use an out-of-band stack to pass information
20108         around, I wonder why I need this.
20109
20110         foreach_block: Make the new foreach_block the current_block.
20111
20112         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20113         function used to return a static Parameters structure.  Used for
20114         empty parameters, as those are created very frequently.
20115
20116         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20117
20118 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20119
20120         * interface.cs : Default modifier is private, not public. The
20121         make verify test passes again.
20122
20123 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20124
20125         * support.cs (ReflectionParameters): Fix logic to determine
20126         whether the last parameter is a params one. Test 9 passes again.
20127
20128         * delegate.cs (Populate): Register the builders we define with
20129         RegisterParameterForBuilder. Test 19 passes again.
20130
20131         * cs-parser.jay (property_declaration): Reference $6 instead
20132         of $$ to get at the location.
20133
20134         (indexer_declaration): Similar stuff.
20135
20136         (attribute): Ditto.
20137
20138         * class.cs (Property): Register parameters for the Get and Set methods
20139         if they exist. Test 23 passes again.
20140
20141         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20142         call to EmitArguments as we are sure there aren't any params arguments. 
20143         Test 32 passes again.
20144
20145         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20146         IndexOutOfRangeException. 
20147
20148         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20149         Test 33 now passes again.
20150
20151 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20152
20153         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20154         broke a bunch of things.  Will have to come up with a better way
20155         of tracking locations.
20156
20157         * statement.cs: Implemented foreach for single dimension arrays.
20158
20159 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20160
20161         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20162         an error.  This removes the lookup from the critical path.
20163
20164         * cs-parser.jay: Removed use of temporary_loc, which is completely
20165         broken. 
20166
20167 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20168
20169         * support.cs (ReflectionParameters.ParameterModifier): Report
20170         whether the argument is a PARAMS argument or not.
20171
20172         * class.cs: Set the attribute `ParamArrayAttribute' on the
20173         parameter argument.
20174
20175         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20176         and cons_param_array_attribute (ConstructorInfo for
20177         ParamArrayAttribute)., 
20178
20179         * codegen.cs: Emit the return using the `Return' statement, that
20180         way we can report the error correctly for missing return values. 
20181
20182         * class.cs (Method.Emit): Clean up.
20183
20184         * expression.cs (Argument.Resolve): Take another argument: the
20185         location where this argument is used.  Notice that this is not
20186         part of the "Argument" class as to reduce the size of the
20187         structure (we know the approximate location anyways).
20188
20189         Test if the argument is a variable-reference, if not, then
20190         complain with a 206.
20191
20192         (Argument.Emit): Emit addresses of variables.
20193
20194         (Argument.FullDesc): Simplify.
20195
20196         (Invocation.DoResolve): Update for Argument.Resolve.
20197
20198         (ElementAccess.DoResolve): ditto.
20199
20200         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20201         method should be virtual, as this method is always virtual.
20202
20203         (NewDelegate.DoResolve): Update for Argument.Resolve.
20204
20205         * class.cs (ConstructorInitializer.DoResolve): ditto.
20206
20207         * attribute.cs (Attribute.Resolve): ditto.
20208
20209 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20210
20211         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20212
20213         * expression.cs (ParameterReference): Drop IStackStorage and implement
20214         IAssignMethod instead. 
20215
20216         (LocalVariableReference): ditto.
20217
20218         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20219         IAssignMethod instead. 
20220
20221 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20222
20223         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20224         enumerations that are used in heavily used structures derive from
20225         byte in a laughable and pathetic attempt to reduce memory usage.
20226         This is the kind of pre-optimzations that you should not do at
20227         home without adult supervision.
20228
20229         * expression.cs (UnaryMutator): New class, used to handle ++ and
20230         -- separatedly from the other unary operators.  Cleans up the
20231         code, and kills the ExpressionStatement dependency in Unary.
20232
20233         (Unary): Removed `method' and `Arguments' from this class, making
20234         it smaller, and moving it all to SimpleCall, so I can reuse this
20235         code in other locations and avoid creating a lot of transient data
20236         strucutres when not required.
20237
20238         * cs-parser.jay: Adjust for new changes.
20239
20240 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20241
20242         * enum.cs (Enum.Populate): If there is a failure during
20243         definition, return
20244
20245         * cs-parser.jay (opt_enum_base): we used to catch type errors
20246         here, but this is really incorrect.  The type error should be
20247         catched during semantic analysis.
20248
20249 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20250
20251         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20252         current_local_parameters as expected since I, in my stupidity, had forgotten
20253         to do this :-)
20254
20255         * attribute.cs (GetValidPlaces): Fix stupid bug.
20256
20257         * class.cs (Method::Emit): Perform check on applicability of attributes.
20258
20259         (Constructor::Emit): Ditto.
20260
20261         (Field::Emit): Ditto.
20262
20263         (Field.Location): Store location information.
20264
20265         (Property, Event, Indexer, Operator): Ditto.
20266
20267         * cs-parser.jay (field_declaration): Pass in location for each field.
20268
20269         * ../errors/cs0592.cs : Add.
20270
20271 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20272
20273         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20274
20275         (InitCoreTypes): Update accordingly.
20276
20277         (RegisterAttrType, LookupAttr): Implement.
20278
20279         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20280         info about the same.
20281
20282         (Resolve): Update to populate the above as necessary.
20283
20284         (Error592): Helper.
20285
20286         (GetValidPlaces): Helper to the above.
20287
20288         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20289
20290         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20291
20292 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20293
20294         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20295
20296         * ../errors/cs0617.cs : Add.
20297
20298 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20299
20300         * enum.cs (Emit): Rename to Populate to be more consistent with what
20301         we expect it to do and when exactly it is called.
20302
20303         * class.cs, rootcontext.cs : Update accordingly.
20304
20305         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20306         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20307
20308         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20309
20310         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20311         of a fieldinfo using the above, when dealing with a FieldBuilder.
20312
20313 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20314
20315         * ../errors/cs0031.cs : Add.
20316
20317         * ../errors/cs1008.cs : Add.
20318
20319         * ../errrors/cs0543.cs : Add.
20320
20321         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20322         enum type.
20323
20324         (FindMembers): Implement.
20325
20326         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20327         enums and delegates too.
20328
20329         (enum_types): Rename to builder_to_enum.
20330
20331         (delegate_types): Rename to builder_to_delegate.
20332
20333         * delegate.cs (FindMembers): Implement.
20334
20335 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20336
20337         * typemanager.cs (IsEnumType): Implement.
20338
20339         * enum.cs (Emit): Re-write parts to account for the underlying type
20340         better and perform checking etc.
20341
20342         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20343         of the underlying type.
20344
20345         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20346         value
20347
20348         * enum.cs (error31): Helper to report error #31.
20349
20350         * cs-parser.jay (enum_declaration): Store location of each member too.
20351
20352         * enum.cs (member_to_location): New hashtable. 
20353
20354         (AddEnumMember): Update location hashtable.
20355
20356         (Emit): Use the location of each member while reporting errors.
20357
20358 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20359
20360         * cs-parser.jay: A for_initializer if is a
20361         local_variable_declaration really ammount to have an implicit
20362         block with the variable declaration and no initializer for for.
20363
20364         * statement.cs (For.Emit): Cope with null initializers.
20365
20366         This fixes the infinite loop on for initializers.
20367
20368 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20369
20370         * enum.cs: More cleanup.
20371
20372         * ecore.cs: Remove dead code.
20373
20374         * class.cs (Property.Emit): More simplification.
20375         (Event.Emit): ditto.
20376
20377         Reworked to have less levels of indentation.
20378
20379 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20380
20381         * class.cs (Property): Emit attributes.
20382
20383         (Field): Ditto.
20384
20385         (Event): Ditto.
20386
20387         (Indexer): Ditto.
20388
20389         (Operator): Ditto.
20390
20391         * enum.cs (Emit): Ditto.
20392
20393         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20394         Enums too.
20395
20396         * class.cs (Field, Event, etc.): Move attribute generation into the
20397         Emit method everywhere.
20398
20399         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20400         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20401         as we had no way of defining nested enums !
20402
20403         * rootcontext.cs : Adjust code accordingly.
20404
20405         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20406
20407 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20408
20409         * expression.cs (EvalConstantExpression): Move into ecore.cs
20410
20411         * enum.cs (Enum): Rename some members and make them public and readonly
20412         according to our convention.
20413
20414         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20415         nothing else.
20416
20417         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20418
20419         (Enum::Emit): Write a simple version for now which doesn't try to compute
20420         expressions. I shall modify this to be more robust in just a while.
20421
20422         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20423
20424         (TypeContainer::CloseType): Create the Enum types too.
20425
20426         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20427
20428         * expression.cs (EvalConstantExpression): Get rid of completely.
20429
20430         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20431         user-defined values and other cases.
20432
20433         (IsValidEnumLiteral): Helper function.
20434
20435         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20436         out there in the case we had a literal FieldExpr.
20437
20438         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20439
20440         (Literalize): Revamp a bit to take two arguments.
20441
20442         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20443
20444 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20445
20446         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20447
20448         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20449
20450         (Resolve): Use the above to ensure we have proper initializers.
20451
20452 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20453
20454         * expression.cs (Expression::EvalConstantExpression): New method to 
20455         evaluate constant expressions.
20456
20457         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20458
20459 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20460
20461         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20462         in an array.
20463
20464         (Binary.ResolveOperator): Handle operator != (object a, object b)
20465         and operator == (object a, object b);
20466
20467         (Binary.DoNumericPromotions): Indicate whether the numeric
20468         promotion was possible.
20469
20470         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20471         Implement.  
20472
20473         Made the ArrayAccess implement interface IAssignMethod instead of
20474         IStackStore as the order in which arguments are passed reflects
20475         this.
20476
20477         * assign.cs: Instead of using expr.ExprClass to select the way of
20478         assinging, probe for the IStackStore/IAssignMethod interfaces.
20479
20480         * typemanager.cs: Load InitializeArray definition.
20481
20482         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20483         static data that can be used to initialize arrays. 
20484
20485 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20486
20487         * expression.cs: Handle operator== and operator!= for booleans.
20488
20489         (Conditioal.Reduce): Implement reducer for the ?: operator.
20490
20491         (Conditional.Resolve): Implement dead code elimination.
20492
20493         (Binary.Resolve): Catch string literals and return a new
20494         concatenated string.
20495
20496         (Unary.Reduce): Implement reduction of unary expressions.
20497
20498         * ecore.cs: Split out the expression core handling here.
20499
20500         (Expression.Reduce): New method used to perform constant folding
20501         and CSE.  This is needed to support constant-expressions. 
20502
20503         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20504         targets, and optimize for !x.
20505
20506 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20507
20508         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20509         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20510         set custom atttributes.
20511
20512         * literal.cs (Literal::GetValue): New abstract method to return the actual
20513         value of the literal, cast as an object.
20514
20515         (*Literal): Implement GetValue method.
20516
20517         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20518         expressions to the arraylist but objects of type Argument.
20519
20520         * class.cs (TypeContainer::Emit): Emit our attributes too.
20521
20522         (Method::Emit, Constructor::Emit): Ditto.
20523
20524         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20525         to be ignoring earlier.
20526
20527 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20528
20529         * attribute.cs (AttributeSection::Define): Implement to do the business
20530         of constructing a CustomAttributeBuilder.
20531
20532         (Attribute): New trivial class. Increases readability of code.  
20533
20534         * cs-parser.jay : Update accordingly.
20535
20536         (positional_argument_list, named_argument_list, named_argument): New rules
20537
20538         (attribute_arguments): Use the above so that we are more correct.
20539
20540 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20541
20542         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20543         to perform all checks for a method with a params parameter.
20544
20545         (Invocation::OverloadResolve): Update to use the above method and therefore
20546         cope correctly with params method invocations.
20547
20548         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20549         params too.
20550
20551         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20552         constructors in our parent too because we can't afford to miss out on 
20553         protected ones ;-)
20554
20555         * attribute.cs (AttributeSection): New name for the class Attribute
20556
20557         Other trivial changes to improve readability.
20558
20559         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20560         use the new class names.
20561
20562 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20563
20564         * class.cs (Method::Define): Complete definition for params types too
20565
20566         (Indexer::Define): Ditto.
20567
20568         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20569         Cope everywhere with a request for info about the array parameter.
20570
20571 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20572
20573         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20574
20575         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20576         local_variable_type to extract the string corresponding to the type.
20577
20578         (local_variable_type): Fixup the action to use the new helper method.
20579
20580         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20581         go.
20582
20583         * expression.cs : Clean out code which uses the above.
20584
20585 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20586
20587         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20588         and bale out if necessary by returning a false.
20589
20590         (RegisterProperty): Ditto.
20591
20592         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20593         and print out appropriate error messages.
20594
20595         * interface.cs (everywhere): Ditto.
20596
20597         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20598         location to constructor.
20599
20600         * class.cs (Property, Event, Indexer): Update accordingly.
20601
20602         * ../errors/cs111.cs : Added.
20603
20604         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20605         of a method, as laid down by the spec.
20606
20607         (Invocation::OverloadResolve): Use the above method.
20608
20609 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20610
20611         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20612         now take a TypeContainer and a Parameters object.
20613
20614         (ParameterData): Modify return type of ParameterModifier method to be 
20615         Parameter.Modifier and not a string.
20616
20617         (ReflectionParameters, InternalParameters): Update accordingly.
20618
20619         * expression.cs (Argument::GetParameterModifier): Same here.
20620
20621         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20622         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20623         symbol in it at all so maybe this is only for now.
20624
20625 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20626
20627         * support.cs (InternalParameters): Constructor now takes an extra argument 
20628         which is the actual Parameters class.
20629
20630         (ParameterDesc): Update to provide info on ref/out modifiers.
20631
20632         * class.cs (everywhere): Update call to InternalParameters to pass in
20633         the second argument too.
20634
20635         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20636         to return the modifier info [ref/out etc]
20637
20638         (InternalParameters, ReflectionParameters): Implement the above.
20639
20640         * expression.cs (Argument::ParameterModifier): Similar function to return
20641         info about the argument's modifiers.
20642
20643         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20644         too.
20645
20646         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20647         a new SetFormalParameters object which we pass to InternalParameters.
20648
20649 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20650
20651         * expression.cs (NewArray): Merge into the ArrayCreation class.
20652
20653 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20654
20655         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20656         NewUserdefinedArray into one as there wasn't much of a use in having
20657         two separate ones.
20658
20659         * expression.cs (Argument): Change field's name to ArgType from Type.
20660
20661         (Type): New readonly property which returns the proper type, taking into 
20662         account ref/out modifiers.
20663
20664         (everywhere): Adjust code accordingly for the above.
20665
20666         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20667         whether we are emitting for a ref or out parameter.
20668
20669         * expression.cs (Argument::Emit): Use the above field to set the state.
20670
20671         (LocalVariableReference::Emit): Update to honour the flag and emit the
20672         right stuff.
20673
20674         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20675
20676         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20677
20678         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20679
20680         (ReflectionParameters, InternalParameters): Implement the above method.
20681
20682         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20683         reporting errors.
20684
20685         (Invocation::FullMethodDesc): Ditto. 
20686
20687 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20688
20689         * cs-parser.jay: Add extra production for the second form of array
20690         creation. 
20691
20692         * expression.cs (ArrayCreation): Update to reflect the above
20693         change. 
20694
20695         * Small changes to prepare for Array initialization.
20696
20697 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20698
20699         * typemanager.cs (ImplementsInterface): interface might be null;
20700         Deal with this problem;
20701
20702         Also, we do store negative hits on the cache (null values), so use
20703         this instead of calling t.GetInterfaces on the type everytime.
20704
20705 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20706
20707         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20708
20709         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20710         split functionality out into different classes.
20711
20712         (New::FormArrayType): Move into NewBuiltinArray.
20713
20714         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20715         quite useless.
20716
20717         (NewBuiltinArray): New class to handle creation of built-in arrays.
20718
20719         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20720         account creation of one-dimensional arrays.
20721
20722         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20723
20724         (NewUserdefinedArray::DoResolve): Implement.
20725
20726         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20727
20728         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20729         we maintain inside the TypeManager. This is necessary to perform lookups on the
20730         module builder.
20731
20732         (LookupType): Update to perform GetType on the module builders too.     
20733
20734         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20735
20736         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20737
20738 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20739
20740         * expression.cs (New::DoResolve): Implement guts of array creation.
20741
20742         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20743
20744 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20745
20746         * expression.cs: Fix bug I introduced lsat night that broke
20747         Delegates. 
20748
20749         (Expression.Resolve): Report a 246 error (can not resolve name)
20750         if we find a SimpleName in the stream.
20751
20752         (Expression.ResolveLValue): Ditto.
20753
20754         (Expression.ResolveWithSimpleName): This function is a variant of
20755         ResolveName, this one allows SimpleNames to be returned without a
20756         warning.  The only consumer of SimpleNames is MemberAccess
20757
20758 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20759
20760         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20761         might arrive here.  I have my doubts that this is correct.
20762
20763         * statement.cs (Lock): Implement lock statement.
20764
20765         * cs-parser.jay: Small fixes to support `lock' and `using'
20766
20767         * cs-tokenizer.cs: Remove extra space
20768
20769         * driver.cs: New flag --checked, allows to turn on integer math
20770         checking. 
20771
20772         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20773         Threading.Monitor.Exit 
20774
20775 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20776
20777         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20778         Expression Class to be IndexerAccess.
20779
20780         Notice that Indexer::DoResolve sets the eclass to Value.
20781
20782 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20783
20784         * class.cs (TypeContainer::Emit): Emit code for indexers.
20785
20786         * assign.cs (IAssignMethod): New interface implemented by Indexers
20787         and Properties for handling assignment.
20788
20789         (Assign::Emit): Simplify and reuse code. 
20790
20791         * expression.cs (IndexerAccess, PropertyExpr): Implement
20792         IAssignMethod, clean up old code. 
20793
20794 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20795
20796         * typemanager.cs (ImplementsInterface): New method to determine if a type
20797         implements a given interface. Provides a nice cache too.
20798
20799         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20800         method.
20801
20802         (ConvertReferenceExplicit): Ditto.
20803
20804         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20805         various methods, with correct names etc.
20806
20807         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20808         Operator.UnaryNegation.
20809
20810         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20811         we have a unary plus or minus operator.
20812
20813         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20814         UnaryMinus.
20815
20816         * everywhere : update accordingly.
20817
20818         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20819         respectively.
20820
20821         * class.cs (Method::Define): For the case where we are implementing a method
20822         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20823         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20824
20825 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20826
20827         * interface.cs (FindMembers): Implement to work around S.R.E
20828         lameness.
20829
20830         * typemanager.cs (IsInterfaceType): Implement.
20831
20832         (FindMembers): Update to handle interface types too.
20833
20834         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20835         use IsAssignableFrom as that is not correct - it doesn't work.
20836
20837         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20838         and accordingly override EmitStatement.
20839
20840         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20841         using the correct logic :-)
20842
20843 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20844
20845         * ../errors/cs-11.cs : Add to demonstrate error -11 
20846
20847 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20848
20849         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20850         then pass this as a hint to ResolveLValue.
20851
20852         * expression.cs (FieldExpr): Add Location information
20853
20854         (FieldExpr::LValueResolve): Report assignment to readonly
20855         variable. 
20856
20857         (Expression::ExprClassFromMemberInfo): Pass location information.
20858
20859         (Expression::ResolveLValue): Add new method that resolves an
20860         LValue. 
20861
20862         (Expression::DoResolveLValue): Default invocation calls
20863         DoResolve. 
20864
20865         (Indexers): New class used to keep track of indexers in a given
20866         Type. 
20867
20868         (IStackStore): Renamed from LValue, as it did not really describe
20869         what this did.  Also ResolveLValue is gone from this interface and
20870         now is part of Expression.
20871
20872         (ElementAccess): Depending on the element access type
20873
20874         * typemanager.cs: Add `indexer_name_type' as a Core type
20875         (System.Runtime.CompilerServices.IndexerNameAttribute)
20876
20877         * statement.cs (Goto): Take a location.
20878
20879 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20880
20881         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20882         if two delegates are compatible.
20883
20884         (NewDelegate::DoResolve): Update to take care of the case when
20885         we instantiate a delegate from another delegate.
20886
20887         * typemanager.cs (FindMembers): Don't even try to look up members
20888         of Delegate types for now.
20889
20890 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20891
20892         * delegate.cs (NewDelegate): New class to take care of delegate
20893         instantiation.
20894
20895         * expression.cs (New): Split the delegate related code out into 
20896         the NewDelegate class.
20897
20898         * delegate.cs (DelegateInvocation): New class to handle delegate 
20899         invocation.
20900
20901         * expression.cs (Invocation): Split out delegate related code into
20902         the DelegateInvocation class.
20903
20904 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20905
20906         * expression.cs (New::DoResolve): Implement delegate creation fully
20907         and according to the spec.
20908
20909         (New::DoEmit): Update to handle delegates differently.
20910
20911         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20912         because of which we were printing out arguments in reverse order !
20913
20914         * delegate.cs (VerifyMethod): Implement to check if the given method
20915         matches the delegate.
20916
20917         (FullDelegateDesc): Implement.
20918
20919         (VerifyApplicability): Implement.
20920
20921         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20922         delegate invocations too.
20923
20924         (Invocation::Emit): Ditto.
20925
20926         * ../errors/cs1593.cs : Added.
20927
20928         * ../errors/cs1594.cs : Added.
20929
20930         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20931
20932 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20933
20934         * typemanager.cs (intptr_type): Core type for System.IntPtr
20935
20936         (InitCoreTypes): Update for the same.
20937
20938         (iasyncresult_type, asynccallback_type): Ditto.
20939
20940         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20941         correct.
20942
20943         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20944         too.
20945
20946         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20947         the builders for the 4 members of a delegate type :-)
20948
20949         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20950         type.
20951
20952         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20953
20954         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20955
20956 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20957
20958         * statement.cs (Break::Emit): Implement.   
20959         (Continue::Emit): Implement.
20960
20961         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20962         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20963         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20964         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20965         end loop
20966
20967         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20968         properties that track the label for the current loop (begin of the
20969         loop and end of the loop).
20970
20971 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20972
20973         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20974         use of emitting anything at all.
20975
20976         * class.cs, rootcontext.cs : Get rid of calls to the same.
20977
20978         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20979
20980         (Populate): Define the constructor correctly and set the implementation
20981         attributes.
20982
20983         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20984         have been defined.
20985
20986         (AddDelegateType): Implement.
20987
20988         (IsDelegateType): Implement helper method.
20989
20990         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20991
20992         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20993         and accordingly handle it.
20994
20995         * delegate.cs (Populate): Take TypeContainer argument.
20996         Implement bits to define the Invoke method. However, I still haven't figured out
20997         how to take care of the native int bit :-(
20998
20999         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21000         Qualify the name of the delegate, not its return type !
21001
21002         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21003         conversion.
21004
21005         (StandardConversionExists): Checking for array types turns out to be recursive.
21006
21007         (ConvertReferenceExplicit): Implement array conversion.
21008
21009         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21010
21011 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21012
21013         * cs-parser.jay (delegate_declaration): Store the fully qualified
21014         name as it is a type declaration.
21015
21016         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21017         readonly.
21018
21019         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21020         as TypeContainer::DefineType.
21021
21022         (Populate): Method in which all the definition of the various methods (Invoke)
21023         etc is done.
21024
21025         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21026         see.
21027
21028         (CloseDelegate): Finally creates the delegate.
21029
21030         * class.cs (TypeContainer::DefineType): Update to define delegates.
21031         (Populate, Emit and CloseType): Do the same thing here too.
21032
21033         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21034         delegates in all these operations.
21035
21036 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21037
21038         * expression.cs: LocalTemporary: a new expression used to
21039         reference a temporary that has been created.
21040
21041         * assign.cs: Handle PropertyAccess back here, so that we can
21042         provide the proper semantic access to properties.
21043
21044         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21045         a few more explicit conversions. 
21046
21047         * modifiers.cs: `NEW' modifier maps to HideBySig.
21048
21049         * expression.cs (PropertyExpr): Make this into an
21050         ExpressionStatement, and support the EmitStatement code path. 
21051
21052         Perform get/set error checking, clean up the interface.
21053
21054         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21055         them into toplevel access objects.
21056
21057 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21058
21059         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21060         SRE.
21061
21062         * typemanager.cs: Keep track here of our PropertyBuilders again to
21063         work around lameness in SRE.
21064
21065 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21066
21067         * expression.cs (LValue::LValueResolve): New method in the
21068         interface, used to perform a second resolution pass for LValues. 
21069
21070         (This::DoResolve): Catch the use of this in static methods.
21071
21072         (This::LValueResolve): Implement.
21073
21074         (This::Store): Remove warning, assigning to `this' in structures
21075         is 
21076
21077         (Invocation::Emit): Deal with invocation of
21078         methods on value types.  We need to pass the address to structure
21079         methods rather than the object itself.  (The equivalent code to
21080         emit "this" for structures leaves the entire structure on the
21081         stack instead of a pointer to it). 
21082
21083         (ParameterReference::DoResolve): Compute the real index for the
21084         argument based on whether the method takes or not a `this' pointer
21085         (ie, the method is static).
21086
21087         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21088         value types returned from functions when we need to invoke a
21089         method on the sturcture.
21090
21091
21092 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21093
21094         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21095         defining the type in the Modulebuilder or Typebuilder. This is to take
21096         care of nested types which need to be defined on the TypeBuilder using
21097         DefineNestedMethod.
21098
21099         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21100         methods in RootContext, only ported to be part of TypeContainer.
21101
21102         (TypeContainer::GetInterfaceOrClass): Ditto.
21103
21104         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21105
21106         * interface.cs (Interface::DefineInterface): New method. Does exactly
21107         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21108         too.
21109
21110         (Interface::GetInterfaces): Move from RootContext here and port.
21111
21112         (Interface::GetInterfaceByName): Same here.
21113
21114         * rootcontext.cs (ResolveTree): Re-write.
21115
21116         (PopulateTypes): Re-write.
21117
21118         * class.cs (TypeContainer::Populate): Populate nested types too.
21119         (TypeContainer::Emit): Emit nested members too.
21120
21121         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21122         instead just use the name argument passed in as it is already fully
21123         qualified.
21124
21125         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21126         to TypeContainer mapping to see if a type is user-defined.
21127
21128         * class.cs (TypeContainer::CloseType): Implement. 
21129
21130         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21131         the default constructor.
21132
21133         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21134         twice.
21135
21136         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21137
21138         * interface.cs (CloseType): Create the type here.
21139
21140         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21141         the hierarchy.
21142
21143         Remove all the methods which are now in TypeContainer.
21144
21145 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21146
21147         * delegate.cs (Define): Re-write bits to define the delegate
21148         correctly.
21149
21150 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21151
21152         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21153
21154         * expression.cs (ImplicitReferenceConversion): handle null as well
21155         as a source to convert to any reference type.
21156
21157         * statement.cs (Return): Perform any implicit conversions to
21158         expected return type.  
21159
21160         Validate use of return statement.  
21161
21162         * codegen.cs (EmitContext): Pass the expected return type here.
21163
21164         * class.cs (Method, Constructor, Property): Pass expected return
21165         type to EmitContext.
21166
21167 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21168
21169         * expression.cs: Make DoResolve take an EmitContext instead of a
21170         TypeContainer.
21171
21172         Replaced `l' and `location' for `loc', for consistency.
21173
21174         (Error, Warning): Remove unneeded Tc argument.
21175
21176         * assign.cs, literal.cs, constant.cs: Update to new calling
21177         convention. 
21178
21179         * codegen.cs: EmitContext now contains a flag indicating whether
21180         code is being generated in a static method or not.
21181
21182         * cs-parser.jay: DecomposeQI, new function that replaces the old
21183         QualifiedIdentifier.  Now we always decompose the assembled
21184         strings from qualified_identifier productions into a group of
21185         memberaccesses.
21186
21187 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21188
21189         * rootcontext.cs: Deal with field-less struct types correctly now
21190         by passing the size option to Define Type.
21191
21192         * class.cs: Removed hack that created one static field. 
21193
21194 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21195
21196         * statement.cs: Moved most of the code generation here. 
21197
21198 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21199
21200         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21201         seem very right.
21202
21203         (ElementAccess): Remove useless bits for now - keep checks as the spec
21204         says.
21205
21206 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21207
21208         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21209         and start performing checks according to the spec.
21210
21211 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21212
21213         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21214         rank_specifiers instead.
21215
21216         (rank_specifiers): Change the order in which the rank specifiers are stored
21217
21218         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21219
21220         * expression.cs (ElementAccess): Implement the LValue interface too.
21221
21222 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21223
21224         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21225         except that user defined conversions are not included.
21226
21227         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21228         perform the conversion of the return type, if necessary.
21229
21230         (New::DoResolve): Check whether we are creating an array or an object
21231         and accordingly do the needful.
21232
21233         (New::Emit): Same here.
21234
21235         (New::DoResolve): Implement guts of array creation.
21236
21237         (New::FormLookupType): Helper function.
21238
21239 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21240
21241         * codegen.cs: Removed most of the code generation here, and move the
21242         corresponding code generation bits to the statement classes. 
21243
21244         Added support for try/catch/finalize and throw.
21245
21246         * cs-parser.jay: Added support for try/catch/finalize.
21247
21248         * class.cs: Catch static methods having the flags override,
21249         virtual or abstract.
21250
21251         * expression.cs (UserCast): This user cast was not really doing
21252         what it was supposed to do.  Which is to be born in fully resolved
21253         state.  Parts of the resolution were being performed at Emit time! 
21254
21255         Fixed this code.
21256
21257 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21258
21259         * expression.cs: Implicity convert the result from UserCast.
21260
21261 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21262
21263         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21264         prevented it from working correctly. 
21265
21266         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21267         merely ConvertImplicit.
21268
21269 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21270
21271         * typemanager.cs: Make the LookupTypeContainer function static,
21272         and not per-instance.  
21273
21274         * class.cs: Make static FindMembers (the one that takes a Type
21275         argument). 
21276
21277         * codegen.cs: Add EmitForeach here.
21278
21279         * cs-parser.jay: Make foreach a toplevel object instead of the
21280         inline expansion, as we need to perform semantic analysis on it. 
21281
21282 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21283
21284         * expression.cs (Expression::ImplicitUserConversion): Rename to
21285         UserDefinedConversion.
21286
21287         (Expression::UserDefinedConversion): Take an extra argument specifying 
21288         whether we look for explicit user conversions too.
21289
21290         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21291
21292         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21293
21294         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21295         with the appropriate arguments.
21296
21297         * cs-parser.jay (cast_expression): Record location too.
21298
21299         * expression.cs (Cast): Record location info.
21300
21301         (Expression::ConvertExplicit): Take location argument.
21302
21303         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21304         to determine if we are doing explicit conversions.
21305
21306         (UserCast::Emit): Update accordingly.
21307
21308         (Expression::ConvertExplicit): Report an error if everything fails.
21309
21310         * ../errors/cs0030.cs : Add.
21311
21312 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21313
21314         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21315         virtual and newslot bits. 
21316
21317         * class.cs (TypeContainer::RegisterRequiredImplementations):
21318         Record methods we need.
21319
21320         (TypeContainer::MakeKey): Helper function to make keys for
21321         MethodBases, since the Methodbase key is useless.
21322
21323         (TypeContainer::Populate): Call RegisterRequiredImplementations
21324         before defining the methods.   
21325
21326         Create a mapping for method_builders_to_methods ahead of time
21327         instead of inside a tight loop.
21328
21329         (::RequireMethods):  Accept an object as the data to set into the
21330         hashtable so we can report interface vs abstract method mismatch.
21331
21332 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21333
21334         * report.cs: Make all of it static.
21335
21336         * rootcontext.cs: Drop object_type and value_type computations, as
21337         we have those in the TypeManager anyways.
21338
21339         Drop report instance variable too, now it is a global.
21340
21341         * driver.cs: Use try/catch on command line handling.
21342
21343         Add --probe option to debug the error reporting system with a test
21344         suite. 
21345
21346         * report.cs: Add support for exiting program when a probe
21347         condition is reached.
21348
21349 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21350
21351         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21352         we do a forcible conversion regardless of type, to check if 
21353         ForceConversion returns a null.
21354
21355         (Binary::error19): Use location to report error.
21356
21357         (Unary::error23): Use location here too.
21358
21359         * ../errors/cs0019.cs : Check in.
21360
21361         * ../errors/cs0023.cs : Check in.
21362
21363         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21364         case of a non-null MethodInfo object with a length of 0 !
21365
21366         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21367         an applicable member - according to the spec :-)
21368         Also fix logic to find members in base types.
21369
21370         (Unary::ResolveOperator): Same here.
21371
21372         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21373         as I was getting thoroughly confused between this and error19 :-)
21374
21375         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21376         (::FindMostEncompassedType): Implement.
21377         (::FindMostEncompassingType): Implement.
21378         (::StandardConversionExists): Implement.
21379
21380         (UserImplicitCast): Re-vamp. We now need info about most specific
21381         source and target types so that we can do the necessary conversions.
21382
21383         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21384         mathematical union with no duplicates.
21385
21386 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21387
21388         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21389         in order from base classes to child classes, so that we can in
21390         child classes look up in our parent for method names and
21391         attributes (required for handling abstract, virtual, new, override
21392         constructs: we need to instrospect our base class, and if we dont
21393         populate the classes in order, the introspection might be
21394         incorrect.  For example, a method could query its parent before
21395         the parent has any methods and would determine that the parent has
21396         no abstract methods (while it could have had them)).
21397
21398         (RootContext::CreateType): Record the order in which we define the
21399         classes.
21400
21401 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21402
21403         * class.cs (TypeContainer::Populate): Also method definitions can
21404         fail now, keep track of this.
21405
21406         (TypeContainer::FindMembers): Implement support for
21407         DeclaredOnly/noDeclaredOnly flag.
21408
21409         (Constructor::Emit) Return the ConstructorBuilder.
21410
21411         (Method::Emit) Return the MethodBuilder. 
21412         Check for abstract or virtual methods to be public.
21413
21414         * rootcontext.cs (RootContext::CreateType): Register all the
21415         abstract methods required for the class to be complete and the
21416         interface methods that must be implemented. 
21417
21418         * cs-parser.jay: Report error 501 (method requires body if it is
21419         not marked abstract or extern).
21420
21421         * expression.cs (TypeOf::Emit): Implement.
21422
21423         * typemanager.cs: runtime_handle_type, new global type.
21424
21425         * class.cs (Property::Emit): Generate code for properties.
21426
21427 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21428
21429         * expression.cs (Unary::ResolveOperator): Find operators on base type
21430         too - we now conform exactly to the spec.
21431
21432         (Binary::ResolveOperator): Same here.
21433
21434         * class.cs (Operator::Define): Fix minor quirk in the tests.
21435
21436         * ../errors/cs0215.cs : Added.
21437
21438         * ../errors/cs0556.cs : Added.
21439
21440         * ../errors/cs0555.cs : Added.
21441
21442 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21443
21444         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21445         single integer which is really efficient
21446
21447 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21448
21449         *  expression.cs (Expression::ImplicitUserConversion): Use location
21450         even in the case when we are examining True operators.
21451  
21452         * class.cs (Operator::Define): Perform extensive checks to conform
21453         with the rules for operator overloading in the spec.
21454
21455         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21456         some of the other conversions mentioned in the spec.
21457
21458         * typemanager.cs (array_type): New static member for the System.Array built-in
21459         type.
21460
21461         (cloneable_interface): For System.ICloneable interface.
21462
21463         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21464         we start resolving the tree and populating types.
21465
21466         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21467  
21468 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21469
21470         * expression.cs (Expression::ExprClassFromMemberInfo,
21471         Expression::Literalize): Create literal expressions from
21472         FieldInfos which are literals.
21473
21474         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21475         type casts, because they were wrong.  The test suite in tests
21476         caught these ones.
21477
21478         (ImplicitNumericConversion): ushort to ulong requires a widening
21479         cast. 
21480
21481         Int32 constant to long requires widening cast as well.
21482
21483         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21484         for integers because the type on the stack is not i4.
21485
21486 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21487
21488         * expression.cs (report118): require location argument. 
21489
21490         * parameter.cs: Do not dereference potential null value.
21491
21492         * class.cs: Catch methods that lack the `new' keyword when
21493         overriding a name.  Report warnings when `new' is used without
21494         anything being there to override.
21495
21496         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21497
21498         * class.cs: Only add constructor to hashtable if it is non-null
21499         (as now constructors can fail on define).
21500
21501         (TypeManager, Class, Struct): Take location arguments.
21502
21503         Catch field instance initialization in structs as errors.
21504
21505         accepting_filter: a new filter for FindMembers that is static so
21506         that we dont create an instance per invocation.
21507
21508         (Constructor::Define): Catch errors where a struct constructor is
21509         parameterless 
21510
21511         * cs-parser.jay: Pass location information for various new
21512         constructs. 
21513
21514         * delegate.cs (Delegate): take a location argument.
21515
21516         * driver.cs: Do not call EmitCode if there were problesm in the
21517         Definition of the types, as many Builders wont be there. 
21518
21519         * decl.cs (Decl::Decl): Require a location argument.
21520
21521         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21522         into integers, and find the most appropiate integer for it.
21523
21524         * literal.cs: Implement ULongLiteral.
21525
21526         * rootcontext.cs: Provide better information about the location of
21527         failure when CreateType fails.
21528
21529 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21530
21531         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21532         as well.
21533
21534         * expression.cs (Binary::CheckShiftArguments): Add missing type
21535         computation.
21536         (Binary::ResolveOperator): Add type to the logical and and logical
21537         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21538         before.
21539
21540         (Binary::DoNumericPromotions): In the case where either argument
21541         is ulong (and most signed types combined with ulong cause an
21542         error) perform implicit integer constant conversions as well.
21543
21544 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21545
21546         * expression.cs (UserImplicitCast): Method should always be
21547         non-null. 
21548         (Invocation::BetterConversion): Simplified test for IntLiteral.
21549
21550         (Expression::ImplicitNumericConversion): Split this routine out.
21551         Put the code that performs implicit constant integer conversions
21552         here. 
21553
21554         (Expression::Resolve): Become a wrapper around DoResolve so we can
21555         check eclass and type being set after resolve.
21556
21557         (Invocation::Badness): Remove this dead function
21558
21559         (Binary::ResolveOperator): Do not compute the expensive argumnets
21560         unless we have a union for it.
21561
21562         (Probe::Emit): Is needs to do an isinst and then
21563         compare against null.
21564
21565         (::CanConvert): Added Location argument.  If the Location argument
21566         is null (Location.Null), then we do not report errors.  This is
21567         used by the `probe' mechanism of the Explicit conversion.  We do
21568         not want to generate an error for something that the user
21569         explicitly requested to be casted.  But the pipeline for an
21570         explicit cast first tests for potential implicit casts.
21571
21572         So for now, if the Location is null, it means `Probe only' to
21573         avoid adding another argument.   Might have to revise this
21574         strategy later.
21575
21576         (ClassCast): New class used to type cast objects into arbitrary
21577         classes (used in Explicit Reference Conversions).
21578
21579         Implement `as' as well.
21580
21581         Reverted all the patches from Ravi below: they were broken:
21582
21583                 * The use of `level' as a mechanism to stop recursive
21584                   invocations is wrong.  That was there just to catch the
21585                   bug with a strack trace but not as a way of addressing
21586                   the problem.
21587
21588                   To fix the problem we have to *understand* what is going
21589                   on and the interactions and come up with a plan, not
21590                   just get things going.
21591
21592                 * The use of the type conversion cache that I proposed
21593                   last night had an open topic: How does this work across
21594                   protection domains.  A user defined conversion might not
21595                   be public in the location where we are applying the
21596                   conversion, a different conversion might be selected
21597                   (ie, private A->B (better) but public B->A (worse),
21598                   inside A, A->B applies, but outside it, B->A will
21599                   apply).
21600
21601                 * On top of that (ie, even if the above is solved),
21602                   conversions in a cache need to be abstract.  Ie, `To
21603                   convert from an Int to a Short use an OpcodeCast', not
21604                   `To convert from an Int to a Short use the OpcodeCast on
21605                   the variable 5' (which is what this patch was doing).
21606
21607 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21608
21609         * expression.cs (Invocation::ConversionExists): Re-write to use
21610         the conversion cache
21611
21612         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21613         cache all conversions done, not just user-defined ones.
21614
21615         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21616         to determine if a conversion exists instead of acutually trying to 
21617         perform the conversion. It's faster too.
21618
21619         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21620         and only then attempt the implicit conversion.
21621
21622 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21623
21624         * expression.cs (ConvertImplicit): Use a cache for conversions
21625         already found. Check level of recursion and bail out if necessary.
21626
21627 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21628
21629         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21630         Export standard methods that we expect for string operations.
21631
21632         * statement.cs (Block::UsageWarning): Track usage of variables and
21633         report the errors for not used variables.
21634
21635         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21636         operator. 
21637
21638 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * codegen.cs: remove unnneded code 
21641
21642         * expression.cs: Removed BuiltinTypeAccess class
21643
21644         Fix the order in which implicit conversions are
21645         done.  
21646
21647         The previous fixed dropped support for boxed conversions (adding a
21648         test to the test suite now)
21649
21650         (UserImplicitCast::CanConvert): Remove test for source being null,
21651         that code is broken.  We should not feed a null to begin with, if
21652         we do, then we should track the bug where the problem originates
21653         and not try to cover it up here.
21654
21655         Return a resolved expression of type UserImplicitCast on success
21656         rather than true/false.  Ravi: this is what I was talking about,
21657         the pattern is to use a static method as a "constructor" for
21658         objects. 
21659
21660         Also, do not create arguments until the very last minute,
21661         otherwise we always create the arguments even for lookups that
21662         will never be performed. 
21663
21664         (UserImplicitCast::Resolve): Eliminate, objects of type
21665         UserImplicitCast are born in a fully resolved state. 
21666
21667         * typemanager.cs (InitCoreTypes): Init also value_type
21668         (System.ValueType). 
21669
21670         * expression.cs (Cast::Resolve): First resolve the child expression.
21671
21672         (LValue): Add new method AddressOf to be used by
21673         the `&' operator.  
21674
21675         Change the argument of Store to take an EmitContext instead of an
21676         ILGenerator, because things like FieldExpr need to be able to call
21677         their children expression to generate the instance code. 
21678
21679         (Expression::Error, Expression::Warning): Sugar functions for
21680         reporting errors.
21681
21682         (Expression::MemberLookup): Accept a TypeContainer instead of a
21683         Report as the first argument.
21684
21685         (Expression::ResolvePrimary): Killed.  I still want to improve
21686         this as currently the code is just not right.
21687
21688         (Expression::ResolveMemberAccess): Simplify, but it is still
21689         wrong. 
21690
21691         (Unary::Resolve): Catch errors in AddressOf operators.
21692
21693         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21694         index to a byte for the short-version, or the compiler will choose
21695         the wrong Emit call, which generates the wrong data.
21696
21697         (ParameterReference::Emit, ::Store): same.
21698
21699         (FieldExpr::AddressOf): Implement.
21700
21701         * typemanager.cs: TypeManager: made public variable instead of
21702         property.
21703
21704         * driver.cs: document --fatal.
21705
21706         * report.cs (ErrorMessage, WarningMessage): new names for the old
21707         Error and Warning classes.
21708
21709         * cs-parser.jay (member_access): Turn built-in access to types
21710         into a normal simplename
21711
21712 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21713
21714         * expression.cs (Invocation::BetterConversion): Fix to cope
21715         with q being null, since this was introducing a bug.
21716
21717         * expression.cs (ConvertImplicit): Do built-in conversions first.
21718
21719 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21720
21721         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21722
21723 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21724
21725         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21726         I had introduced long ago (what's new ?).
21727
21728         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21729         the work of all the checking. 
21730         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21731         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21732
21733         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21734         that is the right way. 
21735
21736         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21737         overloading resolution. Use everywhere instead of cutting and pasting code.
21738
21739         (Binary::ResolveOperator): Use MakeUnionSet.
21740
21741         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21742         we have to convert to bool types. Not complete yet.
21743
21744 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21745
21746         * typemanager.cs (TypeManager::CSharpName): support ushort.
21747
21748         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21749         to provide an expression that performsn an implicit constant int
21750         conversion (section 6.1.6).
21751         (Expression::ConvertImplicitRequired): Reworked to include
21752         implicit constant expression conversions.
21753
21754         (Expression::ConvertNumericExplicit): Finished.
21755
21756         (Invocation::Emit): If InstanceExpression is null, then it means
21757         that we perform a call on this.
21758
21759 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21760
21761         * expression.cs (Unary::Emit): Remove some dead code.
21762         (Probe): Implement Resolve and Emit for `is'.
21763         (Expression::ConvertImplicitRequired): Attempt to do constant
21764         expression conversions here.  Maybe should be moved to
21765         ConvertImplicit, but I am not sure.
21766         (Expression::ImplicitLongConstantConversionPossible,
21767         Expression::ImplicitIntConstantConversionPossible): New functions
21768         that tell whether is it possible to apply an implicit constant
21769         expression conversion.
21770
21771         (ConvertNumericExplicit): Started work on explicit numeric
21772         conversions.
21773
21774         * cs-parser.jay: Update operator constants.
21775
21776         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21777         (Parameters::GetSignature): Hook up VerifyArgs here.
21778         (Parameters::VerifyArgs): Verifies that no two arguments have the
21779         same name. 
21780
21781         * class.cs (Operator): Update the operator names to reflect the
21782         ones that the spec expects (as we are just stringizing the
21783         operator names).
21784
21785         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21786         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21787         previous usage did only work for our methods.
21788         (Expression::ConvertImplicit): Handle decimal implicit numeric
21789         conversions as well.
21790         (Expression::InternalTypeConstructor): Used to invoke constructors
21791         on internal types for default promotions.
21792
21793         (Unary::Emit): Implement special handling for the pre/post
21794         increment/decrement for overloaded operators, as they need to have
21795         the same semantics as the other operators.
21796
21797         (Binary::ResolveOperator): ditto.
21798         (Invocation::ConversionExists): ditto.
21799         (UserImplicitCast::Resolve): ditto.
21800
21801 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21802
21803         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21804         operator, return after emitting body. Regression tests pass again !
21805
21806         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21807         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21808         (Invocation::OverloadResolve): Ditto.
21809         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21810
21811         * everywhere : update calls to the above methods accordingly.
21812
21813 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21814
21815         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21816
21817         * expression.cs (ExpressionStatement): New base class used for
21818         expressions that can appear in statements, so that we can provide
21819         an alternate path to generate expression that do not leave a value
21820         on the stack.
21821
21822         (Expression::Emit, and all the derivatives): We no longer return
21823         whether a value is left on the stack or not.  Every expression
21824         after being emitted leaves a single value on the stack.
21825
21826         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21827         facilties of ExpressionStatement if possible.
21828
21829         * cs-parser.jay: Update statement_expression.
21830
21831 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21832
21833         * driver.cs: Change the wording of message
21834
21835 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21836
21837         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21838         the type of the expression to the return type of the method if
21839         we have an overloaded operator match ! The regression tests pass again !
21840         (Unary::ResolveOperator): Ditto.
21841
21842         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21843         to find "op_Implicit", not "implicit" ;-)
21844         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21845         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21846
21847         * everywhere : Correct calls to the above accordingly.
21848
21849         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21850         (ConvertImplicit): Do user-defined conversion if it exists.
21851
21852 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21853
21854         * assign.cs: track location.
21855         (Resolve): Use implicit conversions on assignment.
21856
21857         * literal.cs: Oops.  Not good, Emit of short access values should
21858         pass (Bytes) or the wrong argument will be selected.
21859
21860         * expression.cs (Unary::Emit): Emit code for -expr.
21861
21862         (Unary::ResolveOperator): Handle `Substract' for non-constants
21863         (substract from zero from the non-constants).
21864         Deal with Doubles as well. 
21865
21866         (Expression::ConvertImplicitRequired): New routine that reports an
21867         error if no implicit conversion exists. 
21868
21869         (Invocation::OverloadResolve): Store the converted implicit
21870         expressions if we make them
21871
21872 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21873
21874         * class.cs (ConstructorInitializer): Take a Location argument.
21875         (ConstructorBaseInitializer): Same here.
21876         (ConstructorThisInitializer): Same here.
21877
21878         * cs-parser.jay : Update all calls accordingly.
21879
21880         * expression.cs (Unary, Binary, New): Take location argument.
21881         Update accordingly everywhere.
21882
21883         * cs-parser.jay : Update all calls to the above to take a location
21884         argument.
21885
21886         * class.cs : Ditto.
21887
21888 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21889
21890         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21891         (Invocation::BetterConversion): Same here
21892         (Invocation::ConversionExists): Ditto.
21893
21894         (Invocation::ConversionExists): Implement.
21895
21896 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21897
21898         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21899         Also take an additional TypeContainer argument.
21900
21901         * All over : Pass in TypeContainer as argument to OverloadResolve.
21902
21903         * typemanager.cs (CSharpName): Update to check for the string type and return
21904         that too.
21905
21906         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21907         a given method.
21908
21909 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21910
21911         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21912         (Invocation::BetterFunction): Implement.
21913         (Invocation::BetterConversion): Implement.
21914         (Invocation::ConversionExists): Skeleton, no implementation yet.
21915
21916         Okay, things work fine !
21917
21918 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21919
21920         * typemanager.cs: declare and load enum_type, delegate_type and
21921         void_type. 
21922
21923         * expression.cs (Expression::Emit): Now emit returns a value that
21924         tells whether a value is left on the stack or not.  This strategy
21925         might be reveted tomorrow with a mechanism that would address
21926         multiple assignments.
21927         (Expression::report118): Utility routine to report mismatches on
21928         the ExprClass.
21929
21930         (Unary::Report23): Report impossible type/operator combination
21931         utility function.
21932
21933         (Unary::IsIncrementableNumber): Whether the type can be
21934         incremented or decremented with add.
21935         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21936         complemented. 
21937         (Unary::ResolveOperator): Implement ++, !, ~,
21938
21939         (Invocation::Emit): Deal with new Emit convetion.
21940
21941         * All Expression derivatives: Updated their Emit method to return
21942         whether they leave values on the stack or not.
21943
21944         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21945         stack for expressions that are statements. 
21946
21947 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21948
21949         * expression.cs (LValue): New interface.  Must be implemented by
21950         LValue objects.
21951         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21952         LValue interface.
21953
21954         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21955         interface for generating code, simplifies the code.
21956
21957 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21958
21959         * expression.cs (everywhere): Comment out return statements in ::Resolve
21960         methods to avoid the warnings.
21961
21962 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21963
21964         * driver.cs (parse): Report error 2001 if we can not open the
21965         source file.
21966
21967         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21968         not resolve it.
21969
21970         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21971         object. 
21972
21973         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21974         otherwise nested blocks end up with the same index.
21975
21976         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21977
21978         * expression.cs:  Instead of having FIXMEs in the Resolve
21979         functions, throw exceptions so it is obvious that we are facing a
21980         bug. 
21981
21982         * cs-parser.jay (invocation_expression): Pass Location information.
21983
21984         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21985         Use a basename for those routines because .NET does not like paths
21986         on them. 
21987
21988         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21989         already defined.
21990
21991 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21992
21993         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21994         are loading the correct data types (throws an exception if not).
21995         (TypeManager::InitCoreTypes): Use CoreLookupType
21996
21997         * expression.cs (Unary::ResolveOperator): return the child
21998         expression for expressions which are just +expr.
21999         (Unary::ResolveOperator): Return negative literals for -LITERAL
22000         expressions (otherwise they are Unary {Literal}).
22001         (Invocation::Badness): Take into account `Implicit constant
22002         expression conversions'.
22003
22004         * literal.cs (LongLiteral): Implement long literal class.
22005         (IntLiteral): export the `Value' of the intliteral. 
22006
22007 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22008
22009         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22010
22011         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22012         instead of 'Operator'
22013
22014         * expression.cs (Binary::ResolveOperator): Update accordingly.
22015         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22016         and 'Minus'
22017
22018         * cs-parser.jay (unary_expression): Update to use the new names.
22019
22020         * gen-treedump.cs (GetUnary): Same here.
22021
22022         * expression.cs (Unary::Resolve): Implement.
22023         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22024         operators are found instead of making noise ;-)
22025         (Unary::ResolveOperator): New method to do precisely the same thing which
22026         Binary::ResolveOperator does for Binary expressions.
22027         (Unary.method, .Arguments): Add.
22028         (Unary::OperName): Implement.   
22029         (Unary::ForceConversion): Copy and Paste !
22030
22031         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22032         a unary operator.
22033
22034         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22035         for the inbuilt operators. Only overloading works for now ;-)
22036
22037 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22038
22039         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22040         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22041
22042         * expression.cs (This::Emit): Implement. 
22043         (This::Resolve): Implement.
22044         (TypeOf:Resolve): Implement.
22045         (Expression::ResolveSimpleName): Add an implicit this to instance
22046         field references. 
22047         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22048         Bind instance variable to Field expressions.
22049         (FieldExpr::Instance): New field used to track the expression that
22050         represents the object instance.
22051         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22052         binding 
22053         (FieldExpr::Emit): Implement.
22054
22055         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22056         the last instruction contains a return opcode to avoid generating
22057         the last `ret' instruction (this generates correct code, and it is
22058         nice to pass the peverify output).
22059
22060         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22061         initializer for static and instance variables.
22062         (Constructor::Emit): Allow initializer to be null in the case of
22063         static constructors.  Only emit initializer for instance
22064         constructors. 
22065
22066         (TypeContainer::FindMembers): Return a null array if there are no
22067         matches.
22068
22069         Also fix the code for the MemberTypes.Method branch, as it was not
22070         scanning that for operators (or tried to access null variables before).
22071
22072         * assign.cs (Assign::Emit): Handle instance and static fields. 
22073
22074         * TODO: Updated.
22075
22076         * driver.cs: Stop compilation if there are parse errors.
22077
22078         * cs-parser.jay (constructor_declaration): Provide default base
22079         initializer for non-static constructors.
22080         (constructor_declarator): Do not provide a default base
22081         initializers if none was specified.
22082         Catch the fact that constructors should not have parameters.
22083
22084         * class.cs: Do not emit parent class initializers for static
22085         constructors, that should be flagged as an error.
22086
22087 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22088
22089         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22090         Move back code into TypeContainer::Populate.
22091
22092 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22093
22094         * class.cs (TypeContainer::AddConstructor): Fix the check to
22095         compare against Name, not Basename. 
22096         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22097
22098         * cs-parser.jay : Update accordingly.
22099
22100         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22101         for methods, don't forget to look into the operators too.
22102         (RegisterMethodBuilder): Helper method to take care of this for
22103         methods, constructors and operators.
22104         (Operator::Define): Completely revamp.
22105         (Operator.OperatorMethod, MethodName): New fields.
22106         (TypeContainer::Populate): Move the registering of builders into
22107         RegisterMethodBuilder.
22108         (Operator::Emit): Re-write.
22109
22110         * expression.cs (Binary::Emit): Comment out code path to emit method
22111         invocation stuff for the case when we have a user defined operator. I am
22112         just not able to get it right !
22113
22114 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22115
22116         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22117         argument. 
22118
22119         (Expression::MemberLookup): Provide a version that allows to
22120         specify the MemberTypes and BindingFlags. 
22121
22122         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22123         so it was not fetching variable information from outer blocks.
22124
22125         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22126         Beforefieldinit as it was buggy.
22127
22128         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22129         that Ravi put here.  
22130
22131         * class.cs (Constructor::Emit): Only emit if block is not null.
22132         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22133         deal with this by semantically definining it as if the user had
22134         done it.
22135
22136         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22137         constructors as we now "emit" them at a higher level.
22138
22139         (TypeContainer::DefineDefaultConstructor): Used to define the
22140         default constructors if none was provided.
22141
22142         (ConstructorInitializer): Add methods Resolve and Emit. 
22143
22144         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22145
22146 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22147
22148         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22149         the default constructor builder with our hashtable for methodbuilders
22150         to methodcores.
22151
22152         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22153         and argument_count is 0 in which case we have a match.
22154         (Binary::ResolveOperator): More null checking and miscellaneous coding
22155         style cleanup.
22156
22157 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22158
22159         * rootcontext.cs (IsNameSpace): Compare against null.
22160
22161         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22162
22163         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22164         and Unary::Operator.
22165
22166         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22167         accordingly.
22168
22169         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22170         we have overloaded operators.
22171         (Binary::ResolveOperator): Implement the part which does the operator overload
22172         resolution.
22173
22174         * class.cs (Operator::Emit): Implement.
22175         (TypeContainer::Emit): Emit the operators we have too.
22176
22177         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22178         the case when we have a user-defined operator.
22179
22180 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22181
22182         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22183
22184 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22185
22186         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22187         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22188         (Constructor::Emit): Implement.
22189         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22190         if we have no work to do. 
22191         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22192         Emit method.
22193
22194         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22195         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22196
22197         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22198         of parent.parent.
22199
22200 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22201
22202         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22203         in the source.
22204         (Tree::RecordNamespace): Method to do what the name says ;-)
22205         (Tree::Namespaces): Property to get at the namespaces hashtable.
22206
22207         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22208         keep track.
22209
22210         * rootcontext.cs (IsNamespace): Fixed it :-)
22211
22212 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22213
22214         * class.cs (TypeContainer::FindMembers): Add support for
22215         constructors. 
22216         (MethodCore): New class that encapsulates both the shared aspects
22217         of a Constructor and a Method.  
22218         (Method, Constructor): Factored pieces into MethodCore.
22219
22220         * driver.cs: Added --fatal which makes errors throw exceptions.
22221         Load System assembly as well as part of the standard library.
22222
22223         * report.cs: Allow throwing exceptions on errors for debugging.
22224
22225         * modifiers.cs: Do not use `parent', instead use the real type
22226         container to evaluate permission settings.
22227
22228         * class.cs: Put Ravi's patch back in.  He is right, and we will
22229         have to cope with the
22230
22231 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22232
22233         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22234         FamORAssem, not FamANDAssem.
22235
22236 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22237
22238         * driver.cs: Added --parse option that only parses its input files
22239         and terminates.
22240
22241         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22242         incorrect.  IsTopLevel is not used to tell whether an object is
22243         root_types or not (that can be achieved by testing this ==
22244         root_types).  But to see if this is a top-level *class* (not
22245         necessarly our "toplevel" container). 
22246
22247 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22248
22249         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22250         parent instead of a direct call to GetType.
22251
22252 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22253
22254         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22255         Modifiers.TypeAttr. This should just be a call to that method.
22256
22257         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22258         object so that we can determine if we are top-level or not.
22259
22260         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22261         TypeContainer too.
22262
22263         * enum.cs (Enum::Define): Ditto.
22264
22265         * modifiers.cs (FieldAttr): Re-write.
22266
22267         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22268         (TypeContainer::HaveStaticConstructor): New property to provide access
22269         to precisely that info.
22270
22271         * modifiers.cs (MethodAttr): Re-write.
22272         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22273
22274         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22275         of top-level types as claimed.
22276
22277 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22278
22279         * expression.cs (MemberLookup): Fruitless attempt to lookup
22280         constructors.  Maybe I need to emit default constructors?  That
22281         might be it (currently .NET emits this for me automatically).
22282         (Invocation::OverloadResolve): Cope with Arguments == null.
22283         (Invocation::EmitArguments): new function, shared by the new
22284         constructor and us.
22285         (Invocation::Emit): Handle static and instance methods.  Emit
22286         proper call instruction for virtual or non-virtual invocations.
22287         (New::Emit): Implement.
22288         (New::Resolve): Implement.
22289         (MemberAccess:Resolve): Implement.
22290         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22291         to track instances.
22292         (FieldExpr::Resolve): Set type.
22293
22294         * support.cs: Handle empty arguments.
22295                 
22296         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22297         SimpleLookup): Auxiliary routines to help parse a qualifier
22298         identifier.  
22299
22300         Update qualifier_identifier rule.
22301
22302         * codegen.cs: Removed debugging messages.
22303
22304         * class.cs: Make this a global thing, this acts just as a "key" to
22305         objects that we might have around.
22306
22307         (Populate): Only initialize method_builders_to_methods once.
22308
22309         * expression.cs (PropertyExpr): Initialize type from the
22310         PropertyType. 
22311
22312         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22313         Resolve pattern.  Attempt to implicitly convert value to boolean.
22314         Emit code.
22315
22316         * expression.cs: Set the type for the int32/int32 argument case.
22317         (Binary::ResolveOperator): Set the return type to boolean for
22318         comparission operators
22319
22320         * typemanager.cs: Remove debugging print code.
22321
22322         (Invocation::Resolve): resolve type.
22323
22324         * class.cs: Allocate a MemberInfo of the correct size, as the code
22325         elsewhere depends on the test to reflect the correct contents.
22326
22327         (Method::) Keep track of parameters, due to System.Reflection holes
22328
22329         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22330         mapping here.
22331
22332         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22333         of the exact size and return that.
22334
22335         (Class::LookupMethodByBuilder): New function that maps
22336         MethodBuilders to its methods.  Required to locate the information
22337         on methods because System.Reflection bit us again.
22338
22339         * support.cs: New file, contains an interface ParameterData and
22340         two implementations: ReflectionParameters and InternalParameters
22341         used to access Parameter information.  We will need to grow this
22342         as required.
22343
22344         * expression.cs (Invocation::GetParameterData): implement a cache
22345         and a wrapper around the ParameterData creation for methods. 
22346         (Invocation::OverloadResolve): Use new code.
22347
22348 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22349
22350         * class.cs (TypeContainer::EmitField): Remove and move into 
22351         (Field::Define): here and modify accordingly.
22352         (Field.FieldBuilder): New member.
22353         (TypeContainer::Populate): Update accordingly.
22354         (TypeContainer::FindMembers): Implement.
22355
22356 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22357
22358         * statement.cs: (VariableInfo::VariableType): New field to be
22359         initialized with the full type once it is resolved. 
22360
22361 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22362
22363         * parameter.cs (GetParameterInfo): Use a type cache to compute
22364         things only once, and to reuse this information
22365
22366         * expression.cs (LocalVariableReference::Emit): Implement.
22367         (OpcodeCast::Emit): fix.
22368
22369         (ParameterReference::Resolve): Implement.
22370         (ParameterReference::Emit): Implement.
22371
22372         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22373         that are expressions need to stay as Expressions.
22374
22375         * typemanager.cs (CSharpName): Returns the C# name of a type if
22376         possible. 
22377
22378         * expression.cs (Expression::ConvertImplicit): New function that
22379         implements implicit type conversions.
22380
22381         (Expression::ImplicitReferenceConversion): Implements implicit
22382         reference conversions.
22383
22384         (EmptyCast): New type for transparent casts.
22385
22386         (OpcodeCast): New type for casts of types that are performed with
22387         a sequence of bytecodes.
22388
22389         (BoxedCast): New type used for casting value types into reference
22390         types.  Emits a box opcode.
22391
22392         (Binary::DoNumericPromotions): Implements numeric promotions of
22393         and computation of the Binary::Type.
22394
22395         (Binary::EmitBranchable): Optimization.
22396
22397         (Binary::Emit): Implement code emission for expressions.
22398
22399         * typemanager.cs (TypeManager): Added two new core types: sbyte
22400         and byte.
22401
22402 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22403
22404         * class.cs (TypeContainer::FindMembers): Method which does exactly
22405         what Type.FindMembers does, only we don't have to use reflection. No
22406         implementation yet.
22407
22408         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22409         typecontainer objects as we need to get at them.
22410         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22411
22412         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22413         typecontainer object.
22414
22415         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22416         of just a Report object.
22417
22418 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22419
22420         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22421         "remove_"
22422         (TypeContainer::Populate): Now define the delegates of the type too.
22423         (TypeContainer.Delegates): Property to access the list of delegates defined
22424         in the type.
22425
22426         * delegates.cs (Delegate::Define): Implement partially.
22427
22428         * modifiers.cs (TypeAttr): Handle more flags.
22429
22430 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22431
22432         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22433         and not <=
22434         (Operator::Define): Re-write logic to get types by using the LookupType method
22435         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22436         (Indexer::Define): Ditto.
22437         (Event::Define): Ditto.
22438         (Property::Define): Ditto.
22439
22440 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22441
22442         * class.cs (TypeContainer::Populate): Now define operators too. 
22443         (TypeContainer.Operators): New property to access the list of operators
22444         in a type.
22445         (Operator.OperatorMethodBuilder): New member to hold the method builder
22446         for the operator we are defining.
22447         (Operator::Define): Implement.
22448
22449 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22450
22451         * class.cs (Event::Define): Make the prefixes of the accessor methods
22452         addOn_ and removeOn_ 
22453
22454         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22455         of the location being passed in too. Ideally, this should go later since all
22456         error reporting should be done through the Report object.
22457
22458         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22459         (Populate): Iterate thru the indexers we have and define them too.
22460         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22461         for the get and set accessors.
22462         (Indexer::Define): Implement.
22463
22464 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22465
22466         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22467         my previous implementation, did not work.
22468
22469         * typemanager.cs: Add a couple of missing types (the longs).
22470
22471         * literal.cs: Use TypeManager.bool_type instead of getting it.
22472
22473         * expression.cs (EventExpr): New kind of expressions.
22474         (Expressio::ExprClassFromMemberInfo): finish
22475
22476 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22477
22478         * assign.cs: Emit stores to static fields differently.
22479
22480 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22481
22482         * Merge in changes and adjust code to tackle conflicts. Backed out my
22483         code in Assign::Resolve ;-) 
22484
22485 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22486
22487         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22488         instead Report.Error and also pass in the location.
22489         (CSharpParser::Lexer): New readonly property to return the reference
22490         to the Tokenizer object.
22491         (declare_local_variables): Use Report.Error with location instead of plain 
22492         old error.
22493         (CheckDef): Ditto.
22494
22495         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22496         (Operator.CheckBinaryOperator): Ditto.
22497
22498         * cs-parser.jay (operator_declarator): Update accordingly.
22499
22500         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22501         (CheckBinaryOperator): Same here.
22502
22503         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22504         on the name without any prefixes of namespace names etc. This is because we
22505         already might have something already fully qualified like 
22506         'System.Console.WriteLine'
22507
22508         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22509
22510 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22511
22512         * cs-tokenizer.cs (location): Return a string which also contains
22513         the file name.
22514
22515         * expression.cs (ElementAccess): New class for expressions of the
22516         type 'element access.'
22517         (BaseAccess): New class for expressions of the type 'base access.'
22518         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22519         respectively.
22520
22521         * cs-parser.jay (element_access): Implement action.
22522         (base_access): Implement actions.
22523         (checked_expression, unchecked_expression): Implement.
22524
22525         * cs-parser.jay (local_variable_type): Correct and implement.
22526         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22527
22528         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22529
22530         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22531         name and the specifiers.
22532
22533         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22534
22535         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22536         making them all public ;-)
22537
22538         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22539         class anyways.
22540
22541 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22542
22543         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22544         PropertyExprs.
22545         (FieldExpr, PropertyExprs): New resolved expressions.
22546         (SimpleName::MemberStaticCheck): Perform static checks for access
22547         to non-static fields on static methods. Maybe this should be
22548         generalized for MemberAccesses. 
22549         (SimpleName::ResolveSimpleName): More work on simple name
22550         resolution. 
22551
22552         * cs-parser.jay (primary_expression/qualified_identifier): track
22553         the parameter index.
22554
22555         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22556         (EmitContext::EmitBoolExpression): Chain to expression generation
22557         instead of temporary hack.
22558         (::EmitStatementExpression): Put generic expression code generation.
22559
22560         * assign.cs (Assign::Emit): Implement variable assignments to
22561         local variables, parameters and fields.
22562
22563 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22564
22565         * statement.cs (Block::GetVariableInfo): New method, returns the
22566         VariableInfo for a variable name in a block.
22567         (Block::GetVariableType): Implement in terms of GetVariableInfo
22568
22569         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22570         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22571
22572 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22573
22574         * cs-parser.jay (operator_declaration): Continue on my quest : update
22575         to take attributes argument.
22576         (event_declaration): Ditto.
22577         (enum_declaration): Ditto.
22578         (indexer_declaration): Ditto.
22579
22580         * class.cs (Operator::Operator): Update constructor accordingly.
22581         (Event::Event): Ditto.
22582
22583         * delegate.cs (Delegate::Delegate): Same here.
22584
22585         * enum.cs (Enum::Enum): Same here.
22586
22587 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22588
22589         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22590
22591         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22592
22593         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22594         being passed around as an arraylist.
22595         (Attributes::AddAttribute): Method to add attribute sections.
22596
22597         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22598         (struct_declaration): Update accordingly.
22599         (constant_declaration): Update.
22600         (field_declaration): Update.
22601         (method_header): Update.
22602         (fixed_parameter): Update.
22603         (parameter_array): Ditto.
22604         (property_declaration): Ditto.
22605         (destructor_declaration): Ditto.
22606
22607         * class.cs (Struct::Struct): Update constructors accordingly.
22608         (Class::Class): Ditto.
22609         (Field::Field): Ditto.
22610         (Method::Method): Ditto.
22611         (Property::Property): Ditto.
22612         (TypeContainer::OptAttribute): update property's return type.
22613
22614         * interface.cs (Interface.opt_attributes): New member.
22615         (Interface::Interface): Update to take the extra Attributes argument.
22616
22617         * parameter.cs (Parameter::Parameter): Ditto.
22618
22619         * constant.cs (Constant::Constant): Ditto.
22620
22621         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22622         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22623         the attributes as a parameter.
22624         (InterfaceProperty): Update constructor call.
22625         (InterfaceEvent): Ditto.
22626         (InterfaceMethod): Ditto.
22627         (InterfaceIndexer): Ditto.
22628
22629         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22630         pass the attributes too.
22631         (interface_event_declaration): Ditto.
22632         (interface_property_declaration): Ditto.
22633         (interface_method_declaration): Ditto.
22634         (interface_declaration): Ditto.
22635
22636 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22637
22638         * class.cs (Method::Define): Track the "static Main" definition to
22639         create an entry point. 
22640
22641         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22642         EntryPoint if we find it. 
22643
22644         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22645         (EmitContext::ig): Make this variable public.
22646
22647         * driver.cs: Make the default output file be the first file name
22648         with the .exe extension.  
22649
22650         Detect empty compilations
22651
22652         Handle various kinds of output targets.  Handle --target and
22653         rename -t to --dumper.
22654
22655         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22656         methods inherited from Expression return now an Expression.  This
22657         will is used during the tree rewriting as we resolve them during
22658         semantic analysis.
22659
22660         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22661         the spec.  Missing entirely is the information about
22662         accessability of elements of it.
22663
22664         (Expression::ExprClassFromMemberInfo): New constructor for
22665         Expressions that creates a fully initialized Expression based on
22666         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22667         a Type.
22668
22669         (Invocation::Resolve): Begin implementing resolution of invocations.
22670
22671         * literal.cs (StringLiteral):  Implement Emit.
22672
22673 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22674
22675         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22676         member.
22677
22678 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22679
22680         * cs-parser.jay (attribute_arguments): Implement actions.
22681         (attribute): Fix bug in production. Implement action.
22682         (attribute_list): Implement.
22683         (attribute_target): Implement.
22684         (attribute_target_specifier, opt_target_specifier): Implement
22685         (CheckAttributeTarget): New method to check if the attribute target
22686         is valid.
22687         (attribute_section): Implement.
22688         (opt_attributes): Implement.
22689
22690         * attribute.cs : New file to handle attributes.
22691         (Attribute): Class to hold attribute info.
22692
22693         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22694         (attribute_section): Modify production to use 2 different rules to 
22695         achieve the same thing. 1 s/r conflict down !
22696         Clean out commented, useless, non-reducing dimension_separator rules.
22697
22698         * class.cs (TypeContainer.attributes): New member to hold list
22699         of attributes for a type.
22700         (Struct::Struct): Modify to take one more argument, the attribute list.
22701         (Class::Class): Ditto.
22702         (Field::Field): Ditto.
22703         (Method::Method): Ditto.
22704         (Property::Property): Ditto.
22705
22706         * cs-parser.jay (struct_declaration): Update constructor call to
22707         pass in the attributes too.
22708         (class_declaration): Ditto.
22709         (constant_declaration): Ditto.
22710         (field_declaration): Ditto.
22711         (method_header): Ditto.
22712         (fixed_parameter): Ditto.
22713         (parameter_array): Ditto.
22714         (property_declaration): Ditto.
22715
22716         * constant.cs (Constant::Constant): Update constructor similarly.
22717         Use System.Collections.
22718
22719         * parameter.cs (Parameter::Parameter): Update as above.
22720
22721 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22722
22723         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22724         (TypeContainer.delegates): New member to hold list of delegates.
22725
22726         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22727         this time as I seem to be on crack ;-)
22728
22729 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22730
22731         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22732         tell whether an identifier represents a namespace.
22733
22734         * expression.cs (NamespaceExpr): A namespace expression, used only
22735         temporarly during expression resolution.
22736         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22737         utility functions to resolve names on expressions.
22738
22739 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22740
22741         * codegen.cs: Add hook for StatementExpressions. 
22742
22743         * class.cs: Fix inverted test for static flag in methods.
22744
22745 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22746
22747         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22748         to make it coincide with MS' number.
22749         (Operator::CheckBinaryOperator): Ditto.
22750
22751         * ../errors/errors.txt : Remove error numbers added earlier.
22752
22753         * ../errors/cs1019.cs : Test case for error # 1019
22754
22755         * ../errros/cs1020.cs : Test case for error # 1020
22756
22757         * cs-parser.jay : Clean out commented cruft.
22758         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22759         used anywhere - non-reducing rule.
22760         (namespace_declarations): Non-reducing rule - comment out.
22761
22762         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22763         with TypeContainer::AddEnum.
22764
22765         * delegate.cs : New file for delegate handling classes.
22766         (Delegate): Class for declaring delegates.
22767
22768         * makefile : Update.
22769
22770         * cs-parser.jay (delegate_declaration): Implement.
22771
22772 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22773
22774         * class.cs (Event::Define): Implement.
22775         (Event.EventBuilder): New member.
22776
22777         * class.cs (TypeContainer::Populate): Update to define all enums and events
22778         we have.
22779         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22780         readonly fields for all these cases ?
22781
22782 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22783
22784         * class.cs (Property): Revamp to use the convention of making fields readonly.
22785         Accordingly modify code elsewhere.
22786
22787         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22788         the Define method of the Property class.
22789
22790         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22791         trivial bug.
22792         (TypeContainer::Populate): Update to define all the properties we have. Also
22793         define all enumerations.
22794
22795         * enum.cs (Define): Implement.
22796
22797 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22798
22799         * cs-parser.jay (overloadable_operator): The semantic value is an
22800         enum of the Operator class.
22801         (operator_declarator): Implement actions.
22802         (operator_declaration): Implement.
22803
22804         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22805         validity of definitions.
22806         (Operator::CheckBinaryOperator): Static method to check for binary operators
22807         (TypeContainer::AddOperator): New method to add an operator to a type.
22808
22809         * cs-parser.jay (indexer_declaration): Added line to actually call the
22810         AddIndexer method so it gets added ;-)
22811
22812         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22813         already taken care of by the MS compiler ?  
22814
22815 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22816
22817         * class.cs (Operator): New class for operator declarations.
22818         (Operator::OpType): Enum for the various operators.
22819
22820 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22821
22822         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22823         ostensibly handle this in semantic analysis.
22824
22825         * cs-parser.jay (general_catch_clause): Comment out
22826         (specific_catch_clauses, specific_catch_clause): Ditto.
22827         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22828         (catch_args, opt_catch_args): New productions.
22829         (catch_clause): Rewrite to use the new productions above
22830         (catch_clauses): Modify accordingly.
22831         (opt_catch_clauses): New production to use in try_statement
22832         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22833         and re-write the code in the actions to extract the specific and
22834         general catch clauses by being a little smart ;-)
22835
22836         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22837         Hooray, try and catch statements parse fine !
22838
22839 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22840
22841         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22842         string from the hashtable of variables.
22843
22844         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22845         I end up making that mistake ;-)
22846         (catch_clauses): Fixed gross error which made Key and Value of the 
22847         DictionaryEntry the same : $1 !!
22848
22849 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22850
22851         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22852
22853         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22854         when the add and remove accessors are specified. 
22855
22856 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22857
22858         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22859         information about indexer_declarator.
22860         (indexer_declarator): Implement actions.
22861         (parsing_indexer): New local boolean used to keep track of whether
22862         we are parsing indexers or properties. This is necessary because 
22863         implicit_parameters come into picture even for the get accessor in the 
22864         case of an indexer.
22865         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22866
22867         * class.cs (Indexer): New class for indexer declarations.
22868         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22869         (TypeContainer::indexers): New member to hold list of indexers for the
22870         type.
22871
22872 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22873
22874         * cs-parser.jay (add_accessor_declaration): Implement action.
22875         (remove_accessor_declaration): Implement action.
22876         (event_accessors_declaration): Implement
22877         (variable_declarators): swap statements for first rule - trivial.
22878
22879         * class.cs (Event): New class to hold information about event
22880         declarations.
22881         (TypeContainer::AddEvent): New method to add an event to a type
22882         (TypeContainer::events): New member to hold list of events.
22883
22884         * cs-parser.jay (event_declaration): Implement actions.
22885
22886 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22887
22888         * cs-parser.jay (dim_separators): Implement. Make it a string
22889         concatenating all the commas together, just as they appear.
22890         (opt_dim_separators): Modify accordingly
22891         (rank_specifiers): Update accordingly. Basically do the same
22892         thing - instead, collect the brackets here.
22893         (opt_rank_sepcifiers): Modify accordingly.
22894         (array_type): Modify to actually return the complete type string
22895         instead of ignoring the rank_specifiers.
22896         (expression_list): Implement to collect the expressions
22897         (variable_initializer): Implement. We make it a list of expressions
22898         essentially so that we can handle the array_initializer case neatly too.
22899         (variable_initializer_list): Implement.
22900         (array_initializer): Make it a list of variable_initializers
22901         (opt_array_initializer): Modify accordingly.
22902
22903         * expression.cs (New::NType): Add enumeration to help us
22904         keep track of whether we have an object/delegate creation
22905         or an array creation.
22906         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22907         members to hold data about array creation.
22908         (New:New): Modify to update NewType
22909         (New:New): New Overloaded contructor for the array creation
22910         case.
22911
22912         * cs-parser.jay (array_creation_expression): Implement to call
22913         the overloaded New constructor.
22914
22915 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22916
22917         * class.cs (TypeContainer::Constructors): Return member
22918         constructors instead of returning null.
22919
22920 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22921
22922         * typemanager.cs (InitCoreTypes): Initialize the various core
22923         types after we have populated the type manager with the user
22924         defined types (this distinction will be important later while
22925         compiling corlib.dll)
22926
22927         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22928         on Expression Classification.  Now all expressions have a method
22929         `Resolve' and a method `Emit'.
22930
22931         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22932         generation from working.     Also add some temporary debugging
22933         code. 
22934
22935 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22936
22937         * codegen.cs: Lots of code generation pieces.  This is only the
22938         beginning, will continue tomorrow with more touches of polish.  We
22939         handle the fundamentals of if, while, do, for, return.  Others are
22940         trickier and I need to start working on invocations soon.
22941
22942         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22943         s.InitStatement. 
22944
22945         * codegen.cs (EmitContext): New struct, used during code
22946         emission to keep a context.   Most of the code generation will be
22947         here. 
22948
22949         * cs-parser.jay: Add embedded blocks to the list of statements of
22950         this block.  So code generation proceeds in a top down fashion.
22951
22952 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22953
22954         * statement.cs: Add support for multiple child blocks.
22955
22956 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22957
22958         * codegen.cs (EmitCode): New function, will emit the code for a
22959         Block of code given a TypeContainer and its ILGenerator. 
22960
22961         * statement.cs (Block): Standard public readonly optimization.
22962         (Block::Block constructors): Link children. 
22963         (Block::Child): Child Linker.
22964         (Block::EmitVariables): Emits IL variable declarations.
22965
22966         * class.cs: Drop support for MethodGroups here, delay until
22967         Semantic Analysis.
22968         (Method::): Applied the same simplification that I did before, and
22969         move from Properties to public readonly fields.
22970         (Method::ParameterTypes): Returns the parameter types for the
22971         function, and implements a cache that will be useful later when I
22972         do error checking and the semantic analysis on the methods is
22973         performed.
22974         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22975         and made a method, optional argument tells whether this is a class
22976         or a structure to apply the `has-this' bit.
22977         (Method::GetCallingConvention): Implement, returns the calling
22978         convention. 
22979         (Method::Define): Defines the type, a second pass is performed
22980         later to populate the methods.
22981
22982         (Constructor::ParameterTypes): implement a cache similar to the
22983         one on Method::ParameterTypes, useful later when we do semantic
22984         analysis. 
22985
22986         (TypeContainer::EmitMethod):  New method.  Emits methods.
22987
22988         * expression.cs: Removed MethodGroup class from here.
22989
22990         * parameter.cs (Parameters::GetCallingConvention): new method.
22991
22992 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22993
22994         * class.cs (TypeContainer::Populate): Drop RootContext from the
22995         argument. 
22996
22997         (Constructor::CallingConvention): Returns the calling convention.
22998         (Constructor::ParameterTypes): Returns the constructor parameter
22999         types. 
23000
23001         (TypeContainer::AddConstructor): Keep track of default constructor
23002         and the default static constructor.
23003
23004         (Constructor::) Another class that starts using `public readonly'
23005         instead of properties. 
23006
23007         (Constructor::IsDefault): Whether this is a default constructor. 
23008
23009         (Field::) use readonly public fields instead of properties also.
23010
23011         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23012         track of static constructors;  If none is used, turn on
23013         BeforeFieldInit in the TypeAttributes. 
23014
23015         * cs-parser.jay (opt_argument_list): now the return can be null
23016         for the cases where there are no arguments. 
23017
23018         (constructor_declarator): If there is no implicit `base' or
23019         `this', then invoke the default parent constructor. 
23020
23021         * modifiers.cs (MethodAttr): New static function maps a set of
23022         modifiers flags into a MethodAttributes enum
23023         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23024         MethodAttr, TypeAttr to represent the various mappings where the
23025         modifiers are used.
23026         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23027
23028 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23029
23030         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23031         method arguments.
23032
23033         * interface.cs (PopulateIndexer): Implemented the code generator
23034         for interface indexers.
23035
23036 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23037
23038         * interface.cs (InterfaceMemberBase): Now we track the new status
23039         here.  
23040
23041         (PopulateProperty): Implement property population.  Woohoo!  Got
23042         Methods and Properties going today. 
23043
23044         Removed all the properties for interfaces, and replaced them with
23045         `public readonly' fields. 
23046
23047 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23048
23049         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23050         initialize their hashtables/arraylists only when they are needed
23051         instead of doing this always.
23052
23053         * parameter.cs: Handle refs and out parameters.
23054
23055         * cs-parser.jay: Use an ArrayList to construct the arguments
23056         instead of the ParameterCollection, and then cast that to a
23057         Parameter[] array.
23058
23059         * parameter.cs: Drop the use of ParameterCollection and use
23060         instead arrays of Parameters.
23061
23062         (GetParameterInfo): Use the Type, not the Name when resolving
23063         types. 
23064
23065 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23066
23067         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23068         and instead use public readonly fields.
23069
23070         * class.cs: Put back walking code for type containers.
23071
23072 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23073
23074         * class.cs (MakeConstant): Code to define constants.
23075
23076         * rootcontext.cs (LookupType): New function.  Used to locate types 
23077
23078
23079 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23080
23081         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23082         this System.Reflection code is.  Kudos to Microsoft
23083
23084         * typemanager.cs: Implement a type cache and avoid loading all
23085         types at boot time.  Wrap in LookupType the internals.  This made
23086         the compiler so much faster.  Wow.  I rule!
23087
23088         * driver.cs: Make sure we always load mscorlib first (for
23089         debugging purposes, nothing really important).
23090
23091         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23092         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23093
23094         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23095         on namespaces that have been imported using the `using' keyword.
23096
23097         * class.cs (TypeContainer::TypeAttr): Virtualize.
23098         (Class::TypeAttr): Return attributes suitable for this bad boy.
23099         (Struct::TypeAttr): ditto.
23100         Handle nested classes.
23101         (TypeContainer::) Remove all the type visiting code, it is now
23102         replaced with the rootcontext.cs code
23103
23104         * rootcontext.cs (GetClassBases): Added support for structs. 
23105
23106 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23107
23108         * interface.cs, statement.cs, class.cs, parameter.cs,
23109         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23110         Drop use of TypeRefs, and use strings instead.
23111
23112 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23113
23114         * rootcontext.cs: 
23115
23116         * class.cs (Struct::Struct): set the SEALED flags after
23117         checking the modifiers.
23118         (TypeContainer::TypeAttr): new property, returns the
23119         TypeAttributes for a class.  
23120
23121         * cs-parser.jay (type_list): Oops, list production was creating a
23122         new list of base types.
23123
23124         * rootcontext.cs (StdLib): New property.
23125         (GetInterfaceTypeByName): returns an interface by type name, and
23126         encapsulates error handling here.
23127         (GetInterfaces): simplified.
23128         (ResolveTree): Encapsulated all the tree resolution here.
23129         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23130         types. 
23131
23132         * driver.cs: Add support for --nostdlib, to avoid loading the
23133         default assemblies.
23134         (Main): Do not put tree resolution here. 
23135
23136         * rootcontext.cs: Beginning of the class resolution.
23137
23138 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23139
23140         * rootcontext.cs: Provide better error reporting. 
23141
23142         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23143
23144         * rootcontext.cs (CreateInterface): Handle the case where there
23145         are no parent interfaces.
23146
23147         (CloseTypes): Routine to flush types at the end.
23148         (CreateInterface): Track types.
23149         (GetInterfaces): Returns an array of Types from the list of
23150         defined interfaces.
23151
23152         * typemanager.c (AddUserType): Mechanism to track user types (puts
23153         the type on the global type hash, and allows us to close it at the
23154         end). 
23155
23156 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23157
23158         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23159         RecordInterface instead.
23160
23161         * cs-parser.jay: Updated to reflect changes above.
23162
23163         * decl.cs (Definition): Keep track of the TypeBuilder type that
23164         represents this type here.  Not sure we will use it in the long
23165         run, but wont hurt for now.
23166
23167         * driver.cs: Smaller changes to accomodate the new code.
23168
23169         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23170         when done. 
23171
23172         * rootcontext.cs (CreateInterface):  New method, used to create
23173         the System.TypeBuilder type for interfaces.
23174         (ResolveInterfaces): new entry point to resolve the interface
23175         hierarchy. 
23176         (CodeGen): Property, used to keep track of the code generator.
23177
23178 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23179
23180         * cs-parser.jay: Add a second production for delegate_declaration
23181         with `VOID'.
23182
23183         (enum_body): Put an opt_comma here instead of putting it on
23184         enum_body or enum_member_declarations so we can handle trailing
23185         commas on enumeration members.  Gets rid of a shift/reduce.
23186
23187         (type_list): Need a COMMA in the middle.
23188
23189         (indexer_declaration): Tell tokenizer to recognize get/set
23190
23191         * Remove old targets.
23192
23193         * Re-add the parser target.
23194
23195 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23196
23197         * cs-parser.jay: Add precendence rules for a number of operators
23198         ot reduce the number of shift/reduce conflicts in the grammar.
23199
23200 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23201
23202         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23203         and put it here.
23204
23205         Get rid of old crufty code.
23206
23207         * rootcontext.cs: Use this to keep track of the parsed
23208         representation and the defined types available to the program. 
23209
23210         * gen-treedump.cs: adjust for new convention.
23211
23212         * type.cs: Split out the type manager, and the assembly builder
23213         from here. 
23214
23215         * typemanager.cs: the type manager will live here now.
23216
23217         * cil-codegen.cs: And the code generator here. 
23218
23219 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23220
23221         * makefile: Fixed up for easy making.
23222
23223 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23224
23225         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23226         the 
23227
23228         (unary_expression): Expand pre_increment_expression and
23229         post_decrement_expression to reduce a shift/reduce.
23230
23231 2001-07-11  Simon Cozens
23232
23233         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23234
23235         Improve allow_keyword_as_indent name.
23236
23237 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23238
23239         * Adjustments for Beta2. 
23240
23241 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23242
23243         * decl.cs: Added `Define' abstract method.
23244         (InTransit): new property, used to catch recursive definitions. 
23245
23246         * interface.cs: Implement `Define'. 
23247
23248         * modifiers.cs: Map Modifiers.constants to
23249         System.Reflection.TypeAttribute flags.
23250
23251         * class.cs: Keep track of types and user-defined types.
23252         (BuilderInit): New method for creating an assembly
23253         (ResolveType): New function to launch the resolution process, only
23254         used by interfaces for now.
23255
23256         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23257         that are inserted into the name space. 
23258
23259 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23260
23261         * ARGH.  I have screwed up my tree so many times due to the use of
23262         rsync rather than using CVS.  Going to fix this at once. 
23263
23264         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23265         load types.
23266
23267 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23268
23269         * Experiment successful: Use System.Type rather that our own
23270         version of Type.  
23271
23272 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23273
23274         * cs-parser.jay: Removed nsAliases from here.
23275
23276         Use new namespaces, handle `using XXX;' 
23277
23278         * namespace.cs: Reimplemented namespace handling, use a recursive
23279         definition of the class.  Now we can keep track of using clauses
23280         and catch invalid using clauses.
23281
23282 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23283
23284         * gen-treedump.cs: Adapted for all the renaming.
23285
23286         * expression.cs (Expression): this class now has a Type property
23287         which returns an expression Type.
23288
23289         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23290         `Type', as this has a different meaning now in the base
23291
23292 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23293
23294         * interface.cs, class.cs: Removed from all the sources the
23295         references to signature computation, as we can not do method
23296         signature computation during the parsing time, as we are not
23297         trying to solve at that point distinguishing:
23298
23299         class X {
23300                 void a (Blah x) {}
23301                 void a (NS.Blah x) {}
23302         }
23303
23304         Which depending on the context might be valid or not, as we do not
23305         know if Blah is the same thing as NS.Blah at that point.
23306
23307         * Redid everything so the code uses TypeRefs now instead of
23308         Types.  TypeRefs are just temporary type placeholders, that need
23309         to be resolved.  They initially have a pointer to a string and the
23310         current scope in which they are used.  This is used later by the
23311         compiler to resolve the reference to an actual Type. 
23312
23313         * DeclSpace is no longer a CIR.Type, and neither are
23314         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23315         are all DeclSpaces, but no Types. 
23316
23317         * type.cs (TypeRefManager): This implements the TypeRef manager,
23318         which keeps track of all the types that need to be resolved after
23319         the parsing has finished. 
23320
23321 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23322
23323         * ARGH.  We are going to have to store `foreach' as a class rather
23324         than resolving it, as we need to verify error 1579 after name
23325         resolution.   *OR* we could keep a flag that says `This request to
23326         IEnumerator comes from a foreach statement' which we can then use
23327         to generate the error.
23328
23329 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23330
23331         * class.cs (TypeContainer.AddMethod): we now add methods to the
23332         MethodGroup instead of the method hashtable.  
23333
23334         * expression.cs: Add MethodGroup abstraction, which gets us one
23335         step closer to the specification in the way we handle method
23336         declarations.  
23337
23338         * cs-parser.jay (primary_expression): qualified_identifier now
23339         tried to match up an identifier to a local variable reference or
23340         to a parameter reference.
23341
23342         current_local_parameters is now a parser global variable that
23343         points to the current parameters for the block, used during name
23344         lookup.
23345
23346         (property_declaration): Now creates an implicit `value' argument to
23347         the set accessor.
23348
23349 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23350
23351         * parameter.cs: Do not use `param' arguments as part of the
23352         signature, per the spec.
23353
23354 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23355
23356         * decl.cs: Base class for classes, structs and interfaces.  This
23357         is the "Declaration Space" 
23358
23359         * cs-parser.jay: Use CheckDef for checking declaration errors
23360         instead of having one on each function.
23361
23362         * class.cs: Factor out some code for handling error handling in
23363         accordance to the "Declarations" section in the "Basic Concepts"
23364         chapter in the ECMA C# spec.
23365
23366         * interface.cs: Make all interface member classes derive from
23367         InterfaceMemberBase.
23368
23369 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23370
23371         * Many things: all interfaces are parsed and generated in
23372         gen-treedump.  Support for member variables, constructors,
23373         destructors, properties, constants is there.
23374
23375         Beginning of the IL backend, but very little done, just there for
23376         testing purposes. 
23377
23378 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23379
23380         * cs-parser.jay: Fix labeled statement.
23381
23382         * cs-tokenizer.cs (escape): Escape " and ' always.
23383         ref_line, ref_name: keep track of the line/filename as instructed
23384         by #line by the compiler.
23385         Parse #line.
23386
23387 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23388
23389         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23390         to match the values in System.CodeDOM.
23391
23392         Divid renamed to Divide.
23393
23394         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23395         statements. 
23396         (Statements.set): remove.
23397
23398         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23399         statements. 
23400
23401         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23402         falseStatements always have valid values. 
23403
23404         * cs-parser.jay: Use System.CodeDOM now.
23405