In ilasm/tests:
[mcs.git] / mcs / ChangeLog
blobb5276796643873b7e5d49f901a854f4437d0489b
1 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
3         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4         attribute applicable tests for attribute argument.
6 2006-06-02  Raja R Harinath  <rharinath@novell.com>
8         Fix #78079
9         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
10         (Binary.OverloadResolve_PredefinedIntegral): New.
11         (Binary.OverloadResolve_PredefinedFloating): New.
12         (Binary.OverloadResolve_PredefinedString): New.
13         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
14         Follow the standard more closely, and treat numeric promotions in
15         terms of overload resolution.
16         (Binary.CheckShiftArguments): Simplify.
18 2006-06-01  Raja R Harinath  <rharinath@novell.com>
20         * flowanalysis.cs (MyBitVector): Simplify representation.
21         (MyBitVector.Clone): Avoid allocating BitArray.
22         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
23         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
24         (*): Update.  Change all references to MyBitVector.And and
25         MyBitVector.Or to &= and |=.
27 2006-05-29  Raja R Harinath  <rharinath@novell.com>
29         Fix cs0231-[34].cs.
30         * cs-parser.jay (formal_parameter_list): Extend the pattern below
31         to param arguments too.
33 2006-05-26  Miguel de Icaza  <miguel@novell.com>
35         * cs-parser.jay: Catch another parsing form for arglist being
36         followed by other arguments.  Fixes #78313.
38 2006-05-24  Raja R Harinath  <rharinath@novell.com>
40         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
41         checking of out parameters to ...
42         (FlowBranchingToplevel.Merge): ... here.
43         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
44         set, propagate the origin upward, and only complain if there was
45         no other error.
46         (FlowBranchingException.AddContinueOrigin): Likewise.
47         (FlowBranchingException.AddReturnOrigin): Likewise.
48         (FlowBranchingException.AddGotoOrigin): Likewise.       
50 2006-05-23  Raja R Harinath  <rharinath@novell.com>
52         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
53         unreachable, skip it.
54         (FlowBranchingException.Merge): Always propagate jumps, even if
55         the finally block renders subsequent code unreachable.
57 2006-05-18  Raja R Harinath  <rharinath@novell.com>
59         Fix #77601
60         * statement.cs (Goto.Resolve): Move responsibility for resolving
61         'goto' to FlowBranching.AddGotoOrigin.
62         (Goto.SetResolvedTarget): New.  Callback to set the
63         LabeledStatement that's the target of the goto.
64         (Goto.DoEmit): Use Leave instead of Br when crossing an
65         unwind-protect boundary.
66         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
67         LookupLabel and adjust to new semantics.
68         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
69         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
70         Goto.SetResolvedTarget to update target.
71         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
72         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
73         AddBreakOrigin & co.  Delay propagation until ...
74         (FlowBranchingException.Merge): ... this.
76         * statement.cs (Block.Resolve): Always depend on flow-branching to
77         determine unreachability.  Kill workaround that originally emitted
78         only one statement after an "unreachable" label (see infloop in
79         test-515.cs).
81         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
82         This is still "wrong", but anything better would probably need a
83         multi-pass algorithm.
84         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
85         usage vector.  Force current usage vector to be reachable, to
86         optimistically signify backward jumps.
87         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
88         detected.
89         (FlowBranchingLabeled.Merge): New.  If no backward jump was
90         detected, return the original salted-away usage vector instead,
91         updated with appropriate changes.  Print unreachable warning if
92         necessary.
93         * statement.cs (Block.Resolve): Don't print unreachable warning on
94         a labeled statement.
96 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
98         * driver.cs: Pass filename without path to AssemblyBuilder's 
99         AddResourceFile. Fixes bug #78407.
101 2006-05-17  Raja R Harinath  <rharinath@novell.com>
103         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
104         * flowanalysis.cs (FlowBranchingLabeled): ... here.
105         (FlowBranching.MergeChild): Overwrite
106         reachability information from Labeled branchings too.
108 2006-05-16  Raja R Harinath  <rharinath@novell.com>
110         * statement.cs (Goto.Resolve): Merge jump origins here ...
111         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
113         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
114         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
115         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
116         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
117         here, ...
118         * statement.cs (Goto.Resolve): ... not here.
119         (Goto.Emit): Remove CS1632 check.
121 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
123         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
124         error message.
126 2006-05-11  Raja R Harinath  <rharinath@novell.com>
128         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
129         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
130         (FlowBranchingException.Label): Likewise.
132         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
133         given value.
134         (MyBitVector.Or): Use it to avoid losing information (Count).
135         (FlowBranching.MergeOrigins): Likewise.
137         * flowanalysis.cs (UsageVector.IsDirty): Remove.
138         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
139         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
140         (UsageVector.ToString): Simplify.
141         (UsageVector.MergeSiblings): Move here from ...
142         (FlowBranching.Merge): ... here.
143         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
144         not a MyBitVector.
146 2006-05-10  Raja R Harinath  <rharinath@novell.com>
148         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
149         null bitvector is treated as all-true.
151         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
152         (MyBitVector): Rationalize invariants.  'vector != null' implies
153         that we have our own copy of the bitvector.  Otherwise,
154         'InheritsFrom == null' implies all inherited bits are true.
156 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
158         * statement.cs (LocalInfo): Add IsConstant.
159         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
160         local variable for constants.
162 2006-05-09  Raja R Harinath  <rharinath@novell.com>
164         * flowanalysis.cs (MyBitVector.Empty): New.
165         (MyBitVector): Don't allow InheritedFrom to be null.
166         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
167         (UsageVector, FlowBranching): Update to changes.
169         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
170         recursion.  The 'Parent == null' condition isn't sufficient for
171         anonymous methods.
172         (FlowBranching.AddBreakOrigin): Likewise.
173         (FlowBranching.AddContinueOrigin): Likewise.
174         (FlowBranching.AddReturnOrigin): Likewise.
175         (FlowBranching.StealFinallyClauses): Likewise.
176         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
177         (FlowBranching.CheckOutParameters): Likewise.
178         (FlowBranchingToplevel): Terminate all the above recursions here.
179         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
180         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
182         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
183         toplevel block.
184         (FlowBranchingToplevel): New.  Empty for now.
185         (FlowBranching.MergeTopBlock): Update.
186         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
187         branching for the anonymous delegate.
188         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
190         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
191         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
192         information at the start of the merge.  Reorganize.
194 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
196         * class.cs (MethodData.Define): Method cannot implement interface accessor.
198 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
200         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
201         to newly introduced ctor.
203         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
204         message to one place.
205         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
206         global namespace.
208 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
210         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
212         * ecore.cs (Expression.ResolveAsConstant): Updated.
214         * statement.cs (ResolveMeta): Updated.
216 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
218         * cs-parser.jay: __arglist cannot be used in initializer.
220 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
222         A fix for #77879
223         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
224         private types.
226 2006-05-05  Raja R Harinath  <rharinath@novell.com>
228         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
229         (LabeledStatement): Add 'name' parameter.
230         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
231         (Block.AddLabel): Update to changes.
232         * cs-parser.jay (labeled_statement): Likewise.
234         * flowanalysis.cs (BranchingType.Labeled): New.
235         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
236         (FlowBranchingLabeled): New.  Does nothing for now, but will
237         eventually handle 'goto' flows.
238         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
239         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
240         that's terminated ...
241         (Block.Resolve): ... here.
243         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
244         (UsageVector.MergeFinallyOrigins): Likewise.
245         (FlowBranching.InTryOrCatch): Likewise.
246         (FlowBranching.AddFinallyVector): Likewise.
247         (FlowBranchingException): Update to changes.
249         Fix #78290
250         * statement.cs (Return.Resolve): Move error checking to ...
251         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
252         (FlowBranchingException): Handle return origins like break and
253         continue origins.
254         (FlowBranching.UsageVector.CheckOutParameters): Remove.
256 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
258         A fix for #76122
259         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
260         filter.
262 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
264         A fix for #77543
265         * class.cs (MethodData.Define): Do public accessor check only when method
266         implements an interface.
268 2006-05-04  Raja R Harinath  <rharinath@novell.com>
270         Remove special handling of 'break'
271         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
272         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
273         (UsageVector.Break): Remove.
274         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
275         reachability.
276         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
278         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
279         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
281 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
283         A fix for #75726
284         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
285         be the interface member.
287 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
289         A fix for #60069
290         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
291         for emitting small (int) values.
293 2006-05-03  Raja R Harinath  <rharinath@novell.com>
295         Fix #59427
296         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
297         control-flow passes through the 'finally' after merging-in all the
298         control-flows from 'try' and the 'catch' clauses.
300         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
301         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
302         always true at the only non-recursive entry point.
303         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
304         FlowBranchingBreakable.
305         (FlowBranchingLoop): Remove.
306         * statement.cs (Return.DoResolve): Update to changes.
308         Fix #76471, #76665
309         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
310         (FlowBranching.CreateBranching): Handle it: create a
311         FlowBranchingContinuable.
312         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
313         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
314         except that it handles the 'continue' command.
315         (FlowBranching.UsageVector.MergeOrigins): Rename from
316         MergeBreakOrigins.
317         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
318         except that it overrides AddContinueOrigin.
319         (FlowBranchingException): Override AddContinueOrigin, similar to
320         AddBreakOrigin.
321         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
322         Create a new branching around the embedded statement.
323         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
324         control flow after the embedded statement.
325         (Continue.Resolve): Move all error checking to AddContinueOrigin.
327         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
328         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
329         FlowBranchingBreakable.
330         (FlowBranchingSwitch): Remove.
332         Fix test-503.cs
333         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
334         error reporting to ...
335         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
336         Rename from 'AddBreakVector'.  Add new location argument.  Return
337         a bool indicating whether the 'break' crosses an unwind-protect.
338         (FlowBranchingException.AddBreakOrigin): Add.
339         (FlowBranchingException.Merge): Propagate 'break's to surrounding
340         flowbranching after updating with the effects of the 'finally'
341         clause.
342         (FlowBranchingBreakable): New common base class for
343         FlowBranchingLoop and FlowBranchingSwitch.
345         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
346         embedded statement.
347         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
349 2006-05-02  Raja R Harinath  <rharinath@novell.com>
351         * statement.cs (Do.Resolve): If the loop is infinite, set the
352         barrier.
353         (While.Resolve, For.Resolve): Set a barrier after the embedded
354         statement.  There's no direct control flow that goes from the end
355         of the embedded statement to the end of the loop.
356         * flowanalysis.cs (FlowBranching.Infinite): Remove.
357         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
358         above ensure that the reachability is correctly computed.
360         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
361         (UsageVector.MergeBreakOrigins): If the current path is
362         unreachable, treat it as if all parameters/locals are initialized.
363         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
364         infinite loops before merging-in break origins.
366         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
367         (Reachability.Reachable): Split part into ...
368         (Reachability.Unreachable): ... this.  Simplify.
369         (Reachability.IsUnreachable): Use 'Unreachable' instead.
371         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
372         (Reachability.SetThrowsSometimes): Likewise.
373         (FlowBranchingBlock.MergeTopBlock): Don't compare against
374         TriState.Always, use corresponding property.
375         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
376         (Block.Resolve): Likewise.  Remove some redundant checks.
378 2006-05-02  Raja R Harinath  <harinath@gmail.com>
380         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
381         (Reachability.Meet): Don't bother checking AlwaysThrows --
382         barrier is always set.
383         (FlowBranchingBlock.Merge): Likewise.
385 2006-05-01  Raja R Harinath  <harinath@gmail.com>
387         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
388         checks for unreachable.
390 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
392         A fix for #77980
393         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
395         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
396         whether field is really assigned.
398 2006-04-30  Raja R Harinath  <harinath@gmail.com>
400         * flowanalysis.cs (Reachability): Make 4-argument constructor
401         private.
402         (Reachability.Meet): Rename from 'And'.  Remove static variant.
403         (Reachability.Always): Rename from the highly misleading
404         'Reachability.Never'.
405         (FlowBranching.Merge): Update to changes.  Mark an impossible
406         situation with a 'throw'.
407         (*): Update to changes.
409 2006-04-29  Raja R Harinath  <harinath@gmail.com>
411         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
412         Remove 'Undefined'.
413         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
414         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
415         (*): Update to changes.
416         * statement.cs: Update to changes.
418 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
420         A fix for #78049
421         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
423 2006-04-28  Raja R Harinath  <harinath@gmail.com>
425         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
426         dummy UsageVector.
428         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
429         argument to two arguments: an usage-vector and a bool.  Move call
430         to FlowBranching.Merge () ...
431         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
433         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
434         handling of loop and switch reachability to ...
435         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
437 2006-04-27  Raja R Harinath  <harinath@gmail.com>
439         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
440         handling to FlowBranchingLoop.InLoop.
441         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
443 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
445         A fix for #78115
446         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
447         anonymous method is allowed from AnonymousContainer here.
449         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
451 2006-04-24  Raja R Harinath  <rharinath@novell.com>
453         Fix #78156
454         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
456 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
458         A fix for #49011.
459         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
460         (DoubleConstant.Reduce): Ditto.
462 2006-04-23  Raja R Harinath  <rharinath@novell.com>
464         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
465         Remove 'lvalue_right_side' argument.  Move parts to ...
466         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
467         (LocalVariable.DoResolveLValue): ... these.
469 2006-04-21  Raja R Harinath  <rharinath@novell.com>
471         Fix cs1655.cs
472         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
473         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
474         (LocalVariableReference.DoResolveBase): Use it to implement new
475         CS1655 check.
476         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
477         (Argument.Resolve): Simplify.  Move CS1510 check ...
478         * ecore.cs (Expression.ResolveLValue): ... here.
479         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
480         (PropertyExpr.DoResolveLValue): Likewise.
481         (FieldExpr.Report_AssignToReadonly): Likewise.
482         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
483         LValueMemberAccess or LValueMemberOutAccess on instance depending
484         on it.
485         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
486         DoResolve as appropriate.
488 2006-04-20  Raja R Harinath  <rharinath@novell.com>
490         Fix #75800
491         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
492         implicit conversions on 'out' and 'ref' arguments.
494         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
495         improve clarity.  Remove dead code.
497         Fix #66031
498         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
499         (Catch.Resolve): Resolve VarBlock if it exists.
501 2006-04-19  Miguel de Icaza  <miguel@novell.com>
503         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
504         twice, this was some residual code, the enumerator was emitted
505         properly in the two branche of if later.
507 2006-04-19  Raja R Harinath  <rharinath@novell.com>
509         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
510         cast is never an lvalue.
511         (Cast.DoResolve, Cast.ResolveRest): Combine.
512         (Argument.Emit): Simplify slightly.  Move 'Expr is
513         IMemoryLocation' check ...
514         (Argument.Resolve): ... here.
515         (Argument.Error_LValueRequired): Remove.  Inline into only user.
517         Simplifications.  Fix cs0191-2.cs
518         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
519         CS1649 and CS1651 to ...
520         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
521         the actual selection of the error code and message to a lookup
522         table.  Add a dummy return value to simplify callsites.
523         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
524         readonly fields of other instances of the same type.  Move CS0197
525         warning from ...
526         * expression.cs (Argument.Resolve): ... here.  Simplify code.
527         Ensure that ec.InRefOutArgumentResolving is only set during LValue
528         resolution of an out or ref argument.  The code simplification
529         above uses this invariant.
531 2006-04-18  Raja R Harinath  <rharinath@novell.com>
533         Possibly fix #77752.  Fix cs1690-[4-7].cs.
534         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
535         CheckMarshallByRefAccess.  Drop parameter.
536         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
537         warning.
538         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
539         InstanceExpression.
540         * report.cs (AllWarnings): Add CS1690.
541         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
542         for ref access too.
543         (LocalVariableReference.DoResolveBase): Update.
545 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
547         * class.cs (MethodOrOperator): Moved common parts from method class.
548         detect obsolete attributes.
549         (Method.Define): Simplified as it reuses code from base.
550         (Constructor.ValidAttributeTargets): Fixed issue found during
551         refactoring.
552         (Destructor.ValidAttributeTargets): Fixed issue found during
553         refactoring.
554         (Operator): Finished refactoring set off by #78020. Operator class is now
555         ordinary method class.
557         * anonymous.cs: Updated.
559         * decl.cs (DeclSpace): Add IsGeneric
561 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
563         * class.cs (Constructor.Emit): Don't emit the attributes twice.
565 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
567         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
568         detect obsolete attributes.
569         (Method.CreateEmitContext): Moved to MethodOrOperator.
571 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
573         A fix for #78048.
574         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
575         customized exception to make crash detection easier.
576         (MethodOrOperator): Started to work on new base class for methods and
577         operators.
578         (Method): Derives from MethodOrOperator.
579         (Constructor.Emit): Emits its own attributes.
580         (AbstractPropertyEventMethod.Emit): Ditto.
581         (Operator): Derives from MethodOrOperator, will refactor fully in extra
582         patch.
583         (Operator.Emit): It's temporary more tricky than should be.
584         
585         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
587         * report.cs (InternalErrorException): Add ctor with inner exception.
589 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
591         A fix for #76744.
592         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
593         only not visible.
595 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
597         A fix for #77916.
598         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
599         array.
601 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
603         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
604         attribute is present and Guid not.
605         (Interface.ApplyAttributeBuilder): Ditto.
607         * attribute.cs: Add error message.
609 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
611         A fix for #78020.
613         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
614         sources (it's composite) so hold them in extra array as they are used in
615         Emit phase only. It worked in the previous versions by mistake.
616         (Attribute.Emit): Emit attribute for more owners when exist.
618         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
619         it has now different behaviour.
621 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
623         * constant.cs (Constant.IsDefaultInitializer): New method.
625         * class.cs: Updated.
627         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
628         re-initialize default values. It saves KBs almost for every assembly.
629         Thanks Zoltan for the idea.
630         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
631         (ArrayCreation.DoResolve): Resolve only once.
632         (ArrayCreation.Emit): Emit static initializer only when it is faster.
633         (ArrayCreation.GetAttributableValue): Cope with optimized values.
635 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
637         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
638         From #77961.
640 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
642         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
643         in an embedded statement too.
645 2006-04-01  Raja R Harinath  <rharinath@novell.com>
647         Fix #77958
648         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
650 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
652         A fix for #77966.
654         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
655         was not specified.
657         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
659 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
661         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
662         phase.
664         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
665         LocalTemporary change.
667         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
668         TypeContainer.
669         (ClassOrStruct.DefineFieldInitializers): Implemented static field
670         initializers optimization.
671         (ClassOrStruct.TypeAttr): Moved from modifiers.
672         (Constructor.CheckBase): Don't crash when static ctor has parameters.
673         (FieldBase.ResolveInitializer): Resolves initializer.
674         (FieldBase.HasDefaultInitializer): New property.
676         * cs-parser.jay: Removed message.
678         * expression.cs (CompilerGeneratedThis): New specialization.
680         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
682 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
684         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
686 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
688         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
689         be now EnumConstants only.
691 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
693         * attribute.cs, driver.cs: Reset more caches.
695 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
697         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
699 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
701         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
702         for easier reuse. Updated all overrides.
703         (IntegralConstant): New base class for all integral constants.
704         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
705         of the constant range, report custom error.
706         (UIntConstant.Reduce): Fixed uint conversion.
708         * ecore.cs, literal.cs: Reduce updates.
710 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
712         A fix for #75813.
714         * class.cs (Constructor.Define): Removed extra if for default ctors.
715         A patch from Atsushi Enomoto.
717 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
719         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
720         GetAttributableValue.
722         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
723         when required.
725         * convert.cs (ImplicitConversionRequired): Error message moved to
726         DoubleLiteral.
728         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
729         automatic implicit conversion of an output value.
730         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
732         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
733         conversion.
734         (TypeOf.GetAttributableValue): Add extra handling for object type.
736         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
737         special error message.
739 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
741         * class.cs (Constructor.Emit): Don't crash when struct ctor is
742         InternalCall.
743         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
744         compatible with MS runtime.
746 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
748         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
749         attribute arguments here.
751         * class.cs (Indexer.Define): The check was moved to attribute class.
753 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
755         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
756         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
757         easier.
759 2006-03-22  Raja R Harinath  <rharinath@novell.com>
761         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
762         mcs to keep code differences small.
763         * attribute.cs (Attribute.GetParameterDefaultValue): New.
764         * typemanager.cs (parameter_default_value_attribute_type): New.
765         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
766         CS1908 check.
768 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
770         * expression.cs (StringConcat.Append): Reverted back to no warning state.
772 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
774         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
776         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
777         the blocks too.
779 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
781         * doc-bootstrap.cs : fix build.
783 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
785         * expression.cs (StringConcat.Append): Issue a warning when empty string
786         is going to append.
788 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
790         * assign.cs (CompoundAssign.ResolveSource): Removed.
792         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
793         clean up.
795         * class.cs (TypeContainer.FindMethods): Removed.
796         (TypeContainer.CheckMemberUsage): Made static.
798         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
800         * constant.cs (CheckRange): Removed unused type argument.
801         (CheckUnsigned): Removed unused type argument.
803         * cs-parser.jay: Updated after MemberAccess clean up.
804         Uses Length for empty string test.
806         * cs-tokenizer.cs: Uses Length for empty string test.
807         (IsCastToken): Made static.
808         (is_hex): Made static.
809         (real_type_suffix): Made static.
811         * decl.cs (SetupCache): Made static.
812         (OnGenerateDocComment): Removed unused ds argument.
814         * delegate.cs (VerifyDelegate): Removed unused argument.
816         * doc.cs: Uses Length for empty string test.
818         * driver.cs: Uses Length for empty string test.
820         * enum.cs (IsValidEnumType): Made static
822         * expression.cs (EnumLiftUp): Removed unused argument.
823         (ResolveMethodGroup): Ditto.
824         (BetterConversion): Ditto.
825         (GetVarargsTypes): Ditto.
826         (UpdateIndices): Ditto.
827         (ValidateInitializers): Ditto.
828         (MemberAccess.ctor): Ditto.
829         (GetIndexersForType): Ditto.
831         * flowanalysis.cs: (MergeFinally): Removed unused argument.
833         * iterators.cs: Updated after MemberAccess clean up.
835         * location.cs: Uses Length for empty string test.
837         * namespace.cs: Uses Length for empty string test.
839          * report.cs (CheckWarningCode): Made static.
841         * statement.cs (LabeledStatement): Removed unused argument.
843         * typemanager.cs (FilterNone): Removed.
845 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
847         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
848         obsolete.
850         * class.cs: Updated.
852 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
854         * cs-parser.jay.cs: __arglist is not allowed for delegates.
856 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
858         A fix for #77822.
860         * expression.cs (VerifyArgumentsCompat): Reverted to double error
861         reporting, it's more tricky than I thought.
863 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
865         A fix for #77816.
867         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
868         host container.
869         (AnonymousMethod.ImplicitStandardConversionExists): New method.
870         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
871         Add more error reporting; Fixed issue with params.
873         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
875         * cs-parser.jay: AnonymousMethod requires host container.
877         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
879 2006-03-18  Raja R Harinath  <harinath@gmail.com>
881         * class.cs: Change 'TypeContainer ds' constructor argument to
882         'DeclSpace parent'.  Some classes were missed below due to
883         different naming convention.
885         * class.cs (MemberCore.Parent): Delete.  This makes the
886         ParentContainer changes below enforceable by the compiler.
888         Treat pointers to enclosing declaration space as 'DeclSpace', not
889         'TypeContainer'.
890         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
891         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
893         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
894         of TypeContainer.
895         (Block.AddThisVariable): Likewise.
896         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
897         (AbstractPropertyEventMethod.Emit): Likewise.
898         (AbstractPropertyEventMethod.EmitMethod): Likewise.
899         (GetMethod.Define, SetMethod.Define): Likewise.
900         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
901         (DelegateMethod.EmitMethod): Likewise.
903         Fix regression test-partial-13.cs.
904         Rationalize use of PartialContainer.  Ensure that the partial
905         class semantics can be tied to type-correctness, i.e., any
906         violation will cause a compile error.
907         * class.cs, const.cs: Access all fields that belong to class
908         TypeContainer via ParentContainer.  Arguments of EmitContexts and
909         Resolve()-like functions still use 'Parent'.
911         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
912         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
913         (PropertyMethod.CheckModifiers): Remove unused argument.
914         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
915         DeclSpace.
917 2006-03-17  Raja R Harinath  <harinath@gmail.com>
919         Make semantics of PartialContainer simpler.
920         * decl.cs (DeclSpace.IsPartial): Remove.
921         * class.cs (TypeContainer.IsPartial): Likewise.
922         (TypeContainer..ctor): Set PartialContainer to point to self.
923         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
924         (TypeContainer.FindNestedType): Likewise.
925         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
927 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
929         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
931 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
933         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
934         classes.
936 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
938         * class.cs (Operator.Define): An error for base conversion was not
939         reported correctly.
941 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
943         * iterator.cs : yield break is allowed in try statement which has
944           catch clauses. Fixed bug #77767.
946 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
948         A fix for #77593, #77574.
950         * class.cs (MethodCore.CheckBase): Another if for operator.
952 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
954         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
955         were not resolved
957         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
958         (DelegateCreation.ImplicitStandardConversionExists): New method for just
959         conversion test.
960         
961         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
962         not needed.
964         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
965         Updated after another emitcontext usage was clean up. It should help us to
966         synchronize with gmcs easier.
968 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
970         A fix for #77353.
972         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
973         (Event.Define): ditto
974         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
976         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
977         Removed redundant code and set NewSlot for Invoke method too.
979         * parameter.cs (Parameters.ctor): Add custom, type ctor.
980         (Parameters.MergeGenerated): New method. Use this method when you merge
981         compiler generated argument with user arguments.
983 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
985         * attribute.cs (ResolveAsTypeTerminal): Removed.
987         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
988         specialization for predefined types; 30% speed up.
989         Finally placed obsolete check to right place.
990         (Expression.ResolveType): Removed.
992         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
993         Updated after ResolveType was removed.
995         * expression.cs (Cast.ctor): Check void cast.
996         (Binary.ResolveAsTypeTerminal): Is never type.
997         (Conditional.ResolveAsTypeTerminal): Is never type.
999         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1001 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1003         Fix #77679.
1004         * expression.cs (ParameterReference.DoResolveBase): Change return
1005         type to bool.
1006         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1007         Update.
1009         Fix #77628.
1010         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1012         Fix #77642.
1013         * typemanager.cs (GetFullNameSignature): Don't nullref on
1014         protected accessors.
1016 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1018         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1019         these two separated members to simplify the code.
1020         (Attribute.Resolve): Refactored to use new fields and methods.
1021         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1022         implemented obsolete attribute checking.
1023         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1024         implemented obsolete checking again. It look line never ending quest ;-)
1025         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1027         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1029         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1031         *class.cs (Property.Define): Add RegisterProperty call.
1033         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1034         argument groups (only 2).
1036         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1037         encoding expression to arguments.
1038         (Expression.ExprClassToResolveFlags): Just turned to property.
1040         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1041         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1042         optimized as well as implemented support for zero-length attributes.
1044         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1045         Add caching of PropertyInfo's.
1047 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1049         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1050         error multiple times.
1052 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1054         New partial class implementation.
1055         A fix for #77027, #77029, #77403
1057         * attribute.cs (Attributable): Made attributes protected.
1059         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1060         the replacements of ClassPart and PartialContainer.
1061         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1062         (TypeContainer.AddInterface): Ditto.
1063         (TypeContainer.AddPartial): The main method for partial classes. It checks
1064         for errors and merges ModFlags and attributes. At the end class is added to
1065         partial_parts list.
1066         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1067         required here.
1068         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1069         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1070         from the rest of partial classes.
1071         (TypeContainer.GetClassBases): Simplified.
1072         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1073         DefineType.
1074         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1075         (TypeContainer.HasExplicitLayout): Uses Flags now.
1076         (PartialContainer): Removed.
1077         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1078         (StaticClass): Was merged with Class.
1079         (Class.GetClassBases): class and static class bases are verified here.
1080         (Class.TypeAttr): Added static attributes when class is static.
1081         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1082         (MemberBase): In some cases we need to call parent container for partial
1083         class. It should be eliminated but it's not easy now.
1085         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1087         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1088         partial classed to accumulate class comments.
1089         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1091         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1093         * driver.cs (MainDriver): Tree.GetDecl was removed.
1095         * modifiers.cs (Modifiers): Add partial modifier.
1097         * tree.cs (Tree.decl): Removed.
1098         (RootTypes): Started to use this class more often for root types
1099         specializations.
1101 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1103         A fix for #77615
1105         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1106         external interface does not have an attribute.
1108 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1110         Another prerequisites for new partial classs implementation.
1111         
1112         * attribute.cs (Attribute.Equal): Implemented.
1113         (Attribute.Emit): Changed as attributes can be applied more than twice.
1114         (Attributes.Emit): Check for duplicate attributes here.
1116         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1117         as a parameter, clean-up.
1119 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1121         A fix for #77485
1123         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1124         contains obsolete attribute check which can in some cases look for base
1125         type of current class which is not initialized yet.
1126         (TypeContainer.BaseType): Replacement of ptype.
1128         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1130 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1132         First of prerequisites for new partial classs implemention.
1133         
1134         * attribute.cs (Attributable): Extended by ResolveContext;
1135         Attributes finally have correct context for resolving in all cases.
1136         (AttachTo): Attribute owner is assigned here.
1138         * codegen.cs (IResolveContext): Introduce new interface to hold
1139         all information needed in resolving phase.
1140         (EmitContext): Implements IResolveContext; more clean-up needed here.
1141         
1142         * decl.cs (MemberCore): Implemented IResolveContext.
1144         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1145         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1146         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1147         Refactored to use new IResolveContext instead of EmitContext; cleanup
1149 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1151         * codegen.cs (EmitScopeInitFromBlock): check here the
1152         capture_context, there is no need to make two calls to the
1153         EmitContext. 
1155         * anonymous.cs: Add some debugging messages that might help me
1156         track other instances of this problem in the future (the
1157         regression of test 467).
1159         * cs-parser.jay: track the variable block, as we need to initalize
1160         any captured variables declared in this block for the "catch"
1161         portion of the "Try" statement.
1163         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1164         scope initialization for captured variables. 
1166         Also, move the emit for the variables after the block location has
1167         been marked.
1169 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1171         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1173 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1175         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1176         commit yesterday, the initialization for the roots is necessary.
1177         What is not necessary is the scope activation.
1179 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1181         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1182         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1183         CS0206 checks.
1184         (Argument.Resolve): Remove CS0206 checks.
1186 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1188         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1189         scopes for all the roots, the scopes will now be emitted when the
1190         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1192         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1193         code.  This reduces a lot of existing cruft.
1194         
1195         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1196         that the ScopeInfo is generated as we enter the scope, not at the
1197         time of use, which is what we used to do before.
1199         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1200         every time a Block is about to be emitted if we have a
1201         CaptureContext. 
1203 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1205         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1206         (Reset): Update.
1207         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1209         * typemanager.cs (cons_param_array_attribute): Make private.
1210         (Reset): Set it to null.
1211         (InitCoreHelpers): Don't initialize it.
1212         (ConsParamArrayAttribute): New.  Initialize it as needed.
1213         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1215 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1217         * expression.cs: There might be errors reported during the
1218         selection of applicable methods.  If there are errors, do not
1219         continue execution as it will lead the compiler to crash.
1221 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1223         * expression.cs: Member access is not allowed on anonymous
1224         methods.  Fixes #77402.
1226 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1228         Fix #77401
1229         * cs-parser.jay (VariableDeclaration): Don't set
1230         current_array_type to null.
1231         (field_declaration, event_declaration, declaration_statement):
1232         Set it to null here.
1234 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1236         * typemanager.cs (GenericParameterPosition): New.
1237         * doc.cs: Use it.
1239 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1241         * doc.cs : To process "include" elements, first we should create
1242           another list than XmlNodeList, because it could result in node
1243           removal, which could result in that the XmlNodeList gives up
1244           yielding next node.
1246           (Also made code identical to gmcs again.)
1248 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1250         * ecore.cs: Introduce an error report that we were not catching
1251         before, if not silent, we must report the error.  Gonzalo ran into
1252         it.
1254 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1256         A fix for bug: #76957
1257         
1258         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1259         ComputeMethodHost before creating the method, this is a new
1260         requirement. 
1262         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1263         that this method references (RegisterScope).  The actual scope
1264         where the method is hosted is computed with the ComputeMethodHost
1265         before we create the method.
1267         Moved the Deepest routine here.
1269         (AnonymousContainer.ComputeMethodHost): New routine used to
1270         compute the proper ScopeInfo that will host the anonymous method.
1272         (ScopeInfo): Deal with multiple roots.  The problem was that we
1273         did not have a unique root where all ScopeInfos could be hanged
1274         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1275         of roots.  
1277         Remove AdjustMethodScope which is now computed at the end.  Remove
1278         LinkScope which did a partial link, instead link all ScopeInfos
1279         before code generation from the new "LinkScopes" routine. 
1281         Simplify all the Add* routines as they no longer need to maintain
1282         the tree, they just need to record that they are using variables
1283         from a ScopeInfo.
1285         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1286         routines to produce the forest of ScopeInfo trees.
1288         * class.cs (TypeContainer.AppendMethod): This is just like
1289         AddMethod, but ensures that an interface implementation method
1290         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1291         methods, but at the end.
1293         We use this functionality to ensure that the generated MoveNext
1294         method in the iterator class is resolved/emitted before the
1295         enumerator methods created.   
1297         This is required because the MoveNext method computes the right
1298         ScopeInfo for the method.  And the other methods will eventually
1299         need to resolve and fetch information computed from the anonymous
1300         method. 
1302 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1303             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1305         Fix rest of #76995.
1306         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1307         the 'aliases' hash.
1308         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1309         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1311 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1313         Fix #76656, cs0231-2.cs.
1314         * cs-parser.jay (formal_parameter_list): Make error case catch
1315         more issues.
1316         (parenthesized_expression_0): Add CS1026 check.
1317         (invocation_expression): Remove unused { $$ = lexer.Location }.
1319 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1321         Fix #76824.
1322         * cs-parser.jay (statement_expression): Don't list out the
1323         individual statement-expressions.  Convert syntax error into
1324         CS0201 check.
1326 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1328         Fix #76874.
1329         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1330         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1331         CheckIntermediateModification.
1332         (FieldExpr.DoResolve): Add new two-argument version that
1333         allows us to resolve the InstanceExpression as an lvalue.
1334         The one-argument variant is now just a wrapper.
1335         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1336         Resolve the lhs as an lvalue if the it has a value type.
1337         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1338         from Assign.DoResolve.
1339         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1340         resolved as an lvalue.
1341         (PropertyExpr.DoResolve): Update.
1342         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1343         has a value type.  Move CS1612 check here from
1344         CheckIntermediateModification.
1345         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1346         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1347         'right_side' of a ResolveLValue on an 'out' argument.
1348         (EmptyExpression.LValueMemberAccess): New.  Used as the
1349         'right_side' of a propagated ResolveLValue on a value type.
1350         (LocalVariableReference.DoResolveBase): Recognize
1351         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1352         Add CS1654 check.
1353         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1354         EmptyExpression.Null.
1356 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1358         * typemanager.cs : added IsGenericParameter(). In mcs it always
1359           return false.
1360         * doc.cs : for generic parameters, use GenericParameterPosition,
1361           not FullName.
1363 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1365         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1367 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1369         This fixes the problem where we used ldfld instead of ldflda to
1370         load the "THIS" pointer on captured parameters, when THIS is a
1371         value type.  See bug #77205.
1372         
1373         * iterators.cs (CapturedThisReference.Emit): Pass false to
1374         EmitThis (we do not need the address).
1376         * codegen.cs (EmitThis): it needs to know whether we need the
1377         address of `this' or not.  This is used by value types.  
1379         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1380         every other call passes false.
1382 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1384         Fix #77221.
1385         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1386         GetOverride.
1387         * expression.cs (Invocation.OverloadResolve): Update.
1388         (Invocation.DoResolve): Avoid double resolution of invocation.
1390 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1392         Fix #77180.
1393         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1394         unary negation of floating point types as 0-expr; negation cannot
1395         overflow in floating point types.
1397         Fix #77204.
1398         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1399         on operands of 'void' type.
1401         Fix #77200.
1402         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1403         and ExclusiveOr for boolean constants too.
1405 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1407         Fix #75636.
1408         * expression.cs (Invocation.OverloadResolve): Replace reflected
1409         override methods with their base virtual methods, rather than
1410         skipping over them.
1411         * typemanager.cs (TypeManager.GetOverride): New.
1413 2006-01-05  Jb Evain  <jbevain@gmail.com>
1415         * class.cs (Property.Define, Indexer.Define): do not tag the
1416         properties as SpecialName | RTSpecialName.
1418 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1420         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1421         doing a low-level comparission of parameter types.  It was lacking
1422         a check for __argslist. 
1424 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1426         * expression.cs (ParameterReference.DoResolveBase): Allow
1427         reference parameters if they are local to this block. 
1429         This allows the ref and out parameters of a delegate to be used in
1430         an anonymous method, for example:
1432         delegate void set (out int x);
1434         set s = delegate (out int x){
1435                 x = 0;
1436         };
1438         This is used by functionality introduced late in the C# language.
1439         
1440         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1441         method that take ref and out parameters. 
1443         Fixes #77119 which was a late change in the spec.
1445 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1447         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1448         parent if its the same scope.  Fixes #77060.
1450 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1452         * driver.cs: Report the case of no source files and no -out:
1453         argument provided.
1455 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1457         Fix #77035.
1458         * expression.cs (ComposedCast.GetSignatureForError): Define.
1460 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1462         Fix #76995
1464         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1465         ListDictionary, to contain the ExternAliasEntry entries (in
1466         addition to the NamespaceEntry.aliases hashtable). This field is
1467         shared between the original entry and its doppelganger (bodyless 
1468         copy of it).
1469         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1470         extern_aliases field.
1471         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1472         lookup in extern_aliases.
1474 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1476         Fix #77006.
1477         * class.cs (TypeContainer.Mark_HasEquals): New.
1478         (TypeContainer.Mark_HasGetHashCode): New.
1479         (ClassPart): Override them.
1480         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1482         Fix #77008.
1483         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1484         'parent' argument to the base constructor.
1486         Remove all mention of TypeContainer from decl.cs.
1487         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1488         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1489         (DeclSpace.DeclSpace): Likewise.
1490         (DeclSpace.DefineMembers): Remove unused argument.
1491         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1492         debugging check -- we don't care if the debug code throws an
1493         InvalidCastException instead of an InternalErrorException.
1494         * class.cs (TypeContainer.DefineMembers): Update to changes.
1495         (TypeContainer.DoDefineMembers): Likewise.
1496         (TypeContainer.GetMethods): Likewise.
1497         (PropertyMember.Define): Likewise.
1498         (MemberBase.Parent): New property that forwards to
1499         MemberCore.Parent, but ensures that we get a TypeContainer.
1500         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1501         (RootContext.PopulateTypes): Likewise.  Remove special case code
1502         for !RootContext.StdLib: DefineMembers is idempotent.
1504 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1506         * convert.cs (ExplicitConversionCore): Check the return value from
1507         ExplicitConversionCore which can return null on failure.  Fixes #76914
1509 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1511         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1513 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1515         * doc.cs : The search for referenced namespace was insufficient to
1516           get global one as it used to do. Fixed bug #76965.
1518 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1520         * doc.cs : check name in cref in the last phase that whether it is
1521           namespace or not.
1523 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1525         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1526           Mono.C5.
1528 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1530         * doc.cs : so it turned out that we cannot skip override check for 
1531           interface members. Fixed bug #76954.
1533 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1535         * cs-tokenizer.cs : fixed bug #75984:
1536           - #warning and #error should not be handled when the source line
1537             is disabled.
1538           - #line is not checked strictly when the source line is disabled.
1539           - #define and #undef is on the other hand checked strictly at any
1540             state.
1542 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1544         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1545           CS1027 report.
1547 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1549         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1551         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1552         event initializers.
1553         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1554         (FieldBase.Initializer): Initializer is now optional.
1555         (EventField.Define): Only event field can have initializer.
1557         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1559         * const.cs (Const): Reuse initializer.
1561         * cs-parser.jay: Updated after FieldBase changes.
1562         Added current_array_type to simplify array initializers.
1564         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1566         * expression.cs, iterators.cs: Updated.
1568         * namespace.cs (NamespaceEntry): Made UsingFound private.
1570 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1572         * parameterCollection.cs: Obsolete, removed.
1573         * parser.cs: Obsolete, removed.
1575 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1577         Fix #76849.
1578         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1580         * enum.cs (Enum.Define): Set obsolete context here.
1582 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1584         * doc.cs :
1585           - FindDocumentedMember() now expects 1) paramList as null
1586             when "we don't have to check the number of parameters" and
1587             2) Type.EmptyTypes when "there is no arguments".
1588           - Introduced FoundMember struct to hold the exact type which was
1589             used to find the documented member (the above change broke
1590             test-xml-044; it might be better just to use DeclaringType than
1591             what MS does, like this change does, but it depends on usage.)
1593 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1595         * doc.cs : documented member might be from DeclaringType for nested
1596           types. Fixed bug #76782.
1598 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1600         * anonymous.cs: Have the param code handle leaving copies on the
1601         stack etc. Allows anonymous params to take part in the assignment
1602         code (++, +=, etc). Fixes bug #76550
1604         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1605         it down to the anon code.
1607         * iterators.cs: Use dummy var here
1609         * codegen.cs: Handle new vars
1611 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1613         Fix #76849.
1614         * class.cs (MethodData.Define): Set proper Obsolete context.
1616         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1617         obsolete context.
1618         (FieldExpr.DoResolve): Ditto.
1620 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1622         Fix #76849.
1623         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1624         parent is not obsolete.
1626 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1628         * doc.cs : (FindDocumentedMember) find parameterless members first
1629           and get CS0419 in the early stage. Fixed first case of bug #76727.
1631 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1633         Fix #76859.
1634         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1635         no error was reported.
1637         *expression.cs (Binary.DoResolve): left can be null.
1639 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1641         Fix #76783.
1642         * class.cs (MethodData.Emit): Parameters should be labeled first.
1644 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1646         Fix #76761.
1647         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1649 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1651         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1653         * class.cs (MethodCore): Parameter clean up.
1654         (IMethodData): Added ParameterInfo.
1655         (MethodData): Parameter clean up.
1656         (Indexer.Define): Parameter clean up.
1658         * anonymous.cs,
1659         * codegen.cs,
1660         * cs-parser.jay,
1661         * decl.cs,
1662         * doc.cs,
1663         * ecore.cs,
1664         * flowanalysis.cs,
1665         * iterators.cs,
1666         * pending.cs,
1667         * statement.cs,
1668         * typemanager.cs: Parameter clean up.
1670         * delegate.cs (Define): Get rid of duplicated code.
1672         * expression.cs (ParameterReference): Removed useless parameters
1673         and simplified.
1674         (Invocation): Ditto.
1676         * parameter.cs (ParamsParameter): New class, params specialization.
1677         (ArglistParameter): Attemp to separate arglist.
1678         (Parameter): Refactored to be reusable and faster.
1679         (Parameter.Modifier): Made understandable.
1680         (Parameters): Changed to be used as a class for `this' assembly
1681         parameters. Refactored to use new specialized classes.
1683         * support.cs (ParameterData): Added Types property.
1684         (InternalParameters): Deleted.
1686 2005-08-20  Martin Baulig  <martin@ximian.com>
1688         Merging this patch from GMCS to fix #75867.
1690         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1691         scope if we don't already have it.
1693 2005-11-17  Martin Baulig  <martin@ximian.com>
1695         * anonymous.cs
1696         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1697         inherit the scope from our parent.  Fixes #76653.
1699 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1701         * doc.cs : the previous patch does not actually fix the bug.
1702           PropertyInfo override check is now implemented and really fixed it.
1703         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1705 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1707         * doc.cs : apply "override filter" also to properties.
1708           Fixed bug #76730.
1710 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1712         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1713           no need to check overrides. For classes, omit those results from 
1714           interfaces since they must exist in the class. Fixed bug #76726.
1716 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1718         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1719           with different parameters. Fixed the second problem in #76685.
1721 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1723         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1724           get expected 'protected' access in CheckValidFamilyAccess()).
1725           Fixed bug #76692.
1727 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1729         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1730           Fixed bug #76705.  CS1569 was incorrectly commented out.
1732 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1734         * doc.cs : use Invocation.IsOverride() to do real override check.
1735         * expression.cs : made Invocation.IsOverride() internal.
1737 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1739         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1740           TypeBuilder.FindMembers() and filter overriden base members out.
1741           Fixed bug #76990.
1743 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1745         * doc.cs : ref/out parameters are represented as '@' (instead of
1746           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1748 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1750         * doc.cs : when there was no '.' in cref to methods in doc comment,
1751           then parameters were missing in the output. Fixed bug #76691.
1753 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1755         * driver.cs : don't output docs when there is an error.
1756           Fixed bug #76693.
1758 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1760         * doc.cs :
1761           Now it should detect indexers. Fixed primary concern in bug #76685.
1762           Fixed CS0419 message to not show the identical member signature in
1763           the message.
1765 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1767         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1768           instead of Type.FindMembers() since it does not handle events.
1769           Fixed bug #71604.
1771 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1773         * codegen.cs: Fixed typo (speficied -> specified).
1775 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1777         Fix #76369.
1778         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1780 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1782         * attribute.cs: Changed error message.
1784         * cs-tokenizer.cs: One more check.
1786 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1788         * statement.cs (Block.Resolve): Ignore empty statement.
1790 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1792         * report.cs: Made error/warning methods more strict to avoid
1793         their misuse.
1795         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1796         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1797         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1798         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1800 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1802         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1803         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1805         * class.cs (TypeContainer.IsComImport): New property.
1806         (Constructor.Define): Create proper ctor for ComImport types.
1808         * expression.cs (New.CheckComImport): Fixed.
1810 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1812         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1813         that a parameter has been captured does not mean that we do not
1814         have to do the rest of the processing.  This fixes the second part
1815         of #76592.  If there was another anonymous method capturing
1816         values in the past, the Scope would never be set for the second
1817         method that captured the same parameter.
1819         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1820         properly manipulate the stack.   Second part of fix for #76592.
1822         * expression.cs (New): Add support for invoking "new" on
1823         interfaces that have been flagged with the ComImport attribute and
1824         the CoClass.  Fixes #76637 
1826         * statement.cs (Try.DoEmit): When a variable is captured, do not
1827         try to emit the vi.LocalBuilder variable as it has been captured.
1828         Create a temporary variable and store the results on the
1829         FieldBuilder.  Fixes #76642
1831 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1833         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1835         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1837         * expression.cs (Binary.DoResolve): Added && optimalization.
1838     
1839         * typemanager.cs (AddUserType): Removed useless argument.
1841 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1843         * statement.cs (Block.variables): Uses ListDictionary.
1845 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1847         Fix #75969.
1848         * class.cs (PartialContainer.EmitType): Customized to emit
1849         security attributes.
1850         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1851         for partial classes.
1853 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1855         Fix #76599.
1856         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1857         access has to be fixed.
1858         
1859         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1861 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1863         Fix #76590.
1864         * ecore.cs (NullCast.Reduce): Implemented.
1866         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1867         constant type.
1868         
1869         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1870         properly.
1871         (Foreach.Resolve): Catch null properly.
1873 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1875         * cs-tokenizer.cs: Warning text fix.
1877         * driver.cs: AllWarningNumbers exposed on public interface.
1879         * report.cs (): Reviewed warning numbers.
1880         (IsValidWarning): Use binary search.
1882 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1884         * driver.cs: Implemeted resource visibility.
1885         (Resources): New class for code sharing between /res: and
1886         /linkres:
1888 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1890         Fix #76568.
1891         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1892         folding.
1893         
1894         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1895         contants only.
1896         
1897         * ecore.cs (NullCast): Child is contant only.
1898         
1899         * literal.cs (NullLiteral.Reduce): null can be converted to any
1900         reference type.
1902 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1904         * driver.cs: Use Encoding.Default as default code page instead
1905           of ISO-28591.
1907 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1909         Fix #76085.
1910         * expression.cs (Invocation.Error_InvalidArguments): Handle
1911         __arglist parameters.
1912         (Invocation.VerifyArgumentsCompat): Likewise.
1913         * support.cs (ReflectionParameters.GetSignatureForError): Print
1914         __arglist parameters.
1915         (InternalParamters.GetSignatureForError): Likewise.
1916         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1918 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1920         * attribute.cs (GetPropertyValue): Made public.
1922         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1923         Resolve.
1924         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1925         attribute.
1926         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1927         is not defined.
1928         
1929         * driver.cs: Reflect method name change.
1930         
1931         * statement.cs (Try.Resolve): Warn when try has both general
1932         exception handlers.
1933         
1934         * typemanager.cs: runtime_compatibility_attr_type new predefined
1935         type.
1937 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1939         Fix #76419.
1940         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1941         treat it as an empty parameter list.
1943 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1945         Fix #76271.     
1946         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1947         ResolveAsTypeStep silent.
1948         * statement.cs (Block.AddConstant): Mark block as used.
1949         (Block.ResolveMeta): Avoid piling on error messages
1950         if a constant initializer resolution fails.
1952 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1954         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1955         Remove.
1956         (NamespaceEntry.VerifyAllUsing): New.
1957         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1958         behaviour.  Delegates actual resolution of alias to ...
1959         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1960         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1961         Update.
1962         * driver.cs (Driver.MainDriver): Update.
1963         
1964         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1965         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1966         property.
1967         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1968         Remove.
1969         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1970         RootNamespace.DefineNamespacesForAll.
1972 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1974         * typemanager.cs (assemblies, external_aliases, modules)
1975         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1976         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1977         overhead.  Move resposibility ...
1978         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1979         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1981 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1983         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1984         cached_namespaces.  Improve usage.
1985         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1986         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1987         Move from GlobalRootNamespace and simplify.
1988         (RootNamespace.Global): Make instance variable.
1989         (RootNamespace.RootNamespace): Add "alias name" parameter.
1990         (GlobalRootNamespace): Simplify drastically.
1991         (Namespace.Lookup): Don't use GetNamespace.
1992         * typemanager.cs (GetRootNamespace): Rename from
1993         ComputeNamespaceForAlias.
1994         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1996 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1998         * anonymous.cs (AnonymousContainer): Don't crash when container
1999         doesn't exist.
2001 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2003         * expression.cs (Binary.DoResolve): Warn when comparing same
2004         values.
2006 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2008         Fix #76486.
2009         * expression.cs (Binary.DoResolve): It looks like there are no
2010         convetsion rules in enum context.
2012 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2014         Add support for extern alias qualifiers.
2015         * typemanager.cs: Move some LookupTypeReflection code
2016         to namespace.cs, to have cleaner code. Added some methods
2017         to help us keep track of the extern aliased references.
2018         * driver.cs: Add suport for extern alias assemblies on command
2019         line and check for their warnings/errors. Also keep track of the
2020         extern aliased assemblies.
2021         * namespace.cs: Move the global functionality of Namespace
2022         to GlobalRootNamespace/RootNamespace. Now the global namespace
2023         is GlobalRootNamespace.Globa. Also the code moved from 
2024         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2025         Finally added LocalAliasEntry (AliasEntry before) and
2026         ExternAliasEntry, to handle alias statements.
2027         * cs-parser.jay: Add support in the grammar for extern alias
2028         statement.
2029         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2030         Update callings to Namespace (now in GlobalRootNamespace).
2032 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2034         Fix #76371.
2035         * class.cs (TypeContainer.DefineType): Move updating of
2036         topological sort earlier in the code.
2037         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2039 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2041         Fix #76273.
2042         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2043         
2044         * constant.cs (Constant.TryReduce): Moved from Cast class.
2045         (Reduce): Made little bit more OO and fixed missing conversions.
2046         
2047         * ecore.cs (Reduce): Implemented.
2048         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2049         
2050         * literal.cs (Reduce): Implemented.
2051         
2052         * class.cs: Reverted Miguel's wrong commit.
2054 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2056         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2058 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2060         * cs-parser.jay, expression.cs : CS0214 was missing error location
2061           for constants. Fixed bug #76404.
2063 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2065         Fix #76370.
2066         * convert.cs (ExplicitConversionCore): Fixed object->enum
2067         conversion.
2069 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2071         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2072         InstanceExpression.
2073         (PropertyExpr.EmitCall): Likewise.
2074         * expression.cs (Invocation.EmitArguments): Handle case where
2075         arguments == null.
2076         (Invocation.EmitCall): Avoid allocating temporary variable if
2077         there are no arguments.
2079 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2081         Fix #76323.
2082         * convert.cs (ImplicitConversionStandard): Move conversion of
2083         void* to arbitrary pointer types ...
2084         (ExplicitConversionStandard): .. here.
2085         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2086         error to always print typenames.
2088 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2090         * convert.cs (GetConversionOperator): Rename from
2091         GetConversionOperators.  Move operator selection code from ...
2092         (UserDefinedConversion): ... here.
2094 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2096         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2097         conversion.
2099 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2101         * assign.cs (Assign.DoResolve): Error method changed.
2103         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2104         
2105         * const.cs (ResolveValue): Reset in_transit immediately.
2106         
2107         * constant.cs: Error method changed.
2108         
2109         * convert.cs: Removed useless location parameter.
2110         (ExplicitNumericConversion): Don't do double enum check.
2111         (ExplicitConversionCore): Renamed from ExplicitConversion.
2112         (ExplicitUnsafe): Extracted from ExplicitConversion.
2113         (ExplicitConversion): Uses for error reporting.
2114         
2115         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2116         error messages.
2117         (ResolveBoolean): Uses common error method.
2118         (CastToDecimal): Get rid of ec.
2119         (CastFromDecimal): Optimized.
2120         (ConvCast): Get rid of ec.
2121         
2122         * enum.cs (ResolveValue): Reset in_transit immediately.
2123         (Emit): Return after first error.
2124         
2125         * expression.cs: Convert changes.
2126         
2127         * literal.cs: Error method changed.
2128         
2129         * statement.cs: Error method changed.
2131 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2133         * support.cs (SeekableStreamReader.Position): Don't error out when
2134         the requested position is just beyond the end of the current
2135         buffered data.
2137 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2139         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2140         try to keep in sync with the byte count of the underlying Stream.
2141         However, this limits us to a window size of 2048 characters: i.e.,
2142         the maximum lookahead of our lexer/parser can be 2048 characters.
2144 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2146         Fix #76255.
2147         * driver.cs: Fix compilation files with full root path.
2149 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2151         * report.cs (SymbolRelatedToPreviousError): Format the output so
2152         it does not use an open parenthesis that is never closed. 
2154         * driver.cs: Follow coding guidelines
2156 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2158         Fix #72930.
2159         * const.cs (Const.ResolveValue): Check for assigning non-null
2160         value to reference type.
2162 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2164         * anonymous.cs: Implemented ExprClassName.
2165         
2166         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2167         delegate.
2168         
2169         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2170         check.
2171         
2172         * class.cs (StaticClass.DefineContainerMembers): Report protected
2173         members as error.
2174         
2175         * codegen.cs: if(ed) PRODUCTION.
2176         
2177         * convert.cs (Error_CannotImplicitConversion): Better error
2178         distinction.
2179         
2180         * cs-parser.jay: More error checks.
2181         
2182         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2183         
2184         * driver.cs (CSCParseOption): Enabled wrong option check.
2185         
2186         * ecore.cs (Expression.ExprClassName): Turned to property.
2187         (MemberExpr.CheckIntermediateModification): For checking boxed
2188         value types     modification.
2189         
2190         * statement.cs (Fixed.Resolve): Expression type must be
2191         convertible to fixed type.
2192         (CollectionForeach.GetEnumeratorFilter,TryType):
2193         Small refactoring for easier error checking.
2195 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2197         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2198         attributes.
2199         
2200         * class.cs (GeneratedBaseInitializer): New class for customization
2201         compiler generated initializers.
2202         (MemberBase.DoDefine): Check Obsolete attribute here.
2203         (FieldMember.DoDefine): Ditto.
2204         
2205         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2206         constants.
2207         
2208         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2209         (MemberCore.GetObsoleteAttribute): Removed argument.
2210         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2211         (MemberCore.CheckObsoleteType): New helper.
2212         
2213         * delegate.cs,
2214         * enum.cs,
2215         * statement.cs: Updates after MemberCore changes.
2216         
2217         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2218         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2219         
2220         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2221         obsolete attribute for compiler construct.
2222         (As.DoResolve): Cache result.
2223         
2224         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2226 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2228         Fix #76133.
2229         * expression.cs (This.VerifyFixed): In a value type T, the type of
2230         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2231         value type R, 'this' is treated as a value parameter.
2233 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2235         * statement.cs (Lock): Use the TemporaryVariable class instead of
2236         manually using local variables as those do not work when variables
2237         are captured.
2239         * ecore.cs: Moved the TemporaryVariable class from being a nested
2240         class inside Foreach to be a public class that can be employed in
2241         other places. 
2243 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2245         * cs-parser.jay: interface_accessors replaced by
2246         accessor_declarations.
2248         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2249         location.
2250         
2251         * statement.cs (GotoCase.Resolve): Convert null constant to
2252         null case.
2253         (SwitchLabel.ResolveAndReduce): Ditto.
2254         (SwitchLabel.NullStringCase): Custom null stamp.
2255         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2256         
2257         typemanager.cs (CSharpSignature): Don't skip first argument
2258         for full names.
2260 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2262         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2264         * location.cs (InEmacs): in this mode, do not report column
2265         location as it confuses Emacs.
2267 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2269         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2270         expression.cs, iterators.cs, literal.cs: Store constants and
2271         literals location.
2272         
2273         * class.cs (MemberBase.ShortName): Pass location.
2274         
2275         * cs-parser.jay: Some location fixes.
2276         
2277         * ecore.cs (Expression.Location): Made virtual.
2279 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2281         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2282         if the underlying types are the same, otherwise we need to produce
2283         code that will do the proper cast.
2285         This was exposed by Marek's constant rewrite which produced
2286         invalid code for the call site:
2288         enum X : long { a }
2289         void Method (X v) {}
2291         Method ((X) 5)
2293         This fixes test-49.cs
2295 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2297         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2298           Type/Object should be allowed as well. Fixed bug #75968.
2300 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2302         * expression.cs : (Binary.DoResolve): when one is enum constant and
2303           another is constant 0, then return enum one *as enum type*.
2304           Fixed bug 74846.
2306 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2308         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2309         internal.
2311         Fix #75941.
2312         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2313         flow-branching for LocalVariableReferences in case we were invoked
2314         from a MemberAccess.
2315         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2316         Carved out of ...
2317         (LocalVariableReference.DoResolveBase): ... this.
2318         (MemberAccess.Resolve): Do the check that was disabled during
2319         SimpleNameResolve.
2321 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2323         * class.cs :
2324           (PartialContainer.Create): check abstract/sealed/static strictly
2325           but abstract/sealed can exist only at one side. Fixed bug #75883.
2327 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2329         Fix #75945.
2330         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2331         specified, don't default to UnmanagedType.I4.
2333 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2335         * expression.cs : conditional operator should check possibly
2336           incorrect assign expression. Fixed bug #75946.
2338 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2340         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2341           Reverting the change. gmcs is much complex than mcs on this matter.
2343 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2345         * cs-tokenizer.cs : To read another token ahead of the actual 
2346           consumption, use new SavedToken and cache token instead of moving
2347           back the stream with SeekableStreamReader (it seemed problematic).
2348         * cs-parser.jay,
2349           driver.cs : Thus use StreamReader directly.
2350         * support.cs : Thus removed SeekableStreamReader.
2352 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2354         Fix #75934.
2355         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2356         (ScopeInfo.EmitScopeType): Use it to construct field names from
2357         names of captured locals.
2359         Fix #75929.
2360         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2361         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2362         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2363         (ExplicitConversion): Remove enum cases already handled by
2364         implicit conversion.  Move implicit conversion check to the beginning.
2365         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2366         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2367         Don't treat System.Enum as a struct.
2369 2005-08-30  Jb Evain  <jbevain@gmail.com>
2371         * attribute.cs: handles as expression in parameters.
2373 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2375         Fix #75802.
2376         * class.cs (TypeContainer.VerifyClsName): Don't use a
2377         PartialContainer when verifying CLS compliance.
2378         (AbstractPropertyEventMethod): Set Parent here, ...
2379         (PropertyMethod): ... not here.
2381 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2383         * attribute.cs : escaped attribute name should not be allowed to be
2384           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2386 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2388         Fix #75927.
2389         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2390         when converting a long constant to unsigned long.
2391         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2392         detect where IsApplicable and VerifyArgumentsCompat disagree.
2394 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2395         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2397         Fix #75848.
2398         * class.cs (TypeContainer.CanElideInitializer): New helper.
2399         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2400         can safely emitting the initializer of a field.
2402 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2404         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2405           allowed inside a switch (without loop). Fixed bug #75433.
2407 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2409         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2410         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2412 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2414         * driver.cs : kinda reverting the default encoding changes (not exact 
2415           revert since I noticed that "codepage:reset" might not work fine).
2417 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2419         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2420           Location. Now getter and setter store location correctly.
2421           (errors/cs0111-12.cs now reports the expected location.)
2423 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2425         * driver.cs : Use default encoding on the environment.
2426           Removed (now that) extra parameter for SeekableStreamReader.
2427         * support.cs : (SeekableStreamReader) third .ctor() argument for
2428           StreamReader is not required (always true). preamble size could
2429           be acquired in simpler and safe way.
2431 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2433         * cs-parser.jay: report CS0642 at warning level 3
2434           and report CS0642 for an if else statement also
2435           fixes bug #74745. Patch by John Luke (and a bit
2436           modified by me).
2437           Removed extra CS0642 warning check for "while",
2438           "for" and "fixed".
2439         * statement.cs: In Block.Resolve(), CS0642 check
2440           is reimplemented to check a sequence of an empty
2441           statement and a block.
2443           Both fix bug #66777.
2445 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2447         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2448         detection until I fix it.
2449         
2450         * cs-tokenizer.cs: Changed error message.
2451         
2452         * cs-parser.jay: Fixed 2 error locations.
2453         
2454         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2455         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2456         properties.
2457         
2458         * enum.cs (GetSignatureForError): Fixed.
2459         
2460         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2461         method detection.
2462         
2463         * class.cs,
2464         * typemanager.cs (RegisterProperty): Removed.
2465         
2466         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2468 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2470         Fix #75874.
2471         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2472         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2474 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2476         * expression.cs : tiny fix is required for not warning positive ulong.
2477           See test-441.cs.
2479 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2481         * expression.cs : add CS0652 check for constant and integral
2482           expression. Fixed bug #53974.
2484 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2486         * expression.cs : in DoNumericPromotions(), check if there is implicit
2487           conversion overload for string (to check CS0034). Fixed bug #52492.
2489 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2491         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2493 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2495         * ecore.cs : report location when it is *not* Null.
2497 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2499         * codegen.cs,
2500           ecore.cs,
2501           flowanalysis.cs,
2502           expression.cs:
2503           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2504           correctly. Fixed bug #75721.
2506 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2508         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2509         loop that performs 'min (pos, char_count)'.
2511         Fix #75862.
2512         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2513         converted value in Operator.OnesComplement.
2515 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2517         * anonymous.cs: If the anon method is pulled into a helper class,
2518         it needs to be `internal' not `private'. Fixes runtime behavior on
2519         msft. bug #75704
2521 2005-08-20  Martin Baulig  <martin@ximian.com>
2523         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2524         scope if we don't already have it.
2526         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2527         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2528         fixes #75867.
2530 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2532         Fix #75803
2533         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2534         is a partial class.
2536 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2538         The big constants rewrite
2539         Fix #75746, #75685 and more
2540         As a side effect saved 1MB for MWF ;-)
2541         
2542         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2543         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2544         enum based for corlib compilation.
2545         
2546         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2547         subtractions.
2548         
2549         * class.cs (FixedField.Define): Use ResolveAsConstant.
2550         
2551         * const.cs (IConstant): Interface constants and enums.
2552         (Const.ResolveValue): New method for constant resolvning.
2553         (ExternalConstant): Constants from imported assemblies.
2554         
2555         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2556         conversion; like enums.
2557         (Constant.ToType): Converts this constant to different type.
2558         (Constant.Increment): Adds 1.
2559         
2560         * convert.cs (ImplicitConversionRequired): Simplified.
2561         
2562         * cs-parser.jay: Create EnumMember directly.
2563         
2564         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2565         
2566         * doc.cs (GenerateEnumDocComment): Removed.
2567         
2568         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2569         (ConvertIntLiteral): Removed.
2570         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2571         
2572         * enum.cs (EnumMember): Implement IConstant.
2573         (Enum.IsValidEnumConstant): Removed.
2574         (Enum.GetNextDefaultValue): Removed.
2575         (Enum.FindMembers): Updated.
2576         (Enum.GenerateDocComment): Iterate enum members.
2577         
2578         * expression.cs (Cast.TryReduce): Handle enums correctly.
2579         (New.Constantify): Made public.
2580         (MemberAccess.DoResolve): Removed contant specific if(s).
2581         
2582         * literal.cs (NullLiteral): Implement new abstract methods.
2583         
2584         * statement.cs (GotoCase.Resolve): Use new constant methods.
2585         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2586         
2587         * typemanager.cs (LookupEnum): Removed.
2588         (IsEnumType): Fixed to work with corlib.
2589         (RegisterConstant): Removed.
2590         (LookupConstant): Removed.
2591         (GetConstant): Changed to work with IConstant.
2593 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2595         * location.cs : Fixed overflown (>255) column number.
2597 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2599         First cut of the qualified-alias-member feature.
2600         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2601         token.
2602         * cs-parser.jay (DOUBLE_COLON): New token.
2603         (namespace_or_type_name): Add rule for recognizing
2604         qualified-alias-members.
2605         (primary_expression): Likewise.
2606         (element_access): Allow QualifiedAliasMember as a possible
2607         type-bearing expression.
2608         (local_variable_type, local_variable_pointer_type): Likewise.
2609         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2610         aliases in the current and enclosing namespace declarations.
2611         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2612         * decl.cs (MemberName.is_double_colon): New.
2613         (MemberName.MemberName): Add new constructor for alias-member.
2614         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2615         * expression.cs (QualifiedAliasMember): New expression type.
2617 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2619         * location.cs : it borked when no argument was specified.
2621 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2623         * location.cs : tiny ToString() format fix.
2625 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2627         * statement.cs : oops, it was missing.
2629 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2631         A set of fixes for precise line/column location.
2633         * location.cs :
2634           "token" field now holds a file/line "delta", a line number offset 
2635           from the segment, and a column number. See also:
2636           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2637           December/009508.html
2638           Removed static IsNull. Use instance IsNull property instead.
2639         * cs-tokenizer.cs :
2640           For some tokens it stores Location. For Identifier it stores
2641           LocatedToken which is a pair of string name and location.
2642           Column numbers are adjusted only at getChar().
2643         * report.cs :
2644           Use Location.ToString() for reporting (it now contains column).
2645         * cs-parser.jay :
2646           Largely modified to use LocatedToken instead of
2647           string (IDENTIFIER), and to acquire Location from some tokens.
2648         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2649           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2650           codegen.cs :
2651           Now MemberName holds Location. DeclSpace.ctor() receives Location
2652           as a parameter. Removed extra parameters to all derived classes.
2653           Replaced Location.IsNull() with instance property.
2654         * assign.cs, expression.cs :
2655           Added .ctor() overload that omits Location.
2656         * attribute.cs :
2657           Added "nameEscaped" flag that indicates the identifier was escaped
2658           in the source file. This fixes bug #57047.
2660 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2662         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2663         New method, looking for lo-case imported cls type.
2665         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2666         here.
2668         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2670         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2672         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2673         all_imported_types.
2674         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2676         Optimized to save 3.5 MB for SWF compilation.
2678 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2680         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2681         (PartialContainer.Create): Moved logic AddToContainer.
2682         (PartialContainer.MarkForDuplicationCheck): Shares name.
2683         
2684         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2685         place.
2686         
2687         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2688         initialization.
2689         (Namespace.GetSignatureForError): New method.
2690         
2691         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2692         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2694 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2696         Fix #75669.
2697         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2698         member lookup rather than qualifier_type, since qualifier_type can
2699         be null.
2701 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2703         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2704         enum member.
2706 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2708         * statement.cs: Copy the local exception into the exception
2709         captured local.  Fixes 75674
2711 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2713         Fix #75658.
2714         * expression.cs (Invocation.OverloadResolve): Don't report error
2715         CS1501 if error CS1502 has been reported.
2716         (New.DoResolve): Delegate CS1501 reporting to
2717         Invocation.OverloadResolve.
2719         Fix #75656.
2720         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2721         invariant-meaning-in-block property in an enclosing block if
2722         necessary.
2724 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2726         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2727         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2728         (Switch.CheckSwitch): Just save 50kb for SWF.
2730 2005-07-27  Martin Baulig  <martin@ximian.com>
2732         * anonymous.cs (CaptureContext.AddField): Added
2733         `AnonymousContainer am' argument; compute its toplevel scope if
2734         it's not already computed.  Fixes #75649.
2736 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2738         Fix #75628.
2739         * class.cs (Constructor.Emit): Reset block to null if the block
2740         resolve fails.
2742 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2744         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2746 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2748         * class.cs (MethodData.Define): Check whether accessor implementing
2749         interface is public.
2751         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2753 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2755         Fix #57245
2756         * namespace.cs (LookupType): Moved same type check to...
2757         
2758         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2759         with the same name.
2761 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2763         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2764         already found a typebuilder.
2765         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2766         MemberNames, not strings.
2768         * const.cs (Error_ExpressionMustBeConst): 
2769         Rename from Error_EpressionMustBeConst.
2770         * const.cs, class.cs, statement.cd: Update.
2772 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2774         Fix #65573
2776         * const.cs (Const.LookupConstantValue): Report missing contant expression
2777         everytime.
2778         (Error_EpressionMustBeConstant): Only one error method.
2780         * class.cs, statement.c: Updated.
2782 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2784         * statement.cs (Block.Flags): Add back HasVarargs.
2785         (Block.flags): Make protected.
2786         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2788         * typemanager.cs (types, typecontainers, user_types): Remove.
2789         (UserTypes, TypeContainers): Likewise.
2790         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2791         (CleanUp, Reset): Update.
2792         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2793         (GetNestedType): Use Type.GetNestedType.
2794         (CoreLookupType): Take two arguments, the namespace and the
2795         basename of the type.  Update to use the Namespace.Lookup
2796         mechanism.
2797         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2798         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2799         string concatenation and substring matches.
2800         * class.cs, enum.cs, delegate.cs: Update to changes.
2802 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2804         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2805         Expression and made virtual.
2807         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2808         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2810         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2812         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2813         error message.
2815         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2816         change.
2818 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2820         Fix #57707
2821         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2822         AssemblyCultureAttribute is not used on executable.
2824         * rootcontext.cs,
2825         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2827 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2829         Fix #60638.
2830         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2831         New.  Reports CS0252/CS0253.
2832         Mostly taken from preliminary patch by Duncak Mak.
2833         (Binary.DoResolveOperator): Store results of operator lookup.
2834         Use them to detect if we need to warn about unintended reference
2835         comparisons.
2837 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2839         Fix #72969.
2840         * namespace.cs (Namespace.Lookup): Add back location parameter.
2841         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2842         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2844         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2845         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2846         (Namespace.LookupType): ... this.
2847         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2848         of namespaces.
2849         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2850         purported to handle pointers.
2851         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2852         CoreLookupType.
2854 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2856         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2857         type as namespace.
2859 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2861         * namespace.cs (Namespace.Lookup): Drop location parameter.
2862         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2863         (NamespaceEntry.Lookup): ... this.
2864         (NamespaceEntry.Error_AmbiguousTypeReference):
2865         Move here from DeclSpace.
2866         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2867         names ...
2868         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2869         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2870         Move to NamespaceEntry.
2871         * delegate.cs, expression.cs: Update to changes.
2873 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2875         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2876         CheckAttributeType and refactored.
2877         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2878         ResolveAsTypeTerminal error handling.
2879         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2880         handling.
2881         (GetSignatureForError): Print errors in same way.
2883         * class.cs,
2884         * codegen.cs: Reflect attribute GetSignatureForError change.
2886         * ecore.cs,
2887         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2889         * namespace.cs (UsingEntry): Refactored to make fields private.
2891         * assign.cs,
2892         statement.cs: Error_UnexpectedKind has extra parameter.
2894 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2896         * ecore.cs (IAlias): Remove.
2897         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2898         that implement the interface.
2899         * namespace.cs (Namespace): Likewise.
2900         (Namespace.declspaces): Renamed from 'defined_names'.
2901         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2902         DeclSpace instead of an IAlias.
2903         * tree.cs (Tree.AddDecl): Update.
2905 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2907         * statement.cs (Block.Flags); Remove HasVarargs.
2908         (Block.HasVarargs): Move to ToplevelBlock.
2909         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2910         (Block.Variables): Make protected.  Initialize variable hashtable
2911         if necessary.
2912         (Block.AddVariable): Update.
2913         (Block.Resolve): Update to changes.
2914         (ToplevelBlock.HasVarargs): New boolean.
2915         (ToplevelBlock.ThisVariable): Move here from Block.
2916         (ToplevelBlock.AddThisVariable): Likewise.
2917         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2918         * expression.cs (This.ResolveBase): Update to changes.
2919         (ArglistAccess.DoResolve): Likewise.
2921 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2923         Fix #75321
2924         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2926         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2927         not used and not used & assigned.
2928         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2930 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2932         Fix #75053
2933         * expression.cs (Is.DoResolve): null is never provided type.
2935 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2937         Fix #52496
2938         * cs-parser.jay: Less strict event error rule to catch more errors.
2940 2005-07-08  Martin Baulig  <martin@ximian.com>
2942         Fix test-iter-10.cs - distinguish whether we `yield' in a property
2943         gettter (allowed) or setter (not allowed).
2945         * class.cs (Accessor): Implement IIteratorContainer.
2946         (Accessor.Yields): New public field.
2947         (PropertyBase.PropertyMethod.Define): Handle iterators on a
2948         per-accessor basis.
2950         * cs-parser.jay
2951         (get_accessor_declaration, set_accessor_declaration): Set the
2952         `yields' flag on the accessor, not the property.
2953         (property_declaration): Do the iterators check on a per-accessor
2954         basis and not for the whole property.
2956 2005-07-08  Martin Baulig  <martin@ximian.com>
2958         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2959         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2961 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2963         Fix #74975
2964         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2965         (ExtractSecurityPermissionSet): Cope with self referencing security
2966         attributes properly.
2968         * driver.cs (SetOutputFile): Made public property OutputFile.
2970 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2972         Fix #75486.
2973         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2974         has_nonstatic_fields.  Make into a FieldBase pointer.
2975         (TypeContainer.AddField): Add CS0282 check.
2976         (TypeContainer.EmitType): Update.
2978 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2980         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2981         compare if they start with __.
2983 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2985         * statement.cs (Switch.SwitchGoverningType): Only look at
2986         UserCasts that don't need implicit standard conversions to one of
2987         the allowed switch types (Fixes test-322.cs).
2988         (LocalInfo.Resolve): Re-enable sanity-test.
2990 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2992         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2993         
2994         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2995         
2996         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2998 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3000         Fix #75472.
3001         * ecore.cs (SimpleName.GetSignatureForError): Add.
3002         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3003         (MemberAccess.GetSignatureForError): Add.
3005 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3007         The big error and warning messages review.
3008         
3009         * anonymous.cs,
3010         * assign.cs,
3011         * attribute.cs,
3012         * class.cs,
3013         * codegen.cs,
3014         * convert.cs,
3015         * cs-parser.jay,
3016         * cs-tokenizer.cs,
3017         * decl.cs,
3018         * delegate.cs,
3019         * doc.cs,
3020         * driver.cs,
3021         * ecore.cs,
3022         * enum.cs,
3023         * expression.cs,
3024         * flowanalysis.cs,
3025         * iterators.cs,
3026         * literal.cs,
3027         * location.cs,
3028         * modifiers.cs,
3029         * namespace.cs,
3030         * parameter.cs,
3031         * pending.cs,
3032         * report.cs,
3033         * rootcontext.cs,
3034         * statement.cs,
3035         * support.cs,
3036         * tree.cs,
3037         * typemanager.cs: Updated.
3038         
3039         * class.cs: (MethodCore.SetYields): Moved here to share.
3040         (PropertyMethod.Define): Moved iterator setup here.
3041         
3042         * iterators.cs: Add orig_method to have full access to parent
3043         container.
3045 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3047         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3048         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3049         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3050         variable of struct type.
3051         * expression.cs (Unary.ResolveOperator): Update to change.
3052         (Indirection.VerifyFixed): Likewise.
3053         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3054         (ParameterReference.VerifyFixed): Value parameters are fixed.
3055         (This.VerifyFixed): Treat 'this' as a value parameter.
3056         * statement.cs (LocalInfo.IsFixed): Remove.
3058 2005-07-01  Martin Baulig  <martin@ximian.com>
3060         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3061         `ec.EmitThis ()' to get the correct scope.
3063 2005-07-01  Martin Baulig  <martin@ximian.com>
3065         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3066         instance is a ParameterReference; fixes #75299.
3068 2005-07-01  Martin Baulig  <martin@ximian.com>
3070         Reverted Marek's latest patch (r46725):
3071         - it contains structural changes which are neither mentioned in
3072           the ChangeLog nor explained anywhere; for example the additional
3073           argument of EmitContext's and Iterator's .ctor's and the
3074           TypeContainer.DefineMembers() change.
3075         - structural changes like this should go in in seperate patches
3076           and not be hidden in a huge patch which just seems to affect
3077           warnings and errors.
3078           a big and hard to understand patch.
3079         - it breaks iterators and causes regressions, for instance in
3080           test-iter-03.cs.      
3082 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3084         Fix #75412.
3085         * expression.cs (Indexers.map): Remove.
3086         (Indexers.Append): Filter out inaccessible setters and getters.
3087         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3089         Fix #75283.
3090         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3091         Refactored from ...
3092         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3093         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3094         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3095         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3097 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3099         Fix #75322
3100         * class.cs (FieldBase.GetInitializerExpression): One more field
3101         for backup.
3103 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3105         * pending.cs: Do not define a proxy if the base method is virtual,
3106         it will be picked up by the runtime (bug 75270).
3108 2005-06-08  Martin Baulig  <martin@ximian.com>
3110         The big Iterators rewrite :-)
3112         * iterators.cs: Rewrite this to use the anonymous methods framework.
3114         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3115         before the TypeContainers; see 2test-21.cs.
3117         * class.cs
3118         (TypeContainer.DefineType): Don't create a new EmitContext if we
3119         already have one (this only happens if we're an Iterator).
3120         (TypeContainer.Define): Also call Define() on all our iterators.
3121         (Method.CreateEmitContext): Added support for iterators.
3123         * anonymous.cs
3124         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3125         (AnonymousContainer.CreateMethodHost): Moved here from
3126         AnonymousMethod and made abstract.
3127         (AnonymousContainer.CreateScopeType): New abstract method.
3128         (AnonymousContainer.IsIterator): New public property.
3129         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3130         get the ScopeTypeBuilder rather than manually defining it here. 
3131         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3132         iterators here.
3134         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3135         before RootContext.DefineTypes().
3137         * codegen.cs (EmitContext.RemapToProxy): Removed.
3138         (EmitContext.CurrentAnonymousMethod): Changed type from
3139         AnonymousMethod -> AnonymousContainer.
3140         (EmitContext.ResolveTopBlock): Protect from being called twice.
3141         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3142         (EmitContext.EmitThis): Removed the iterators hacks; use the
3143         anonymous methods framework for that.
3145         * statement.cs
3146         (ToplevelBlock.Container): Make this a property, not a field.
3147         (ToplevelBlock.ReParent): New public method; move the
3148         ToplevelBlock into a new container.
3149         (Foreach.TemporaryVariable): Simplify.
3151 2005-06-05  Martin Baulig  <martin@ximian.com>
3153         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3154         (Block.AddTemporaryVariable): New public method; creates a new
3155         `LocalInfo' for a temporary variable.
3156         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3157         variables here.
3158         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3159         non-iterator variables.
3161 2005-06-05  Martin Baulig  <martin@ximian.com>
3163         * statement.cs (Foreach.TemporaryVariable): Create the
3164         LocalBuilder in the Emit phase and not in Resolve since in some
3165         situations, we don't have an ILGenerator during Resolve; see
3166         2test-19.cs for an example.
3168 2005-06-04  Martin Baulig  <martin@ximian.com>
3170         **** Merged r45395 from GCS ****
3172         The big Foreach rewrite - Part II.
3174         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3175         with `PropertyInfo ienumerator_getcurrent'.
3177         * codegen.cs (VariableStorage): Removed.
3179         * statement.cs
3180         (Foreach): Derive from Statement, not ExceptionStatement.
3181         (Foreach.CollectionForeach): New nested class.  Moved all the code
3182         dealing with collection foreach here.
3183         (Foreach.ForeachHelperMethods): Removed.
3184         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3186 2005-05-23  Martin Baulig  <martin@ximian.com>
3188         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3189         don't need to.  Fix #75014.
3191 2005-05-20  Martin Baulig  <martin@ximian.com>
3193         Merged r44808 from GMCS.
3195         * class.cs (TypeContainer.CircularDepException): Removed.
3196         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3197         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3198         (CS0146) and interface (CS0529) dependencies here.
3200 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3202         * expression.cs (Invocation.EmitCall): Fix initialization
3203         'this_call' to reflect current behaviour.  Fix indentation.
3205         * convert.cs (FindMostEncompassedType): Add two trivial special
3206         cases (number_of_types == 0 || number_of_types == 1).
3207         (FindMostEncompasingType): Likewise.
3209 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3211         Some cleanups preparing for the fix of #75283.
3212         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3213         error testing.
3214         (EventExpr.InstanceResolve): Likewise.
3215         (EventExpr.DoResolve): Remove redundant checks.
3217 2005-06-10  Duncan Mak  <duncan@novell.com>
3219         * cs-tokenizer.cs (process_directives): New flag for controlling
3220         the processing of preprocessor directives.
3221         (x_token): After seeing a '#', return Token.NONE instead of going
3222         to handle_preprocessing_directive() when not processing
3223         directives. This avoids unnecessary processing during the token peek in
3224         is_punct().
3226         This fixes #74939.
3228         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3229         the existing error reporting methods instead of Report.Error.
3231         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3232         after Raja's rewrite.
3234 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3236         * class.cs: Small fix.
3238 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3240         Fix #75160.
3241         * class.cs (GetPartialBases): Fix return value check of
3242         part.GetClassBases.
3244 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3246         Ensure that partial classes are registered in their enclosing
3247         namespace.  Initial part of fix of #75160.
3248         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3249         Register declspace with namespace here, not in
3250         DeclSpace.RecordDecl.
3251         * cs-parser.jay: Pass namespace to RecordDecl.
3252         * class.cs (PartialContainer.Create): Likewise.
3253         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3254         called.
3255         * decl.cs (Declspace.RecordDecl): Remove.
3256         * namespace.cs (NamespaceEntry.DefineName): Remove.
3258 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3260         * rootcontext.cs: Reset TargetExt as well.
3262 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3264         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3265         -langversion:ISO-1.
3267 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3269         Fix #75080, cs0119.cs.
3270         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3271         of ...
3272         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3273         allowing ExprClass.Type and ExprClass.Namespace for
3274         ResolveFlags.VariableOrValue.
3275         (Expression.Resolve) [1-argument variant]: Change default resolve
3276         flags based on language version.
3277         (Expression.Error_UnexpectedKind): Use a simple string array
3278         rather than an ArrayList.
3279         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3280         not ExprClass.Type.
3281         (TypeOfVoid.DoResolve): Likewise.
3282         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3283         flags argument -- it always has the same value.
3285 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3287         Fix #75081.
3288         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3289         Use it in the error message.
3290         * assign.cs, expression.cs, statement.cs: Update.
3292 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3294         Fix #75088.
3295         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3296         the "almostMatchedMember" case too.
3297         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3298         that failed the accessibility checks to 'almost_match'.
3300 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3302         * attribute.cs: Use internal MethodBuilder methods to set
3303         ExactSpelling and SetLastError on PInvoke methods, instead
3304         of passing them via charset.  Fixes #75060.
3306 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3308         * parameter.cs (Parameter): Remove TODO comment.
3309         (Parameter.DefineParameter): Remove Location parameter.
3310         (Parameters.LabelParameters): Likewise.
3311         * class.cs (Constructor.Emit): Update to change.
3312         (MethodData.Emit): Likewise.
3313         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3314         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3316 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3318         * parameter.cs,
3319           Removed Parameters.Location and added Parameter.Location instead.
3320           Removed Location parameter from Emit() and GetSignature().
3321         * anonymous.cs,
3322           class.cs,
3323           cs-parser.jay,
3324           delegate.cs,
3325           iterators.cs,
3326           statement.cs :
3327           Modified all related calls.
3329 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3331         Improve user-defined conversion handling.
3332         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3333         applicable operators.
3334         (AddConversionOperators): New.  Helper for GetConversionOperators.
3335         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3336         there is only one most encompassed/encompassing type.
3337         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3338         "applicable operator" handling.
3339         (UserConversion): Move cache here from GetConversionOperators.
3340         Directly cache the chosen operator, rather than the whole
3341         MethodGroup.
3342         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3343         case.  Allow conversion of decimal to sbyte and byte too.
3344         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3345         New static methods.  Used to avoid allocating EmptyExpressions in
3346         convert.cs.
3348 2005-05-24  Duncan Mak  <duncan@novell.com>
3350         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3351         another class, used in Convert.ExplicitNumericConversion.
3352         (CastToDecimal): New class, similar to above, but casts to
3353         System.Decimal, used in Convert.ImplicitNumericConversion and also
3354         in explicit convesion from double/float to decimal.
3356         * convert.cs (ImplicitNumericConversion): Handle implicit
3357         conversions to System.Decimal.
3358         (ExplicitNumericConversion): handle explicit conversions to
3359         System.Decimal.
3361         This fixes #68711.
3362         
3363 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3365         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3366         know the type at this stage, just break through.   Fixes #75008 
3368 2005-05-19  Martin Baulig  <martin@ximian.com>
3370         * delegate.cs
3371         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3372         to disable error reporting.
3374         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3375         here since we don't want to report an error; see the new test-336.cs.
3377 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3379         * statement.cs (ToplevelBlock.GetParameterReference)
3380         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3381         Move here from class Block.
3382         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3383         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3385 2005-05-18  Martin Baulig  <martin@ximian.com>
3387         Fix #74978.
3389         * flowanalysis.cs
3390         (FlowBranching.Reachability): Add non-static public And() and Or()
3391         methods.
3392         (FlowBranchingSwitch): New class; do the `break_origins' thing
3393         like in FlowBranchingLoop.
3394         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3395         reachability, not just locals and parameters.
3396         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3397         switch; MergeBreakOrigins() now takes care of that.
3399 2005-05-18  Martin Baulig  <martin@ximian.com>
3401         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3402         a loop and may leave it, reset the barrier; fixes #74974.
3404 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3405         
3406         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3407         is back.
3408         
3409         * cs-parser.jay: Catch more lexical errors.
3410         
3411         * report.cs: Add one more Error method.
3412         
3413         * rootcontext.cs,
3414         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3416 2005-05-17  Martin Baulig  <martin@ximian.com>
3418         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3419         #70970. 
3421 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3423         Fix test-382.cs.  Emit values of decimal constants.
3424         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3425         Carved out of ...
3426         (TypeContainer.AddField): ... this.
3427         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3428         with initializers to include 'Const's.
3429         (ClassPart.RegisterFieldForInitialization): Forward to
3430         PartialContainer.
3431         * const.cs (Const.Const): Pass initializer to base class.
3432         (Const.Define): In case of decimal constants, register them for
3433         initialization in a static constructor.
3435 2005-05-14  Martin Baulig  <martin@ximian.com>
3437         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3438         do not call ResolveUnreachable() on unreachable statements in
3439         here, see the comment in the source code.
3441 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3443         Fix #74934.
3444         * expression.cs (BinaryResolveOperator): If one of the operands of
3445         an equality comparison is 'null' and the other is a pointer type,
3446         convert the null to a NullPointer.
3447         * convert.cs (ImplicitReferenceConversion): If the expression is a
3448         NullLiteral and the target type is a pointer type, return a
3449         NullPointer instead.
3450         (ImplicitConversionStandard): Likewise.
3452 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3453         
3454         * cs-parser.jay: Set readonly context based on special constructs.
3455         
3456         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3457         readonly variable error handling.
3458         
3459         * rootcontext.cs (EmitCode): Don't verify members when error
3460         occurred.
3461         
3462         * statement.cs (LocalInfo): Add reaodnly context information.
3463         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3465 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3467         * statement.cs (Block.Resolve): Revert change below.  Modify fix
3468         for #74041 to initialize 'resolved' to false only for explicit
3469         blocks.  Fixes #74873.
3471 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3473         Fix #74920.
3474         * typemanager.cs (unmanaged_enclosing_types): New.
3475         (IsUnmanagedType): Avoid infloops by using
3476         'unmanaged_enclosing_types' to talk with recursive invocations.
3478 2005-05-13  Martin Baulig  <martin@ximian.com>
3480         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3481         instance variable, not a local.  Fix #74873.
3482         (Block.ResolveUnreachable): Set it to true here.
3484 2005-05-11  Duncan Mak  <duncan@novell.com>
3486         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3487         continuing to process for 'arg'.
3488         (handle_preprocessing_directive): Check the argument of the #endif
3489         directive and report error CS1025 if there are any trailing
3490         characters.
3492         According to the C# spec, having even whitespace after the #endif
3493         directive is illegal; however, because we call arg.TrimEnd ()
3494         beforehand, we have the same behavior as csc, allowing whitespace
3495         after the directive.
3497         Fixes #74892.
3499 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3501         Fix #74863.
3502         
3503         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3504         (Constructor.GetObsoleteAttribute): Implemented correctly.
3506 2005-05-10  Martin Baulig  <martin@ximian.com>
3508         * support.cs (ReflectionParameters.ParameterModifier): Use
3509         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3510         and `ParameterAttributes.In'.  Fixes #74884.
3512 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3514         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3515         
3516         * expression.cs (Argument.GetParameterModifier): Turned to property.
3517         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3518         
3519         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3520         its C# equivalent.
3521         
3522 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3524         Fix #74852.
3525         * decl.cs (MemberCache.AddMethods): Register override methods,
3526         rather than non-override methods.
3527         * typemanager.cs (RegisterOverride): New.
3528         (IsOverride): Update.
3530 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3532         Fix #73105.
3533         
3534         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3535         recursive declaration.
3536         
3537         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3538         
3539 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3541         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3542         
3543         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3545 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3547         Fix #74797.
3548         * decl.cs (DeclSpace.FamilyAccessible): 
3549         Use TypeManager.IsNestedFamilyAccessible.
3551         Fix reopened #64812.
3552         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3553         internal'.
3555 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3556             Abin Thomas  <projectmonokochi@rediffmail.com>
3557             Anoob V E  <projectmonokochi@rediffmail.com>
3558             Harilal P R  <projectmonokochi@rediffmail.com>
3560         Fix #64812.
3561         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3562         allow access to all static members.
3564 2005-05-04  Martin Baulig  <martin@ximian.com>
3566         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3568 2005-05-04  Martin Baulig  <martin@ximian.com>
3570         Fix #74655.
3572         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3573         section at the end; make things work if `default' is not the last
3574         section.        
3576 2005-05-04  Martin Baulig  <martin@ximian.com>
3578         Fix #70400.
3580         * statement.cs (Switch): Replaced the `got_default' field with a
3581         `default_section' one.
3582         (Switch.CheckSwitch): Set `default_section' here.
3583         (Switch.Resolve): If we're a constant switch and the constant is
3584         not found, use the default section.
3586 2005-05-03  Martin Baulig  <martin@ximian.com>
3588         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3590         * statement.cs (Foreach.ArrayForeach): New nested class.
3591         (Foreach.TemporaryVariable): New nested class.
3592         (Foreach.EmitArrayForeach): Removed; this is now in the new
3593         ArrayForeach class.
3595 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3597         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3598         more conservative.
3599         (VerifyPendingMethods): Revert change below.
3601         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3602         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3603         that used to trigger warning -28.  Remove warning -28.
3604         * expression.cs (Invocation.OverloadResolve): Use
3605         TypeManager.IsOverride to distinguish override methods.
3607         Fix #74773.
3608         * pending.cs (VerifyPendingMethods): If a base type implements the
3609         requested interface, don't bother checking individual methods of
3610         the base type.  As a side-effect, this prevents the creation of
3611         unnecessary proxies.
3613 2005-05-02  Martin Baulig  <martin@ximian.com>
3615         Fix #70182.
3617         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3618         Also `And' the locals if the old vector is null.
3619         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3620         null; in this case we basically reset all the variables.        
3622 2005-05-02  Martin Baulig  <martin@ximian.com>
3624         Fix #74529.
3626         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3627         Added `FlowBranching branching' argument; always `and' the
3628         variables instead of `or'ing them unless we're an infinite loop.
3630         * statement.cs (While.Resolve): Create a new sibling unless we're
3631         infinite.       
3633 2005-05-02  Martin Baulig  <martin@ximian.com>
3635         Fix #70140.
3637         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3638         arguments; use it instead of creating a new TopLevelBlock.
3639         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3640         our ConstructorInitializer.
3642         * statement.cs
3643         (TopLevelBlock.TopLevelBranching): New public property.
3644         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3645         and create our `TopLevelBranching'.
3647         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3648         anonymous method host, use `block.TopLevelBranching' rather than
3649         creating a new branching.
3651 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3653         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3654         a ScopeInfo, if any of the current children is a child of the new
3655         entry, move those children there.
3657 2005-04-30  Martin Baulig  <martin@ximian.com>
3659         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3660         at the beginning of a SwitchSection.  Fix #73335.
3662 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3664         Fix #74378
3665         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3666         
3667         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3668         (FieldExpr.DoResolve): Obsolete members are ignored for field
3669         initializers.
3670         
3671 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3673         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3674         of arrays detection.
3676         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3677         verification.
3678         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3680         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3681         arrays report.
3683 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3685         * cs-parser.jay: Use the prefered version of -unsafe in error
3686         message.
3688 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3690         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3691         circumstances.
3693 2005-04-20  John Luke  <john.luke@gmail.com>
3695         * driver.cs: fix typo in error message, --outout to --output
3697 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3699         * codegen.cs (InRefOutArgumentResolving): New field.
3700         
3701         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3702         fields outside contructor.
3703         
3704         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3705         
3706 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3708         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3709         parameter code was not completed ever, so it was not as up-to-date
3710         as local variables.  Must finish it.
3712         The bug fix was to compare the Toplevel of the block, not the
3713         current block.  Thanks for Ben for pointing this out. 
3715 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3717         * decl.cs (AddMethods): Use the declaring type of the problem
3718         method to determine if we want to squash a warning.
3720 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3722         * attribute.cs: Removed debug output.
3724         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3725         
3726         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3727         Report.Stderr.
3728         
3729 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3731         Fix #74481.
3732         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3733         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3734         all null comparisons against reference types.
3736 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3738         Fix# 74565
3739         * class.cs (TypeContainer.CircularDepException) New nested
3740         exception class.
3741         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3742         (TypeContainer.DefineType): Removed error, reset InTransit before
3743         exit.
3744         (Class.DefineType): Throw exception when is in Transit.
3745         Catch exception and report error.
3746         (Struct.DefineType): Throw exception when is in Transit.
3747         Catch exception and report error.
3748         (Interface.DefineType): Throw exception when is in Transit.
3749         Catch exception and report error.
3751         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3752         handle nested exception handlers.
3754         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3755         a catch.
3757         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3758         InFinally and InCatch storage.
3760         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3761         (Catch.Resolve): Set and Restore ec.InCatch.
3762         (Try.Resolve): Set and Restore ec.InFinally.
3763         (Try.HasCatch): True when try has catch.
3765 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3767         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3768           for the same event member, so exclude such cases from warning 419.
3769           Fixed bug #74633.
3771 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3773         * expression.cs (Binary.ResolveOperator): Apply patch from John
3774         Luke to fix bug 59864: operators &, | and ^ on enumerations
3775         require that the same enum type on both sides.
3777         * driver.cs: Add warnings to old flag usage, this is to assist
3778         people who produce Makefiles and hope that the Makefiles will be
3779         used on Windows.
3781         * class.cs (TypeContainer.EmitType): Moved the definition of the
3782         special $PRIVATE$ field from the resolve phase to the Emit phase.
3783         During resolve we do not know if we are a struct with
3784         HasExplicitLayout, we know this only after the attributes for the
3785         type are emitted.
3787         Set the FieldOffset to zero on the dummy field that we create for
3788         the class.   Fixes 74590.
3790 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3792         Fix #73834.
3793         * ecore.cs (PropertyExpr.resolved): New.
3794         (DoResolve): Use it to handle a case of double resolution here.
3795         Handle a case of identical-name-and-type-name.
3796         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3797         resolution by storing the results of expression resolution back
3798         into the "probes" array.
3800 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3802         Fix cs0208-7.cs and cs0208-8.cs.
3803         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3804         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3805         error reporting to point out the reason a struct is not unmanaged.
3807 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3809         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3810           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3812 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3814         Fix #74528.
3815         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3816         IdenticalNameAndTypeName here.
3817         (EventExpr.InstanceResolve): Likewise.
3819 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3821         C# 2.0 DefaultCharSetAttribute implementation
3822         
3823         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3824         which allows us to set GlobalNamespace for every resolve.
3825         (Attribute.ResolveArguments): Cut from Resolve.
3826         (Attribute.GetCharSetValue): Returns CharSet named argument.
3827         (Attribute.DefinePInvokeMethod): Gets default charset from
3828         module settings.
3829         (GlobalAttribute.ResolveAsTypeStep): Override.
3830         (GlobalAttribute.ResolveArguments): Override.
3831         
3832         * class.cs (TypeAttr): Is protected.
3833         
3834         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3835         (ModuleClass.DefaultCharSetType): New memeber.
3836         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3837         
3838         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3839         charset from module.
3840         
3841         * delegate.cs (TypeAttr): Override.
3842         (Delegate.DefineType): Use this TypeAttr.
3843         
3844         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3845         at very early stage (before types are defined) to resolve model
3846         module attributes. It will probably not work with corlib but it
3847         should be ok.
3848         
3849         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3850         charset from module.
3851         
3852         * typemanager.cs (default_charset_type): New type.
3854 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3856         * decl.cs (MemberCache.AddMethods): Don't warn if
3857         System.Object.Finalize has buggy MethodAttributes.
3859         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3860         removed below.
3862 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3864         * doc.cs : detect ambiguous reference to overloaded members.
3865           Fixed bug #71603. MS 1.1 csc does not detect it.
3867 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3869         * doc.cs : delegates must not be referenced with parameters.
3870           Fixed bug #71605.
3872 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3874         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3876 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3878         * driver.cs (MainDriver): Stop processing if the CLS stage found
3879         errors. 
3881         (CompilerCallableEntryPoint.InvokeCompiler): Always
3882         reset after execution;   Take a TextWriter argument for the
3883         output.
3885         * report.cs: Use the error stream instead of hardcoding stderr. 
3887 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3889         * class.cs: Reduce code paths to test, too small of an
3890         optimization to make it worth the extra testing.  Always perform
3891         it. 
3893 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3895         Fix #74510.
3896         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3897         operators that had errors reported on them.
3899 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3901         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3902         argument types.
3903         (Attribute.Resolve): Add named argument type checking.
3904         
3905         * class.cs (FixedField.Define): Use IsPrimitiveType
3906         
3907         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3908         
3909         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3910         unsafe parameter types.
3911         
3912         * statement.cs (Using.ResolveExpression): Add better error description.
3913         
3914         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3915         
3916 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3918         Fix #74484.
3919         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3920         AttributeUsageAttribute in the emitcontext of the attribute class,
3921         not in the emitcontext of the attributable entity it was attached to.
3922         * cs-parser.jay: Use 'current_class', not 'current_container',
3923         when creating a GlobalAttribute.
3925 2005-04-08  Alp Toker  <alp@atoker.com>
3927         * pending.cs: The fix to #58413 failed to compile methods implementing
3928         interfaces with/without params modifiers and vice versa, even though
3929         params modifiers aren't part of the signature. Make the modifier check
3930         less strict as in csc.
3932 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3933             Anoob V E  <projectmonokochi@rediffmail.com>
3934             Harilal P R  <projectmonokochi@rediffmail.com>
3936         Fix #58413.
3937         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3938         modifiers of pending methods.
3939         (PendingImplementation.PendingImplementation): Initialize it.
3940         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3941         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3942         with ParameterData.  Add check for modifiers.
3943         * class.cs (MethodData.Define): Update to changes.
3945 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3947         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3949 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3951         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3952         property.
3953         
3954         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3955         
3956         * rootcontext.cs,
3957         * typemanager.cs: Registered RequiredAttributeAttribute.
3958         
3959 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3961         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3962         Warning CS0169 is back at level 3.
3963         (IMethodData.SetMemberIsUsed): New method.
3964         
3965         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3966         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3967         
3968         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3970         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3971         contants.
3972         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3973         is used.
3974         
3975         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3976         is used.
3977         
3978         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3979         to avoid the problems with nested types.
3981 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3982             Anoob V.E  <projectmonokochi@rediffmail.com>
3983             Harilal P.R  <projectmonokochi@rediffmail.com>
3984             Raja R Harinath  <rharinath@novell.com>
3986         Fix #73820.
3987         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3988         attribute.
3989         * typemanager (GetConstructor): Make public.
3991 2005-04-05  John Luke  <john.luke@gmail.com>
3992             Raja R Harinath  <rharinath@novell.com>
3994         Fix #62232.
3995         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3996         struct too.  Return false quicker in a few cases.
3997         (VerifyUnManaged): Use it.
3999 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4001         Fix #74041.
4002         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4003         not 'unreachable_seen'.
4005 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4007         * attribute.cs (Attribute.GetValue): Removed unused.
4008         
4009         * codegen.cs (CodeGen.TrimExt): Removed unused.
4010         
4011         * cs-parser.jay (output): Removed unused.
4012         
4013         * cs-tokenizer.cs (hex_digits): Removed unused.
4014         
4015         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4016         
4017         * expression.cs (Indirection.LoadExprValue): Removed unused.
4018         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4019         
4020         * iterators.cs (Iterator.param_types): Removed unused.
4021         
4022         * statement.cs (Goto.block): Removed unused.
4023         (ToplevelBlock.did): Removed unused.
4024         (Switch.ResolveConstantSwitch): Removed unused.
4026 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4028         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4029         resetting thingy.
4031 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4033         Fix #74232 and cs0208-3.cs.
4034         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4035         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4036         unmanaged type.  Don't use FieldBuilders when 't' is a
4037         TypeBuilder.  Use ModFlags and MemberType fields.
4038         * class.cs (MemberBase.member_type): Rename from MemberType.
4039         (MemberBase.MemberType): New property.  Determines member_type on
4040         demand.
4041         (MemberBase.DoDefine): Don't initialize MemberType here.
4042         (FieldMember.Define): Likewise.
4044 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4046         Fix #74241
4047         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4048         Attributes are emitted there.
4049         
4050 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4052         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4053         keyword in 'partial enum' too.
4054         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4055         is not allowed).
4056         Report from Kamil Skalski <nazgul@omega.pl>.
4058         Fix #74309.
4059         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4060         have partial containers too.
4062         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4063         in block' checks to Block.CheckInvariantMeaningInBlock.
4064         * statement.cs (Block.GetKnownVariableInfo): Make private.
4065         (Block.IsVariableUsedInChildBlock): Remove.
4066         (Block.IsVariableUsedInBlock): Likewise.
4067         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4068         conflicting declaration.
4069         (Block.AddVariable): Make error messages less long-winded and more
4070         specific.  Show location of conflicting declaration.
4071         * parameter.cs (Parameters.Location): New readonly property.
4073 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4075         Clean up semantics of invoking ResolveMemberAccess.
4076         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4077         can have an instance, ensure that we pass in a non-TypeExpression
4078         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4079         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4080         argument.  Update to changes and simplify.
4081         (FieldExpr.Emitinstance): Remove CS0120 check.
4082         (PropertyExpr.EmitInstance): Likewise.
4083         * expression.cs (Argument.Resolve): Likewise.
4084         (Invocation.DoResolve): Update to changes in semantics of
4085         InstanceExpression.
4087 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4089         Fix #74241
4090         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4091         customization.
4092         
4093         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4095 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4097         Fix difference in behaviour with commandline invocation.
4098         * driver.cs (Driver.Reset): New.
4099         (CompilerCallableEntryPoint): Call it.
4101         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4102         variable" warnings if the boolean expression failed to resolve.
4104 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4106         * attribute.cs: Fix the union of several permissions when some of them
4107         are unrestricted (so the result isn't an unrestricted permission set).
4108         Fix #74036.
4110 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4112         * ecore.cs (MemberExpr): New class.  Convert from interface
4113         IMemberExpr.
4114         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4115         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4116         error checks.
4117         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4118         (MethodGroupExpr.IsExplicitImpl): Remove.
4119         (Expression.GetFieldFromEvent): Remove.
4120         (SimpleName.MemberStaticCheck): Remove.
4121         (SimpleName.DoSimpleNameResolve): Update to changes.
4122         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4123         (MemberAccess.IdenticalNameAndTypeName): Remove.
4124         (MemberAccess.error176): Move to MemberExpr.
4125         (MemberAccess.DoResolve): Update to changes.
4126         (BaseAccess.DoResolve): Likewise.
4128 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4130         C# 2.0 Conditional attribute class implementation
4131         
4132         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4133         Analyzes class whether it has attribute which has ConditionalAttribute
4134         and its condition is not defined.
4135         
4136         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4137         (Class.IsExcluded): New method. Search for at least one defined
4138         condition in ConditionalAttribute of attribute class.
4140 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4142         * ecore.cs (PropertyExpr): Derive from Expression, not
4143         ExpressionStatement.
4144         (PropertyExpr.EmitStatement): Remove.
4146 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4148         Fix #74060.
4149         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4150         internal field "value__" of an enum be private.  The examples for
4151         "value__" that I found on MSDN all used FieldAttributes.Private.
4153         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4154         Don't mention IL method attribute names.
4156         Fix #47991.  Remove a TODO.
4157         * statement.cs (Block.Toplevel): Make into a field.
4158         (Block.Parameters): Move into ToplevelBlock.
4159         (Block.known_variables): Rename from child_variable_names.
4160         (Block.Block): Remove variants that take Parameters.  Initialize
4161         'Toplevel' with the immediately surrounding toplevel block.
4162         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4163         LocalInfo parameter.
4164         (Block.GetKnownVariableInfo): New.
4165         (Block.IsVariableNameUsedInChildBlock): Update.
4166         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4167         the block, even though it may not be in scope.
4168         (Block.AddVariable): Remove Parameters parameter.  Use
4169         Toplevel.Parameters instead.
4170         (Block.AddConstant): Remove Parameters parameter.
4171         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4172         (Block.IsParamaterReference): Likewise.
4173         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4174         (ToplevelBlock.Parameters): New.  Moved from Block.
4175         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4176         initialize Parameters to a non-null value.
4177         * cs-parser.jay: Update to changes.
4178         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4179         simple names that mean different things in the same block.  Use
4180         Block.IsVariableNameUsedInBlock.
4182 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4184         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4185         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4186         GetTypeHandle.  It is possible for a reflected type to derive from
4187         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4188         System.Array during mscorlib compilation).
4189         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4190         contain a method_hash, don't create one either.  Don't create a
4191         deep copy of the base cache's method_hash.
4192         (MemberCache.SetupCache): Rename back from DeepCopy.
4193         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4194         already initialized.  If we see an override function, add its
4195         underlying base virtual function to the member_hash too.
4197         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4199 2005-03-26  Raja R Harinath  <harinath@acm.org>
4201         Fix #73038.
4202         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4203         fails to resolve, ensure that the LHS is still resolved as an
4204         lvalue.
4206 2005-03-25  Raja R Harinath  <harinath@acm.org>
4208         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4209         ec.ContainerType.
4210         (Enum.current_ec): Remove.
4211         (Enum.LookupEnumValue): Remove EmitContext argument.
4212         Just uses the one created during DefineType.
4213         (Enum.FindMembers): Update.
4214         * expression.cs (MemberAccess.DoResolve): Update.
4216 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4218         * assign.cs (Assign.DoResolve): Check for CS1717 when
4219         source and target are same (uses Equals).
4221         * expression.cs (LocalVariableReference, ParameterReference,
4222         This): Implemented Equals, GetHashCode.
4224         * statement.cs (Block.GetParameterReference): Removed useless
4225         local variable.
4227 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4229         Fix cs0128.cs
4230         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4231         blocks before deciding whether the error is cs0136 or cs0128.
4233         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4234         (using_alias_directive, using_namespace_directive): Pass
4235         MemberName, not an expression to Namespace.UsingAlias and
4236         Namespace.Using.
4237         (MakeName): Use the MemberName of the namespace.
4238         * namespace.cs (Namespace.MemberName): New.
4239         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4240         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4241         Likewise.
4242         * decl.cs (MemberName.Name): Make readonly.
4243         (MemberName.FromDotted): New "constructor".
4244         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4245         (MemberCore.Name): Compute from MemberName on demand.
4246         (MemberCore.SetMemberName): Provide a way to change the
4247         MemberName.
4248         (MemberCore.AddToContainer): Don't take a fullname parameter.
4249         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4250         fully qualified name of the container to the member name.
4251         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4252         only if the type is a member of the root container.
4253         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4254         MemberName.Left rather than searching for an embedded ".".
4255         (PartialContainer.CreatePart): Update to changes in RootContext.
4256         (MemberBase.ShortName): Turn into a property.  Use
4257         MemberCore.SetMemberName.
4258         (MemberBase.ExplicitInterfaceName): Remove.
4259         (MemberBase.UpdateMemberName): Remove.
4260         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4261         (PropertyBase.SetMemberName): New override.
4262         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4263         (Tree.GetDecl): New.
4264         (Tree.AllDecls): Rename from Decls.
4265         * attribute.cs, enum.cs, report.cs: Update to changes.
4266         * driver.cs (MainDriver): Use MemberName.FromDotted on
4267         RootContext.MainClass.
4269 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4271         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4272         checks.
4274         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4276 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4278         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4279         property accessor modifiers.
4281         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4282         fixed buffer attribute (CS1716).
4283         (PropertyMethod.HasCustomAccessModifier): When property accessor
4284         has custom modifier.
4286         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4287         modifiers.
4288         (PropertyExpr.DoResolveLValue): Add CS0272.
4290 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4292         * convert.cs: When converting to a pointer, use the proper Conv.U
4293         or Conv.I depending on the source data type.
4295         * cs-tokenizer.cs: Make the size for large decimal constants,
4296         fixes #72957.
4298 2005-03-17  Martin Baulig  <martin@ximian.com>
4300         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4301         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4303 2005-03-17  Martin Baulig  <martin@ximian.com>
4305         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4306         to bool so we can return an error condition.
4307         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4308         returned an error.
4310 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4312         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4313         attributes.
4315 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4317         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4318         Refactor to avoid traversing the list of assemblies, and to avoid
4319         string concatenation.
4320         * typemanager.cs (guid_attr_type): Remove.
4321         (negative_hits, pointers, references): Remove hashes.
4322         (type_hash): New.
4323         (GetConstructedType): New.  Uses type_hash to handle constructed
4324         types (arrays, references, pointers).
4325         (GetReferenceType, GetPointerType): Use it.
4326         (GetNestedType): New.  Uses type_hash to handle nested types of
4327         reflected types.
4328         (LookupType, LookupTypeDirect): Remove.
4329         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4330         'types' hash and LookupTypeReflection directly.
4331         (params_string, params_object): Use GetConstructedType.
4332         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4333         top-level types.
4334         (Namespace.Lookup): Use cached_types.
4335         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4336         provided by old TypeManager.LookupType.
4337         * rootcontext.cs (MakeFQN): Remove.
4338         * decl.cs (DeclSpace.MakeFQN): Likewise.
4339         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4340         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4341         TypeManager.GetConstructedType.
4342         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4344 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4346         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4347         indexers.
4349         * cs-parser.jay: Reports CS1527 for any namespace element.
4351         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4352         Added CS0407.
4354         * expression.cs (ParameterReference.IsAssigned): Changed error to
4355         CS0269.
4356         (Error_WrongNumArguments): Moved CS0245 detection here.
4358         * statement.cs (Return.Resolve): Add CS1622 report.
4360 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4362         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4364 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4366         * attribute.cs expression.cs: Get rid of some allocations.
4368 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4370         * doc.cs : just eliminate the latest change.
4372 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4374         * doc.cs : commented out the latest change. It breaks xml-030.cs
4376 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4378         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4379           fail. So invoke CreateType() in FindDocumentedType().
4381 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4383         * cs-tokenizer.cs : added IsKeyword().
4384         * doc.cs : Detect keyword incorrectly used as identifier.
4385           Allow identifiers prefixed by @.
4387 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4389         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4390         It caused exception in namespace resolving (again!).
4391         
4392         * class.cs (Class.ctor): Removed exit.
4393         (PropertyMethod.ctor): ditto.
4394         
4395         * codegen.cs (Codegen.Reset): Reset static data.
4396         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4397         
4398         * cs-tokenizer.cs (Cleanup): Removed.
4399         
4400         * driver.cs (GetSystemDir): Rewrote to one line command.
4401         It caused problem with unloaded dynamic modules.
4402         (UnixParseOption): Removed Exit.
4403         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4404         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4405         Now can be mcs used as library.
4406         
4407         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4408         empty location.
4409         
4410         * location.cs (Reset): Reset static data.
4411         
4412         * namespace.cs (Reset): Reset static data.
4413         
4414         * report.cs (Report.Reset): Reset static data.
4415         
4416         * rootcontext.cs (RootContext.Reset): Reset static data.
4417         
4418         * tree.cs (RootTypes.ctor): Use Location.Null
4419         
4420         * typemanager.cs (TypeManager.Reset): Reset static data.
4421         (CoreLookupType): Removed Exit.
4422         (TypeHandle.Reset): Reset static data.
4423         
4424 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4426         Fix #73516.
4427         * typemanager.cs (ComputeNamespaces): Import namespaces from
4428         referenced modules too.
4430 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4432         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4433         than '.'.
4435 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4437         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4438         enclosing DeclSpace.  This ensures that a name-lookup populates
4439         more caches and there are fewer 'TypeExpression's.  Carve out
4440         nested type lookup into ...
4441         (LookupNestedTypeInHierarchy): ... this.
4443 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4445         Clean up a few partial-class semantics.  
4446         Fixes test-357.cs and cs1618-2.cs.
4447         * cs-parser.jay (struct_declaration): Use 'current_class' as
4448         parent of newly-created struct.  Remove call to Register ().
4449         Use 'pop_current_class' to complete handing the current struct.
4450         (interface_declaration): Likewise.
4451         (class_declaration): Likewise.
4452         (enum_declaration): Use 'current_class' as parent of newly created
4453         enum.
4454         (delegate_declaration): Likewise.
4455         (pop_current_class): New function.  This is used to handle closing
4456         up the 'current_class' and 'current_container', and pointing them
4457         to the enclosing class/container.
4458         (CSharpParser): Initialize 'current_class' too.
4459         * decl.cs (MemberCore): Add check for invariant: a partial
4460         container is not a parsed entity, and thus does not enclose any
4461         parsed members.
4462         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4463         (DeclSpace.BaseTypeExpr): Use it.
4464         (DeclSpace.LookupType): Add check for invariant.
4465         * class.cs (TypeContainer): Add check for invariant: a nested
4466         class should have the same NamespaceEntry as its enclosing class.
4467         (TypeContainer.EmitFieldInitializers): Make virtual.
4468         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4469         MemberCore.
4470         (TypeContainer.Register): Remove.
4471         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4472         null.  Use TypeResolveEmitContext for resolving base types and
4473         interfaces.  Move initialization of Parts.TypeBuilder here from
4474         ...
4475         (TypeContainer.DefineNestedTypes): ... here.
4476         (PartialContainer): Take a Namespace not a NamespaceEntry.
4477         (PartialContainer.Create): Don't use Register.  Call the
4478         appropriate Add... function directly.
4479         (ClassPart): Take both the PartialContainer and the enclosing
4480         class as constructor arguments.
4481         (ClassPart.EmitFieldInitializers): Override.
4482         (ClassPart.PartFindNestedTypes): Remove.
4483         (FieldBase.GetInitializerExpression): Resolve the initializer
4484         expression in the emit context of the enclosing class.
4485         * tree.cs (RootTypes): Remove Register ().
4486         
4487 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4489         * cs-parser.jay: Removed CS0134.
4490         
4491         * driver.cs: Removed CS1901.
4492         
4493         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4494         for predefined types.
4496 2005-03-07  Duncan Mak  <duncan@novell.com>
4498         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4499         well. Fixes bug #73454.
4501 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4503         * cs-tokenizer.cs (xtoken): Add CS1035.
4504         
4505         * class.cs (MethodData.Define): Add CS0683.
4506         (FieldMember.ctor): Add CS0681.
4508 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4510         * ecore.cs (SimpleName.DoResolve): Rename from
4511         SimpleName.DoResolveAllowStatic.
4512         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4513         Pass 'intermediate' flag to MemberStaticCheck.
4514         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4515         of "intermediate" lookups via MemberAccess.
4516         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4517         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4519 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4521         Fix #73394.
4522         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4523         slipped in because of variable names that are identical to a
4524         builtin type's BCL equivalent ('string String;', 'int Int32;').
4525         (PropertyExpr.EmitInstance): Likewise.
4527 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4529         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4530         
4531         * report.cs (warning_ignore_table): Made public.
4533 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4535         Fix #73282.
4536         * class.cs (MethodData.Emit): Pass 'container' to
4537         container.GetObsoleteAttribute instead of 'container.Parent'.
4539 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4541         * cs-parser.jay: Add 1534 error test.
4543         * iterators.cs (Yield.CheckContext): Add error 1629.
4544         (Iterator.ctor): Save unsafe modifier.
4545         (MoveNextMethod.DoEmit): Restore unsafe context.
4547         * namespace.cs (UsingAlias): Better error message.
4549 2005-03-03  Dan Winship  <danw@novell.com>
4551         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4552         the warning message [#73219]
4554 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4556         Fix compile with MCS 1.0.0.0.
4557         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4558         w_restore to not depend on string constant folding.
4560 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4562         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4563         CS0246 check to users who passed 'silent = false'.
4564         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4565         check.
4566         (SimpleName.SimpleNameResolve): Update.
4567         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4568         (MemberAccess.IdenticalNameAndTypeName): Update.
4569         * doc.cs (FindDocumentedTypeNonArray): Update.
4571 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4573         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4574         * parameters.cs (ComputeAndDefineParameters): Remove.
4575         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4576         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4577         Use GetParameterInfo.
4579 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4581         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4583 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4585         Unify DeclSpace.LookupType and DeclSpace.FindType.
4586         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4587         is in charge of defining nested types on demand.
4588         (DeclSpace.LookupType): Use it when the current_type is a
4589         TypeBuilder.  Use LookupTypeDirect for reflected types.
4590         (DeclSpace.FindType): Remove.
4591         (DeclSpace.LookupInterfaceOrClass): Likewise.
4592         (DeclSpace.DefineTypeAndParents): Likewise.
4593         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4594         DeclSpace.LookupType.
4595         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4596         * typemanager.cs (LookupType): Simplify.
4597         (AddUserType): Remove type from negative_hits.
4598         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4599         * class.cs (TypeContainer.FindMembers): Move handling of nested
4600         types ...
4601         (TypeContainer.FindMembers_NestedTypes): ... here.
4602         (TypeContainer.FindNestedType): Implement override.
4603         (ClassPart.FindNestedType): Delegate to PartialContainer.
4604         (ClassPart.PartFindNestedType): Looks up the nested types of the
4605         part alone.
4607 2005-03-02  Martin Baulig  <martin@ximian.com>
4609         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4610         static constructor in static classes.
4612 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4614         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4615         sizeParamIndex is not specified.
4617 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4619         Fix #73117
4620         * report.cs (WarningMessage.IsEnabled): Missing null check.
4622 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4624         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4625         in the fields and not in the properties.
4627 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4629         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4630         fields as well.
4632 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4634         * attribute.cs: Small refactoring (improved robustness).
4635         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4636         (ValidateGuid): Removed.
4637         (Resolve): Removed referenced to above mentioned.
4638         (GetAttributeUsage): Made private and changed to work without
4639         class assistance.
4640         (GetIndexerAttributeValue): Don't crash.
4641         (GetConditionalAttributeValue): Ditto.
4642         (GetClsCompliantAttributeValue): Ditto.
4643         (ExtractSecurityPermissionSet): All attributes exceptions are
4644         error 648.
4645         (GetPropertyValue): New helper.
4646         (GetMethodImplOptions): New method.
4647         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4648         some missing properties.
4649         
4650         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4651         (Method.ApplyAttributeBuilder): Updated.
4652         
4653         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4654         exception.
4656 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4658         Fix #73052.
4659         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4660         non-simple types (array, pointer, reference).
4662 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4664         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4666         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4667         for operators.
4668         (Method.CheckBase): Catch wrong destructor here.
4669         (MethodData.Define): Add errors 550, 668.
4671         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4673         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4675         * pending.cs (VerifyPendingMethods): Add error 551.
4677         * typemanager.cs (CSharpName): Next error report helper.
4679 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4681         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4682         attributes. Removed useless attribute double check.
4683         It saves almost 2MBs for corlib.
4685 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4687         Fix #72924.
4688         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4689         called twice in case of error.
4691 2005-02-23  Chris Toshok  <toshok@ximian.com>
4693         Fix compiler portions of #72827.
4694         * statement.cs (Block.Emit): call Begin/EndScope on the
4695         EmitContext instead of the ILGenerator.
4697         * codegen.cs (EmitContext.BeginScope): new method, call
4698         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4699         we have one.)
4700         (EmitContext.BeginScope): same, but EndScope and CloseScope
4702         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4703         offset and call the superclass's OpenScope(int) with it.
4704         (SymbolWriter.CloseScope): get the current il
4705         offset and call superclass's CloseScope(int) with it.
4707 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4709         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4710         CS1677 for out and ref as well.
4712         * class.cs (Method.Define): Add error CS1599 detection.
4713         
4714         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4715         
4716         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4717         
4718         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4719         
4720         * support.cs.cs (ModifierDesc): New helper method.
4722 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4723             Abin Thomas  <projectmonokochi@rediffmail.com>
4724             Anoob V E  <projectmonokochi@rediffmail.com>
4725             Harilal P R  <projectmonokochi@rediffmail.com>
4727         Fix #57851, #72718.
4728         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4729         MemberLookup (used for error reporting) actually returns a result.
4730         Fix error report number (122, not 112).
4732 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4733             Anoob V E  <projectmonokochi@rediffmail.com>
4734             Harilal P R  <projectmonokochi@rediffmail.com>
4736         Fix #71134.
4737         * pending.cs (PendingImplementation.GetAbstractMethods):
4738         Find NonPublic members too.
4740 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4742         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4743         Fixed error 217.
4744         
4745         * class.cs (MethodCore.CheckMethodAgainstBase):
4746         Add error 239 report.
4748 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4750         Fix #68955.
4751         * expression.cs (Invocation.IsApplicable): Make public.
4752         (Invocation.IsParamsMethodApplicable): Likewise.
4753         * delegate.cs (Delegate.VerifyApplicability): Don't use
4754         Invocation.VerifyArgumentCompat for parameter applicability
4755         testing.  Use Invocation.IsApplicable and
4756         Invocation.IsParamsMethodApplicable.
4758 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4760         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4761         
4762         * class.cs (Operator.Define): Add error 217 report.
4763         
4764 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4766         * namespace.cs (UsingEntry.Resolve): Undo change below.
4768 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4770         Fix #72756.
4771         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4772         disable the error message when the extended MemberLookup also
4773         fails.
4774         (Expression.MemberLookupFinal): Update.
4775         (SimpleName.DoSimpleNameResolve): Update.
4776         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4777         Don't use MemberLookupFinal.
4778         (New.DoResolve): Update.
4779         (BaseAccess.CommonResolve): Update.
4781 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4783         Fix #72732.
4784         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4785         occured previously, don't resolve again.
4787 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4789         Fix #69949
4790         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4791         argument. Call ResolveAttributeUsage for unresolved.
4792         when types doesn't match ctor arguments.
4793         
4794         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4795         for nested attribute classes.
4796         (Class.attribute_usage): Removed.
4797         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4798         for attribute class.
4799         
4800         * ecore.cs (IsAttribute): Removed.
4801         
4802         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4803         
4804         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4805         now normal types.
4806         (attribute_types): Removed.
4807         (EmitCode): Global attributes are emited as the latest.
4809 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4811         * class.cs (EmitFieldInitializers): Don't emit field initializer
4812         for default values when optimilization is on.
4813         
4814         * constant.cs (Constant.IsDefaultValue): New property.
4815         
4816         * driver.cs: Add /optimize handling.
4817         
4818         * constant.cs,
4819         * ecore.cs,
4820         * literal.cs: Implement new IsDefaultValue property.
4821         
4822         * rootcontext.cs (Optimize): New field, holds /optimize option.
4824 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4826         Fix crasher in re-opened #72347.
4827         * namespace.cs (Namespace.Lookup): Return null if
4828         DeclSpace.DefineType returns null.
4830         Fix #72678.
4831         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4833 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4835         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4836         now returns null if it cannot resolve to an lvalue.
4837         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4838         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4839         returned null.  Remove check for SimpleName.
4840         (EventExpr.DoResolveLValue): New.
4841         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4842         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4843         error from ...
4844         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4845         avoid CS0131 error.
4846         (Unary.ResolveOperator): Move CS0211 check ...
4847         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4848         CS0131 error.
4849         (Unary.DoResolveLValue): Simplify.
4850         (AddressOf.DoResolveLValue): New.
4851         (ArrayAccess.DoResolveLValue): New.
4853 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4855         * attribute.cs (Attribute.Resolve): Add arguments casting for
4856         when types doesn't match ctor arguments.
4858 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4860         Fix parts of #63202.
4861         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4862         lookup of operator in base type.  Ensure that all checks happen
4863         when the operator resolves to an "op_..." method.
4865 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4867         Fix #71992.
4868         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4869         'ignore_cs0104' parameter.  Pass it to ...
4870         (NamespaceEntry.Lookup): ... this.
4871         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4872         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4873         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4874         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4875         Update.  Request that cs0104 errors be ignored.
4876         (ComposedCast.ResolveAsTypeStep): Update.
4878 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4880         Fix #59209.
4881         * expression.cs (Invocation.BetterFunction): Remove support for
4882         comparing virtual functions and their overrides.
4883         (Invocation.IsOverride): New.
4884         (Invocation.OverloadResolve): Don't consider 'override' functions
4885         during candidate selection.  Store them in a lookaside list.
4886         If the selected method is a 'virtual' function, use the list to
4887         find any overrides that are closer to the LHS type.
4889 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4891         * expression.cs (New.DoResolve): Add complex core type reduction.
4892         (New.Constantify): Converts complex core type syntax like 'new int ()'
4893         to simple constant.
4894         
4895 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4897         * decl.cs (EntryType.EntryType): New constructor to create an
4898         updated copy of a cache entry.
4899         (MemberCache.AddMethods): Use it.
4900         (MemberCache.ClearDeclaredOnly): Remove.
4901         (MemberCache.MemberCache): Update.
4903 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4905         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4906         variable.  This one is represents the actual low-level declaration
4907         of the method, as opposed to the semantic level `IsStatic'.   
4909         An anonymous method which is hosted into a static method might be
4910         actually an instance method.  IsStatic would reflect the
4911         container, while MethodIsStatic represents the actual code
4912         generated.
4914         * expression.cs (ParameterReference): Use the new MethodIsStatic
4915         instead of IsStatic.
4917         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4918         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4919         set on the current EmitContext. 
4921         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4922         resolve our casted expression as an LValue.  This triggers the
4923         proper LValue processing that is later required by Assign.
4925         This fixes 72347.
4927         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4929 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4931         C# 2.0 Fixed buffer implementation
4933         * anonymous.cs: Update after RegisterHelperClass renaming.
4935         * attribute.cs (AttributeTester.fixed_buffer_cache):
4936         Cache of external fixed buffers.
4937         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4938         implementation if field is fixed buffer else null.
4940         * class.cs
4941         (TypeContainer.AddField): Accept FieldMember instead of Field.
4942         (FieldBase.IsFieldClsCompliant): Extracted code from
4943         VerifyClsCompliance descendant customization.
4944         (FixedField): New class handles fixed buffer fields.
4945         (FixedFieldExternal): Keeps information about imported fixed
4946         buffer.
4947         (IFixedField): Make access to internal or external fixed buffer
4948         same.
4950         * cs-parser.jay: Add fixed buffer parsing.
4952         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4953         buffer.
4955         * expression.cs (Indirection): Extended implementation to accept
4956         fixed buffer field.
4957         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4958         (ElementAccess.MakePointerAccess): Get type as parameter.
4959         (DoResolve): Add fixed buffer field expression conversion.
4960         (DoResolveLValue): Ditto.
4961         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4962         (ArrayPtr): Derives from FixedBufferPtr.
4963         (ArrayPtr.Emit): Add extra emit for array elements.
4965         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4967         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4968         for compiler generated types.
4969         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4971         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4972         and consume less memory.
4973         (Fixed.Resolve): Add fixed buffer case.
4975         * typemanager.cs (compiler_generated_attr_ctor,
4976         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4977         (HasElementType): Add our own implementation to work on every
4978         runtime.
4980 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4982         * anonymous.cs (CaptureContext): Track whether `this' has been
4983         referenced.   
4985         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4986         only captured `this' if it was implicitly done (instance
4987         methods/variables were used). 
4989         * codegen.cs (EmitContext.CaptureThis): New method to flag that
4990         `this' must be captured.
4992 2005-01-30  Miguel de Icaza  <miguel@novell.com>
4994         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4995         is null it means that there has been no need to capture anything,
4996         so we just create a sibling.
4998         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5000         Just a partial fix.  The other half is fairly elusive.
5001         
5002 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5004         Fix #52586, cs0121-4.cs.
5005         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5006         and return a hashtable.
5007         (MemberCache.ClearDeclaredOnly): New.
5008         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5009         the method_hash of a base type too.
5010         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5011         type methods.  Overwrite entries with the same MethodHandle so
5012         that the ReflectedType is correct.  The process leaves in base
5013         virtual functions and their overrides as distinct entries.
5014         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5015         matters since it was boxed in a ArrayList before.
5016         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5017         modifier.
5018         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5019         case of a virtual function and its override (choose the overload
5020         as better).
5021         (Invocation.OverloadResolve): Avoid 'override' members during
5022         'applicable_type' calculation.
5024 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5026         Combine two near-redundant caches.
5027         * typemanager.cs (method_params): Rename from method_internal_params.
5028         (TypeManager.GetParameterData): New.  Replace
5029         Invocation.GetParameterData.
5030         (TypeManager.LookupParametersByBuilder): Remove.
5031         * expression.cs (Invocation.method_parameter_cache): Remove.
5032         (Invocation.GetParameterData): Remove.
5033         Update to changes.
5034         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5035         Update to changes.
5037 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5039         Fix #72015.
5040         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5041         TypeManager.multicast_delegate_type is null, resolve it by looking
5042         up "System.MulticastDelegate".
5043         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5045 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5046             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5047             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5049         Fix cs0164.cs.
5050         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5051         (LabeledStatement.AddReference): New.  Set 'referenced'.
5052         (Goto.Resolve): Use it.
5054 2005-02-05  John Luke  <john.luke@gmail.com>
5056         * driver.cs: remove duplicate -doc line in Usage ()
5058 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5060         * location.cs (Location.AddFile): Fix CS2002 error report.
5062 2005-02-02  Martin Baulig  <martin@ximian.com>
5064         * delegate.cs (Delegate.DefineType): Report an internal error if
5065         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5066         details.        
5068 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5070         Fix a crasher in a variant of #31984.
5071         * const.cs (Constant.CheckBase): New override that defers the
5072         new-or-override check in case the base type hasn't been populated
5073         yet.
5074         (Constant.Define): Ensure the new-or-override check is performed.
5076 2005-02-01  Duncan Mak  <duncan@ximian.com>
5078         * const.cs (LookupConstantValue): Check that `ce' is not null
5079         before calling GetValue ().
5081 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5083         Fix test-334.cs (#69519).
5084         * cs-parser.jay (using_alias_directive): Pass in an expression to
5085         NamespaceEntry.UsingAlias.
5086         (using_namespace_directive): Pass in an expression to
5087         NamespaceEntry.Using.
5088         (namespace_name): Don't flatten to a string.
5089         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5090         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5091         ResolveAsTypeStep.
5092         (NamespaceEntry.UsingEntry): Likewise.
5093         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5094         changes.
5095         (NamespaceEntry.LookupForUsing): Remove.
5096         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5097         names.
5098         (NamespaceEntry.Lookup): Remove support for dotted names.
5100 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5102         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5103         split into two.
5104         (NamespaceEntry.ImplicitParent): Compute on demand.
5105         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5106         parallels the current.
5107         (NamespaceEntry.LookupForUsing): Use it.
5108         (NamespaceEntry.Lookup): If the current namespace-entry is
5109         implicit, don't search aliases and using tables.
5111 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5113         Fix #31984.
5114         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5115         BaseCache here.
5116         (TypeContainer.BaseCache): Compute on demand.
5117         (TypeContainer.FindMembers): Define constants and types if they're
5118         not already created.
5119         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5120         check.
5121         * const.cs (Constant.Define): Make idempotent.
5123 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5125         * pending.cs: Produce better code (no nops produced by using Ldarg
5126         + value).
5127         
5128         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5129         i - 1' it should be arg + 1.
5131         Fixes bug #71819.
5133 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5135         * attribute.cs (Attribute.CheckAttributeType): Make private
5136         non-virtual.
5137         (Attribute.ResolveType): Make virtual.
5138         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5139         handling of RootContext.Tree.Types.
5141 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5143         Update attribute-handling to use the SimpleName/MemberAccess
5144         mechanisms.
5145         * cs-parser.jay (attribute): Pass in an expression to the
5146         constructors of Attribute and GlobalAttribute.
5147         * attribute.cs (Attribute): Take an expression for the name.
5148         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5149         passed in attribute name expression.
5150         (Attribute.CheckAttributeType): Use it.
5151         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5152         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5153         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5154         argument to prevent error messages if the lookup fails.
5156 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5158         * expression.cs (Indirection): Implemented IVariable interface
5159         to support indirection in AddressOf operator.
5160         (PointerArithmetic.Emit): Add optimalization for case where
5161         result can be precomputed.
5163 2005-01-26  Martin Baulig  <martin@ximian.com>
5165         * class.cs (TypeContainer.AttributeTargets): Return the correct
5166         AttributeTargets depending on our `Kind' instead of throwing an
5167         exception; fixes #71632.
5169 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5171         Fix #71257
5172         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5173         constant members.
5175 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5177         Fix #71602.
5178         * expression.cs (MemberAccess.DoResolve): Don't complain with
5179         cs0572 when the LHS of a member access has identical name and type
5180         name.
5182 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5184         Fix #71651, #71675
5185         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5186         CreatePermission.
5187         Create custom PermissionSet only for PermissionSetAttribute.
5189 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5191         Fix #71649
5192         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5193         delegates in static class.
5195 2005-01-24  Martin Baulig  <martin@ximian.com>
5197         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5198         merging an implicit block, just use its reachability.
5200         * statement.cs (Block.Resolve): Make the unreachable code check
5201         work wrt. implicit blocks; see test-337 from #63842.
5203 2005-01-21  Alp Toker  <alp@atoker.com>
5205         * cs-parser.jay: destructor_declaration's container is PartialContainer
5206         not Class when partial types are used, so use Kind prop instead of
5207         'is'.
5208         
5209 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5211         * cs-parser.jay: Improve error reporting when an interface
5212         declares new types.
5214 2005-01-20  Dick Porter  <dick@ximian.com>
5216         * support.cs: SeekableStreamReader fix from Sandor Dobos
5217         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5218         chars are read.  Fixes bug 70369.
5220 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5222         * cs-parser.jay (catch_clause): Simplify current_block handling
5223         somewhat.
5225 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5227         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5228         code with ImplicitStandardConversion to handle the implicit
5229         conversion of method groups into valid delegate invocations. 
5231         The problem is that in parameter handling we were using this code
5232         path.  Fixes bug #64698
5234 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5236         * cs-parser.jay: Fix several infelicities.
5237         - Avoid assigning to the parser value stack.  Code like 
5238           '$3 = null' is unclean.  Synthesize a value for the code block
5239           instead. 
5240         - Avoid using oob_stack for storing location information.  Use ...
5241         (_mark_): ... this.  New (empty) rule.  Saves the current location
5242         in $$.
5243         (foreach_statement): Avoid using oob_stack for current_block
5244         handling.  Use technique used in for_statement and
5245         using_statement.  Synthesize a value for the code block to store
5246         additional intermediate information.
5248 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5250         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5251         of a different type is only allowed to private fields of a
5252         containing type, not on fields of a base class.
5254         See test-174.cs and error cs0122-9.cs
5256 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5258         Fix test-335.cs (bug #58126).
5259         * cs-parser.jay (argument): Split out non-expression parts of the
5260         rule into 'non_simple_argument'.
5261         (invocation_expression): Support parenthesized invocations with
5262         multiple arguments, and with single non-simple arguments.
5264 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5266         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5267         places.
5269 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5271         Fix cs0038-1.cs, cs1640-6.cs.
5272         * ecore.cs (Expression.Resolve): Remove special-case for
5273         SimpleName in error-handling.
5274         (Expression.almostMatchedMembers): Relax access permission to
5275         protected.
5276         (Expression.MemberLookupFailed): Handle duplicates in
5277         almostMatchedMembers list.
5278         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5279         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5280         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5281         overload if the passed in MemberInfo is a MethodBase.
5283 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5285         Fix #70749
5286         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5287         for non-CAS & merge permission sets properly.
5289 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5291         Improve standard-compliance of simple name and member access 
5292         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5293         * ecore.cs (FullNamedExpression): New abstract base class 
5294         for Namespaces and TypeExpressions.
5295         (ResolveFlags.SimpleName): Remove.
5296         (SimpleName): Remove support for dotted names.
5297         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5298         DeclSpace.FindType and DeclSpace.LookupType.
5299         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5300         (Expression.ExprClassName): Make member function.
5301         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5302         a namespace.  Remove creation of dotted "SimpleName"s.
5303         (MemberAccess.DoResolve): Likewise.
5304         * decl.cs (DeclSpace.Cache): Make private.
5305         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5306         (DeclSpace.FindType): Update.
5307         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5308         FullNamedExpression.
5309         * namespace.cs (Namespace): Derive from FullNamedExpression
5310         so that it can be part of expression resolution.
5311         (Namespace.Lookup): Return an FullNamedExpression.
5312         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5313         namespace.
5314         * rootcontext.cs (NamespaceLookup): Remove.
5315         (LookupType): Move to DeclSpace.
5316         * attribute.cs (CheckAttributeType): Update.
5317         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5318         (FindDocumentedTypeNonArray): Likewise.
5320 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5322         Fix cs0509.cs, cs1632.cs.
5323         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5324         is the same as IsInterface.
5325         (TypeContainer.GetClassBases): Likewise.
5326         * statement.cs (LabeledStatement.ig): New field.
5327         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5328         label.
5329         (LabeledStatement.DoEmit): Check that the label was created with
5330         the same ILGenerator.
5332 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5334         Fix #71058
5335         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5336         accessors to its properties.
5338         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5339         from accessors to property.
5340         
5341 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5343         Fix #70722
5344         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5345         only for overrides.
5346         
5347 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5349         * attribute.cs: Check for null and empty strings.  
5351         I have lost another battle to Paolo.
5353 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5355         Fix #70942
5356         * class.cs (PropertyMethod): Set Parent field in ctors.
5357         (SetMethod.InternalParameters): Add unsafe switch hack.
5358         Override MarkForDuplicationCheck where it is appropriate.
5360         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5361         It says whether container allows members with the same name.
5362         Base default is no.
5363         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5364         Removed is_method parameter.
5366 2005-01-06  Duncan Mak  <duncan@ximian.com>
5368         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5369         because the previous change led to incorrect reporting of CS1032
5370         ("Cannot define/undefine preprocessor symbols after first token in
5371         file"). Instead of using `tokens_seen' as the only flag that
5372         triggers CS1040, introduce `comments_seen'. This new flag is used
5373         to signify having seen comments on the current line, so it is
5374         unset after a newline.
5376 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5378         * doc.cs : When searching for a type, find nested type too.
5379           This fixes bug #71040.
5381 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5383         * doc.cs :
5384           - Warn missing member comment on those classes which also does not
5385             have doc comments. Fixed bug #71041.
5386           - Don't warn missing doc comment on default constructor.
5387             Fixed bug #71042.
5389 2005-01-06  Duncan Mak  <duncan@ximian.com>
5391         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5392         comments, set `tokens_seen' to true. This allows us to detect
5393         misplaced preprocessor directives (i.e. not at the beginning of
5394         the a line, nor after whitespaces). In that case, report error
5395         CS1040. This fixes bug #56460.
5397         * cs-parser.jay (interface_member_declaration): Add checks for
5398         IsExplicitImpl, and report CS0541 error if an interface member is
5399         defined as an explicit interface declaration.
5401 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5403         Fix #70817
5404         * class.cs (PropertyMethod): Set Parent field in ctors.
5405         (SetMethod.InternalParameters): Add unsafe switch hack.
5406         
5407         * decl.cs (MemberCore.Parent): Cannot be readonly.
5409 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5411         * decl.cs (DeclSpace.ResolveType): Remove.
5412         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5413         Merge in code from ...
5414         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5415         * class.cs, enum.cs: Update to changes.
5417 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5419         * anonymous.cs: Ensure that we init the scope of our parent if it
5420         has not been initialized yet.
5422 2004-12-30  Duncan Mak  <duncan@ximian.com>
5424         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5425         if field.FieldBuilder is null. Fixes #70758.
5427         * convert.cs: Fixed some typos and updated some of the comments.
5428         (ImplicitStandardConversionExists):
5429         (TryImplicitIntConversion): If `target_type' is an interface and
5430         the type of `ic' implements this interface, return true or a new
5431         BoxedCast instead of null. This fixes #70468.
5433 2004-12-29  Duncan Mak  <duncan@ximian.com>
5435         * expression.cs (Argument.Emit): Check that Expr is
5436         IMemoryLocation before casting to it, and report CS1510 otherwise.
5438         This fixes #70402.
5440 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5442         * statement.cs (Block.ThisVariable): remove the recursion here, to
5443         make the --profile more sane.
5445 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5447         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5448         assembly, by JB Evain.
5450 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5452         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5453           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5454         "parent" refers to enclosing type/class.  "base" refers to superclass.
5456 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5458         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5459         Ensure that we only have GlobalAttributes.
5460         * attribute.cs (Attribute.Emit): Make non-virtual.
5461         (GlobalAttribute.Emit): Remove.
5462         (Attribute.Resolve): Make virtual.
5463         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5464         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5465         the argument. Don't create one.
5466         (Attribute.GetObsoleteAttribute): Likewise.
5467         (Attribute.GetClsCompliantAttributeValue): Likewise.
5468         * class.cs, decl.cs: Update to changes.
5470 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5472         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5473         
5474         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5475         
5476         * statement.cs (Foreach.Resolve): Add error 186 report.
5478 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5480         * expression.cs (Conditional.DoResolve): Add warning 429.
5481         
5482         * statement.cs (If.Resolve): Add warning 665.
5484 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5486         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5487         except when in the parser, and in GlobalAttribute.
5488         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5489         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5490         RootContext.Tree.Types.NamespaceEntry once work is done.
5491         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5492         and resets RootContext.Tree.Types.NamespaceEntry.
5494 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5496         * cs-parser.jay: Don't create a block for every variable.
5498 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5500         * location.cs: Provide extra information.
5502         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5503         variables from the captured environment, it is the ldarg_0.
5505 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5507         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5508         find a conclusion.
5509         
5510         * class.cs: Changed warning level for 169 to avoid developer
5511         displeasure from warning flooding. It will be changed back when they
5512         fix most of current BCL warnings.
5513         
5514         * RootContext.cs: Pushed default WarningLevel to 3.
5515         
5516         * statement.cs: Removed unused variable.
5518 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5520         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5521         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5522         Add error 502 report.
5523         (StaticClass.DefineType): Add error 441 report.
5524         (Class.AllowedModifiersProp): New virtual property as temporary
5525         extension to AllowedModifiers.
5526         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5527         to share implementation with StaticClass and don't call virtual
5528         methods from ctor.
5529         
5530         * driver.cs (MainDriver): Add error 1558 test.
5532         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5533         report. Moved error 36 test here.
5535         * statement.cs (Throw.Resolve): Add error 724 report.
5537         * typemanager.cs: Add out_attribute_type core type.
5538         
5539 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5541         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5542         3018 report.
5543         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5545         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5546         3017 report.
5547         
5548         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5550         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5551         Add error 3023 report.
5552         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5554         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5555         implementation.
5557 2004-12-12  John Luke  <john.luke@gmail.com>
5559         * driver.cs (AddArgs): take -- into account when
5560         adding arguments, fixes bug 65710 
5562 2004-12-12  Martin Baulig  <martin@ximian.com>
5564         * expression.cs (Unary.TryReduceNegative): Added support for
5565         SByteConstant and ByteConstant.
5566         (Unary.Reduce): Check error values from TryReduceNegative().
5568 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5570         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5571         and report exception as error 182.
5573 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5575         * driver.cs (Main): Fix message when there are warnings.
5577 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5579         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5581 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5583         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5584         Reduced number of warnings.
5585         
5586         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5588 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5590         * driver.cs: Removed message.
5592         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5594 2004-12-08    <vargaz@freemail.hu>
5596         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5598 2004-12-08  Martin Baulig  <martin@ximian.com>
5600         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5601         instead of a CS3002 for properties and indexer.
5603 2004-12-08  Martin Baulig  <martin@ximian.com>
5605         * decl.cs (MemberName.ToString): Make this work again.
5607 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5609         * attribute.cs (Resolve): Add error 591 detection.
5611         * class.cs (FieldMember.Define): Add error 1547 detection.
5612         (Indexer.Define): Add error 620 detection.
5613         (Operator.Define): Add error 590 detection.
5615         * ecore.cs: Missing argument for error 79.
5617         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5618         detection.
5620 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5622         Fix #70106
5623         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5624         only.
5626 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5628         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5629           Some operator comments were suppressed.
5630         * doc.cs : Implicit/explicit operator name in doc comments are like
5631           "op_Explicit(type)~returnType", so added suffix handling.
5633 2004-12-07  Martin Baulig  <martin@ximian.com>
5635         * decl.cs
5636         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5637         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5638         (DeclSpace.ec): New protected field; store the EmitContext here.
5639         (DeclSpace.EmitContext): New public property; moved here from
5640         `TypeContainer'.
5641         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5642         EmitContext.
5644         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5645         (Enum.Emit): Don't create a new EmitContext.
5647         * delegate.cs (Delegate.DefineType): Always create the
5648         EmitContext.
5650         * iterators.cs (Iterators.DefineIterator): Create a new
5651         EmitContext and store it in `ec'.
5653 2004-08-24  Martin Baulig  <martin@ximian.com>
5655         * typemanager.cs
5656         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5657         this for accessibility checks.
5658         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5659         IsNestedFamilyAccessible.
5660         (TypeManager.IsSubclassOf): New method, do what the name actually
5661         says.   
5663 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5665         Fix crash on cs0657-17.cs.
5666         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5667         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5668         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5669         the case where the NamespaceEntry gets overwritten.
5671 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5673         Fixed #69195, #56821
5674         * ecore.cs (ResolveBoolean): Tiny refactoring.
5676         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5677         of right expression resolving when left is false constant and
5678         operator is LogicalAnd OR true constant and operator is LogicalOr.
5680         * statement.cs (ResolveUnreachable): Always reports warning.
5682 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5684         * class.cs: Distinguish between 1721 and 1722 (just a little help
5685         for the programmer).
5687 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5689         * delegate.cs: Only allow this on new versions of the language. 
5691 2004-12-02  Duncan Mak  <duncan@ximian.com>
5693         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5694         Expression class.
5695         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5696         here as a static method. Take an additional bool out parameter
5697         `must_do_cs1540_check' for signaling to InstanceResolve.
5698         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5699         member field from PropertyExpr class and made it an argument of
5700         the method instead.
5701         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5702         check for MarshalByRefObject, and report CS0122 instead of CS1540.
5703         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5704         and `remove_accessor' as well as InstanceResolve: report CS0122
5705         where applicable.
5707         Fixes #70129.
5709 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5711         Fix test-327.cs, test-328.cs, and put in early infrastructure
5712         for eventually fixing #52697.
5713         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5714         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5715         from other methods.
5716         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5717         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5718         (VerifyUsing, error246): Update.
5719         * rootcontext.cs (RootContext.NamespaceLookup): Just use
5720         'NamespaceEntry.LookupNamespaceOrType'.
5722 2004-12-03  Martin Baulig  <martin@ximian.com>
5724         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5725         method as our child, call AnonymousMethod.Compatible() on it.
5727 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5729         Disable XML documentation support in 'basic' profile.
5730         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
5731         Redirect XmlElement to System.Object.
5732         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
5733         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
5734         * mcs.exe.sources: Add doc-bootstrap.cs.
5735         * doc-bootstrap.cs: New file.  Contains empty stub implementation
5736         of doc.cs.
5738 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
5740         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5741           comments are allowed.
5743 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5745         * delegate.cs: Add checks for subtypes in paramaters and return values
5746         in VerifyMethod () to add support for Covariance/Contravariance
5747         in delegates.
5748         
5749 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5751         * report.cs: Remove extra closing parenthesis.
5753         * convert.cs (Error_CannotImplicitConversion): If the name of the
5754         types are the same, provide some extra information.
5756         * class.cs (FieldBase): Use an unused bit field from the field to
5757         encode the `has_offset' property from the FieldMember.  This saves
5758         a couple of Ks on bootstrap compilation.
5760         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5761         method as our child, return the AnonymousMethod resolved
5762         expression.
5764         * expression.cs (New.DoResolve): Allow return values from
5765         NewDelegate to also include AnonymousMethods.
5767         Fixes #70150.
5769 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
5771         Fix bug #70102
5772         * attribute.cs (Resolve): Improved implementation of params
5773         attribute arguments.
5775         * support.cs (ParameterData): Add HasParams to be faster.
5777 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
5779         all things are for /doc support:
5781         * doc.cs: new file that supports XML documentation generation.
5782         * mcs.exe.sources: added doc.cs.
5783         * driver.cs:
5784           Handle /doc command line option.
5785           Report error 2006 instead of 5 for missing file name for /doc.
5786           Generate XML documentation when required, after type resolution.
5787         * cs-tokenizer.cs:
5788           Added support for picking up documentation (/// and /** ... */),
5789           including a new XmlCommentState enumeration.
5790         * cs-parser.jay:
5791           Added lines to fill Documentation element for field, constant,
5792           property, indexer, method, constructor, destructor, operator, event
5793           and class, struct, interface, delegate, enum.
5794           Added lines to warn incorrect comment.
5795         * rootcontext.cs :
5796           Added Documentation field (passed only when /doc was specified).
5797         * decl.cs:
5798           Added DocComment, DocCommentHeader, GenerateDocComment() and
5799           OnGenerateDocComment() and some supporting private members for
5800           /doc feature to MemberCore.
5801         * class.cs:
5802           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5803         * delegate.cs:
5804           Added overriden DocCommentHeader.
5805         * enum.cs:
5806           Added overriden DocCommentHeader and GenerateDocComment().
5808 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
5810         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5811         unwrapping the enumeration values, chain to
5812         DoConstantNumericPromotions again, so we can promote things to the
5813         fundamental types (takes care of enums that are bytes, sbytes).
5815         Fixes bug #62054.
5817 2004-12-01  Raja R Harinath  <rharinath@novell.com>
5819         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5820         Fix long-standing bug in type-lookup.  Use FindType instead of
5821         LookupType when ec.ResolvingTypeTree.
5822         (Attribute.ResolveType, Attribute.Resolve)
5823         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5824         Update to changes.
5825         (Attributes.Search): Remove internal version.  Update.
5826         (Attributes.SearchMulti): Update.
5827         (Attributes.GetClsCompliantAttribute): Remove.
5828         (Attributes.GetIndexerNameAttribute): Remove.
5829         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5830         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5831         * class.cs (Indexer.Define): Likewise.
5833 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
5835         Fix bug #68790
5836         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5837         MarshallByReference members access.
5839         * expression.cs: Use CheckMarshallByRefAccess;
5840         Better error CS0197 message.
5842         * report.cs: Print whole related error message.
5844 2004-11-30  Raja R Harinath  <rharinath@novell.com>
5846         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
5847         the current directory to help debugging.
5849 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5851         * class (GetClassBases): Better error 60 report.
5852         (EventProperty): Disabled warning 67 detection.
5854 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5856         Fix bug #60324
5857         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5859         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5860         precise values.
5862 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5864         Fix bug #49488
5865         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5867         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5869 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
5871         * attribute.cs (Attribute.Resolve): Refine error reporting and
5872         report a cs0117 if the identifier does not exist, to distinguish
5873         from 0617 which is a miss-use of the actual identifier.
5875         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5876         between cs0070 and cs0079.
5878         * class.cs (MemberBase.DoDefine): When reporting a wrong
5879         accessibility level, we use MethodCore to compare instead of
5880         Method (this was a regression in some refactoring effort).
5882         So now we correctly report cs0056 again.
5884         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5885         testing the target_type (which was known to be object_type) and
5886         not the source type (which is anonymous_method).
5888         Fixed reporting of error cs1660.
5890         * expression.cs (UserCast.Source): Expose the underlying cast.
5892         * statement.cs (Switch.SwitchGoverningType): Sort the list of
5893         allowed types to find a match to int32 first (most common).
5895         In addition, it ignores any ImplicitUserConversions that did an
5896         internal implicit conversion (as the switch statement allows only
5897         one integral conversion to exist).
5899         * class.cs (PartialContainer.Create): rename `name' to
5900         `member_name' for clarity.  Then replace the string calls with a
5901         call to MemberName.GetPartialName, as now using
5902         MemberName.ToString is an error (this is due to the side effects
5903         it had, that were fixed in the past).
5905         This will restore the error reporting on a number of partial class
5906         errors that were missusing this (and getting an exception as a
5907         results, which is now just a plain textual warning, because
5908         yyparse debug output would crash otherwise).
5910 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5912         * Makefile (PROGRAM_INSTALL_DIR): Remove.
5914 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5916         * rootcontext.cs (LookupType): Make sure to cache lookups that
5917         don't give us a negative result. This saves about 5% of corlib
5918         compilation time.
5920 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5922         * report.cs (AbstractMessage.Print): messages are sent to stderr
5924         * class.cs (TypeContainer.GetClassBases): It is an error to have a
5925         non-interface in the list of interfaces (at this point, either
5926         parent was properly set, or a base class is being listed in the
5927         interfaces section).
5929         This flags error 1722, and resolves the crash from bug 69259.
5931 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5933         * statement.cs (Using.EmitExpressionFinally): make this work right
5934         for valuetypes. Fixes 69926.
5936 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5938         * const.cs (Const.ChangeType): Cope with the "0 literal can be
5939         converted to an enum" here, before we try to change the underlying
5940         type.  This code exists, but it is a different code path than the
5941         one used while encoding constants.
5943         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5944         old bug: when converting from the null literal to a pointer,
5945         return an EmptyCast, not the NullLiteral.
5947         This fixes #69921, the recent null_type changes probably made this
5948         bug more prominent.
5950         (ImplicitReferenceConversionExists): In addition, resynchronized
5951         the code here, so it matches the same code in
5952         ImplicitReferenceConversionExists for the `from any class-type S
5953         to any interface-type T'.
5954         
5956 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
5958         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5960 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
5962         * cs-parser.jay: Use verbosity accordingly. 
5964 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5966         * expression.cs (Unary.ResolveOperator): Do not report warning;
5967         AddressOf reads from variable.
5968         
5969         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5971 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5973         Fix bug #69462
5975         * attribute.cs (Attributable): Removed CheckTargets.
5976         (Attributes.Emit): Explicit attribute targets are tested here.
5978         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5979         not enabled for interfaces.
5981         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5982         (GetAssemblyName): Ouch next bug there.
5984 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5986         * expression.cs: Error 275 added.
5987         
5988 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
5990         Fix bug #69177 (Implemented decimal constant support)
5992         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5993         (BinaryFold): Add DecimalConstant.
5995         * const.cs (Define): Decimal constant 
5996         (is not constant.
5997         (ChangeType): Add decimal type handling.
5998         (LookupConstantValue): Don't set value for decimal type but
5999         emit DecimalConstantAttribute. Needed for constant optimization.
6001         * constant.cs (ToDecimal): New method.
6002         (ConvertToDecimal): New method.
6003         (IntConstant): Implemented ConvertToDecimal.
6004         (DecimalConstant.Emit): Emit optimized version for decimals in
6005         int range.
6007         * expression.cs (ResolveOperator): Changed order of constant
6008         reduction to work correctly with native types which have
6009         overloaded operators.
6010         (ResolveMemberAccess): Extract constant value from attribute
6011         for decimal type.
6013         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6015         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6016         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6017         (ChangeType): Decimal is special.
6018         (TypeToCoreType): Add decimal type.
6020 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6022         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6023         decimal types.
6025 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6027         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6028         test cs1667-5.cs.
6030 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6032         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6034         * pending.cs (PendingImplementation): Grab only interfaces.
6036 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6038         * statement.cs (ForeachHelperMethods): Add location member and
6039         error 202 detection.
6041 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6043         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6044         automatically handled by executable.make.
6045         (PROGRAM): Make profile-specific.
6047 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6049         * expression.cs (DoResolveBase): Fixed wrong warning for out
6050         variables.
6052 2004-11-18  Martin Baulig  <martin@ximian.com>
6054         Merged latest changes into gmcs.  Please keep this comment in
6055         here, it makes it easier for me to see what changed in MCS since
6056         the last time I merged.
6058 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6060         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6061         (TypeHandle.GetMemberCache): New.
6062         (TypeHandle.TypeHandle): Update.
6063         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6064         (TypeManager.LookupParentInterfacesCache):
6065         Rename from LookupInterfaceCache.  Optimize slightly.
6066         (TypeManager.MemberLookup_FindMembers): Update.
6067         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6068         multi-type variant.
6069         (AddCacheContents): Rename from AddHashtable.
6070         * class.cs (TypeContainer.parent_container): Remove.
6071         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6072         (TypeContainer.DoDefineMembers): Don't initialize it.
6073         Update to name changes.
6074         
6075 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6077         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6078         that factors the code to check access modifiers on override.  
6080         (PropertyBase): Use the code here.
6082         Patch from Lluis S'anchez, fixes bug #69361.
6084 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6086         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6087         routine that is used to report the use of a captured variable
6088         whose address has been taken.
6090         There are two checks: one when variables are being captured and
6091         the other check is when the address of a variable is taken. 
6092         
6093         (because an anonymous methods might be resolved before *or* after
6094         the address has been taken) and 
6096         * expression.cs (Conditional.DoResolve): Remove the special
6097         casing that Martin added to trueExpr and falseExpr being both
6098         NullLiteral.  We get the right behavior now just by introducing
6099         the null_type into the compiler. 
6101         * convert.cs (ExplicitConversion): Change the code to use
6102         null_type instead of testing `expr is NullLiteral'.
6103         (ImplicitConversionStandard): use null_type too.
6104         (ImplicitReferenceConversionExists): use null_type too.
6105         (ImplicitReferenceConversion): use null_type too.
6107         * literal.cs: The type of `NullLiteral' is now null_type instead
6108         of object_type. 
6109         (Resolve): Set the type here.
6111         * typemanager.cs: Introduce null_type.
6113 2004-11-17  Martin Baulig  <martin@ximian.com>
6115         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6116         direction, like FindMembers() does.  Fixes #69546, testcase is in
6117         test-315.cs.    
6119 2004-11-16  Martin Baulig  <martin@ximian.com>
6121         This is based on a patch from Marek Safar, see bug #69082.
6122         Fixes bugs #63705 and #67130.
6124         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6125         method; create a MemberCache for an interface type and cache the
6126         result.
6128         * decl.cs (IMemberContainer.ParentContainer): Removed.
6129         (IMemberContainer.ParentCache): New property.
6130         (MemberCache.SetupCacheForInterface): Removed.
6131         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6132         to create a cache for an interface's "parent".
6134         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6135         interfaces too.
6137 2004-11-16  Martin Baulig  <martin@ximian.com>
6139         Merged back from gmcs; these changes already went into gmcs a
6140         couple of weeks ago.
6142         * typemanager.cs
6143         (TypeManager.AddUserType): Removed the `ifaces' argument.
6144         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6145         `TypeExpr []'.
6146         (TypeManager.AddUserInterface): Removed.
6147         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6148         `TypeExpr []'.
6149         (TypeManager.GetInterfaces): Likewise.
6150         (TypeManager.GetExplicitInterfaces): Likewise.
6152         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6154         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6155         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6157 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6159         * statement.cs: Avoid adding bools to a hashtable.
6161 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6163         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6164         calling an unsafe method from a safe location.
6166 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6168         Fix #69167
6169         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6171 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6173         * namespace.cs (VerifyUsing): use GetPartialName instead of
6174         ToString. 
6176 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6178         * statement.cs (Return.Resolve): Fix regression in typo: if
6179         `in_exc', we have to request a NeedReturnLabel, this was a typo
6180         introduced in the anonymous method check-in.  Fixes #69131.
6182         * Indexers were using the ShortName when defining themselves,
6183         causing a regression in the compiler bootstrap when applying the
6184         patch from 2004-11-02 (first part), now they use their full name
6185         and the bug is gone.
6187 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6189         * driver.cs: Strip the path from the names of embedded resources. Fixes
6190         #68519.
6192 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6194         Fix error message regression: cs0104-2.cs.
6195         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6196         (AliasEntry.Resolve): Update.
6197         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6198         'silent' flag.
6199         (RootContext.LookupType): Update.
6201 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6203         * cs-parser.jay: Add support for handling accessor modifiers
6204         * class: Add support port accessor modifiers and error checking,
6205         define PropertyMethod.Define as virtual (not abstract anymore)
6206         * ecore.cs: Add checking for proeprties access with access modifiers
6207         * iterators.cs: Modify Accessor constructor call based in the modified
6208         constructor
6209 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6211         * expression.cs (StringConcat): Handle being called twice,
6212         as when we have a concat in a field init with more than two
6213         ctors in the class
6215 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6217         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6218         special case explicit implementations, we should always produce
6219         the .property or .event declaration.
6220         
6221         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6222         since it will not return correct data if people use this
6223         unresolved in the presence of using statements (see test-313).
6225         * class.cs (MethodData.Define): If we are an explicit interface
6226         implementation, set the method name to the full name of the
6227         interface plus the name of the method.  
6229         Notice that using the method.MethodName.GetFullName() does not
6230         work, as it will only contain the name as declared on the source
6231         file (it can be a shorthand in the presence of using statements)
6232         and not the fully qualifed type name, for example:
6234         using System;
6236         class D : ICloneable {
6237                 object ICloneable.Clone ()  {
6238                 }
6239         }
6241         Would produce a method called `ICloneable.Clone' instead of
6242         `System.ICloneable.Clone'.
6244         * namespace.cs (Alias.Resolve): Use GetPartialName.
6245         
6246 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6248         * cs-parser.jay: Add error 1055 report.
6250 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6252         * assign.cs (Assign.DoResolve): Only do the transform of
6253         assignment into a New if the types are compatible, if not, fall
6254         through and let the implicit code deal with the errors and with
6255         the necessary conversions. 
6257 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6259         * cs-parser.jay: Add error 1031 report.
6261         * cs-tokenizer.cs: Add location for error 1038.
6263 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6265         * cs-parser.jay: Add error 1016 report.
6267 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6269         * cs-parser.jay: Add errors 1575,1611 report.
6271 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6273         * cs-parser.jay: Add error 1001 report.
6275 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6277         Fix #68850
6278         * attribute.cs (GetMarshal): Add method argument for
6279         caller identification.
6281         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6282         agument for GetMarshal and RuntimeMissingSupport.
6284 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6286         * attribute.cs (ExtractSecurityPermissionSet): Removed
6287         TypeManager.code_access_permission_type.
6289         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6291 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6293         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6294         for obsolete use of a variable here.   Fixes regression on errors
6295         cs0619-25 and cs0619-26.
6297 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6299         Fix #62358, implemented security attribute encoding.
6301         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6302         Tests permitted SecurityAction for assembly or other types.
6303         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6304         data from SecurityPermissionAttribute to PermisionSet class.
6306         * class.cs (ApplyAttributeBuilder): Added special handling
6307         for System.Security.Permissions.SecurityAttribute based types.
6309         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6310         special handling for System.Security.Permissions.SecurityAttribute
6311         based types.
6313         * enum.cs (ApplyAttributeBuilder): Added special handling
6314         for System.Security.Permissions.SecurityAttribute based types.
6316         * parameter.cs (ApplyAttributeBuilder): Added special handling
6317         for System.Security.Permissions.SecurityAttribute based types.
6319         * rootcontext.cs: Next 2 core types.
6321         * typemanager.cs (TypeManager.security_permission_attr_type):
6322         Built in type for the SecurityPermission Attribute.
6323         (code_access_permission_type): Build in type.
6325 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6327         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6328         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6329         all of this information into
6330         EmitContext.EmitCapturedVariableInstance.
6331         
6332         * codegen.cs (EmitCapturedVariableInstance): move here the
6333         funcionality of emitting an ldarg.0 in the presence of a
6334         remapping.   This centralizes the instance emit code.
6336         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6337         then emit a load of this: it means that we have reached the
6338         topmost ScopeInfo: the one that contains the pointer to the
6339         instance of the class hosting the anonymous method.
6341         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6342         captures to the topmost CaptureContext.
6344 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6346         * expression.cs (LocalVariableReference): Move the knowledge about
6347         the iterators into codegen's EmitCapturedVariableInstance.
6349 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6351         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6352         all code paths return a value from an anonymous method (it is the
6353         same as the 161 error, but for anonymous methods).
6355 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6357         The introduction of anonymous methods in the compiler changed
6358         various ways of doing things in the compiler.  The most
6359         significant one is the hard split between the resolution phase
6360         and the emission phases of the compiler.
6362         For instance, routines that referenced local variables no
6363         longer can safely create temporary variables during the
6364         resolution phase: they must do so from the emission phase,
6365         since the variable might have been "captured", hence access to
6366         it can not be done with the local-variable operations from the runtime.
6367         
6368         * statement.cs 
6370         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6371         is a toplevel block.
6373         (ToplevelBlock): A new kind of Block, these are the blocks that
6374         are created by the parser for all toplevel method bodies.  These
6375         include methods, accessors and anonymous methods.
6377         These contain some extra information not found in regular blocks:
6378         A pointer to an optional CaptureContext (for tracking captured
6379         local variables and parameters).  A pointer to the parent
6380         ToplevelBlock.
6381         
6382         (Return.Resolve): Catch missmatches when returning a value from an
6383         anonymous method (error 1662).
6384         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6385         phase.
6387         (Break.Resolve): ditto.
6389         (SwitchLabel): instead of defining the labels during the
6390         resolution phase, we now turned the public ILLabel and ILLabelCode
6391         labels into methods called GetILLabelCode() and GetILLabel() that
6392         only define the label during the Emit phase.
6394         (GotoCase): Track the SwitchLabel instead of the computed label
6395         (its contained therein).  Emit the code by using
6396         SwitchLabel.GetILLabelCode ().
6398         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6399         whether the Local has been captured or not.
6401         (LocalInfo.IsCaptured): New property, used to tell whether the
6402         local has been captured.
6403         
6404         * anonymous.cs: Vastly updated to contain the anonymous method
6405         support.
6407         The main classes here are: CaptureContext which tracks any
6408         captured information for a toplevel block and ScopeInfo used to
6409         track the activation frames for various local variables.   
6411         Each toplevel block has an optional capture context associated
6412         with it.  When a method contains an anonymous method both the
6413         toplevel method and the anonymous method will create a capture
6414         context.   When variables or parameters are captured, they are
6415         recorded on the CaptureContext that owns them, for example:
6417         void Demo () {
6418              int a;
6419              MyDelegate d = delegate {
6420                  a = 1;
6421              }
6422         }
6424         Here `a' will be recorded as captured on the toplevel
6425         CapturedContext, the inner captured context will not have anything
6426         (it will only have data if local variables or parameters from it
6427         are captured in a nested anonymous method.
6429         The ScopeInfo is used to track the activation frames for local
6430         variables, for example:
6432         for (int i = 0; i < 10; i++)
6433                 for (int j = 0; j < 10; j++){
6434                    MyDelegate d = delegate {
6435                         call (i, j);
6436                    }
6437                 }
6439         At runtime this captures a single captured variable `i', but it
6440         captures 10 different versions of the variable `j'.  The variable
6441         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6442         recorded on a child.  
6444         The toplevel ScopeInfo will also track information like the `this'
6445         pointer if instance variables were referenced (this is necessary
6446         as the anonymous method lives inside a nested class in the host
6447         type of the method). 
6449         (AnonymousMethod): Expanded to track the Toplevel, implement
6450         `AnonymousMethod.Compatible' to tell whether an anonymous method
6451         can be converted to a target delegate type. 
6453         The routine now also produces the anonymous method content
6455         (AnonymousDelegate): A helper class that derives from
6456         DelegateCreation, this is used to generate the code necessary to
6457         produce the delegate for the anonymous method that was created. 
6459         * assign.cs: API adjustments for new changes in
6460         Convert.ImplicitStandardConversionExists.
6462         * class.cs: Adjustments to cope with the fact that now toplevel
6463         blocks are of type `ToplevelBlock'. 
6465         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6466         insteda of standard blocks.
6468         Flag errors if params arguments are passed to anonymous methods.
6470         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6471         `CurrentAnonymousMethod' which points to the current Anonymous
6472         Method.  The variable points to the AnonymousMethod class that
6473         holds the code being compiled.  It is set in the new EmitContext
6474         created for the anonymous method.
6476         (EmitContext.Phase): Introduce a variable and an enumeration to
6477         assist in enforcing some rules about when and where we are allowed
6478         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6479         only one that enfonces this right now).
6481         (EmitContext.HaveCaptureInfo): new helper method that returns
6482         whether we have a CapturedContext initialized.
6484         (EmitContext.CaptureVariable): New method used to register that a
6485         LocalInfo must be flagged for capturing. 
6487         (EmitContext.CapturedParameter): New method used to register that a
6488         parameters must be flagged for capturing. 
6489         
6490         (EmitContext.CapturedField): New method used to register that a
6491         field must be flagged for capturing. 
6493         (EmitContext.HaveCapturedVariables,
6494         EmitContext.HaveCapturedFields): Return whether there are captured
6495         variables or fields. 
6497         (EmitContext.EmitMethodHostInstance): This is used to emit the
6498         instance for the anonymous method.  The instance might be null
6499         (static methods), this (for anonymous methods that capture nothing
6500         and happen to live side-by-side with the current method body) or a
6501         more complicated expression if the method has a CaptureContext.
6503         (EmitContext.EmitTopBlock): Routine that drives the emission of
6504         code: it will first resolve the top block, then emit any metadata
6505         and then emit the code.  The split is done so that we can extract
6506         any anonymous methods and flag any captured variables/parameters.
6507         
6508         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6509         during this phase, the ILGenerator should not be used as labels
6510         and local variables declared here might not be accessible to any
6511         code that is part of an anonymous method.  
6513         Exceptions to this include the temporary variables that are
6514         created by some statements internally for holding temporary
6515         variables. 
6516         
6517         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6518         metadata for a cb
6520         (EmitContext.TemporaryReturn): This method is typically called
6521         from the Emit phase, and its the only place where we allow the
6522         ReturnLabel to be defined other than the EmitMeta.  The reason is
6523         that otherwise we would have to duplicate a lot of logic in the
6524         Resolve phases of various methods that today is on the Emit
6525         phase. 
6527         (EmitContext.NeedReturnLabel): This no longer creates the label,
6528         as the ILGenerator is not valid during the resolve phase.
6530         (EmitContext.EmitThis): Extended the knowledge in this class to
6531         work in anonymous methods in addition to iterators. 
6533         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6534         code is necessary on the stack to access the instance to a local
6535         variable (the variable will be accessed as a field).
6537         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6538         EmitContext.EmitAddressOfParameter): Routines to support
6539         parameters (not completed at this point). 
6540         
6541         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6542         will also remove the parameters.
6544         * convert.cs (Convert): Define a `ConstantEC' which points to a
6545         null.  This is just to prefity some code that uses
6546         ImplicitStandardConversion code and do not have an EmitContext
6547         handy.
6549         The idea is to flag explicitly that at that point in time, it is
6550         known that the conversion will not trigger the delegate checking
6551         code in implicit conversions (which requires a valid
6552         EmitContext). 
6554         Everywhere: pass new EmitContext parameter since
6555         ImplicitStandardConversionExists now requires it to check for
6556         anonymous method conversions. 
6558         (Convert.ImplicitStandardConversionExists): If the type of an
6559         expression is the anonymous_method_type, and the type is a
6560         delegate, we invoke the AnonymousMethod.Compatible method to check
6561         whether an implicit conversion is possible. 
6563         (Convert.ImplicitConversionStandard): Only do implicit method
6564         group conversions if the language level is not ISO_1.
6566         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6567         MethodInfo for the Invoke method.  used by Delegate and
6568         AnonymousDelegate.
6570         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6571         method conversions if the target type is a delegate.
6573         Removed extra debugging nops.
6575         (LocalVariableReference): Turn the `local_info' into a public
6576         field. 
6578         Add `prepared' field, the same hack used for FieldExprs to cope
6579         with composed assignments, as Local variables do not necessarily
6580         operate purely on the stack as they used to: they can be captured
6581         fields. 
6583         Add `temp' for a temporary result, like fields.
6585         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6587         It now copes with Local variables that are captured and emits the
6588         proper instance variable to load it from a field in the captured
6589         case. 
6591         (ParameterReference.DoResolveBase): During the resolve phase,
6592         capture parameters if we are in an anonymous method.
6594         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6595         anonymous method, use the EmitContext helper routines to emit the
6596         parameter reference.
6598         * iterators.cs: Set RemapToProxy to true/false during the
6599         EmitDispose class.
6601         * parameters.cs (GetParameterByName): New helper method. 
6603         * typemanager.cs (anonymous_method_type) a new type that
6604         represents an anonyous method.  This is always an internal type,
6605         used as a fencepost to test against the anonymous-methodness of an
6606         expression. 
6607         
6608 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6610         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6611         561 report.
6612         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6614 2004-10-18  Martin Baulig  <martin@ximian.com>
6616         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6617         `Type' directly, but call ResolveType() on it.
6618         (Catch.Resolve): Likewise.
6619         (Foreach.Resolve): Likewise.
6621 2004-10-18  Martin Baulig  <martin@ximian.com>
6623         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6624         `Type' directly, but call ResolveType() on it.
6625         (Probe.DoResolve): Likewise.
6626         (ArrayCreation.LookupType): Likewise.
6627         (TypeOf.DoResolve): Likewise.
6628         (SizeOf.DoResolve): Likewise.
6630 2004-10-18  Martin Baulig  <martin@ximian.com>
6632         * expression.cs (Invocation.BetterFunction): Put back
6633         TypeManager.TypeToCoreType().
6635 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6637         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6638         the ResolveType.
6640 2004-10-18  Martin Baulig  <martin@ximian.com>
6642         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
6643         `Type' directly, but call ResolveType() on it.
6645 2004-10-18  Martin Baulig  <martin@ximian.com>
6647         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6648         `Type' directly, but call ResolveType() on it.
6649         (MemberBase.DoDefine): Likewise.
6651         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6652         `Type' directly, but call ResolveType() on it.
6653         (ComposedCast.DoResolveAsTypeStep): Likewise.
6655         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6656         `Type' directly, but call ResolveType() on it.
6658 2004-10-17  John Luke  <john.luke@gmail.com>
6660         * class.cs (Operator.GetSignatureForError): use CSharpName
6662         * parameter.cs (Parameter.GetSignatureForError): Returns
6663         correct name even if was not defined.
6665 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6667         Fix #65816.
6668         * class.cs (TypeContainer.EmitContext): New property.
6669         (DefineNestedTypes): Create an emitcontext for each part.
6670         (MethodCore.DoDefineParameters): Use container's emitcontext.
6671         Pass type array to InternalParameters.
6672         (MemberBase.DoDefine): Use container's emitcontext.
6673         (FieldMember.Define): Likewise.
6674         (Event.Define): Likewise.
6675         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6676         Pass type array to InternalParameters.
6677         (SetIndexerMethod.GetParameterInfo): Likewise.
6678         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6679         * delegate.cs (Define): Pass emitcontext to
6680         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6681         array to InternalParameters.
6682         * expression.cs (ParameterReference.DoResolveBase): Pass
6683         emitcontext to GetParameterInfo.
6684         (ComposedCast.DoResolveAsTypeStep): Remove check on
6685         ec.ResolvingTypeTree.
6686         * parameter.cs (Parameter.Resolve): Change argument to
6687         EmitContext.  Use ResolveAsTypeTerminal.
6688         (Parameter.GetSignature): Change argument to EmitContext.
6689         (Parameters.ComputeSignature): Likewise.
6690         (Parameters.ComputeParameterTypes): Likewise.
6691         (Parameters.GetParameterInfo): Likewise.
6692         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6693         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6694         * support.cs (InternalParameters..ctor): Remove variant that takes
6695         a DeclSpace.
6696         * typemanager.cs (system_intptr_expr): New.
6697         (InitExpressionTypes): Initialize it.
6699 2004-10-12  Chris Toshok  <toshok@ximian.com>
6701         * cs-parser.jay: fix location for try_statement and catch_clause.
6703 2004-10-11  Martin Baulig  <martin@ximian.com>
6705         * report.cs: Don't make --fatal abort on warnings, we have
6706         -warnaserror for that.
6708 2004-10-07  Raja R Harinath  <rharinath@novell.com>
6710         More DeclSpace.ResolveType avoidance.
6711         * decl.cs (MemberCore.InUnsafe): New property.
6712         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
6713         with newly created EmitContext.
6714         (FieldMember.Define): Likewise.
6715         * delegate.cs (Delegate.Define): Likewise.
6716         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6717         only if normal name-lookup fails.
6718         (TypeExpr.DoResolve): Enable error-checking.
6719         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6720         (SizeOf.DoResolve): Likewise.
6721         (ComposedCast.DoResolveAsTypeStep): Likewise.
6722         (StackAlloc.DoResolve): Likewise.
6723         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6724         (Block.Unsafe): New property.
6725         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6726         (Unsafe): Set 'unsafe' flag of contained block.
6727         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6728         (Fixed.Resolve): Likewise.
6729         (Catch.Resolve): Likewise.
6730         (Using.ResolveLocalVariableDecls): Likewise.
6731         (Foreach.Resolve): Likewise.
6733 2004-10-05  John Luke <john.luke@gmail.com>
6735         * cs-parser.jay: add location to error CS0175
6737 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
6739         * ecore.cs (Expression.Constantity): Add support for turning null
6740         into a constant.
6742         * const.cs (Const.Define): Allow constants to be reference types
6743         as long as the value is Null.
6745 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
6747         * namespace.cs (NamespaceEntry.Using): No matter which warning
6748         level is set, check if this namespace name has already been added.
6750 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
6752         * expression.cs: reftype [!=]= null should always use br[true,false].
6753         # 67410
6755 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
6757         Fix #67108
6758         * attribute.cs: Enum conversion moved to 
6759         GetAttributeArgumentExpression to be applied to the all
6760         expressions.
6762 2004-10-01  Raja R Harinath  <rharinath@novell.com>
6764         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6765         * class.c (TypeContainer.DefineType): Flag error if
6766         base types aren't accessible due to access permissions.
6767         * decl.cs (DeclSpace.ResolveType): Move logic to
6768         Expression.ResolveAsTypeTerminal.
6769         (DeclSpace.ResolveTypeExpr): Thin layer over
6770         Expression.ResolveAsTypeTerminal.
6771         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6772         Refactor code into NestedAccess.  Use it.
6773         (DeclSpace.NestedAccess): New.
6774         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6775         argument to silence errors.  Check access permissions.
6776         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6777         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6778         (Cast.DoResolve): Likewise.
6779         (New.DoResolve): Likewise.
6780         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6781         (TypeOf.DoResolve): Likewise.
6783         * expression.cs (Invocation.BetterConversion): Return the Type of
6784         the better conversion.  Implement section 14.4.2.3 more faithfully.
6785         (Invocation.BetterFunction): Make boolean.  Make correspondence to
6786         section 14.4.2.2 explicit.
6787         (Invocation.OverloadResolve): Update.
6788         (Invocation): Remove is_base field.
6789         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
6790         (Invocation.Emit): Likewise.
6792 2004-09-27  Raja R Harinath  <rharinath@novell.com>
6794         * README: Update to changes.
6796 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
6798         * cs-parser.jay: Reverted 642 warning fix.
6800 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6802         Fix bug #66615
6803         * decl.cs (FindMemberWithSameName): Indexer can have more than
6804         1 argument.
6806 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6808         * expression.cs (LocalVariableReference.DoResolveLValue):
6809         Do not report warning 219 for out values.
6810         (EmptyExpression.Null): New member to avoid extra allocations.
6812 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6814         * cs-parser.jay: Fix wrong warning 642 report.
6816         * cs-tokenizer.cs (CheckNextToken): New helper;
6817         Inspect next character if is same as expected.
6819 2004-09-23  Martin Baulig  <martin@ximian.com>
6821         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6822         (Convert.ImplicitReferenceConversionExists): Likewise.
6824 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6826         * class.cs (Operator.Define): Add error 448 and 559 report.
6828 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6830         * class.cs (MemberBase.IsTypePermitted): New protected
6831         method for checking error CS0610.
6833 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6835         * class.cs (TypeContainer.HasExplicitLayout): New property
6836         Returns whether container has StructLayout attribute set Explicit.
6837         (FieldMember): New abstract class for consts and fields.
6838         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6839         (Field): Reuse FieldMember.
6841         * const.cs (Const): Reuse FieldMember.
6843         * rootcontext.cs: EmitConstants call moved to class.
6845 2004-09-22  Martin Baulig  <martin@ximian.com>
6847         Thanks to Peter Sestoft for this bug report.
6849         * expression.cs (Conditional): If both the `trueExpr' and the
6850         `falseExpr' is a NullLiteral, return a NullLiteral.
6852 2004-09-22  Martin Baulig  <martin@ximian.com>
6854         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6855         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6856         for the "get_Current" call.
6858 2004-09-22  Martin Baulig  <martin@ximian.com>
6860         Marek and me just fixed one of our oldest bugs: #28562 :-)
6862         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6864         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6865         we're an EnumConstant, just return that.
6866         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6867         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
6868         to get the value which'll actually be written into the attribute.
6869         However, we have to use GetValue() to access the attribute's value
6870         in the compiler.        
6872 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6874         * constant.cs (Constant.IsNegative): New abstract property
6875         IsNegative.
6877         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6878         (StackAlloc.DoResolve): Reused IsNegative.
6880 2004-09-21  Martin Baulig  <martin@ximian.com>
6882         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
6883         if we're used in an iterator, we may be called from different
6884         methods.
6886         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
6887         we actually have an exception block.
6889 2004-09-20  John Luke <jluke@cfl.rr.com>
6891         * class.cs, cs-parser.jay: Improve the error report for 1520:
6892         report the actual line where the error happens, not where the
6893         class was declared.
6895         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
6896         Pass location information that was available elsewhere.
6898 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
6900         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
6901         runtime to delay sign assemblies.
6903 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
6905         * cs-parser.jay: Do not report the stack trace, this is barely
6906         used nowadays.
6908 2004-08-22  John Luke  <john.luke@gmail.com>
6910         * driver.cs : check that a resource id is not already used
6911         before adding it, report CS1508 if it is, bug #63637
6913 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
6915         * ecore.cs: Removed dead code.
6917 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
6919         * class.cs: Do not report warning CS0067 on the interfaces.
6921 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6923         * cs-parser.jay: Add error 504 report.
6925 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6927         * rootcontext.cs: WarningLevel is 4 by default now.
6929         * statement.cs (Fixed.Resolve): Do not null
6930         VariableInfo.
6932 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6934         Fixed bug #55780
6935         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
6936         deep search when property is not virtual.
6937         (PropertyExpr.ResolveAccessors): Make one call for both
6938         accessors.
6940 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6942         Fixed bug #65766
6943         * statement.cs: Error 152 report constains also location.
6945 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6947         Fixed bug #65766
6948         * const.cs: Explicitly set constant as static.
6950 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6952         Fixed bug #64226
6953         * cs-parser.jay: Add error 1017 report.
6955 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6957         Fixed bug #59980, #64224
6958         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
6960         * typemanager.cs (IsSpecialMethod): Simplified
6962 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6964         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
6965         condition with better params.
6967 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6969         Fixed bug #65238
6970         * attribute.cs (Resolve): Property has to have both
6971         accessors.
6973 2004-09-14  Martin Baulig  <martin@ximian.com>
6975         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6977 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6979         Fixed bug #61902
6980         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6981         called and is obsolete then this member suppress message
6982         when call is inside next [Obsolete] method or type.
6984         * expression.cs: Use TestObsoleteMethodUsage member.
6986 2004-09-14  Martin Baulig  <martin@ximian.com>
6988         * cs-parser.jay: Sync a bit with the GMCS version.
6990 2004-09-14  Martin Baulig  <martin@ximian.com>
6992         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
6993         (CSharpParser.yacc_verbose_flag): New public field.
6995         * genericparser.cs: Removed.
6997 2004-09-14  Raja R Harinath  <rharinath@novell.com>
6999         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7001 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7003         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7005 2004-09-10  Martin Baulig  <martin@ximian.com>
7007         Backported my MemberName changes from GMCS into MCS.
7009         - we are now using a special `MemberName' class instead of using
7010         strings; in GMCS, the `MemberName' also contains the type
7011         arguments.
7013         - changed the grammar rules a bit:
7014           * the old `member_name' is now a `namespace_or_type_name':
7015             The rule is that we use `namespace_or_type_name' everywhere
7016             where we expect either a "member name" (GetEnumerator) or a
7017             "member name" with an explicit interface name
7018             (IEnumerable.GetEnumerator).
7019             In GMCS, the explicit interface name may include type arguments
7020             (IEnumerable<T>.GetEnumerator).
7021           * we use `member_name' instead of just `IDENTIFIER' for
7022             "member names":
7023             The rule is that we use `member_name' wherever a member may
7024             have type parameters in GMCS.       
7026         * decl.cs (MemberName): New public class.
7027         (MemberCore.MemberName): New public readonly field.
7028         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7029         (DeclSpace): Likewise.
7031         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7032         * enum.cs (Enum.ctor): Likewise.
7034         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7035         MemberName.     
7036         (AliasEntry.ctor): Take a MemberName, not an Expression.
7037         (AliasEntry.UsingAlias): Likewise.
7039         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7040         (IMethodData.MemberName): Changed type from string to MemberName.
7041         (MemberBase.ExplicitInterfaceName): Likewise.
7042         (AbstractPropertyEventMethod.SetupName): Make this private.
7043         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7044         argument; compute the member name here.
7045         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7046         on the `member.MemberName' and the `prefix'.
7048         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7049         not `type_name'.
7050         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7051         thus, we get a `MemberName' instead of a `string'.  These
7052         declarations may have type parameters in GMCS.
7053         (interface_method_declaration, delegate_declaration): Likewise.
7054         (class_declaration, interface_declaration): Likewise.
7055         (method_header): Use `namespace_or_type_name' instead of
7056         `member_name'.  We may be an explicit interface implementation.
7057         (property_declaration, event_declaration): Likewise.
7058         (member_name): This is now just an `IDENTIFIER', not a
7059         `namespace_or_type_name'.
7060         (type_name, interface_type): Removed.
7061         (namespace_or_type_name): Return a MemberName, not an Expression.
7062         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7063         call GetTypeExpression() on the MemberName to get an expression.
7064         (IndexerDeclaration.interface_type): Changed type from string to
7065         MemberName.
7066         (MakeName): Operate on MemberName's instead of string's.
7068 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7070         Fix bug #55770.
7071         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7072         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7073         lookup to avoid symbols introduced by 'using'.
7074         * rootcontext.cs (NamespaceLookup): Update.
7076 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7078         * class.cs (TypeContainer.DoDefineMembers): Do not call
7079         DefineDefaultConstructor for static classes.
7081 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7083         * attribute.cs (Attribute.Resolve): Add error 653 report.
7085         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7086         report.
7087         (Method.ApplyAttributeBuilder): Add error 685 report.
7088         (Operator.Define): Add error 564 report.
7090         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7092         * expression.cs (Invocation.DoResolve): Add error
7093         245 and 250 report.
7095         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7096         error 674 report.
7098 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7100         * class.cs (ConstructorInitializer.Resolve):
7101         Wrong error number (515->516).
7103 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7105         * class.cs (Indexer.Define): Add error 631 report.
7107 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7109         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7111 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7113         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7115 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7117         * cs-parser.jay: Added error CS0241 report.
7119 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7121         * cs-parser.jay (fixed_statement): Introduce a scope for the
7122         declaration in the 'fixed' statement.
7124 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7126         * cs-parser.jay: Added CS0230 error report.
7128 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7130         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7132 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7134         * expression.cs (Argument.Resolve): Added error CS0192 and
7135         CS0199 report.
7137 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7139         C# 2.0 #pragma warning feature
7141         * cs-tokenizer.cs (PreProcessPragma): New method; 
7142         Handles #pragma directive.
7144         * report.cs (WarningRegions): New class; Support
7145         class for #pragma warning directive. It tests whether
7146         warning is enabled for a given line.
7148 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7150         * const.cs: Add more descriptive error report, tahnks to
7151         Sebastien. 
7153 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7155         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7157 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7159         * expression.cs: Apply patch from Ben: Remove dead code from
7160         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7161         as that code just threw an exception anwyays.
7163         * const.cs: Remove the call to the turnintoconstant, for details
7164         see bug: #63144
7165         
7166         * literal.cs: The type of the null-literal is the null type;  So
7167         we use a placeholder type (literal.cs:System.Null, defined here)
7168         for it.
7170         * expression.cs (Conditional.DoResolve): Remove some old code that
7171         is no longer needed, conversions have been fixed.
7173         (ArrayCreationExpression.DoResolve): Return false if we fail to
7174         resolve the inner expression.
7176 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7178         Fix test-290.cs.
7179         * cs-parser.jay (delegate_declaration): Record a delegate
7180         declaration as a type declaration.
7181         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7183 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7185         * parameter.cs: Do not crash if the type can not be resolved. 
7187         * expression.cs: Report errors with unsafe pointers, fixes #64896
7189 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7191         * expression.cs: Pointer arith always needs to do a conv.i
7192         if the operand is a long. fix 65320
7194 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7196         Fixed cs0619-37.cs, cs0619-38.cs
7198         * enum.cs (GetObsoleteAttribute): Removed.
7200         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7201         on Enum member is double staged. The first is tested member
7202         and then enum.
7204 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7206         Fixed #56986, #63631, #65231
7208         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7209         adds member to name container.
7210         (TypeContainer.AddToTypeContainer): New method, adds type to
7211         name container.
7212         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7213         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7214         AddOperator): Simplified by reusing AddToMemberContainer.
7215         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7216         instead of field.
7217         (Method.CheckForDuplications): Fixed implementation to test all
7218         possibilities.
7219         (MemberBase): Detection whether member is explicit interface
7220         implementation is now in constructor.
7221         (MemberBase.UpdateMemberName): Handles IndexerName.
7222         (Accessor): Changed to keep also location information.
7223         (AbstractPropertyEventMethod): Is derived from MemberCore.
7224         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7225         will be emited or not.
7226         (PropertyBase.AreAccessorsDuplicateImplementation):
7227         Tests whether accessors are not in collision with some method.
7228         (Operator): Is derived from MethodCore to simplify common
7229         operations.
7231         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7232         must be performed.
7233         (DeclSpace.AddToContainer): Adds the member to defined_names
7234         table. It tests for duplications and enclosing name conflicts.
7236         * enum.cs (EnumMember): Clean up to reuse the base structures
7238 2004-09-03  Martin Baulig  <martin@ximian.com>
7240         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7241         into TypeContainer, to make partial classes work again.
7243 2004-09-03  Martin Baulig  <martin@ximian.com>
7245         * rootcontext.cs (RootContext.V2): Removed.
7247 2004-03-23  Martin Baulig  <martin@ximian.com>
7249         * expression.cs (Invocation.OverloadResolve): Added `bool
7250         may_fail' argument and use it instead of the Location.IsNull() hack.
7252 2004-09-03  Martin Baulig  <martin@ximian.com>
7254         Merged latest changes into gmcs.  Please keep this comment in
7255         here, it makes it easier for me to see what changed in MCS since
7256         the last time I merged.
7258 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7260         Fix #61128.
7261         * expression.cs (BetterConversion): Don't allow either conversion 
7262         to be null.  Remove redundant implicit conversion test when 'q ==
7263         null' -- when this function is invoked, we already know that the
7264         implicit conversion exists.
7265         (BetterFunction): Assume that 'best' is non-null.  Remove
7266         redundant reimplementation of IsApplicable when 'best' is null.
7267         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7268         number of arguments.
7269         (IsAncestralType): Extract from OverloadResolve.
7270         (OverloadResolve): Make robust to the MethodGroupExpr being
7271         unsorted.  Implement all the logic of Section 14.5.5.1, and
7272         support overloading of methods from multiple applicable types.
7273         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7275         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7276         (RealError, Warning): Append type of report to related symbol.
7278 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7280         * enum.cs: Fixed CLS-Compliance checks for enum members.
7281         Error tests cs3008-8.cs, cs3014-8.cs
7283 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7285         Fixed bug #62342, #63102
7286         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7287         like ImplementMethod.
7289 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7291         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7292         Fixed bug #65170.
7294 2004-09-02  Martin Baulig  <martin@ximian.com>
7296         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7297         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7298         on the MethodBase.
7300 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7302         C# 2.0 Static classes implemented
7304         * class.cs (TypeContainer): instance_constructors,
7305         initialized_fields, initialized_static_fields,
7306         default_constructor, base_inteface_types are protected to be
7307         accessible from StaticClass.
7308         (TypeContainer.DefineDefaultConstructor): New virtual method
7309         for custom default constructor generating
7310         (StaticClass): New class to handle "Static classes" feature.
7312         * cs-parser.jay: Handle static keyword on class like instance
7313         of StaticClass.
7315         * driver.cs: Added "/langversion" command line switch with two
7316         options (iso-1, default).
7318 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7320         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7322 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7324         * delegate.cs: Style.
7326 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7328         * delegate.cs: Add seperate instance expr field for miguel.
7330 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7332         * PointerArithmetic (Resolve): make sure we are not doing
7333         pointer arith on void*. Also, make sure we are resolved
7334         by not setting eclass until resolve.
7336         All callers: Make sure that PointerArithmetic gets resolved.
7338 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7340         * ArrayCreation (LookupType): If the type does not resolve 
7341         to an array, give an error.
7343 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7345         * statement.cs (Try.Resolve): Fixed bug #64222
7347 2004-08-27  Martin Baulig  <martin@ximian.com>
7349         * class.cs
7350         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7351         crash here.     
7353 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7355         * ecore.cs (Constantify): Get underlying type via
7356         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7357         Windows in special cases.
7359 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7361         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7362         for obtaining also private methods.
7363         (GetRemoveMethod): Used GetRemoveMethod (true)
7364         for obtaining also private methods.
7366 2004-08-24  Martin Baulig  <martin@ximian.com>
7368         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7369         MethodAttributes.HideBySig for operators.
7371 2004-08-23  Martin Baulig  <martin@ximian.com>
7373         Back to the old error reporting system :-)
7375         * report.cs (Message): Removed.
7376         (Report.MessageData, ErrorData, WarningData): Removed.
7377         (Report.Error, Warning): Back to the old system.
7379 2004-08-23  Martin Baulig  <martin@ximian.com>
7381         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7383         * class.cs (TypeContainer.ParentContainer): New public virtual
7384         method; replaces the explicit interface implementation.
7385         (ClassPart.ParentContainer): Override.
7387 2004-08-23  Martin Baulig  <martin@ximian.com>
7389         * statement.cs (Switch): Added support for constant switches; see
7390         #59428 or test-285.cs.
7392 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7394         Fixed bug #62740.
7395         * statement.cs (GetEnumeratorFilter): Removed useless
7396         logic because C# specs is strict. GetEnumerator must be
7397         public.
7399 2004-08-22  Martin Baulig  <martin@ximian.com>
7401         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7402         a switch and may break, reset the barrier.  Fixes #59867.
7404 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7406         CLS-Compliance speed up (~5% for corlib)
7408         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7409         New method. Tests container for CLS-Compliant names
7411         * class.cs (TypeContainer.VerifyClsName): New method.
7412         Checks whether container name is CLS Compliant.
7413         (Constructor): Implements IMethodData.
7415         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7416         low-case table for CLS Compliance test.
7417         (MemberCache.VerifyClsParameterConflict): New method.
7418         Checks method parameters for CS3006 error.
7420         * enum.cs (EnumMember): Is derived from MemberCore.
7421         (Enum.VerifyClsName): Optimized for better performance.
7423 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7425         * report.cs: Renamed Error_T to Error and changed all
7426         references.
7428 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7430         * class.cs (TypeContainer.IndexerArrayList): New inner class
7431         container for indexers.
7432         (TypeContainer.DefaultIndexerName): New constant for default
7433         indexer name. Replaced all "Item" with this constant.
7434         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7436         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7437         DefaultMemberAttribute constructor.
7439 2004-08-05  Martin Baulig  <martin@ximian.com>
7441         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7442         Fix bug #59429.
7444 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7446         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7447         multi platforms problem.
7449         * compiler.csproj: Included shared files.
7451 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7453         Fix bug 60333, 55971 in the more general way
7454         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7455         Added arg_type argument for constant conversion.
7456         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7458 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7460         Fix bug #59760
7461         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7462         OperatorArrayList, MethodCoreArrayList for typecontainer
7463         containers. Changed class member types to these new types.
7464         (MethodArrayList.DefineMembers): Added test for CS0659.
7466 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7468         * cfold.cs: Synchronize the folding with the code in expression.cs
7469         Binary.DoNumericPromotions for uint operands.
7471         * attribute.cs: Revert patch from Raja, it introduced a regression
7472         while building Blam-1.2.1 (hard to isolate a test case).
7474 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7476         Fix for #55382
7477         * class.cs:
7478         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7479         name collision.
7480         (MethodCore.parent_method): New member. The method we're overriding
7481         if this is an override method.
7482         (MethodCore.CheckBase): Moved from Method class and made common.
7483         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7484         private.
7485         (MethodCore.CheckForDuplications): New abstract method. For custom
7486         member duplication search in a container
7487         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7488         method and its return type.
7489         (Event.conflict_symbol): New member. Symbol with same name in the
7490         parent class.
7492         * decl.cs:
7493         (MemberCache.FindMemberWithSameName): New method. The method
7494         is looking for conflict with inherited symbols.
7496 2004-08-04  Martin Baulig  <martin@ximian.com>
7498         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7500         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7502 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7504         * report.cs (Message): New enum for better error, warning reference in
7505         the code.
7506         (MessageData): New inner abstract class. It generally handles printing of
7507         error and warning messages.
7508         Removed unused Error, Warning, Message methods.
7510 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7512         Fix for cs0592-8.cs test
7513         * attribute.cs
7514         (Attributable.ValidAttributeTargets): Made public.
7515         (Attribute.ExplicitTarget): New member for explicit target value.
7516         (Attribute.CheckTargets): Now we translate explicit attribute
7517         target to Target here.
7519 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7521         * ecore.cs (MethodGroupExpr): new IsBase property.
7523         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7525         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7526         rather than an instance expr.
7528         (DelegateCreation.Emit): Use the method group rather than
7529         the instance expression. Also, if you have base.Foo as the
7530         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7532         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7534         (NewDelegate.DoResolve): Only check for the existance of Invoke
7535         if the method is going to be needed. Use MethodGroupExpr.
7537         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7539         * expression.cs: For pointer arith., make sure to use
7540         the size of the type, not the size of the pointer to
7541         the type.
7543 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7545         Fix for #60722
7546         * class.cs (Class): Added error CS0502 test.
7548 2004-08-03  John Luke  <jluke@cfl.rr.com>
7549             Raja R Harinath  <rharinath@novell.com>
7551         Fix for #60997.
7552         * attribute.cs (Attribute.complained_before): New flag.
7553         (Attribute.ResolveType, Attribute.Resolve),
7554         (Attribute.DefinePInvokeMethod): Set it.
7555         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7556         
7557 2004-08-03  Martin Baulig  <martin@ximian.com>
7559         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7560         use a user-defined operator; we still need to do numeric
7561         promotions in case one argument is a builtin type and the other
7562         one has an implicit conversion to that type.  Fixes #62322.
7564 2004-08-02  Martin Baulig  <martin@ximian.com>
7566         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7567         (LocalInfo.IsThis): New public property.
7568         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7570 2004-08-01  Martin Baulig  <martin@ximian.com>
7572         * class.cs (TypeContainer.GetClassBases): Don't set the default
7573         here since we may get called from GetPartialBases().
7574         (TypeContainer.DefineType): If GetClassBases() didn't return a
7575         parent, use the default one.
7577 2004-07-30  Duncan Mak  <duncan@ximian.com>
7579         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7581 2004-07-30  Martin Baulig  <martin@ximian.com>
7583         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7585         * class.cs (SourceMethod): New public class, derive from the
7586         symbol writer's ISourceMethod.
7587         (Method): Use the new symbol writer API.
7589         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7590         as argument and use the new symbol writer.
7592         * location.cs
7593         (SourceFile): Implement the symbol writer's ISourceFile.
7594         (Location.SymbolDocument): Removed.
7595         (Location.SourceFile): New public property.
7597         * symbolwriter.cs: Use the new symbol writer API.
7599 2004-07-30  Raja R Harinath  <rharinath@novell.com>
7601         * Makefile (install-local): Remove.  Functionality moved to
7602         executable.make.
7604 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
7606         * Makefile: Install mcs.exe.config file together with mcs.exe.
7607         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7608         correct runtime version.
7609         
7610 2004-07-25  Martin Baulig  <martin@ximian.com>
7612         * class.cs
7613         (TypeContainer.RegisterOrder): Removed, this was unused.
7614         (TypeContainer, interface_order): Removed.
7615         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7616         TypeContainer as argument since we can also be called with a
7617         `PartialContainer' for a partial class/struct/interface.
7618         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7619         of checking whether we're an `Interface' - we could be a
7620         `PartialContainer'.
7621         (PartialContainer.Register): Override; call
7622         AddClass()/AddStruct()/AddInterface() on our parent.
7624         * cs-parser.jay (interface_member_declaration): Add things to the
7625         `current_container', not the `current_class'.
7627         * rootcontext.cs (RegisterOrder): The overloaded version which
7628         takes an `Interface' was unused, removed.
7630         * typemanager.cs (TypeManager.LookupInterface): Return a
7631         `TypeContainer', not an `Interface'.
7632         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7633         contain a `PartialContainer' for an interface, so check it's
7634         `Kind' to figure out what it is.
7636 2004-07-25  Martin Baulig  <martin@ximian.com>
7638         * class.cs (Class.DefaultTypeAttributes): New public constant.
7639         (Struct.DefaultTypeAttributes): Likewise.
7640         (Interface.DefaultTypeAttributes): Likewise.
7641         (PartialContainer.TypeAttr): Override this and add the
7642         DefaultTypeAttributes.
7644 2004-07-25  Martin Baulig  <martin@ximian.com>
7646         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7647         we can just use the `Parent' field instead.
7649 2004-07-25  Martin Baulig  <martin@ximian.com>
7651         * class.cs (TypeContainer.Emit): Renamed to EmitType().
7653 2004-07-25  Martin Baulig  <martin@ximian.com>
7655         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7656         our parts before defining any methods.
7657         (TypeContainer.VerifyImplements): Make this virtual.
7658         (ClassPart.VerifyImplements): Override and call VerifyImplements()
7659         on our PartialContainer.
7661 2004-07-25  Martin Baulig  <martin@ximian.com>
7663         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7665         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7666         argument, we can just use the `Parent' field instead.
7668         * class.cs
7669         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
7670         (MemberBase.DoDefine): Likewise.
7672 2004-07-24  Martin Baulig  <martin@ximian.com>
7674         * decl.cs (MemberCore.Parent): New public field.
7675         (DeclSpace.Parent): Moved to MemberCore.
7677         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7678         (MemberBase.ctor): Added TypeContainer argument, pass it to our
7679         parent's .ctor.
7680         (FieldBase, Field, Operator): Likewise.
7681         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7682         (EventField, Event): Likewise.
7684 2004-07-23  Martin Baulig  <martin@ximian.com>
7686         * class.cs (PartialContainer): New public class.
7687         (ClassPart): New public class.
7688         (TypeContainer): Added support for partial classes.
7689         (TypeContainer.GetClassBases): Splitted some of the functionality
7690         out into GetNormalBases() and GetPartialBases().
7692         * cs-tokenizer.cs (Token.PARTIAL): New token.
7693         (Tokenizer.consume_identifier): Added some hacks to recognize
7694         `partial', but only if it's immediately followed by `class',
7695         `struct' or `interface'.
7697         * cs-parser.jay: Added support for partial clases.
7699 2004-07-23  Martin Baulig  <martin@ximian.com>
7701         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7702         a `DeclSpace' and also made it readonly.
7703         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7704         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7705         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7707         * cs-parser.jay: Pass the `current_class', not the
7708         `current_container' (at the moment, this is still the same thing)
7709         to a new Method, Property, Event, Indexer or Constructor.
7711 2004-07-23  Martin Baulig  <martin@ximian.com>
7713         * cs-parser.jay (CSharpParser): Added a new `current_class' field
7714         and removed the `current_interface' one.
7715         (struct_declaration, class_declaration, interface_declaration):
7716         Set `current_class' to the newly created class/struct/interface;
7717         set their `Bases' and call Register() before parsing their body.
7719 2004-07-23  Martin Baulig  <martin@ximian.com>
7721         * class.cs (Kind): New public enum.
7722         (TypeContainer): Made this class abstract.
7723         (TypeContainer.Kind): New public readonly field.
7724         (TypeContainer.CheckDef): New public method; moved here from
7725         cs-parser.jay.
7726         (TypeContainer.Register): New public abstract method.
7727         (TypeContainer.GetPendingImplementations): New public abstract
7728         method.
7729         (TypeContainer.GetClassBases): Removed the `is_class' and
7730         `is_iface' parameters.
7731         (TypeContainer.DefineNestedTypes): Formerly known as
7732         DoDefineType().
7733         (ClassOrStruct): Made this class abstract.
7735         * tree.cs (RootTypes): New public type. 
7737 2004-07-20  Martin Baulig  <martin@ximian.com>
7739         * tree.cs (Tree.RecordNamespace): Removed.
7740         (Tree.Namespaces): Removed.
7742         * rootcontext.cs (RootContext.IsNamespace): Removed.
7744         * cs-parser.jay (namespace_declaration): Just create a new
7745         NamespaceEntry here.
7747 2004-07-20  Martin Baulig  <martin@ximian.com>
7749         * statement.cs (ExceptionStatement): New abstract class.  This is
7750         now used as a base class for everyone who's using `finally'.
7751         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
7752         our local variables before using them.
7754         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
7755         virtual method.  This is used by Yield.Resolve() to "steal" an
7756         outer block's `finally' clauses.
7757         (FlowBranchingException): The .ctor now takes an ExceptionStatement
7758         argument.
7760         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
7761         version which takes an ExceptionStatement.  This version must be
7762         used to create exception branchings.
7764         * iterator.cs
7765         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
7766         (Iterator.EmitMoveNext): Added exception support; protect the
7767         block with a `fault' clause, properly handle 'finally' clauses.
7768         (Iterator.EmitDispose): Run all the `finally' clauses here.
7770 2004-07-20  Martin Baulig  <martin@ximian.com>
7772         * iterator.cs: This is the first of a set of changes in the
7773         iterator code.  Match the spec more closely: if we're an
7774         IEnumerable, then GetEnumerator() must be called.  The first time
7775         GetEnumerator() is called, it returns the current instance; all
7776         subsequent invocations (if any) must create a copy.
7778 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
7780         * expression.cs: Resolve the constant expression before returning
7781         it. 
7783 2004-07-19  Martin Baulig  <martin@ximian.com>
7785         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
7786         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
7787         the return type of the new EmitContext.
7789 2004-07-18  Martin Baulig  <martin@ximian.com>
7791         * class.cs (Property.Define): Fix iterators.
7793         * iterators.cs (Iterator.Define): Moved the
7794         `container.AddInterator (this)' call here from the .ctor; only do
7795         it if we resolved successfully.
7797 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
7799         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
7800         `true' for preprocessing directives that we parse.  The return
7801         value indicates whether we should return to regular tokenizing or
7802         not, not whether it was parsed successfully.
7804         In the past if we were in: #if false ... #line #endif, we would
7805         resume parsing after `#line'.  See bug 61604.
7807         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
7808         building: IsEnumType should return true only for enums, not for
7809         enums or System.Enum itself.  This fixes #61593.
7811         Likely what happened is that corlib was wrong: mcs depended on
7812         this bug in some places.  The bug got fixed, we had to add the
7813         hack, which caused bug 61593.
7815         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
7816         that was a workaround for the older conditions.
7818 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
7820         * assign.cs: IAssignMethod has a new interface, as documented
7821         inline. All assignment code now uses this new api.
7823         * ecore.cs, expression.cs: All classes which implement
7824         IAssignMethod now use the new interface.
7826         * expression.cs (Invocation): add a hack to EmitCall so that
7827         IndexerAccess can be the target of a compound assignment without
7828         evaluating its arguments twice.
7830         * statement.cs: Handle changes in Invocation api.
7832 2004-07-16  Martin Baulig  <martin@ximian.com>
7834         * iterators.cs: Rewrote this.  We're now using one single Proxy
7835         class for both the IEnumerable and the IEnumerator interface and
7836         `Iterator' derives from Class so we can use the high-level API.
7838         * class.cs (TypeContainer.AddIterator): New method.
7839         (TypeContainer.DoDefineType): New protected virtual method, which
7840         is called from DefineType().
7841         (TypeContainer.DoDefineMembers): Call DefineType() and
7842         DefineMembers() on all our iterators.
7843         (TypeContainer.Emit): Call Emit() on all our iterators.
7844         (TypeContainer.CloseType): Call CloseType() on all our iterators.
7846         * codegen.cs (EmitContext.CurrentIterator): New public field.
7848 2004-07-15  Martin Baulig  <martin@ximian.com>
7850         * typemanager.cs
7851         (TypeManager.not_supported_exception_type): New type.   
7853 2004-07-14  Martin Baulig  <martin@ximian.com>
7855         * iterators.cs: Use real error numbers.
7857 2004-07-14  Martin Baulig  <martin@ximian.com>
7859         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7860         requires this to be a System.Collection.IEnumerable and not a
7861         class implementing that interface.
7862         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
7864 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
7866         * class.cs: Fixed previous fix, it broke some error tests.
7868 2004-07-12  Martin Baulig  <martin@ximian.com>
7870         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7871         Fixes #61293.
7873 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
7875         * assign.cs (LocalTemporary): Add new argument: is_address,If
7876         `is_address' is true, then the value that we store is the address
7877         to the real value, and not the value itself.
7878         
7879         * ecore.cs (PropertyExpr): use the new local temporary
7880         stuff to allow us to handle X.Y += z (where X is a struct)
7882 2004-07-08  Martin Baulig  <martin@ximian.com>
7884         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7885         not always return, just like we're doing in Using.Resolve().
7887 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
7889         * cs-parser.jay (fixed_statement): flag this as Pinned.
7891 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
7893         * typemanager.cs (TypeManager): Removed MakePinned method, this
7894         mechanism is replaced with the .NET 2.x compatible mechanism of
7895         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7897         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
7898         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7899         `IsFixed' property which has a different meaning.
7901 2004-07-02  Raja R Harinath  <rharinath@novell.com>
7903         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7904         visible from inside a nested class, not just the names of the
7905         immediately enclosing class.
7906         Fix for bug #60730.
7908 2004-06-24  Raja R Harinath  <rharinath@novell.com>
7910         * expression.cs (BetterConversion): Remove buggy special-case
7911         handling of "implicit constant expression conversions".  At this
7912         point, we already know that the conversion is possible -- we're
7913         only checking to see which is better.
7915 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7917         * cs-parser.jay: Added error CS0210 test.
7919 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7921         * cs-parser.jay: Added error CS0134 test.
7923 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7925         Fix bug #52507
7926         * cs-parser.jay: Added error CS0145 test.
7928 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7930         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7932 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
7933         
7934         * expression.cs (StackAlloc.Resolve): The argument may not
7935         be a constant; deal with this case.
7936         
7937 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
7939         * attribute.cs (IndexerName_GetIndexerName): Renamed to
7940         GetIndexerAttributeValue.
7941         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7943         * class.cs (Indexer.Define): Added error tests for CS0415,
7944         CS0609.
7946 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
7948         * attribute.cs (Attribute.Resolve): Keep field code in sync with
7949         property code.
7951 2004-06-23  Martin Baulig  <martin@ximian.com>
7953         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7954         neither return nor throw, reset the barrier as well.  Fixes #60457.
7956 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
7958         * class.cs : EventAttributes is now set to None by default.
7959           This fixes bug #60459.
7961 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7963         Fix bug #60219
7964         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7965         Don't throw exception but return null (it's sufficient now).
7967 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7969         * typemanager.cs (GetArgumentTypes): Faster implementation.
7971 2004-06-18  Martin Baulig  <martin@ximian.com>
7973         * attribute.cs (Attribute.Resolve): Check whether we're an
7974         EmptyCast which a Constant child.  Fixes #60333.
7976 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
7978         * statement.cs (EmitCollectionForeach): Account for the fact that
7979         not all valuetypes are in areas which we can take the address of.
7980         For these variables, we store to a temporary variable. Also, make
7981         sure that we dont emit a `callvirt' on a valuetype method.
7983 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7985         * expression.cs (StackAlloc.DoReSolve): Added test for
7986         negative parameter (CS0247).
7988 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7990         Fix bug #59792
7991         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7993 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7995         Fix bug #59781
7996         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7997         ulong.
7999 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8001         Fix bug #58254 & cs1555.cs, cs1556.cs
8002         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8004 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8006         * cs-parser.jay: Added error CS1669 test for indexers.
8008 2004-06-11  Martin Baulig  <martin@ximian.com>
8010         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8011         call this twice: for params and varargs methods.
8013 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8015         * class.cs:
8016         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8018 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8020         * attribute.cs (Attribute.GetValidTargets): Made public.
8022         * class.cs: 
8023         (AbstractPropertyEventMethod): New class for better code sharing.
8024         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8025         CS1667 report.
8026         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8028 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8030         Fix bug #59477.
8031         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8032         that the call to Resolve is part of a MemberAccess.
8033         (Expression.Resolve): Use it for SimpleName resolution.
8034         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8035         Add 'intermediate' boolean argument.
8036         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8037         error message when the SimpleName can be resolved ambiguously
8038         between an expression and a type.
8039         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8040         public.
8041         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8042         call on the left-side.
8044 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8046         * class.cs:
8047         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8049 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8051         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8053 2004-06-11  Martin Baulig  <martin@ximian.com>
8055         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8056         varargs methods if applicable.
8058 2004-06-11  Martin Baulig  <martin@ximian.com>
8060         * expression.cs (Invocation.EmitCall): Don't use
8061         `method.CallingConvention == CallingConventions.VarArgs' since the
8062         method could also have `CallingConventions.HasThis'.
8064 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8066         * class.cs (Event.GetSignatureForError): Implemented.
8067         Fixed crash in error test cs3010.cs
8069 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8071         * cs-tokenizer.cs: Change the way we track __arglist to be
8072         consistent with the other keywords.
8074 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8076         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8077         tomorrow.
8079 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8081         * codegen.cs: Check that all referenced assemblies have a strongname
8082         before strongnaming the compiled assembly. If not report error CS1577.
8083         Fix bug #56563. Patch by Jackson Harper.
8084         * typemanager.cs: Added a method to return all referenced assemblies.
8085         Fix bug #56563. Patch by Jackson Harper.
8087 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8089         * class.cs:
8090         (Method.ApplyAttributeBuilder): Moved and added conditional
8091         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8093         * delegate.cs:
8094         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8096 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8098         Fixed #59640
8099         * class.cs: (EventField.attribute_targets): Changed default target.
8101 2004-06-08  Martin Baulig  <martin@ximian.com>
8103         * expression.cs (Invocation.EmitCall): Enable varargs methods.
8105 2004-06-08  Martin Baulig  <martin@ximian.com>
8107         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8109 2004-06-07  Martin Baulig  <martin@ximian.com>
8111         Added support for varargs methods.
8113         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8114         keyword.
8116         * cs-parser.jay: Added support for `__arglist'.
8118         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8120         * expression.cs (Argument.AType): Added `ArgList'.
8121         (Invocation): Added support for varargs methods.
8122         (ArglistAccess): New public class.
8123         (Arglist): New public class.
8125         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8127         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8128         a method's top-level block if the method has varargs.
8130         * support.cs (ReflectionParameters, InternalParameters): Added
8131         support for varargs methods.    
8133 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8135         * class.cs: Provide location in indexer error report.
8137         * driver.cs: Use standard names.
8139         * namespace.cs: Catch the use of using after a namespace has been
8140         declared also on using aliases.
8142 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8144         Bug #50820.
8145         * typemanager.cs (closure_private_ok, closure_invocation_type)
8146         (closure_qualifier_type, closure_invocation_assembly)
8147         (FilterWithClosure): Move to ...
8148         (Closure): New internal nested class.
8149         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8150         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8151         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8152         (MemberLookup, MemberLookupFailed): Use it.
8153         * expression.cs (New.DoResolve): Treat the lookup for the
8154         constructor as being qualified by the 'new'ed type.
8155         (Indexers.GetIndexersForTypeOrInterface): Update.
8157 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8159         * attribute.cs
8160         (GetConditionalAttributeValue): New method. Returns
8161         condition of ConditionalAttribute.
8162         (SearchMulti): New method.  Returns all attributes of type 't'.
8163         Use it when attribute is AllowMultiple = true.
8164         (IsConditionalMethodExcluded): New method.
8166         * class.cs
8167         (Method.IsExcluded): Implemented. Returns true if method has conditional
8168         attribute and the conditions is not defined (method is excluded).
8169         (IMethodData): Extended interface for ConditionalAttribute support.
8170         (PropertyMethod.IsExcluded): Implemented.
8172         * decl.cs
8173         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8175         * expression.cs
8176         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8177         on the method.
8179 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8181         * expression.cs (ArrayCreationExpression): Make this just an
8182         `expression'. It can't be a statement, so the code here was
8183         dead.
8185 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8187         Fixed #59072
8188         * typemanager.cs (GetFullNameSignature): New method for
8189         MethodBase types.
8191 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8193         Fixed #56452
8194         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8195         Use this method when MethodBuilder is null.
8196         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8197         Added test for error CS0626 (MONO reports error for this situation).
8198         (IMethodData.GetSignatureForError): Extended interface.
8200 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8202         * attribute.cs
8203         (AttributeTester.GetObsoleteAttribute): Returns instance of
8204         ObsoleteAttribute when type is obsolete.
8206         * class.cs
8207         (TypeContainer.VerifyObsoleteAttribute): Override.
8208         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8209         (MethodCode.VerifyObsoleteAttribute): Override.
8210         (MemberBase.VerifyObsoleteAttribute): Override.
8212         * decl.cs
8213         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8214         and report proper error.
8216         *delegate.cs
8217         Delegate.VerifyObsoleteAttribute): Override.
8219         * ecore.cs
8220         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8221         and report proper error.
8222         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8224         * enum.cs
8225         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8226         and enum member.
8228         * expression.cs
8229         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8230         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8231         Added test for ObsoleteAttribute.
8233         * statement.cs
8234         (Catch): Derived from Statement.
8236 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8238         Fixed bug #59071 & cs0160.cs
8240         * statement.cs (Try.Resolve): Check here whether order of catch
8241         clauses matches their dependencies.
8243 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8245         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8246         caused a regression: #59343.  Referencing nested classes from an
8247         assembly stopped working.
8249 2004-05-31  Martin Baulig  <martin@ximian.com>
8251         MCS is now frozen for beta 2.
8253 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8255         * convert.cs: add a trivial cache for overload operator resolution.
8257 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8259         * decl.cs: If possible, use lookuptypedirect here. We can only do
8260         this if there is no `.' after the namespace. Avoids using
8261         LookupType, which does lots of slow processing.
8262         (FindNestedType) New method, does what it says :-).
8263         * namespace.cs: use LookupTypeDirect.
8264         * rootcontext.cs: use membercache, if possible.
8265         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8267 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8269         * expression.cs:
8270         According to the spec, 
8272         In a member access of the form E.I, if E is a single identifier,
8273         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8274         field, property, localvariable, or parameter with the same type as
8275         the meaning of E as a type-name (§3.8), then both possible
8276         meanings of E are permitted.
8278         We did not check that E as a simple-name had the same type as E as
8279         a type name.
8281         This trivial check gives us 5-7% on bootstrap time.
8283 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8285         * expression.cs (Invocation.OverloadResolve): Avoid the
8286         use of hashtables and boxing here by allocating on demand.
8288 2004-05-30  Martin Baulig  <martin@ximian.com>
8290         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8291         we're doing a silent lookup.  Don't try to lookup nested types in
8292         TypeManager.object_type (thanks to Ben Maurer).
8294 2004-05-30  Martin Baulig  <martin@ximian.com>
8296         Committing a patch from Ben Maurer.
8298         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8300 2004-05-29  Martin Baulig  <martin@ximian.com>
8302         * class.cs (IMethodData.ShouldIgnore): New method.
8304         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8305         `Location' argument, we don't need it anywhere.  Use
8306         `IMethodData.ShouldIgnore ()' instead of
8307         `MethodData.GetMethodFlags ()'.
8308         (TypeManager.AddMethod): Removed.
8309         (TypeManager.AddMethod2): Renamed to AddMethod.
8311 2004-05-29  Martin Baulig  <martin@ximian.com>
8313         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8315         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8316         converting from a class type S to an interface type and we already
8317         have an object on the stack, don't box it again.  Fixes #52578.
8319 2004-05-29  Martin Baulig  <martin@ximian.com>
8321         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8322         Added support for `params' parameters.  Fixes #59267.
8324 2004-05-29  Martin Baulig  <martin@ximian.com>
8326         * literal.cs (NullPointer): Provide a private .ctor which sets
8327         `type' to TypeManager.object_type.  Fixes #59048.
8329 2004-05-29  Martin Baulig  <martin@ximian.com>
8331         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8332         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8334         * ecore.cs (EventExpr.instance_expr): Make the field private.
8336 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8338         Fixed bug #50080 & cs0214-2.cs
8339         * expression.cs (Cast.DoResolve): Check unsafe context here.
8340         
8341         * statement.cs (Resolve.DoResolve): Likewise.
8343 2004-05-26  Martin Baulig  <martin@ximian.com>
8345         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8347         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8348         (RootContext.LookupType): Pass down the `silent' flag.
8350 2004-05-25  Martin Baulig  <martin@ximian.com>
8352         * expression.cs
8353         (MethodGroupExpr.IdenticalTypeName): New public property.
8354         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8355         expression actually refers to a type.
8357 2004-05-25  Martin Baulig  <martin@ximian.com>
8359         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8360         for #56176 and made it actually work.
8362 2004-05-25  Martin Baulig  <martin@ximian.com>
8364         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8365         (FieldExpr, PropertyExpr): Override and implement
8366         CacheTemporaries.  Fixes #52279.
8368 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8370         * location.cs: In the new compiler listing a file twice is a
8371         warning, not an error.
8373 2004-05-24  Martin Baulig  <martin@ximian.com>
8375         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8376         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8378 2004-05-24  Martin Baulig  <martin@ximian.com>
8380         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8381         walking the `using' list.  Fixes #53921.
8383 2004-05-24  Martin Baulig  <martin@ximian.com>
8385         * const.cs (Const.LookupConstantValue): Added support for
8386         EmptyCast's; fixes #55251.
8388 2004-05-24  Martin Baulig  <martin@ximian.com>
8390         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8391         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8392         which does the CS0135 check.  The reason is that we first need to
8393         check whether the variable actually exists.
8395 2004-05-24  Martin Baulig  <martin@ximian.com>
8397         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8398         than RootContext.LookupType() to find the explicit interface
8399         type.  Fixes #58584.
8401 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8403         * Makefile: Simplify.  Use executable.make.
8404         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8406 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8408         * decl.cs:
8409         * enum.cs:
8410         Use the invariant culture when doing String.Compare for CLS case
8411         sensitivity.
8412         
8413 2004-05-23  Martin Baulig  <martin@ximian.com>
8415         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8416         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8418         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8419         
8420 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8422         * class.cs (MemberBase.Define): Reuse MemberType member for 
8423         resolved type. Other methods can use it too.
8425 2004-05-23  Martin Baulig  <martin@ximian.com>
8427         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8428         the variable also exists in the current block (otherwise, we need
8429         to report a CS0103).  Fixes #58670.
8431 2004-05-23  Martin Baulig  <martin@ximian.com>
8433         * flowanalysis.cs (Reachability.Reachable): Compute this
8434         on-the-fly rather than storing it as a field.
8436 2004-05-23  Martin Baulig  <martin@ximian.com>
8438         * flowanalysis.cs (Reachability.And): Manually compute the
8439         resulting `barrier' from the reachability.      
8440        
8441 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8443         Fix bug #57835
8444         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8445         instance of ObsoleteAttribute when symbol is obsolete.
8447         * class.cs
8448         (IMethodData): Extended interface for ObsoleteAttribute support.
8450 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8452         * attribute.cs: Fix bug #55970
8454 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8456         Fix bug #52705
8457         * attribute.cs
8458         (GetObsoleteAttribute): New method. Creates the instance of
8459         ObsoleteAttribute.
8460         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8461         ObsoleteAttribute when member is obsolete.
8462         (AttributeTester.Report_ObsoleteMessage): Common method for
8463         Obsolete error/warning reporting.
8465         * class.cs
8466         (TypeContainer.base_classs_type): New member for storing parent type.
8468         * decl.cs
8469         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8470         for this MemberCore.
8472 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8474         * attribute.cs, const.cs: Fix bug #58590
8476 2004-05-21  Martin Baulig  <martin@ximian.com>
8478         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8479         out parameters if the end of the method is unreachable.  Fixes
8480         #58098. 
8482 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8484         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8485         Hari was right, why extra method.
8487 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8489         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8491 2004-05-20  Martin Baulig  <martin@ximian.com>
8493         Merged this back from gmcs to keep the differences to a minumum.
8495         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8496         instead of a Declspace.
8497         (Attribute.ResolveType): Likewise.
8498         (Attributes.Search): Likewise.
8499         (Attributes.Contains): Likewise.
8500         (Attributes.GetClsCompliantAttribute): Likewise.
8502         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8503         argument.
8504         (MethodData.ApplyAttributes): Take an EmitContext instead of a
8505         DeclSpace.
8507 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8509         Fix bug #58688 (MCS does not report error when the same attribute
8510         is assigned twice)
8512         * attribute.cs (Attribute.Emit): Distinction between null and default.
8514 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8516         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8517         of a top-level attribute without an attribute target.
8518         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8519         Make non-static.
8520         (Attribute.Conditional_GetConditionName), 
8521         (Attribute.Obsolete_GetObsoleteMessage): Update.
8522         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8523         part of ScanForIndexerName.
8524         (Attribute.CanIgnoreInvalidAttribute): New function.
8525         (Attribute.ScanForIndexerName): Move to ...
8526         (Attributes.ScanForIndexerName): ... here.
8527         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8528         (Attributes.Search): New internal variant that can choose not to
8529         complain if types aren't resolved.  The original signature now
8530         complains.
8531         (Attributes.GetClsCompliantAttribute): Use internal variant, with
8532         complaints suppressed.
8533         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8534         only if it not useful.
8535         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8536         top-level for attributes that are shared between the assembly
8537         and a top-level class.
8538         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8539         * class.cs: Update to reflect changes.
8540         (DefineIndexers): Fuse loops.
8541         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8542         a couple more variants of attribute names.
8544 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8546         Fix bug #52585 (Implemented explicit attribute declaration)
8548         * attribute.cs:
8549         (Attributable.ValidAttributeTargets): New abstract method. It gets
8550         list of valid attribute targets for explicit target declaration.
8551         (Attribute.Target): It holds target itself.
8552         (AttributeSection): Removed.
8553         (Attribute.CheckTargets): New method. It checks whether attribute
8554         target is valid for the current element.
8556         * class.cs:
8557         (EventProperty): New class. For events that are declared like
8558         property (with add and remove accessors).
8559         (EventField): New class. For events that are declared like field.
8560         class.cs
8562         * cs-parser.jay: Implemented explicit attribute target declaration.
8564         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8565         Override ValidAttributeTargets.
8567         * parameter.cs:
8568         (ReturnParameter): Class for applying custom attributes on 
8569         the return type.
8570         (ParameterAtribute): New class. Class for applying custom
8571         attributes on the parameter type.
8573 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8575         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8576         definitions. 
8578         (Method): Allow UNSAFE here.
8580         * modifiers.cs: Support unsafe reporting.
8582 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8584         * decl.cs: Fix bug #58478.
8586 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8588         * statement.cs: When checking for unreachable code on an EmptyStatement,
8589         set the location. Fixes bug #58488.
8591 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8593         * driver.cs: Add -pkg handling.
8595         From Gonzalo: UseShelLExecute=false
8597 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8599         * attribute.cs:
8600         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8601         for attribute.
8602         (Attribute.IsClsCompliaceRequired): Moved to base for better
8603         accesibility.
8604         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8605         when attribute is AttributeUsageAttribute.
8606         (Attribute.GetValidTargets): Simplified.
8607         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8608         attribute for this type.
8609         (Attribute.ApplyAttributes): Method renamed to Emit and make
8610         non-static.
8611         (GlobalAttributeSection): New class for special handling of global
8612         attributes (assembly, module).
8613         (AttributeSection.Emit): New method.
8615         * class.cs: Implemented Attributable abstract methods.
8616         (MethodCore.LabelParameters): Moved to Parameter class.
8617         (Accessor): Is back simple class.
8618         (PropertyMethod): Implemented Attributable abstract class.
8619         (DelegateMethod): Implemented Attributable abstract class.
8620         (Event): New constructor for disctintion between normal Event
8621         and Event with accessors.
8623         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8625         * codegen.cs, const.cs, decl.cs, delegate.cs:
8626         (CommonAssemblyModulClass): Implemented Attributable abstract class
8627         and simplified.
8629         * enum.cs: Implement IAttributeSupport interface.
8630         (EnumMember): New class for emum members. Implemented Attributable
8631         abstract class
8633         * parameter.cs:
8634         (ParameterBase): Is abstract.
8635         (ReturnParameter): New class for easier [return:] attribute handling.
8637         * typemanager.cs: Removed builder_to_attr.
8639 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8641         Fix bug #57151.
8642         * attribute.cs (Attribute.GetPositionalValue): New function.
8643         * class.cs (TypeContainer.VerifyMembers): New function.
8644         (TypeContainer.Emit): Use it.
8645         (ClassOrStruct): New base class for Class and Struct.
8646         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8647         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8648         class.
8649         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8650         then each non-static field should have a FieldOffset attribute.
8651         Otherwise, none of the fields should have a FieldOffset attribute.
8652         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8653         and FieldOffset attributes.
8654         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8655         (TypeManager.field_offset_attribute_type): New core types.
8656         (TypeManager.InitCoreTypes): Initialize them.
8658 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8660         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8661         Return correct type.
8662         From bug #58270.
8664 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8666         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8667         be implicitly converted to ulong.
8668         
8669         * expression.cs: The logic for allowing operator &, | and ^ worked
8670         was wrong, it worked before because we did not report an error in
8671         an else branch.  Fixes 57895.
8673         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8674         allow volatile fields to be reference types.
8676 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8678         * driver.cs: Add support for /debug-
8680 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8682         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8683         Add a 'complain' parameter to silence errors.
8684         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8685         silently overlooked type-resolutions.
8686         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8687         to reflect changes.
8688         (Attributes.Search): New function.
8689         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8690         (Attributes.GetAttributeFullName): Remove hack.
8691         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
8692         Update to reflect changes.
8693         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8694         Use Attributes.Search instead of nested loops.
8696 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
8698         * decl.cs:
8699         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8700         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8701         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8703         * report.cs: (Report.Warning): Renamed to Warning_T because of
8704         parameter collision.
8706 2004-05-05  Raja R Harinath  <rharinath@novell.com>
8708         * expression.cs (MemberAccess.ResolveMemberAccess):
8709         Exit with non-zero status after Report.Error.
8710         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8711         Likewise.
8712         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8714 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8716         * support.cs: Don't hang when the file is empty.
8718 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8720         * support.cs: In SeekableStreamReader, compute the preamble size of the
8721           underlying stream. Position changes should take into account that initial
8722           count of bytes.
8724 2004-05-03  Todd Berman  <tberman@sevenl.net>
8726         * driver.cs: remove unused GetSysVersion function.
8728 2004-05-03  Todd Berman  <tberman@sevenl.net>
8730         * driver.cs: Remove the hack from saturday, as well as the hack
8731         from jackson (LoadAssemblyFromGac), also adds the CWD to the
8732         link_paths to get that bit proper.
8734 2004-05-01  Todd Berman  <tberman@sevenl.net>
8736         * driver.cs: Try a LoadFrom before a Load, this checks the current
8737         path. This is currently a bug in mono that is be fixed, however, this
8738         provides a workaround for now. This will be removed when the bug
8739         is fixed.
8741 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
8743         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8744         incomplete key pairs (#57941).
8746 2004-05-01  Todd Berman  <tberman@sevenl.net>
8748         * driver.cs: Remove '.' from path_chars, now System.* loads properly
8749         from the GAC
8751 2004-04-30  Jackson Harper  <jackson@ximian.com>
8753         * codegen.cs: Open keys readonly.
8754         
8755 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8757         * typemanager.cs: don't report cyclic struct layout when a struct
8758         contains 2 or more fields of the same type. Failed for Pango.AttrShape
8759         which has 2 Pango.Rectangle fields.
8761 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8763         * expression.cs: Handle IntPtr comparisons with IL code
8764         rather than a method call.
8766 2004-04-29  Martin Baulig  <martin@ximian.com>
8768         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
8769         the list of PropertyInfo's in class hierarchy and find the
8770         accessor.  Fixes #56013.
8772 2004-04-29  Martin Baulig  <martin@ximian.com>
8774         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8776 2004-04-29  Martin Baulig  <martin@ximian.com>
8778         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8780         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8782 2004-04-29  Martin Baulig  <martin@ximian.com>
8784         * class.cs (ConstructorInitializer.Resolve): Check whether the
8785         parent .ctor is accessible.  Fixes #52146.
8787 2004-04-29  Martin Baulig  <martin@ximian.com>
8789         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8791         * statement.cs (Using.EmitLocalVariableDecls): Use
8792         TypeManager.idisposable_type, not typeof (IDisposable).
8793         (Foreach.EmitCollectionForeach): Added support for valuetypes.
8795 2004-04-29  Martin Baulig  <martin@ximian.com>
8797         * class.cs (Event.Define): Don't emit the field and don't set
8798         RTSpecialName and SpecialName for events on interfaces.  Fixes
8799         #57703. 
8801 2004-04-29  Raja R Harinath  <rharinath@novell.com>
8803         Refactor Attribute.ApplyAttributes.
8804         * attribute.cs (Attributable): New base class for objects that can
8805         have Attributes applied on them.
8806         (Attribute): Make AttributeUsage fields public.
8807         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8808         (Attribute.IsInternalCall): New property.
8809         (Attribute.UsageAttr): Convert to a public read-only property.
8810         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8811         (Attribute.ResolveType, Attribute.Resolve)
8812         (Attribute.ScanForIndexerName): Update to reflect changes.
8813         (Attribute.CheckAttributeTarget): Re-format.
8814         (Attribute.ApplyAttributes): Refactor, to various
8815         Attributable.ApplyAttributeBuilder methods.
8816         * decl.cs (MemberCore): Make Attributable.
8817         * class.cs (Accessor): Make Attributable.
8818         (MethodData.ApplyAttributes): Use proper attribute types, not
8819         attribute names.
8820         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8821         (TypeContainer.ApplyAttributeBuilder)
8822         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8823         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
8824         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8825         (Operator.ApplyAttributeBuilder): New factored-out methods.
8826         * const.cs (Const.ApplyAttributeBuilder): Likewise.
8827         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8828         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8829         * parameter.cs (ParameterBase): New Attributable base class
8830         that can also represent Return types.
8831         (Parameter): Update to the changes.
8833 2004-04-29  Jackson Harper  <jackson@ximian.com>
8835         * driver.cs: Prefer the corlib system version when looking for
8836         assemblies in the GAC. This is still a hack, but its a better hack
8837         now.
8838         
8839 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
8841         * decl.cs, enum.cs: Improved error 3005 reporting.
8842   
8843         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8844         (related_symbols): New private member for list of symbols
8845         related to reported error/warning.
8846         
8847         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8849 2004-04-29  Martin Baulig  <martin@ximian.com>
8851         * ecore.cs (Expression.Constantify): If we're an enum and
8852         TypeManager.TypeToCoreType() doesn't give us another type, use
8853         t.UnderlyingSystemType.  Fixes #56178.  
8855 2004-04-29  Martin Baulig  <martin@ximian.com>
8857         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8858         interfaces and for each interface, only add members directly
8859         declared in that interface.  Fixes #53255.
8861 2004-04-28  Martin Baulig  <martin@ximian.com>
8863         * expression.cs (ConditionalLogicalOperator): Use a temporary
8864         variable for `left' to avoid that we evaluate it more than once;
8865         bug #52588.
8867 2004-04-28  Martin Baulig  <martin@ximian.com>
8869         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8870         `void[]' (CS1547).
8872 2004-04-28  Martin Baulig  <martin@ximian.com>
8874         * statement.cs (LocalInfo.Resolve): Check whether the type is not
8875         void (CS1547).
8877         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8878         whether the type is not void (CS1547).
8880 2004-04-28  Martin Baulig  <martin@ximian.com>
8882         * expression.cs (Unary.DoResolveLValue): Override this and report
8883         CS0131 for anything but Operator.Indirection.
8885 2004-04-28  Martin Baulig  <martin@ximian.com>
8887         Committing a patch from Ben Maurer; see bug #50820.
8889         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8890         check for classes.
8892         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8893         classes.        
8895 2004-04-28  Martin Baulig  <martin@ximian.com>
8897         Committing a patch from Ben Maurer; see bug #50820.
8899         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8900         check for classes.
8902         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8903         classes.        
8905 2004-04-28  Martin Baulig  <martin@ximian.com>
8907         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8908         (Block.AddLabel): Call DoLookupLabel() to only search in the
8909         current block.
8911 2004-04-28  Martin Baulig  <martin@ximian.com>
8913         * cfold.cs (ConstantFold.BinaryFold): Added special support for
8914         comparing StringConstants and NullLiterals in Equality and Inequality.
8916 2004-04-28  Jackson Harper  <jackson@ximian.com>
8918         * driver.cs: Attempt to load referenced assemblies from the
8919         GAC. This is the quick and dirty version of this method that
8920         doesnt take into account versions and just takes the first
8921         canidate found. Will be good enough for now as we will not have more
8922         then one version installed into the GAC until I update this method.
8924 2004-04-28  Martin Baulig  <martin@ximian.com>
8926         * typemanager.cs (TypeManager.CheckStructCycles): New public
8927         static method to check for cycles in the struct layout.
8929         * rootcontext.cs (RootContext.PopulateTypes): Call
8930         TypeManager.CheckStructCycles() for each TypeContainer.
8931         [Note: We only need to visit each type once.]
8933 2004-04-28  Martin Baulig  <martin@ximian.com>
8935         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8937         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8938         success and added `out object value'.  Use a `bool resolved' field
8939         to check whether we've already been called rather than
8940         `ConstantValue != null' since this breaks for NullLiterals.
8942 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8944         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8945         setting of this flag, since the 'set' method may be non-public.
8947 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8949         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8950         check on current_vector.Block.
8952 2004-04-27  Martin Baulig  <martin@ximian.com>
8954         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8955         a field initializer.  Fixes #56459.
8957 2004-04-27  Martin Baulig  <martin@ximian.com>
8959         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8960         we're not attempting to use an indexer.  Fixes #52154.
8962 2004-04-27  Martin Baulig  <martin@ximian.com>
8964         * statement.cs (Return): Don't create a return label if we don't
8965         need it; reverts my change from January 20th.  Thanks to Ben
8966         Maurer for this.
8968 2004-04-27  Martin Baulig  <martin@ximian.com>
8970         According to the spec, `goto' can only leave a nested scope, but
8971         never enter it.
8973         * statement.cs (Block.LookupLabel): Only lookup in the current
8974         block, don't recurse into parent or child blocks.
8975         (Block.AddLabel): Check in parent and child blocks, report
8976         CS0140/CS0158 if we find a duplicate.
8977         (Block): Removed this indexer for label lookups.
8978         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8979         this already does the error reporting for us.
8981         * flowanalysis.cs
8982         (FlowBranching.UsageVector.Block): New public variable; may be null.
8983         (FlowBranching.CreateSibling): Added `Block' argument.
8984         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
8985         label for the target of a `goto' and check whether we're not
8986         leaving a `finally'.
8988 2004-04-27  Martin Baulig  <martin@ximian.com>
8990         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8991         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8992         just for returns).
8994 2004-04-27  Martin Baulig  <martin@ximian.com>
8996         * statement.cs (Block.AddLabel): Also check for implicit blocks
8997         and added a CS0158 check.
8999 2004-04-27  Martin Baulig  <martin@ximian.com>
9001         * flowanalysis.cs (FlowBranchingLoop): New class.
9002         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9003         UsageVector's instead of an ArrayList.
9004         (FlowBranching.Label): Likewise.
9005         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9006         (FlowBranching.AddBreakVector): New method.
9008 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9010         * attribute.cs: Small regression fix: only convert the type if we
9011         the type is different, fixes System.Drawing build.
9013 2004-04-27  Martin Baulig  <martin@ximian.com>
9015         * attribute.cs (Attribute.Resolve): If we have a constant value
9016         for a named field or property, implicity convert it to the correct
9017         type.
9019 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9021         * statement.cs (Block.Block): Implicit blocks share
9022         'child_variable_names' fields with parent blocks.
9023         (Block.AddChildVariableNames): Remove.
9024         (Block.AddVariable): Mark variable as "used by a child block" in
9025         every surrounding block.
9026         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9027         been used in a child block, complain about violation of "Invariant
9028         meaning in blocks" rule.
9029         * cs-parser.jay (declare_local_variables): Don't use
9030         AddChildVariableNames.
9031         (foreach_statement): Don't create an implicit block: 'foreach'
9032         introduces a scope.
9034 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9036         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9037         converting from 0L to ulong.  Fixes 57522.
9039 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9041         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9042         derived class hides via 'new' keyword field from base class (test-242.cs).
9043         TODO: Handle this in the more general way.
9044         
9045         * class.cs (CheckBase): Ditto.
9047 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9049         * decl.cs (caching_flags): New member for storing cached values
9050         as bit flags.
9051         (MemberCore.Flags): New enum where bit flags for caching_flags
9052         are defined.
9053         (MemberCore.cls_compliance): Moved to caching_flags.
9054         (DeclSpace.Created): Moved to caching_flags.
9056         * class.cs: Use caching_flags instead of DeclSpace.Created
9057         
9058 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9060         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9061         if we are only a derived class, not a nested class.
9063         * typemanager.cs: Same as above, but do this at the MemberLookup
9064         level (used by field and methods, properties are handled in
9065         PropertyExpr).   Allow for the qualified access if we are a nested
9066         method. 
9068 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9070         * class.cs: Refactoring.
9071         (IMethodData): New inteface; Holds links to parent members
9072         to avoid member duplication (reduced memory allocation).
9073         (Method): Implemented IMethodData interface.
9074         (PropertyBase): New inner classes for get/set methods.
9075         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9076         (Event): New inner classes for add/remove methods.
9077         (Event.DelegateMethod): Implemented IMethodData interface.
9079         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9080         EmitContext (related to class.cs refactoring).
9082 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9084         * delegate.cs (Delegate.VerifyApplicability): If the number of
9085         arguments are the same as the number of parameters, first try to
9086         verify applicability ignoring  any 'params' modifier on the last
9087         parameter.
9088         Fixes #56442.
9090 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9092         * class.cs (TypeContainer.AddIndexer): Use
9093         'ExplicitInterfaceName' to determine if interface name was
9094         explicitly specified.  'InterfaceType' is not initialized at this time.
9095         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9096         Indexers array is already in the required order.  Initialize
9097         'IndexerName' only if there are normal indexers.
9098         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9099         (TypeContainer.Emit): Emit DefaultMember attribute only if
9100         IndexerName is initialized.
9101         Fixes #56300.
9103 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9105         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9106         Fixes #57007
9108 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9110         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9111         attributes.
9112         Fix for #56456.
9114         * attribute.cs (Attribute.Resolve): Check for duplicate named
9115         attributes.
9116         Fix for #56463.
9118 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9120         * iterators.cs (MarkYield): track whether we are in an exception,
9121         and generate code accordingly.  Use a temporary value to store the
9122         result for our state.
9124         I had ignored a bit the interaction of try/catch with iterators
9125         since their behavior was not entirely obvious, but now it is
9126         possible to verify that our behavior is the same as MS .NET 2.0
9128         Fixes 54814
9130 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9132         * iterators.cs: Avoid creating temporaries if there is no work to
9133         do. 
9135         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9136         Enumerations, use TypeManager.EnumToUnderlying and call
9137         recursively. 
9139         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9140         bug #57013
9142         (This.Emit): Use EmitContext.EmitThis to emit our
9143         instance variable.
9145         (This.EmitAssign): Ditto.
9147         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9148         codepaths, we will move all the functionality into
9149         Mono.CSharp.This 
9151         (FieldExpr.EmitAssign): Ditto.
9153         This fixes several hidden bugs that I uncovered while doing a code
9154         review of this today.
9156         * codegen.cs (EmitThis): reworked so the semantics are more clear
9157         and also support value types "this" instances.
9159         * iterators.cs: Changed so that for iterators in value types, we
9160         do not pass the value type as a parameter.  
9162         Initialization of the enumerator helpers is now done in the caller
9163         instead of passing the parameters to the constructors and having
9164         the constructor set the fields.
9166         The fields have now `assembly' visibility instead of private.
9168 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9170         * expression.cs (Argument.Resolve): Check if fields passed as ref
9171         or out are contained in a MarshalByRefObject.
9173         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9174         another compiler type.
9176 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9178         * class.cs (Indexer.Define): use the new name checking method.
9179         Also, return false on an error.
9180         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9181         (is_identifier_[start/part]_character): make static.
9183 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9185         * expression.cs (Binary.ResolveOperator): Do no append strings
9186         twice: since we can be invoked more than once (array evaluation)
9187         on the same concatenation, take care of this here.  Based on a fix
9188         from Ben (bug #56454)
9190 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9192         * codegen.cs: Fix another case where CS1548 must be reported (when 
9193         delay-sign isn't specified and no private is available #56564). Fix
9194         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9195         error when MCS is used on the MS runtime and we need to delay-sign 
9196         (which seems unsupported by AssemblyBuilder - see #56621).
9198 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9200         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9201         (TypeManager.ComputeNamespaces): Faster implementation for
9202         Microsoft runtime.
9204         * compiler.csproj: Updated AssemblyName to mcs.
9206 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9208         * rootcontext.cs: Add new types to the boot resolution.
9210         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9211         MulticastDelegate is not allowed.
9213         * typemanager.cs: Add new types to lookup: System.TypedReference
9214         and ArgIterator.
9216         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9217         check for TypedReference or ArgIterator, they are not allowed. 
9219         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9220         makes us properly catch 1510 in some conditions (see bug 56016 for
9221         details). 
9223 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9225         * CryptoConvert.cs: update from corlib version
9226         with endian fixes.
9228 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9230         * class.cs (Indexer.Define): Check indexername declaration
9232 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9234         * attribute.cs (IsClsCompliant): Fixed problem with handling
9235         all three states (compliant, not-compliant, undetected).
9237 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9239         * attribute.cs (Attribute): Location is now public.
9240         (Resolve): Store resolved arguments (pos_values) in attribute class.
9241         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9242         (GetClsCompliantAttributeValue): New method that gets
9243         CLSCompliantAttribute value.
9244         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9245         if exists else null.
9246         (AttributeTester): New class for CLS-Compliant verification routines.
9248         * class.cs (Emit): Add CLS-Compliant verification.
9249         (Method.GetSignatureForError): Implemented.
9250         (Constructor.GetSignatureForError): Implemented
9251         (Constructor.HasCompliantArgs): Returns if constructor has
9252         CLS-Compliant arguments.
9253         (Constructor.Emit): Override.
9254         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9255         is needed to test only parameters.
9256         (FieldBase.GetSignatureForError): Implemented.
9257         (TypeContainer): New member for storing base interfaces.
9258         (TypeContainer.FindMembers): Search in base interfaces too.
9260         * codegen.cs (GetClsComplianceAttribute): New method that gets
9261         assembly or module CLSCompliantAttribute value.
9262         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9263         for assembly.
9264         (ModuleClass.Emit): Add error 3012 test.
9266         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9268         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9269         state for all decl types.
9270         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9271         if CLS-Compliant tests are required.
9272         (IsClsCompliaceRequired): New method. Analyze whether code
9273         must be CLS-Compliant.
9274         (IsExposedFromAssembly): New method. Returns true when MemberCore
9275         is exposed from assembly.
9276         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9277         value or gets cached value.
9278         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9279         is explicitly marked with CLSCompliantAttribute.
9280         (IsIdentifierClsCompliant): New abstract method. This method is
9281         used to testing error 3005.
9282         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9283         for identifier and parameters CLS-Compliant testing.
9284         (VerifyClsCompliance): New method. The main virtual method for
9285         CLS-Compliant verifications.
9286         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9287         null. I don't know why is null (too many public members !).
9288         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9289         and get value of first CLSCompliantAttribute that found.
9291         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9292         (VerifyClsCompliance): Override and add extra tests.
9294         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9295         clscheck- disable CLS-Compliant verification event if assembly is has
9296         CLSCompliantAttribute(true).
9298         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9299         ApllyAttribute is now called in emit section as in the other cases.
9300         Possible future Emit integration.
9301         (IsIdentifierClsCompliant): New override.
9302         (VerifyClsCompliance): New override.
9303         (GetEnumeratorName): Returns full enum name.
9305         * parameter.cs (GetSignatureForError): Implemented.
9307         * report.cs (WarningData): New struct for Warning message information.
9308         (LocationOfPreviousError): New method.
9309         (Warning): New method. Reports warning based on the warning table.
9310         (Error_T): New method. Reports error based on the error table.
9312         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9313         verifications are done here.
9315         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9317         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9318         CLSCompliantAttribute.
9319         (all_imported_types): New member holds all imported types from other
9320         assemblies.
9321         (LoadAllImportedTypes): New method fills static table with exported types
9322         from all referenced assemblies.
9323         (Modules): New property returns all assembly modules.
9325 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9327         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9328         throwing a parser error.
9330         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9331         which removes the hardcoded get_/set_ prefixes for properties, as
9332         IL allows for the properties to be named something else.  
9334         Bug #56013
9336         * expression.cs: Do not override operand before we know if it is
9337         non-null.  Fix 56207
9339 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9341         * typemanager.cs: support for pinned variables.
9343 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9345         * decl.cs, typemanager.cs: Avoid using an arraylist
9346         as a buffer if there is only one result set.
9348 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9350         * expression.cs: Make sure you cant call a static method
9351         with an instance expression, bug #56174.
9353 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9355         * class.cs (IsDuplicateImplementation): Improve error reporting to
9356         flag 663 (method only differs in parameter modifier).
9358         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9359         in preprocessor directives.
9361         * location.cs (LookupFile): Allow for the empty path.
9363         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9364         better approach for some of that patch, but its failing with the
9365         CharSet enumeration.  For now try/catch will do.
9367         * typemanager.cs: Do not crash if a struct does not have fields.
9368         Fixes 56150.
9370 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9372         * expression.cs: cs0213, cant fix a fixed expression.
9373         fixes 50231.
9375 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9377         * cs-parser.jay: detect invalid embeded statements gracefully.
9378         bug #51113.
9380 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9382         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9383         As a regex:
9384         s/
9385         the invocation type may not be a subclass of the tye of the item/
9386         The type of the item must be a subclass of the invocation item.
9387         /g
9389         Fixes bug #50820.
9391 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9393         * attribute.cs: Added methods to get a string and a bool from an
9394         attribute. Required to information from AssemblyKeyFileAttribute,
9395         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9396         * codegen.cs: Modified AssemblyName creation to include support for
9397         strongnames. Catch additional exceptions to report them as CS1548.
9398         * compiler.csproj: Updated include CryptoConvert.cs.
9399         * compiler.csproj.user: Removed file - user specific configuration.
9400         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9401         Mono.Security assembly. The original class is maintained and tested in
9402         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9403         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9404         like CSC 8.0 (C# v2) supports.
9405         * Makefile: Added CryptoConvert.cs to mcs sources.
9406         * rootcontext.cs: Added new options for strongnames.
9408 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9410         * driver.cs: For --expect-error, report error code `2'
9411         if the program compiled with no errors, error code `1' if
9412         it compiled with an error other than the one expected.
9414 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9416         * compiler.csproj: Updated for Visual Studio .NET 2003.
9417         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9418         * compiler.sln: Updated for Visual Studio .NET 2003.
9420 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9422         * expression.cs: Fix bug #47234. We basically need to apply the
9423         rule that we prefer the conversion of null to a reference type
9424         when faced with a conversion to 'object' (csc behaviour).
9426 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9428         * statement.cs: Shorter form for foreach, eliminates
9429         a local variable. r=Martin.
9431 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9433         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9434         checks if we can use brtrue/brfalse to test for 0.
9435         * expression.cs: use the above in the test for using brtrue/brfalse.
9436         cleanup code a bit.
9438 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9440         * expression.cs: Rewrite string concat stuff. Benefits:
9442         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9443         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9444         rather than a concat chain.
9446         * typemanager.cs: Add lookups for more concat overloads.
9448 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9450         * expression.cs: Emit shorter il code for array init.
9452         newarr
9453         dup
9454         // set 1
9456         // set 2
9458         newarr
9459         stloc.x
9461         ldloc.x
9462         // set 1
9464         ldloc.x
9465         // set 2
9467 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9469         * statement.cs: Before, two switch blocks would be merged if the
9470         total size of the blocks (end_item - begin_item + 1) was less than
9471         two times the combined sizes of the blocks.
9473         Now, it will only merge if after the merge at least half of the
9474         slots are filled.
9476         fixes 55885.
9478 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9480         * class.cs : csc build fix for GetMethods(). See bug #52503.
9482 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9484         * expression.cs: Make sure fp comparisons work with NaN.
9485         This fixes bug #54303. Mig approved this patch a long
9486         time ago, but we were not able to test b/c the runtime
9487         had a related bug.
9489 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9491         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9493 2004-03-19  Martin Baulig  <martin@ximian.com>
9495         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9496         error here and not in our caller.
9498 2004-03-19  Martin Baulig  <martin@ximian.com>
9500         * interface.cs: Completely killed this file.
9501         (Interface): We're now a TypeContainer and live in class.cs.
9503         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9504         argument; we're now also called for interfaces.
9505         (TypeContainer.DefineMembers): Allow this method being called
9506         multiple times.
9507         (TypeContainer.GetMethods): New public method; formerly known as
9508         Interface.GetMethod().  This is used by PendingImplementation.
9509         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9510         it's now private and non-static.
9511         (Interface): Moved this here; it's now implemented similar to
9512         Class and Struct.
9513         (Method, Property, Event, Indexer): Added `bool is_interface'
9514         argument to their .ctor's.
9515         (MemberBase.IsInterface): New public field.
9517         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9518         instances instead of InterfaceMethod, InterfaceProperty, etc.
9519         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9520         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9522 2004-03-19  Martin Baulig  <martin@ximian.com>
9524         * class.cs (MethodCore.IsDuplicateImplementation): New private
9525         method which does the CS0111 checking.
9526         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9527         Use IsDuplicateImplementation().
9529 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9531         * decl.cs (FindMemberToOverride): New method to find the correct
9532         method or property to override in the base class.
9533         * class.cs
9534             - Make Method/Property use the above method to find the
9535               version in the base class.
9536             - Remove the InheritableMemberSignatureCompare as it is now
9537               dead code.
9539         This patch makes large code bases much faster to compile, as it is
9540         O(n) rather than O(n^2) to do this validation.
9542         Also, it fixes bug 52458 which is that nested classes are not
9543         taken into account when finding the base class member.
9545         Reviewed/Approved by Martin.
9547 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9549         * interface.cs: In all interface classes removed redundant
9550         member initialization.
9552 2004-03-16  Martin Baulig  <martin@ximian.com>
9554         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9556 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9558         * decl.cs (DefineTypeAndParents): New helper method to define a
9559         type's containers before the type itself is defined;  This is a
9560         bug exposed by the recent changes to Windows.Forms when an
9561         implemented interface was defined inside a class that had not been
9562         built yet.   
9564         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9566         (Check): Loop correctly to report errors modifiers
9567         (UNSAFE was not in the loop, since it was the same as TOP).
9569         * interface.cs: Every interface member now takes a ModFlags,
9570         instead of a "is_new" bool, which we set on the base MemberCore. 
9572         Every place where we called "UnsafeOk" in the interface, now we
9573         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9574         the unsafe settings from the member declaration instead of the
9575         container interface. 
9577         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9579         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9580         `set_indexer_name' to the pending bits (one per type).
9582         We fixed a bug today that was picking the wrong method to
9583         override, since for properties the existing InterfaceMethod code
9584         basically ignored the method name.  Now we make sure that the
9585         method name is one of the valid indexer names.
9587 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9589         * support.cs (SeekableStreamReader): Keep track of stream byte
9590         positions and don't mix them with character offsets to the buffer.
9592         Patch from Gustavo Giráldez
9594 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9596         * interface.cs (InterfaceSetGetBase): Removed double member
9597         initialization, base class does it as well.
9599 2004-03-13  Martin Baulig  <martin@ximian.com>
9601         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9602         when compiling corlib.
9604 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9606         * convert.cs (ExplicitConversion): We were reporting an error on
9607         certain conversions (object_type source to a value type, when the
9608         expression was `null') before we had a chance to pass it through
9609         the user defined conversions.
9611         * driver.cs: Replace / and \ in resource specifications to dots.
9612         Fixes 50752
9614         * class.cs: Add check for duplicate operators.  Fixes 52477
9616 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9618         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9619         that are in the middle of the statements, not only at the end.
9620         Fixes #54987
9622         * class.cs (TypeContainer.AddField): No longer set the
9623         `HaveStaticConstructor' flag, now we call it
9624         `UserDefineStaticConstructor' to diferentiate the slightly
9625         semantic difference.
9627         The situation is that we were not adding BeforeFieldInit (from
9628         Modifiers.TypeAttr) to classes that could have it.
9629         BeforeFieldInit should be set to classes that have no static
9630         constructor. 
9632         See:
9634         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9636         And most importantly Zoltan's comment:
9638         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9640         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9641          before its static fields are used', i.e. initialization does not need
9642          to be triggered by the first access to the type. Setting this flag
9643          helps the JIT to compile better code, since it can run the static
9644          constructor at JIT time, and does not need to generate code to call it
9645          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9646          this flag for lots of classes like String. 
9647          
9648          csc sets this flag if the type does not have an explicit static 
9649          constructor. The reasoning seems to be that if there are only static
9650          initalizers for a type, and no static constructor, then the programmer
9651          does not care when this initialization happens, so beforefieldinit
9652          can be used.
9653          
9654          This bug prevents the AOT compiler from being usable, since it 
9655          generates so many calls to mono_runtime_class_init that the AOT code
9656          is much slower than the JITted code. The JITted code is faster, 
9657          because it does not generate these calls if the vtable is type is
9658          already initialized, which is true in the majority of cases. But the
9659          AOT compiler can't do this."
9661 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9663         * class.cs (MethodData.Emit): Refactor the code so symbolic
9664         information is generated for destructors;  For some reasons we
9665         were taking a code path that did not generate symbolic information
9666         before. 
9668 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9670         * class.cs: Create a Constructor.CheckBase method that
9671         takes care of all validation type code. The method
9672         contains some code that was moved from Define.
9674         It also includes new code that checks for duplicate ctors.
9675         This fixes bug #55148.
9677 2004-03-09  Joshua Tauberer <tauberer@for.net>
9679         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9680         a { ... }-style array creation invokes EmitStaticInitializers
9681         which is not good for reference-type arrays.  String, decimal
9682         and now null constants (NullCast) are not counted toward
9683         static initializers.
9685 2004-03-05  Martin Baulig  <martin@ximian.com>
9687         * location.cs (SourceFile.HasLineDirective): New public field;
9688         specifies whether the file contains or is referenced by a "#line"
9689         directive.
9690         (Location.DefineSymbolDocuments): Ignore source files which
9691         either contain or are referenced by a "#line" directive.        
9693 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9695         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9696         direct access to our parent, so check the method inline there.
9698 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9700         * expression.cs (Invocation.EmitCall): Miguel's last commit
9701         caused a regression. If you had:
9703             T t = null;
9704             t.Foo ();
9706         In Foo the implict this would be null.
9708 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9710         * expression.cs (Invocation.EmitCall): If the method is not
9711         virtual, do not emit a CallVirt to it, use Call.
9713         * typemanager.cs (GetFullNameSignature): Improve the method to
9714         cope with ".ctor" and replace it with the type name.
9716         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9717         as an argument the ConstructorBuilder where it is being defined,
9718         to catch the recursive constructor invocations.
9720 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9722         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9723         routines to check if a type is an enumerable/enumerator allow
9724         classes that implement the IEnumerable or IEnumerator interfaces.
9726         * class.cs (Property, Operator): Implement IIteratorContainer, and
9727         implement SetYields.
9729         (Property.Define): Do the block swapping for get_methods in the
9730         context of iterators.   We need to check if Properties also
9731         include indexers or not.
9733         (Operator): Assign the Block before invoking the
9734         OperatorMethod.Define, so we can trigger the Iterator code
9735         replacement. 
9737         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9738         Property and Operator classes are not created when we parse the
9739         declarator but until we have the block completed, so we use a
9740         singleton SimpleIteratorContainer.Simple to flag whether the
9741         SetYields has been invoked.
9743         We propagate this setting then to the Property or the Operator to
9744         allow the `yield' to function.
9746 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9748         * codegen.cs: Implemented attribute support for modules.
9749         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9750         Assembly/Module functionality.
9752         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9753         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9754         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9756 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9758         * interface.cs (FindMembers): The operation is performed on all base
9759         interfaces and not only on the first. It is required for future CLS Compliance patch.
9761 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9763         * statement.cs, codegen.cs:
9764         This patch deals with patterns such as:
9766         public class List : IEnumerable {
9768                 public MyEnumerator GetEnumerator () {
9769                         return new MyEnumerator(this);
9770                 }
9772                 IEnumerator IEnumerable.GetEnumerator () {
9773                         ...
9774                 }
9775                 
9776                 public struct MyEnumerator : IEnumerator {
9777                         ...
9778                 }
9779         }
9781         Before, there were a few things we did wrong:
9782         1) we would emit callvirt on a struct, which is illegal
9783         2) we emited ldarg when we needed to emit ldarga
9784         3) we would mistakenly call the interface methods on an enumerator
9785         type that derived from IEnumerator and was in another assembly. For example:
9787         public class MyEnumerator : IEnumerator
9789         Would have the interface methods called, even if there were public impls of the
9790         method. In a struct, this lead to invalid IL code.
9792 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9794         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9795           renamed to Emit.
9797         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9799 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9801         * cs-parser.jay: Fix small regression: we were not testing V2
9802         compiler features correctly.
9804         * interface.cs: If the emit context is null, then create one
9806 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9808         * decl.cs (GetSignatureForError): New virtual method to get full name
9809           for error messages.
9811         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9812           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9814         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9815           Duplicated members and code in these classes has been removed.
9816           Better encapsulation in these classes.
9818 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9820         * assign.cs (Assign.DoResolve): When dealing with compound
9821         assignments, there is a new rule in ECMA C# 2.4 (might have been
9822         there before, but it is documented here) that states that in:
9824         a op= b;
9826         If b is of type int, and the `op' is a shift-operator, then the
9827         above is evaluated as:
9829         a = (int) a op b 
9831         * expression.cs (Binary.ResolveOperator): Instead of testing for
9832         int/uint/long/ulong, try to implicitly convert to any of those
9833         types and use that in pointer arithmetic.
9835         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9836         method to print information for from the type, not from the
9837         null-method we were given.
9839 2004-02-01  Duncan Mak  <duncan@ximian.com>
9841         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9842         parsing for cmd, fixes bug #53694.
9844 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9846         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9847         in the member name duplication tests. Property and operator name duplication
9848         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9850 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9852         * interface.cs (PopulateMethod): Fixed crash when interface method
9853         returns not existing type (error test cs0246-3.cs).
9855 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9857         * cs-parser.jay (interface_accessors): Re-write actions to also
9858         store attributes attached to get and set methods. Fix spelling
9859         while at it.
9861         (inteface_property_declaration): Modify accordingly.
9863         (InterfaceAccessorInfo): New helper class to store information to pass
9864         around between rules that use interface_accessors.
9866         * interface.cs (Emit): Apply attributes on the get and set
9867         accessors of properties and indexers too.
9869         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9870         right MethodBuilder when applying attributes to the get and set accessors.
9872 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9874         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9876 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9878         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9880 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9882         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9883         changes that treat `yield' specially when present before `break'
9884         or `return' tokens.
9886         * cs-tokenizer.cs: yield is no longer a keyword.
9888 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9890         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9891         setting for default constructors.
9892         For default constructors are almost every time set wrong Modifier. The
9893         generated IL code has been alright. But inside mcs this values was
9894         wrong and this was reason why several of my CLS Compliance tests
9895         failed.
9897 2004-01-22  Martin Baulig  <martin@ximian.com>
9899         * cs-parser.jay (namespace_or_type_name): Return an Expression,
9900         not a QualifiedIdentifier.  This is what `type_name_expression'
9901         was previously doing.
9902         (type_name_expression): Removed; the code is now in
9903         `namespace_or_type_name'.
9904         (qualified_identifier): Removed, use `namespace_or_type_name'
9905         instead.
9906         (QualifiedIdentifier): Removed this class.      
9908 2004-01-22  Martin Baulig  <martin@ximian.com>
9910         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9911         not a string as alias name.
9913 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
9915         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9916         #52730 bug, and instead compute correctly the need to use a
9917         temporary variable when requesting an address based on the
9918         static/instace modified of the field and the constructor.
9920 2004-01-21  Martin Baulig  <martin@ximian.com>
9922         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9923         class and namespace before looking up aliases.  Fixes #52517.
9925 2004-01-21  Martin Baulig  <martin@ximian.com>
9927         * flowanalysis.cs (UsageVector.Merge): Allow variables being
9928         assinged in a 'try'; fixes exception4.cs.
9930 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9931         * class.cs : Implemented parameter-less constructor for TypeContainer
9933         * decl.cs: Attributes are now stored here. New property OptAttributes
9935         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9937         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9939 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9941         * typemanager.cs (CSharpSignature): Now reports also inner class name.
9942           (CSharpSignature): New method for indexer and property signature.
9944 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9946         * pending.cs (IsVirtualFilter): Faster implementation.
9948 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9950         * typemanager.cs: Avoid inclusion of same assembly more than once.
9952 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9954         * cs-parser.jay: Fixed problem where the last assembly attribute
9955           has been applied also to following declaration (class, struct, etc.)
9956           
9957 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9959         * class.cs: Added error CS0538, CS0539 reporting.
9960         Fixed crash on Microsoft runtime when field type is void.
9962         * cs-parser.jay: Added error CS0537 reporting.
9964         * pending.cs: Added error CS0535 reporting.
9965         Improved error report for errors CS0536, CS0534.
9967 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
9969         Merge a few bits from the Anonymous Method MCS tree.
9971         * statement.cs (ToplevelBlock): New class for toplevel methods,
9972         will hold anonymous methods, lifted variables.
9974         * cs-parser.jay: Create toplevel blocks for delegates and for
9975         regular blocks of code. 
9977 2004-01-20  Martin Baulig  <martin@ximian.com>
9979         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9980         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9981         and `NeedExplicitReturn'; added `IsLastStatement'.
9982         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9983         have a `ReturnLabel' or we're not unreachable.
9985         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9986         child's reachability; don't just override ours with it.  Fixes
9987         #58058 (lluis's example).
9988         (FlowBranching): Added public InTryOrCatch(), InCatch(),
9989         InFinally(), InLoop(), InSwitch() and
9990         BreakCrossesTryCatchBoundary() methods.
9992         * statement.cs (Return): Do all error checking in Resolve().
9993         Unless we are the last statement in a top-level block, always
9994         create a return label and jump to it.
9995         (Break, Continue): Do all error checking in Resolve(); also make
9996         sure we aren't leaving a `finally'.
9997         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9998         statement in a top-level block.
9999         (Block.Flags): Added `IsDestructor'.
10000         (Block.IsDestructor): New public property.
10002 2004-01-20  Martin Baulig  <martin@ximian.com>
10004         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10006 2004-01-20  Martin Baulig  <martin@ximian.com>
10008         * statement.cs (Statement.ResolveUnreachable): New public method.
10009         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10010         (Block.Resolve): Resolve unreachable statements.
10012 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10014         * expression.cs: We need to fix the case where we do
10015         not have a temp variable here.
10017         * assign.cs: Only expression compound assignments need
10018         temporary variables.
10020 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10022         * flowanalysis.cs: Reduce memory allocation in a few ways:
10023           - A block with no variables should not allocate a bit
10024             vector for itself.
10025           - A method with no out parameters does not need any tracking
10026             for assignment of the parameters, so we need not allocate
10027             any data for it.
10028           - The arrays:
10029                 public readonly Type[] VariableTypes;
10030                 public readonly string[] VariableNames;
10031             Are redundant. The data is already stored in the variable
10032             map, so we need not allocate another array for it.
10033           - We need to add alot of checks for if (params | locals) == null
10034             due to the first two changes.
10036 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10038         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10039         implement IMemoryLocation, we store a copy on a local variable and
10040         take the address of it.  Patch from Benjamin Jemlich
10042         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10043         to use a special "type_name_expression" rule which reduces the
10044         number of "QualifiedIdentifier" classes created, and instead
10045         directly creates MemberAccess expressions.
10047 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10049         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10050         that fixes #52853.  Null literal assignment to ValueType
10052         * class.cs (MethodData.Emit): Instead of checking the name of the
10053         method to determine if its a destructor, create a new derived
10054         class from Method called Destructor, and test for that.  
10056         * cs-parser.jay: Create a Destructor object instead of a Method.  
10058         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10060         Fixes: 52933
10062 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10064         * expression.cs (Binary.ResolveOperator): Perform an implicit
10065         conversion from MethodGroups to their delegate types on the
10066         Addition operation.
10068         * delegate.cs: Introduce a new class DelegateCreation that is the
10069         base class for `NewDelegate' and `ImplicitDelegateCreation',
10070         factor some code in here.
10072         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10073         conversion from MethodGroups to compatible delegate types. 
10075         * ecore.cs (Expression.Resolve): Do not flag error 654
10076         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10077         we allow conversions from MethodGroups to delegate types now.
10079         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10080         assignments in v2 either.
10082 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10084         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10085         static read-only fields in ctors.
10087         Applied patch from Benjamin Jemlich 
10089         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10091 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10093         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10094         here to return true, as they can be used like this:
10096                 (XXX) int.MEMBER ()
10098         Fixed 49836 and all the other dups
10100 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10102         * driver.cs: Implement /win32res and /win32icon.
10104 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10106         * cs-parser.jay: Add a rule to improve error handling for the
10107         common mistake of placing modifiers after the type.
10109 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10111         * cs-parser.jay (interface_event_declaration): Catch
10112         initialization of events on interfaces, and report cs0068
10114         * cs-parser.jay (interface_event_declaration): Catch
10115         initialization of events. 
10117         * ecore.cs: Better report missing constructors.
10119         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10120         the error reporting done in the wrong place.  Fix.
10122         * expression.cs (Binary.ResolveOperator): Catch the 
10123         operator + (E x, E y) error earlier, and later allow for implicit
10124         conversions in operator +/- (E e, U x) from U to the underlying
10125         type of E.
10127         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10128         52596, if the container class is abstract, the default constructor
10129         is protected otherwise its public (before, we were always public).
10131         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10132         fixed statement.
10134         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10135         Jemlich that fixes bug #52597, MCS was generating invalid code for
10136         idisposable structs.   Thanks to Ben for following up with this
10137         bug as well.
10139 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10141         * driver.cs: Allow assemblies without code to be generated, fixes
10142         52230.
10144 2004-01-07  Nick Drochak <ndrochak@gol.com>
10146         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10148 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10150         * cs-parser.jay: Add rules to improve error reporting if fields or
10151         methods are declared at the namespace level (error 116)
10153         * Add rules to catch event add/remove
10155 2004-01-04  David Sheldon <dave-mono@earth.li>
10157   * expression.cs: Added matching ")" to error message for 
10158   CS0077
10160 2004-01-03 Todd Berman <tberman@gentoo.org>
10162         * ecore.cs, attribute.cs:
10163         Applying fix from #52429.
10165 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10167         * ecore.cs, expression.cs, statement.cs:
10168         Total rewrite of how we handle branching. We
10169         now handle complex boolean expressions with fewer
10170         jumps. As well if (x == 0) no longer emits a ceq.
10172         if (x is Foo) is much faster now, because we generate
10173         better code.
10175         Overall, we get a pretty big improvement on our benchmark
10176         tests. The code we generate is smaller and more readable.
10178         I did a full two-stage bootstrap. The patch was reviewed
10179         by Martin and Miguel.
10181 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10183         * cs-parser.jay: Make primary_expression not take a QI.
10184         we dont need this because the member_access rule covers
10185         us here. So we replace the rule with just IDENTIFIER.
10187         This has two good effects. First, we remove a s/r conflict.
10188         Second, we allocate many fewer QualifiedIdentifier objects.
10190 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10192         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10193         set the correct information via SRE. This prevents
10194         hanging on the MS runtime. Fixes #29374.
10196 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10198         * convert.cs: correctly handle conversions to value types
10199         from Enum and ValueType as unboxing conversions.
10201         Fixes bug #52569. Patch by Benjamin Jemlich.
10203 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10205         * expression.cs (BetterConversion): Prefer int -> uint
10206         over int -> ulong (csc's behaviour). This fixed bug #52046.
10208 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10210         * decl.cs (MemberCache.FindMembers): now returns a
10211         MemberInfo [].
10213         * typemanager.cs: In general, go with with ^^.
10214         (CopyNewMethods): take an IList.
10215         (RealMemberLookup): Only allocate an arraylist
10216         if we copy from two sets of methods.
10218         This change basically does two things:
10219         1) Fewer array lists allocated due to CopyNewMethods.
10220         2) the explicit cast in MemberList costed ALOT.
10222 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10224         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10225         a hashtable to avoid needless string allocations when an identifier is
10226         used more than once (the common case).
10228 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10230         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10231         is broken, it will not return anything. So, we
10232         have to use the information we have in mcs to
10233         do the task.
10235         * typemanager.cs: Add a cache for GetInterfaces,
10236         since this will now be used more often (due to ^^)
10238         (GetExplicitInterfaces) New method that gets the
10239         declared, not effective, interfaces on a type
10240         builder (eg, if you have interface IFoo, interface
10241         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10242         { IBar }.
10244         This patch makes MCS able to bootstrap itself on
10245         Windows again.
10247 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10249         * expression.cs: Remove the Nop's that Miguel put
10250         in by mistake.
10252 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10254         * report.cs, codegen.cs: Give the real stack trace to
10255         the error when an exception is thrown.
10257 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10259         * decl.cs: only allocate hashtables for ifaces if 
10260         it is an iface!
10262 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10264         * expression.cs: fix the error from cs0121-2.cs
10265         (a parent interface has two child interfaces that
10266         have a function with the same name and 0 params
10267         and the function is called through the parent).
10269 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10271         * class.cs, rootcontext.cs, typmanager.cs: do not
10272         leak pointers.
10274 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10276         * codegen.cs: remove stack for the ec flow branching.
10277         It is already a linked list, so no need.
10279 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10281         * Makefile: Allow custom profiler here.
10283 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10285         * typemanager.cs (LookupType):
10286           - Use a static char [], because split takes
10287             a param array for args, so it was allocating
10288             every time.
10289           - Do not store true in a hashtable, it boxes.
10291 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10293         * flowanalysis.cs: bytify common enums.
10295 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10297         * modifiers.cs: Add a new set of flags for the
10298         flags allowed on explicit interface impls.
10299         * cs-parser.jay: catch the use of modifiers in
10300         interfaces correctly.
10301         * class.cs: catch private void IFoo.Blah ().
10303         All related to bug #50572.
10305 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10307         * decl.cs: Rewrite the consistant accessability checking.
10308         Accessability is not linear, it must be implemented in
10309         a tableish way. Fixes #49704.
10311 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10313         * expression.cs: Handle negation in a checked context.
10314         We must use subtraction from zero. Fixes #38674.
10316 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10318         * class.cs: Ignore static void main in DLLs.
10319         * rootcontext.cs: Handle the target type here,
10320         since we are have to access it from class.cs
10321         * driver.cs: account for the above.
10323 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10325         * report.cs: Give line numbers and files if available.
10327 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10329         * driver.cs: Implement /addmodule.
10331         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10332         ModuleBuilders.
10334 2003-12-20  Martin Baulig  <martin@ximian.com>
10336         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10337         (FieldBase.IsAssigned): Removed this field.
10338         (FieldBase.SetAssigned): New public method.
10339         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10341 2003-12-20  Martin Baulig  <martin@ximian.com>
10343         * expression.cs (LocalVariableReference.DoResolve): Don't set
10344         `vi.Used' if we're called from DoResolveLValue().
10346         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10347         returns the usage vector it just merged into the current one -
10348         pass this one to UsageWarning().
10349         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10350         of the `EmitContext', don't call this recursively on our children.
10352 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10354         * driver.cs: Implement /target:module.
10356 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10358         * support.cs (CharArrayHashtable): New helper class.
10360         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10361         char arrays, not strings, so we can avoid creating a string in
10362         consume_identifier if the identifier is a keyword.
10364 2003-12-16  Martin Baulig  <martin@ximian.com>
10366         * statement.cs (LocalInfo.Assigned): Removed this property.
10367         (LocalInfo.Flags): Removed `Assigned'.
10368         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10369         and uses flow analysis.
10370         (Block.UsageWarning): Made this method private.
10371         (Block.Resolve): Call UsageWarning() if appropriate.
10373         * expression.cs (LocalVariableReference.DoResolve): Always set
10374         LocalInfo.Used here.
10376 2003-12-13  Martin Baulig  <martin@ximian.com>
10378         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10379         any value here; we're now using flow analysis to figure out
10380         whether a statement/block returns a value.
10382 2003-12-13  Martin Baulig  <martin@ximian.com>
10384         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10385         working again.
10386         (FlowBranching.MergeFinally): Don't call
10387         `branching.CheckOutParameters()' here, this is called in
10388         MergeTopBlock().
10389         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10390         when adding the `finally' vector.       
10392 2003-12-13  Martin Baulig  <martin@ximian.com>
10394         * flowanalysis.cs
10395         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10396         actually work and also fix #48962.
10398 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10400         * decl.cs: Do not check System.Object for nested types,
10401         since we know it does not have any. Big bang for buck:
10403         BEFORE:
10404            Run 1:   8.35 seconds
10405            Run 2:   8.32 seconds
10406            corlib:  17.99 seconds
10407         AFTER:
10408            Run 1:   8.17 seconds
10409            Run 2:   8.17 seconds
10410            corlib:  17.39 seconds
10412 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10414         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10415         time we are returning 0 members, so we save alot here.
10417 2003-12-11  Martin Baulig  <martin@ximian.com>
10419         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10420         `MergeChild()', also just take the `FlowBranching' as argument;
10421         call Merge() on it and return the result.
10422         (FlowBranching.Merge): We don't need to do anything if we just
10423         have one sibling.
10425 2003-12-11  Martin Baulig  <martin@ximian.com>
10427         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10428         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10429         Maurer for this idea.
10431 2003-12-11  Martin Baulig  <martin@ximian.com>
10433         * flowanalysis.cs (MergeResult): This class is now gone; we now
10434         use the `UsageVector' for this.  The reason for this is that if a
10435         branching just has one sibling, we don't need to "merge" them at
10436         all - that's the next step to do.
10437         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10438         `MergeResult'.
10440 2003-12-11  Martin Baulig  <martin@ximian.com>
10442         Reworked flow analyis and made it more precise and bug-free.  The
10443         most important change is that we're now using a special `Reachability'
10444         class instead of having "magic" meanings of `FlowReturns'.  I'll
10445         do some more cleanups and optimizations and also add some more
10446         documentation this week.
10448         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10449         largely reworked this class.
10450         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10451         the new `Reachability' class instead of having "magic" values here.
10452         (FlowBranching): We're now using an instance of `Reachability'
10453         instead of having separate `Returns', `Breaks' etc. fields.
10455         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10456         based on flow analysis; ignore the return value of block.Emit ().
10458 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10460         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10461         if they are private.
10463 2003-12-09  Martin Baulig  <martin@ximian.com>
10465         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10466         call them directly on the UsageVector.
10468 2003-12-09  Martin Baulig  <martin@ximian.com>
10470         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10471         Changed return type from `FlowReturns' to `Reachability'.
10473 2003-12-09  Martin Baulig  <martin@ximian.com>
10475         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10476         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10477         `Reachable' fields with a single `Reachability' one.
10479 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10481         * class.cs (FindMembers): Remove foreach's.
10483         Bootstrap times:
10485         BEFORE
10486                 Run 1:   8.74 seconds
10487                 Run 2:   8.71 seconds
10489         AFTER
10490                 Run 1:   8.64 seconds
10491                 Run 2:   8.58 seconds
10494 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10496         * cs-parser.jay:
10497         * gen-treedump.cs:
10498         * statement.cs:
10499         This patch does a few things:
10500                 1. EmptyStatement is now a singleton, so it is never reallocated.
10501                 2. All blah is EmptyStatement constructs have been changed to
10502                    blah == EmptyStatement.Value, which is much faster and valid
10503                    now that EmptyStatement is a singleton.
10504                 3. When resolving a block, rather than allocating a new array for
10505                    the non-empty statements, empty statements are replaced with
10506                    EmptyStatement.Value
10507                 4. Some recursive functions have been made non-recursive.
10508         Mainly the performance impact is from (3), however (1) and (2) are needed for
10509         this to work. (4) does not make a big difference in normal situations, however
10510         it makes the profile look saner.
10512         Bootstrap times:
10514         BEFORE
10515         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10516         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10517         Total memory allocated: 56397 KB
10519         AFTER
10520         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10521         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10522         Total memory allocated: 55666 KB
10524 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10526         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10527         than the hashtable in a hashtable version
10529         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10530         we always end up concating a string. This results in a huge perf
10531         loss, because many strings have to be tracked by the GC. In this
10532         patch, we first use a hashtable that works with two keys, so that
10533         the strings do not need to be concat'ed.
10535         Bootstrap times:
10536         BEFORE
10537                 Run 1:   8.74 seconds
10538                 Run 2:   8.71 seconds
10540         AFTER
10541                 Run 1:   8.65 seconds
10542                 Run 2:   8.56 seconds
10544 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10546         * Makefile: Add a new target `do-time' that does a quick and simple
10547         profile, leaving easy to parse output.
10549 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10551         * codegen.cs (Init): Create the dynamic assembly with 
10552         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10554 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10556         * support.cs: Make the PtrHashtable use only one
10557         instance of its comparer.
10559 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10561         * typemanager.cs: Fix lookup of GetNamespaces.
10563 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10565         * expression.cs: Removed redundant line.
10567         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10568         ArrayLists, use for loops with bounds.  
10570         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10571         arraylist.
10573         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10574         arraylists, use for loop with bounds.
10576         The above three changes give us a 0.071 second performance
10577         improvement out of 3.294 seconds down to 3.223.  On my machine
10578         the above changes reduced the memory usage by 1,387 KB during
10579         compiler bootstrap.
10581         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10582         QualifiedIdentifiers.  Before we created a new string through
10583         concatenation, and mostly later on, the result would be
10584         manipulated by DecomposeQI through string manipulation.
10586         This reduced the compiler memory usage for bootstrapping from
10587         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10588         compile times in 0.05 seconds.
10590 2003-11-28  Dick Porter  <dick@ximian.com>
10592         * support.cs: Do string compares with the Invariant culture.
10594         * rootcontext.cs: 
10595         * gen-treedump.cs: 
10596         * expression.cs: 
10597         * driver.cs: 
10598         * decl.cs: 
10599         * codegen.cs: 
10600         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10601         the comparison is done with the Invariant culture.
10603 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10605         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10606         GetEnumerator method.
10608         (ProbeCollectionType): Iterate starting at the most specific type
10609         upwards looking for a GetEnumerator
10611         * expression.cs: Shift count can be up to 31 for int/uint and 63
10612         for long/ulong.
10614 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10616         * statement.cs (Block.LookupLabel): Also look for the label on the
10617         children blocks.  Use a hash table to keep track of visited
10618         nodes. 
10620         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10621         we actually did transform the other operand, otherwise fall back
10622         to the common codepath that casts to long.
10624         * cs-tokenizer.cs: Use the same code pattern as the int case.
10625         Maybe I should do the parsing myself, and avoid depending on the
10626         Parse routines to get this done.
10628 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10630         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10631         which fixes bug 51347.  This time test it.
10633         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10634         attributes for example can not tell the difference between these.
10635         The difference was only a syntax feature of the language. 
10637         * attribute.cs: Apply attributes to delegates.
10639         * delegate.cs: Call the apply attributes method.
10641 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10643         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10644         comparing 0 vs Byte.MinValue, not the value
10646         (ImplicitConversionRequired): When reporting a conversion error,
10647         use error 31 to print out the constant error instead of the
10648         simpler 29.
10650         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10651         which fixes bug 51347.
10653 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10655         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10656         which fixes the -warnaserror command line option.
10658 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10660         * cfold.cs (DoNumericPromotions): During constant folding of
10661         additions on UIntConstant, special case intconstants with
10662         IntConstants like we do on the expression binary operator. 
10664 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10666         * convert.cs (ImplicitReferenceConversion): We were missing a case
10667         (System.Enum are not value types or class types, so we need to
10668         classify them separatedly).
10670         * driver.cs: We do not support error 2007.
10672 2003-11-12 Jackson Harper <jackson@ximian.com>
10674         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10675         system directory. Also use the full file name so users can
10676         libraries names mscorlib-o-tron.dll in a non system dir.
10678 2003-11-10  Martin Baulig  <martin@ximian.com>
10680         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10681         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10682         calling `ResolveType()' on them, directly assign their `Type'.
10684 2003-11-08  Martin Baulig  <martin@ximian.com>
10686         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10687         return value and the `out parent' parameter.
10688         (TypeContainer.DefineType): Moved the CS0644 check into
10689         GetClassBases().  Don't pass the interface types to the
10690         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10691         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10693         * ecore.cs (TypeExpr.IsAttribute): New property.
10694         (TypeExpr.GetInterfaces): New method.
10696         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10697         TypeExpr instead of a Type.
10698         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10699         (Interface.DefineType): Don't pass the interface types to the
10700         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10701         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10703         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10704         instead of a `Type[]'.
10705         (TypeManager.RegisterBuilder): Likewise.
10706         (TypeManager.AddUserInterface): Likewise.
10707         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10708         `Type[]' and also return a `TypeExpr[]'.
10709         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10711 2003-11-08  Martin Baulig  <martin@ximian.com>
10713         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10714         Expression.     
10716 2003-11-08  Martin Baulig  <martin@ximian.com>
10718         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10719         TypeManager.ResolveExpressionTypes().
10721         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10722         instead of an Expression.
10723         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10724         (TypeExpression): New public class; formerly known as `TypeExpr'.
10726         * expression.cs (ComposedCast): Derive from TypeExpr.
10728         * typemanager.cs (TypeManager.system_*_expr): These are now
10729         TypExpr's instead of Expression's.
10730         (TypeManager.ResolveExpressionTypes): New public static function;
10731         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10732         of them.        
10734 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10736         * expression.cs (New.DoResolve): Do not dereference value that
10737         might be a null return.
10739         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10740         sure that the constant value has the right type.  Fixes an
10741         unreported bug, similar to 50425.
10743         * const.cs (Const.LookupConstantValue): Call
10744         ImplicitStandardConversionExists before doing a conversion to
10745         avoid havng the TypeManager.ChangeType do conversions.
10747         Reduced the number of casts used
10749         (Const.ChangeType): New routine to enable reuse of the constant
10750         type changing code from statement.
10752         * typemanager.cs (ChangeType): Move common initialization to
10753         static global variables.
10755         Fixes #50425.
10757         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10758         every value type to go through, even if it was void.  Fix that. 
10760         * cs-tokenizer.cs: Use is_identifier_start_character on the start
10761         character of the define, and the is_identifier_part_character for
10762         the rest of the string.
10764 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
10766         * expression.cs (UnaryMutator.EmitCode): When I updated
10767         LocalVariableReference.DoResolve, I overdid it, and dropped an
10768         optimization done on local variable references.
10770 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
10772         * ecore.cs: Convert the return from Ldlen into an int.
10774 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
10776         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10777         the accessibility, this is a special case for toplevel non-public
10778         classes (internal for instance).
10780 2003-10-20  Nick Drochak <ndrochak@gol.com>
10782         * ecore.cs: Fix typo and build.  Needed another right paren.
10784 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
10786         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
10787         `internal' case regular and protected, but not allowing protected
10788         to be evaluated later.  Bug 49840
10790 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
10792         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10793         to kb.Nlast, and not the kb.nFirst to isolate the switch
10794         statement.
10796         Extract the underlying type, so enumerations of long/ulong are
10797         treated like long/ulong.
10799 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
10801         * expression.cs (New): Overload the meaning of RequestedType to
10802         track the possible creation of the NewDelegate type, since
10803         DoResolve is invoked more than once for new constructors on field
10804         initialization.
10806         See bugs: #48800 and #37014
10808         * cs-parser.jay (declare_local_constants): Take an arraylist
10809         instead of a single constant.
10811         (local_constant_declaration): It should take a
10812         constant_declarators, not a constant_declarator.  Fixes 49487
10814         * convert.cs: Fix error report.
10816 2003-10-13 Jackson Harper <jackson@ximian.com>
10818         * typemanager.cs (TypeToCoreType): Add float and double this fixes
10819         bug #49611
10821 2003-10-09  Martin Baulig  <martin@ximian.com>
10823         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10824         to the .ctor.
10825         (MethodCore.DoDefineParameters): Removed the TypeContainer
10826         argument; use the DeclSpace which was passed to the .ctor instead.
10827         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10828         TypeContainer; we only need a DeclSpace here.
10830 2003-10-09  Martin Baulig  <martin@ximian.com>
10832         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10833         to the .ctor.
10834         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10835         EmitContext's .ctor.    
10837 2003-10-09  Martin Baulig  <martin@ximian.com>
10839         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10840         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10841         AsAccessible(), moved them as well.
10843         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10845 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10847         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10849 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10851         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10852         generation for >=, as spotted by Paolo, bug 48679.  
10853         Patch from David Waite.
10855         * cs-tokenizer.cs: Add handling for #pragma.
10857         * cs-parser.jay: Allow for both yield and yield return in the
10858         syntax.  The anti-cobolization of C# fight will go on!
10860         * class.cs (TypeBuilder.DefineType): Catch error condition here
10861         (Parent.DefineType erroring out and returning null).
10863         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10864         coping with enumerations variables, we were mistakenly processing
10865         them as a regular value type instead of built-in types.  Fixes the
10866         bug #48063
10868         * typemanager.cs (IsBuiltinOrEnum): New method.
10870 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10872         * cs-parser.jay: Upgrade: yield now needs the return clause.
10874 2003-09-19  Martin Baulig  <martin@ximian.com>
10876         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10877         `MemberCache parent' argument.  Normally, an interface doesn't
10878         have a parent type except System.Object, but we use this in gmcs
10879         for generic type parameters.
10881 2003-09-18  Martin Baulig  <martin@ximian.com>
10883         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10884         on `type.IsInterface'; don't check whether the type has a parent
10885         to determine whether it's an interface.
10887 2003-09-15  Martin Baulig  <martin@ximian.com>
10889         * class.cs (TypeContainer.DefineType): Added an error flag to
10890         avoid reporting duplicate CS0146's ("class definition is
10891         circular.").
10893         * driver.cs (Driver.MainDriver): Abort if
10894         RootContext.ResolveTree() reported any errors.
10896 2003-09-07  Martin Baulig  <martin@ximian.com>
10898         * report.cs (Error, Warning): Added overloaded versions which take
10899         a `params object[] args' and call String.Format().
10901 2003-09-07  Martin Baulig  <martin@ximian.com>
10903         * decl.cs (DeclSpace..ctor): Don't call
10904         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10905         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10906         (DeclSpace.RecordDecl): New method.
10908         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10910 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10912         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10913         value attributes to be applied to ParameterBuilders.
10915         * class.cs (MethodCore.LabelParameters): Make static and more
10916         generic so that it can be used from other places - like interface
10917         methods, for instance.
10919         * interface.cs (Interface.Emit): Call LabelParameters before
10920         emitting attributes on the InterfaceMethod.
10922 2003-08-26  Martin Baulig  <martin@ximian.com>
10924         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10925         resolving aliases; fixes #47927.
10927 2003-08-26  Martin Baulig  <martin@ximian.com>
10929         * statement.cs (Using.DoResolve): This is internally emitting a
10930         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10931         do not always return.  Fixes #47681.
10933 2003-08-26  Martin Baulig  <martin@ximian.com>
10935         * decl.cs (MemberCore): Moved WarningNotHiding(),
10936         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10937         into MemberBase.
10938         (AdditionResult): Make this nested in DeclSpace.
10939         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10940         argument; call NamespaceEntry.Define() unless we're nested in a
10941         class or struct.
10943         * namespace.cs (Namespace.DefineName): New public function.  This
10944         is called from DeclSpace's .ctor to add 
10945         (Namespace.Lookup): Include DeclSpaces in the lookup.
10947         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10949         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10951 2003-08-25  Martin Baulig  <martin@ximian.com>
10953         * convert.cs (Convert.ExplicitReferenceConversion): When
10954         converting from an interface type to a class, unbox if the target
10955         type is a struct type.  Fixes #47822.
10957 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10959         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10960         #47854.
10962 2003-08-22  Martin Baulig  <martin@ximian.com>
10964         * class.cs (TypeManager.DefineType): When defining a nested type,
10965         call DefineType() on our parent; fixes #47801.
10967 2003-08-22  Martin Baulig  <martin@ximian.com>
10969         * class.cs (MethodData.Define): While checking if a method is an
10970         interface implementation, improve the test a bit more to fix #47654.
10972 2003-08-22  Martin Baulig  <martin@ximian.com>
10974         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10975         correctly; fixes #47722.
10977 2003-08-22  Martin Baulig  <martin@ximian.com>
10979         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10980         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10982         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10984 2003-08-22  Martin Baulig  <martin@ximian.com>
10986         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10987         can only be assigned in static constructors.  Fixes #47161.
10989 2003-08-22  Martin Baulig  <martin@ximian.com>
10991         Rewrote and improved the flow analysis code.
10993         * flowbranching.cs (FlowBranching): Make this class abstract.
10994         (FlowBranching.CreateBranching): New static function to create a
10995         new flow branching.
10996         (FlowBranchingBlock, FlowBranchingException): New classes.
10997         (FlowBranching.UsageVector.Type): New public readonly field.
10998         (FlowBranching.UsageVector.Breaks): Removed the setter.
10999         (FlowBranching.UsageVector.Returns): Removed the setter.
11000         (FlowBranching.UsageVector): Added Break(), Return(),
11001         NeverReachable() and Throw() methods to modify the reachability.
11002         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11003         done by FlowBranching.Merge().
11004         (FlowBranching.UsageVector.MergeChild): New method; merges the
11005         merge result into the current vector.
11006         (FlowBranching.Merge): New abstract method to merge a branching.
11008 2003-08-12  Martin Baulig  <martin@ximian.com>
11010         * expression.cs (Indirection.CacheTemporaries): Create the
11011         LocalTemporary with the pointer type, not its element type.
11013 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11015         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11016         token was a keyword or not.
11018         Add `error' options where an IDENTIFIER was expected;  Provide
11019         CheckToken and CheckIdentifierToken convenience error reporting
11020         functions. 
11022         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11024         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11025         NameSpaceEntry NameSpaceEntry.
11027         (LookupInterfaceOrClass): Avoid creating a full qualified name
11028         from namespace and name: avoid doing lookups when we know the
11029         namespace is non-existant.   Use new Tree.LookupByNamespace which
11030         looks up DeclSpaces based on their namespace, name pair.
11032         * driver.cs: Provide a new `parser verbose' to display the
11033         exception thrown during parsing.  This is turned off by default
11034         now, so the output of a failure from mcs is more graceful.
11036         * namespace.cs: Track all the namespaces defined in a hashtable
11037         for quick lookup.
11039         (IsNamespace): New method
11041 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11043         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11044         we know that we need to concatenate (full typename can never be
11045         null). 
11047         * class.cs: ditto.
11049         * statement.cs: Use a bitfield;  Do not initialize to null things
11050         which are done by the constructor by default.
11052         * cs-parser.jay: bug fix, parameter was 4, not 3.
11054         * expression.cs: Just use the property;
11056         * statement.cs: No need for GetVariableInfo method.
11058 2003-08-08  Martin Baulig  <martin@ximian.com>
11060         * flowanalysis.cs (FlowReturns): This is now nested in the
11061         `FlowBranching' class.
11062         (MyBitVector): Moved this here from statement.cs.
11063         (FlowBranching.SiblingType): New enum type.
11064         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11066 2003-08-07  Martin Baulig  <martin@ximian.com>
11068         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11069         `FlowBranching' class and called `BranchingType'.
11071 2003-08-07  Martin Baulig  <martin@ximian.com>
11073         * flowanalysis.cs: Moved all the control flow analysis code into
11074         its own file.
11076 2003-08-07  Martin Baulig  <martin@ximian.com>
11078         * assign.cs (Assign.DoResolve): `target' must either be an
11079         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11080         #37319.
11082 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11084         * expression.cs (BinaryMethod): This kind of expression is created by the
11085         Binary class if it determines that the operator has to be handled
11086         by a method.
11088         (BinaryDelegate): This kind of expression is created if we are
11089         dealing with a + or - operator on delegates.
11091         (Binary): remove method, argumetns, and DelegateOperator: when
11092         dealing with methods, 
11094         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11096         * statement.cs (Block): use bitfields for the three extra booleans
11097         we had in use.   Remove unused topblock parameter.
11099         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11101         * assign.cs: Drop extra unneeded tests.
11103 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11105         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11107         * statement.cs (Foreach): Use VariableStorage instead of
11108         LocalBuilders.   
11110         * codegen.cs (VariableStorage): New class used by clients that
11111         require a variable stored: locals or fields for variables that
11112         need to live across yield.
11114         Maybe provide a convenience api for EmitThis+EmitLoad?
11116         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11117         these bad boys.
11119 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11121         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11122         RemapParameterLValue): New methods that are used to turn a
11123         precomputed FieldInfo into an expression like this:
11125                 instance.FieldInfo
11127         The idea is to use this instead of making LocalVariableReference
11128         have more than one meaning.
11130         * cs-parser.jay: Add error production to BASE.
11132         * ecore.cs: Deal with TypeManager.GetField returning null, which
11133         is now a valid return value.
11135         (FieldExprNoAddress): New expression for Fields whose address can
11136         not be taken.
11138         * expression.cs (LocalVariableReference): During the resolve
11139         phases, create new expressions if we are in a remapping context.
11140         Remove code that dealt with remapping here.
11142         (ParameterReference): same.
11144         (ProxyInstance): New expression, like the `This' expression, but
11145         it is born fully resolved.  We know what we are doing, so remove
11146         the errors that are targeted to user-provided uses of `this'.
11148         * statement.cs (Foreach): our variable is now stored as an
11149         Expression;  During resolution, follow the protocol, dont just
11150         assume it will return this.
11152 2003-08-06  Martin Baulig  <martin@ximian.com>
11154         * support.cs (SeekableStreamReader.cs): New public class.
11156         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11157         SeekableStreamReader instead of the normal StreamReader.
11159 2003-08-04  Martin Baulig  <martin@ximian.com>
11161         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11162         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11163         deambiguate casts and delegate invocations.
11164         (parenthesized_expression): Use the new tokens to ensure this is
11165         not a cast of method invocation.
11167         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11168         when reading a `)' and Deambiguate_CloseParens () was previously
11169         called.
11171         * expression.cs (ParenthesizedExpression): New class.  This is
11172         just used for the CS0075 test.
11173         (Binary.DoResolve): Check for CS0075.   
11175 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11177         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11178         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11179         reference comparison.
11181         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11182         examine the ReturnType for equality - this is necessary in the
11183         cases of implicit and explicit operators whose signature also
11184         includes the return type.
11186 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11188         * namespace.cs: Cache the result of the namespace computation,
11189         instead of computing it every time.
11191 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11193         * decl.cs: Use a global arraylist that we reuse over invocations
11194         to avoid excesive memory consumption.  Reduces memory usage on an
11195         mcs compile by one meg (45 average).
11197         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11198         private, work around that.
11200 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11202         * literal.cs (IntLiteral): Define Zero and One static literals. 
11204         * cs-parser.jay (integer_literal): use static literals to reduce
11205         memory usage for the most used literals (0, 1 and -1).  211kb
11206         reduced in memory usage.
11208         Replace all calls to `new ArrayList' with `new
11209         ArrayList(4)' which is a good average number for most allocations,
11210         and also requires only 16 bytes of memory for its buffer by
11211         default. 
11213         This reduced MCS memory usage in seven megabytes for the RSS after
11214         bootstrapping.
11216 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11218         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11219         handle params methods the correct way by forming only one
11220         applicable set with params and normal methods in them. Earlier we
11221         were looking at params methods only if we found no normal methods
11222         which was not the correct thing to do.
11224         (Invocation.BetterFunction): Take separate arguments indicating
11225         when candidate and the best method are params methods in their
11226         expanded form.
11228         This fixes bugs #43367 and #46199.
11230         * attribute.cs: Documentation updates.
11232         (CheckAttribute): Rename to CheckAttributeTarget.
11233         (GetValidPlaces): Rename to GetValidTargets.
11235         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11236         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11238         Fixes bug #44468.
11240 2003-07-28  Martin Baulig  <martin@ximian.com>
11242         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11243         name when looking up the base class of a nested class.  Fixes #46977.
11245 2003-07-26  Martin Baulig  <martin@ximian.com>
11247         * expression.cs (Indexers.Indexer): New nested struct; contains
11248         getter, setter and the indexer's type.
11249         (Indexers.Properties): This is now an ArrayList of
11250         Indexers.Indexer's.
11251         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11252         indexer doesn't have any getters.
11254         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11255         for embedded property and indexer assignments.
11257 2003-07-26  Martin Baulig  <martin@ximian.com>
11259         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11260         preprocessor directive is not the first non-whitespace character
11261         on a line.
11263 2003-07-26  Martin Baulig  <martin@ximian.com>
11265         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11266         namespace parsing, follow the spec more closely.
11268         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11269         NamespaceEntry.Lookup().
11271 2003-07-25  Martin Baulig  <martin@ximian.com>
11273         * MethodCore.cs (OverridesSomething): New public field; it's set
11274         from TypeContainer.DefineMembers if this method overrides
11275         something (which doesn't need to be a method).  Fix #39462.
11277 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11279         * typemanager.cs (GetMembers): Ensure that the list of members is
11280         reversed. This keeps things in sync.
11282         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11283         find an AttributeUsage attribute.
11285         * expression.cs (Invocation.OverloadResolve): Perform the check
11286         which disallows Invoke to be directly called on a Delegate.
11288         (Error_InvokeOnDelegate): Report error cs1533.
11290 2003-07-25  Martin Baulig  <martin@ximian.com>
11292         * expression.cs (Indexers.GetIndexersForType): Only look in the
11293         interface hierarchy if the requested type is already an
11294         interface.  Fixes #46788 while keeping #46502 fixed.
11296 2003-07-25  Martin Baulig  <martin@ximian.com>
11298         * class.cs (TypeContainer.DefineMembers): Check whether all
11299         readonly fields have been assigned and report warning CS0649 if
11300         not.
11302         * statement.cs (LocalInfo.IsFixed): Always return true if this is
11303         a valuetype.
11305 2003-07-24  Ravi Pratap  <ravi@ximian.com>
11307         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11308         returned from GetMethods to make things consistent with the
11309         assumptions MCS makes about ordering of methods.
11311         This should comprehensively fix bug #45127 and it does :-)
11313         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11314         ordering is actually reverse.
11316         * Clean up some debug messages I left lying around.
11318         * interface.cs (Populate*): Get rid of code which emits attributes
11319         since the stage in which we emit attributes is the 'Emit' stage,
11320         not the define stage.
11322         (Emit): Move attribute emission for interface members here.
11324 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11326         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11327         closely: we eliminate methods in base types when we have an
11328         applicable method in a top-level type.
11330         Please see section 14.5.5.1 for an exact description of what goes
11331         on. 
11333         This fixes bug #45127 and a host of other related to corlib compilation.
11335         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11336         array is the method corresponding to the top-level type (this is
11337         because of the changes made to icall.c) so we change this
11338         accordingly.
11340         (MethodGroupExpr.Name): This too.
11342         * typemanager.cs (GetElementType): New method which does the right
11343         thing when compiling corlib. 
11345         * everywhere: Make use of the above in the relevant places.
11347 2003-07-22  Martin Baulig  <martin@ximian.com>
11349         * cs-parser.jay (invocation_expression): Moved
11350         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11351         `cast_expression', but create a InvocationOrCast which later
11352         resolves to either an Invocation or a Cast.
11354         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11355         method; call this before EmitStatement() to make sure that this
11356         expression can be used as a statement.
11358         * expression.cs (InvocationOrCast): New class; resolves to either
11359         an Invocation or a Cast.
11361         * statement.cs (StatementExpression): Call ResolveStatement() on
11362         the ExpressionStatement before emitting it.
11364 2003-07-21  Martin Baulig  <martin@ximian.com>
11366         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11367         `ref' and `out' attributes match; fixes #46220.
11368         (MemberAccess.ResolveMemberAccess): You can't reference a type
11369         through an expression; fixes #33180.
11370         (Indexers.GetIndexersForType): Don't return the indexers from
11371         interfaces the class implements; fixes #46502.
11373 2003-07-21  Martin Baulig  <martin@ximian.com>
11375         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11376         CS0661 checks; fixes bug #30442.
11378 2003-07-21  Martin Baulig  <martin@ximian.com>
11380         * decl.cs (AdditionResult): Added `Error'.
11382         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11384         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11385         makes cs0031.cs actually work.
11387 2003-07-20  Martin Baulig  <martin@ximian.com>
11389         * namespace.cs: Fixed that bug which caused a crash when compiling
11390         the debugger's GUI.
11392 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11394         * typemanager.cs (LookupTypeReflection): Never expose types which
11395         are NotPublic, NestedPrivate, NestedAssembly, or
11396         NestedFamANDAssem.  We used to return these, and later do a check
11397         that would report a meaningful error, but the problem is that we
11398         would not get the real match, if there was a name override.
11400 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11402         * namespace.cs (Namespace, Name): Do not compute the namespace
11403         name dynamically, compute it in the constructor.  This reduced
11404         memory usage by 1697 KB.
11406         * driver.cs: Use --pause to pause at the end.
11408 2003-07-17  Peter Williams  <peter@newton.cx>
11410         * Makefile: Change the name of the test target so that it doesn't
11411         conflict with the recursive test target.
11413 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11415         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11416         AddressOf): Do not use EmitThis, that was wrong, use the actual
11417         this pointer.
11419 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11421         * class.cs (MethodData.Define): While checking if a method is an
11422         interface implementation, improve the test: If we are not public
11423         (use new test here: use the computed MethodAttributes directly,
11424         instead of the parsed modifier flags) check if the `implementing'
11425         method comes from an interface or not.
11427         * pending.cs (VerifyPendingMethods): Slightly better error
11428         message.
11430         * makefile: add test target that does the mcs bootstrap.
11432 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11434         * interface.cs (Define): Do nothing here since there are no
11435         members to populate etc. Move the attribute emission out of here
11436         since this was just totally the wrong place to put it. Attribute
11437         application happens during the 'Emit' phase, not in the 'Define'
11438         phase.
11440         (Emit): Add this method and move the attribute emission here
11442         * rootcontext.cs (EmitCode): Call the Emit method on interface
11443         types too.
11445 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11447         * expression.cs (OverloadResolve): Report error only if Location
11448         is not 'Null' which means that there was a probe going on.
11450 2003-07-14  Martin Baulig  <martin@ximian.com>
11452         * expression.cs (ConditionalLogicalOperator): New public class to
11453         implement user defined conditional logical operators.
11454         This is section 14.11.2 in the spec and bug #40505.
11456 2003-07-14  Martin Baulig  <martin@ximian.com>
11458         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11460 2003-07-14  Martin Baulig  <martin@ximian.com>
11462         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11464         * ecore.cs (IVariable.VerifyFixed): New interface method.
11466         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11467         operator, check whether the variable is actually fixed.  Fixes bug
11468         #36055.  Set a variable definitely assigned when taking its
11469         address as required by the spec.
11471         * statement.cs (LocalInfo.IsFixed): New field.
11472         (LocalInfo.MakePinned): Set `IsFixed' to true.
11474 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11476         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11477         for .ctors, ensure that we only ask for members declared in the
11478         attribute type (BindingFlags.DeclaredOnly).
11480         Fixes bug #43632.
11482         * expression.cs (Error_WrongNumArguments): Report error 1501
11483         correctly the way CSC does.
11485 2003-07-13  Martin Baulig  <martin@ximian.com>
11487         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11488         lookup on the fully qualified name, to make things like "X.X" work
11489         where "X.X" is a fully qualified type name, but we also have a
11490         namespace "X" in the using list.  Fixes #41975.
11492 2003-07-13  Martin Baulig  <martin@ximian.com>
11494         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11495         function. If we're a CompoundAssign, we need to create an embedded
11496         CompoundAssign, not an embedded Assign.
11497         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11498         Fixes #45854.
11500 2003-07-13  Martin Baulig  <martin@ximian.com>
11502         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11503         work to fix bug #46088.
11505 2003-07-13  Ravi Pratap <ravi@ximian.com>
11507         * class.cs (Operator.Emit): Do not emit attributes here - it is
11508         taken care of by the Method class that we delegate too. This takes
11509         care of bug #45876.
11511 2003-07-10  Martin Baulig  <martin@ximian.com>
11513         * expression.cs (TypeOfVoid): New class.
11514         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11516 2003-07-10  Martin Baulig  <martin@ximian.com>
11518         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11519         bug #35957.
11521 2003-07-10  Martin Baulig  <martin@ximian.com>
11523         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11524         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11526         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11528         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11530 2003-07-10  Martin Baulig  <martin@ximian.com>
11532         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11533         of decimal.  Fixes #42850.
11535         NOTE: I also fixed the created byte blob, but this doesn't work on
11536         the MS runtime and csc never produces any byte blobs for decimal
11537         arrays.
11539 2003-07-10  Martin Baulig  <martin@ximian.com>
11541         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11542         structs; fixes #32068.
11543         (Block.AddChildVariableNames): Fixed #44302.
11545 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11547         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11549 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11551         * attribute.cs: And this test is onger needed.
11553 2003-07-08  Martin Baulig  <martin@ximian.com>
11555         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11556         inaccessible types.  Fixes #36313.
11558         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11560         * namespace.cs (NamespaceEntry): Create implicit entries for all
11561         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11562         implicit entries for N1.N2 and N1.
11564 2003-07-08  Martin Baulig  <martin@ximian.com>
11566         Rewrote the handling of namespaces to fix a lot of the issues
11567         wrt. `using' aliases etc.
11569         * namespace.cs (Namespace): Splitted this class into a
11570         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11572         * typemanager.cs (TypeManager.IsNamespace): Removed.
11573         (TypeManager.ComputeNamespaces): Only compute namespaces from
11574         loaded assemblies here, not the namespaces from the assembly we're
11575         currently compiling.
11577 2003-07-08  Martin Baulig  <martin@ximian.com>
11579         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11581 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11583         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11584         already fixed it.  
11586         I thought about the memory savings here, but LookupTypeReflection
11587         is used under already very constrained scenarios.  Compiling
11588         corlib or mcs only exposes one hit, so it would not really reduce
11589         any memory consumption.
11591 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11593         * typemanager.cs: fixes bug #45889 by only adding public types from
11594         other assemblies to the list of known types.
11596 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11598         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11599         on the type we resolved.
11601 2003-07-05  Martin Baulig  <martin@ximian.com>
11603         * pending.cs (PendingImplementation.ParentImplements): Don't
11604         create the proxy if the parent is abstract.
11606         * class.cs (TypeContainer.DefineIndexers): Process explicit
11607         interface implementations first.  Fixes #37714.
11609 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11611         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11612         defined recursively;  but since we modify the input parameters
11613         (left is set to `this' temporarily), we reset this value if the
11614         left_is_explicit is false, which gives the original semantics to
11615         the code.  
11617         * literal.cs (NullPointer): new class used to represent a null
11618         literal in a pointer context.
11620         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11621         type is a pointer, use a NullPointer object instead of a
11622         NullLiteral.   Closes 43687
11624         (ExplicitConversion): Convert pointer values using
11625         the conv opcode to the proper type.
11627         * ecore.cs (New): change ValueTypeVariable property into a method,
11628         that returns whether the valuetype is suitable for being used.
11630         * expression.cs (Binary.DoNumericPromotions): Only return if we
11631         the int constant was a valid uint, and we can return both left and
11632         right as uints.  If not, we continue processing, to trigger the
11633         type conversion.  This fixes 39018.
11635         * statement.cs (Block.EmitMeta): During constant resolution, set
11636         the CurrentBlock property on the emitcontext, so that we resolve
11637         constants propertly.
11639 2003-07-02  Martin Baulig  <martin@ximian.com>
11641         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11642         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11644         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11645         than emitting it here.
11647         * statement.cs: Fixed some more flow analysis bugs.
11649 2003-07-02  Martin Baulig  <martin@ximian.com>
11651         * class.cs (MethodData.Define): When implementing interface
11652         methods, set Final unless we're Virtual.
11654         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11655         check work for interface methods.
11657 2003-07-01  Martin Baulig  <martin@ximian.com>
11659         * ecore.cs (EmitContext.This): Replaced this property with a
11660         GetThis() method which takes a Location argument.  This ensures
11661         that we get the correct error location for a CS0188.
11663 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11665         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11666         ImplicitStandardConversion.
11668         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11670 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11672         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11673         optimization.
11675 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11677         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11678         constructors.
11680         (MethodData.Define): Turn off initlocals for unsafe methods.
11682 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11684         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11685         complete;  Fixes #37521.
11687         * delegate.cs: Use Modifiers.TypeAttr to compute the
11688         TypeAttributes, instead of rolling our own.  This makes the flags
11689         correct for the delegates.
11691 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11693         * class.cs (Constructor.Define): Set the private flag for static
11694         constructors as well.
11696         * cs-parser.jay (statement_expression): Set the return value to
11697         null, to avoid a crash when we catch an error.
11699 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11701         * cs-parser.jay: Applied patch from Jackson that adds support for
11702         extern and unsafe modifiers to destructor declarations.
11704         * expression.cs: Report error 21 if the user is trying to index a
11705         System.Array.
11707         * driver.cs: Add an error message, suggested by the bug report.
11709         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11710         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11712 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11714         * namespace.cs: Add some information to reduce FAQs.
11716 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11718         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11719         underlying enumeration types.  Fixes #43915.
11721         * expression.cs: Treat ushort/short as legal values to be used in
11722         bitwise operations.
11724 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11726         * delegate.cs: transfer custom attributes for paramenters from
11727         the delegate declaration to Invoke and BeginInvoke.
11729 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11731         * attribute.cs: handle custom marshalers and emit marshal info
11732         for fields, too.
11734 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11736         * makefile.gnu: Added anonymous.cs to the compiler sources.
11738 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11740         * iterators.cs: Change the name of the proxy class to include two
11741         underscores.
11743         * cs-parser.jay: Update grammar to include anonymous methods.
11745         * anonymous.cs: new file.
11747 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11749         * class.cs (Field.Define): Add missing test for pointers and
11750         safety. 
11752 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11754         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11755         we use the stobj opcode.
11757         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11758         since it wasn't the correct fix. 
11760         It still is puzzling that we are required to use stobj for IntPtr
11761         which seems to be a ValueType.
11763 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11765         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11766         during regular simple name resolution.   Now, the trick is that
11767         instead of returning for processing the simplename, we do a
11768         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11769         contextual lookup type).   If a match is found, return that, if
11770         not, return for further composition.
11772         This fixes long-standing 30485.
11774         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11775         using the address to initialize an object, do an Stobj instead of
11776         using the regular Stelem.
11778         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11779         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11780         Because if we are a BaseIndexerAccess that value will be true.
11781         Fixes 43643.
11783         * statement.cs (GotoCase.Resolve): Return after reporting an
11784         error, do not attempt to continue. 
11786         * expression.cs (PointerArithmetic.Emit): If our operand is a
11787         long, convert our constants to match the operand before
11788         multiplying.  Convert to I type before adding.   Fixes 43670.
11790 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11792         * enum.cs (ImplicitConversionExists) : Rename to
11793         ImplicitEnumConversionExists to remove ambiguity. 
11795         * ecore.cs (NullCast): New type of cast expression class which
11796         basically is very similar to EmptyCast with the difference being
11797         it still is a constant since it is used only to cast a null to
11798         something else
11799         (eg. (string) null)
11801         * convert.cs (ImplicitReferenceConversion): When casting a null
11802         literal, we return a NullCast.
11804         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11805         should be around anymore.
11807         The renaming (reported was slightly wrong). Corrections:
11809         ConvertImplicitStandard -> ImplicitConversionStandard
11810         ConvertExplicitStandard -> ExplicitConversionStandard
11812         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11813         before passing them in !
11815         * convert.cs (ImplicitConversionStandard): When comparing for
11816         equal expr and target types, ensure that expr is not a
11817         NullLiteral.
11819         In general, we must not be checking (expr_type ==
11820         target_type) in the top level conversion methods
11821         (ImplicitConversion, ExplicitConversion etc). This checking is
11822         done in the methods that they delegate to.
11824 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11826         * convert.cs: Move Error_CannotConvertType,
11827         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11828         ImplicitNumericConversion, ImplicitConversionExists,
11829         ImplicitUserConversionExists, StandardConversionExists,
11830         FindMostEncompassedType, FindMostSpecificSource,
11831         FindMostSpecificTarget, ImplicitUserConversion,
11832         ExplicitUserConversion, GetConversionOperators,
11833         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11834         TryImplicitIntConversion, Error_CannotConvertImplicit,
11835         ConvertImplicitRequired, ConvertNumericExplicit,
11836         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11837         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11838         its own file.
11840         Perform the following renames:
11842         StandardConversionExists -> ImplicitStandardConversionExists
11843         ConvertImplicit -> ImplicitConversion
11844         ConvertImplicitStandard -> ImplicitStandardConversion
11845         TryImplicitIntConversion -> ImplicitIntConversion
11846         ConvertImplicitRequired -> ImplicitConversionRequired
11847         ConvertNumericExplicit -> ExplicitNumericConversion
11848         ConvertReferenceExplicit -> ExplicitReferenceConversion
11849         ConvertExplicit -> ExplicitConversion
11850         ConvertExplicitStandard -> ExplicitStandardConversion
11852 2003-05-19  Martin Baulig  <martin@ximian.com>
11854         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11855         (TypeInfo): Added support for structs having structs as fields.
11857         * ecore.cs (FieldExpr): Implement IVariable.
11858         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11859         VariableInfo for the field.
11861 2003-05-18  Martin Baulig  <martin@ximian.com>
11863         * expression.cs (This.DoResolve): Report a CS0027 if we're
11864         emitting a field initializer.
11866 2003-05-18  Martin Baulig  <martin@ximian.com>
11868         * expression.cs (This.ResolveBase): New public function.
11869         (This.DoResolve): Check for CS0188.
11871         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11872         This.Resolve().
11874         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11875         `instance_expression' to null if we don't have any non-static
11876         methods.
11878 2003-05-18  Martin Baulig  <martin@ximian.com>
11880         Reworked the way how local variables and parameters are handled by
11881         the flow analysis code.
11883         * statement.cs (TypeInfo, VariableMap): New public classes.
11884         (VariableInfo): New public class.  This is now responsible for
11885         checking whether a variable has been assigned.  It is used for
11886         parameters and local variables.
11887         (Block.EmitMeta): Take the InternalParameters as argument; compute
11888         the layout of the flow vectors here.
11889         (Block.LocalMap, Block.ParameterMap): New public properties.
11890         (FlowBranching): The .ctor doesn't get the InternalParameters
11891         anymore since Block.EmitMeta() now computes the layout of the flow
11892         vector.
11893         (MyStructInfo): This class is now known as `StructInfo' and nested
11894         in `TypeInfo'; we don't access this directly anymore.
11896         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11897         property and removed IsAssigned(), IsFieldAssigned(),
11898         SetAssigned() and SetFieldAssigned(); we now call them on the
11899         VariableInfo so we don't need to duplicate this code everywhere.
11901         * expression.cs (ParameterReference): Added `Block block' argument
11902         to the .ctor.
11903         (LocalVariableReference, ParameterReference, This): The new
11904         VariableInfo class is now responsible for all the definite
11905         assignment stuff.
11907         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11908         IsParameterAssigned, SetParameterAssigned): Removed.
11910 2003-05-18  Martin Baulig  <martin@ximian.com>
11912         * typemanager.cs (InitCoreTypes): Try calling
11913         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11914         the 3-args-version.  Corlib now also needs our `void_type'.
11915         (GetMethod): Added overloaded version which takes an optional
11916         `bool report_errors' to allow lookups of optional methods.
11918 2003-05-12  Martin Baulig  <martin@ximian.com>
11920         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11921         only used for locals and not for parameters.
11923 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11925         * support.cs (InternalParameters.ParameterType): Return the
11926         ExternalType of the parameter.
11928         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11929         they were unused.
11931 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11933         * class.cs (MethodData.Define): Do not set the `newslot' on
11934         interface members, if they are also flagged as "override".
11936         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11937         better code for ++i and i++.  This only works for static fields
11938         and local variables.
11940         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11941         want to pull the DeclSpace out of the builder_to_declspace instead
11942         of the TypeBuilder (like in TypeContainer.FindMembers).
11944         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11945         instead of LookupTypeContainer.  Fixes the crash on .NET for
11946         looking up interface members.
11948         * const.cs: Create our own emit context during the Definition
11949         stage, so that constants are evaluated in the proper context, when
11950         a recursive definition happens.
11952 2003-05-11  Martin Baulig  <martin@ximian.com>
11954         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11955         new block for a switch section.
11956         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11957         the adding/lookup in the switch block.  Fixes #39828.
11959 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11961         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11962         functionality: I needed to convert the data after I had performed
11963         the add/sub operation into the operands type size.
11965         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11966         pass the type for the box operation, otherwise the resulting
11967         object would have been of type object.
11969         (BoxedCast): Add constructor to specify the type to box as.
11971 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11973         * iterators.cs: I was reusing the `count' variable inadvertently,
11974         take steps to not allow this to happen.
11976 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11978         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11979         by creating an array at the point where the params starts and
11980         putting all those arguments there, then adjusting the size of the
11981         array.
11983 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11985         * expression.cs (New.AddressOf): Implement interface
11986         IMemoryLocation.  This is used when the `new' operator is used in
11987         the context of an invocation to a method on a value type.
11989         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11990         example. 
11992         * namespace.cs: Also check the using aliases here.
11994         * driver.cs: Move the test for using validity after the types have
11995         been entered, so we do a single pass that also includes the using
11996         aliases. 
11998         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11999         in the regular case.   CreateSiblingForFinally is doing extra
12000         error checking.
12002         * attribute.cs (GetAttributeArgumentExpression): Store the result
12003         on an out value, and use the return value to indicate failure
12004         instead of using null (which is a valid return for Constant.GetValue).
12006         * statement.cs: Perform the analysis flow for the increment
12007         portion after the statement, because this will be the real flow of
12008         execution.  Fixes #42385
12010         * codegen.cs (EmitContext.EmitArgument,
12011         EmitContext.EmitStoreArgument): New helper functions when the
12012         RemapToProxy flag is set.
12014         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12015         function.
12017         Add support for remapping parameters. 
12019         * iterators.cs: Propagate parameter values;  Store parameter
12020         values in the proxy classes.
12022 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12024         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12025         need a proxy reference;  I do not know what I was thinking
12027         * cs-parser.jay (constructor_initializer): catch another error,
12028         and display nice message.
12030         (field_declaration): catch void field declaration
12031         to flag a better error. 
12033         * class.cs (MemberBase.CheckBase): Report an error instead of a
12034         warning if a new protected member is declared in a struct. 
12035         (Field.Define): catch the error of readonly/volatile.
12037         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12039         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12040         volatile variable is taken
12042 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12044         * statement.cs (Fixed.Resolve): Report an error if we are not in
12045         an unsafe context.
12047 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12049         * typemanager.cs: reuse the code that handles type clashes for
12050         delegates and enumerations.
12052         * class.cs (Report28): Always report.
12054         * expression.cs (EncodeAsAttribute): Allow nulls here.
12056 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12058         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12059         the functionality for testing whether an expression is valid for
12060         an attribute here.  Also handle the case of arrays of elements
12061         being stored. 
12063         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12064         encoding a linear array into an array of objects that are suitable
12065         to be passed to an CustomAttributeBuilder.
12067         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12069         * ecore.cs: (FieldExpr): Handle field remapping here.
12071         * iteratators.cs: Pass the instance variable (if the method is an
12072         instance method) to the constructors, so we can access the field
12073         variables on the class.
12075         TODO: Test this with structs.  I think the THIS variable on
12076         structs might have to be a pointer, and not a refenrece
12078 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12080         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12081         local variables to fields in a proxy class.
12083         * iterators.cs (PopulateProxy): Rename our internal fields to
12084         <XXX>.  
12085         Create a <THIS> field if we are an instance method, so we can
12086         reference our parent container variables.
12087         (MapVariable): Called back from the EmitContext code to enter a
12088         new variable to field mapping into the proxy class (we just create
12089         a FieldBuilder).
12091         * expression.cs
12092         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12093         for using the remapped locals to fields.
12095         I placed the code here, because that gives the same semantics to
12096         local variables, and only changes the Emit code.
12098         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12099         statements inside iterators.
12100         (VariableInfo): Add a FieldBuilder for the cases when we are
12101         remapping local variables to fields in a proxy class
12103         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12104         current_block != null.
12106         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12107         not cope with strings, as it has been moved to the
12108         TableSwitchEmit.  Fixed bug in switch generation.
12110         * expression.cs (New.DoResolve): Provide more context for the user
12111         when reporting an error.
12113         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12114         pointers. 
12116         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12117         check the permissions for it.  Note than in a type-resolution
12118         context the check was already present in DeclSpace.ResolveType,
12119         but was missing from the MemberAccess.
12121         (ArrayCreation.CheckIndices): warn if the user has
12122         more nested levels of expressions, but there are no more
12123         dimensions specified.  Avoids crash on bug 41906.
12125 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12127         * statement.cs (Block): replace Implicit bool, for a generic
12128         flags.   
12129         New flag: `Unchecked'.  This is used during the EmitMeta phase
12130         (which is out-of-line with the regular Resolve/Emit process for a
12131         statement, as this is done ahead of time, but still gets a chance
12132         to call constant resolve).
12134         (Block.Flags): new enum for adding a new flag.
12136         (Block.EmitMeta): track the state of unchecked.
12138         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12139         to enable constant resolution to work there as well.
12141 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12143         * typemanager.cs (ienumerable_type): Also look up
12144         System.Collections.IEnumerable. 
12146 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12148         TODO: Test more than one conditional per method.
12150         * class.cs (Indexer.Define): Report the location where the user is
12151         referencing the unsupported feature.
12153         (MethodData): Overload the use of `conditionals' to
12154         minimize the creation of needless ArrayLists.   This saves roughly
12155         212kb on my machine.
12157         (Method): Implement the new IIteratorContainer interface.
12158         (Method.SetYields): Implement the method by setting the ModFlags
12159         to contain METHOD_YIELDS.
12161         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12162         which just got set to null.
12164         * iterators.cs: New file.
12166         (Yield, YieldBreak): New statements.
12168         * statement.cs (Return.Resolve): Flag an error if we are used in
12169         an iterator method.
12171         * codegen.cs (InIterator): New flag set if the code is being
12172         compiled in an iterator method.
12174         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12175         internal modifier, and we just use it to avoid adding extra
12176         fields, as this is seldom used.  
12178         * cs-parser.jay: Add yield_statement (yield and yield break).
12180         * driver.cs: New flag -v2 to turn on version 2 features. 
12182         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12183         hashtable when v2 is enabled.
12185 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12187         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12188         there is already a namespace defined with this name.
12190         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12191         people upgraded their corlibs.
12193         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12194         always use fully qualified types, no need to use the compiler
12195         front end.
12197         (TypeManager.IsNamespace): Use binarysearch.
12199         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12200         AddDelegate): I did not quite use the new IsValid API properly: I
12201         have to pass the short-name and the fullname.  I was passing only
12202         the basename instead of the fullname sometimes. 
12204         (TypeContainer.DefineType): call NamespaceClash.
12206         * interface.cs (Interface.DefineType): use NamespaceClash before
12207         defining the type.
12209         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12210         defining the type.
12212         * enum.cs: (Enum.DefineType): use NamespaceClash before
12213         defining the type.
12215         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12216         speed increase.  First, use the negative_hits cache when we get a
12217         negative.  Second, add the type with its full original name
12218         instead of the new . and + encoded name (reflection uses + to
12219         separate type from a nested type).  Use LookupTypeReflection
12220         directly which bypasses the type->name hashtable (that we already
12221         know does not contain the type.
12223         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12224         location/container type. 
12226         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12228 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12230         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12232         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12233         method is being referenced in the method group from a static
12234         context, and report error 120 if so.
12236         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12237         Error118. 
12239         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12240         is created, we create the A namespace).
12242         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12243         Fixes #41591
12245 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12247         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12248         invocation to ModuleBuilder.GetType with the same values will
12249         return a new type instance, so we need to cache its return
12250         values. 
12252         * expression.cs (Binary.ResolveOperator): Only allow the compare
12253         operators on enums if they are of the same type.
12255         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12256         types of ValueType on their own case.  Before we were giving them
12257         the same treatment as objects.
12259         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12260         fullname.  Short name is used to compare against container name.
12261         Fullname is used to check against defined namespace names.
12263         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12264         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12266         (Method.CheckBase): Call parent.
12267         (MemberBase.CheckBase): Check for protected members on sealed
12268         classes.
12269         (PropertyBase.CheckBase): Call parent.
12270         (Field.Define): Call parent.
12272         * report.cs: Negative error codes are now mapped to 8000 - code,
12273         so that the display is render more nicely.
12275         * typemanager.cs: Do not use try/catch, instead report a regular
12276         error. 
12278         (GetPointerType, GetReferenceType): These methods provide
12279         mechanisms to obtain the T* and T& from a T.  We had the code
12280         previously scattered around the code base, and it also used
12281         TypeManager.LookupType that would go through plenty of caches.
12282         This one goes directly to the type source.
12284         In some places we did the Type.GetType followed by
12285         ModuleBuilder.GetType, but not in others, so this unifies the
12286         processing as well.
12288         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12289         statements now that we have namespace information.
12291         * typemanager.cs (IsNamespace): New method, returns whether the
12292         string presented is a namespace or not.
12294         (ComputeNamespaces): New public entry point, computes the list of
12295         available namespaces, using the GetNamespaces API call in Mono, or
12296         the slower version in MS.NET.   
12298         Now before we start the semantic analysis phase, we have a
12299         complete list of namespaces including everything that the user has
12300         provided.
12302         Deleted old code to cache namespaces in .nsc files.
12304 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12306         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12307         class/struct location definition Location for the implicit
12308         constructor location.
12310         (Operator.Define): Use the location of the operator for the
12311         implicit Method definition.
12313         (Constructor.Emit): use the constructor location for the implicit
12314         base initializer constructor.
12316         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12317         and the Expression class now contains two new methods:
12319         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12320         isolate type lookup from the rest of the resolution process.
12322         Since we use Expressions to hold type definitions due to the way
12323         we parse the input we have historically overloaded Resolve to
12324         perform the Type lookups if a special flag is passed.  Now this is
12325         eliminated and two methods take their place. 
12327         The differences in the two methods between xStep and xTerminal is
12328         that xStep is involved in our current lookup system that uses
12329         SimpleNames to compose a name, while xTerminal is used just to
12330         catch the case where the simplename lookup failed.
12332 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12334         * expression.cs (ResolveMemberAccess): Remove redundant code.
12335         TypeExpr expressions are always born fully resolved.
12337         * interface.cs (PopulateMethod): Do not lookup the types twice.
12338         We were doing it once during SemanticAnalysis and once during
12339         PopulateMethod.
12341         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12342         in local variable type definitions, were being returned as a
12343         SimpleName (we decomposed everything into a string), that is
12344         because primary_expression was being used instead of a type in the
12345         grammar (reduce/reduce conflicts).
12347         The part that was wrong is that we converted the expression into a
12348         string (an oversimplification in one hand, compounded with primary
12349         expressions doing string concatenation).
12351         So things like:
12353         A.B.C [] x;
12355         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12356         using clauses from working on this particular context.  And a type
12357         was being matched directly against "A.B.C[]".
12359         We now use the correct approach, and allow for ComposedCast to be
12360         part of the unary expression.  So the "A.B.C []" become a composed
12361         cast of "A.B.C" (as a nested group of MemberAccess with a
12362         SimpleName at the end) plus the rank composition "[]". 
12364         Also fixes 35567
12366 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12368         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12369         for the access level checking.
12371         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12372         `TypeContainer container', because I kept getting confused when I
12373         was debugging this code.
12375         * expression.cs (Indexers): Instead of tracking getters/setters,
12376         we now track them in parallel.  We create one arraylist less, but
12377         most importantly it is possible now for the LValue code to find a
12378         matching get for a set.
12380         (IndexerAccess.DoResolveLValue): Update the code.
12381         GetIndexersForType has been modified already to extract all the
12382         indexers from a type.  The code assumed it did not.
12384         Also make the code set the correct return type for the indexer.
12385         This was fixed a long time ago for properties, but was missing for
12386         indexers.  It used to be void_type.
12388         (Binary.Emit): Test first for doubles instead of
12389         floats, as they are more common.
12391         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12392         when dealing with floats and the <=, >= operators.  This fixes bug
12393         #39314 
12395         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12396         to load the array value by emitting a load on the foreach variable
12397         type.  This was incorrect.  
12399         We now emit the code to load an element using the the array
12400         variable type, and then we emit the conversion operator.
12402         Fixed #40176
12404 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12406         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12408 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12410         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12411         test for protection before we test for signatures. 
12413         (MethodSignature.ToString): implement.
12415         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12416         to the case where we reduced into a LongConstant.
12418         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12419         depend on whether the information is acurrate, because the
12420         Microsoft runtime will always claim that the array type is public,
12421         regardless of the real state.
12423         If the type is a pointer, another problem happens: the type is
12424         reported as non-public in Microsoft.  
12426         In both cases we have to call CheckAccessLevel recursively with
12427         the underlying type as the argument to be tested.
12429 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12431         * assign.cs (Assign.Emit): If we are dealing with a compound
12432         assignment expression, we should use the code path that stores the
12433         intermediate result in a temporary value.  This fixes #40903.
12435         *expression.cs (Indirection.ToString): Provide ToString method for
12436         debugging. 
12438 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12440         * class.cs: Null out fields holding references to Block objects so
12441         they can be garbage collected.
12443         * expression.cs (OverloadResolve): Remove unused local.
12445 2003-04-07  Martin Baulig  <martin@ximian.com>
12447         * codegen.cs (EmitContext.CurrentFile): New public field.
12448         (EmitContext.Mark): Use the CurrentFile to check whether the
12449         location is in the correct file.
12450         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12452 2003-04-07  Martin Baulig  <martin@ximian.com>
12454         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12456         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12457         location.  [FIXME: The location argument which gets passed to this
12458         method is sometimes wrong!]
12460 2003-04-07  Nick Drochak <ndrochak@gol.com>
12462         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12464 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12466         * expression.cs (Indirection.EmitAssign): We were using the
12467         temporary, but returning immediately instead of continuing the
12468         EmitAssing flow.
12470 2003-04-06  Martin Baulig  <martin@ximian.com>
12472         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12473         if it's a nested child, but also deriving from the outer class.
12474         See test 190.cs.
12476         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12477         nested child, but also deriving from the outer class.  See
12478         test-190.cs.
12479         (FilterWithClosure): We may access private members of the outer
12480         class if we're a nested child and deriving from the outer class.
12481         (RealMemberLookup): Only set `closure_private_ok' if the
12482         `original_bf' contained BindingFlags.NonPublic.
12484 2003-04-05  Martin Baulig  <martin@ximian.com>
12486         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12488 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12490         * class.cs (Event.Define): Do not allow abstract events to have
12491         initializers. 
12493 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12495         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12496         block in event declarations.
12498         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12499         value type, get its address.
12501         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12502         leaving a class on the stack instead of a boolean value (int
12503         0/1).  Change the code so we compare against null, and then the
12504         result against zero.
12506         * class.cs (TypeContainer.GetClassBases): We were checking for the
12507         parent class being sealed too late.
12509         * expression.cs (Binary.Emit): For <= and >= when dealing with
12510         floating point values, use cgt.un and clt.un instead of cgt and
12511         clt alone.
12513 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12515         * statement.cs: Apply the same optimization as MS: skip the 
12516         GetEnumerator returning an IEnumerator, and use the one returning a 
12517         CharEnumerator instead. This allows us to avoid the try-finally block 
12518         and the boxing.
12520 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12522         * cs-parser.jay: Attributes cannot be applied to
12523                          namespaces. Fixes #40473
12525 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12527         * class.cs:
12528         (Add*): check if the name is valid using the full name for constants,
12529         fields, properties and events.
12531 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12533         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12534         char constants to be part of the enumeration.
12536         * expression.cs (Conditional.DoResolve): Add support for operator
12537         true. Implements the missing functionality from 14.12
12539         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12540         operator true/false as required by the spec.
12542         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12543         implicit conversion to boolean.
12545         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12546         also one where the type implements `operator true'. 
12548         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12549         get an expression that will invoke operator true based on an
12550         expression.  
12552         (GetConversionOperators): Removed the hack that called op_True
12553         here.  
12555         (Expression.ResolveBoolean): Move this from Statement.
12557 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12559         * ecore.cs (FieldExpr): do not allow initialization of initonly
12560         fields on derived classes
12562 2003-03-13  Martin Baulig  <martin@ximian.com>
12564         * statement.cs (Block.Emit): Call ig.BeginScope() and
12565         ig.EndScope() when compiling with debugging info; call
12566         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12568 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12570         * expression.cs (Indexers): Do not construct immediately, allow
12571         for new members to be appended as we go.  Fixes 38143
12573 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12575         * expression.cs: save/restore context when resolving an unchecked
12576         expression.
12578 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12580         * cfold.cs: Catch division by zero in modulus operator during
12581         constant folding.
12583 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12585         * interface.cs (Interface.DefineMembers): Avoid defining members
12586         twice. 
12588 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12590         * driver.cs: handle the +/- options for -noconfig
12592         * statement.cs (Unckeched.Resolve): Also track the state of
12593         unchecked in the Resolve phase.
12595 2003-02-27  Martin Baulig  <martin@ximian.com>
12597         * ecore.cs (Expression.MemberLookup): Don't create a
12598         MethodGroupExpr for something which is not a method.  Fixes #38291.
12600 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12602         * class.cs (MemberBase.CheckParameters): Also check that the type
12603         is unmanaged if it is a pointer.
12605         * expression.cs (SizeOf.Resolve): Add location information.
12607         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12608         a managed type is declared.
12610         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12611         parameter modifiers as well.  Fixes bug 38606
12613         * class.cs: Very sad.  Am backing out the speed up changes
12614         introduced by the ArrayList -> Array in the TypeContainer, as they
12615         were not actually that much faster, and introduced a bug (no error
12616         reports on duplicated methods).
12618         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12619         source first, this will guarantee that we have a valid expression
12620         before calling in lower levels functions that will require a
12621         resolved object.  Then use this original_source in the
12622         target.ResolveLValue instead of the original source that was
12623         passed to us.
12625         Another change.  Use target.Resolve instead of LValueResolve.
12626         Although we are resolving for LValues, we will let the Assign code
12627         take care of that (it will be called again from Resolve).  This
12628         basically allows code like this:
12630         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12631         class Y { void A (X x) { x [0] += o; }
12633         The problem was that the indexer was trying to resolve for
12634         set_Item (idx, object o) and never finding one.  The real set_Item
12635         was set_Item (idx, X).  By delaying the process we get the right
12636         semantics. 
12638         Fixes bug 36505
12640 2003-02-23  Martin Baulig  <martin@ximian.com>
12642         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12643         while calling DoEmit ().
12645         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12646         source files; if you use the #line directive inside a method, the
12647         compiler stops emitting line numbers for the debugger until it
12648         reaches the end of the method or another #line directive which
12649         restores the original file.
12651 2003-02-23  Martin Baulig  <martin@ximian.com>
12653         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12655 2003-02-23  Martin Baulig  <martin@ximian.com>
12657         * statement.cs (Block.AddChildVariableNames): We need to call this
12658         recursively, not just for our immediate children.
12660 2003-02-23  Martin Baulig  <martin@ximian.com>
12662         * class.cs (Event.Define): Always make the field private, like csc does.
12664         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12665         actually work, fixes bug #37521.
12667 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12669         * delegate.cs: When creating the various temporary "Parameters"
12670         classes, make sure that we call the ComputeAndDefineParameterTypes
12671         on those new parameters (just like we do with the formal ones), to
12672         allow them to be resolved in the context of the DeclSpace.
12674         This fixes the bug that Dick observed in Bugzilla #38530.
12676 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12678         * expression.cs (ResolveMemberAccess): When resolving a constant,
12679         do not attempt to pull a constant if the value was not able to
12680         generate a valid constant.
12682         * const.cs (LookupConstantValue): Do not report more errors than required.
12684 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12686         * expression.cs: fixes bug #38328.
12688 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12690         * class.cs: Changed all the various members that can be part of a
12691         class from being an ArrayList to be an Array of the right type.
12692         During the DefineType type_list, interface_list, delegate_list and
12693         enum_list are turned into types, interfaces, delegates and enums
12694         arrays.  
12696         And during the member population, indexer_list, event_list,
12697         constant_list, field_list, instance_constructor_list, method_list,
12698         operator_list and property_list are turned into their real arrays.
12700         Although we could probably perform this operation earlier, for
12701         good error reporting we need to keep the lists and remove the
12702         lists for longer than required.
12704         This optimization was triggered by Paolo profiling the compiler
12705         speed on the output of `gen-sample-program.pl' perl script. 
12707         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12708         not crash in methods like MemberLookupFailed that use this field.  
12710         This problem arises when the compiler fails to resolve a type
12711         during interface type definition for example.
12713 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12715         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12716         inherit from System.Object, so we have to stop at null, not only
12717         when reaching System.Object.
12719 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12721         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12722         DeclaredOnly because the parent indexer might have had a different
12723         name, but did not loop until the top of the hierarchy was reached.
12725         The problem this one fixes is 35492: when a class implemented an
12726         indexer from an interface, we were getting the interface method
12727         (which was abstract) and we were flagging an error (can not invoke
12728         abstract method).
12730         This also keeps bug 33089 functioning, and test-148 functioning.
12732         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12733         out if a method is special is to see if it is declared in a
12734         property or event, or whether it is one of the predefined operator
12735         names.   This should fix correctly #36804.
12737 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12739         The goal here is to remove the dependency on EmptyCast.Peel ().
12740         Killing it completely.
12742         The problem is that currently in a number of places where
12743         constants are expected, we have to "probe" for an EmptyCast, and
12744         Peel, which is not the correct thing to do, as this will be
12745         repetitive and will likely lead to errors. 
12747         The idea is to remove any EmptyCasts that are used in casts that
12748         can be reduced to constants, so we only have to cope with
12749         constants. 
12751         This bug hunt was triggered by Bug 37363 and the desire to remove
12752         the duplicate pattern where we were "peeling" emptycasts to check
12753         whether they were constants.  Now constants will always be
12754         constants.
12756         * ecore.cs: Use an enumconstant here instead of wrapping with
12757         EmptyCast.  
12759         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12760         throwing me off.  By handling this we can get rid of a few hacks.
12762         * statement.cs (Switch): Removed Peel() code.
12764 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12766         * class.cs: Location information for error 508
12768         * expression.cs (New.DoResolve): Add a guard against double
12769         resolution of an expression.  
12771         The New DoResolve might be called twice when initializing field
12772         expressions (see EmitFieldInitializers, the call to
12773         GetInitializerExpression will perform a resolve on the expression,
12774         and later the assign will trigger another resolution
12776         This leads to bugs (#37014)
12778         * delegate.cs: The signature for EndInvoke should contain any ref
12779         or out parameters as well.  We were not doing this in the past. 
12781         * class.cs (Field.Define): Do not overwrite the type definition
12782         inside the `volatile' group.  Turns out that volatile enumerations
12783         were changing the type here to perform a validity test, which
12784         broke conversions. 
12786 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12788         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12789         and structs, we do not want to load the instance variable
12791         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12792         enum_type has to be handled like an object reference (implicit
12793         conversions exists from this to object), but the regular IsClass
12794         and IsValueType tests will never return true for this one.
12796         Also we use TypeManager.IsValueType instead of type.IsValueType,
12797         just for consistency with the rest of the code (this is only
12798         needed if we ever use the construct exposed by test-180.cs inside
12799         corlib, which we dont today).
12801 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12803         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12804         just InternalCall.
12806 2003-02-09  Martin Baulig  <martin@ximian.com>
12808         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12809         (Namespace.DefineNamespaces): New static public method; this is
12810         called when we're compiling with debugging to add all namespaces
12811         to the symbol file.
12813         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12814         pass it to the Namespace's .ctor.
12816         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12817         and MethodBase arguments; pass the namespace ID to the symwriter;
12818         pass the MethodBase instead of the token to the symwriter.
12819         (SymbolWriter.DefineNamespace): New method to add a namespace to
12820         the symbol file.
12822 2003-02-09  Martin Baulig  <martin@ximian.com>
12824         * symbolwriter.cs: New file.  This is a wrapper around
12825         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12826         methods here in near future.
12828 2003-02-09  Martin Baulig  <martin@ximian.com>
12830         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12831         ILGenerator.MarkSequencePoint() which are actually used by the
12832         symbol writer.
12834 2003-02-09  Martin Baulig  <martin@ximian.com>
12836         * location.cs (SourceFile): New public sealed class.  This
12837         contains the name and an index which is used in the location's token.
12838         (Location): Reserve an appropriate number of bits in the token for
12839         the source file instead of walking over that list, this gives us a
12840         really huge performance improvement when compiling with debugging.
12842         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12843         `SourceFile' argument instead of a string.
12844         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12845         but don't parse/tokenize here, we need to generate the list of all
12846         source files before we do that.
12847         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12848         the files.
12850         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12851         instead of a string.
12853         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12854         of a string.
12856 2003-02-09  Martin Baulig  <martin@ximian.com>
12858         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12859         filename on `#line default'.
12861 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12863         * statement.cs: don't clear the pinned var when the fixed statement
12864         returns from the method (fixes bug#37752).
12866 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12868         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12869         to IsValueType.
12871 2003-02-07  Martin Baulig  <martin@ximian.com>
12873         * driver.cs: Removed the `--debug-args' command line argument.
12875         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12876         automatically by the AsssemblyBuilder.
12877         (CodeGen.InitializeSymbolWriter): We don't need to call any
12878         initialization function on the symbol writer anymore.  This method
12879         doesn't take any arguments.
12881 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12883         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12884         from referenced assemblies as well.
12886 2003-02-02  Martin Baulig  <martin@ximian.com>
12888         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12890 2003-02-02  Martin Baulig  <martin@ximian.com>
12892         * class.cs (Constructor.Emit): Open the symbol writer before
12893         emitting the constructor initializer.
12894         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12895         single-stepping through constructor initializers.
12897 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12899         * class.cs: Handle error 549: do not allow virtual methods in
12900         sealed classes. 
12902 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12904         * decl.cs: Check access levels when resolving types
12906 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12908         * statement.cs: Add parameters and locals set in catch blocks that might 
12909         return to set vector
12911 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12913         * class.cs (Operator): Set the SpecialName flags for operators.
12915         * expression.cs (Invocation.DoResolve): Only block calls to
12916         accessors and operators on SpecialName methods.
12918         (Cast.TryReduce): Handle conversions from char constants.
12921 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12923         * statement.cs: small memory and time optimization in FlowBranching.
12925 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12927         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12928         problem that the last fix but in the other sid (Set).
12930         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12931         access when there is no indexer in the hierarchy.
12933 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12935         * class.cs: Combine some if statements.
12937 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12939         * driver.cs: fixed bug #37187.
12941 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12943         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12944         any indexer, it's needed to build a list with all the indexers in the
12945         hierarchy (AllGetters), else we have problems. Fixes #35653.
12947 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12949         * class.cs (MethodData.Define): It is wrong for an interface
12950         implementation to be static in both cases: explicit and implicit.
12951         We were only handling this in one case.
12953         Improve the if situation there to not have negations.
12955         * class.cs (Field.Define): Turns out that we do not need to check
12956         the unsafe bit on field definition, only on usage.  Remove the test.
12958 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12960         * driver.cs: use assembly.Location instead of Codebase (the latest
12961         patch made mcs fail when using MS assemblies).
12963 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12965         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12966         get the path to *corlib.dll.
12968 2003-01-21  Nick Drochak <ndrochak@gol.com>
12970         * cs-tokenizer.cs:
12971         * pending.cs:
12972         * typemanager.cs: Remove compiler warnings
12974 2003-01-20  Duncan Mak  <duncan@ximian.com>
12976         * AssemblyInfo.cs: Bump the version number to 0.19.
12978 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12980         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12982 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12984         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12986 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12988         * cs-parser.jay: Small fix: we were not comparing the constructor
12989         name correctly.   Thanks to Zoltan for the initial pointer.
12991 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12993         * cs-tokenizer.cs: Set file name when specified with #line
12995 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12997         * cs-parser.jay: Only perform the constructor checks here if we
12998         are named like the class;  This will help provider a better
12999         error.  The constructor path is taken when a type definition is
13000         not found, but most likely the user forgot to add the type, so
13001         report that rather than the constructor error.
13003 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13005         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13006         allocations.
13008 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13010         * cs-parser.jay: Add cleanup call.
13012 2003-01-13  Duncan Mak  <duncan@ximian.com>
13014         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13015         consistent with other methods.
13017 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13019         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13021 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13023         * attribute.cs: only set GuidAttr to true when we have a
13024         GuidAttribute.
13026 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13028         * ecore.cs:
13029         * expression.cs:
13030         * typemanager.cs: fixes to allow mcs compile corlib with the new
13031         Type.IsSubclassOf fix.
13033 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13035         * expression.cs (LocalVariableReference.DoResolve): Classify a
13036         constant as a value, not as a variable.   Also, set the type for
13037         the variable.
13039         * cs-parser.jay (fixed_statement): take a type instead of a
13040         pointer_type, so we can produce a better error message later.
13042         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13043         as an error.  
13045         (For.DoEmit): Make inifinite loops have a
13046         non-conditional branch back.
13048         (Fixed.DoEmit): First populate the pinned variables, then emit the
13049         statement, then clear the variables.  Before I was emitting the
13050         code once for each fixed piece.
13053 2003-01-08  Martin Baulig  <martin@ximian.com>
13055         * statement.cs (FlowBranching.MergeChild): A break in a
13056         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13058 2003-01-08  Martin Baulig  <martin@ximian.com>
13060         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13061         lives in the same number space than `param_map'.  Fixes #36154.
13063 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13065         * cs-parser.jay (constructor_declaration): Set the
13066         Constructor.ModFlags before probing for it.  This makes the
13067         compiler report 514, 515 and 132 (the code was there, but got
13068         broken). 
13070         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13071         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13072         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13074 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13076         * enum.cs: create the enum static fields using the enum type.
13078 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13080         * class.cs: don't try to create the ParamBuilder for the return
13081         type if it's not needed (and handle it breaking for the ms runtime
13082         anyway).
13084 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13086         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13088 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13090         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13091         the command.   This showed up while compiling the JANET source
13092         code, which used \r as its only newline separator.
13094 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13096         * class.cs (Method.Define): If we are an operator (because it
13097         reuses our code), then set the SpecialName and HideBySig.  #36128
13099 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13101         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13102         exception, report error 120 `object reference required'.
13104         * driver.cs: Add --pause option, used during to measure the size
13105         of the process as it goes with --timestamp.
13107         * expression.cs (Invocation.DoResolve): Do not allow methods with
13108         SpecialName to be invoked.
13110 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13112         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13113         number before adding it.
13115 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13117         * ecore.cs (StandardImplicitConversion): When in an unsafe
13118         context, we allow conversion between void * to any other pointer
13119         type. This fixes bug #35973.
13121 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13123         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13124         is not thrown when extensionless outputs are used 
13126 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13128         * rootcontext.cs: fixed compilation of corlib.
13130 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13132         * attribute.cs (Attributes.Contains): Add new method.
13134         * class.cs (MethodCore.LabelParameters): if the parameter is an
13135         `out' parameter, check that no attribute `[In]' has been passed.
13137         * enum.cs: Handle the `value__' name in an enumeration.
13139 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13141         * decl.cs: Added special case to allow overrides on "protected
13142         internal" methods
13144 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13146         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13147         since it makes much more sense.
13149         (Attributes.ctor): Don't require a Location parameter.
13151         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13153         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13154         since we already have that information per attribute.
13156         * everywhere : make appropriate changes.
13158         * class.cs (LabelParameters): Write the code which actually
13159         applies attributes to the return type. We can't do this on the MS
13160         .NET runtime so we flag a warning in the case an exception is
13161         thrown.
13163 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13165         * const.cs: Handle implicit null conversions here too.
13167 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13169         * class.cs (MethodCore.LabelParameters): Remove the extra
13170         Type [] parameter since it is completely unnecessary. Instead
13171         pass in the method's attributes so that we can extract
13172         the "return" attribute.
13174 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13176         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13177         of ignoring it and letting the compile continue.
13179         * typemanager.cs (ChangeType): use an extra argument to return an
13180         error condition instead of throwing an exception.
13182 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13184         * expression.cs (Unary.TryReduce): mimic the code for the regular
13185         code path.  Perform an implicit cast in the cases where we can
13186         implicitly convert to one of the integral types, and then reduce
13187         based on that constant.   This fixes bug #35483.
13189 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13191         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13193 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13195         * namespace.cs: fixed bug #35489.
13197 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13199         * class.cs: Remove some dead code.
13201         * cs-parser.jay: Estimate the number of methods needed
13202         (RootContext.MethodCount);
13204         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13205         numbers instead of StringBuilders.
13207         * support.cs (PtrHashtable): Add constructor with initial size;
13208         We can now reduce reallocations of the method table.
13210 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13212         * attribute.cs (ApplyAttributes): Keep track of the emitted
13213         attributes on a per-target basis. This fixes bug #35413.
13215 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13217         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13218         default to the Windows 1252 encoding.
13220         (UnixParseOption): Support version, thanks to Alp for the missing
13221         pointer. 
13223         * AssemblyInfo.cs: Add nice assembly information.
13225         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13226         (bug 35169).
13228         * cs-parser.jay: Allow a trailing comma before the close bracked
13229         in the attribute_section production.
13231         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13232         address of the instance was being taken, I will take this out,
13233         because we take the address of the object immediately here.
13235 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13237         * typemanager.cs (AreMultipleAllowed): Take care of the most
13238         obvious case where attribute type is not in the current assembly -
13239         stupid me ;-)
13241 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13243         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13244         definitions, instead of doing that afterwards.  
13246         Also we use a nice little hack, depending on the constructor, we
13247         know if we are a "composed" name or a simple name.  Hence, we
13248         avoid the IndexOf test, and we avoid 
13250         * codegen.cs: Add code to assist in a bug reporter to track down
13251         the source of a compiler crash. 
13253 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13255         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13256         types have been emitted for a given element and flag an error
13257         if something which does not have AllowMultiple set is used more
13258         than once.
13260         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13261         attribute types and their corresponding AllowMultiple properties
13263         (AreMultipleAllowed): Check the property for a given type.
13265         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13266         property in the case we have a TypeContainer.
13268         (Attributes.AddAttribute): Detect duplicates and just skip on
13269         adding them. This trivial fix catches a pretty gross error in our
13270         attribute emission - global attributes were being emitted twice!
13272         Bugzilla bug #33187 is now fixed.
13274 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13276         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13277         instead of pp_and).
13279         * expression.cs (Binary.ResolveOperator): I can only use the
13280         Concat (string, string, string) and Concat (string, string,
13281         string, string) if the child is actually a concatenation of
13282         strings. 
13284 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13286         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13287         context where we need a 2-character lookahead.
13289         * pending.cs (PendingImplementation): Rework so we can keep track
13290         of interface types all the time, and flag those which were
13291         implemented by parents as optional.
13293 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13295         * expression.cs (Binary.ResolveOperator): Use
13296         String.Concat(string,string,string) or
13297         String.Concat(string,string,string,string) when possible. 
13299         * typemanager: More helper methods.
13302 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13304         * pending.cs: remove the bogus return from GetMissingInterfaces()
13305         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13307 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13309         * namespace.cs: avoid duplicated 'using xxx' being added to
13310         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13311         when we get more than one 'using' statement for the same namespace.
13312         Report a CS0105 warning for it.
13314 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13316         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13317         of calling getChar/putback, uses internal knowledge of it.    
13319         (xtoken): Reorder tokenizer so most common patterns are checked
13320         first.  This reduces the compilation time in another 5% (from 8.11s
13321         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13323         The parsing time is 22% of the compilation in mcs, and from that
13324         64% is spent on the tokenization process.  
13326         I tried using a binary search for keywords, but this is slower
13327         than the hashtable.  Another option would be to do a couple of
13328         things:
13330                 * Not use a StringBuilder, instead use an array of chars,
13331                   with a set value.  Notice that this way we could catch
13332                   the 645 error without having to do it *afterwards*.
13334                 * We could write a hand-parser to avoid the hashtable
13335                   compares altogether.
13337         The identifier consumption process takes 37% of the tokenization
13338         time.  Another 15% is spent on is_number.  56% of the time spent
13339         on is_number is spent on Int64.Parse:
13341                 * We could probably choose based on the string length to
13342                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13343                   computations. 
13345         Another 3% is spend on wrapping `xtoken' in the `token' function.
13347         Handle 0xa0 as whitespace (#34752)
13349 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13351         * typemanager.cs (IsCLRType): New routine to tell whether a type
13352         is one of the builtin types.  
13354         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13355         typecode in more places instead of doing pointer comparissions.
13356         We could leverage some knowledge about the way the typecodes are
13357         laid out.
13359         New code to cache namespaces in assemblies, it is currently not
13360         invoked, to be used soon.
13362         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13364         * expression.cs (Binary.ResolveOperator): specially handle
13365         strings, and do not perform user-defined operator overloading for
13366         built-in types.
13368 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13370         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13371         internalcall as it is a pretty simple operation;  Avoid whenever
13372         possible to call Char.IsLetter.
13374         (consume_identifier): Cut by half the number of
13375         hashtable calls by merging the is_keyword and GetKeyword behavior.
13377         Do not short-circuit, because if we do, we
13378         report errors (ie, #if false && true would produce an invalid
13379         directive error);
13382 2002-11-24  Martin Baulig  <martin@ximian.com>
13384         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13385         check constant ranges and report a CS0221.  Fixes #33186.
13387 2002-11-24  Martin Baulig  <martin@ximian.com>
13389         * cs-parser.jay: Make this work for uninitialized variable
13390         declarations in the `for' initializer.  Fixes #32416.
13392 2002-11-24  Martin Baulig  <martin@ximian.com>
13394         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13395         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13397 2002-11-24  Martin Baulig  <martin@ximian.com>
13399         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13400         argument; if true, we also check for user-defined conversions.
13401         This is only needed if both arguments are of a user-defined type.
13402         Fixes #30443, added test-175.cs.
13403         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13405         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13407 2002-11-24  Martin Baulig  <martin@ximian.com>
13409         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13410         function to get the store opcode.
13411         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13412         only emit the Ldelema if the store opcode is Stobj.  You must run
13413         both test-34 and test-167 to test this.  Fixes #34529.
13415 2002-11-23  Martin Baulig  <martin@ximian.com>
13417         * ecore.cs (Expression.MemberLookup): Added additional
13418         `qualifier_type' argument which is used when we're being called
13419         from MemberAccess.DoResolve() and null if we're called from a
13420         SimpleName lookup.
13421         (Expression.MemberLookupFailed): New method to report errors; this
13422         does the CS1540 check and reports the correct error message.
13424         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13425         argument for the CS1540 check and redone the way how we're dealing
13426         with private members.  See the comment in the source code for details.
13427         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13428         `closure_start_type' to `closure_qualifier_type' and check whether
13429         it's not null.  It was not this filter being broken, it was just
13430         being called with the wrong arguments.
13432         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13433         and pass it the correct `qualifier_type'; this also does the error
13434         handling for us.
13436 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13438         * expression.cs (Invocation.EmitParams): If the we are dealing
13439         with a non-built-in value type, load its address as well.
13441         (ArrayCreation): Use a a pretty constant instead
13442         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13443         static initializers.  
13445         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13446         because they are not really value types, just glorified integers. 
13448         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13450         * ecore.cs: Remove redundant code for enumerations, make them use
13451         the same code path as everything else, fixes the casting issue
13452         with enumerations in Windows.Forms.
13454         * attribute.cs: Do only cast to string if it is a string, the
13455         validation happens later.
13457         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13458         people upgrade their corlibs.
13460         * ecore.cs: Oops, enumerations were not following the entire code path
13462 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13464         * typemanager.cs (FilterWithClosure): Commented out the test for
13465         1540 in typemanager.cs, as it has problems when accessing
13466         protected methods from a parent class (see test-174.cs). 
13468         * attribute.cs (Attribute.ValidateGuid): new method.
13469         (Attribute.Resolve): Use above.
13471 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13473         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13475         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13476         handling for enumerations, as we only needed the TypeContainer
13477         functionality to begin with (this is required for the fix below to
13478         work for enums that reference constants in a container class for
13479         example). 
13481         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13483         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13484         a valid TypeBuilder to perform lookups on.o
13486         * class.cs (InheritableMemberSignatureCompare): Use true in the
13487         call to GetGetMethod and GetSetMethod, because we are comparing
13488         the signature, and we need to get the methods *even* if they are
13489         private. 
13491         (PropertyBase.CheckBase): ditto.
13493         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13494         GotoCase.Resolve): Use Peel on EmpytCasts.
13496         * ecore.cs (EmptyCast): drop child, add Peel method.
13498 2002-11-17  Martin Baulig  <martin@ximian.com>
13500         * ecore.cs (EmptyCast.Child): New public property.
13502         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13503         label resolved to an EmptyCast.  Fixes #34162.
13504         (GotoCase.Resolve): Likewise.
13505         (Block.EmitMeta): Likewise.
13507 2002-11-17  Martin Baulig  <martin@ximian.com>
13509         * expression.cs (Invocation.BetterConversion): Prefer int over
13510         uint; short over ushort; long over ulong for integer literals.
13511         Use ImplicitConversionExists instead of StandardConversionExists
13512         since we also need to check for user-defined implicit conversions.
13513         Fixes #34165.  Added test-173.cs.
13515 2002-11-16  Martin Baulig  <martin@ximian.com>
13517         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13518         with the `true' and `false' literals.  Fixes #33151.
13520 2002-11-16  Martin Baulig  <martin@ximian.com>
13522         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13523         October 22nd; don't do the cs1540 check for static members.
13525         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13526         now using our own filter here and doing the cs1540 check again.
13528 2002-11-16  Martin Baulig  <martin@ximian.com>
13530         * support.cs (InternalParameters): Don't crash if we don't have
13531         any fixed parameters.  Fixes #33532.
13533 2002-11-16  Martin Baulig  <martin@ximian.com>
13535         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13536         when looking up static methods to make this work on Windows.
13537         Fixes #33773.
13539 2002-11-16  Martin Baulig  <martin@ximian.com>
13541         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13542         a setter rather than using PropertyInfo.CanWrite.
13544 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13546         * class.cs: Allow acces to block member by subclasses. Fixes build
13547         breaker.
13549 2002-11-14  Martin Baulig  <martin@ximian.com>
13551         * class.cs (Constructor.Emit): Added the extern/block check.
13552         Fixes bug #33678.
13554 2002-11-14  Martin Baulig  <martin@ximian.com>
13556         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13557         iteration while looking for indexers, this is needed because the
13558         indexer may have a different name in our base classes.  Fixed the
13559         error reporting (no indexers at all, not get accessor, no
13560         overloaded match).  Fixes bug #33089.
13561         (IndexerAccess.DoResolveLValue): Likewise.
13563 2002-11-14  Martin Baulig  <martin@ximian.com>
13565         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13566         indexers.  Fixes the first part of bug #33089.
13567         (MethodSignature.InheritableMemberSignatureCompare): Added support
13568         for properties.
13570 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13572         * attribute.cs (Attribute.Resolve): Catch the
13573         NullReferenceException and report it since it isn't supposed to
13574         happen. 
13576 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13578         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13579         LogicalOr and LogicalAnd that can benefit from recursively
13580         handling EmitBranchable.  The code now should be nice for Paolo.
13582 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13584         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13585         the Type lookups, as we perform quite a number of lookups on
13586         non-Types.  This can be removed once we can deterministically tell
13587         whether we have a type or a namespace in advance.
13589         But this might require special hacks from our corlib.
13591         * TODO: updated.
13593         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13594         and double which avoids a conversion from an integer to a double.
13596         * expression.cs: tiny optimization, avoid calling IsConstant,
13597         because it effectively performs the lookup twice.
13599 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13601         But a bogus return here to keep the semantics of the old code
13602         until the Mono runtime is fixed.
13604         * pending.cs (GetMissingInterfaces): New method used to remove all
13605         the interfaces that are already implemented by our parent
13606         classes from the list of pending methods. 
13608         * interface.cs: Add checks for calls after ResolveTypeExpr.
13610 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13612         * class.cs (Class.Emit): Report warning 67: event not used if the
13613         warning level is beyond 3.
13615         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13616         being a NullLiteral.
13618         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13619         specifiers. 
13621         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13622         path that might fail if a type can not be resolved.
13624         * expression.cs (Binary.Emit): Emit unsigned versions of the
13625         operators. 
13627         * driver.cs: use error 5.
13629 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13631         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13633 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13635         * cs-parser.jay (switch_section): A beautiful patch from Martin
13636         Baulig that fixed 33094.
13638 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13640         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13641         Check whether the base is abstract and report an error if so.
13643         * expression.cs (IndexerAccess.DoResolveLValue,
13644         IndexerAccess.DoResolve): ditto. 
13646         (Invocation.DoResolve): ditto.
13648         (Invocation.FullMethodDesc): Improve the report string.
13650         * statement.cs (Block): Eliminate IsVariableDefined as it is
13651         basically just a wrapper for GetVariableInfo.
13653         * ecore.cs (SimpleName): Use new 
13655         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13656         type, as we return the actual parameter ref/unref state on a
13657         different call.
13659 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13661         * support.cs: Return proper flags REF/OUT fixing the previous
13662         commit.  
13664         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13665         not used to mean `ref' but `ref or out' in ParameterReference
13667         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13668         full type signature instead of calling TypeManger.CSharpName
13669         ourselves. 
13671         * support.cs (InternalParameters.ParameterDesc): Do not compare
13672         directly to the modflags, because REF/OUT will actually be bitsets
13673         if set. 
13675         * delegate.cs (VerifyMethod): Check also the modifiers.
13677         * cs-tokenizer.cs: Fix bug where floating point values with an
13678         exponent where a sign was missing was ignored.
13680         * driver.cs: Allow multiple assemblies to be specified in a single
13681         /r: argument
13683 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13685         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13686         because identifiers after a parenthesis would end up in this kind
13687         of production, and we needed to desamiguate it for having casts
13688         like:
13690                 (UserDefinedType *) xxx
13692 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13694         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13695         we should set on the Bindingflags.NonPublic, but not turn on
13696         private_ok.  private_ok controls whether a Private member is
13697         returned (this is chekced on the filter routine), while the
13698         BindingFlags.NonPublic just controls whether private/protected
13699         will be allowed.   This fixes the problem part of the problem of
13700         private properties being allowed to be used in derived classes.
13702         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13703         so we can call the children DoResolveLValue method (this will
13704         properly signal errors on lvalue assignments to base properties)
13706         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13707         getter are null, and we have a property info, we know that this
13708         happened because the lookup failed, so we report an error 122 for
13709         protection level violation.
13711         We also silently return if setter and getter are null in the
13712         resolve functions, this condition only happens if we have flagged
13713         the error before.  This is the other half of the problem. 
13715         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13716         not have accessibility information, that is why we were returning
13717         true in the filter function in typemanager.cs.
13719         To properly report 122 (property is inaccessible because of its
13720         protection level) correctly, we report this error in ResolveAccess
13721         by failing if both the setter and the getter are lacking (ie, the
13722         lookup failed). 
13724         DoResolve and DoLResolve have been modified to check for both
13725         setter/getter being null and returning silently, the reason being
13726         that I did not want to put the knowledge about this error in upper
13727         layers, like:
13729         int old = Report.Errors;
13730         x = new PropertyExpr (...);
13731         if (old != Report.Errors)
13732                 return null;
13733         else
13734                 return x;
13736         So the property expr is returned, but it is invalid, so the error
13737         will be flagged during the resolve process. 
13739         * class.cs: Remove InheritablePropertySignatureCompare from the
13740         class, as we no longer depend on the property signature to compute
13741         whether it is possible to implement a method or not.
13743         The reason is that calling PropertyInfo.GetGetMethod will return
13744         null (in .NET, in Mono it works, and we should change this), in
13745         cases where the Get Method does not exist in that particular
13746         class.
13748         So this code:
13750         class X { public virtual int A { get { return 1; } } }
13751         class Y : X { }
13752         class Z : Y { public override int A { get { return 2; } } }
13754         Would fail in Z because the parent (Y) would not have the property
13755         defined.  So we avoid this completely now (because the alternative
13756         fix was ugly and slow), and we now depend exclusively on the
13757         method names.
13759         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13760         reference method, instead of using the property.
13762         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13763         routines are gone now.
13765         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13766         names, they were incorrectly named.
13768         * cs-tokenizer.cs: Return are more gentle token on failure. 
13770         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13771         had an out-of-sync index variable, which caused it to remove from
13772         the list of pending methods the wrong method sometimes.
13774 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13776         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13777         CanWrite, because those refer to this particular instance of the
13778         property, and do not take into account the fact that we can
13779         override single members of a property.
13781         Constructor requires an EmitContext.  The resolution process does
13782         not happen here, but we need to compute the accessors before,
13783         because the resolution does not always happen for properties.
13785         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13786         subclass, before we did not update this flag, but we did update
13787         bindingflags. 
13789         (GetAccessors): Drop this routine, as it did not work in the
13790         presence of partially overwritten set/get methods. 
13792         Notice that this broke the cs1540 detection, but that will require
13793         more thinking. 
13795 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13797         * class.cs:
13798         * codegen.cs:
13799         * driver.cs: issue a warning instead of an error if we don't support
13800         debugging for the platform. Also ignore a couple of errors that may
13801         arise when trying to write the symbols. Undo my previous patch.
13803 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13805         * driver.cs: ignore /debug switch except for Unix platforms.
13807 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13809         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13811 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13813         * driver.cs: Do not make mcs-debug conditional, so we do not break
13814         builds that use it.
13816         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13817         review this patch.  But basically after all the children variables
13818         have been merged, the value of "Breaks" was not being set to
13819         new_breaks for Switch blocks.  I think that it should be set after
13820         it has executed.  Currently I set this to the value of new_breaks,
13821         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13822         conservative, but I do not understand this code very well.
13824         I did not break anything in the build, so that is good ;-)
13826         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13828 2002-10-20  Mark Crichton  <crichton@gimp.org>
13830         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13832 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13834         * cfold.cs: Fixed compile blocker.
13836 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13838         * driver.cs: I was chekcing the key, not the file.
13840 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13842         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13843         message that we were generating - we just need to silently return
13844         a null.
13846 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13848         * class.cs (Event.Define): Change my previous commit, as this
13849         breaks the debugger.  This is a temporary hack, as it seems like
13850         the compiler is generating events incorrectly to begin with.
13852         * expression.cs (Binary.ResolveOperator): Added support for 
13853         "U operator - (E x, E y)"
13855         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13856         y)".
13858         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13859         init-only variables, but this path did not take into account that
13860         there might be also instance readonly variables.  Correct this
13861         problem. 
13863         This fixes bug 32253
13865         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13866         delegates as well.
13868         * driver.cs: Change the extension for modules to `netmodule'
13870         * cs-parser.jay: Improved slightly the location tracking for
13871         the debugger symbols.
13873         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13874         modifiers that were specified instead of the hardcoded value
13875         (FamAndAssem).  This was basically ignoring the static modifier,
13876         and others.  Fixes 32429.
13878         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13879         fixed a bug in the process (32476)
13881         * expression.cs (ArrayAccess.EmitAssign): Patch from
13882         hwang_rob@yahoo.ca that fixes bug 31834.3
13884 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13886         * driver.cs: Make the module extension .netmodule.
13888 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13890         * driver.cs: Report an error if the resource file is not found
13891         instead of crashing.
13893         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13894         false, like Emit does.
13896 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13898         * typemanager.cs: Remove unused private member.  Also reported mcs
13899         bug to report this as a warning like csc.
13901 2002-10-15  Martin Baulig  <martin@gnome.org>
13903         * statement.cs (Statement.Emit): Made this a virtual method; emits
13904         the line number info and calls DoEmit().
13905         (Statement.DoEmit): New protected abstract method, formerly knows
13906         as Statement.Emit().
13908         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13910 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13912         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13913         have fixed a remaining problem: not every AddXXXX was adding a
13914         fully qualified name.  
13916         Now everyone registers a fully qualified name in the DeclSpace as
13917         being defined instead of the partial name.  
13919         Downsides: we are slower than we need to be due to the excess
13920         copies and the names being registered this way.  
13922         The reason for this is that we currently depend (on the corlib
13923         bootstrap for instance) that types are fully qualified, because
13924         we dump all the types in the namespace, and we should really have
13925         types inserted into the proper namespace, so we can only store the
13926         basenames in the defined_names array.
13928 2002-10-10  Martin Baulig  <martin@gnome.org>
13930         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13931         from bug #31834, see the bug report for a testcase which is
13932         miscompiled.
13934 2002-10-10  Martin Baulig  <martin@gnome.org>
13936         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13937         flow analysis code for this.
13939         * statement.cs (Do, While, For): Tell the flow analysis code about
13940         infinite loops.
13941         (FlowBranching.UsageVector): Added support for infinite loops.
13942         (Block.Resolve): Moved the dead code elimination here and use flow
13943         analysis to do it.
13945 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13947         * class.cs (Field.Define): Catch cycles on struct type
13948         definitions. 
13950         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13951         fields if the fields are static.  We only need to check instance
13952         fields. 
13954         * expression.cs (As.DoResolve): Test for reference type.
13956         * statement.cs (Using.ResolveExpression): Use
13957         ConvertImplicitRequired, not ConvertImplicit which reports an
13958         error on failture
13959         (Using.ResolveLocalVariableDecls): ditto.
13961         * expression.cs (Binary.ResolveOperator): Report errors in a few
13962         places where we had to.
13964         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13966 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13968         * expression.cs: Use StoreFromPtr instead of extracting the type
13969         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13971         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13972         an enumeration value to a System.Enum, but System.Enum is not a
13973         value type, but an class type, so we need to box.
13975         (Expression.ConvertExplicit): One codepath could return
13976         errors but not flag them.  Fix this.  Fixes #31853
13978         * parameter.cs (Resolve): Do not allow void as a parameter type.
13980 2002-10-06  Martin Baulig  <martin@gnome.org>
13982         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13983         if it's a class type and not a struct.  Fixes #31815.
13985 2002-10-06  Martin Baulig  <martin@gnome.org>
13987         * statement.cs: Reworked the flow analysis code a bit to make it
13988         usable for dead code elimination.
13990 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13992         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13994 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13996         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13997         to fix the test 165, will investigate deeper.
13999 2002-10-04  Martin Baulig  <martin@gnome.org>
14001         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14002         finally blocks actually work.
14003         (Try.Resolve): We don't need to create a sibling for `finally' if
14004         there is no finally block.
14006 2002-10-04  Martin Baulig  <martin@gnome.org>
14008         * class.cs (Constructor.Define): The default accessibility for a
14009         non-default constructor is private, not public.
14011 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14013         * class.cs (Constructor): Make AllowedModifiers public, add
14014         EXTERN.
14016         * cs-parser.jay: Perform the modifiers test here, as the
14017         constructor for the Constructor class usually receives a zero
14018         because of the way we create it (first we create, later we
14019         customize, and we were never checking the modifiers).
14021         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14022         is a version of LookupTypeReflection that includes the type-name
14023         cache.  This can be used as a fast path for functions that know
14024         the fully qualified name and are only calling into *.GetType() to
14025         obtain a composed type.
14027         This is also used by TypeManager.LookupType during its type
14028         composition.
14030         (LookupType): We now also track the real type name, as sometimes
14031         we can get a quey for the real type name from things like
14032         ComposedCast.  This fixes bug 31422.
14034         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14035         complete type fullname, it does not have to go through the type
14036         resolution system to obtain the composed version of the type (for
14037         obtaining arrays or pointers).
14039         (Conditional.Emit): Use the EmitBoolExpression to
14040         generate nicer code, as requested by Paolo.
14042         (ArrayCreation.CheckIndices): Use the patch from
14043         hwang_rob@yahoo.ca to validate the array initializers. 
14045 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14047         * class.cs (ConstructorInitializer.Emit): simplify code by using
14048         Invocation.EmitCall, and at the same time, fix the bugs in calling
14049         parent constructors that took variable arguments. 
14051         * ecore.cs (Expression.ConvertNumericExplicit,
14052         Expression.ImplicitNumericConversion): Remove the code that
14053         manually wrapped decimal (InternalTypeConstructor call is now gone
14054         as well).
14056         * expression.cs (Cast.TryReduce): Also handle decimal types when
14057         trying to perform a constant fold on the type.
14059         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14061         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14062         that only turned off an error report, and did nothing else. 
14064 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14066         * driver.cs: Handle and ignore /fullpaths
14068 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14070         * expression.cs (Binary.ResolveOperator): Catch the case where
14071         DoNumericPromotions returns true, 
14073         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14075 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14077         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14078         report error 70.
14080 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14082         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14083         conversion exists, but it is also required that the conversion be
14084         performed.  This manifested in "(Type64Enum) 2".  
14086         * class.cs (TypeManager.AddMethod): The fix is not to change
14087         AddEnum, because that one was using a fully qualified name (every
14088         DeclSpace derivative does), but to change the AddMethod routine
14089         that was using an un-namespaced name.  This now correctly reports
14090         the duplicated name.
14092         Revert patch until I can properly fix it.  The issue
14093         is that we have a shared Type space across all namespaces
14094         currently, which is wrong.
14096         Options include making the Namespace a DeclSpace, and merge
14097         current_namespace/current_container in the parser.
14099 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14101         * cs-parser.jay: Improve error reporting when we get a different
14102         kind of expression in local_variable_type and
14103         local_variable_pointer_type. 
14105         Propagate this to avoid missleading errors being reported.
14107         * ecore.cs (ImplicitReferenceConversion): treat
14108         TypeManager.value_type as a target just like object_type.   As
14109         code like this:
14111         ValueType v = 1;
14113         Is valid, and needs to result in the int 1 being boxed before it
14114         is assigned to the value type v.
14116         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14117         to validate the enumeration name.
14119         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14120         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14121         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14123         * ecore.cs (TryImplicitIntConversion): When doing an
14124         implicit-enumeration-conversion, check if the type is 64-bits and
14125         perform a conversion before passing to EnumConstant.
14127 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14129         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14130         report ambiguous type references.  Unlike the MS version, we
14131         report what the ambiguity is.   Innovation at work ;-)
14133         (DeclSpace.FindType): Require a location argument to
14134         display when we display an ambiguous error.
14136         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14138         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14140         * expression.cs (EmitDynamicInitializers): Apply patch from
14141         hwang_rob@yahoo.ca that fixes the order in which we emit our
14142         initializers. 
14144 2002-09-21  Martin Baulig  <martin@gnome.org>
14146         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14147         delegate takes no arguments.
14149 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14151         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14152         from integers.
14154         * expression.cs: Extract the underlying type.
14156         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14158         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14160 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14162         * class.cs (TypeContainer.DefineType): We can not use the nice
14163         PackingSize with the size set to 1 DefineType method, because it
14164         will not allow us to define the interfaces that the struct
14165         implements.
14167         This completes the fixing of bug 27287
14169         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14170         means also structs.  This fixes part of the problem. 
14171         (Expresion.ImplicitReferenceConversionExists): ditto.
14173         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14174         error if there were no errors reported during the type lookup
14175         process, to avoid duplicates or redundant errors.  Without this
14176         you would get an ambiguous errors plus a type not found.  We have
14177         beaten the user enough with the first error.  
14179         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14180         reference. 
14182         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14183         during the resolution process, stop the lookup, this avoids
14184         repeated error reports (same error twice).
14186         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14188         * typemanager.cs (LookupType): Redo the type lookup code to match
14189         the needs of System.Reflection.  
14191         The issue is that System.Reflection requires references to nested
14192         types to begin with a "+" sign instead of a dot.  So toplevel
14193         types look like: "NameSpace.TopLevelClass", and nested ones look
14194         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14195         levels. 
14197 2002-09-19  Martin Baulig  <martin@gnome.org>
14199         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14200         says that a method always returns or always throws an exception,
14201         don't report the CS0161.
14203         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14204         set `Returns = new_returns'.
14206 2002-09-19  Martin Baulig  <martin@gnome.org>
14208         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14209         to an enum constant, check for a CS0176.
14211 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14213         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14214         for operators that must be in pairs and report errors.
14216         * ecore.cs (SimpleName.DoResolveType): During the initial type
14217         resolution process, when we define types recursively, we must
14218         check first for types in our current scope before we perform
14219         lookups in the enclosing scopes.
14221         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14223         (Invocation.VerifyArgumentsCompat): Call
14224         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14225         I thought we were supposed to always call this, but there are a
14226         few places in the code where we dont do it.
14228 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14230         * driver.cs: Add support in -linkres and -resource to specify the
14231         name of the identifier.
14233 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14235         * ecore.cs (StandardConversionExists): Sync with the conversion
14236         code: allow anything-* to void* conversions.
14238         (FindMostSpecificSource): Use an Expression argument
14239         instead of a Type, because we might be handed over a Literal which
14240         gets a few more implicit conversions that plain types do not.  So
14241         this information was being lost.
14243         Also, we drop the temporary type-holder expression when not
14244         required.
14246 2002-09-17  Martin Baulig  <martin@gnome.org>
14248         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14249         this is an explicit interface implementation.
14251 2002-09-17  Martin Baulig  <martin@gnome.org>
14253         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14254         different `IndexerName' attributes.
14256         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14257         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14258         virtual CommonResolve().
14260 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14262         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14263         and convert that to the UnderlyingType.
14265         * statement.cs (Foreach.Resolve): Indexers are just like variables
14266         or PropertyAccesses.
14268         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14269         inside quoted strings, we were not doing this before.
14271 2002-09-16  Martin Baulig  <martin@gnome.org>
14273         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14274         resolve it.  This is needed for the definite assignment check of the
14275         instance expression, fixes bug #29846.
14276         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14278 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14280         * parameter.cs: Fix compile error.  Cannot reference static member
14281         from an instance object.  Is this an mcs bug?
14283 2002-09-14  Martin Baulig  <martin@gnome.org>
14285         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14286         multiple times.  Fixes bug #30295, added test-166.cs.
14288 2002-09-14  Martin Baulig  <martin@gnome.org>
14290         * statement.cs (Block.Emit): Don't emit unreachable code.
14291         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14292         `break' statements.
14293         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14295 2002-09-14  Martin Baulig  <martin@gnome.org>
14297         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14298         is set.
14300 2002-09-14  Martin Baulig  <martin@gnome.org>
14302         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14303         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14304         be false on the ms runtime.
14306 2002-09-13  Martin Baulig  <martin@gnome.org>
14308         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14309         the CS0038 error message.
14311 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14313         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14314         constant inside, return it.
14316 2002-09-12  Martin Baulig  <martin@gnome.org>
14318         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14319         implicit conversion can be done between enum types.
14321         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14322         check whether an implicit conversion to the current enum's UnderlyingType
14323         exists and report an error if not.
14325         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14326         without debugging support.
14328         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14329         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14331 2002-09-12  Martin Baulig  <martin@gnome.org>
14333         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14335         * ecore.cs (IMemberExpr.DeclaringType): New property.
14336         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14337         nonstatic member of an outer type (CS0038).
14339 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14341         * driver.cs: Activate the using-error detector at warning level
14342         4 (at least for MS-compatible APIs).
14344         * namespace.cs (VerifyUsing): Small buglett fix.
14346         * pending.cs (PendingImplementation): pass the container pointer. 
14348         * interface.cs (GetMethods): Allow for recursive definition.  Long
14349         term, I would like to move every type to support recursive
14350         definitions, not the current ordering mechanism that we have right
14351         now.
14353         The situation is this: Attributes are handled before interfaces,
14354         so we can apply attributes to interfaces.  But some attributes
14355         implement interfaces, we will now handle the simple cases
14356         (recursive definitions will just get an error).  
14358         * parameter.cs: Only invalidate types at the end if we fail to
14359         lookup all types.  
14361 2002-09-09  Martin Baulig  <martin@gnome.org>
14363         * ecore.cs (PropertyExpr.Emit): Also check for
14364         TypeManager.system_int_array_get_length so this'll also work when
14365         compiling corlib.  Fixes #30003.
14367 2002-09-09  Martin Baulig  <martin@gnome.org>
14369         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14370         and throw an exception if we can't get the type's size.  Fixed #30040,
14371         added test-165.cs.
14373 2002-09-09  Martin Baulig  <martin@gnome.org>
14375         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14377         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14378         context.  Fixes bug #30027.
14380         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14381         virtual functions.  Fixes bug #30043, added test-164.cs.
14383 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14385         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14387 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14389         * driver.cs: Use an object to get the windows codepage since it's not a
14390         static property.
14392 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14394         * statement.cs (For.Emit): for infinite loops (test == null)
14395         return whether there is a break inside, not always "true".
14397         * namespace.cs (UsingEntry): New struct to hold the name of the
14398         using definition, the location where it is defined, and whether it
14399         has been used in a successful type lookup.
14401         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14402         strings.
14404         * decl.cs: ditto.
14406 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14408         * attribute.cs : Fix incorrect code which relied on catching
14409         a NullReferenceException to detect a null being passed in
14410         where an object was expected.
14412 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14414         * statement.cs (Try): flag the catch variable as assigned
14416         * expression.cs (Cast): Simplified by using ResolveType instead of
14417         manually resolving.
14419         * statement.cs (Catch): Fix bug by using ResolveType.
14421 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14423         * expression.cs (BetterConversion): Special case for when we have
14424         a NullLiteral as the argument and we have to choose between string
14425         and object types - we choose string the way csc does.
14427         * attribute.cs (Attribute.Resolve): Catch the
14428         NullReferenceException and report error #182 since the Mono
14429         runtime no more has the bug and having this exception raised means
14430         we tried to select a constructor which takes an object and is
14431         passed a null.
14433 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14435         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14436         message (1502, 1503) when we can't locate a method after overload
14437         resolution. This is much more informative and closes the bug
14438         Miguel reported.
14440         * interface.cs (PopulateMethod): Return if there are no argument
14441         types. Fixes a NullReferenceException bug.
14443         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14444         expressions too. Previously we were checking only in one place for
14445         positional arguments leaving out named arguments.
14447         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14448         type to the enum type is not allowed. Remove code corresponding to
14449         that.
14451         (ConvertNumericExplicit): Allow explicit conversions from
14452         the underlying type to enum type. This precisely follows the spec
14453         and closes a bug filed by Gonzalo.
14455 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14457         * compiler.csproj:
14458         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14460 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14462         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14463         it was important that we stored the right value after the
14464         reduction in `converted'.
14466 2002-09-04  Martin Baulig  <martin@gnome.org>
14468         * location.cs (Location.SymbolDocument): Use full pathnames for the
14469         source files.
14471 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14473         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14474         of the expression resolve mechanism, because that will catch the
14475         SimpleName error failures.
14477         (Conditional): If we can not resolve the
14478         expression, return, do not crash.
14480 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14482         * cs-tokenizer.cs:
14483         (location): display token name instead of its number.
14485 2002-08-28  Martin Baulig  <martin@gnome.org>
14487         * expression.cs (Binary.ResolveOperator): Don't silently return
14488         but return an error if an operator cannot be applied between two
14489         enum types.
14491 2002-08-28  Martin Baulig  <martin@gnome.org>
14493         * class.cs (Constructor.Define): Set the permission attributes
14494         correctly instead of making all constructors public.
14496 2002-08-28  Martin Baulig  <martin@gnome.org>
14498         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14499         for private members before reporting a CS0103; if we find anything,
14500         it's a CS0122.
14502 2002-08-28  Martin Baulig  <martin@gnome.org>
14504         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14505         to check whether `closure_start_type == closure_invocation_type',
14506         we also need to check whether `m.DeclaringType == closure_invocation_type'
14507         before bypassing the permission checks.  We might be accessing
14508         protected/private members from the base class.
14509         (TypeManager.RealMemberLookup): Only set private_ok if private
14510         members were requested via BindingFlags.NonPublic.
14512         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14514         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14515         MethodGroupExpr.IsExplicitImpl if appropriate.
14516         (Invocation.DoResolve): Don't report the CS0120 for explicit
14517         interface implementations.
14519 2002-08-27  Martin Baulig  <martin@gnome.org>
14521         * expression.cs (Invocation.DoResolve): If this is a static
14522         method and we don't have an InstanceExpression, we must report
14523         a CS0120.
14525 2002-08-25  Martin Baulig  <martin@gnome.org>
14527         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14528         `==' between a valuetype and an object.
14530 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14532         * ecore.cs (TypeExpr): Provide a ToString method.
14534 2002-08-24  Martin Baulig  <martin@gnome.org>
14536         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14537         now called proggie.dbg and it's a binary file.
14539 2002-08-23  Martin Baulig  <martin@gnome.org>
14541         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14543 2002-08-23  Martin Baulig  <martin@gnome.org>
14545         * struct.cs (MyStructInfo.ctor): Make this work with empty
14546         structs; it's not allowed to use foreach() on null.
14548 2002-08-23  Martin Baulig  <martin@gnome.org>
14550         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14551         writer the full pathname of the generated assembly.
14553 2002-08-23  Martin Baulig  <martin@gnome.org>
14555         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14556         A `finally' block never returns or breaks; improved handling of
14557         unreachable code.
14559 2002-08-23  Martin Baulig  <martin@gnome.org>
14561         * statement.cs (Throw.Resolve): Allow `throw null'.
14563 2002-08-23  Martin Baulig  <martin@gnome.org>
14565         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14566         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14567         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14568         MemberLookup would return a wrong event if this is an explicit
14569         interface implementation and the class has an event with the same
14570         name.
14572 2002-08-23  Martin Baulig  <martin@gnome.org>
14574         * statement.cs (Block.AddChildVariableNames): New public method.
14575         (Block.AddChildVariableName): Likewise.
14576         (Block.IsVariableNameUsedInChildBlock): Likewise.
14577         (Block.AddVariable): Check whether a variable name has already
14578         been used in a child block.
14580         * cs-parser.jay (declare_local_variables): Mark all variable names
14581         from the current block as being used in a child block in the
14582         implicit block.
14584 2002-08-23  Martin Baulig  <martin@gnome.org>
14586         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14587         find the symbol writer.
14589         * driver.cs: csc also allows the arguments to /define being
14590         separated by commas, not only by semicolons.
14592 2002-08-23  Martin Baulig  <martin@gnome.org>
14594         * interface.cs (Interface.GetMembers): Added static check for events.
14596 2002-08-15  Martin Baulig  <martin@gnome.org>
14598         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14599         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14601         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14602         why the MethodData.EmitDestructor() change was necessary.
14604 2002-08-20  Martin Baulig  <martin@gnome.org>
14606         * class.cs (TypeContainer.FindMembers): Added static check for events.
14608         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14610         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14611         use Type.GetEvents(), not Type.FindMembers().
14613 2002-08-20  Martin Baulig  <martin@gnome.org>
14615         * decl.cs (MemberCache): Added a special method cache which will
14616         be used for method-only searched.  This ensures that a method
14617         search will return a MethodInfo with the correct ReflectedType for
14618         inherited methods.      
14620 2002-08-20  Martin Baulig  <martin@gnome.org>
14622         * decl.cs (DeclSpace.FindMembers): Made this public.
14624 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14626         * delegate.cs: fixed build on windows.
14627         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14629 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14631         * ecore.cs (StandardConversionExists): Return a false
14632         if we are trying to convert the void type to anything else
14633         since that is not allowed.
14635         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14636         we flag error 70 in the event an event is trying to be accessed
14637         directly from outside the declaring type.
14639 2002-08-20  Martin Baulig  <martin@gnome.org>
14641         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14642         MemberCache from typemanager.cs to decl.cs.
14644 2002-08-19  Martin Baulig  <martin@gnome.org>
14646         * class.cs (TypeContainer): Implement IMemberContainer.
14647         (TypeContainer.DefineMembers): Create the MemberCache.
14648         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14649         return public members if BindingFlags.Public was given, check
14650         whether members are static.
14652 2002-08-16  Martin Baulig  <martin@gnome.org>
14654         * decl.cs (DeclSpace.Define): Splitted this in Define and
14655         DefineMembers.  DefineMembers is called first and initializes the
14656         MemberCache.
14658         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14659         DefineMembers() on all our DeclSpaces.
14661         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14662         but call DefineMembers() on all nested interfaces.  We call their
14663         Define() in our new Define() function.
14665         * interface.cs (Interface): Implement IMemberContainer.
14666         (Interface.Define): Moved all code except the attribute stuf to
14667         DefineMembers().
14668         (Interface.DefineMembers): Initialize the member cache.
14670         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14671         need this anymore since we can use MemberCache.FindMembers directly.
14673 2002-08-19  Martin Baulig  <martin@gnome.org>
14675         * typemanager.cs (MemberCache): When creating the cache for an
14676         interface type, add all inherited members.
14677         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14678         to `out bool used_cache' and documented it.
14679         (TypeManager.MemberLookup): If we already used the cache in the first
14680         iteration, we don't need to do the interfaces check.
14682 2002-08-19  Martin Baulig  <martin@gnome.org>
14684         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14685         here from IMemberFinder and don't implement this interface anymore.
14686         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14688         * typemanager.cs (IMemberFinder): This interface is now only used by
14689         classes which actually support the member cache.
14690         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14691         since we only put DeclSpaces into this Hashtable.
14692         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14693         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14695 2002-08-16  Martin Baulig  <martin@gnome.org>
14697         * typemanager.cs (ICachingMemberFinder): Removed.
14698         (IMemberFinder.MemberCache): New property.
14699         (TypeManager.FindMembers): Merged this with RealFindMembers().
14700         This function will never be called from TypeManager.MemberLookup()
14701         so we can't use the cache here, just the IMemberFinder.
14702         (TypeManager.MemberLookup_FindMembers): Check whether the
14703         IMemberFinder has a MemberCache and call the cache's FindMembers
14704         function.
14705         (MemberCache): Rewrote larger parts of this yet another time and
14706         cleaned it up a bit.
14708 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14710         * driver.cs (LoadArgs): Support quoting.
14712         (Usage): Show the CSC-like command line arguments.
14714         Improved a few error messages.
14716 2002-08-15  Martin Baulig  <martin@gnome.org>
14718         * typemanager.cs (IMemberContainer.Type): New property.
14719         (IMemberContainer.IsInterface): New property.
14721         The following changes are conditional to BROKEN_RUNTIME, which is
14722         defined at the top of the file.
14724         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14725         class'es members, but add all members from TypeHandle.ObjectType
14726         if we're an interface.
14727         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14728         is the current type.
14729         (MemberCache.CacheEntry.Container): Removed this field.
14730         (TypeHandle.GetMembers): Include inherited members.
14732 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14734         * typemanager.cs: fixed compilation and added a comment on a field that
14735         is never used.
14737 2002-08-15  Martin Baulig  <martin@gnome.org>
14739         * class.cs (ConstructorInitializer.Resolve): In the
14740         Expression.MemberLookup call, use the queried_type as
14741         invocation_type.
14743         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14744         declared' attribute, it's always true.
14745         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14746         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14747         temporary wrapper for FindMembers which tells MemberLookup whether
14748         members from the base classes are included in the return value.
14749         This will go away soon.
14750         (TypeManager.MemberLookup): Use this temporary hack here; once the
14751         new MemberCache is completed, we don't need to do the DeclaredOnly
14752         looping here anymore since the MemberCache will take care of this.
14753         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14754         (MemberCache): When creating the MemberCache for a class, get
14755         members from the current class and all its base classes.
14756         (MemberCache.CacheEntry.Container): New field.  This is a
14757         temporary hack until the Mono runtime is fixed to distinguish
14758         between ReflectedType and DeclaringType.  It allows us to use MCS
14759         with both the MS runtime and the unfixed Mono runtime without
14760         problems and without accecting performance.
14761         (MemberCache.SearchMembers): The DeclaredOnly looping from
14762         TypeManager.MemberLookup is now done here.      
14764 2002-08-14  Martin Baulig  <martin@gnome.org>
14766         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14767         Type.GetFields on dynamic types but get the fields from the
14768         corresponding TypeContainer.
14769         (MyStructInfo.GetStructInfo): Added check for enum types.
14771         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14772         (MemberList.SyncRoot): Implemented.
14773         (TypeManager.FilterWithClosure): No need to check permissions if
14774         closure_start_type == closure_invocation_type, don't crash if
14775         closure_invocation_type is null.
14777 2002-08-13  Martin Baulig  <martin@gnome.org>
14779         Rewrote TypeContainer.FindMembers to use a member cache.  This
14780         gives us a speed increase of about 35% for the self-hosting MCS
14781         build and of about 15-20% for the class libs (both on GNU/Linux).
14783         * report.cs (Timer): New class to get enhanced profiling.  This
14784         whole class is "TIMER" conditional since it remarkably slows down
14785         compilation speed.
14787         * class.cs (MemberList): New class.  This is an IList wrapper
14788         which we're now using instead of passing MemberInfo[]'s around to
14789         avoid copying this array unnecessarily.
14790         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14791         (ICachingMemberFinder, IMemberContainer): New interface.
14792         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14793         has already been checked, otherwise use it for the name comparision.
14794         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14795         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14796         if possible.  Returns a MemberList, not a MemberInfo [].
14797         (TypeHandle): New class, implements IMemberContainer.  We create
14798         one instance of this class per type, it contains a MemberCache
14799         which is used to do the member lookups.
14800         (MemberCache): New class.  Each instance of this class contains
14801         all members of a type and a name-based hash table.
14802         (MemberCache.FindMembers): This is our new member lookup
14803         function.  First, it looks up all members of the requested name in
14804         the hash table.  Then, it walks this list and sorts out all
14805         applicable members and returns them.
14807 2002-08-13  Martin Baulig  <martin@gnome.org>
14809         In addition to a nice code cleanup, this gives us a performance
14810         increase of about 1.4% on GNU/Linux - not much, but it's already
14811         half a second for the self-hosting MCS compilation.
14813         * typemanager.cs (IMemberFinder): New interface.  It is used by
14814         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14815         Enum, Delegate or Interface.
14816         (TypeManager.finder_to_member_finder): New PtrHashtable.
14817         (TypeManager.finder_to_container): Removed.
14818         (TypeManager.finder_to_delegate): Removed.
14819         (TypeManager.finder_to_interface): Removed.
14820         (TypeManager.finder_to_enum): Removed.
14822         * interface.cs (Interface): Implement IMemberFinder.
14824         * delegate.cs (Delegate): Implement IMemberFinder.
14826         * enum.cs (Enum): Implement IMemberFinder.
14828         * class.cs (TypeContainer): Implement IMemberFinder.
14830 2002-08-12  Martin Baulig  <martin@gnome.org>
14832         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14834 2002-08-12  Martin Baulig  <martin@gnome.org>
14836         * ecore.cs (ITypeExpression): New interface for expressions which
14837         resolve to a type.
14838         (TypeExpression): Renamed to TypeLookupExpression.
14839         (Expression.DoResolve): If we're doing a types-only lookup, the
14840         expression must implement the ITypeExpression interface and we
14841         call DoResolveType() on it.
14842         (SimpleName): Implement the new ITypeExpression interface.
14843         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14844         hack, the situation that we're only looking up types can't happen
14845         anymore when this method is called.  Moved the type lookup code to
14846         DoResolveType() and call it.
14847         (SimpleName.DoResolveType): This ITypeExpression interface method
14848         is now doing the types-only lookup.
14849         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14850         (ResolveFlags): Added MaskExprClass.
14852         * expression.cs (MemberAccess): Implement the ITypeExpression
14853         interface.
14854         (MemberAccess.DoResolve): Added support for a types-only lookup
14855         when we're called via ITypeExpression.DoResolveType().
14856         (ComposedCast): Implement the ITypeExpression interface.
14858         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14859         Expression.Resolve() with ResolveFlags.Type instead.
14861 2002-08-12  Martin Baulig  <martin@gnome.org>
14863         * interface.cs (Interface.Define): Apply attributes.
14865         * attribute.cs (Attribute.ApplyAttributes): Added support for
14866         interface attributes.
14868 2002-08-11  Martin Baulig  <martin@gnome.org>
14870         * statement.cs (Block.Emit): Only check the "this" variable if we
14871         do not always throw an exception.
14873         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14874         whether the property has a set accessor.
14876 2002-08-11  Martin Baulig  <martin@gnome.org>
14878         Added control flow analysis support for structs.
14880         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14881         with control flow analysis turned off.
14882         (IVariable): New interface.
14883         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14884         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14885         (FieldExpr.DoResolve): Resolve the instance expression with flow
14886         analysis turned off and do the definite assignment check after the
14887         resolving when we know what the expression will resolve to.
14889         * expression.cs (LocalVariableReference, ParameterReference):
14890         Implement the new IVariable interface, only call the flow analysis
14891         code if ec.DoFlowAnalysis is true.
14892         (This): Added constructor which takes a Block argument.  Implement
14893         the new IVariable interface.
14894         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14895         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14896         This does the definite assignment checks for struct members.
14898         * class.cs (Constructor.Emit): If this is a non-static `struct'
14899         constructor which doesn't have any initializer, call
14900         Block.AddThisVariable() to tell the flow analysis code that all
14901         struct elements must be initialized before control returns from
14902         the constructor.
14904         * statement.cs (MyStructInfo): New public class.
14905         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14906         argument to this indexer.  If non-zero, check an individual struct
14907         member, not the whole struct.
14908         (FlowBranching.CheckOutParameters): Check struct members.
14909         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14910         overloaded versions of these methods which take an additional
14911         `int field_idx' argument to check struct members.
14912         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14913         overloaded versions of these methods which take an additional
14914         `string field_name' argument to check struct member.s
14915         (VariableInfo): Implement the IVariable interface.
14916         (VariableInfo.StructInfo): New public property.  Returns the
14917         MyStructInfo instance of the variable if it's a struct or null.
14918         (Block.AddThisVariable): New public method.  This is called from
14919         Constructor.Emit() for non-static `struct' constructor which do
14920         not have any initializer.  It creates a special variable for the
14921         "this" instance variable which will be checked by the flow
14922         analysis code to ensure that all of the struct's fields are
14923         initialized before control returns from the constructor.
14924         (UsageVector): Added support for struct members.  If a
14925         variable/parameter is a struct with N members, we reserve a slot
14926         in the usage vector for each member.  A struct is considered fully
14927         initialized if either the struct itself (slot 0) or all its
14928         members are initialized.
14930 2002-08-08  Martin Baulig  <martin@gnome.org>
14932         * driver.cs (Driver.MainDriver): Only report an error CS5001
14933         if there were no compilation errors.
14935         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14936         `UnsafeContext' property to determine whether the parent is in
14937         unsafe context rather than checking the parent's ModFlags:
14938         classes nested in an unsafe class are unsafe as well.
14940 2002-08-08  Martin Baulig  <martin@gnome.org>
14942         * statement.cs (UsageVector.MergeChildren): Distinguish between
14943         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14944         we return.  Added test17() and test18() to test-154.cs.
14946 2002-08-08  Martin Baulig  <martin@gnome.org>
14948         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14949         Family access, make sure the invoking type isn't a subclass of the
14950         queried type (that'd be a CS1540).
14952         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14953         this method which takes an additional `Type invocation_type'.
14955         * expression.cs (BaseAccess.DoResolve): Use the base type as
14956         invocation and query type.
14957         (MemberAccess.DoResolve): If the lookup failed and we're about to
14958         report a CS0122, try a lookup with the ec.ContainerType - if this
14959         succeeds, we must report a CS1540.
14961 2002-08-08  Martin Baulig  <martin@gnome.org>
14963         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14964         (MethodGroupExpr): Implement the IMemberExpr interface.
14966         * expression (MemberAccess.ResolveMemberAccess): No need to have
14967         any special code for MethodGroupExprs anymore, they're now
14968         IMemberExprs.   
14970 2002-08-08  Martin Baulig  <martin@gnome.org>
14972         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14973         Family, FamANDAssem and FamORAssem permissions.
14974         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14976 2002-08-08  Martin Baulig  <martin@gnome.org>
14978         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14979         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14980         or loop block.
14982 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14984         * driver.cs: implemented /resource option to embed managed resources.
14986 2002-08-07  Martin Baulig  <martin@gnome.org>
14988         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14989         (FieldBase.HasFieldInitializer): New public property.
14990         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14991         returns the field initializer and makes sure it is only resolved once.
14992         (TypeContainer.EmitFieldInitializers): Call
14993         FieldBase.GetInitializerExpression to get the initializer, this ensures
14994         that it isn't resolved multiple times.
14996         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14997         the resolving process (SimpleName/MemberLookup) that we're currently
14998         emitting a field initializer (which must not access any instance members,
14999         this is an error CS0236).
15001         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15002         argument, if the `IsFieldInitializer' flag is set, we must report and
15003         error CS0236 and not an error CS0120.   
15005 2002-08-07  Martin Baulig  <martin@gnome.org>
15007         * ecore.cs (IMemberExpr): New public interface.
15008         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15009         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15010         if the expression is an IMemberExpr.
15012         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15013         to be null, implicitly default to `this' if we're non-static in
15014         this case.  Simplified the code a lot by using the new IMemberExpr
15015         interface.  Also fixed bug #28176 here.
15017 2002-08-06  Martin Baulig  <martin@gnome.org>
15019         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15020         ParameterReferences during semantic analysis so that we can do a
15021         type-only search when resolving Cast, TypeOf and SizeOf.
15022         (block): Pass the `current_local_parameters' to the Block's
15023         constructor.
15025         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15026         argument to the constructor.
15027         (ConstructorInitializer.Resolve): Create a temporary implicit
15028         block with the parameters.
15030         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15031         references here if we aren't doing a type-only search.
15033         * statement.cs (Block): Added constructor which takes a
15034         `Parameters parameters' argument.
15035         (Block.Parameters): New public property.
15037         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15038         to `Parameters' and made it public readonly.
15040 2002-08-06  Martin Baulig  <martin@gnome.org>
15042         * ecore.cs (Expression.Warning): Made this public as well.
15044         * report.cs (Report.Debug): Print the contents of collections.
15046 2002-08-06  Martin Baulig  <martin@gnome.org>
15048         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15049         used to tell Resolve() which kinds of expressions it may return.
15050         (Expression.Resolve): Added overloaded version of this method which
15051         takes a `ResolveFlags flags' argument.  This can be used to tell
15052         Resolve() which kinds of expressions it may return.  Reports a
15053         CS0118 on error.
15054         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15055         ResolveFlags.SimpleName.
15056         (Expression.Error118): Added overloaded version of this method which
15057         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15058         which kinds of expressions are allowed.
15060         * expression.cs (Argument.ResolveMethodGroup): New public method.
15061         Resolves an argument, but allows a MethodGroup to be returned.
15062         This is used when invoking a delegate.
15064         * TODO: Updated a bit.
15066 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15068         Fixed compilation with csc.
15070         * ecore.cs: Expression.Error made public. Is this correct? Should
15071         Warning be made public too?
15073         * expression.cs: use ea.Location instead of ea.loc.
15074         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15076 2002-08-06  Martin Baulig  <martin@gnome.org>
15078         * ecore.cs (Expression.loc): Moved the location here instead of
15079         duplicating it in all derived classes.
15080         (Expression.Location): New public property.
15081         (Expression.Error, Expression.Warning): Made them non-static and
15082         removed the location argument.
15083         (Expression.Warning): Added overloaded version which takes an
15084         `int level' argument.
15085         (Expression.Error118): Make this non-static and removed the
15086         expression and location arguments.
15087         (TypeExpr): Added location argument to the constructor.
15089         * expression.cs (StaticCallExpr): Added location argument to
15090         the constructor.
15091         (Indirection, PointerArithmetic): Likewise.
15092         (CheckedExpr, UnCheckedExpr): Likewise.
15093         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15094         (StringPtr): Likewise.
15097 2002-08-05  Martin Baulig  <martin@gnome.org>
15099         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15101         * assign.cs (Assign.DoResolve): Check whether the source
15102         expression is a value or variable.
15104         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15105         while resolving the corresponding blocks.
15107         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15108         an error, don't silently return null.
15110         * statement.cs (Block.AddVariable): Do the error reporting here
15111         and distinguish between CS0128 and CS0136.
15112         (Block.DoResolve): Report all unused labels (warning CS0164).
15113         (LabeledStatement): Pass the location to the constructor.
15114         (LabeledStatement.HasBeenReferenced): New property.
15115         (LabeledStatement.Resolve): Set it to true here.
15117         * statement.cs (Return.Emit): Return success even after reporting
15118         a type mismatch error (CS0126 or CS0127), this is what csc does and
15119         it avoids confusing the users with any consecutive errors.
15121 2002-08-05  Martin Baulig  <martin@gnome.org>
15123         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15125         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15127         * expression.cs (MemberAccess.DoResolve): Silently return if an
15128         error has already been reported.
15130         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15131         error has already been reported.
15133 2002-08-05  Martin Baulig  <martin@gnome.org>
15135         * statement.cs (UsageVector): Only initialize the `parameters'
15136         vector if we actually have any "out" parameters.
15138 2002-08-05  Martin Baulig  <martin@gnome.org>
15140         * expression.cs (Binary.ResolveOperator): When combining delegates,
15141         they must have the same type.
15143 2002-08-05  Martin Baulig  <martin@gnome.org>
15145         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15146         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15147         work with the ms runtime and we also don't need it: if we're a
15148         PropertyBuilder and not in the `indexer_arguments' hash, then we
15149         are a property and not an indexer.
15151         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15152         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15153         since the latter one doesn't work with the ms runtime.
15155 2002-08-03  Martin Baulig  <martin@gnome.org>
15157         Fixed bugs #27998 and #22735.
15159         * class.cs (Method.IsOperator): New public field.
15160         (Method.CheckBase): Report CS0111 if there's already a method
15161         with the same parameters in the current class.  Report CS0508 when
15162         attempting to change the return type of an inherited method.
15163         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15164         and it's not marked abstract or extern.
15165         (PropertyBase): New abstract base class for Property and Indexer.
15166         (PropertyBase.CheckBase): Moved here from Property and made it work
15167         for indexers.
15168         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15169         the same so we can reuse it there.
15170         (Property, Indexer): Derive from PropertyBase.
15171         (MethodSignature.inheritable_property_signature_filter): New delegate
15172         to find properties and indexers.
15174         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15175         argument and improved error reporting.
15177         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15178         EmptyReadOnlyParameters and made it a property.
15180         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15181         version of this method which takes a `PropertyInfo indexer'.
15182         (TypeManager.RegisterIndexer): New method.
15184         * class.cs: Added myself as author of this file :-)
15186 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15188         * class.cs: fixed compilation on windoze.
15190 2002-08-03  Martin Baulig  <martin@gnome.org>
15192         * interface.cs (Interface.GetInterfaceBases): Check whether all
15193         base interfaces are at least as accessible than the current one.
15195         * class.cs (TypeContainer.GetClassBases): Check whether base types
15196         are at least as accessible than the current type.
15197         (TypeContainer.AsAccessible): Implemented and made non-static.
15198         (MemberBase.CheckParameters): Report errors if the accessibility
15199         checks fail.
15201         * delegate.cs (Delegate.Delegate): The default visibility is
15202         internal for top-level types and private for nested types.
15203         (Delegate.Define): Report errors if the accessibility checks fail.
15205         * enum.cs (Enum.Enum): The default visibility is internal for
15206         top-level types and private for nested types.
15207         (Enum.DefineType): Compute the correct visibility.
15209         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15210         function which takes a `bool is_toplevel' instead of a TypeContainer.
15212         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15213         builtin type.
15215 2002-08-02  Martin Baulig  <martin@gnome.org>
15217         * expression.cs (LocalVariableReferenc): Added constructor which
15218         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15219         (LocalVariableReference.IsReadOnly): New property.
15220         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15221         variable is readonly, use our own readonly flag to do this; you can
15222         use the new constructor to get a writable reference to a read-only
15223         variable.
15225         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15226         reference to the local variable.
15228 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15230         * rootcontext.cs (ResolveCore): Also include System.Exception
15232         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15233         we reach an EmptyStatement.
15235         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15236         is also fine.
15238         * expression.cs (Binary.ResolveOperator): Check error result in
15239         two places.
15241         use brtrue/brfalse directly and avoid compares to null.
15243 2002-08-02  Martin Baulig  <martin@gnome.org>
15245         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15246         Fixes bug #28407, added test-155.cs.
15248 2002-08-01  Martin Baulig  <martin@gnome.org>
15250         * class.cs (Event.EmitDefaultMethod): Make this work with static
15251         events.  Fixes #28311, added verify-3.cs.
15253 2002-08-01  Martin Baulig  <martin@gnome.org>
15255         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15256         `is_disposable' fields.
15257         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15258         `hm.is_disposable' if we're using the collection pattern.
15259         (Foreach.EmitCollectionForeach): Use the correct type for the
15260         enumerator's local variable, only emit the try/finally block if
15261         necessary (fixes #27713).
15263 2002-08-01  Martin Baulig  <martin@gnome.org>
15265         * ecore.cs (Expression.report118): Renamed to Error118 and made
15266         it public static.
15268         * statement.cs (Throw.Resolve): Check whether the expression is of
15269         the correct type (CS0118) and whether the type derives from
15270         System.Exception (CS0155).
15271         (Catch.Resolve): New method.  Do the type lookup here and check
15272         whether it derives from System.Exception (CS0155).
15273         (Catch.CatchType, Catch.IsGeneral): New public properties.
15275         * typemanager.cs (TypeManager.exception_type): Added.
15277 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15279         * driver.cs: Updated About function.
15281 2002-07-31  Martin Baulig  <martin@gnome.org>
15283         Implemented Control Flow Analysis.
15285         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15286         (EmitContext.CurrentBranching): Added.
15287         (EmitContext.StartFlowBranching): Added.
15288         (EmitContext.EndFlowBranching): Added.
15289         (EmitContext.KillFlowBranching): Added.
15290         (EmitContext.IsVariableAssigned): Added.
15291         (EmitContext.SetVariableAssigned): Added.
15292         (EmitContext.IsParameterAssigned): Added.
15293         (EmitContext.SetParameterAssigned): Added.
15294         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15295         Added control flow analysis stuff here.
15297         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15298         resolve the expression as lvalue.
15299         (LocalVariableReference.DoResolve): Check whether the variable has
15300         already been assigned.
15301         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15302         the parameter as assigned here.
15303         (ParameterReference.DoResolve): Check whether the parameter has already
15304         been assigned.
15305         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15306         expression as lvalue.
15308         * statement.cs (FlowBranching): New class for the flow analysis code.
15309         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15310         (LabeledStatement.IsDefined): New public property.
15311         (LabeledStatement.AddUsageVector): New public method to tell flow
15312         analyis that the label may be reached via a forward jump.
15313         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15314         flow analysis.
15315         (VariableInfo.Number): New public field.  This is used by flow analysis
15316         to number all locals of a block.
15317         (Block.CountVariables): New public property.  This is the number of
15318         local variables in this block (including the locals from all parent
15319         blocks).
15320         (Block.EmitMeta): Number all the variables.
15322         * statement.cs: Added flow analysis support to all classes.
15324 2002-07-31  Martin Baulig  <martin@gnome.org>
15326         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15327         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15328         then use this argument.
15330         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15332         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15333         use this to specify /define options.
15335 2002-07-29  Martin Baulig  <martin@gnome.org>
15337         * statement.cs (Fixed): Moved all code that does variable lookups
15338         and resolvings from Emit to Resolve.
15340         * statement.cs (For): Moved all code that does variable lookups
15341         and resolvings from Emit to Resolve.
15343         * statement.cs (Using): Moved all code that does variable lookups
15344         and resolvings from Emit to Resolve.
15346 2002-07-29  Martin Baulig  <martin@gnome.org>
15348         * attribute.cs (Attribute.Resolve): Explicitly catch a
15349         System.NullReferenceException when creating the
15350         CustromAttributeBuilder and report a different warning message.
15352 2002-07-29  Martin Baulig  <martin@gnome.org>
15354         * support.cs (ParameterData.ParameterName): Added method to
15355         get the name of a parameter.
15357         * typemanager.cs (TypeManager.IsValueType): New public method.
15359 2002-07-29  Martin Baulig  <martin@gnome.org>
15361         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15362         is a flag which specifies that it's either ref or out.
15363         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15364         the out parameter to `out Parameter.Modifier mod', also set the
15365         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15367         * support.cs (InternalParameters.ParameterModifier): Distinguish
15368         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15369         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15371         * expression.cs (Argument.GetParameterModifier): Distinguish
15372         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15373         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15375 2002-07-29  Martin Baulig  <martin@gnome.org>
15377         * expression.cs (ParameterReference.ParameterReference): Added
15378         `Location loc' argument to the constructor.
15380         * cs-parser.jay: Pass location to ParameterReference.
15382 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15384         * statement.cs (Try): Initialize the location.
15386         * cs-parser.jay: pass location to Try.
15388         * expression.cs (Unary.Reduce): Change the prototype to return
15389         whether a constant fold could be performed or not.  The result is
15390         returned in an out parameters.  In the case of Indirection and
15391         AddressOf, we want to perform the full tests.
15393 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15395         * statement.cs (Statement.Emit): Flag dead code.
15397 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15399         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15401 2002-07-27  Martin Baulig  <martin@gnome.org>
15403         * class.cs (MethodData.Define): Put back call to
15404         TypeManager.AddMethod(), accidentally commented this out.
15406         * report.cs (Debug): New public method to print debugging information,
15407         this is `[Conditional ("DEBUG")]'.
15409 2002-07-26  Martin Baulig  <martin@gnome.org>
15411         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15412         (switch_statement): Push the current_block to the switch_stack and
15413         pop it again when we're done with the switch.
15414         (switch_section): The new block is a child of the current_block.
15415         Fixes bug #24007, added test-152.cs.
15417 2002-07-27  Martin Baulig  <martin@gnome.org>
15419         * expression.cs (Invocation.EmitArguments): When calling a varargs
15420         function with only its fixed arguments, we need to pass an empty
15421         array.
15423 2002-07-27  Martin Baulig  <martin@gnome.org>
15425         Mono 0.13 has been released.
15427 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15429         * driver.cs: Rename --resource to --linkres, because that is what
15430         we do currently, we dont support --resource yet.
15432         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15434 2002-07-25  Martin Baulig  <martin@gnome.org>
15436         * class.cs (MethodData): New public class.  This is a `method builder'
15437         class for a method or one accessor of a Property/Indexer/Event.
15438         (MethodData.GetMethodFlags): Moved here from MemberBase.
15439         (MethodData.ApplyAttributes): Likewise.
15440         (MethodData.ApplyObsoleteAttribute): Likewise.
15441         (MethodData.ApplyConditionalAttribute): Likewise.
15442         (MethodData.ApplyDllImportAttribute): Likewise.
15443         (MethodData.CheckAbstractAndExternal): Likewise.
15444         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15445         (MethodData.Emit): Formerly known as Method.Emit().
15446         (MemberBase): Moved everything which was specific to a single
15447         accessor/method to MethodData.
15448         (Method): Create a new MethodData and call Define() and Emit() on it.
15449         (Property, Indexer, Event): Create a new MethodData objects for each
15450         accessor and call Define() and Emit() on them.
15452 2002-07-25  Martin Baulig  <martin@gnome.org>
15454         Made MethodCore derive from MemberBase to reuse the code from there.
15455         MemberBase now also checks for attributes.
15457         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15458         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15459         as virtual.
15460         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15461         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15462         (MemberBase.ApplyAttributes): New virtual method; applies the
15463         attributes to a method or accessor.
15464         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15465         (MemberBase.ApplyConditionalAttribute): Likewise.
15466         (MemberBase.ApplyDllImportAttribute): Likewise.
15467         (MemberBase.CheckAbstractAndExternal): Likewise.
15468         (MethodCore.ParameterTypes): This is now a property instead of a
15469         method, it's initialized from DoDefineParameters().
15470         (MethodCore.ParameterInfo): Removed the set accessor.
15471         (MethodCore.DoDefineParameters): New protected virtual method to
15472         initialize ParameterTypes and ParameterInfo.
15473         (Method.GetReturnType): We can now simply return the MemberType.
15474         (Method.GetMethodFlags): Override the MemberBase version and add
15475         the conditional flags.
15476         (Method.CheckBase): Moved some code from Define() here, call
15477         DoDefineParameters() here.
15478         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15479         here to avoid some larger code duplication.
15480         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15481         ensure that abstract and external accessors don't declare a body.
15483         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15484         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15485         lookup in the attribute's parent classes, so we need to abort as soon
15486         as we found the first match.
15487         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15488         the attribute has no arguments.
15490         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15491         of a Method.
15493 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15495         * cs-parser.jay: reverted previous patch.
15497 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15499         * cs-parser.jay: fixed bug #22119.
15501 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15503         * attribute.cs: fixed compilation. The error was:
15504         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15505         be assigned to before control leaves the current method."
15506         [FIXME:  Filed as bug #28186: MCS must report this error.]
15508 2002-07-25  Martin Baulig  <martin@gnome.org>
15510         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15511         method to pull the condition name ouf of a Conditional attribute.
15512         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15513         the obsolete message and error flag out of an Obsolete attribute.
15515         * class.cs (Method.GetMethodFlags): New public method to get the
15516         TypeManager.MethodFlags for this method.
15517         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15518         private methods.
15519         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15520         if we're overriding a virtual function, set the new private variable
15521         `parent_method'; call the new TypeManager.AddMethod().
15523         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15524         the MethodBuilder and the Method in a PtrHashtable.
15525         (TypeManager.builder_to_method): Added for this purpose.
15526         (TypeManager.MethodFlags): Added IsObsoleteError.
15527         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15528         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15529         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15530         the message from the attribute.
15532 2002-07-24  Martin Baulig  <martin@gnome.org>
15534         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15535         preprocessor directives, ensure that the argument to #define/#undef is
15536         exactly one identifier and that it's actually an identifier.
15538         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15539         did not work ....
15541 2002-07-24  Martin Baulig  <martin@gnome.org>
15543         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15544         initialize it to TypeManager.object_type in the constructor.
15545         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15546         of the `hm.get_current' method if we're using the collection pattern.
15547         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15548         for the explicit conversion to make it work when we're using the collection
15549         pattern and the `Current' property has a different return type than `object'.
15550         Fixes #27713.
15552 2002-07-24  Martin Baulig  <martin@gnome.org>
15554         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15555         does not match, but don't report any errors.  This method is called in
15556         order for all methods in a MethodGroupExpr until a matching method is
15557         found, so we don't want to bail out if the first method doesn't match.
15558         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15559         matches, report the 123.  Fixes #28070.
15561 2002-07-24  Martin Baulig  <martin@gnome.org>
15563         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15564         TypeManager.TypeToCoreType() to the top of the method so the
15565         following equality checks will work.  Fixes #28107.
15567 2002-07-24  Martin Baulig  <martin@gnome.org>
15569         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15570         operand is of type uint, and the other operand is of type sbyte,
15571         short or int, the operands are converted to type long." -
15572         Actually do what this comment already told us.  Fixes bug #28106,
15573         added test-150.cs.
15575 2002-07-24  Martin Baulig  <martin@gnome.org>
15577         * class.cs (MethodBase): New abstract class.  This is now a base
15578         class for Property, Indexer and Event to avoid some code duplication
15579         in their Define() and DefineMethods() methods.
15580         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15581         generic methods for Define() and DefineMethods().
15582         (FieldBase): Derive from MemberBase, not MemberCore.
15583         (Property): Derive from MemberBase, not MemberCore.
15584         (Property.DefineMethod): Moved all the code from this method to the
15585         new MethodBase.DefineAccessor(), just call it with appropriate
15586         argumetnts.
15587         (Property.Define): Call the new Property.DoDefine(), this does some
15588         sanity checks and we don't need to duplicate the code everywhere.
15589         (Event): Derive from MemberBase, not MemberCore.
15590         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15591         accessors, this will also make them work with interface events.
15592         (Indexer): Derive from MemberBase, not MemberCore.
15593         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15594         (Indexer.Define): Use the new MethodBase functions.
15596         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15597         argument to the constructor.
15598         (Interface.FindMembers): Added support for interface events.
15599         (Interface.PopluateEvent): Implemented.
15601         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15603 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15605         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15606         but this is required to check for a method name being the same as
15607         the containing class.  
15609         Handle this now.
15611 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15613         * interface.cs: initialize variable.
15615 2002-07-23  Martin Baulig  <martin@gnome.org>
15617         Implemented the IndexerName attribute in interfaces.
15619         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15620         name if this is an explicit interface implementation.
15621         (Indexer.InterfaceIndexerName): New public variable.  If we're
15622         implementing an interface indexer, this is the IndexerName in that
15623         interface.  Otherwise, it's the IndexerName.
15624         (Indexer.DefineMethod): If we're implementing interface indexer,
15625         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15626         and Pending.ImplementIndexer methods.
15627         (Indexer.Define): Also define the PropertyBuilder if we're
15628         implementing an interface indexer and this is neither an explicit
15629         interface implementation nor do the IndexerName match the one in
15630         the interface.
15632         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15633         If a method is defined here, then we always need to create a proxy
15634         for it.  This is used when implementing interface indexers.
15635         (Pending.IsInterfaceIndexer): New public method.
15636         (Pending.ImplementIndexer): New public method.
15637         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15638         This is used when implementing interface indexers to define a proxy
15639         if necessary.
15640         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15641         define a proxy if necessary.
15643         * interface.cs (Interface.IndexerName): New public variable.
15644         (Interface.PopulateIndexer): Set the IndexerName.
15645         (Interface.DefineIndexers): New private method.  Populate all the
15646         indexers and make sure their IndexerNames match.
15648         * typemanager.cs (IndexerPropertyName): Added support for interface
15649         indexers.
15651 2002-07-22  Martin Baulig  <martin@gnome.org>
15653         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15654         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15655         ret if HasReturnLabel.
15656         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15657         variables.
15659         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15660         and set the ec.LoopBeginTryCatchLevel.
15661         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15662         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15663         the current ec.TryCatchLevel, the branch goes out of an exception
15664         block.  In this case, we need to use Leave and not Br.
15666 2002-07-22  Martin Baulig  <martin@gnome.org>
15668         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15669         block unless the block does not always return or it is contained in
15670         another try { ... } catch { ... } block.  Fixes bug #26506.
15671         Added verify-1.cs to the test suite.
15673 2002-07-22  Martin Baulig  <martin@gnome.org>
15675         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15676         then we do not always return.  Fixes bug #24985.
15678 2002-07-22  Martin Baulig  <martin@gnome.org>
15680         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15681         lookup on a per-class level; ie. walk up the class hierarchy until we
15682         found at least one applicable method, then choose the best among them.
15683         Fixes bug #24463 and test-29.cs.
15685 2002-07-22  Martin Baulig  <martin@gnome.org>
15687         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15688         return types of the methods.  The return type is not part of the
15689         signature and we must not check it to make the `new' modifier work.
15690         Fixes bug #27999, also added test-147.cs.
15691         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15693         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15694         on the method's return type.
15696 2002-07-21  Martin Baulig  <martin@gnome.org>
15698         * assign.cs: Make this work if the rightmost source is a constant and
15699         we need to do an implicit type conversion.  Also adding a few more tests
15700         to test-38.cs which should have caught this.
15702         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15703         target in the makefile for this.  The makefile.gnu is primarily intended
15704         for end-users who don't want to debug the compiler.
15706 2002-07-21  Martin Baulig  <martin@gnome.org>
15708         * assign.cs: Improved the Assign class so it can now handle embedded
15709         assignments (X = Y = Z = something).  As a side-effect this'll now also
15710         consume less local variables.  test-38.cs now passes with MCS, added
15711         a few new test cases to that test.
15713 2002-07-20  Martin Baulig  <martin@gnome.org>
15715         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15716         instructions.  Fixes bug #27977, also added test-146.cs.
15718 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15720         * cs-tokenizer.cs: fixed getHex ().
15722 2002-07-19  Martin Baulig  <martin@gnome.org>
15724         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15725         not Type.GetType() to lookup the array type.  This is needed when
15726         we're constructing an array of a user-defined type.
15727         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15728         single-dimensional arrays, but also for single-dimensial arrays of
15729         type decimal.
15731 2002-07-19  Martin Baulig  <martin@gnome.org>
15733         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15734         this function is called, it's not allowed to share LocalBuilders
15735         among ILGenerators.
15737 2002-07-19  Martin Baulig  <martin@gnome.org>
15739         * expression.cs (Argument.Resolve): Report an error 118 when trying
15740         to pass a type as argument.
15742 2002-07-18  Martin Baulig  <martin@gnome.org>
15744         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15745         Conv_R_Un for the signed `long' type.
15747 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15749         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15750         `expr' for the temporary result, as that will fail if we do
15751         multiple resolves on the same expression.
15753 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15755         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15756         ec.TypeContainer for looking up aliases. 
15758         * class.cs (TypeContainer): Remove LookupAlias from here.
15760         * decl.cs (DeclSpace); Move here.
15762 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15764         * class.cs (FindMembers): Only call filter if the constructor
15765         bulider is not null.
15767         Also handle delegates in `NestedTypes' now.  Now we will perform
15768         type lookups using the standard resolution process.  This also
15769         fixes a bug.
15771         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15772         This uses Expressions (the limited kind that can be parsed by the
15773         tree) instead of strings.
15775         * expression.cs (ComposedCast.ToString): Implement, used to flag
15776         errors since now we have to render expressions.
15778         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15779         FormArrayType. 
15781         * ecore.cs (SimpleName.ToString): ditto.
15783         * cs-parser.jay: Instead of using strings to assemble types, use
15784         Expressions to assemble the type (using SimpleName, ComposedCast,
15785         MemberAccess).  This should fix the type lookups in declarations,
15786         because we were using a different code path for this.
15788         * statement.cs (Block.Resolve): Continue processing statements
15789         even when there is an error.
15791 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15793         * class.cs (Event.Define): Also remove the `remove' method from
15794         the list of pending items.
15796         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15797         generate more compact code. 
15799 2002-07-17  Martin Baulig  <martin@gnome.org>
15801         * const.cs (Const.LookupConstantValue): Add support for constant
15802         `unchecked' and `checked' expressions.
15803         Also adding test case test-140.cs for this.
15805 2002-07-17  Martin Baulig  <martin@gnome.org>
15807         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15808         check whether mi.ReturnType implements the IEnumerator interface; the
15809         `==' and the IsAssignableFrom() will fail in this situation.
15811 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15813         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15814         here too.
15816 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15818         * expression.cs: fixed bug #27811.
15820 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15822         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15823         Molaro: when we are a ref, the value already contains a pointer
15824         value, do not take the address of it.
15826 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15827         * removed mb-parser.jay and mb-tokenizer.cs
15829 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15831         * expression.cs: check against the building corlib void type.
15833 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15835         * ecore.cs: fix for valuetype static readonly fields: when 
15836         initializing them, we need their address, not the address of a copy.
15838 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15840         * typemanager.cs: register also enum_type in corlib.
15842 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15844         * class.cs: allow calling this (but not base) initializers in structs.
15846 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15848         * ecore.cs: make sure we compare against the building base types
15849         in GetTypeSize ().
15851 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15853         * typemanager.cs: fix TypeToCoreType() to handle void and object
15854         (corlib gets no more typerefs after this change).
15856 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15858         * expression.cs (ArrayCreation.EmitArrayArguments): use
15859         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15861         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15862         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15863         array indexes, the runtime actually forbids them.
15865         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15866         for array arguments here.
15868         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15869         instead of the default for ValueTypes.
15871         (New.DoEmit): Use IsValueType instead of
15872         IsSubclassOf (value_type)
15873         (New.DoResolve): ditto.
15874         (Invocation.EmitCall): ditto.
15876         * assign.cs (Assign): ditto.
15878         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15879         Statements *are* currently doing part of their resolution during
15880         Emit.  
15882         Expressions do always resolve during resolve, but statements are
15883         only required to propagate resolution to their children.
15885 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15887         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15889         (LoadAssembly): Do not add the dll if it is already specified
15891         (MainDriver): Add the System directory to the link path at the end,
15892         after all the other -L arguments. 
15894         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15895         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15896         ldelem.u1) and using the opposite for sbytes.
15898         This fixes Digger, and we can finally run it.
15900         * driver.cs (UnixParseOption): Move the option parsing here.  
15901         (CSCParseOption): Implement CSC-like parsing of options.
15903         We now support both modes of operation, the old Unix way, and the
15904         new CSC-like way.  This should help those who wanted to make cross
15905         platform makefiles.
15907         The only thing broken is that /r:, /reference: and /lib: are not
15908         implemented, because I want to make those have the same semantics
15909         as the CSC compiler has, and kill once and for all the confussion
15910         around this.   Will be doing this tomorrow.
15912         * statement.cs (Unsafe.Resolve): The state is checked during
15913         resolve, not emit, so we have to set the flags for IsUnsfe here.
15915 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15917         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15918         not catch the Error_ObjectRefRequired in SimpleName (as it is
15919         possible to have a class/instance variable name that later gets
15920         deambiguated), we have to check this here.      
15922 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15924         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15925         make static and put into Expression.
15927         (Event.Define): Register the private field of the event with the 
15928         TypeManager so that GetFieldFromEvent can get at it.
15930         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15931         keep track of the private field associated with an event which
15932         has no accessors.
15934         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15935         private field.
15937         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15939 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15941         * expression.cs (Binary.EmitBranchable): this routine emits the
15942         Binary expression in a branchable context.  This basically means:
15943         we need to branch somewhere, not just get the value on the stack.
15945         This works together with Statement.EmitBoolExpression.
15947         * statement.cs (Statement.EmitBoolExpression): Use
15948         EmitBranchable. 
15950 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15952         * statement.cs (For): Reduce the number of jumps in loops.
15954         (For): Implement loop inversion for the For statement.
15956         (Break): We can be breaking out of a Try/Catch controlled section
15957         (foreach might have an implicit try/catch clause), so we need to
15958         use Leave instead of Br.
15960         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15961         now).  If the instace expression supports IMemoryLocation, we use
15962         the AddressOf method from the IMemoryLocation to extract the
15963         address instead of emitting the instance.
15965         This showed up with `This', as we were emitting the instance
15966         always (Emit) instead of the Address of This.  Particularly
15967         interesting when This is a value type, as we dont want the Emit
15968         effect (which was to load the object).
15970 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15972         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15974         * statement.cs (Checked): Set the CheckedState during the resolve
15975         process too, as the ConvCast operations track the checked state on
15976         the resolve process, and not emit.
15978         * cs-parser.jay (namespace_member_declaration): Flag that we have
15979         found a declaration when we do.  This is used to flag error 1529
15981         * driver.cs: Report ok when we display the help only.
15983 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15985         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15987 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15989         * cs-tokenizer.cs (define): We also have to track locally the
15990         defines.  AllDefines is just used for the Conditional Attribute,
15991         but we also need the local defines for the current source code. 
15993 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15995         * statement.cs (While, For, Do): These loops can exit through a
15996         Break statement, use this information to tell whether the
15997         statement is the last piece of code.
15999         (Break): Flag that we break.
16001         * codegen.cs (EmitContexts): New `Breaks' state variable.
16003 2002-07-03  Martin Baulig  <martin@gnome.org>
16005         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16006         modifiers in method declarations in structs.  Otherwise, you won't
16007         be able to override things like Object.Equals().
16009 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16011         * class.cs (Method, Property, Indexer): Do not allow the public
16012         modifier to be used in explicit interface implementations.
16014         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16015         override modifiers in method declarations in structs
16017 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16019         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16020         integer or real overflow, report an error
16022 2002-07-02  Martin Baulig  <martin@gnome.org>
16024         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16025         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16026         to tell the runtime about our newly created System.Object and
16027         System.ValueType types.
16029 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16031         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16032         struct instead of Ldarg/Starg.
16034 2002-07-02  Martin Baulig  <martin@gnome.org>
16036         * expression.cs (Indirection.Indirection): Call
16037         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16039 2002-07-02  Martin Baulig  <martin@gnome.org>
16041         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16042         ValueType, call TypeManager.TypeToCoreType() on it.
16043         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16044         the OpCodes.Newarr argument.
16046 2002-07-02  Martin Baulig  <martin@gnome.org>
16048         * expression.cs (Invocation.EmitCall): When compiling corlib,
16049         replace all calls to the system's System.Array type to calls to
16050         the newly created one.
16052         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16053         System.Array methods.
16054         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16055         from the system's System.Array type which must be replaced.
16057 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16059         * typemanager.cs: load unverifiable_code_ctor so we can build
16060         corlib using the correct type. Avoid using GetTypeCode() with
16061         TypeBuilders.
16062         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16063         TypeManager.object_type to allow building corlib.
16065 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16067         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16069 2002-07-01  Martin Baulig  <martin@gnome.org>
16071         * class.cs: Make the last change actually work, we need to check
16072         whether `ifaces != null' to avoid a crash.
16074 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16076         * class.cs: when we build structs without fields that implement
16077         interfaces, we need to add the interfaces separately, since there is
16078         no API to both set the size and add the interfaces at type creation
16079         time.
16081 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16083         * expression.cs: the dimension arguments to the array constructors
16084         need to be converted if they are a long.
16086 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16088         * class.cs: don't emit ldarg.0 if there is no parent constructor
16089         (fixes showstopper for corlib).
16091 2002-06-29  Martin Baulig  <martin@gnome.org>
16093         MCS now compiles corlib on GNU/Linux :-)
16095         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16096         ie. check for MethodImplOptions.InternalCall.
16098         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16099         and TypeManager.attribute_type are null, so we must explicitly check
16100         whether parent is not null to find out whether it's an attribute type.
16101         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16102         and SetBuilder, not only if the property is neither abstract nor external.
16103         This is necessary to set the MethodImplOptions on the accessor methods.
16104         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16105         SetBuilder, see Property.Emit().
16107         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16108         populate "System.Object", "System.ValueType" and "System.Attribute" since
16109         they've already been populated from BootCorlib_PopulateCoreTypes().
16111 2002-06-29  Martin Baulig  <martin@gnome.org>
16113         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16114         is the NullLiteral, we also need to make sure that target_type is not
16115         an enum type.   
16117 2002-06-29  Martin Baulig  <martin@gnome.org>
16119         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16120         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16121         before calling BootstrapCorlib_ResolveDelegate ().
16123 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16125         * statement.cs: fixed build-breaker. All tests passed ok.
16127 2002-06-27  Martin Baulig  <martin@gnome.org>
16129         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16130         for System.Decimal when compiling corlib.
16132 2002-06-27  Martin Baulig  <martin@gnome.org>
16134         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16135         switch blocks which contain nothing but a default clause.
16137 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16139        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16141 2002-06-27  Martin Baulig  <martin@gnome.org>
16143         * ecore.cs (PropertyExpr.PropertyExpr): Call
16144         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16146         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16147         is already a TypeBuilder.
16149 2002-06-27  Martin Baulig  <martin@gnome.org>
16151         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16152         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16153         the "from an array-type to System.Array" case.  This makes it work
16154         when compiling corlib.
16156 2002-06-27  Martin Baulig  <martin@gnome.org>
16158         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16159         non-static PropertyExpr, set its InstanceExpression.  This makes
16160         the `ICollection.Count' property work in System/Array.cs.
16162 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16164         * driver.cs: Made error handling more consistent.  Errors now
16165         tracked by Report class, so many methods which used to return int
16166         now return void.  Main() now prints success/failure and 
16167         errors/warnings message.
16169         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16170         the magic number return values (123 and 124).  Now, if the
16171         expected error occurs, the compiler exits with success (exit value
16172         0).  If the compilation completes without seeing that particular
16173         error, the compiler exits with failure (exit value 1).  The
16174         makefile in mcs/errors has been changed to handle the new behaviour.
16176         * report.cs: Made 'expected error' number a property and renamed
16177         it from 'Probe' to 'ExpectedError'.
16179         * genericparser.cs: Removed error handling support, since it is
16180         now all done by Report class.
16182         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16183         class, so parse() no longer returns an int.
16185         * namespace.cs: Use Report.Error instead of GenericParser.error
16187 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16189         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16190         TypeContainer.AddOperator): At the front of the list put the
16191         explicit implementations, so they get resolved/defined first. 
16193 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16195         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16196         interface type is implemented by this TypeContainer.  Used during
16197         explicit interface implementation.
16199         (Property.Define, Indexer.Define, Method.Define): Validate that
16200         the given interface in the explicit implementation is one of the
16201         base classes for the containing type.
16203         Also if we are explicitly implementing an interface, but there is
16204         no match in the pending implementation table, report an error.
16206         (Property.Define): Only define the property if we are
16207         not explicitly implementing a property from an interface.  Use the
16208         correct name also for those properties (the same CSC uses,
16209         although that is really not needed).
16211         (Property.Emit): Do not emit attributes for explicitly implemented
16212         properties, as there is no TypeBuilder.
16214         (Indexer.Emit): ditto.
16216         Hiding then means that we do not really *implement* a pending
16217         implementation, which makes code fail.
16219 2002-06-22  Martin Baulig  <martin@gnome.org>
16221         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16222         the return value of Object.GetType().  [FIXME: we need to do this whenever
16223         we get a type back from the reflection library].
16225 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16227         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16229 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16231         * attribute.cs: Return null if we can not look up the type.
16233         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16234         the interface types found.
16236         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16237         interface types found.
16239         * typemanager.cs (GetInterfaces): Make this routine returns alll
16240         the interfaces and work around the lame differences between
16241         System.Type and System.Reflection.Emit.TypeBuilder in the results
16242         result for GetInterfaces.
16244         (ExpandInterfaces): Given an array of interface types, expand and
16245         eliminate repeated ocurrences of an interface.  This expands in
16246         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16247         be IA, IB, IC.
16249 2002-06-21  Martin Baulig  <martin@gnome.org>
16251         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16252         on System.Enum.
16254 2002-06-21  Martin Baulig  <martin@gnome.org>
16256         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16257         and called with one of the core types, return the corresponding typebuilder for
16258         that type.
16260         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16261         element type.
16263 2002-06-21  Martin Baulig  <martin@gnome.org>
16265         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16266         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16267         (Expression.ConvertReferenceExplicit): Likewise.
16269         * expression.cs (ElementAccess.DoResolve): Likewise.
16270         (ElementAccess.DoResolveLValue): Likewise.
16272 2002-06-10  Martin Baulig  <martin@gnome.org>
16274         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16275         add the "value" parameter to the parameter list.
16277         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16278         to our caller.
16280 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16282         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16283         the argument to an int, uint, long or ulong, per the spec.  Also
16284         catch negative constants in array creation.
16286 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16288         * class.cs: do not allow the same interface to appear twice in
16289         the definition list.
16291 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16293         * ecore.cs: don't use ldlen with System.Array.
16295 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16297         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16299 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16301         * modifiers.cs: produce correct field attributes for protected
16302         internal. Easy fix so miguel can work on ther harder stuff:-)
16304 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16306         * pending.cs: New file.  Move the code from class.cs here.
16307         Support clearning the pending flag for all methods (when not doing
16308         explicit interface implementation).
16310 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16312         * rootcontext.cs: added a couple more types needed to bootstrap.
16314 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16316         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16317         constructor in the type, instead of any constructor in the type
16318         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16319         a bug in the Mono runtime when applying the params attribute). 
16321 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16322         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16324 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16326         * expression.cs (Unary.ResolveOperator): Use TypeManager
16327         to resolve the type.
16329 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16331         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16332         attached.
16334         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16335         with each member too.
16337         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16338         field builders too - this takes care of the enum member case.
16340 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16342         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16343         address-of operator on both value types and pointers.
16345 2002-06-10  Martin Baulig  <martin@gnome.org>
16347         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16348         PropertyBuilder to the `property_builders' list.
16350         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16351         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16352         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16353         find any indexers which are inherited from an interface.
16355 2002-06-09  Martin Baulig  <martin@gnome.org>
16357         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16358         the same type as the constant if necessary.  There's also a test-130.cs
16359         for this.
16361         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16363         * typemanager.cs (TypeManager.ChangeType): Previously known as
16364         Enum.ChangeEnumType().
16366 2002-06-09  Martin Baulig  <martin@gnome.org>
16368         * expression.cs (Cast.TryReduce): Added support for consts.
16370 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16372         * class.cs (Accessor): Hold attributes information so we can pass
16373         it along.
16375         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16376         Modify to pass in attributes attached to the methods.
16378         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16380         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16381         to handle the Accessor kind :-)
16383         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16385 2002-06-08  Martin Baulig  <martin@gnome.org>
16387         * expression.cs (Unary.TryReduceNegative): Added support for
16388         ULongConstants.
16390 2002-06-08  Martin Baulig  <martin@gnome.org>
16392         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16393         name can't be found in the `defined_names' - the caller will do a
16394         MemberLookup in this case and thus find methods in System.Enum
16395         such as Enum.IsDefined().
16397 2002-06-08  Martin Baulig  <martin@gnome.org>
16399         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16400         Convert.ChangeType() which works with TypeBuilder created types.
16401         (Enum.LookupEnumValue, Enum.Define): Use it here.
16403         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16404         `TypeBuilder.BaseType != null' check.
16405         (TypeContainer.FindMembers): Only lookup parent members if we
16406         actually have a parent.
16407         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16408         (ConstructorInitializer.Resolve): Likewise.
16410         * interface.cs (Interface.FindMembers): Added
16411         `TypeBuilder.BaseType != null' check.
16413         * rootcontext.cs (RootContext.ResolveCore): Added
16414         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16415         classes_second_stage.
16417         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16418         debug_type and trace_type when compiling with --nostdlib.       
16420 2002-06-07  Martin Baulig  <martin@gnome.org>
16422         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16423         (AddField): Set it to true when adding a non-static field.
16424         (DefineType): Use `have_nonstatic_fields' to find out whether we
16425         have non-static fields, not `Fields != null'.
16427 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16429         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16430         dereferencing a null on the static-field code path)
16432 2002-05-30  Martin Baulig  <martin@gnome.org>
16434         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16435         to take command line arguments.  Use reflection to call the new
16436         custom `Initialize' function on the symbol writer and pass it the
16437         command line arguments.
16439         * driver.cs (--debug-args): New command line argument to pass command
16440         line arguments to the symbol writer.
16442 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16444         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16445         the target type for indexers and properties.  Thanks to Joe for
16446         catching this.
16448 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16450         * typemanager.cs (MethodFlags): returns the method flags
16451         (Obsolete/ShouldIgnore) that control warning emission and whether
16452         the invocation should be made, or ignored. 
16454         * expression.cs (Invocation.Emit): Remove previous hack, we should
16455         not do this on matching a base type, we should do this based on an attribute
16457         Only emit calls to System.Diagnostics.Debug and
16458         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16459         on the command line.
16461         * rootcontext.cs: Global settings for tracing and debugging.
16463         * cs-tokenizer.cs (define): New utility function to track
16464         defines.   Set the global settings for TRACE and DEBUG if found.
16466 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16468         * interface.cs (Populate*): Pass in the TypeContainer as well as
16469         the DeclSpace as parameters so that we can create EmitContexts and
16470         then use that to apply attributes etc.
16472         (PopulateMethod, PopulateEvent, PopulateProperty)
16473         (PopulateIndexer): Apply attributes everywhere.
16475         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16476         etc.
16478         (ApplyAttributes): Update accordingly.
16480         We now apply interface attributes for all members too.
16482 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16484         * class.cs (Indexer.Define); Correctly check if we are explicit
16485         implementation (instead of checking the Name for a ".", we
16486         directly look up if the InterfaceType was specified).
16488         Delay the creation of the PropertyBuilder.
16490         Only create the PropertyBuilder if we are not an explicit
16491         interface implementation.   This means that explicit interface
16492         implementation members do not participate in regular function
16493         lookups, and hence fixes another major ambiguity problem in
16494         overload resolution (that was the visible effect).
16496         (DefineMethod): Return whether we are doing an interface
16497         implementation. 
16499         * typemanager.cs: Temporary hack until we get attributes in
16500         interfaces (Ravi is working on that) and we get IndexerName
16501         support in interfaces.
16503         * interface.cs: Register the indexers as properties.
16505         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16506         warning, I have verified that this is a bug in the .NET runtime
16507         (JavaScript suffers of the same problem).
16509         * typemanager.cs (MemberLookup): When looking up members for
16510         interfaces, the parent of an interface is the implicit
16511         System.Object (so we succeed in searches of Object methods in an
16512         interface method invocation.  Example:  IEnumerable x;  x.ToString
16513         ()) 
16515 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16517         * class.cs (Event): Events should also register if they do
16518         implement the methods that an interface requires.
16520         * typemanager.cs (MemberLookup); use the new GetInterfaces
16521         method. 
16523         (GetInterfaces): The code used to lookup interfaces for a type is
16524         used in more than one place, factor it here. 
16526         * driver.cs: Track the errors at the bottom of the file, we kept
16527         on going.
16529         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16530         instance if the method we are calling is static!
16532 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16534         * attribute.cs (ApplyAttributes): Make this function filter out
16535         the IndexerName attribute (as that attribute in reality is never
16536         applied) and return the string constant for the IndexerName
16537         attribute. 
16539         * class.cs (TypeContainer.Emit): Validate that all the indexers
16540         have the same IndexerName attribute, and if so, set the
16541         DefaultName attribute on the class. 
16543         * typemanager.cs: The return value might contain other stuff (not
16544         only methods).  For instance, consider a method with an "Item"
16545         property and an Item method.
16547         * class.cs: If there is a problem with the parameter types,
16548         return. 
16550 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16552         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16553         looks at user defined conversion after making a call to 
16554         StandardConversionExists - we need this for overload resolution.
16556         * expression.cs : Update accordingly the various method calls.
16558         This fixes 2 bugs filed against implicit user defined conversions 
16560 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16562         * statement.cs: Track the result of the assignment.
16564 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16566         * expression.cs (MemberAccess): Improved error reporting for
16567         inaccessible members.
16569 2002-05-22  Martin Baulig  <martin@gnome.org>
16571         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16572         itself with debugging support.
16574 2002-05-22  Martin Baulig  <martin@gnome.org>
16576         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16577         Removed, this isn't needed anymore.
16579 2002-05-20  Martin Baulig  <martin@gnome.org>
16581         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16582         be underlying type for an enum.
16584 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16586         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16587         that splits out the loading of just the core types.
16589         * rootcontext.cs (ResolveCore): Split the struct resolution in
16590         two, so we can load the enumeration underlying types before any
16591         enums are used.
16593         * expression.cs (Is): Bandaid until we fix properly Switch (see
16594         bug #24985 for details).
16596         * typemanager.cs (ImplementsInterface): The hashtable will contain
16597         a null if there are no interfaces implemented.
16599 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16601         * cs-parser.jay (indexer_declarator): It is fine to have array
16602         parameters
16604 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16606         * typemanager.cs: (RegisterBuilder): New function used to register
16607         TypeBuilders that implement interfaces.  Since
16608         TypeBuilder.GetInterfaces (as usual) does not work with lame
16609         Reflection.Emit. 
16610         (AddUserType): register interfaces.
16612         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16613         dealing with TypeBuilder.  Also, arrays are showing up as
16614         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16615         methods can not be invoked on them!
16617         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16618         (ImplicitReferenceConversionExists): Split out from
16619         StandardConversionExists. 
16621         * expression.cs (As): We were only implementing one of the three
16622         cases for the as operator.  We now implement them all.
16623         (Is): Implement the various other cases for Is as well.
16625         * typemanager.cs (CACHE): New define used to control if we want or
16626         not the FindMembers cache.  Seems to have a negative impact on
16627         performance currently
16629         (MemberLookup): Nested types have full acess to
16630         enclosing type members
16632         Remove code that coped with instance/static returns for events, we
16633         now catch this in RealFindMembers.
16635         (RealFindMembers): only perform static lookup if the instance
16636         lookup did not return a type or an event.  
16638 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16640         * assign.cs (CompoundAssign): We pass more semantic information
16641         now to Compound Assignments than we did before: now we have all
16642         the information at hand, and now we resolve the target *before* we
16643         do the expression expansion, which allows the "CacheValue" method
16644         to have the effect we intended (before, a [x] += 1 would generate
16645         two differen ArrayAccess expressions from the ElementAccess,
16646         during the resolution process).
16648         (CompoundAssign.DoResolve): Resolve target and original_source here.
16650 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16652         * expression.cs (ArrayAccess): dropped debugging information. 
16654         * typemanager.cs: Small bug fix: I was always returning i_members,
16655         instead of one of i_members or s_members (depending on which had
16656         the content).
16658         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16659         method is invoked before any code generation takes place, and it
16660         is a mechanism to inform that the expression will be invoked more
16661         than once, and that the method should use temporary values to
16662         avoid having side effects
16664         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16666         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16667         implementation.
16669         * expression.cs (Indirection, ArrayAccess): Add support for
16670         CacheTemporaries in these two bad boys. 
16672         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16673         ldobj or ldind_ref.  
16674         (StoreFromPtr): Handle stobj as well.
16676         * expression.cs (UnaryMutator): Share more code.
16678         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16679         down: I was not tracking the Filter function as well, which
16680         was affecting the results of the cache.
16682 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16684         * attribute.cs: Remove the hack to handle the CharSet property on
16685         StructLayouts. 
16687 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16689         * attribute.cs (DoResolve): More uglyness, we now only try to
16690         resolve the attribute partially, to extract the CharSet
16691         information (only if we are a StructLayout attribute).  Otherwise 
16693         (GetExtraTypeInfo): Add some code to conditionally kill in the
16694         future this.   I am more and more convinced that the .NET
16695         framework has special code to handle the attribute setting on
16696         certain elements.
16698         * expression.cs (IsParamsMethodApplicable): Revert my previous
16699         foreach change here, it was wrong.
16701 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16703         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16704         (pp_expr): do not abort on unknown input, just return.
16705         (eval): abort if there are pending chars.
16707         * attribute.cs (Attribute.Resolve): Positional parameters are
16708         optional.  Deal with that case.
16710         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16711         the Ansi/Unicode/Auto information for the type.
16713         (TypeContainer.DefineType): instantiate the EmitContext here, as
16714         we will be using it during the type definition (to resolve
16715         attributes) and during the emit phase.
16717         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16718         to pull type information out of the attributes
16720         (Attribute.Resolve): track the constructor builder, and allow for
16721         multiple invocations (structs and classes will use this).
16723         * ecore.cs (MemberLookupFinal): new version with all the
16724         parameters customizable.
16726         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16727         constructors.  Return if the result value is null (as the error
16728         would have been flagged already by MemberLookupFinal)
16730         Do not allow instances of abstract classes or interfaces to be
16731         created.
16733         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16734         We have to compare the assembly property here when dealing with
16735         FamANDAssem and Assembly access modifiers, because we might be
16736         creating an assembly from *modules* (that means that we are not
16737         getting TypeBuilders for types defined in other modules that are
16738         part of this assembly).
16740         (Method.Emit): If the method is marked abstract and has a body,
16741         emit an error. 
16743         (TypeContainer.DefineMembers): If both the defined member and the
16744         parent name match are methods, then do not emit any warnings: let
16745         the Method.Define routine take care of flagging warnings.  But if
16746         there is a mismatch (method overrides something else, or method is
16747         overriwritten by something, then emit warning).
16749         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16750         set to null, this means `do not check for the return type on the
16751         signature'. 
16753         (Method.Define): set the return type for the method signature to
16754         null, so that we get methods with the same name and parameters and
16755         different return types.  This is used to flag warning 114 (you are
16756         hiding a method, and you probably want to use the new/override
16757         keywords instead).
16759         * typemanager.cs (MemberLookup): Implemented proper access
16760         control, closing a long standing set of bug reports.  The problem
16761         was that the Framework only has two bits: Public and NonPublic,
16762         and NonPublic includes private and protected methods, but we need
16763         to enforce the FamANDAssem, FamOrAssem and Family. 
16765 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16767         * statement.cs (GotoCase): Return true: Ammounts to giving up
16768         knowledge on whether we return or not, and letting the other case
16769         be responsible for it.
16771 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16773         * driver.cs: Do not load directories for each file processed, only
16774         do it if there is a pattern.
16776         * ecore.cs: Report readonly assigns here as well, as we might have
16777         been resolved only by MemberAccess.
16779         (SimpleName.SimpleNameResolve): Also be useful for LValue
16780         resolution.   We need this to propagate assign to local readonly variables
16782         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16783         do not want to reuse potential criteria memory.
16785         * class.cs (MyEventBuilder): Set reflected_type;
16787         * ecore.cs (Constantify): Added support for constifying bools.
16789         (RootContext.LookupType): Added a cache for values looked up in
16790         the declaration space.
16792         * typemanager.cs (FindMembers): Now is a front-end to
16793         RealFindMembers, and provides a two-level hashtable-based cache to
16794         the request.  
16796         15% performance improvement: from 22.5 to 19.2 seconds.
16798         * expression.cs (IsParamsMethodApplicable): use foreach.
16799         (Invocation.DoResolve): ditto.
16800         (New.DoResolve): ditto.
16801         (ArrayCreation.DoResolve): ditto.
16803         * ecore.cs (FindMostEncompassingType): use foreach.
16805         * delegate.cs (NewDelegate.DoResolve): Use foreach
16807         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16808         (RemoveMethods): use foreach.
16810         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16811         nested foreach statements instead of for, and also break out of
16812         the inner loop once a match is found.
16814         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16816 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16818         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16819         we actually unwrap the expression to allow for extra information
16820         to be extracted. 
16822         * expression.cs: Use Shr_Un on unsigned operations. 
16824 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16826         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16827         applicable operators was not being considered correctly. This closes
16828         the bug Miguel reported.
16830 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16832         * attribute.cs: check that the type derives from System.Attribute
16833         and report the correct error in that case (moved the duplicate code to
16834         its own method, too).
16836 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16838         * attribute.cs: lookup attribute type name as the spec says: first the
16839         bare attribute name and then name + "Attribute" (nant compiles with
16840         mcs after this fix).
16842 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16844         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16845         Because of the way we parse things, we should try to see if a
16846         UIntConstant can fit in an integer.
16848 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16850         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16851         when we are in an explicit context.
16853         (ConvertReferenceExplicit): When converting from Iface type S to Class
16854         T make sure the rules are implemented as an OR.
16856         * parameter.cs (ParameterType): Make it a property for now although the
16857         purpose really isn't anything immediate.
16859         * expression.cs (Is*Applicable): Do better checking on the parameter type
16860         of a ref/out parameter. The ones from the system assemblies are already 
16861         marked with the correct type so we don't need to do any correction.
16863         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16864         the object type is standard too so include that.
16866 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16868         * ecore.cs (StandardConversionExists): Augment with missing code:
16869         deal with IntConstant, LongConstants and Enumerations.
16871         * assign.cs: Report the error, instead of failing silently
16873         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16874         typecontainer that they are declared, because the
16875         typecontainer/namespace will have the list of using clauses that
16876         need to be applied.
16878         Assembly Attributes were escaping the normal registration
16879         mechanism. 
16881         (EmitCode): Apply attributes within an EmitContext that represents
16882         the container they were declared on.
16884         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16886 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16888         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16889         Revamp completely - make much cleaner as we now operate only
16890         on a set of Types.
16892         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16893         to implement the logic detailed in the spec more correctly.
16895         (UserDefinedConversion): Update accordingly.
16897 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16899         * statement.cs: Return flow analysis information up.
16901         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16902         and the default.
16904         (token): Do not consume an extra character before calling
16905         decimal_digits.
16907 2002-05-06  Piers Haken <piersh@friskit.com>
16909         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16911 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16913         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16914         EmitContext during the instance constructor initializer
16915         resolution, to stop access to instance variables.
16917         This is mandated by the spec, last paragraph of the `constructor
16918         initializers' section. 
16920 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16922         * cs-parser.jay, class.cs (Accessor): new class used to represent
16923         an accessor (get or set).  In the past we used `null' to represent
16924         a missing accessor.  But this is ambiguous because there was no
16925         way to tell in abstract indexers/properties if one of them was
16926         specified.
16928         Now there is a way of addressing that.
16930         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16931         instead of FindMembers.
16933         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16934         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16936         * attribute.cs: Treat indexers and properties as the same in terms
16937         of applying attributes
16939         * ecore.cs (FindMostEncompassedType): Use statically initialized
16940         EmptyExpressions()s like we do elsewhere to avoid creating useless
16941         objects (and we take this out of the tight loop).
16943         (GetConversionOperators): Move the code to extract the actual
16944         operators to a separate routine to clean things up.
16946 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16948         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16949         events are always registered FieldBuilders.
16951         * class.cs (FieldBase): New class shared by Fields 
16953         * delegate.cs: If we are a toplevel delegate, use our full name.
16954         If we are a nested delegate, then only use our tail name.
16956 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16958         * expression.cs (IsApplicable): Ensure that we add the "&" to
16959         ref/out types before comparing it with the type of the argument.
16961         (IsParamsMethodApplicable): Ditto.
16963         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16964         silly me ;-)
16966         * delegate.cs : Handle the case when we have more than one applicable
16967         method. Flag an error only when we finish checking all.
16969 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16971         * expression.cs: Add support for boolean static initializers.
16973 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16975         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16977         * parameter.cs (ComputeParameterTypes,
16978         ComputeAndDefineParameterTypes): Better error handling: now we
16979         clear the `types' cache if we fail during any of the type lookups.
16980         We also return the status code correctly to our caller
16982         * delegate.cs: If we fail to define a delegate, abort the extra
16983         steps. 
16985         * expression.cs (Binary.ResolveOperator): for
16986         operator==(object,object) and operator !=(object, object) we also
16987         have to verify that there is an implicit conversion from one to
16988         the other.
16990         (ArrayAccess.DoResolve): Array Access can operate on
16991         non-variables. 
16993 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16995         * assign.cs (CompoundAssign): A new class used as a "flag" that
16996         the assignment actually is happening as part of a compound
16997         assignment operator.
16999         During compound assignment, a few new rules exist to enable things
17000         like:
17002         byte b |= 1 + 2
17004         From the spec:
17006         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17007         to the type of x) if y is implicitly convertible to the type of x,
17008         and the operator is a builtin operator and the return type of the
17009         operator is explicitly convertible to the type of x. 
17011         * rootcontext.cs: Reset warning level to 2.  4 catches various
17012         "interesting" features in mcs, we must clean this up at some
17013         point, but currently am trying to kill other bugs ;-)
17015         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17016         in container classes as well.  
17018         * expression.cs (Binary.ResolveOperator): Handle string case
17019         before anything else (as operator overloading does emit an error
17020         before doing anything else).
17022         This code could go away when we move to a table driven model, but
17023         i could not come up with a good plan last night.
17025 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17027         * typemanager.cs (CSharpName): reimplementation using regex.
17028         * class.cs: added null check for fields in Emit
17029         * rootcontext.cs: set warninglevel to 4
17031 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17033         * typemanager.cs (CSharpName): reimplemented with Lupus
17034         suggestion.
17036 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17038         * statement.cs (If): correclty implement Resolve, because we were
17039         not catching sem errors in there.  The same process is needed
17040         everywhere else. 
17041         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17044         (Statement.Warning_DeadCodeFound): Factorize code.
17045         (While): Report dead code here too.
17047         (Statement): Added Resolve virtual method to allow
17048         for resolution split from the emit code.
17050 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17052         * statement.cs (EmitBoolExpression): No longer try to resolve the
17053         expression here.    
17054         (MakeBoolean): New utility function that resolve, implicitly
17055         converts to boolean and tags the expression. 
17058         (If, Do): Implement dead code elimination.
17059         (While): Implement loop inversion
17061         (Do, While, For, If): Resolve the expression prior to calling our
17062         code generation.
17064 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17066         * class.cs:
17067           - added method Report28 (warning: program has more than one entry point)
17068           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17069           - modified method Method.Define, the part at the end of the method
17071         * rootcontext.cs: added static public Location EntryPointLocation;
17072           
17073         * ../errors/cs0028.cs : Add test case for the above warning.              
17075         * typemanager.cs:
17076           - modified method CSharpName to allow arrays of primitive type to
17077             be printed nicely (e.g. instead of System.Int32[][] it now prints
17078             int[][])
17079           - added method CSharpSignature: returns the signature of a method
17080             in string format to be used in reporting errors, warnings, etc.
17082         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17083         with String.Empty.
17085 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17087         * delegate.cs (Define): Fix extremely silly bug where I was
17088         setting the type of the 'object' parameter of the BeginInvoke
17089         method to System.IAsyncResult instead of System.Object ;-)
17091 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17093         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17094         here. 
17096         (Constructor.Emit): return if we fail to initialize the
17097         constructor.  Another door closed!  
17099         * expression.cs (New.DoResolve): Improve error message (from -6 to
17100         1501).  Use DeclaredOnly lookup to find the exact constructor.
17102         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17103         loop.  This is useful.
17105         * cs-parser.jay: Adjust the default parameters so that destructors
17106         have the proper signature.
17108 2002-04-26  Martin Baulig  <martin@gnome.org>
17110         * driver.cs (LoadAssembly): If `assembly' contains any characters
17111         which are only valid in path names and not in assembly names
17112         (currently slash, backslash and point), use Assembly.LoadFrom ()
17113         instead of Assembly.Load () on the `assembly' (before iteration
17114         over the link_paths).
17116 2002-04-26  Martin Baulig  <martin@gnome.org>
17118         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17120 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17122         * class.cs (Property): use the new typemanager.MemberLookup
17124         (TypeContainer.MemberLookup): Implement using the
17125         TypeManager.MemberLookup now. 
17127         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17128         and return MemberInfos, so that these can be used without an
17129         EmitContext (what we had before).
17131 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17133         * expression.cs: Fix the case where the argument to params if the
17134         type of the params.  I omitted handling this before.   Fixed
17136 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17138         * driver.cs: Call BootCorlib_PopulateCoreType
17140         * class.cs (Property.CheckBase): Check for properties only, not
17141         for all members. 
17143         * interface.cs: Temporary hack: try/catch around the
17144         CustomAttributeBuilder, because I am getting an exception that I
17145         do not understand.
17147         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17148         types whose definitions are required to be there (attributes are
17149         defined before standard types).
17151         Compute definitions as we boot the various types, as they are used
17152         immediately (value_type class will need object_type, but if we do
17153         not initialize object_type, we will pass a null, which will let
17154         the runtime pick the System.Object from the existing corlib, which
17155         is not what we want).
17157 2002-04-22  Patrik Torstensson <totte@labs2.com>
17159         * cs-tokenizer.cs: fixed a number of trim() issues.
17161 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17163         * expression.cs (Argument.Type): Ensure that we return the correct
17164         type when we have out or ref parameters [in which case we 
17165         append a "&"].
17167 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17169         * class.cs (Property, Indexer): Allow extern modifier in there. 
17171         * typemanager.cs (InitBaseTypes): Initializes object_type and
17172         value_type, since those will be used early on during the bootstrap
17173         process to compile corlib.
17175         (InitCoreTypes): Move code from here to InitBaseTypes.
17177 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17179         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17180         single-dimension arrays as using the ldlen opcode.  
17182         Daniel Lewis discovered this optimization.  
17184         * typemanager.cs: Add signature for System.Array::get_Length
17186 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17188         * statement.cs: report the error when the foreach does not apply to an
17189         array nor a collection.
17191 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17193         * expression.cs: Add implicit conversions to the operator ~.
17195         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17197         * typemanager.cs: Locate the decimal constructor.
17199 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17201         * attribute.cs: use the new property of TypeOf.
17202         * expression.cs: added 'get' property around typearg.
17204         These changes fix a build breaker reported by NickD. Is this the
17205         correct way to fix?  If not, please, revert my changes and make it
17206         work :-).
17208 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17210         * attribute.cs: Add support for typeof in attribute invocations.
17211         I am not sure that this is right though.
17213 2002-04-14  Duncan Mak  <duncan@ximian.com>
17215         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17216         Binary.Operator.Division case.
17218 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17220         * class.cs (DefineType): Ensure that we do a proper check on
17221         attribute types and also register it with the TypeManager.
17223         (TypeContainer.Targets): The default for attribute types is
17224         AttributeTargets.All.
17226         * attribute.cs (ApplyAttributes): Registering the attribute type
17227         is done elsewhere, not when we discover we have a Usage attribute.
17229 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17231         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17232         and get rid of is_delegate parameter.
17234         * everywhere : update.
17236 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17238         * cs-parser.jay (compilation_unit): Revamp completely to use
17239         some new ideas that I got from Rhys' grammar to solve the problems
17240         with assembly level attributes.
17242         (outer_declaration): New grammar production.
17244         (attribute_sections): Add.
17246         (opt_attributes): Base on attribute_sections
17248         (namespace_declaration): Allow opt_attributes to tackle the case
17249         when we have assembly level attributes - we are clever in this
17250         regard now ;-)
17252         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17253         attributes in the non-global context.
17255         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17256         instead of SetGlobalAttributes.
17258         * class.cs, rootcontext.cs : Ensure we define and generate 
17259         attribute types before anything else.
17261         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17262         and flag the new error -20 for the case when the attribute type
17263         does not have valid targets specified. csc does not catch this.
17265         * ../errors/errors.txt : update for error # -20
17267 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17269         * support.cs (InternalParameters.ParameterModifier): Do some null
17270         checking and return sane values.
17272         * class.cs (Method.Define): If we are a PInvoke method, ensure
17273         that we are static and extern. Report error # 601
17275         * ../errors/cs0601.cs : Add test case for the above error.
17277 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17279         * rootcontext.cs (attribute_types): We need to keep type of
17280         all attribute types separately and emit code for them first.
17282         (RegisterAttribute) : Implement.
17284         * class.cs (DefineType): Check if the current Type is a custom
17285         attribute type and register it accordingly.
17287         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17288         adding the first attribute twice and rename to
17290         (SetGlobalAttributes): this.
17292         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17293         lookups.
17295         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17296         if we are processing global arguments. Hmm, I am unsure of this.
17298 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17300         * expression.cs: added static array of strings to avoid calling
17301         Enum.ToString () for Operator in Binary. Significant recover of
17302         performance.
17304 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17306         * class.cs (FindMembers): Allow the Builders of the various
17307         members to be null.  If they are skip them.  This only happens
17308         during the PInvoke declaration.
17310 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17312         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17313         failure, so we do not keep going afterwards.
17315         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17316         wanted to pass `false' as the `is_delegate' argument.  If this is
17317         the case, why not use delegate_type == null to mean `is_delegate =
17318         false' and anything else as is_delegate = true.
17320 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17322         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17323         code for the section, not the beginning of the tests.
17325 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17327         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17329         * expression.cs (Binary): same.  Warn about errors where we have
17330         Enum/Enum in operator + as well.
17332 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17334         * statement.cs:
17335                 - added support for switch(bool)
17336                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17337                 - add TableSwitchEmit() to handle table-based switch statements
17339 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17341         * expression.cs (Invocation.OverloadResolve): Factor out code which
17342         does parameter compatibility checking with arguments so that we can 
17343         re-use the code even from Delegate.VerifyApplicability
17345         (VerifyArgumentsCompat): Move above code here.
17347         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17348         and instead make a call to the above method.
17350 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17352         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17353         We use it to keep track of classes which are attribute types.
17355 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17357         * delegate.cs (Delegate.Define): Correctly define the types in the
17358         presence of fixed and array parameters.
17360         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17361         doing FindMembers.
17363         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17364         include NonPublic after the first iteration.
17366         * class.cs (Indexer.CheckBase): Only check if both parents are
17367         non-null. 
17369         * cs-parser.jay (accessor_body): If empty, set to null.
17371         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17372         same code path here to resolve constants names that we did have in
17373         MemberAccess.DoResolve.  There is too much code duplicated here.
17375 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17377         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17379         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17380         to MakeUnionSet.
17382         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17383         tokens, numbers and strings.
17385         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17386         parenthesis.
17388         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17389         asyncronous parameters and the regular parameters.  
17391         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17392         specify the target directory.
17394         * expression.cs: (This.DoResolve): Simplify
17395         (As.Emit): Optimize, do not generate IsInst if the expression is
17396         always of the given type.
17398         (Is.DoResolve): Bug fix, we were reporting both always/never for
17399         the is expression.
17401         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17402         creating too many unnecessary arrays.
17404 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17406         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17407         fields instead of rolling our own initializer.   Takes care of all
17408         implicit conversions, and drops unnecessary static checks/argument.
17410 2002-03-31  Dick Porter  <dick@ximian.com>
17412         * driver.cs: use the GetDirectories() return values properly, and
17413         use "/" as path separator.
17415 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17417         * expression.cs (Unary): Optimize - - expr into expr.
17418         (Binary): Optimize a + (-b) into a -b.
17420         * codegen.cs (CodeGen): Made all methods static.
17422 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17424         * rootcontext.cs: 
17426         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17427         TypeBuilder property.
17429         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17430         instead. 
17432         * tree.cs: Removed the various RecordXXXX, and replaced with a
17433         single RecordDecl.  Removed all the accessor methods, and just
17434         left a single access point Type 
17436         * enum.cs: Rename DefineEnum to DefineType.
17438         * decl.cs: New abstract method `DefineType' used to unify the
17439         Defines for Enumerations, Interfaces, TypeContainers and
17440         Delegates.
17442         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17443         LookupBaseClasses method that used to live in class.cs and
17444         interface.cs here, and renamed to FindType.
17446         * delegate.cs: Implement DefineType.  Take advantage of the
17447         refactored pattern for locating the parent builder without taking
17448         the parent_builder argument (which we know does not work if we are
17449         nested, and triggering a toplevel definition).
17451 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17453         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17454         accessibility of a member has changed during override and report
17455         an error if so.
17457         * class.cs (Method.Define, Property.Define): Only complain on
17458         overrides if the method is private, any other accessibility is
17459         fine (and since we just checked the permission is the same, we are
17460         good to go).
17462         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17463         and elif are processed always.  The other pre-processing
17464         directives are only processed if we are "taking" the path
17466 2002-03-29  Martin Baulig  <martin@gnome.org>
17468         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17469         current location is not Null.
17471         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17472         a separate method so we can profile it.
17474         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17475         `span.Seconds' are just seconds, but no minutes or hours.
17476         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17478 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17480         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17481         Remove the gratuitous set of Final:
17483                                 // If an interface implementation, then we can set Final.
17484                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17485                                     implementing.DeclaringType.IsInterface)
17486                                         flags |= MethodAttributes.Final;
17488         I do not know what I was smoking when I used that.
17491         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17492         step into fixing the name resolution issues for delegates and
17493         unifying the toplevel name resolution.
17495 2002-03-28  Martin Baulig  <martin@gnome.org>
17497         * class.cs (Method.Emit): If we have a symbol writer, call its
17498         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17499         tell it about the current method.
17501         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17502         writer that we're going to emit the first byte of IL code for a new
17503         statement (a new source line).
17504         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17505         EmitContext.Mark() before emitting any code.
17507         * location.cs (SymbolDocument): Return null when we're Null.
17509         * statement.cs (Statement): Moved the `Location loc' variable here.
17510         (Statement.EmitBoolExpression): If we have a symbol writer, call
17511         ec.Mark() before emitting any code to tell it that we're at the
17512         beginning of a new statement.
17513         (StatementExpression): Added `Location' argument to the constructor.
17514         (Block): Added public readonly variable `StartLocation' and public
17515         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17516         (Block): Added constructor which takes a start and end location.
17517         (Block.SetEndLocation): New method. This sets the end location.
17518         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17519         local variables we create.
17520         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17521         each statement and do also mark the begin and end of the block.
17523         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17524         tell it the current lexer.Location, use Location.Null for the end of the
17525         block.
17526         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17527         current block, set its end location using SetEndLocation().
17528         (statement_expression): StatementExpression constructor now takes the
17529         lexer.Location as additional argument.
17530         (for_statement, declare_local_variables): Likewise.
17531         (declare_local_variables): When creating a new implicit block, use the
17532         new Block constructor and pass it the lexer.Location.
17534 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17536         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17537         members also on the parent interfaces recursively.
17539 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17541         * report.cs: Use new formats, since Gonzalo finished the missing
17542         bits. 
17544         * expression.cs (Binary.ResolveOperator): added missing operator|
17545         operator& and operator^ for bool/bool.
17547         * cs-parser.jay: CheckDef now takes a Location argument that is
17548         used to report errors more precisly (instead of reporting the end
17549         of a definition, we try to track something which is a lot closer
17550         to the source of the problem).
17552         * cs-tokenizer.cs: Track global token use, so we can properly flag
17553         the use of #define/#undef after the first token has been seen.
17555         Also, rename the reportXXXX to Error_DescriptiveName
17557         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17558         TypeContainer, so that Enum and Interface can use this too.
17560         * class.cs (TypeContainer.LookupInterfaceOrClass,
17561         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17562         `builder' argument.  Typically this was used to pass the parent
17563         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17564         the definition).  
17566         The problem is that a nested class could trigger the definition of
17567         a toplevel class, and the builder would be obviously wrong in that
17568         case. 
17570         So we drop this argument, and we compute dynamically the
17571         TypeBuilder/ModuleBuilder (the correct information was available
17572         to us anyways from DeclSpace.Parent)
17574         * interface.cs (Interface.DefineInterface): Drop builder
17575         parameter cleanup like class.cs
17577         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17578         like class.cs
17580         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17581         values. 
17583         (Try.Emit): Propagate the returns value from the statement.
17585         (Return.Emit): Even if we are leavning 
17587         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17589         * modifiers.cs: Fix the computation of MethodAttributes flags.
17591 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17593         * driver.cs: allow compilation of files that start with '/'.
17594         Add a default case when checking the argument of --target.
17596 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17598         * interface.cs: Implement the same search algorithm for types in
17599         the interface code.
17601         * delegate.cs: Do not allow multiple definition.
17603         * Recovered ChangeLog that got accidentally amputated
17605         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17607         * rootcontext.cs: Load manually enum to allow core classes to
17608         contain enumerations.
17610         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17611         Update to new static methods in TypeManager.
17613         * typemanager.cs (GetMethod, GetConstructor): Use our
17614         implementation of FindMembers to find the members, since during
17615         corlib compilation, the types are TypeBuilders and GetMethod and
17616         GetConstructor do not work.
17618         Make all methods in TypeManager static.
17620         (InitCodeHelpers): Split the functionality from
17621         the InitCodeTypes function.
17623         * driver.cs: Call InitCodeHelpers after we have populated the
17624         types. 
17626         * cs-parser.jay (delegate_declaration): we did not used to compute
17627         the delegate name correctly for void delegates.
17629 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17631         * rootcontext.cs (RootContext): Init the interface_resolve_order
17632         and type_container_resolve_order always.
17634         (ResolveCore, BootstrapCorlib_ResolveClass,
17635         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17636         compiler when compiling with --nostdlib
17638         * class.cs (TypeContainer.DefineType): Check that our parent is
17639         not null.  This test is most important when we are bootstraping
17640         the core types.
17642         * codegen.cs: Split out the symbol writing code.
17644 2002-03-25  Martin Baulig  <martin@gnome.org>
17646         * driver.cs (-g): Made -g an alias for --debug.
17648 2002-03-24  Martin Baulig  <martin@gnome.org>
17650         * codegen.cs (SymbolWriter): New public variable. Returns the
17651         current symbol writer.
17652         (CodeGen): Added `bool want_debugging_support' argument to the
17653          constructor. If true, tell the ModuleBuild that we want debugging
17654         support and ask it for the ISymbolWriter.
17655         (Save): If we have a symbol writer, call it's Close() method after
17656         saving the assembly.
17658         * driver.c (--debug): New command line argument to create a
17659         debugger information file.
17661         * location.cs (SymbolDocument): New public property. Returns an
17662         ISymbolDocumentWriter object for the current source file or null
17663         if we don't have a symbol writer.
17665 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17667         * driver.cs (LoadAssembly): Correctly return when all the paths
17668         have been tried and not before.
17670         * statement.cs (Switch.Emit): return the actual coverage for this
17671         statement (returns/not-returns)
17673         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17674         switch of the statement if we are the last switch section.  That
17675         kills two problems: try/catch problems (we used to emit an empty
17676         nop at the end) and switch statements where all branches would
17677         return. 
17679 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17681         * driver.cs: Add default assemblies (the equivalent to the
17682         Microsoft CSC.RSP file)
17684         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17685         also update tokens_seen and set it to false.
17687         * driver.cs: Implement --recurse for Mike.
17689         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17690         correctly splitting out the paths.
17692 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17694         * interface.cs (Interface.PopulateProperty): Instead of using
17695         `parent' as the declaration space for the set parameters, use
17696         `this' 
17698         * support.cs (InternalParameters): InternalParameters constructor
17699         takes a DeclSpace instead of a TypeContainer.
17701         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17702         types are being initialized, load the address of it before calling
17703         the function.  
17705         (New): Provide a mechanism to disable the generation of local
17706         value type temporaries when the caller will be providing us with
17707         an address to store it.
17709         (ArrayCreation.EmitDynamicInitializers): Use it.
17711 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17713         * expression.cs (Invocation.EmitArguments): Only probe for array
17714         property if there is more than one argument.  Sorry about that.
17716         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17717         empty param arrays.
17719         * class.cs (Method.LabelParameters): Fix incorrect code path that
17720         prevented the `ParamArrayAttribute' from being applied to the
17721         params attribute.
17723 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17725         * support.cs (ReflectionParameters): Correctly compute whether the
17726         last argument is a params array.  Fixes the problem with
17727         string.Split ('a')
17729         * typemanager.cs: Make the assemblies array always be non-null
17730         (empty, but non-null)
17732         * tree.cs (RecordDecl): New function that abstracts the recording
17733         of names.  This reports error 101, and provides a pointer to the
17734         previous declaration.  Fixes a crash in the compiler.
17736         * cs-parser.jay (constructor_declaration): Update to new grammar,
17737         and provide a constructor_body that can be empty.
17739 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17741         * driver.cs: Add support for --resources.
17743         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17744         Make all types for the various array helper methods be integer.
17746         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17747         CheckState to ConvCast.
17749         (ConvCast): Now it takes a `checked' state argument, to avoid
17750         depending on the emit context for the conversion, and just using
17751         the resolve time setting.
17753         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17754         instead of Invocation.EmitArguments.  We do not emit the original
17755         arguments, instead we emit those which have been converted to
17756         unsigned int expressions.
17758         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17760         * codegen.cs: ditto.
17762         * expression.cs (LocalVariableReference): Drop the use of the
17763         Store function that depended on the variable index.
17765         * statement.cs (VariableInfo): Drop the `Idx' property from this
17766         class, as this is not taking into account the indexes for
17767         temporaries tat we generate during the execution, getting the
17768         indexes wrong.
17770         * class.cs: First emit class initializers, then call the parent
17771         constructor. 
17773         * expression.cs (Binary): Fix opcode emision.
17774         (UnaryMutator.EmitCode): Support checked code generation
17776         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17777         matches for events for both the Static and Instance scans,
17778         pointing to the same element.   Fix that.
17780 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17782         * rootcontext.cs (ResolveTree): Always set the
17783         interface_resolve_order, because nested interfaces will be calling
17784         into us.
17786         * class.cs (GetInterfaceOrClass): Track the same resolution
17787         process used by TypeManager.LookupType.  This fixes the nested
17788         type lookups in class declarations (separate path from
17789         LookupType). 
17791         (TypeContainer.DefineType): Also define nested interfaces.
17792         (TypeContainer.RegisterOrder): New public function used to
17793         register the order in which child interfaces need to be closed.
17795         Nested interfaces need to be closed after their parents have been
17796         created. 
17798         * interface.cs (InterfaceAttr): Put all the logic for computing
17799         the interface attribute here. 
17801         (DefineInterface): Register our interface order with the
17802         RootContext or with the TypeContainer depending on the case.
17804 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17806         * cs-parser.jay: rework foreach statement to work with the new
17807         changes to the policy on SimpleNames.
17809         * report.cs: support Stacktrace on warnings as well.
17811         * makefile: drop --unsafe and /unsafe from the compile.
17813 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17815         * ecore.cs (StandardConversionExists): Modify to take an Expression
17816         as the first parameter. Ensure we do null -> reference type conversion
17817         checking.
17819         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17820         temporary Expression objects.
17822 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17824         * interface.cs: workaround bug in method overloading resolution
17825         (there is already a bugzilla bug for it).
17827 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17829         We could also solve this problem by having a separate path for
17830         performing type lookups, instead of DoResolve, we could have a
17831         ResolveType entry point, and only participating pieces of the
17832         production (simplename, deref, array) would implement this. 
17834         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17835         signal SimpleName to only resolve type names and not attempt to
17836         resolve anything else.
17838         * expression.cs (Cast): Set the flag.
17840         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17842         * class.cs: Only report 108 if there is no `new' modifier.
17844         * cs-parser.jay: rework foreach statement to work with the new
17845         changes to the policy on SimpleNames.
17847         * report.cs: support Stacktrace on warnings as well.
17849         * makefile: drop --unsafe and /unsafe from the compile.
17851 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17853         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17854         lookups here, instead of doing that at parse time.  This means
17855         that our grammar will not introduce `LocalVariableReferences' as
17856         expressions at this point.  That solves the problem of code like
17857         this:
17859         class X {
17860            static void Main ()
17861            { int X = 1;
17862             { X x = null }}}
17864         This is only half the fix.  The full fix requires parameters to
17865         also be handled in this way.
17867         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17868         makes the use more obvious of the DeclSpace.  The
17869         ec.TypeContainer.TypeBuilder is now only used to pull the
17870         TypeBuilder for it.
17872         My theory is that I can get rid of the TypeBuilder completely from
17873         the EmitContext, and have typecasts where it is used (from
17874         DeclSpace to where it matters).  
17876         The only pending problem is that the code that implements Aliases
17877         is on TypeContainer, and probably should go in DeclSpace.
17879         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17880         lookups here, instead of doing that at parse time.  This means
17881         that our grammar will not introduce `LocalVariableReferences' as
17882         expressions at this point.  That solves the problem of code like
17883         this:
17885         class X {
17886            static void Main ()
17887            { int X = 1;
17888             { X x = null }}}
17890         This is only half the fix.  The full fix requires parameters to
17891         also be handled in this way.
17893         * class.cs (Property.DefineMethod): When implementing an interface
17894         method, set newslot, when implementing an abstract method, do not
17895         set the flag (before we tried never setting it, or always setting
17896         it, which is the difference).
17897         (Indexer.DefineMethod): same.
17898         (Method.DefineMethod): same.
17900         * ecore.cs: Only set the status used flag if we get back a Field.
17902         * attribute.cs: Temporary hack, so Paolo can keep working.
17904 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17906         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17907         the unmanaged type in the case we have a MarshalAs attribute.
17909         (Resolve): Handle the case when we are parsing the special MarshalAs
17910         attribute [we need to store the unmanaged type to use later]
17912         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17913         MarshalAs Attribute.
17915         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17916         on parameters and accordingly set the marshalling info.
17918 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17920         * class.cs: Optimizing slightly by removing redundant code after
17921         we switched to the `NoTypes' return value.
17922         (Property.DefineMethod): use NoTypes here too.
17924         This fixes the bug I introduced in my last batch of changes.
17926 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17928         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17930         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17931         Enums since those are types too. 
17933         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17935         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17936         thanks to a call during the lookup process.
17938 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17940         * statement.cs (Foreach): Lots of work to accomodate a particular
17941         kind of foreach statement that I had not kept in mind.  It is
17942         possible to have foreachs on classes that provide a GetEnumerator
17943         method that return objects that implement the "pattern" for using
17944         a foreach, there is no need to support GetEnumerator
17945         specifically. 
17947         This is needed to compile nant.
17949         * decl.cs: Only report 114 if the member is not `Finalize' and if
17950         the warning level is at least 2.
17952         * class.cs: Moved the compare function from Method to
17953         MethodSignature. 
17955         (MethodSignature.InheritableMemberSignatureCompare): Add new
17956         filter function that is used to extract inheritable methods from a
17957         class. 
17959         (Method.Define): Use the new `inheritable_method_signature_filter'
17960         delegate
17962         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17963         command. 
17965 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17967         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17969         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17971         * expression.cs: Pass location information to
17972         ConvertImplicitStandard. 
17974         * class.cs: Added debugging code to track return values from
17975         interfaces. 
17977 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17979         * expression.cs (Is.DoResolve): If either side of the `is' is an
17980         interface, do not flag the warning.
17982         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17983         for interfaces
17985         * report.cs: Allow for --fatal to be used with --probe.
17987         * typemanager.cs (NoTypes): Move the definition for the empty Type
17988         array here. 
17990         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17991         properties. 
17992         (TypeContainer.DefineProxy): New function used to proxy to parent
17993         implementations when implementing interfaces.
17994         (TypeContainer.ParentImplements): used to lookup if our parent
17995         implements a public function that is required by an interface.
17996         (TypeContainer.VerifyPendingMethods): Hook this up.
17998         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17999         `modules' and `assemblies' arraylists into arrays.  We only grow
18000         these are the very early start up of the program, so this improves
18001         the speedof LookupType (nicely measured).
18003         * expression.cs (MakeByteBlob): Replaced unsafe code with
18004         BitConverter, as suggested by Paolo.
18006         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18007         folding of string concatenation, but if either side is a string,
18008         and the other is not, then return null, and let the runtime use
18009         the concatenation on the string plus the object (using
18010         `Object.ToString'). 
18012 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18014         Constant Folding has been implemented now.
18016         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18017         the error instead on types that are not supported in one's
18018         complement. 
18020         * constant.cs (Constant and all children): New set of functions to
18021         perform implict and explicit conversions.
18023         * ecore.cs (EnumConstant): Implement the new functions to perform
18024         conversion by proxying to the child expression.
18026         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18027         own separate setting that can not be turned off from the command
18028         line using --unchecked or --checked and is only controlled using
18029         the checked/unchecked statements and expressions.  This setting is
18030         used by the constant folder to flag errors.
18032         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18033         ConstantCheckState as well.   
18035         During Resolve, they also have to flag the state, because the
18036         constant folder runs completely in the Resolve phase.
18038         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18039         well.
18041 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18043         * cfold.cs: New file, this file contains the constant folder.
18045         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18046         argument to track whether we are using the resulting address to
18047         load or store a value and provide better error messages. 
18049         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18050         new AddressOf arguments.
18052         * statement.cs (Foreach.EmitCollectionForeach): Update
18054         * expression.cs (Argument.Emit): Call AddressOf with proper
18055         arguments to track usage.
18057         (New.DoEmit): Call AddressOf with new arguments.
18059         (Unary.Emit): Adjust AddressOf call.
18061 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18063         * cs-parser.jay (member_access): Change the case for pre-defined types
18064         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18065         this suggestion.
18067         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18068         a method body.
18070         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18071         essentially like methods and apply attributes like MethodImplOptions to them too.
18073         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18074         not being null.
18076         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18077         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18078         is the DeclSpace.
18080         * Update code everywhere accordingly.
18082         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18084         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18086 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18088         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18089         try performing lookups against those instead of jumping straight into using
18090         the 'using' clauses.
18092         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18094         (LookupType): Perform lookups in implicit parents too.
18096         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18097         sequence as RootContext.LookupType. 
18099         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18100         the various cases of namespace lookups into this method.
18102 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18104         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18105         in positional arguments)
18107         * class.cs (Operator): Update the AllowedModifiers to contain
18108         extern. 
18110         * cs-parser.jay: Update operator declaration to allow for the
18111         operator body to be empty.
18113         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18114         values. 
18116 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18118         * class.cs (Method.Emit): Label parameters.
18120         * driver.cs: Return 1 or 0 as the program exit code.
18122 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18124         * expression.cs: Special case the `null' object when trying to
18125         auto-compute the type, as anything can be explicitly converted to
18126         that. 
18128         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18129         spotting this Paolo.
18131         (Expression.ImplicitNumericConversion): Perform comparissions of
18132         the type using the underlying type in the case of an enumeration
18133         rather than using the enumeration type for the compare.
18135         Cope with the underlying == type case, which is not possible to
18136         catch before. 
18138         (Expression.ConvertNumericExplicit): Perform comparissions of
18139         the type using the underlying type in the case of an enumeration
18140         rather than using the enumeration type for the compare.
18142         * driver.cs: If the user does not supply an extension, assume .exe
18144         * cs-parser.jay (if_statement): Rewrote so that we can track the
18145         location for the if statement.
18147         * expression.cs (Binary.ConstantFold): Only concat strings when
18148         the operation is "+", not everything ;-)
18150         * statement.cs (Statement.EmitBoolExpression): Take a location
18151         argument. 
18152         (If, While, Do): Track location.
18154         * expression.cs (Binary.ResolveOperator): In the object + string
18155         case, I was missing a call to ConvertImplicit
18157 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18159         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18160         Location arguments. Ensure we use RootContext.LookupType to do our work
18161         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18163         * interface.cs (PopulateMethod): Handle the type of the parameter being
18164         null gracefully.
18166         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18167         have a params method with no fixed arguments and a call is made with no
18168         arguments.
18170 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18172         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18173         the verbatim-string-literal
18175         * support.cs (InternalParameters.ParameterModifier): handle null
18176         fixed parameters.
18177         (InternalParameters.ParameterType): ditto.
18179         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18180         duplicating the name of the variable parameter.
18181         (GetParameterByName): Fix bug where we were not looking up array
18182         paramters if they were the only present (thanks Paolo!).
18183         (GetParameterInfo): We only have an empty set of types if both
18184         fixed and array are set to null.
18185         (GetParameterInfo-idx): Handle FixedParameter == null
18187         * cs-parser.jay: Handle the case where there is no catch
18188         statements (missing null test).
18190 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18192         * driver.cs (MainDriver): Be conservative on our command line
18193         handling.
18195         Catch DirectoryNotFoundException when calling GetFiles.
18197         (SplitPathAndPattern): Used to split the input specification into
18198         a path and a pattern that we can feed to Directory.GetFiles.
18200 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18202         * statement.cs (Fixed): Implement the last case of the Fixed
18203         statement (string handling).
18205         * expression.cs (StringPtr): New class used to return a char * to
18206         a string;  Used by the Fixed statement.
18208         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18210         * expression.cs (Binary.ResolveOperator): Remove redundant
18211         MemberLookup pn parent type.
18212         Optimize union call, we do not need a union if the types are the same.
18213         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18214         type.
18216         Specialize the use of MemberLookup everywhere, instead of using
18217         the default settings. 
18219         (StackAlloc): Implement stackalloc keyword.
18221         * cs-parser.jay: Add rule to parse stackalloc.
18223         * driver.cs: Handle /h, /help, /?
18225         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18226         before we supported unsafe code.
18228         * makefile: add --unsafe to the self compilation of mcs.
18230 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18232         * expression.cs (PointerArithmetic): New class that is used to
18233         perform pointer arithmetic.
18234         (Binary.Resolve): Handle pointer arithmetic
18235         Handle pointer comparission.
18236         (ArrayPtr): Utility expression class that is used to take the
18237         address of an array.
18239         (ElementAccess): Implement array access for pointers
18241         * statement.cs (Fixed): Implement fixed statement for arrays, we
18242         are missing one more case before we are done.
18244         * expression.cs (Indirection): Implement EmitAssign and set the
18245         ExprClass to Variable.  This allows pointer dereferences to be
18246         treated as variables, and to have values assigned to them.
18248         * ecore.cs (Expression.StoreFromPtr): New utility function to
18249         store values dereferencing.
18251 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18253         * expression.cs (Binary.ResolveOperator): Ensure that we are
18254         not trying to operate on a void type - this fixes the reported
18255         bug.
18257         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18258         the parent implementation is sealed.
18260         * ../errors/cs0239.cs : Add.
18262         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18264         * typemanager.cs (unverifiable_code_type): Corresponds to 
18265         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18266         which have unsafe code in them.
18268         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18269         unsafe context.
18271 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18273         * cs-tokenizer.cs: Add support for @"litreal strings"
18275         Make tokenizer accept pre-processor directives
18276         on any column (remove the old C-like limitation). 
18278         * rootcontext.cs (EmitCode): Emit any global attributes.
18279         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18281         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18283         * cs-parser.jay: Add support for global attributes.  
18285 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18287         * expression.cs (Indirection): New helper class.  Unary will
18288         create Indirection classes to be able to implement the
18289         IMemoryLocation interface on it.
18291 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18293         * cs-parser.jay (fixed_statement): reference the right statement.
18295         * statement.cs (Fixed.Emit): Finish implementing the fixed
18296         statement for the &x case.
18298 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18300         * class.cs (Property.Define, Method.Define): Remove newslot when
18301         `implementing'.  
18303         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18304         wrong.  NewSlot should only be used if the `new' keyword is present.
18306         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18307         locating our system dir.  Sorry about this.
18309 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18311         * driver.cs (GetSystemDir): Compute correctly the location of our
18312         system assemblies.  I was using the compiler directory instead of
18313         the library directory.
18315 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18317         * expression.cs (BetterFunction): Put back in what Miguel commented out
18318         since it is the correct fix. The problem is elsewhere ;-)
18320         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18321         parameters of the parms method are themselves compatible or not !
18323         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18324         to check that a class implements an interface before saying that an implicit
18325         conversion was allowed. Use ImplementsInterface to do the checking.
18327 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18329         * class.cs (Method.Define): Track whether we are an explicit
18330         implementation or not.  And only call DefineMethodOverride if we
18331         are an explicit implementation.
18333         (Property.DefineMethod): Ditto.
18335 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18337         * expression.cs (BetterFunction): Catch hideous bug which was
18338          preventing us from detecting ambiguous calls due to implicit casts i.e
18339         cs0121.
18341 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18343         * support.cs (Pair): Remove un-needed method.  I figured why I was
18344         getting the error in cs-parser.jay, the variable in a foreach loop
18345         is readonly, and the compiler does not really treat this as a variable.
18347         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18348         instead of EQUALS in grammar.  
18350         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18352         * expression.cs (Unary.DoResolve): Check whether the argument is
18353         managed or not.
18355 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18357         * support.cs: Api for Pair to set a value.  Despite the fact that
18358         the variables are public the MS C# compiler refuses to compile
18359         code that accesses the field if the variable is part of a foreach
18360         statement. 
18362         * statement.cs (Fixed): Begin implementation of the fixed
18363         statement.
18365         (Block.AddVariable): Return the VariableInfo on success and null
18366         on failure instead of true/false. 
18368         * cs-parser.jay (foreach): Catch errors on variables already
18369         defined (we were ignoring this value before) and properly unwind
18370         the block hierarchy
18372         (fixed_statement): grammar for the fixed statement.
18374 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18376         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18377         pointer types to be incretemented.
18379         (SizeOf): Implement.
18381         * cs-parser.jay (pointer_member_access): Implement
18382         expr->IDENTIFIER production.
18384         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18385         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18386         on safe contexts.
18388         (Unary): Implement indirection.
18390         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18391         use in non-unsafe context).
18393         (SimpleName.DoResolve): Check for pointers in field access on safe
18394         contexts. 
18396         (Expression.LoadFromPtr): Factor the load-indirect code in this
18397         function.  This was duplicated in UnboxCast and ParameterReference
18399 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18401         * expression.cs (ComposedCast): report an error if a pointer cast
18402         is used in a safe region.
18404         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18405         pointer type casts in unsafe context.
18407         * codegen.cs (EmitContext): Set up IsUnsafe.
18409         * cs-parser.jay (non_expression_type): Add productions for pointer
18410         casts. 
18412         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18413         code.  We should not use force into static mode if the method is
18414         not virtual.  Fixes bug in MIS
18416         * statement.cs (Do.Emit, While.Emit, For.Emit,
18417         Statement.EmitBoolExpression): Add support to Do and While to
18418         propagate infinite loop as `I do return' semantics.
18420         Improve the For case to also test for boolean constants.
18422         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18423         to the list of attributes we can add.
18425         Remove `EmitContext' argument.
18427         * class.cs (Method.Define): Apply parameter attributes.
18428         (Constructor.Define): Apply parameter attributes.
18429         (MethodCore.LabelParameters): Move here the core of labeling
18430         parameters. 
18432         * support.cs (ReflectionParameters.ParameterModifier,
18433         InternalParameters.ParameterModifier): Use IsByRef on the type and
18434         only return the OUT bit for these parameters instead of in/out/ref
18435         flags.
18437         This is because I miss-understood things.  The ParameterInfo.IsIn
18438         and IsOut represent whether the parameter has the [In] and [Out]
18439         attributes set.  
18441 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18443         * ecore.cs (FieldExpr.Emit): Release temporaries.
18445         * assign.cs (LocalTemporary.Release): new function.
18447         * codegen.cs (EmitContext.GetTemporaryStorage,
18448         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18449         temporary storage.  Now we can "put back" localbuilders when we
18450         are done with them
18452 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18454         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18455         need to make a copy of the variable to generate verifiable code.
18457 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18459         * driver.cs: Compute dynamically the system directory.
18461         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18462         Slower, but more generally useful.  Used by the abstract
18463         registering implementation. 
18465         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18466         the rules for the special rule on Type/instances.  First check if
18467         we have the same name, and if so, try that special static path
18468         rather than the instance path.
18470 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18472         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18473         for, while and if.
18475         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18476         Enum, ValueType, Delegate or Array for non-corlib compiles.
18478         * cs-tokenizer.cs: Catch long identifiers (645)
18480         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18481         piece of code.
18483         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18484         fix, we were returning too early, so we were not registering
18485         pending methods from abstract classes.
18487         Do not register pending methods if the class is abstract.
18489         * expression.cs (Conditional.DoResolve): Report circular implicit
18490         conversions when we neecd to compute it for conditional
18491         expressions. 
18493         (Is.DoResolve): If the expression is always of the provided type,
18494         flag warning 183.  If the expression can not ever be of the
18495         provided type flag warning 184.
18497         * class.cs: Catch 169 as well.
18499         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18500         read. 
18502 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18504         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18506 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18508         * interface.cs: (PopulateMethod): Check for pointers being defined
18509         only if the unsafe context is active.
18510         (PopulateProperty): ditto.
18511         (PopulateIndexer): ditto.
18513         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18514         specified.  If pointers are present, make sure that they are
18515         present in an unsafe context.
18516         (Constructor, Constructor.Define): ditto.
18517         (Field, Field.Define): ditto.
18518         (Property, Property.Define): ditto.
18519         (Event, Event.Define): ditto.
18521         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18522         hashtable if there are classes or structs defined.
18524         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18525         code, as the constant resolution moved.
18527         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18528         the metadata, so we can flag error 133. 
18530         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18531         pointer is being declared in an unsafe context.
18533 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18535         * modifiers.cs (Modifiers.Check): Require a Location argument.
18536         Report error 227 for Unsafe use.
18538         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18540         * statement.cs (For.Emit): If the test is null, then report that
18541         we do `return', as we wont reach anything afterwards.
18543         (Switch.SwitchGoverningType): Track the expression that matched
18544         the conversion.
18546         * driver.cs: Allow negative numbers as an error code to flag.
18548         * cs-parser.jay: Handle 1551.
18550         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18552 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18554         * cs-parser.jay: Report 1518 (type declaration can only contain
18555         class, struct, interface, enum or delegate)
18557         (switch_label): Report 1523 (keywords `case' or `default' must
18558         preced code)
18560         (opt_switch_sections): Report 1522 (empty switch)
18562         * driver.cs: Report 1515 (response file specified multiple times)
18563         Report 1516 (Source file specified multiple times).
18565         * expression.cs (Argument.Resolve): Signal 1510
18567         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18568         access not allowed in static code)
18570 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18572         * typemanager.cs (IsPointerType): Utility method which we are going
18573         to need a lot.
18575         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18576         the object type, so we take care of that.
18578         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18580         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18581         added to non-params parameters :-)
18583         * typemanager.cs (CSharpName): Include 'void' type too. 
18585         (void_ptr_type): Include in the set of core types.
18587         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18588         duplicating code.
18590         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18591         an unsafe context.
18593         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18594         completely forgotten about it.
18596 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18598         * cs-parser.jay (pointer_type): Add. This begins our implementation
18599         of parsing rules for unsafe code.
18601         (unsafe_statement): Implement.
18603         (embedded_statement): Modify to include the above.
18605         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18607         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18608         if the current context is an unsafe one.
18610         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18611         are handled differently, we need separate rules for them.
18613         (local_variable_declaration): Update to use local_variable_pointer_type
18614         to allow variable declarations of unmanaged pointer types.
18616         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18617         in unsafe contexts.
18619         * ../errors/cs0214.cs : Add.
18621 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18623         * makefile: remove 'response' file when cleaning.
18625 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18627         * cs-parser.jay: Report 1524.
18629 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18631         * typemanager.cs (RegisterMethod): drop checking if we have
18632         registered this from here
18634 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18636         * class.cs (Method.EmitDestructor): Implement calling our base
18637         destructor. 
18639         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18640         value of InFinally.
18642         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18643         this routine and will wrap the call in a try/catch block.  Deal
18644         with the case.
18646 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18648         * ecore.cs (Expression.MemberLookup): instead of taking a
18649         parameter `same_type' that was used to tell whether we could
18650         access private members we compute our containing type from the
18651         EmitContext.
18653         (FieldExpr): Added partial support for volatile fields.  This does
18654         not work for volatile fields exposed from assemblies, as I can not
18655         figure out how to extract the modreq from it.
18657         Updated all the source files to use this.
18659         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18660         because it is referenced by MemberLookup very often. 
18662 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18664         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18665         TypeBuilder.GetCustomAttributes to retrieve what we need.
18667         Get rid of redundant default_member_attr_type as this is the same as
18668         default_member_type which already exists.
18670         * interface.cs, attribute.cs : Update accordingly.
18672 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18674         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18675         work for TYpeBuilders though.  Ravi, can you please fix this?
18677         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18679         * expression.cs (Argument.Emit): Handle the case of ref objects
18680         being passed to ref functions;  
18682         (ParameterReference.EmitLoad): Loads the content of the pointer
18683         without dereferencing.
18685 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18687         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18689 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18691         * class.cs (Indexer.DefineMethod): Incorporate the interface
18692         type in the name of the method if we are doing explicit interface
18693         implementation.
18695         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18697         (BetterConversion): Fix extremely trivial bug where we were referring to
18698         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18699         again !
18701         * ../errors/bug16.cs : Add although we have fixed it.
18703 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18705         * expression.cs (BaseIndexer): Begin implementation.
18707         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18709         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18710         production directly to remove a shift/reduce, and implement
18711         explicit interface implementation.
18713         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18714         after a floating point suffix.
18716         * expression.cs (DoNumericPromotions): Improved the conversion for
18717         uint/uint.  If we have a constant, we avoid doing a typecast to a
18718         larger type.
18720         * class.cs (Indexer): Implement explicit interface implementation
18721         for indexers.
18723 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18725         * class.cs: make the default instance constructor public and hidebysig.
18727 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18729         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18730         so we can call it from elsewhere.
18732         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18733         we emit it internally if the class has a defined indexer; otherwise the user
18734         emits it by decorating the class definition with the DefaultMemberAttribute.
18736         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18737         attribute is not used on a type which defines an indexer.
18739         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18740         character when we skip whitespace.
18742         * ../errors/cs0646.cs : Add.
18744 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18746         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18747         again. 
18749         * makefile: Add practical target `mcs3.exe' which builds the third
18750         generation compiler. 
18752         * expression.cs (New): Fix structures constructor calling.
18754         * class.cs (Property, Method, Indexer): Emit Final flag on the
18755         method if we are an interface implementation and we are not
18756         abstract. 
18758         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18759         whether this property is referencing a `base' method.
18761         * expression.cs (Invocation.EmitCall): take an extra argument:
18762         is_base, this is used to determine whether the `call' or
18763         `callvirt' opcode should be used.
18766         * delegate.cs: update EmitCall.
18768         * class.cs (Method.Define): Set NewSlot for the cases where we are
18769         not implementing an interface method.
18771         (Property.Define): ditto.
18773 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18775         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18776         'r'.  Allows mcs to parse itself fully.
18778 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18780         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18781         of the number of initializers that require the InitializeArray method.
18783         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18784         update the above field where necessary.
18786         (MakeByteBlob): Update accordingly.
18788         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18789         greater than 2.
18791         (EmitDynamicInitializers): Update in accordance with the new optimization.
18793         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18794         same OpCode applies.
18796         * cs-parser.jay : Fix some glaring errors I introduced.
18798 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18800         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18801         so that we can check for name clashes there too.
18803         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18804         for interface indexers.
18806         * interfaces.cs (Define): Emit the default member attribute.
18808         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18809         variable was being referred to while setting the value ;-)
18811 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18813         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18814         byte-by-byte information when we know the data is zero.
18816         Make the block always a multiple of 4, because
18817         DefineInitializedData has a bug.
18819         * assign.cs: Fix, we should assign from the temporary, not from
18820         the source. 
18822         * expression.cs (MakeByteBlob): Fix my incorrect code.
18824 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18826         * typemanager.cs (EnumToUnderlying): This function is used to get
18827         the underlying type from an enumeration, because it does not
18828         always work. 
18830         * constant.cs: Use the I4_S form for values between -128 and 127.
18832         * statement.cs (Block.LookupLabel): Looks up a label.
18833         (Block): Drop support for labeled blocks.
18835         (LabeledStatement): New kind of statement that represents a label
18836         only.
18838         (Goto): Finally implement this bad boy.
18840         * cs-parser.jay: Update to reflect new mechanism to implement
18841         labels.
18843 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18845         * codegen.cs (EmitContext.This): a codegen property that keeps the
18846         a single instance of this instead of creating many different this
18847         instances. 
18849         * delegate.cs (Delegate.DoResolve): Update to use the property;
18851         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18853         * expression.cs (BaseAccess.DoResolve): Ditto.
18855 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18857         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18858         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18860         (InitCoreTypes): Update accordingly.
18862         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18863         so we can quickly store the state.
18865         (ApplyAttributes): Set the correct implementation flags
18866         for InternalCall methods.
18868 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18870         * expression.cs (EmitCall): if a method is not virtual, then do
18871         not use callvirt on it.
18873         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18874         user defined stuff) requires the use of stobj, which takes an
18875         address on the stack instead of an array and an index.  So emit
18876         the Ldelema operation for it.
18878         (EmitStoreOpcode): Use stobj for valuetypes.
18880         (UnaryMutator.EmitCode): Use the right 1 value depending on
18881         whether we are dealing with int64/uint64, float or doubles.
18883         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18884         constructors that I implemented last night.
18886         (Constructor.IsDefault): Fix to work properly for static
18887         constructors.
18889         * cs-parser.jay (CheckDef): report method signature errors.
18890         Update error number 103 to be 132.
18892         * decl.cs: New AdditionResult enumeration value: MethodExists.
18893         Although we do this check for methods later on in the semantic
18894         analysis, catching repeated default constructors is so easy that
18895         we catch these here. 
18897         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18898         promotions code.
18900         (ParameterReference.EmitAssign, Emit): handle
18901         bools as bytes.
18903         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18904         (ArrayAccess.EmitStoreOpcode): ditto.
18906         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18908         * expression.cs (MakeByteBlob): Complete all the missing types
18909         (uint, short, ushort, byte, sbyte)
18911         * class.cs: Only init instance field initializers on instance
18912         constructors. 
18914         Rename `constructors' to instance_constructors. 
18916         (TypeContainer.AddConstructor): Only add constructors to the list
18917         if it is not static.
18919         Make sure that we handle default_static_constructor independently
18920         everywhere where we handle instance_constructors
18922 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18924         * class.cs: Do not lookup or create a base initializer for a
18925         static constructor.
18927         (ConstructorInitializer.Resolve): use the proper type to lookup
18928         for constructors.
18930         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18932         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18933         in DeclSpace. 
18935         * decl.cs: CloseType is now an virtual method, the default
18936         implementation just closes this type.
18938 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18940         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18941         to PreserveSig by default. Also emit HideBySig on such methods.
18943         Basically, set the defaults to standard values.
18945         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18946         argument, if candidate is better, it can't be worse than the best !
18948         (Invocation): Re-write bits to differentiate between methods being
18949         applicable in their expanded form and their normal form - for params
18950         methods of course.
18952         Get rid of use_standard everywhere as only standard conversions are allowed
18953         in overload resolution. 
18955         More spec conformance.
18957 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18959         * driver.cs: Add --timestamp, to see where the compiler spends
18960         most of its time.
18962         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18963         `this' in static code.
18965         (SimpleName.DoResolve): Implement in terms of a helper function
18966         that allows static-references to be passed upstream to
18967         MemberAccess.
18969         (Expression.ResolveWithSimpleName): Resolve specially simple
18970         names when called by MemberAccess to implement the special
18971         semantics. 
18973         (Expression.ImplicitReferenceConversion): Handle conversions from
18974         Null to reference types before others, as Null's type is
18975         System.Object. 
18977         * expression.cs (Invocation.EmitCall): Handle the special case of
18978         calling methods declared on a reference type from a ValueType
18979         (Base classes System.Object and System.Enum)
18981         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18982         the left hand side is a TypeExpr, not on every enumeration. 
18984         (Binary.Resolve): If types are reference types, then do a cast to
18985         object on operators != and == of both arguments.
18987         * typemanager.cs (FindMembers): Extract instance and static
18988         members if requested.
18990         * interface.cs (PopulateProperty): Use void_type instead of null
18991         as the return type for the setter method.
18993         (PopulateIndexer): ditto.
18995 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18997         * support.cs (ReflectionParameters): Fix minor bug where we
18998         were examining the wrong parameter for the ParamArray attribute.
19000         Cope with requests for the type of the parameter at position
19001         greater than the params parameter's. We now return the element
19002         type of the params array as that makes more sense.
19004         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19005         accordingly as we no longer have to extract the element type
19006         ourselves.
19008         (Invocation.OverloadResolve): Update.
19010 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19012         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19013         against IEnumerator, test whether the return value is a descendant
19014         of the IEnumerator interface.
19016         * class.cs (Indexer.Define): Use an auxiliary method to implement
19017         the other bits of the method definition.  Begin support for
19018         explicit interface implementation.
19020         (Property.DefineMethod): Use TypeManager.void_type instead of null
19021         for an empty return value.
19023 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19025         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19026         dealing with a FieldExpr which is composed of a FieldBuilder, in
19027         the code path we did extract the constant, but we should have
19028         obtained the underlying value to be able to cast it (otherwise we
19029         end up in an infinite loop, this is what Ravi was running into).
19031         (ArrayCreation.UpdateIndices): Arrays might be empty.
19033         (MemberAccess.ResolveMemberAccess): Add support for section
19034         14.5.4.1 that deals with the special case of E.I when E is a type
19035         and something else, that I can be a reference to a static member.
19037         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19038         handle a particular array type to create byte blobs, it is just
19039         something we dont generate byteblobs for.
19041         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19042         arguments. 
19044         * location.cs (Push): remove the key from the hashtable that we
19045         are about to add.   This happens for empty files.
19047         * driver.cs: Dispose files after we have parsed them.
19049         (tokenize): new function that only runs the tokenizer on its
19050         input, for speed testing.
19052 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19054         * class.cs (Event.Define): Define the private field only if there
19055         are no accessors defined.
19057         * expression.cs (ResolveMemberAccess): If there is no associated
19058         field with the event, that means we have an event defined with its
19059         own accessors and we should flag error cs0070 since transforming
19060         ourselves into a field is not valid in that case.
19062         * ecore.cs (SimpleName.DoResolve): Same as above.
19064         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19065         and charset to sane values.
19067 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19069         * assign.cs (DoResolve): Perform check on events only if they 
19070         are being accessed outside the declaring type.
19072         * cs-parser.jay (event_declarations): Update rules to correctly
19073         set the type of the implicit parameter etc.
19075         (add_accessor, remove_accessor): Set current local parameters.
19077         * expression.cs (Binary): For delegate addition and subtraction,
19078         cast the return value from the method into the appropriate delegate
19079         type.
19081 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19083         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19084         of these as the workaround is unnecessary.
19086         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19087         delegate data - none of that is needed at all.
19089         Re-write bits to extract the instance expression and the delegate method
19090         correctly.
19092         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19093         on delegates too.
19095         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19096         of attaching attributes instead of duplicating code everywhere.
19098         * everywhere : Update code to do attribute emission using the above method.
19100 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19102         * expression.cs (IsParamsMethodApplicable): if there are not
19103         parameters, return immediately.
19105         * ecore.cs: The 0 literal can be implicity converted to an enum
19106         type. 
19108         (SimpleName.DoResolve): First lookup the type, then lookup the
19109         members. 
19111         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19112         want to get its address.  If the InstanceExpression is not
19113         addressable, store the result in a temporary variable, then get
19114         the address of it.
19116         * codegen.cs: Only display 219 errors on warning level or above. 
19118         * expression.cs (ArrayAccess): Make it implement the
19119         IMemoryLocation interface.
19121         (Binary.DoResolve): handle the operator == (object a, object b)
19122         and operator != (object a, object b) without incurring into a
19123         BoxedCast (because 5 != o should never be performed).
19125         Handle binary enumerator operators.
19127         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19128         value type, otherwise use Ldelem_ref.
19130         Use precomputed names;
19132         (AddressOf): Implement address of
19134         * cs-parser.jay (labeled_statement): Fix recursive block
19135         addition by reworking the production.
19137         * expression.cs (New.DoEmit): New has a special case:
19138                 
19139                  If we are dealing with a ValueType, we have a few
19140                  situations to deal with:
19141                 
19142                     * The target of New is a ValueType variable, that is
19143                       easy, we just pass this as the variable reference
19144                 
19145                     * The target of New is being passed as an argument,
19146                       to a boxing operation or a function that takes a
19147                       ValueType.
19148                 
19149                       In this case, we need to create a temporary variable
19150                       that is the argument of New.
19153 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19155         * rootcontext.cs (LookupType): Check that current_type is not null before
19156         going about looking at nested types.
19158         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19159         not implement the IAssignMethod interface any more.
19161         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19162         where we tranform them into FieldExprs if they are being resolved from within
19163         the declaring type.
19165         * ecore.cs (SimpleName.DoResolve): Do the same here.
19167         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19169         * ../errors/bug10.cs : Add.
19171         * ../errors/cs0070.cs : Add.
19173         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19175         * assign.cs : Get rid of EventIsLocal everywhere.
19177 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19179         * ecore.cs (ConvertIntLiteral): finished the implementation.
19181         * statement.cs (SwitchLabel): Convert the value we are using as a
19182         key before looking up the table.
19184 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19186         * codegen.cs (EmitTopBlock): Require a Location argument now.
19188         * cs-parser.jay (constructor_declarator): We need to setup
19189         current_local_parameters before we parse the
19190         opt_constructor_initializer, to allow the variables to be bound
19191         to the constructor arguments.
19193         * rootcontext.cs (LookupType): First lookup nested classes in our
19194         class and our parents before we go looking outside our class.
19196         * expression.cs (ConstantFold): Extract/debox the values at the
19197         beginnning. 
19199         * rootcontext.cs (EmitCode): Resolve the constants first before we
19200         resolve the types.  This is not really needed, but it helps debugging.
19202         * statement.cs: report location.
19204         * cs-parser.jay: pass location to throw statement.
19206         * driver.cs: Small bug fix.
19208         * report.cs: Updated format to be 4-zero filled digits.
19210 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19212         * expression.cs (CheckIndices): Fix minor bug where the wrong
19213         variable was being referred to ;-)
19215         (DoEmit): Do not call EmitStaticInitializers when the 
19216         underlying type is System.Object.
19218 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19220         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19221         and do the usual workaround for SRE.
19223         * class.cs (MyEventBuilder.EventType): New member to get at the type
19224         of the event, quickly.
19226         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19228         * assign.cs (Assign.DoResolve): Handle the case when the target
19229         is an EventExpr and perform the necessary checks.
19231         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19232         interface.
19234         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19236         (EventExpr): Set the type in the constructor itself since we 
19237         are meant to be born fully resolved.
19239         (EventExpr.Define): Revert code I wrote earlier.
19240                 
19241         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19242         instance expression is null. The instance expression is a This in that case
19243         or a null, depending on whether it is a static method or not.
19245         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19246         refers to more than one method.
19248         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19249         and accordingly flag errors.
19251 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19253         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19255 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19257         * location.cs (ToString): Provide useful rutine.
19259 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19261         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19262         objects, return the actual integral boxed.
19264         * statement.cs (SwitchLabel): define an ILLabel for each
19265         SwitchLabel. 
19267         (Switch.CheckSwitch): If the value is a Literal, extract
19268         the underlying literal.
19270         Also in the unused hashtable we had, add the SwitchLabel so we can
19271         quickly look this value up.
19273         * constant.cs: Implement a bunch of new constants.  Rewrite
19274         Literal based on this.  Made changes everywhere to adapt to this.
19276         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19277         dereferencing array only once, and also copes with enumrations.
19279         bytes are two bytes wide, not one.
19281         (Cast): Perform constant conversions.
19283         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19284         wrappers to the literals here.
19286         * expression.cs (DoNumericPromotions): long literals can converted
19287         to ulong implicity (this is taken care of elsewhere, but I was
19288         missing this spot).
19290         * ecore.cs (Expression.Literalize): Make the return type Literal,
19291         to improve type checking.
19293         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19295 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19297         * literal.cs: Revert code from ravi that checked the bounds.  The
19298         bounds are sane by the definition of the type itself. 
19300         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19301         need to actually look up in our parent hierarchy for interfaces
19302         implemented. 
19304         * const.cs: Use the underlying type for enumerations
19306         * delegate.cs: Compute the basename for the delegate creation,
19307         that should fix the delegate test case, and restore the correct
19308         Type Lookup semantics in rootcontext
19310         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19311         referencing a nested type with the Reflection API is using the "+"
19312         sign. 
19314         * cs-parser.jay: Do not require EOF token at the end.
19316 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19318         * rootcontext.cs (LookupType): Concatenate type names with
19319         a '.' instead of a '+' The test suite passes again.
19321         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19322         field of the enumeration.
19324         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19325         the case when the member is an EventExpr.
19327         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19328         static has an associated instance expression.
19330         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19332         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19334         * class.cs (Event.Define): Register event and perform appropriate checks
19335         for error #111.
19337         We define the Add and Remove methods even if the use provides none because
19338         in that case, we provide default implementations ourselves.
19340         Define a private field of the type of the event. This is done by the CSC compiler
19341         and we should be doing it too ;-)
19343         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19344         More methods we use in code we generate.
19346         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19347         is important.
19349         (InitCoreTypes): Update accordingly for the above.
19351         * class.cs (Event.Emit): Generate code for default accessors that we provide
19353         (EmitDefaultMethod): Do the job in the above.
19355         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19356         appropriate place.
19358 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19360         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19361         builders even if we were missing one.
19363         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19364         pass the Basename as our class name instead of the Name.  The
19365         basename will be correctly composed for us.
19367         * parameter.cs (Paramters): Now takes a Location argument.
19369         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19370         make all the code call directly LookupType in RootContext and take
19371         this chance to pass the Location information everywhere.
19373         * Everywhere: pass Location information.
19375 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19377         * class.cs (Constructor.Define): Updated way of detecting the
19378         length of the parameters.
19380         (TypeContainer.DefineType): Use basename as the type name for
19381         nested types.
19383         (TypeContainer.Define): Do not recursively define types here, as
19384         definition is taken care in order by the RootContext.
19386         * tree.cs: Keep track of namespaces in a per-file basis.
19388         * parameter.cs (Parameter.ComputeSignature): Update to use
19389         DeclSpace. 
19391         (Parameters.GetSignature): ditto.
19393         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19394         instead of a TypeContainer.
19396         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19397         resolve names.  Because we need to be resolve in our context, not
19398         our parents.
19400         * driver.cs: Implement response files.
19402         * class.cs (TypeContainer.DefineType): If we are defined, do not
19403         redefine ourselves.
19405         (Event.Emit): Emit the code for add/remove handlers.
19406         (Event.Define): Save the MethodBuilders for add/remove.
19408         * typemanager.cs: Use pair here too.
19410         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19411         DictionaryEntry requires the first argument to be non-null.  
19413         (enum_declaration): Compute full name for registering the
19414         enumeration.
19416         (delegate_declaration): Instead of using
19417         formal_parameter_list, use opt_formal_parameter_list as the list
19418         can be empty.
19420         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19421         (EventParsing): New property that controls whether `add' and
19422         `remove' are returned as tokens or identifiers (for events);
19424 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19426         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19427         use MyEventBuilder only and let it wrap the real builder for us.
19429         (MyEventBuilder): Revamp constructor etc.
19431         Implement all operations that we perform on EventBuilder in precisely the same
19432         way here too.
19434         (FindMembers): Update to use the EventBuilder member.
19436         (Event.Emit): Update accordingly.
19438 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19440         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19441         by calling the appropriate methods.
19443         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19444         useful.
19446         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19448 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19450         * delegate.cs (Delegate.Populate): Check that the return type
19451         and various parameters types are indeed accessible.
19453         * class.cs (Constructor.Define): Same here.
19455         (Field.Define): Ditto.
19457         (Event.Define): Ditto.
19459         (Operator.Define): Check that the underlying Method defined itself
19460         correctly - so it's MethodBuilder should not be null.
19462         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19463         expression happens to be null.
19465         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19466         members but as of now we don't seem to be able to do anything really useful with it.
19468         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19469         not the EventBuilder.
19471 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19473         * cs-tokenizer.cs: Add support for defines.
19474         Add support for #if, #elif, #else, #endif
19476         (eval_var): evaluates a variable.
19477         (eval): stubbed for evaluating functions.
19479         * cs-parser.jay: Pass the defines information
19481         * driver.cs: Add --define command line option.
19483         * decl.cs: Move MemberCore here.
19485         Make it the base class for DeclSpace.  This allows us to catch and
19486         report 108 and 109 for everything now.
19488         * class.cs (TypeContainer.Define): Extract all the members
19489         before populating and emit the warning 108 (new keyword required
19490         to override) instead of having each member implement this.
19492         (MemberCore.Define): New abstract method, we will be using this in
19493         the warning reporting engine in Populate.
19495         (Operator.Define): Adjust to new MemberCore protocol. 
19497         * const.cs (Const): This does not derive from Expression, it is a
19498         temporary object we use to create fields, it is a MemberCore. 
19500         * class.cs (Method.Define): Allow the entry point to be in a
19501         specific class.
19503         * driver.cs: Rewrite the argument handler to clean it up a bit.
19505         * rootcontext.cs: Made it just an auxiliary namespace feature by
19506         making everything static.
19508         * driver.cs: Adapt code to use RootContext type name instead of
19509         instance variable.
19511         * delegate.cs: Remove RootContext argument.
19513         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19514         argument. 
19516         * class.cs (Event.Define): The lookup can fail.
19518         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19520         * expression.cs: Resolve the this instance before invoking the code.
19522 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19524         * cs-parser.jay: Add a production in element_access that allows
19525         the thing to become a "type" reference.  This way we can parse
19526         things like "(string [])" as a type.
19528         Note that this still does not handle the more complex rules of
19529         casts. 
19532         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19534         * ecore.cs: (CopyNewMethods): new utility function used to
19535         assemble the list of methods from running FindMembers.
19537         (MemberLookup): Rework FindMembers so that 
19539 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19541         * class.cs (TypeContainer): Remove Delegates who fail to be
19542         defined.
19544         * delegate.cs (Populate): Verify that we dont get null return
19545         values.   TODO: Check for AsAccessible.
19547         * cs-parser.jay: Use basename to emit error 574 (destructor should
19548         have the same name as container class), not the full name.
19550         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19551         possible representation.  
19553         Also implements integer type suffixes U and L.
19555 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19557         * expression.cs (ArrayCreation.DoResolve): We need to do the
19558         argument resolution *always*.
19560         * decl.cs: Make this hold the namespace.  Hold the root context as
19561         well.
19562         (LookupType): Move here.
19564         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19566         * location.cs (Row, Name): Fixed the code, it was always returning
19567         references to the first file.
19569         * interface.cs: Register properties defined through interfaces.
19571         * driver.cs: Add support for globbing on the command line
19573         * class.cs (Field): Make it derive from MemberCore as well.
19574         (Event): ditto.
19576 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19578         * class.cs (Event::Define): Check that the type of the event is a delegate
19579         type else flag error #66.
19581         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19582         same.
19584         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19585         values of EntryPoint, CharSet etc etc.
19587         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19589         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19590         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19591         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19592         which needs this to do its work.
19594         * ../errors/cs0066.cs : Add.
19596 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19598         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19599         helper functions.
19601         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19602         clears out the parameters field.
19603         (MemberSignatureCompare): Cleanup
19605         (MemberCore): New base class used to share code between MethodCore
19606         and Property.
19608         (RegisterRequiredImplementations) BindingFlags.Public requires
19609         either BindingFlags.Instace or Static.  Use instance here.
19611         (Property): Refactored code to cope better with the full spec.
19613         * parameter.cs (GetParameterInfo): Return an empty array instead
19614         of null on error.
19616         * class.cs (Property): Abstract or extern properties have no bodies.
19618         * parameter.cs (GetParameterInfo): return a zero-sized array.
19620         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19621         method modifier validation to the typecontainer so we can reuse
19622         this on properties.
19624         (MethodCore.ParameterTypes): return an empty sized array of types.
19626         (Property.Define): Test property modifier validity.
19628         Add tests for sealed/override too.
19630         (Method.Emit): abstract or extern methods have no bodies.
19632 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19634         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19635         thing.
19637         (Method::Define, ::Emit): Modify accordingly.
19639         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19641         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19643         * makefile: Pass in /unsafe.
19645 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19647         * class.cs (MakeKey): Kill routine.
19649         * class.cs (TypeContainer.Define): Correctly define explicit
19650         method implementations (they require the full interface name plus
19651         the method name).
19653         * typemanager.cs: Deply the PtrHashtable here and stop using the
19654         lame keys.  Things work so much better.
19656         This of course broke everyone who depended on `RegisterMethod' to
19657         do the `test for existance' test.  This has to be done elsewhere.
19659         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19660         the object stupid Equals method (because, that like fails all over
19661         the place).  We still do not use it.
19663         * class.cs (TypeContainer.SetRequiredInterface,
19664         TypeContainer.RequireMethods): Killed these two routines and moved
19665         all the functionality to RegisterRequiredImplementations.
19667         (TypeContainer.RegisterRequiredImplementations): This routine now
19668         registers all the implementations required in an array for the
19669         interfaces and abstract methods.  We use an array of structures
19670         which can be computed ahead of time to reduce memory usage and we
19671         also assume that lookups are cheap as most classes will not
19672         implement too many interfaces.
19674         We also avoid creating too many MethodSignatures.
19676         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19677         clear the "pending" bit if we find that there are problems with
19678         the declaration.
19680         (TypeContainer.VerifyPendingMethods): Update to report errors of
19681         methods that look like implementations but are not.
19683         (TypeContainer.Define): Add support for explicit interface method
19684         implementation. 
19686 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19688         * typemanager.cs: Keep track of the parameters here instead of
19689         being a feature of the TypeContainer.
19691         * class.cs: Drop the registration of parameters here, as
19692         InterfaceMethods are also interface declarations.
19694         * delegate.cs: Register methods with the TypeManager not only with
19695         the TypeContainer.  This code was buggy.
19697         * interface.cs: Full registation here.
19699 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19701         * expression.cs: Remove reducer for binary expressions, it can not
19702         be done this way.
19704         * const.cs: Put here the code that used to go into constant.cs
19706         * constant.cs: Put here the code for constants, this is a new base
19707         class for Literals.
19709         * literal.cs: Make Literal derive from Constant.
19711 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19713         * statement.cs (Return.Emit): Report error 157 if the user
19714         attempts to return from a finally block.
19716         (Return.Emit): Instead of emitting a return, jump to the end of
19717         the function.
19719         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19720         LocalBuilder to store the result of the function.  ReturnLabel is
19721         the target where we jump.
19724 2001-12-09  Radek Doulik  <rodo@ximian.com>
19726         * cs-parser.jay: remember alias in current namespace
19728         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19729         namespaces
19731         * class.cs (LookupAlias): lookup alias in my_namespace
19733         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19734         aliases hashtable
19735         (LookupAlias): lookup alias in this and if needed in parent
19736         namespaces
19738 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19740         * support.cs: 
19742         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19743         making things static.  I need this to avoid passing the
19744         TypeContainer when calling ParameterType.
19746         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19747         that did string manipulation to compute the type and then call
19748         GetType.  Use Parameter.ParameterType instead.
19750         * cs-tokenizer.cs: Consume the suffix for floating values.
19752         * expression.cs (ParameterReference): figure out whether this is a
19753         reference parameter or not.  Kill an extra variable by computing
19754         the arg_idx during emission.
19756         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19757         function that returns whether a parameter is an out/ref value or not.
19759         (Parameter.ParameterType): The type of the parameter (base,
19760         without ref/out applied).
19762         (Parameter.Resolve): Perform resolution here.
19763         (Parameter.ExternalType): The full type (with ref/out applied).
19765         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19766         support for expressions on the using statement.
19768 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19770         * statement.cs (Using.EmitLocalVariableDecls): Split the
19771         localvariable handling of the using statement.
19773         (Block.EmitMeta): Keep track of variable count across blocks.  We
19774         were reusing slots on separate branches of blocks.
19776         (Try.Emit): Emit the general code block, we were not emitting it. 
19778         Check the type of the declaration to be an IDisposable or
19779         something that can be implicity converted to it. 
19781         Emit conversions if required.
19783         * ecore.cs (EmptyExpression): New utility class.
19784         (Expression.ImplicitConversionExists): New utility function.
19786 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19788         * statement.cs (Using): Implement.
19790         * expression.cs (LocalVariableReference): Support read only variables.
19792         * statement.cs: Remove the explicit emit for the Leave opcode.
19793         (VariableInfo): Add a readonly field.
19795 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19797         * ecore.cs (ConvCast): new class used to encapsulate the various
19798         explicit integer conversions that works in both checked and
19799         unchecked contexts.
19801         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19802         properly generate the overflow opcodes.
19804 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19806         * statement.cs: The correct type for the EmptyExpression is the
19807         element_type, not the variable type.  Ravi pointed this out.
19809 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19811         * class.cs (Method::Define): Handle PInvoke methods specially
19812         by using DefinePInvokeMethod instead of the usual one.
19814         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19815         above to do the task of extracting information and defining the method.
19817 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19819         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19820         of the condition for string type.
19822         (Emit): Move that here. 
19824         (ArrayCreation::CheckIndices): Keep string literals in their expression
19825         form.
19827         (EmitDynamicInitializers): Handle strings appropriately.
19829 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19831         * codegen.cs (EmitContext): Replace multiple variables with a
19832         single pointer to the current Switch statement.
19834         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19835         EmitContext.
19837 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19839         * statement.cs 
19841         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19842         default'.
19844         (Foreach.Emit): Foreach on arrays was not setting
19845         up the loop variables (for break/continue).
19847         (GotoCase): Semi-implented.
19849 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19851         * attribute.cs (CheckAttribute): Handle system attributes by using
19852         Attribute.GetAttributes to examine information we need.
19854         (GetValidPlaces): Same here.
19856         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19858         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19860         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19862         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19864         (Method::Emit): Handle the case when we are a PInvoke method.
19866 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19868         * expression.cs: Use ResolveWithSimpleName on compound names.
19870 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19872         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19873         before trying to reduce it.
19875         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19877         * constant.cs (LookupConstantValue): Implement.
19879         (EmitConstant): Use the above in emitting the constant.
19881         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19882         that are user-defined by doing a LookupConstantValue on them.
19884         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19885         too, like above.
19887 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19889         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19891         (BaseAccess.DoResolve): Implement.
19893         (MemberAccess.DoResolve): Split this routine into a
19894         ResolveMemberAccess routine that can be used independently
19896 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19898         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19899         As that share bits of the implementation.  Is returns a boolean,
19900         while As returns the Type that is being probed.
19902 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19904         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19905         instead of a Literal - much easier.
19907         (EnumInTransit): Remove - utterly useless :-)
19909         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19911         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19913         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19914         chain when we have no associated expression.
19916 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19918         * constant.cs (Define): Use Location while reporting the errror.
19920         Also emit a warning when 'new' is used and there is no inherited
19921         member to hide.
19923         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19924         populated.
19926         (LookupEnumValue): Implement to lookup an enum member's value and define it
19927         if necessary.
19929         (Populate): Re-write accordingly to use the above routine.
19931 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19933         * expression.cs (This): Fix prototype for DoResolveLValue to
19934         override the base class DoResolveLValue.
19936         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19937         declarations) 
19939         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19940         (we need to load the address of the field here).  This fixes
19941         test-22. 
19943         (FieldExpr.DoResolveLValue): Call the DoResolve
19944         function to initialize the Instance expression.
19946         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19947         correctly the GetEnumerator operation on a value type.
19949         * cs-parser.jay: Add more simple parsing error catches.
19951         * statement.cs (Switch): Add support for string switches.
19952         Handle null specially.
19954         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19956 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19958         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19960         (declare_local_constant): New helper function.
19962         * statement.cs (AddConstant): Keep a separate record of constants
19964         (IsConstant): Implement to determine if a variable is a constant.
19966         (GetConstantExpression): Implement.
19968         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19970         * statement.cs (IsVariableDefined): Re-write.
19972 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19974         * class.cs (TypeContainer::FindMembers): Look for constants
19975         in the case when we are looking for MemberTypes.Field
19977         * expression.cs (MemberAccess::DoResolve): Check that in the
19978         case we are a FieldExpr and a Literal, we are not being accessed
19979         by an instance reference.
19981         * cs-parser.jay (local_constant_declaration): Implement.
19983         (declaration_statement): Implement for constant declarations.
19985 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19987         * statement.cs (Switch): Catch double defaults.
19989         (Switch): More work on the switch() statement
19990         implementation.  It works for integral values now, need to finish
19991         string support.
19994 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19996         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19997         integer literals into other integer literals.  To be used by
19998         switch. 
20000 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20002         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20003         some memory.
20005         (EmitDynamicInitializers): Cope with the above since we extract data
20006         directly from ArrayData now.
20008         (ExpectInitializers): Keep track of whether initializers are mandatory
20009         or not.
20011         (Bounds): Make it a hashtable to prevent the same dimension being 
20012         recorded for every element in that dimension.
20014         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20015         from being found.
20017         Also fix bug which was causing the indices to be emitted in the reverse
20018         order.
20020 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20022         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20023         unfinished.  They do not work, because the underlying code is
20024         sloppy.
20026 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20028         * cs-parser.jay: Remove bogus fixme.
20030         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20031         on Switch statement.
20033 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20035         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20036         the same. 
20038         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20039         parameter. Apparently, any expression is allowed. 
20041         (ValidateInitializers): Update accordingly.
20043         (CheckIndices): Fix some tricky bugs thanks to recursion.
20045         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20046         I was being completely brain-dead.
20048         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20049         and re-write acordingly.
20051         (DelegateInvocation): Re-write accordingly.
20053         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20055         (MakeByteBlob): Handle types more correctly.
20057         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20058         initialization from expressions but it is incomplete because I am a complete
20059         Dodo :-|
20061 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20063         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20064         on If.  Basically, we have to return `true' (ie, we do return to
20065         our caller) only if both branches of the if return.
20067         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20068         short-circuit operators, handle them as short circuit operators. 
20070         (Cast.DoResolve): Resolve type.
20071         (Cast.Cast): Take an expression as the target type.
20073         * cs-parser.jay (cast_expression): Remove old hack that only
20074         allowed a limited set of types to be handled.  Now we take a
20075         unary_expression and we resolve to a type during semantic
20076         analysis.
20078         Use the grammar productions from Rhys to handle casts (this is
20079         not complete like Rhys syntax yet, we fail to handle that corner
20080         case that C# has regarding (-x), but we will get there.
20082 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20084         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20085         field which is an array type.
20087         * cs-parser.jay (declare_local_variables): Support array initialization too.
20089         * typemanager.cs (MakeKey): Implement.
20091         (everywhere): Use the above appropriately.
20093         * cs-parser.jay (for_statement): Update for array initialization while
20094         declaring variables.
20096         * ecore.cs : The error message was correct, it's the variable's names that
20097         were misleading ;-) Make the code more readable.
20099         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20100         the correct type etc.
20102         (ConvertExplicit): Handle Enum types by examining the underlying type.
20104 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20106         * parameter.cs (GetCallingConvention): Always return
20107         CallingConventions.Standard for now.
20109 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20111         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20112         and `r' after calling DoNumericPromotions.
20114         * ecore.cs: Fix error message (the types were in the wrong order).
20116         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20117         BindingFlags.Instance as well 
20119         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20120         implicit int literal conversion in an empty cast so that we
20121         propagate the right type upstream.
20123         (UnboxCast): new class used to unbox value types.
20124         (Expression.ConvertExplicit): Add explicit type conversions done
20125         by unboxing.
20127         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20128         the target type before applying the implicit LongLiterals to ULong
20129         literal cast.
20131 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20133         * cs-parser.jay (for_statement): Reworked the way For works: now
20134         we declare manually any variables that are introduced in
20135         for_initializer to solve the problem of having out-of-band code
20136         emition (that is what got for broken).
20138         (declaration_statement): Perform the actual variable declaration
20139         that used to be done in local_variable_declaration here.
20141         (local_variable_declaration): Do not declare anything, just pass
20142         the information on a DictionaryEntry
20144 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20146         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20147         re-write of the logic to now make it recursive.
20149         (UpdateIndices): Re-write accordingly.
20151         Store element data in a separate ArrayData list in the above methods.
20153         (MakeByteBlob): Implement to dump the array data into a byte array.
20155 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20157         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20158         into CheckIndices.
20160         * constant.cs (Define): Implement.
20162         (EmitConstant): Re-write fully.
20164         Pass in location info.
20166         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20167         respectively.
20169         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20170         DictionaryEntry since we need location info too.
20172         (constant_declaration): Update accordingly.
20174         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20175         code into another method : UpdateIndices.
20177 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20179         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20180         some type checking etc.
20182 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20184         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20185         bits to provide dimension info if the user skips doing that.
20187         Update second constructor to store the rank correctly.
20189 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20191         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20192         and try to implement.
20194         * ../errors/cs0150.cs : Add.
20196         * ../errors/cs0178.cs : Add.
20198 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20200         * statement.cs: Implement foreach on multi-dimensional arrays. 
20202         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20203         name of the params argument.
20205         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20206         initializing the array.
20208         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20209         we can use this elsewhere.
20211         * statement.cs: Finish implementation of foreach for single
20212         dimension arrays.
20214         * cs-parser.jay: Use an out-of-band stack to pass information
20215         around, I wonder why I need this.
20217         foreach_block: Make the new foreach_block the current_block.
20219         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20220         function used to return a static Parameters structure.  Used for
20221         empty parameters, as those are created very frequently.
20223         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20225 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20227         * interface.cs : Default modifier is private, not public. The
20228         make verify test passes again.
20230 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20232         * support.cs (ReflectionParameters): Fix logic to determine
20233         whether the last parameter is a params one. Test 9 passes again.
20235         * delegate.cs (Populate): Register the builders we define with
20236         RegisterParameterForBuilder. Test 19 passes again.
20238         * cs-parser.jay (property_declaration): Reference $6 instead
20239         of $$ to get at the location.
20241         (indexer_declaration): Similar stuff.
20243         (attribute): Ditto.
20245         * class.cs (Property): Register parameters for the Get and Set methods
20246         if they exist. Test 23 passes again.
20248         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20249         call to EmitArguments as we are sure there aren't any params arguments. 
20250         Test 32 passes again.
20252         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20253         IndexOutOfRangeException. 
20255         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20256         Test 33 now passes again.
20258 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20260         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20261         broke a bunch of things.  Will have to come up with a better way
20262         of tracking locations.
20264         * statement.cs: Implemented foreach for single dimension arrays.
20266 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20268         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20269         an error.  This removes the lookup from the critical path.
20271         * cs-parser.jay: Removed use of temporary_loc, which is completely
20272         broken. 
20274 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20276         * support.cs (ReflectionParameters.ParameterModifier): Report
20277         whether the argument is a PARAMS argument or not.
20279         * class.cs: Set the attribute `ParamArrayAttribute' on the
20280         parameter argument.
20282         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20283         and cons_param_array_attribute (ConstructorInfo for
20284         ParamArrayAttribute)., 
20286         * codegen.cs: Emit the return using the `Return' statement, that
20287         way we can report the error correctly for missing return values. 
20289         * class.cs (Method.Emit): Clean up.
20291         * expression.cs (Argument.Resolve): Take another argument: the
20292         location where this argument is used.  Notice that this is not
20293         part of the "Argument" class as to reduce the size of the
20294         structure (we know the approximate location anyways).
20296         Test if the argument is a variable-reference, if not, then
20297         complain with a 206.
20299         (Argument.Emit): Emit addresses of variables.
20301         (Argument.FullDesc): Simplify.
20303         (Invocation.DoResolve): Update for Argument.Resolve.
20305         (ElementAccess.DoResolve): ditto.
20307         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20308         method should be virtual, as this method is always virtual.
20310         (NewDelegate.DoResolve): Update for Argument.Resolve.
20312         * class.cs (ConstructorInitializer.DoResolve): ditto.
20314         * attribute.cs (Attribute.Resolve): ditto.
20316 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20318         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20320         * expression.cs (ParameterReference): Drop IStackStorage and implement
20321         IAssignMethod instead. 
20323         (LocalVariableReference): ditto.
20325         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20326         IAssignMethod instead. 
20328 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20330         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20331         enumerations that are used in heavily used structures derive from
20332         byte in a laughable and pathetic attempt to reduce memory usage.
20333         This is the kind of pre-optimzations that you should not do at
20334         home without adult supervision.
20336         * expression.cs (UnaryMutator): New class, used to handle ++ and
20337         -- separatedly from the other unary operators.  Cleans up the
20338         code, and kills the ExpressionStatement dependency in Unary.
20340         (Unary): Removed `method' and `Arguments' from this class, making
20341         it smaller, and moving it all to SimpleCall, so I can reuse this
20342         code in other locations and avoid creating a lot of transient data
20343         strucutres when not required.
20345         * cs-parser.jay: Adjust for new changes.
20347 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20349         * enum.cs (Enum.Populate): If there is a failure during
20350         definition, return
20352         * cs-parser.jay (opt_enum_base): we used to catch type errors
20353         here, but this is really incorrect.  The type error should be
20354         catched during semantic analysis.
20356 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20358         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20359         current_local_parameters as expected since I, in my stupidity, had forgotten
20360         to do this :-)
20362         * attribute.cs (GetValidPlaces): Fix stupid bug.
20364         * class.cs (Method::Emit): Perform check on applicability of attributes.
20366         (Constructor::Emit): Ditto.
20368         (Field::Emit): Ditto.
20370         (Field.Location): Store location information.
20372         (Property, Event, Indexer, Operator): Ditto.
20374         * cs-parser.jay (field_declaration): Pass in location for each field.
20376         * ../errors/cs0592.cs : Add.
20378 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20380         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20382         (InitCoreTypes): Update accordingly.
20384         (RegisterAttrType, LookupAttr): Implement.
20386         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20387         info about the same.
20389         (Resolve): Update to populate the above as necessary.
20391         (Error592): Helper.
20393         (GetValidPlaces): Helper to the above.
20395         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20397         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20399 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20401         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20403         * ../errors/cs0617.cs : Add.
20405 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20407         * enum.cs (Emit): Rename to Populate to be more consistent with what
20408         we expect it to do and when exactly it is called.
20410         * class.cs, rootcontext.cs : Update accordingly.
20412         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20413         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20415         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20417         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20418         of a fieldinfo using the above, when dealing with a FieldBuilder.
20420 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20422         * ../errors/cs0031.cs : Add.
20424         * ../errors/cs1008.cs : Add.
20426         * ../errrors/cs0543.cs : Add.
20428         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20429         enum type.
20431         (FindMembers): Implement.
20433         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20434         enums and delegates too.
20436         (enum_types): Rename to builder_to_enum.
20438         (delegate_types): Rename to builder_to_delegate.
20440         * delegate.cs (FindMembers): Implement.
20442 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20444         * typemanager.cs (IsEnumType): Implement.
20446         * enum.cs (Emit): Re-write parts to account for the underlying type
20447         better and perform checking etc.
20449         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20450         of the underlying type.
20452         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20453         value
20455         * enum.cs (error31): Helper to report error #31.
20457         * cs-parser.jay (enum_declaration): Store location of each member too.
20459         * enum.cs (member_to_location): New hashtable. 
20461         (AddEnumMember): Update location hashtable.
20463         (Emit): Use the location of each member while reporting errors.
20465 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20467         * cs-parser.jay: A for_initializer if is a
20468         local_variable_declaration really ammount to have an implicit
20469         block with the variable declaration and no initializer for for.
20471         * statement.cs (For.Emit): Cope with null initializers.
20473         This fixes the infinite loop on for initializers.
20475 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20477         * enum.cs: More cleanup.
20479         * ecore.cs: Remove dead code.
20481         * class.cs (Property.Emit): More simplification.
20482         (Event.Emit): ditto.
20484         Reworked to have less levels of indentation.
20486 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20488         * class.cs (Property): Emit attributes.
20490         (Field): Ditto.
20492         (Event): Ditto.
20494         (Indexer): Ditto.
20496         (Operator): Ditto.
20498         * enum.cs (Emit): Ditto.
20500         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20501         Enums too.
20503         * class.cs (Field, Event, etc.): Move attribute generation into the
20504         Emit method everywhere.
20506         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20507         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20508         as we had no way of defining nested enums !
20510         * rootcontext.cs : Adjust code accordingly.
20512         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20514 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20516         * expression.cs (EvalConstantExpression): Move into ecore.cs
20518         * enum.cs (Enum): Rename some members and make them public and readonly
20519         according to our convention.
20521         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20522         nothing else.
20524         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20526         (Enum::Emit): Write a simple version for now which doesn't try to compute
20527         expressions. I shall modify this to be more robust in just a while.
20529         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20531         (TypeContainer::CloseType): Create the Enum types too.
20533         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20535         * expression.cs (EvalConstantExpression): Get rid of completely.
20537         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20538         user-defined values and other cases.
20540         (IsValidEnumLiteral): Helper function.
20542         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20543         out there in the case we had a literal FieldExpr.
20545         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20547         (Literalize): Revamp a bit to take two arguments.
20549         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20551 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20553         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20555         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20557         (Resolve): Use the above to ensure we have proper initializers.
20559 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20561         * expression.cs (Expression::EvalConstantExpression): New method to 
20562         evaluate constant expressions.
20564         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20566 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20568         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20569         in an array.
20571         (Binary.ResolveOperator): Handle operator != (object a, object b)
20572         and operator == (object a, object b);
20574         (Binary.DoNumericPromotions): Indicate whether the numeric
20575         promotion was possible.
20577         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20578         Implement.  
20580         Made the ArrayAccess implement interface IAssignMethod instead of
20581         IStackStore as the order in which arguments are passed reflects
20582         this.
20584         * assign.cs: Instead of using expr.ExprClass to select the way of
20585         assinging, probe for the IStackStore/IAssignMethod interfaces.
20587         * typemanager.cs: Load InitializeArray definition.
20589         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20590         static data that can be used to initialize arrays. 
20592 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20594         * expression.cs: Handle operator== and operator!= for booleans.
20596         (Conditioal.Reduce): Implement reducer for the ?: operator.
20598         (Conditional.Resolve): Implement dead code elimination.
20600         (Binary.Resolve): Catch string literals and return a new
20601         concatenated string.
20603         (Unary.Reduce): Implement reduction of unary expressions.
20605         * ecore.cs: Split out the expression core handling here.
20607         (Expression.Reduce): New method used to perform constant folding
20608         and CSE.  This is needed to support constant-expressions. 
20610         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20611         targets, and optimize for !x.
20613 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20615         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20616         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20617         set custom atttributes.
20619         * literal.cs (Literal::GetValue): New abstract method to return the actual
20620         value of the literal, cast as an object.
20622         (*Literal): Implement GetValue method.
20624         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20625         expressions to the arraylist but objects of type Argument.
20627         * class.cs (TypeContainer::Emit): Emit our attributes too.
20629         (Method::Emit, Constructor::Emit): Ditto.
20631         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20632         to be ignoring earlier.
20634 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20636         * attribute.cs (AttributeSection::Define): Implement to do the business
20637         of constructing a CustomAttributeBuilder.
20639         (Attribute): New trivial class. Increases readability of code.  
20641         * cs-parser.jay : Update accordingly.
20643         (positional_argument_list, named_argument_list, named_argument): New rules
20645         (attribute_arguments): Use the above so that we are more correct.
20647 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20649         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20650         to perform all checks for a method with a params parameter.
20652         (Invocation::OverloadResolve): Update to use the above method and therefore
20653         cope correctly with params method invocations.
20655         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20656         params too.
20658         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20659         constructors in our parent too because we can't afford to miss out on 
20660         protected ones ;-)
20662         * attribute.cs (AttributeSection): New name for the class Attribute
20664         Other trivial changes to improve readability.
20666         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20667         use the new class names.
20669 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20671         * class.cs (Method::Define): Complete definition for params types too
20673         (Indexer::Define): Ditto.
20675         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20676         Cope everywhere with a request for info about the array parameter.
20678 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20680         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20682         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20683         local_variable_type to extract the string corresponding to the type.
20685         (local_variable_type): Fixup the action to use the new helper method.
20687         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20688         go.
20690         * expression.cs : Clean out code which uses the above.
20692 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20694         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20695         and bale out if necessary by returning a false.
20697         (RegisterProperty): Ditto.
20699         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20700         and print out appropriate error messages.
20702         * interface.cs (everywhere): Ditto.
20704         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20705         location to constructor.
20707         * class.cs (Property, Event, Indexer): Update accordingly.
20709         * ../errors/cs111.cs : Added.
20711         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20712         of a method, as laid down by the spec.
20714         (Invocation::OverloadResolve): Use the above method.
20716 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20718         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20719         now take a TypeContainer and a Parameters object.
20721         (ParameterData): Modify return type of ParameterModifier method to be 
20722         Parameter.Modifier and not a string.
20724         (ReflectionParameters, InternalParameters): Update accordingly.
20726         * expression.cs (Argument::GetParameterModifier): Same here.
20728         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20729         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20730         symbol in it at all so maybe this is only for now.
20732 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20734         * support.cs (InternalParameters): Constructor now takes an extra argument 
20735         which is the actual Parameters class.
20737         (ParameterDesc): Update to provide info on ref/out modifiers.
20739         * class.cs (everywhere): Update call to InternalParameters to pass in
20740         the second argument too.
20742         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20743         to return the modifier info [ref/out etc]
20745         (InternalParameters, ReflectionParameters): Implement the above.
20747         * expression.cs (Argument::ParameterModifier): Similar function to return
20748         info about the argument's modifiers.
20750         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20751         too.
20753         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20754         a new SetFormalParameters object which we pass to InternalParameters.
20756 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20758         * expression.cs (NewArray): Merge into the ArrayCreation class.
20760 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20762         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20763         NewUserdefinedArray into one as there wasn't much of a use in having
20764         two separate ones.
20766         * expression.cs (Argument): Change field's name to ArgType from Type.
20768         (Type): New readonly property which returns the proper type, taking into 
20769         account ref/out modifiers.
20771         (everywhere): Adjust code accordingly for the above.
20773         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20774         whether we are emitting for a ref or out parameter.
20776         * expression.cs (Argument::Emit): Use the above field to set the state.
20778         (LocalVariableReference::Emit): Update to honour the flag and emit the
20779         right stuff.
20781         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20783         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20785         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20787         (ReflectionParameters, InternalParameters): Implement the above method.
20789         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20790         reporting errors.
20792         (Invocation::FullMethodDesc): Ditto. 
20794 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20796         * cs-parser.jay: Add extra production for the second form of array
20797         creation. 
20799         * expression.cs (ArrayCreation): Update to reflect the above
20800         change. 
20802         * Small changes to prepare for Array initialization.
20804 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20806         * typemanager.cs (ImplementsInterface): interface might be null;
20807         Deal with this problem;
20809         Also, we do store negative hits on the cache (null values), so use
20810         this instead of calling t.GetInterfaces on the type everytime.
20812 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20814         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20816         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20817         split functionality out into different classes.
20819         (New::FormArrayType): Move into NewBuiltinArray.
20821         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20822         quite useless.
20824         (NewBuiltinArray): New class to handle creation of built-in arrays.
20826         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20827         account creation of one-dimensional arrays.
20829         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20831         (NewUserdefinedArray::DoResolve): Implement.
20833         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20835         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20836         we maintain inside the TypeManager. This is necessary to perform lookups on the
20837         module builder.
20839         (LookupType): Update to perform GetType on the module builders too.     
20841         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20843         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20845 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20847         * expression.cs (New::DoResolve): Implement guts of array creation.
20849         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20851 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20853         * expression.cs: Fix bug I introduced lsat night that broke
20854         Delegates. 
20856         (Expression.Resolve): Report a 246 error (can not resolve name)
20857         if we find a SimpleName in the stream.
20859         (Expression.ResolveLValue): Ditto.
20861         (Expression.ResolveWithSimpleName): This function is a variant of
20862         ResolveName, this one allows SimpleNames to be returned without a
20863         warning.  The only consumer of SimpleNames is MemberAccess
20865 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20867         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20868         might arrive here.  I have my doubts that this is correct.
20870         * statement.cs (Lock): Implement lock statement.
20872         * cs-parser.jay: Small fixes to support `lock' and `using'
20874         * cs-tokenizer.cs: Remove extra space
20876         * driver.cs: New flag --checked, allows to turn on integer math
20877         checking. 
20879         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20880         Threading.Monitor.Exit 
20882 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20884         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20885         Expression Class to be IndexerAccess.
20887         Notice that Indexer::DoResolve sets the eclass to Value.
20889 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20891         * class.cs (TypeContainer::Emit): Emit code for indexers.
20893         * assign.cs (IAssignMethod): New interface implemented by Indexers
20894         and Properties for handling assignment.
20896         (Assign::Emit): Simplify and reuse code. 
20898         * expression.cs (IndexerAccess, PropertyExpr): Implement
20899         IAssignMethod, clean up old code. 
20901 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20903         * typemanager.cs (ImplementsInterface): New method to determine if a type
20904         implements a given interface. Provides a nice cache too.
20906         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20907         method.
20909         (ConvertReferenceExplicit): Ditto.
20911         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20912         various methods, with correct names etc.
20914         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20915         Operator.UnaryNegation.
20917         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20918         we have a unary plus or minus operator.
20920         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20921         UnaryMinus.
20923         * everywhere : update accordingly.
20925         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20926         respectively.
20928         * class.cs (Method::Define): For the case where we are implementing a method
20929         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20930         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20932 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20934         * interface.cs (FindMembers): Implement to work around S.R.E
20935         lameness.
20937         * typemanager.cs (IsInterfaceType): Implement.
20939         (FindMembers): Update to handle interface types too.
20941         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20942         use IsAssignableFrom as that is not correct - it doesn't work.
20944         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20945         and accordingly override EmitStatement.
20947         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20948         using the correct logic :-)
20950 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20952         * ../errors/cs-11.cs : Add to demonstrate error -11 
20954 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20956         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20957         then pass this as a hint to ResolveLValue.
20959         * expression.cs (FieldExpr): Add Location information
20961         (FieldExpr::LValueResolve): Report assignment to readonly
20962         variable. 
20964         (Expression::ExprClassFromMemberInfo): Pass location information.
20966         (Expression::ResolveLValue): Add new method that resolves an
20967         LValue. 
20969         (Expression::DoResolveLValue): Default invocation calls
20970         DoResolve. 
20972         (Indexers): New class used to keep track of indexers in a given
20973         Type. 
20975         (IStackStore): Renamed from LValue, as it did not really describe
20976         what this did.  Also ResolveLValue is gone from this interface and
20977         now is part of Expression.
20979         (ElementAccess): Depending on the element access type
20981         * typemanager.cs: Add `indexer_name_type' as a Core type
20982         (System.Runtime.CompilerServices.IndexerNameAttribute)
20984         * statement.cs (Goto): Take a location.
20986 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20988         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20989         if two delegates are compatible.
20991         (NewDelegate::DoResolve): Update to take care of the case when
20992         we instantiate a delegate from another delegate.
20994         * typemanager.cs (FindMembers): Don't even try to look up members
20995         of Delegate types for now.
20997 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20999         * delegate.cs (NewDelegate): New class to take care of delegate
21000         instantiation.
21002         * expression.cs (New): Split the delegate related code out into 
21003         the NewDelegate class.
21005         * delegate.cs (DelegateInvocation): New class to handle delegate 
21006         invocation.
21008         * expression.cs (Invocation): Split out delegate related code into
21009         the DelegateInvocation class.
21011 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21013         * expression.cs (New::DoResolve): Implement delegate creation fully
21014         and according to the spec.
21016         (New::DoEmit): Update to handle delegates differently.
21018         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21019         because of which we were printing out arguments in reverse order !
21021         * delegate.cs (VerifyMethod): Implement to check if the given method
21022         matches the delegate.
21024         (FullDelegateDesc): Implement.
21026         (VerifyApplicability): Implement.
21028         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21029         delegate invocations too.
21031         (Invocation::Emit): Ditto.
21033         * ../errors/cs1593.cs : Added.
21035         * ../errors/cs1594.cs : Added.
21037         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21039 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21041         * typemanager.cs (intptr_type): Core type for System.IntPtr
21043         (InitCoreTypes): Update for the same.
21045         (iasyncresult_type, asynccallback_type): Ditto.
21047         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21048         correct.
21050         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21051         too.
21053         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21054         the builders for the 4 members of a delegate type :-)
21056         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21057         type.
21059         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21061         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21063 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21065         * statement.cs (Break::Emit): Implement.   
21066         (Continue::Emit): Implement.
21068         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21069         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21070         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21071         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21072         end loop
21074         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21075         properties that track the label for the current loop (begin of the
21076         loop and end of the loop).
21078 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21080         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21081         use of emitting anything at all.
21083         * class.cs, rootcontext.cs : Get rid of calls to the same.
21085         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21087         (Populate): Define the constructor correctly and set the implementation
21088         attributes.
21090         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21091         have been defined.
21093         (AddDelegateType): Implement.
21095         (IsDelegateType): Implement helper method.
21097         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21099         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21100         and accordingly handle it.
21102         * delegate.cs (Populate): Take TypeContainer argument.
21103         Implement bits to define the Invoke method. However, I still haven't figured out
21104         how to take care of the native int bit :-(
21106         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21107         Qualify the name of the delegate, not its return type !
21109         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21110         conversion.
21112         (StandardConversionExists): Checking for array types turns out to be recursive.
21114         (ConvertReferenceExplicit): Implement array conversion.
21116         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21118 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21120         * cs-parser.jay (delegate_declaration): Store the fully qualified
21121         name as it is a type declaration.
21123         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21124         readonly.
21126         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21127         as TypeContainer::DefineType.
21129         (Populate): Method in which all the definition of the various methods (Invoke)
21130         etc is done.
21132         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21133         see.
21135         (CloseDelegate): Finally creates the delegate.
21137         * class.cs (TypeContainer::DefineType): Update to define delegates.
21138         (Populate, Emit and CloseType): Do the same thing here too.
21140         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21141         delegates in all these operations.
21143 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21145         * expression.cs: LocalTemporary: a new expression used to
21146         reference a temporary that has been created.
21148         * assign.cs: Handle PropertyAccess back here, so that we can
21149         provide the proper semantic access to properties.
21151         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21152         a few more explicit conversions. 
21154         * modifiers.cs: `NEW' modifier maps to HideBySig.
21156         * expression.cs (PropertyExpr): Make this into an
21157         ExpressionStatement, and support the EmitStatement code path. 
21159         Perform get/set error checking, clean up the interface.
21161         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21162         them into toplevel access objects.
21164 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21166         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21167         SRE.
21169         * typemanager.cs: Keep track here of our PropertyBuilders again to
21170         work around lameness in SRE.
21172 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21174         * expression.cs (LValue::LValueResolve): New method in the
21175         interface, used to perform a second resolution pass for LValues. 
21177         (This::DoResolve): Catch the use of this in static methods.
21179         (This::LValueResolve): Implement.
21181         (This::Store): Remove warning, assigning to `this' in structures
21182         is 
21184         (Invocation::Emit): Deal with invocation of
21185         methods on value types.  We need to pass the address to structure
21186         methods rather than the object itself.  (The equivalent code to
21187         emit "this" for structures leaves the entire structure on the
21188         stack instead of a pointer to it). 
21190         (ParameterReference::DoResolve): Compute the real index for the
21191         argument based on whether the method takes or not a `this' pointer
21192         (ie, the method is static).
21194         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21195         value types returned from functions when we need to invoke a
21196         method on the sturcture.
21199 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21201         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21202         defining the type in the Modulebuilder or Typebuilder. This is to take
21203         care of nested types which need to be defined on the TypeBuilder using
21204         DefineNestedMethod.
21206         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21207         methods in RootContext, only ported to be part of TypeContainer.
21209         (TypeContainer::GetInterfaceOrClass): Ditto.
21211         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21213         * interface.cs (Interface::DefineInterface): New method. Does exactly
21214         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21215         too.
21217         (Interface::GetInterfaces): Move from RootContext here and port.
21219         (Interface::GetInterfaceByName): Same here.
21221         * rootcontext.cs (ResolveTree): Re-write.
21223         (PopulateTypes): Re-write.
21225         * class.cs (TypeContainer::Populate): Populate nested types too.
21226         (TypeContainer::Emit): Emit nested members too.
21228         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21229         instead just use the name argument passed in as it is already fully
21230         qualified.
21232         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21233         to TypeContainer mapping to see if a type is user-defined.
21235         * class.cs (TypeContainer::CloseType): Implement. 
21237         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21238         the default constructor.
21240         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21241         twice.
21243         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21245         * interface.cs (CloseType): Create the type here.
21247         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21248         the hierarchy.
21250         Remove all the methods which are now in TypeContainer.
21252 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21254         * delegate.cs (Define): Re-write bits to define the delegate
21255         correctly.
21257 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21259         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21261         * expression.cs (ImplicitReferenceConversion): handle null as well
21262         as a source to convert to any reference type.
21264         * statement.cs (Return): Perform any implicit conversions to
21265         expected return type.  
21267         Validate use of return statement.  
21269         * codegen.cs (EmitContext): Pass the expected return type here.
21271         * class.cs (Method, Constructor, Property): Pass expected return
21272         type to EmitContext.
21274 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21276         * expression.cs: Make DoResolve take an EmitContext instead of a
21277         TypeContainer.
21279         Replaced `l' and `location' for `loc', for consistency.
21281         (Error, Warning): Remove unneeded Tc argument.
21283         * assign.cs, literal.cs, constant.cs: Update to new calling
21284         convention. 
21286         * codegen.cs: EmitContext now contains a flag indicating whether
21287         code is being generated in a static method or not.
21289         * cs-parser.jay: DecomposeQI, new function that replaces the old
21290         QualifiedIdentifier.  Now we always decompose the assembled
21291         strings from qualified_identifier productions into a group of
21292         memberaccesses.
21294 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21296         * rootcontext.cs: Deal with field-less struct types correctly now
21297         by passing the size option to Define Type.
21299         * class.cs: Removed hack that created one static field. 
21301 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21303         * statement.cs: Moved most of the code generation here. 
21305 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21307         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21308         seem very right.
21310         (ElementAccess): Remove useless bits for now - keep checks as the spec
21311         says.
21313 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21315         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21316         and start performing checks according to the spec.
21318 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21320         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21321         rank_specifiers instead.
21323         (rank_specifiers): Change the order in which the rank specifiers are stored
21325         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21327         * expression.cs (ElementAccess): Implement the LValue interface too.
21329 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21331         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21332         except that user defined conversions are not included.
21334         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21335         perform the conversion of the return type, if necessary.
21337         (New::DoResolve): Check whether we are creating an array or an object
21338         and accordingly do the needful.
21340         (New::Emit): Same here.
21342         (New::DoResolve): Implement guts of array creation.
21344         (New::FormLookupType): Helper function.
21346 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21348         * codegen.cs: Removed most of the code generation here, and move the
21349         corresponding code generation bits to the statement classes. 
21351         Added support for try/catch/finalize and throw.
21353         * cs-parser.jay: Added support for try/catch/finalize.
21355         * class.cs: Catch static methods having the flags override,
21356         virtual or abstract.
21358         * expression.cs (UserCast): This user cast was not really doing
21359         what it was supposed to do.  Which is to be born in fully resolved
21360         state.  Parts of the resolution were being performed at Emit time! 
21362         Fixed this code.
21364 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21366         * expression.cs: Implicity convert the result from UserCast.
21368 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21370         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21371         prevented it from working correctly. 
21373         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21374         merely ConvertImplicit.
21376 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21378         * typemanager.cs: Make the LookupTypeContainer function static,
21379         and not per-instance.  
21381         * class.cs: Make static FindMembers (the one that takes a Type
21382         argument). 
21384         * codegen.cs: Add EmitForeach here.
21386         * cs-parser.jay: Make foreach a toplevel object instead of the
21387         inline expansion, as we need to perform semantic analysis on it. 
21389 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21391         * expression.cs (Expression::ImplicitUserConversion): Rename to
21392         UserDefinedConversion.
21394         (Expression::UserDefinedConversion): Take an extra argument specifying 
21395         whether we look for explicit user conversions too.
21397         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21399         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21401         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21402         with the appropriate arguments.
21404         * cs-parser.jay (cast_expression): Record location too.
21406         * expression.cs (Cast): Record location info.
21408         (Expression::ConvertExplicit): Take location argument.
21410         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21411         to determine if we are doing explicit conversions.
21413         (UserCast::Emit): Update accordingly.
21415         (Expression::ConvertExplicit): Report an error if everything fails.
21417         * ../errors/cs0030.cs : Add.
21419 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21421         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21422         virtual and newslot bits. 
21424         * class.cs (TypeContainer::RegisterRequiredImplementations):
21425         Record methods we need.
21427         (TypeContainer::MakeKey): Helper function to make keys for
21428         MethodBases, since the Methodbase key is useless.
21430         (TypeContainer::Populate): Call RegisterRequiredImplementations
21431         before defining the methods.   
21433         Create a mapping for method_builders_to_methods ahead of time
21434         instead of inside a tight loop.
21436         (::RequireMethods):  Accept an object as the data to set into the
21437         hashtable so we can report interface vs abstract method mismatch.
21439 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21441         * report.cs: Make all of it static.
21443         * rootcontext.cs: Drop object_type and value_type computations, as
21444         we have those in the TypeManager anyways.
21446         Drop report instance variable too, now it is a global.
21448         * driver.cs: Use try/catch on command line handling.
21450         Add --probe option to debug the error reporting system with a test
21451         suite. 
21453         * report.cs: Add support for exiting program when a probe
21454         condition is reached.
21456 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21458         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21459         we do a forcible conversion regardless of type, to check if 
21460         ForceConversion returns a null.
21462         (Binary::error19): Use location to report error.
21464         (Unary::error23): Use location here too.
21466         * ../errors/cs0019.cs : Check in.
21468         * ../errors/cs0023.cs : Check in.
21470         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21471         case of a non-null MethodInfo object with a length of 0 !
21473         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21474         an applicable member - according to the spec :-)
21475         Also fix logic to find members in base types.
21477         (Unary::ResolveOperator): Same here.
21479         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21480         as I was getting thoroughly confused between this and error19 :-)
21482         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21483         (::FindMostEncompassedType): Implement.
21484         (::FindMostEncompassingType): Implement.
21485         (::StandardConversionExists): Implement.
21487         (UserImplicitCast): Re-vamp. We now need info about most specific
21488         source and target types so that we can do the necessary conversions.
21490         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21491         mathematical union with no duplicates.
21493 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21495         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21496         in order from base classes to child classes, so that we can in
21497         child classes look up in our parent for method names and
21498         attributes (required for handling abstract, virtual, new, override
21499         constructs: we need to instrospect our base class, and if we dont
21500         populate the classes in order, the introspection might be
21501         incorrect.  For example, a method could query its parent before
21502         the parent has any methods and would determine that the parent has
21503         no abstract methods (while it could have had them)).
21505         (RootContext::CreateType): Record the order in which we define the
21506         classes.
21508 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21510         * class.cs (TypeContainer::Populate): Also method definitions can
21511         fail now, keep track of this.
21513         (TypeContainer::FindMembers): Implement support for
21514         DeclaredOnly/noDeclaredOnly flag.
21516         (Constructor::Emit) Return the ConstructorBuilder.
21518         (Method::Emit) Return the MethodBuilder. 
21519         Check for abstract or virtual methods to be public.
21521         * rootcontext.cs (RootContext::CreateType): Register all the
21522         abstract methods required for the class to be complete and the
21523         interface methods that must be implemented. 
21525         * cs-parser.jay: Report error 501 (method requires body if it is
21526         not marked abstract or extern).
21528         * expression.cs (TypeOf::Emit): Implement.
21530         * typemanager.cs: runtime_handle_type, new global type.
21532         * class.cs (Property::Emit): Generate code for properties.
21534 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21536         * expression.cs (Unary::ResolveOperator): Find operators on base type
21537         too - we now conform exactly to the spec.
21539         (Binary::ResolveOperator): Same here.
21541         * class.cs (Operator::Define): Fix minor quirk in the tests.
21543         * ../errors/cs0215.cs : Added.
21545         * ../errors/cs0556.cs : Added.
21547         * ../errors/cs0555.cs : Added.
21549 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21551         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21552         single integer which is really efficient
21554 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21556         *  expression.cs (Expression::ImplicitUserConversion): Use location
21557         even in the case when we are examining True operators.
21559         * class.cs (Operator::Define): Perform extensive checks to conform
21560         with the rules for operator overloading in the spec.
21562         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21563         some of the other conversions mentioned in the spec.
21565         * typemanager.cs (array_type): New static member for the System.Array built-in
21566         type.
21568         (cloneable_interface): For System.ICloneable interface.
21570         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21571         we start resolving the tree and populating types.
21573         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21575 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21577         * expression.cs (Expression::ExprClassFromMemberInfo,
21578         Expression::Literalize): Create literal expressions from
21579         FieldInfos which are literals.
21581         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21582         type casts, because they were wrong.  The test suite in tests
21583         caught these ones.
21585         (ImplicitNumericConversion): ushort to ulong requires a widening
21586         cast. 
21588         Int32 constant to long requires widening cast as well.
21590         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21591         for integers because the type on the stack is not i4.
21593 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21595         * expression.cs (report118): require location argument. 
21597         * parameter.cs: Do not dereference potential null value.
21599         * class.cs: Catch methods that lack the `new' keyword when
21600         overriding a name.  Report warnings when `new' is used without
21601         anything being there to override.
21603         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21605         * class.cs: Only add constructor to hashtable if it is non-null
21606         (as now constructors can fail on define).
21608         (TypeManager, Class, Struct): Take location arguments.
21610         Catch field instance initialization in structs as errors.
21612         accepting_filter: a new filter for FindMembers that is static so
21613         that we dont create an instance per invocation.
21615         (Constructor::Define): Catch errors where a struct constructor is
21616         parameterless 
21618         * cs-parser.jay: Pass location information for various new
21619         constructs. 
21621         * delegate.cs (Delegate): take a location argument.
21623         * driver.cs: Do not call EmitCode if there were problesm in the
21624         Definition of the types, as many Builders wont be there. 
21626         * decl.cs (Decl::Decl): Require a location argument.
21628         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21629         into integers, and find the most appropiate integer for it.
21631         * literal.cs: Implement ULongLiteral.
21633         * rootcontext.cs: Provide better information about the location of
21634         failure when CreateType fails.
21636 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21638         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21639         as well.
21641         * expression.cs (Binary::CheckShiftArguments): Add missing type
21642         computation.
21643         (Binary::ResolveOperator): Add type to the logical and and logical
21644         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21645         before.
21647         (Binary::DoNumericPromotions): In the case where either argument
21648         is ulong (and most signed types combined with ulong cause an
21649         error) perform implicit integer constant conversions as well.
21651 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21653         * expression.cs (UserImplicitCast): Method should always be
21654         non-null. 
21655         (Invocation::BetterConversion): Simplified test for IntLiteral.
21657         (Expression::ImplicitNumericConversion): Split this routine out.
21658         Put the code that performs implicit constant integer conversions
21659         here. 
21661         (Expression::Resolve): Become a wrapper around DoResolve so we can
21662         check eclass and type being set after resolve.
21664         (Invocation::Badness): Remove this dead function
21666         (Binary::ResolveOperator): Do not compute the expensive argumnets
21667         unless we have a union for it.
21669         (Probe::Emit): Is needs to do an isinst and then
21670         compare against null.
21672         (::CanConvert): Added Location argument.  If the Location argument
21673         is null (Location.Null), then we do not report errors.  This is
21674         used by the `probe' mechanism of the Explicit conversion.  We do
21675         not want to generate an error for something that the user
21676         explicitly requested to be casted.  But the pipeline for an
21677         explicit cast first tests for potential implicit casts.
21679         So for now, if the Location is null, it means `Probe only' to
21680         avoid adding another argument.   Might have to revise this
21681         strategy later.
21683         (ClassCast): New class used to type cast objects into arbitrary
21684         classes (used in Explicit Reference Conversions).
21686         Implement `as' as well.
21688         Reverted all the patches from Ravi below: they were broken:
21690                 * The use of `level' as a mechanism to stop recursive
21691                   invocations is wrong.  That was there just to catch the
21692                   bug with a strack trace but not as a way of addressing
21693                   the problem.
21695                   To fix the problem we have to *understand* what is going
21696                   on and the interactions and come up with a plan, not
21697                   just get things going.
21699                 * The use of the type conversion cache that I proposed
21700                   last night had an open topic: How does this work across
21701                   protection domains.  A user defined conversion might not
21702                   be public in the location where we are applying the
21703                   conversion, a different conversion might be selected
21704                   (ie, private A->B (better) but public B->A (worse),
21705                   inside A, A->B applies, but outside it, B->A will
21706                   apply).
21708                 * On top of that (ie, even if the above is solved),
21709                   conversions in a cache need to be abstract.  Ie, `To
21710                   convert from an Int to a Short use an OpcodeCast', not
21711                   `To convert from an Int to a Short use the OpcodeCast on
21712                   the variable 5' (which is what this patch was doing).
21714 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21716         * expression.cs (Invocation::ConversionExists): Re-write to use
21717         the conversion cache
21719         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21720         cache all conversions done, not just user-defined ones.
21722         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21723         to determine if a conversion exists instead of acutually trying to 
21724         perform the conversion. It's faster too.
21726         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21727         and only then attempt the implicit conversion.
21729 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21731         * expression.cs (ConvertImplicit): Use a cache for conversions
21732         already found. Check level of recursion and bail out if necessary.
21734 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21736         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21737         Export standard methods that we expect for string operations.
21739         * statement.cs (Block::UsageWarning): Track usage of variables and
21740         report the errors for not used variables.
21742         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21743         operator. 
21745 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21747         * codegen.cs: remove unnneded code 
21749         * expression.cs: Removed BuiltinTypeAccess class
21751         Fix the order in which implicit conversions are
21752         done.  
21754         The previous fixed dropped support for boxed conversions (adding a
21755         test to the test suite now)
21757         (UserImplicitCast::CanConvert): Remove test for source being null,
21758         that code is broken.  We should not feed a null to begin with, if
21759         we do, then we should track the bug where the problem originates
21760         and not try to cover it up here.
21762         Return a resolved expression of type UserImplicitCast on success
21763         rather than true/false.  Ravi: this is what I was talking about,
21764         the pattern is to use a static method as a "constructor" for
21765         objects. 
21767         Also, do not create arguments until the very last minute,
21768         otherwise we always create the arguments even for lookups that
21769         will never be performed. 
21771         (UserImplicitCast::Resolve): Eliminate, objects of type
21772         UserImplicitCast are born in a fully resolved state. 
21774         * typemanager.cs (InitCoreTypes): Init also value_type
21775         (System.ValueType). 
21777         * expression.cs (Cast::Resolve): First resolve the child expression.
21779         (LValue): Add new method AddressOf to be used by
21780         the `&' operator.  
21782         Change the argument of Store to take an EmitContext instead of an
21783         ILGenerator, because things like FieldExpr need to be able to call
21784         their children expression to generate the instance code. 
21786         (Expression::Error, Expression::Warning): Sugar functions for
21787         reporting errors.
21789         (Expression::MemberLookup): Accept a TypeContainer instead of a
21790         Report as the first argument.
21792         (Expression::ResolvePrimary): Killed.  I still want to improve
21793         this as currently the code is just not right.
21795         (Expression::ResolveMemberAccess): Simplify, but it is still
21796         wrong. 
21798         (Unary::Resolve): Catch errors in AddressOf operators.
21800         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21801         index to a byte for the short-version, or the compiler will choose
21802         the wrong Emit call, which generates the wrong data.
21804         (ParameterReference::Emit, ::Store): same.
21806         (FieldExpr::AddressOf): Implement.
21808         * typemanager.cs: TypeManager: made public variable instead of
21809         property.
21811         * driver.cs: document --fatal.
21813         * report.cs (ErrorMessage, WarningMessage): new names for the old
21814         Error and Warning classes.
21816         * cs-parser.jay (member_access): Turn built-in access to types
21817         into a normal simplename
21819 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21821         * expression.cs (Invocation::BetterConversion): Fix to cope
21822         with q being null, since this was introducing a bug.
21824         * expression.cs (ConvertImplicit): Do built-in conversions first.
21826 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21828         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21830 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21832         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21833         I had introduced long ago (what's new ?).
21835         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21836         the work of all the checking. 
21837         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21838         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21840         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21841         that is the right way. 
21843         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21844         overloading resolution. Use everywhere instead of cutting and pasting code.
21846         (Binary::ResolveOperator): Use MakeUnionSet.
21848         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21849         we have to convert to bool types. Not complete yet.
21851 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21853         * typemanager.cs (TypeManager::CSharpName): support ushort.
21855         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21856         to provide an expression that performsn an implicit constant int
21857         conversion (section 6.1.6).
21858         (Expression::ConvertImplicitRequired): Reworked to include
21859         implicit constant expression conversions.
21861         (Expression::ConvertNumericExplicit): Finished.
21863         (Invocation::Emit): If InstanceExpression is null, then it means
21864         that we perform a call on this.
21866 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21868         * expression.cs (Unary::Emit): Remove some dead code.
21869         (Probe): Implement Resolve and Emit for `is'.
21870         (Expression::ConvertImplicitRequired): Attempt to do constant
21871         expression conversions here.  Maybe should be moved to
21872         ConvertImplicit, but I am not sure.
21873         (Expression::ImplicitLongConstantConversionPossible,
21874         Expression::ImplicitIntConstantConversionPossible): New functions
21875         that tell whether is it possible to apply an implicit constant
21876         expression conversion.
21878         (ConvertNumericExplicit): Started work on explicit numeric
21879         conversions.
21881         * cs-parser.jay: Update operator constants.
21883         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21884         (Parameters::GetSignature): Hook up VerifyArgs here.
21885         (Parameters::VerifyArgs): Verifies that no two arguments have the
21886         same name. 
21888         * class.cs (Operator): Update the operator names to reflect the
21889         ones that the spec expects (as we are just stringizing the
21890         operator names).
21892         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21893         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21894         previous usage did only work for our methods.
21895         (Expression::ConvertImplicit): Handle decimal implicit numeric
21896         conversions as well.
21897         (Expression::InternalTypeConstructor): Used to invoke constructors
21898         on internal types for default promotions.
21900         (Unary::Emit): Implement special handling for the pre/post
21901         increment/decrement for overloaded operators, as they need to have
21902         the same semantics as the other operators.
21904         (Binary::ResolveOperator): ditto.
21905         (Invocation::ConversionExists): ditto.
21906         (UserImplicitCast::Resolve): ditto.
21908 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21910         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21911         operator, return after emitting body. Regression tests pass again !
21913         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21914         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21915         (Invocation::OverloadResolve): Ditto.
21916         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21918         * everywhere : update calls to the above methods accordingly.
21920 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21922         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21924         * expression.cs (ExpressionStatement): New base class used for
21925         expressions that can appear in statements, so that we can provide
21926         an alternate path to generate expression that do not leave a value
21927         on the stack.
21929         (Expression::Emit, and all the derivatives): We no longer return
21930         whether a value is left on the stack or not.  Every expression
21931         after being emitted leaves a single value on the stack.
21933         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21934         facilties of ExpressionStatement if possible.
21936         * cs-parser.jay: Update statement_expression.
21938 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21940         * driver.cs: Change the wording of message
21942 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21944         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21945         the type of the expression to the return type of the method if
21946         we have an overloaded operator match ! The regression tests pass again !
21947         (Unary::ResolveOperator): Ditto.
21949         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21950         to find "op_Implicit", not "implicit" ;-)
21951         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21952         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21954         * everywhere : Correct calls to the above accordingly.
21956         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21957         (ConvertImplicit): Do user-defined conversion if it exists.
21959 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21961         * assign.cs: track location.
21962         (Resolve): Use implicit conversions on assignment.
21964         * literal.cs: Oops.  Not good, Emit of short access values should
21965         pass (Bytes) or the wrong argument will be selected.
21967         * expression.cs (Unary::Emit): Emit code for -expr.
21969         (Unary::ResolveOperator): Handle `Substract' for non-constants
21970         (substract from zero from the non-constants).
21971         Deal with Doubles as well. 
21973         (Expression::ConvertImplicitRequired): New routine that reports an
21974         error if no implicit conversion exists. 
21976         (Invocation::OverloadResolve): Store the converted implicit
21977         expressions if we make them
21979 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21981         * class.cs (ConstructorInitializer): Take a Location argument.
21982         (ConstructorBaseInitializer): Same here.
21983         (ConstructorThisInitializer): Same here.
21985         * cs-parser.jay : Update all calls accordingly.
21987         * expression.cs (Unary, Binary, New): Take location argument.
21988         Update accordingly everywhere.
21990         * cs-parser.jay : Update all calls to the above to take a location
21991         argument.
21993         * class.cs : Ditto.
21995 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21997         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21998         (Invocation::BetterConversion): Same here
21999         (Invocation::ConversionExists): Ditto.
22001         (Invocation::ConversionExists): Implement.
22003 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22005         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22006         Also take an additional TypeContainer argument.
22008         * All over : Pass in TypeContainer as argument to OverloadResolve.
22010         * typemanager.cs (CSharpName): Update to check for the string type and return
22011         that too.
22013         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22014         a given method.
22016 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22018         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22019         (Invocation::BetterFunction): Implement.
22020         (Invocation::BetterConversion): Implement.
22021         (Invocation::ConversionExists): Skeleton, no implementation yet.
22023         Okay, things work fine !
22025 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22027         * typemanager.cs: declare and load enum_type, delegate_type and
22028         void_type. 
22030         * expression.cs (Expression::Emit): Now emit returns a value that
22031         tells whether a value is left on the stack or not.  This strategy
22032         might be reveted tomorrow with a mechanism that would address
22033         multiple assignments.
22034         (Expression::report118): Utility routine to report mismatches on
22035         the ExprClass.
22037         (Unary::Report23): Report impossible type/operator combination
22038         utility function.
22040         (Unary::IsIncrementableNumber): Whether the type can be
22041         incremented or decremented with add.
22042         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22043         complemented. 
22044         (Unary::ResolveOperator): Implement ++, !, ~,
22046         (Invocation::Emit): Deal with new Emit convetion.
22048         * All Expression derivatives: Updated their Emit method to return
22049         whether they leave values on the stack or not.
22051         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22052         stack for expressions that are statements. 
22054 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22056         * expression.cs (LValue): New interface.  Must be implemented by
22057         LValue objects.
22058         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22059         LValue interface.
22061         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22062         interface for generating code, simplifies the code.
22064 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22066         * expression.cs (everywhere): Comment out return statements in ::Resolve
22067         methods to avoid the warnings.
22069 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22071         * driver.cs (parse): Report error 2001 if we can not open the
22072         source file.
22074         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22075         not resolve it.
22077         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22078         object. 
22080         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22081         otherwise nested blocks end up with the same index.
22083         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22085         * expression.cs:  Instead of having FIXMEs in the Resolve
22086         functions, throw exceptions so it is obvious that we are facing a
22087         bug. 
22089         * cs-parser.jay (invocation_expression): Pass Location information.
22091         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22092         Use a basename for those routines because .NET does not like paths
22093         on them. 
22095         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22096         already defined.
22098 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22100         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22101         are loading the correct data types (throws an exception if not).
22102         (TypeManager::InitCoreTypes): Use CoreLookupType
22104         * expression.cs (Unary::ResolveOperator): return the child
22105         expression for expressions which are just +expr.
22106         (Unary::ResolveOperator): Return negative literals for -LITERAL
22107         expressions (otherwise they are Unary {Literal}).
22108         (Invocation::Badness): Take into account `Implicit constant
22109         expression conversions'.
22111         * literal.cs (LongLiteral): Implement long literal class.
22112         (IntLiteral): export the `Value' of the intliteral. 
22114 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22116         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22118         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22119         instead of 'Operator'
22121         * expression.cs (Binary::ResolveOperator): Update accordingly.
22122         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22123         and 'Minus'
22125         * cs-parser.jay (unary_expression): Update to use the new names.
22127         * gen-treedump.cs (GetUnary): Same here.
22129         * expression.cs (Unary::Resolve): Implement.
22130         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22131         operators are found instead of making noise ;-)
22132         (Unary::ResolveOperator): New method to do precisely the same thing which
22133         Binary::ResolveOperator does for Binary expressions.
22134         (Unary.method, .Arguments): Add.
22135         (Unary::OperName): Implement.   
22136         (Unary::ForceConversion): Copy and Paste !
22138         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22139         a unary operator.
22141         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22142         for the inbuilt operators. Only overloading works for now ;-)
22144 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22146         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22147         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22149         * expression.cs (This::Emit): Implement. 
22150         (This::Resolve): Implement.
22151         (TypeOf:Resolve): Implement.
22152         (Expression::ResolveSimpleName): Add an implicit this to instance
22153         field references. 
22154         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22155         Bind instance variable to Field expressions.
22156         (FieldExpr::Instance): New field used to track the expression that
22157         represents the object instance.
22158         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22159         binding 
22160         (FieldExpr::Emit): Implement.
22162         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22163         the last instruction contains a return opcode to avoid generating
22164         the last `ret' instruction (this generates correct code, and it is
22165         nice to pass the peverify output).
22167         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22168         initializer for static and instance variables.
22169         (Constructor::Emit): Allow initializer to be null in the case of
22170         static constructors.  Only emit initializer for instance
22171         constructors. 
22173         (TypeContainer::FindMembers): Return a null array if there are no
22174         matches.
22176         Also fix the code for the MemberTypes.Method branch, as it was not
22177         scanning that for operators (or tried to access null variables before).
22179         * assign.cs (Assign::Emit): Handle instance and static fields. 
22181         * TODO: Updated.
22183         * driver.cs: Stop compilation if there are parse errors.
22185         * cs-parser.jay (constructor_declaration): Provide default base
22186         initializer for non-static constructors.
22187         (constructor_declarator): Do not provide a default base
22188         initializers if none was specified.
22189         Catch the fact that constructors should not have parameters.
22191         * class.cs: Do not emit parent class initializers for static
22192         constructors, that should be flagged as an error.
22194 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22196         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22197         Move back code into TypeContainer::Populate.
22199 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22201         * class.cs (TypeContainer::AddConstructor): Fix the check to
22202         compare against Name, not Basename. 
22203         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22205         * cs-parser.jay : Update accordingly.
22207         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22208         for methods, don't forget to look into the operators too.
22209         (RegisterMethodBuilder): Helper method to take care of this for
22210         methods, constructors and operators.
22211         (Operator::Define): Completely revamp.
22212         (Operator.OperatorMethod, MethodName): New fields.
22213         (TypeContainer::Populate): Move the registering of builders into
22214         RegisterMethodBuilder.
22215         (Operator::Emit): Re-write.
22217         * expression.cs (Binary::Emit): Comment out code path to emit method
22218         invocation stuff for the case when we have a user defined operator. I am
22219         just not able to get it right !
22221 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22223         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22224         argument. 
22226         (Expression::MemberLookup): Provide a version that allows to
22227         specify the MemberTypes and BindingFlags. 
22229         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22230         so it was not fetching variable information from outer blocks.
22232         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22233         Beforefieldinit as it was buggy.
22235         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22236         that Ravi put here.  
22238         * class.cs (Constructor::Emit): Only emit if block is not null.
22239         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22240         deal with this by semantically definining it as if the user had
22241         done it.
22243         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22244         constructors as we now "emit" them at a higher level.
22246         (TypeContainer::DefineDefaultConstructor): Used to define the
22247         default constructors if none was provided.
22249         (ConstructorInitializer): Add methods Resolve and Emit. 
22251         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22253 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22255         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22256         the default constructor builder with our hashtable for methodbuilders
22257         to methodcores.
22259         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22260         and argument_count is 0 in which case we have a match.
22261         (Binary::ResolveOperator): More null checking and miscellaneous coding
22262         style cleanup.
22264 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22266         * rootcontext.cs (IsNameSpace): Compare against null.
22268         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22270         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22271         and Unary::Operator.
22273         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22274         accordingly.
22276         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22277         we have overloaded operators.
22278         (Binary::ResolveOperator): Implement the part which does the operator overload
22279         resolution.
22281         * class.cs (Operator::Emit): Implement.
22282         (TypeContainer::Emit): Emit the operators we have too.
22284         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22285         the case when we have a user-defined operator.
22287 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22289         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22291 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22293         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22294         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22295         (Constructor::Emit): Implement.
22296         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22297         if we have no work to do. 
22298         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22299         Emit method.
22301         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22302         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22304         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22305         of parent.parent.
22307 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22309         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22310         in the source.
22311         (Tree::RecordNamespace): Method to do what the name says ;-)
22312         (Tree::Namespaces): Property to get at the namespaces hashtable.
22314         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22315         keep track.
22317         * rootcontext.cs (IsNamespace): Fixed it :-)
22319 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22321         * class.cs (TypeContainer::FindMembers): Add support for
22322         constructors. 
22323         (MethodCore): New class that encapsulates both the shared aspects
22324         of a Constructor and a Method.  
22325         (Method, Constructor): Factored pieces into MethodCore.
22327         * driver.cs: Added --fatal which makes errors throw exceptions.
22328         Load System assembly as well as part of the standard library.
22330         * report.cs: Allow throwing exceptions on errors for debugging.
22332         * modifiers.cs: Do not use `parent', instead use the real type
22333         container to evaluate permission settings.
22335         * class.cs: Put Ravi's patch back in.  He is right, and we will
22336         have to cope with the
22338 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22340         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22341         FamORAssem, not FamANDAssem.
22343 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22345         * driver.cs: Added --parse option that only parses its input files
22346         and terminates.
22348         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22349         incorrect.  IsTopLevel is not used to tell whether an object is
22350         root_types or not (that can be achieved by testing this ==
22351         root_types).  But to see if this is a top-level *class* (not
22352         necessarly our "toplevel" container). 
22354 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22356         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22357         parent instead of a direct call to GetType.
22359 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22361         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22362         Modifiers.TypeAttr. This should just be a call to that method.
22364         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22365         object so that we can determine if we are top-level or not.
22367         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22368         TypeContainer too.
22370         * enum.cs (Enum::Define): Ditto.
22372         * modifiers.cs (FieldAttr): Re-write.
22374         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22375         (TypeContainer::HaveStaticConstructor): New property to provide access
22376         to precisely that info.
22378         * modifiers.cs (MethodAttr): Re-write.
22379         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22381         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22382         of top-level types as claimed.
22384 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22386         * expression.cs (MemberLookup): Fruitless attempt to lookup
22387         constructors.  Maybe I need to emit default constructors?  That
22388         might be it (currently .NET emits this for me automatically).
22389         (Invocation::OverloadResolve): Cope with Arguments == null.
22390         (Invocation::EmitArguments): new function, shared by the new
22391         constructor and us.
22392         (Invocation::Emit): Handle static and instance methods.  Emit
22393         proper call instruction for virtual or non-virtual invocations.
22394         (New::Emit): Implement.
22395         (New::Resolve): Implement.
22396         (MemberAccess:Resolve): Implement.
22397         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22398         to track instances.
22399         (FieldExpr::Resolve): Set type.
22401         * support.cs: Handle empty arguments.
22402                 
22403         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22404         SimpleLookup): Auxiliary routines to help parse a qualifier
22405         identifier.  
22407         Update qualifier_identifier rule.
22409         * codegen.cs: Removed debugging messages.
22411         * class.cs: Make this a global thing, this acts just as a "key" to
22412         objects that we might have around.
22414         (Populate): Only initialize method_builders_to_methods once.
22416         * expression.cs (PropertyExpr): Initialize type from the
22417         PropertyType. 
22419         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22420         Resolve pattern.  Attempt to implicitly convert value to boolean.
22421         Emit code.
22423         * expression.cs: Set the type for the int32/int32 argument case.
22424         (Binary::ResolveOperator): Set the return type to boolean for
22425         comparission operators
22427         * typemanager.cs: Remove debugging print code.
22429         (Invocation::Resolve): resolve type.
22431         * class.cs: Allocate a MemberInfo of the correct size, as the code
22432         elsewhere depends on the test to reflect the correct contents.
22434         (Method::) Keep track of parameters, due to System.Reflection holes
22436         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22437         mapping here.
22439         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22440         of the exact size and return that.
22442         (Class::LookupMethodByBuilder): New function that maps
22443         MethodBuilders to its methods.  Required to locate the information
22444         on methods because System.Reflection bit us again.
22446         * support.cs: New file, contains an interface ParameterData and
22447         two implementations: ReflectionParameters and InternalParameters
22448         used to access Parameter information.  We will need to grow this
22449         as required.
22451         * expression.cs (Invocation::GetParameterData): implement a cache
22452         and a wrapper around the ParameterData creation for methods. 
22453         (Invocation::OverloadResolve): Use new code.
22455 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22457         * class.cs (TypeContainer::EmitField): Remove and move into 
22458         (Field::Define): here and modify accordingly.
22459         (Field.FieldBuilder): New member.
22460         (TypeContainer::Populate): Update accordingly.
22461         (TypeContainer::FindMembers): Implement.
22463 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22465         * statement.cs: (VariableInfo::VariableType): New field to be
22466         initialized with the full type once it is resolved. 
22468 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22470         * parameter.cs (GetParameterInfo): Use a type cache to compute
22471         things only once, and to reuse this information
22473         * expression.cs (LocalVariableReference::Emit): Implement.
22474         (OpcodeCast::Emit): fix.
22476         (ParameterReference::Resolve): Implement.
22477         (ParameterReference::Emit): Implement.
22479         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22480         that are expressions need to stay as Expressions.
22482         * typemanager.cs (CSharpName): Returns the C# name of a type if
22483         possible. 
22485         * expression.cs (Expression::ConvertImplicit): New function that
22486         implements implicit type conversions.
22488         (Expression::ImplicitReferenceConversion): Implements implicit
22489         reference conversions.
22491         (EmptyCast): New type for transparent casts.
22493         (OpcodeCast): New type for casts of types that are performed with
22494         a sequence of bytecodes.
22496         (BoxedCast): New type used for casting value types into reference
22497         types.  Emits a box opcode.
22499         (Binary::DoNumericPromotions): Implements numeric promotions of
22500         and computation of the Binary::Type.
22502         (Binary::EmitBranchable): Optimization.
22504         (Binary::Emit): Implement code emission for expressions.
22506         * typemanager.cs (TypeManager): Added two new core types: sbyte
22507         and byte.
22509 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22511         * class.cs (TypeContainer::FindMembers): Method which does exactly
22512         what Type.FindMembers does, only we don't have to use reflection. No
22513         implementation yet.
22515         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22516         typecontainer objects as we need to get at them.
22517         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22519         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22520         typecontainer object.
22522         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22523         of just a Report object.
22525 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22527         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22528         "remove_"
22529         (TypeContainer::Populate): Now define the delegates of the type too.
22530         (TypeContainer.Delegates): Property to access the list of delegates defined
22531         in the type.
22533         * delegates.cs (Delegate::Define): Implement partially.
22535         * modifiers.cs (TypeAttr): Handle more flags.
22537 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22539         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22540         and not <=
22541         (Operator::Define): Re-write logic to get types by using the LookupType method
22542         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22543         (Indexer::Define): Ditto.
22544         (Event::Define): Ditto.
22545         (Property::Define): Ditto.
22547 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22549         * class.cs (TypeContainer::Populate): Now define operators too. 
22550         (TypeContainer.Operators): New property to access the list of operators
22551         in a type.
22552         (Operator.OperatorMethodBuilder): New member to hold the method builder
22553         for the operator we are defining.
22554         (Operator::Define): Implement.
22556 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22558         * class.cs (Event::Define): Make the prefixes of the accessor methods
22559         addOn_ and removeOn_ 
22561         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22562         of the location being passed in too. Ideally, this should go later since all
22563         error reporting should be done through the Report object.
22565         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22566         (Populate): Iterate thru the indexers we have and define them too.
22567         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22568         for the get and set accessors.
22569         (Indexer::Define): Implement.
22571 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22573         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22574         my previous implementation, did not work.
22576         * typemanager.cs: Add a couple of missing types (the longs).
22578         * literal.cs: Use TypeManager.bool_type instead of getting it.
22580         * expression.cs (EventExpr): New kind of expressions.
22581         (Expressio::ExprClassFromMemberInfo): finish
22583 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22585         * assign.cs: Emit stores to static fields differently.
22587 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22589         * Merge in changes and adjust code to tackle conflicts. Backed out my
22590         code in Assign::Resolve ;-) 
22592 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22594         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22595         instead Report.Error and also pass in the location.
22596         (CSharpParser::Lexer): New readonly property to return the reference
22597         to the Tokenizer object.
22598         (declare_local_variables): Use Report.Error with location instead of plain 
22599         old error.
22600         (CheckDef): Ditto.
22602         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22603         (Operator.CheckBinaryOperator): Ditto.
22605         * cs-parser.jay (operator_declarator): Update accordingly.
22607         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22608         (CheckBinaryOperator): Same here.
22610         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22611         on the name without any prefixes of namespace names etc. This is because we
22612         already might have something already fully qualified like 
22613         'System.Console.WriteLine'
22615         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22617 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22619         * cs-tokenizer.cs (location): Return a string which also contains
22620         the file name.
22622         * expression.cs (ElementAccess): New class for expressions of the
22623         type 'element access.'
22624         (BaseAccess): New class for expressions of the type 'base access.'
22625         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22626         respectively.
22628         * cs-parser.jay (element_access): Implement action.
22629         (base_access): Implement actions.
22630         (checked_expression, unchecked_expression): Implement.
22632         * cs-parser.jay (local_variable_type): Correct and implement.
22633         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22635         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22637         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22638         name and the specifiers.
22640         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22642         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22643         making them all public ;-)
22645         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22646         class anyways.
22648 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22650         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22651         PropertyExprs.
22652         (FieldExpr, PropertyExprs): New resolved expressions.
22653         (SimpleName::MemberStaticCheck): Perform static checks for access
22654         to non-static fields on static methods. Maybe this should be
22655         generalized for MemberAccesses. 
22656         (SimpleName::ResolveSimpleName): More work on simple name
22657         resolution. 
22659         * cs-parser.jay (primary_expression/qualified_identifier): track
22660         the parameter index.
22662         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22663         (EmitContext::EmitBoolExpression): Chain to expression generation
22664         instead of temporary hack.
22665         (::EmitStatementExpression): Put generic expression code generation.
22667         * assign.cs (Assign::Emit): Implement variable assignments to
22668         local variables, parameters and fields.
22670 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22672         * statement.cs (Block::GetVariableInfo): New method, returns the
22673         VariableInfo for a variable name in a block.
22674         (Block::GetVariableType): Implement in terms of GetVariableInfo
22676         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22677         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22679 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22681         * cs-parser.jay (operator_declaration): Continue on my quest : update
22682         to take attributes argument.
22683         (event_declaration): Ditto.
22684         (enum_declaration): Ditto.
22685         (indexer_declaration): Ditto.
22687         * class.cs (Operator::Operator): Update constructor accordingly.
22688         (Event::Event): Ditto.
22690         * delegate.cs (Delegate::Delegate): Same here.
22692         * enum.cs (Enum::Enum): Same here.
22694 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22696         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22698         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22700         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22701         being passed around as an arraylist.
22702         (Attributes::AddAttribute): Method to add attribute sections.
22704         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22705         (struct_declaration): Update accordingly.
22706         (constant_declaration): Update.
22707         (field_declaration): Update.
22708         (method_header): Update.
22709         (fixed_parameter): Update.
22710         (parameter_array): Ditto.
22711         (property_declaration): Ditto.
22712         (destructor_declaration): Ditto.
22714         * class.cs (Struct::Struct): Update constructors accordingly.
22715         (Class::Class): Ditto.
22716         (Field::Field): Ditto.
22717         (Method::Method): Ditto.
22718         (Property::Property): Ditto.
22719         (TypeContainer::OptAttribute): update property's return type.
22721         * interface.cs (Interface.opt_attributes): New member.
22722         (Interface::Interface): Update to take the extra Attributes argument.
22724         * parameter.cs (Parameter::Parameter): Ditto.
22726         * constant.cs (Constant::Constant): Ditto.
22728         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22729         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22730         the attributes as a parameter.
22731         (InterfaceProperty): Update constructor call.
22732         (InterfaceEvent): Ditto.
22733         (InterfaceMethod): Ditto.
22734         (InterfaceIndexer): Ditto.
22736         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22737         pass the attributes too.
22738         (interface_event_declaration): Ditto.
22739         (interface_property_declaration): Ditto.
22740         (interface_method_declaration): Ditto.
22741         (interface_declaration): Ditto.
22743 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22745         * class.cs (Method::Define): Track the "static Main" definition to
22746         create an entry point. 
22748         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22749         EntryPoint if we find it. 
22751         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22752         (EmitContext::ig): Make this variable public.
22754         * driver.cs: Make the default output file be the first file name
22755         with the .exe extension.  
22757         Detect empty compilations
22759         Handle various kinds of output targets.  Handle --target and
22760         rename -t to --dumper.
22762         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22763         methods inherited from Expression return now an Expression.  This
22764         will is used during the tree rewriting as we resolve them during
22765         semantic analysis.
22767         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22768         the spec.  Missing entirely is the information about
22769         accessability of elements of it.
22771         (Expression::ExprClassFromMemberInfo): New constructor for
22772         Expressions that creates a fully initialized Expression based on
22773         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22774         a Type.
22776         (Invocation::Resolve): Begin implementing resolution of invocations.
22778         * literal.cs (StringLiteral):  Implement Emit.
22780 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22782         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22783         member.
22785 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22787         * cs-parser.jay (attribute_arguments): Implement actions.
22788         (attribute): Fix bug in production. Implement action.
22789         (attribute_list): Implement.
22790         (attribute_target): Implement.
22791         (attribute_target_specifier, opt_target_specifier): Implement
22792         (CheckAttributeTarget): New method to check if the attribute target
22793         is valid.
22794         (attribute_section): Implement.
22795         (opt_attributes): Implement.
22797         * attribute.cs : New file to handle attributes.
22798         (Attribute): Class to hold attribute info.
22800         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22801         (attribute_section): Modify production to use 2 different rules to 
22802         achieve the same thing. 1 s/r conflict down !
22803         Clean out commented, useless, non-reducing dimension_separator rules.
22805         * class.cs (TypeContainer.attributes): New member to hold list
22806         of attributes for a type.
22807         (Struct::Struct): Modify to take one more argument, the attribute list.
22808         (Class::Class): Ditto.
22809         (Field::Field): Ditto.
22810         (Method::Method): Ditto.
22811         (Property::Property): Ditto.
22813         * cs-parser.jay (struct_declaration): Update constructor call to
22814         pass in the attributes too.
22815         (class_declaration): Ditto.
22816         (constant_declaration): Ditto.
22817         (field_declaration): Ditto.
22818         (method_header): Ditto.
22819         (fixed_parameter): Ditto.
22820         (parameter_array): Ditto.
22821         (property_declaration): Ditto.
22823         * constant.cs (Constant::Constant): Update constructor similarly.
22824         Use System.Collections.
22826         * parameter.cs (Parameter::Parameter): Update as above.
22828 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22830         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22831         (TypeContainer.delegates): New member to hold list of delegates.
22833         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22834         this time as I seem to be on crack ;-)
22836 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22838         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22839         tell whether an identifier represents a namespace.
22841         * expression.cs (NamespaceExpr): A namespace expression, used only
22842         temporarly during expression resolution.
22843         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22844         utility functions to resolve names on expressions.
22846 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22848         * codegen.cs: Add hook for StatementExpressions. 
22850         * class.cs: Fix inverted test for static flag in methods.
22852 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22854         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22855         to make it coincide with MS' number.
22856         (Operator::CheckBinaryOperator): Ditto.
22858         * ../errors/errors.txt : Remove error numbers added earlier.
22860         * ../errors/cs1019.cs : Test case for error # 1019
22862         * ../errros/cs1020.cs : Test case for error # 1020
22864         * cs-parser.jay : Clean out commented cruft.
22865         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22866         used anywhere - non-reducing rule.
22867         (namespace_declarations): Non-reducing rule - comment out.
22869         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22870         with TypeContainer::AddEnum.
22872         * delegate.cs : New file for delegate handling classes.
22873         (Delegate): Class for declaring delegates.
22875         * makefile : Update.
22877         * cs-parser.jay (delegate_declaration): Implement.
22879 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22881         * class.cs (Event::Define): Implement.
22882         (Event.EventBuilder): New member.
22884         * class.cs (TypeContainer::Populate): Update to define all enums and events
22885         we have.
22886         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22887         readonly fields for all these cases ?
22889 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22891         * class.cs (Property): Revamp to use the convention of making fields readonly.
22892         Accordingly modify code elsewhere.
22894         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22895         the Define method of the Property class.
22897         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22898         trivial bug.
22899         (TypeContainer::Populate): Update to define all the properties we have. Also
22900         define all enumerations.
22902         * enum.cs (Define): Implement.
22904 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22906         * cs-parser.jay (overloadable_operator): The semantic value is an
22907         enum of the Operator class.
22908         (operator_declarator): Implement actions.
22909         (operator_declaration): Implement.
22911         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22912         validity of definitions.
22913         (Operator::CheckBinaryOperator): Static method to check for binary operators
22914         (TypeContainer::AddOperator): New method to add an operator to a type.
22916         * cs-parser.jay (indexer_declaration): Added line to actually call the
22917         AddIndexer method so it gets added ;-)
22919         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22920         already taken care of by the MS compiler ?  
22922 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22924         * class.cs (Operator): New class for operator declarations.
22925         (Operator::OpType): Enum for the various operators.
22927 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22929         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22930         ostensibly handle this in semantic analysis.
22932         * cs-parser.jay (general_catch_clause): Comment out
22933         (specific_catch_clauses, specific_catch_clause): Ditto.
22934         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22935         (catch_args, opt_catch_args): New productions.
22936         (catch_clause): Rewrite to use the new productions above
22937         (catch_clauses): Modify accordingly.
22938         (opt_catch_clauses): New production to use in try_statement
22939         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22940         and re-write the code in the actions to extract the specific and
22941         general catch clauses by being a little smart ;-)
22943         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22944         Hooray, try and catch statements parse fine !
22946 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22948         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22949         string from the hashtable of variables.
22951         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22952         I end up making that mistake ;-)
22953         (catch_clauses): Fixed gross error which made Key and Value of the 
22954         DictionaryEntry the same : $1 !!
22956 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22958         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22960         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22961         when the add and remove accessors are specified. 
22963 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22965         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22966         information about indexer_declarator.
22967         (indexer_declarator): Implement actions.
22968         (parsing_indexer): New local boolean used to keep track of whether
22969         we are parsing indexers or properties. This is necessary because 
22970         implicit_parameters come into picture even for the get accessor in the 
22971         case of an indexer.
22972         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22974         * class.cs (Indexer): New class for indexer declarations.
22975         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22976         (TypeContainer::indexers): New member to hold list of indexers for the
22977         type.
22979 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22981         * cs-parser.jay (add_accessor_declaration): Implement action.
22982         (remove_accessor_declaration): Implement action.
22983         (event_accessors_declaration): Implement
22984         (variable_declarators): swap statements for first rule - trivial.
22986         * class.cs (Event): New class to hold information about event
22987         declarations.
22988         (TypeContainer::AddEvent): New method to add an event to a type
22989         (TypeContainer::events): New member to hold list of events.
22991         * cs-parser.jay (event_declaration): Implement actions.
22993 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22995         * cs-parser.jay (dim_separators): Implement. Make it a string
22996         concatenating all the commas together, just as they appear.
22997         (opt_dim_separators): Modify accordingly
22998         (rank_specifiers): Update accordingly. Basically do the same
22999         thing - instead, collect the brackets here.
23000         (opt_rank_sepcifiers): Modify accordingly.
23001         (array_type): Modify to actually return the complete type string
23002         instead of ignoring the rank_specifiers.
23003         (expression_list): Implement to collect the expressions
23004         (variable_initializer): Implement. We make it a list of expressions
23005         essentially so that we can handle the array_initializer case neatly too.
23006         (variable_initializer_list): Implement.
23007         (array_initializer): Make it a list of variable_initializers
23008         (opt_array_initializer): Modify accordingly.
23010         * expression.cs (New::NType): Add enumeration to help us
23011         keep track of whether we have an object/delegate creation
23012         or an array creation.
23013         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23014         members to hold data about array creation.
23015         (New:New): Modify to update NewType
23016         (New:New): New Overloaded contructor for the array creation
23017         case.
23019         * cs-parser.jay (array_creation_expression): Implement to call
23020         the overloaded New constructor.
23022 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23024         * class.cs (TypeContainer::Constructors): Return member
23025         constructors instead of returning null.
23027 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23029         * typemanager.cs (InitCoreTypes): Initialize the various core
23030         types after we have populated the type manager with the user
23031         defined types (this distinction will be important later while
23032         compiling corlib.dll)
23034         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23035         on Expression Classification.  Now all expressions have a method
23036         `Resolve' and a method `Emit'.
23038         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23039         generation from working.     Also add some temporary debugging
23040         code. 
23042 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23044         * codegen.cs: Lots of code generation pieces.  This is only the
23045         beginning, will continue tomorrow with more touches of polish.  We
23046         handle the fundamentals of if, while, do, for, return.  Others are
23047         trickier and I need to start working on invocations soon.
23049         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23050         s.InitStatement. 
23052         * codegen.cs (EmitContext): New struct, used during code
23053         emission to keep a context.   Most of the code generation will be
23054         here. 
23056         * cs-parser.jay: Add embedded blocks to the list of statements of
23057         this block.  So code generation proceeds in a top down fashion.
23059 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23061         * statement.cs: Add support for multiple child blocks.
23063 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23065         * codegen.cs (EmitCode): New function, will emit the code for a
23066         Block of code given a TypeContainer and its ILGenerator. 
23068         * statement.cs (Block): Standard public readonly optimization.
23069         (Block::Block constructors): Link children. 
23070         (Block::Child): Child Linker.
23071         (Block::EmitVariables): Emits IL variable declarations.
23073         * class.cs: Drop support for MethodGroups here, delay until
23074         Semantic Analysis.
23075         (Method::): Applied the same simplification that I did before, and
23076         move from Properties to public readonly fields.
23077         (Method::ParameterTypes): Returns the parameter types for the
23078         function, and implements a cache that will be useful later when I
23079         do error checking and the semantic analysis on the methods is
23080         performed.
23081         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23082         and made a method, optional argument tells whether this is a class
23083         or a structure to apply the `has-this' bit.
23084         (Method::GetCallingConvention): Implement, returns the calling
23085         convention. 
23086         (Method::Define): Defines the type, a second pass is performed
23087         later to populate the methods.
23089         (Constructor::ParameterTypes): implement a cache similar to the
23090         one on Method::ParameterTypes, useful later when we do semantic
23091         analysis. 
23093         (TypeContainer::EmitMethod):  New method.  Emits methods.
23095         * expression.cs: Removed MethodGroup class from here.
23097         * parameter.cs (Parameters::GetCallingConvention): new method.
23099 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23101         * class.cs (TypeContainer::Populate): Drop RootContext from the
23102         argument. 
23104         (Constructor::CallingConvention): Returns the calling convention.
23105         (Constructor::ParameterTypes): Returns the constructor parameter
23106         types. 
23108         (TypeContainer::AddConstructor): Keep track of default constructor
23109         and the default static constructor.
23111         (Constructor::) Another class that starts using `public readonly'
23112         instead of properties. 
23114         (Constructor::IsDefault): Whether this is a default constructor. 
23116         (Field::) use readonly public fields instead of properties also.
23118         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23119         track of static constructors;  If none is used, turn on
23120         BeforeFieldInit in the TypeAttributes. 
23122         * cs-parser.jay (opt_argument_list): now the return can be null
23123         for the cases where there are no arguments. 
23125         (constructor_declarator): If there is no implicit `base' or
23126         `this', then invoke the default parent constructor. 
23128         * modifiers.cs (MethodAttr): New static function maps a set of
23129         modifiers flags into a MethodAttributes enum
23130         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23131         MethodAttr, TypeAttr to represent the various mappings where the
23132         modifiers are used.
23133         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23135 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23137         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23138         method arguments.
23140         * interface.cs (PopulateIndexer): Implemented the code generator
23141         for interface indexers.
23143 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23145         * interface.cs (InterfaceMemberBase): Now we track the new status
23146         here.  
23148         (PopulateProperty): Implement property population.  Woohoo!  Got
23149         Methods and Properties going today. 
23151         Removed all the properties for interfaces, and replaced them with
23152         `public readonly' fields. 
23154 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23156         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23157         initialize their hashtables/arraylists only when they are needed
23158         instead of doing this always.
23160         * parameter.cs: Handle refs and out parameters.
23162         * cs-parser.jay: Use an ArrayList to construct the arguments
23163         instead of the ParameterCollection, and then cast that to a
23164         Parameter[] array.
23166         * parameter.cs: Drop the use of ParameterCollection and use
23167         instead arrays of Parameters.
23169         (GetParameterInfo): Use the Type, not the Name when resolving
23170         types. 
23172 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23174         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23175         and instead use public readonly fields.
23177         * class.cs: Put back walking code for type containers.
23179 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23181         * class.cs (MakeConstant): Code to define constants.
23183         * rootcontext.cs (LookupType): New function.  Used to locate types 
23186 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23188         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23189         this System.Reflection code is.  Kudos to Microsoft
23191         * typemanager.cs: Implement a type cache and avoid loading all
23192         types at boot time.  Wrap in LookupType the internals.  This made
23193         the compiler so much faster.  Wow.  I rule!
23195         * driver.cs: Make sure we always load mscorlib first (for
23196         debugging purposes, nothing really important).
23198         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23199         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23201         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23202         on namespaces that have been imported using the `using' keyword.
23204         * class.cs (TypeContainer::TypeAttr): Virtualize.
23205         (Class::TypeAttr): Return attributes suitable for this bad boy.
23206         (Struct::TypeAttr): ditto.
23207         Handle nested classes.
23208         (TypeContainer::) Remove all the type visiting code, it is now
23209         replaced with the rootcontext.cs code
23211         * rootcontext.cs (GetClassBases): Added support for structs. 
23213 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23215         * interface.cs, statement.cs, class.cs, parameter.cs,
23216         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23217         Drop use of TypeRefs, and use strings instead.
23219 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23221         * rootcontext.cs: 
23223         * class.cs (Struct::Struct): set the SEALED flags after
23224         checking the modifiers.
23225         (TypeContainer::TypeAttr): new property, returns the
23226         TypeAttributes for a class.  
23228         * cs-parser.jay (type_list): Oops, list production was creating a
23229         new list of base types.
23231         * rootcontext.cs (StdLib): New property.
23232         (GetInterfaceTypeByName): returns an interface by type name, and
23233         encapsulates error handling here.
23234         (GetInterfaces): simplified.
23235         (ResolveTree): Encapsulated all the tree resolution here.
23236         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23237         types. 
23239         * driver.cs: Add support for --nostdlib, to avoid loading the
23240         default assemblies.
23241         (Main): Do not put tree resolution here. 
23243         * rootcontext.cs: Beginning of the class resolution.
23245 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23247         * rootcontext.cs: Provide better error reporting. 
23249         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23251         * rootcontext.cs (CreateInterface): Handle the case where there
23252         are no parent interfaces.
23254         (CloseTypes): Routine to flush types at the end.
23255         (CreateInterface): Track types.
23256         (GetInterfaces): Returns an array of Types from the list of
23257         defined interfaces.
23259         * typemanager.c (AddUserType): Mechanism to track user types (puts
23260         the type on the global type hash, and allows us to close it at the
23261         end). 
23263 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23265         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23266         RecordInterface instead.
23268         * cs-parser.jay: Updated to reflect changes above.
23270         * decl.cs (Definition): Keep track of the TypeBuilder type that
23271         represents this type here.  Not sure we will use it in the long
23272         run, but wont hurt for now.
23274         * driver.cs: Smaller changes to accomodate the new code.
23276         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23277         when done. 
23279         * rootcontext.cs (CreateInterface):  New method, used to create
23280         the System.TypeBuilder type for interfaces.
23281         (ResolveInterfaces): new entry point to resolve the interface
23282         hierarchy. 
23283         (CodeGen): Property, used to keep track of the code generator.
23285 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23287         * cs-parser.jay: Add a second production for delegate_declaration
23288         with `VOID'.
23290         (enum_body): Put an opt_comma here instead of putting it on
23291         enum_body or enum_member_declarations so we can handle trailing
23292         commas on enumeration members.  Gets rid of a shift/reduce.
23294         (type_list): Need a COMMA in the middle.
23296         (indexer_declaration): Tell tokenizer to recognize get/set
23298         * Remove old targets.
23300         * Re-add the parser target.
23302 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23304         * cs-parser.jay: Add precendence rules for a number of operators
23305         ot reduce the number of shift/reduce conflicts in the grammar.
23307 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23309         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23310         and put it here.
23312         Get rid of old crufty code.
23314         * rootcontext.cs: Use this to keep track of the parsed
23315         representation and the defined types available to the program. 
23317         * gen-treedump.cs: adjust for new convention.
23319         * type.cs: Split out the type manager, and the assembly builder
23320         from here. 
23322         * typemanager.cs: the type manager will live here now.
23324         * cil-codegen.cs: And the code generator here. 
23326 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23328         * makefile: Fixed up for easy making.
23330 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23332         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23333         the 
23335         (unary_expression): Expand pre_increment_expression and
23336         post_decrement_expression to reduce a shift/reduce.
23338 2001-07-11  Simon Cozens
23340         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23342         Improve allow_keyword_as_indent name.
23344 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23346         * Adjustments for Beta2. 
23348 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23350         * decl.cs: Added `Define' abstract method.
23351         (InTransit): new property, used to catch recursive definitions. 
23353         * interface.cs: Implement `Define'. 
23355         * modifiers.cs: Map Modifiers.constants to
23356         System.Reflection.TypeAttribute flags.
23358         * class.cs: Keep track of types and user-defined types.
23359         (BuilderInit): New method for creating an assembly
23360         (ResolveType): New function to launch the resolution process, only
23361         used by interfaces for now.
23363         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23364         that are inserted into the name space. 
23366 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23368         * ARGH.  I have screwed up my tree so many times due to the use of
23369         rsync rather than using CVS.  Going to fix this at once. 
23371         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23372         load types.
23374 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23376         * Experiment successful: Use System.Type rather that our own
23377         version of Type.  
23379 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23381         * cs-parser.jay: Removed nsAliases from here.
23383         Use new namespaces, handle `using XXX;' 
23385         * namespace.cs: Reimplemented namespace handling, use a recursive
23386         definition of the class.  Now we can keep track of using clauses
23387         and catch invalid using clauses.
23389 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23391         * gen-treedump.cs: Adapted for all the renaming.
23393         * expression.cs (Expression): this class now has a Type property
23394         which returns an expression Type.
23396         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23397         `Type', as this has a different meaning now in the base
23399 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23401         * interface.cs, class.cs: Removed from all the sources the
23402         references to signature computation, as we can not do method
23403         signature computation during the parsing time, as we are not
23404         trying to solve at that point distinguishing:
23406         class X {
23407                 void a (Blah x) {}
23408                 void a (NS.Blah x) {}
23409         }
23411         Which depending on the context might be valid or not, as we do not
23412         know if Blah is the same thing as NS.Blah at that point.
23414         * Redid everything so the code uses TypeRefs now instead of
23415         Types.  TypeRefs are just temporary type placeholders, that need
23416         to be resolved.  They initially have a pointer to a string and the
23417         current scope in which they are used.  This is used later by the
23418         compiler to resolve the reference to an actual Type. 
23420         * DeclSpace is no longer a CIR.Type, and neither are
23421         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23422         are all DeclSpaces, but no Types. 
23424         * type.cs (TypeRefManager): This implements the TypeRef manager,
23425         which keeps track of all the types that need to be resolved after
23426         the parsing has finished. 
23428 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23430         * ARGH.  We are going to have to store `foreach' as a class rather
23431         than resolving it, as we need to verify error 1579 after name
23432         resolution.   *OR* we could keep a flag that says `This request to
23433         IEnumerator comes from a foreach statement' which we can then use
23434         to generate the error.
23436 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23438         * class.cs (TypeContainer.AddMethod): we now add methods to the
23439         MethodGroup instead of the method hashtable.  
23441         * expression.cs: Add MethodGroup abstraction, which gets us one
23442         step closer to the specification in the way we handle method
23443         declarations.  
23445         * cs-parser.jay (primary_expression): qualified_identifier now
23446         tried to match up an identifier to a local variable reference or
23447         to a parameter reference.
23449         current_local_parameters is now a parser global variable that
23450         points to the current parameters for the block, used during name
23451         lookup.
23453         (property_declaration): Now creates an implicit `value' argument to
23454         the set accessor.
23456 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23458         * parameter.cs: Do not use `param' arguments as part of the
23459         signature, per the spec.
23461 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23463         * decl.cs: Base class for classes, structs and interfaces.  This
23464         is the "Declaration Space" 
23466         * cs-parser.jay: Use CheckDef for checking declaration errors
23467         instead of having one on each function.
23469         * class.cs: Factor out some code for handling error handling in
23470         accordance to the "Declarations" section in the "Basic Concepts"
23471         chapter in the ECMA C# spec.
23473         * interface.cs: Make all interface member classes derive from
23474         InterfaceMemberBase.
23476 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23478         * Many things: all interfaces are parsed and generated in
23479         gen-treedump.  Support for member variables, constructors,
23480         destructors, properties, constants is there.
23482         Beginning of the IL backend, but very little done, just there for
23483         testing purposes. 
23485 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23487         * cs-parser.jay: Fix labeled statement.
23489         * cs-tokenizer.cs (escape): Escape " and ' always.
23490         ref_line, ref_name: keep track of the line/filename as instructed
23491         by #line by the compiler.
23492         Parse #line.
23494 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23496         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23497         to match the values in System.CodeDOM.
23499         Divid renamed to Divide.
23501         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23502         statements. 
23503         (Statements.set): remove.
23505         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23506         statements. 
23508         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23509         falseStatements always have valid values. 
23511         * cs-parser.jay: Use System.CodeDOM now.