2006-06-13 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2006-06-13  Martin Baulig  <martin@ximian.com>
2
3         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
4         type arguments and create a ConstructedType if necessary.  Fixes #78400.
5
6 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
7
8         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
9         attribute applicable tests for attribute argument.
10
11 2006-06-02  Raja R Harinath  <rharinath@novell.com>
12
13         Fix #78079
14         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
15         (Binary.OverloadResolve_PredefinedIntegral): New.
16         (Binary.OverloadResolve_PredefinedFloating): New.
17         (Binary.OverloadResolve_PredefinedString): New.
18         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
19         Follow the standard more closely, and treat numeric promotions in
20         terms of overload resolution.
21         (Binary.CheckShiftArguments): Simplify.
22
23 2006-06-01  Raja R Harinath  <rharinath@novell.com>
24
25         * flowanalysis.cs (MyBitVector): Simplify representation.
26         (MyBitVector.Clone): Avoid allocating BitArray.
27         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
28         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
29         (*): Update.  Change all references to MyBitVector.And and
30         MyBitVector.Or to &= and |=.
31
32 2006-05-31  Raja R Harinath  <rharinath@novell.com>
33
34         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
35         Use bne.un instead of ceq+brfalse.
36
37         Fix cs0208-[23].cs
38         * typemanager.cs (IsUnmanagedType): Disallow generic types and
39         generic parameters.
40
41 2006-05-29  Raja R Harinath  <rharinath@novell.com>
42
43         Fix cs0231-[34].cs.
44         * cs-parser.jay (formal_parameter_list): Extend the pattern below
45         to param arguments too.
46
47 2006-05-26  Miguel de Icaza  <miguel@novell.com>
48
49         * cs-parser.jay: Catch another parsing form for arglist being
50         followed by other arguments.  Fixes #78313.
51
52 2006-05-25  Raja R Harinath  <rharinath@novell.com>
53
54         Fix #78324
55         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
56         also when one of the operands is a null literal.
57         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
58         to improve clarity, and generate slightly better code.
59
60 2006-05-24  Raja R Harinath  <rharinath@novell.com>
61
62         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
63         checking of out parameters to ...
64         (FlowBranchingToplevel.Merge): ... here.
65         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
66         set, propagate the origin upward, and only complain if there was
67         no other error.
68         (FlowBranchingException.AddContinueOrigin): Likewise.
69         (FlowBranchingException.AddReturnOrigin): Likewise.
70         (FlowBranchingException.AddGotoOrigin): Likewise.       
71
72 2006-05-23  Raja R Harinath  <rharinath@novell.com>
73
74         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
75         unreachable, skip it.
76         (FlowBranchingException.Merge): Always propagate jumps, even if
77         the finally block renders subsequent code unreachable.
78
79 2006-05-18  Raja R Harinath  <rharinath@novell.com>
80
81         Fix #77601
82         * statement.cs (Goto.Resolve): Move responsibility for resolving
83         'goto' to FlowBranching.AddGotoOrigin.
84         (Goto.SetResolvedTarget): New.  Callback to set the
85         LabeledStatement that's the target of the goto.
86         (Goto.DoEmit): Use Leave instead of Br when crossing an
87         unwind-protect boundary.
88         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
89         LookupLabel and adjust to new semantics.
90         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
91         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
92         Goto.SetResolvedTarget to update target.
93         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
94         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
95         AddBreakOrigin & co.  Delay propagation until ...
96         (FlowBranchingException.Merge): ... this.
97
98         * statement.cs (Block.Resolve): Always depend on flow-branching to
99         determine unreachability.  Kill workaround that originally emitted
100         only one statement after an "unreachable" label (see infloop in
101         test-515.cs).
102
103         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
104         This is still "wrong", but anything better would probably need a
105         multi-pass algorithm.
106         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
107         usage vector.  Force current usage vector to be reachable, to
108         optimistically signify backward jumps.
109         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
110         detected.
111         (FlowBranchingLabeled.Merge): New.  If no backward jump was
112         detected, return the original salted-away usage vector instead,
113         updated with appropriate changes.  Print unreachable warning if
114         necessary.
115         * statement.cs (Block.Resolve): Don't print unreachable warning on
116         a labeled statement.
117
118 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
119
120         * driver.cs: Pass filename without path to AssemblyBuilder's
121         AddResourceFile. Fixes bug #78407.
122
123 2006-05-17  Raja R Harinath  <rharinath@novell.com>
124
125         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
126         * flowanalysis.cs (FlowBranchingLabeled): ... here.
127         (FlowBranching.MergeChild): Overwrite
128         reachability information from Labeled branchings too.
129
130 2006-05-16  Raja R Harinath  <rharinath@novell.com>
131
132         * statement.cs (Goto.Resolve): Merge jump origins here ...
133         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
134
135         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
136         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
137         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
138         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
139         here, ...
140         * statement.cs (Goto.Resolve): ... not here.
141         (Goto.Emit): Remove CS1632 check.
142
143 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
144
145         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
146         error message.
147
148 2006-05-11  Raja R Harinath  <rharinath@novell.com>
149
150         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
151         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
152         (FlowBranchingException.Label): Likewise.
153
154         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
155         given value.
156         (MyBitVector.Or): Use it to avoid losing information (Count).
157         (FlowBranching.MergeOrigins): Likewise.
158
159         * flowanalysis.cs (UsageVector.IsDirty): Remove.
160         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
161         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
162         (UsageVector.ToString): Simplify.
163         (UsageVector.MergeSiblings): Move here from ...
164         (FlowBranching.Merge): ... here.
165         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
166         not a MyBitVector.
167
168 2006-05-10  Raja R Harinath  <rharinath@novell.com>
169
170         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
171         null bitvector is treated as all-true.
172
173         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
174         (MyBitVector): Rationalize invariants.  'vector != null' implies
175         that we have our own copy of the bitvector.  Otherwise,
176         'InheritsFrom == null' implies all inherited bits are true.
177
178 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
179
180         * statement.cs (LocalInfo): Add IsConstant.
181         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
182         local variable for constants.
183
184 2006-05-09  Raja R Harinath  <rharinath@novell.com>
185
186         * flowanalysis.cs (MyBitVector.Empty): New.
187         (MyBitVector): Don't allow InheritedFrom to be null.
188         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
189         (UsageVector, FlowBranching): Update to changes.
190
191         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
192         recursion.  The 'Parent == null' condition isn't sufficient for
193         anonymous methods.
194         (FlowBranching.AddBreakOrigin): Likewise.
195         (FlowBranching.AddContinueOrigin): Likewise.
196         (FlowBranching.AddReturnOrigin): Likewise.
197         (FlowBranching.StealFinallyClauses): Likewise.
198         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
199         (FlowBranching.CheckOutParameters): Likewise.
200         (FlowBranchingToplevel): Terminate all the above recursions here.
201         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
202         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
203
204         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
205         toplevel block.
206         (FlowBranchingToplevel): New.  Empty for now.
207         (FlowBranching.MergeTopBlock): Update.
208         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
209         branching for the anonymous delegate.
210         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
211
212         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
213         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
214         information at the start of the merge.  Reorganize.
215
216 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
217
218         * class.cs (MethodData.Define): Method cannot implement interface accessor.
219
220 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
221
222         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
223         to newly introduced ctor.
224
225         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
226         message to one place.
227         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
228         global namespace.
229
230 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
231
232         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
233
234         * ecore.cs (Expression.ResolveAsConstant): Updated.
235
236         * statement.cs (ResolveMeta): Updated.
237
238 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
239
240         * cs-parser.jay: __arglist cannot be used in initializer.
241
242 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
243
244         A fix for #77879
245         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
246         private types.
247
248 2006-05-05  Raja R Harinath  <rharinath@novell.com>
249
250         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
251         (LabeledStatement): Add 'name' parameter.
252         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
253         (Block.AddLabel): Update to changes.
254         * cs-parser.jay (labeled_statement): Likewise.
255
256         * flowanalysis.cs (BranchingType.Labeled): New.
257         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
258         (FlowBranchingLabeled): New.  Does nothing for now, but will
259         eventually handle 'goto' flows.
260         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
261         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
262         that's terminated ...
263         (Block.Resolve): ... here.
264
265         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
266         (UsageVector.MergeFinallyOrigins): Likewise.
267         (FlowBranching.InTryOrCatch): Likewise.
268         (FlowBranching.AddFinallyVector): Likewise.
269         (FlowBranchingException): Update to changes.
270
271         Fix #78290
272         * statement.cs (Return.Resolve): Move error checking to ...
273         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
274         (FlowBranchingException): Handle return origins like break and
275         continue origins.
276         (FlowBranching.UsageVector.CheckOutParameters): Remove.
277
278 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
279
280         A fix for #76122
281         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
282         filter.
283
284 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
285
286         A fix for #77543
287         * class.cs (MethodData.Define): Do public accessor check only when method
288         implements an interface.
289
290 2006-05-04  Raja R Harinath  <rharinath@novell.com>
291
292         Remove special handling of 'break'
293         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
294         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
295         (UsageVector.Break): Remove.
296         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
297         reachability.
298         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
299
300         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
301         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
302
303 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
304
305         A fix for #75726
306         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
307         be the interface member.
308
309 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
310
311         A fix for #60069
312         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
313         for emitting small (int) values.
314
315 2006-05-03  Raja R Harinath  <rharinath@novell.com>
316
317         Fix #59427
318         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
319         control-flow passes through the 'finally' after merging-in all the
320         control-flows from 'try' and the 'catch' clauses.
321
322         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
323         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
324         always true at the only non-recursive entry point.
325         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
326         FlowBranchingBreakable.
327         (FlowBranchingLoop): Remove.
328         * statement.cs (Return.DoResolve): Update to changes.
329
330         Fix #76471, #76665
331         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
332         (FlowBranching.CreateBranching): Handle it: create a
333         FlowBranchingContinuable.
334         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
335         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
336         except that it handles the 'continue' command.
337         (FlowBranching.UsageVector.MergeOrigins): Rename from
338         MergeBreakOrigins.
339         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
340         except that it overrides AddContinueOrigin.
341         (FlowBranchingException): Override AddContinueOrigin, similar to
342         AddBreakOrigin.
343         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
344         Create a new branching around the embedded statement.
345         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
346         control flow after the embedded statement.
347         (Continue.Resolve): Move all error checking to AddContinueOrigin.
348
349         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
350         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
351         FlowBranchingBreakable.
352         (FlowBranchingSwitch): Remove.
353
354         Fix test-503.cs
355         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
356         error reporting to ...
357         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
358         Rename from 'AddBreakVector'.  Add new location argument.  Return
359         a bool indicating whether the 'break' crosses an unwind-protect.
360         (FlowBranchingException.AddBreakOrigin): Add.
361         (FlowBranchingException.Merge): Propagate 'break's to surrounding
362         flowbranching after updating with the effects of the 'finally'
363         clause.
364         (FlowBranchingBreakable): New common base class for
365         FlowBranchingLoop and FlowBranchingSwitch.
366
367         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
368         embedded statement.
369         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
370
371 2006-05-02  Raja R Harinath  <rharinath@novell.com>
372
373         * statement.cs (Do.Resolve): If the loop is infinite, set the
374         barrier.
375         (While.Resolve, For.Resolve): Set a barrier after the embedded
376         statement.  There's no direct control flow that goes from the end
377         of the embedded statement to the end of the loop.
378         * flowanalysis.cs (FlowBranching.Infinite): Remove.
379         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
380         above ensure that the reachability is correctly computed.
381
382         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
383         (UsageVector.MergeBreakOrigins): If the current path is
384         unreachable, treat it as if all parameters/locals are initialized.
385         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
386         infinite loops before merging-in break origins.
387
388         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
389         (Reachability.Reachable): Split part into ...
390         (Reachability.Unreachable): ... this.  Simplify.
391         (Reachability.IsUnreachable): Use 'Unreachable' instead.
392
393         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
394         (Reachability.SetThrowsSometimes): Likewise.
395         (FlowBranchingBlock.MergeTopBlock): Don't compare against
396         TriState.Always, use corresponding property.
397         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
398         (Block.Resolve): Likewise.  Remove some redundant checks.
399
400 2006-05-02  Raja R Harinath  <harinath@gmail.com>
401
402         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
403         (Reachability.Meet): Don't bother checking AlwaysThrows --
404         barrier is always set.
405         (FlowBranchingBlock.Merge): Likewise.
406
407 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
408
409         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
410         defined, so it's references should also compile only for NET_2_0
411         (as occurs in mcs version)
412
413 2006-05-01  Raja R Harinath  <harinath@gmail.com>
414
415         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
416         checks for unreachable.
417
418 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
419
420         A fix for #77980
421         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
422
423         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
424         whether field is really assigned.
425
426 2006-04-30  Raja R Harinath  <harinath@gmail.com>
427
428         * flowanalysis.cs (Reachability): Make 4-argument constructor
429         private.
430         (Reachability.Meet): Rename from 'And'.  Remove static variant.
431         (Reachability.Always): Rename from the highly misleading
432         'Reachability.Never'.
433         (FlowBranching.Merge): Update to changes.  Mark an impossible
434         situation with a 'throw'.
435         (*): Update to changes.
436
437 2006-04-29  Raja R Harinath  <harinath@gmail.com>
438
439         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
440         Remove 'Undefined'.
441         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
442         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
443         (*): Update to changes.
444         * statement.cs: Update to changes.
445
446 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
447
448         A fix for #78049
449         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
450
451 2006-04-28  Raja R Harinath  <harinath@gmail.com>
452
453         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
454         dummy UsageVector.
455
456         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
457         argument to two arguments: an usage-vector and a bool.  Move call
458         to FlowBranching.Merge () ...
459         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
460
461         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
462         handling of loop and switch reachability to ...
463         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
464
465 2006-04-27  Raja R Harinath  <harinath@gmail.com>
466
467         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
468         handling to FlowBranchingLoop.InLoop.
469         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
470
471 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
472
473         A fix for #78115
474         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
475         anonymous method is allowed from AnonymousContainer here.
476
477         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
478
479 2006-04-24  Raja R Harinath  <rharinath@novell.com>
480
481         Fix #78156
482         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
483
484 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
485
486         A fix for #49011.
487         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
488         (DoubleConstant.Reduce): Ditto.
489
490 2006-04-23  Raja R Harinath  <rharinath@novell.com>
491
492         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
493         Remove 'lvalue_right_side' argument.  Move parts to ...
494         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
495         (LocalVariable.DoResolveLValue): ... these.
496
497 2006-04-21  Raja R Harinath  <rharinath@novell.com>
498
499         Fix cs1655.cs
500         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
501         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
502         (LocalVariableReference.DoResolveBase): Use it to implement new
503         CS1655 check.
504         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
505         (Argument.Resolve): Simplify.  Move CS1510 check ...
506         * ecore.cs (Expression.ResolveLValue): ... here.
507         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
508         (PropertyExpr.DoResolveLValue): Likewise.
509         (FieldExpr.Report_AssignToReadonly): Likewise.
510         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
511         LValueMemberAccess or LValueMemberOutAccess on instance depending
512         on it.
513         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
514         DoResolve as appropriate.
515
516 2006-04-20  Raja R Harinath  <rharinath@novell.com>
517
518         Fix #75800
519         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
520         implicit conversions on 'out' and 'ref' arguments.
521
522         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
523         improve clarity.  Remove dead code.
524
525         Fix #66031
526         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
527         (Catch.Resolve): Resolve VarBlock if it exists.
528
529 2006-04-19  Miguel de Icaza  <miguel@novell.com>
530
531         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
532         twice, this was some residual code, the enumerator was emitted
533         properly in the two branche of if later.
534
535         Fixes #78031
536         
537         Thanks to Martin for finding the source of the problem
538         
539 2006-04-19  Raja R Harinath  <rharinath@novell.com>
540
541         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
542         cast is never an lvalue.
543         (Cast.DoResolve, Cast.ResolveRest): Combine.
544         (Argument.Emit): Simplify slightly.  Move 'Expr is
545         IMemoryLocation' check ...
546         (Argument.Resolve): ... here.
547         (Argument.Error_LValueRequired): Remove.  Inline into only user.
548
549         Simplifications.  Fix cs0191-2.cs
550         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
551         CS1649 and CS1651 to ...
552         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
553         the actual selection of the error code and message to a lookup
554         table.  Add a dummy return value to simplify callsites.
555         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
556         readonly fields of other instances of the same type.  Move CS0197
557         warning from ...
558         * expression.cs (Argument.Resolve): ... here.  Simplify code.
559         Ensure that ec.InRefOutArgumentResolving is only set during LValue
560         resolution of an out or ref argument.  The code simplification
561         above uses this invariant.
562
563 2006-04-18  Raja R Harinath  <rharinath@novell.com>
564
565         Possibly fix #77752.  Fix cs1690-[4-7].cs.
566         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
567         CheckMarshallByRefAccess.  Drop parameter.
568         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
569         warning.
570         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
571         InstanceExpression.
572         * report.cs (AllWarnings): Add CS1690.
573         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
574         for ref access too.
575         (LocalVariableReference.DoResolveBase): Update.
576
577 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
578
579         * class.cs (MethodOrOperator): Moved common parts from method class.
580         detect obsolete attributes.
581         (Method.Define): Simplified as it reuses code from base.
582         (Constructor.ValidAttributeTargets): Fixed issue found during
583         refactoring.
584         (Destructor.ValidAttributeTargets): Fixed issue found during
585         refactoring.
586         (Operator): Finished refactoring set off by #78020. Operator class is now
587         ordinary method class.
588
589         * anonymous.cs: Updated.
590
591 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
592
593         * class.cs (Constructor.Emit): Don't emit the attributes twice.
594
595 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
596
597         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
598         detect obsolete attributes.
599         (Method.CreateEmitContext): Moved to MethodOrOperator.
600
601 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
602
603         A fix for #78048.
604         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
605         customized exception to make crash detection easier.
606         (MethodOrOperator): Started to work on new base class for methods and
607         operators.
608         (Method): Derives from MethodOrOperator.
609         (Constructor.Emit): Emits its own attributes.
610         (AbstractPropertyEventMethod.Emit): Ditto.
611         (Operator): Derives from MethodOrOperator, will refactor fully in extra
612         patch.
613         (Operator.Emit): It's temporary more tricky than should be.
614         
615         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
616
617         * report.cs (InternalErrorException): Add ctor with inner exception.
618
619 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
620
621         A fix for #76744.
622         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
623         only not visible.
624
625 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
626
627         A fix for #77916.
628         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
629         array.
630
631 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
632
633         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
634         attribute is present and Guid not.
635         (Interface.ApplyAttributeBuilder): Ditto.
636
637         * attribute.cs: Add error message.
638
639 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
640
641         A fix for #78020.
642
643         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
644         sources (it's composite) so hold them in extra array as they are used in
645         Emit phase only. It worked in the previous versions by mistake.
646         (Attribute.Emit): Emit attribute for more owners when exist.
647
648         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
649         it has now different behaviour.
650
651 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
652
653         * constant.cs (Constant.IsDefaultInitializer): New method.
654
655         * class.cs: Updated.
656
657         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
658         re-initialize default values. It saves KBs almost for every assembly.
659         Thanks Zoltan for the idea.
660         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
661         (ArrayCreation.DoResolve): Resolve only once.
662         (ArrayCreation.Emit): Emit static initializer only when it is faster.
663         (ArrayCreation.GetAttributableValue): Cope with optimized values.
664
665 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
666
667         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
668         From #77961.
669
670 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
671
672         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
673         in an embedded statement too.
674
675 2006-04-01  Raja R Harinath  <rharinath@novell.com>
676
677         Fix #77929
678         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
679         testing.
680
681         Fix #77958
682         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
683
684         Fix #77962
685         * report.cs (SymbolRelatedToPreviousError): Drop generic type
686         arguments before checking whether a type is reflected or not.
687
688         Fix #77954
689         * expression.cs (Invocation.IsApplicable): Ensure a generic method
690         definition doesn't take part in overload resolution.
691         (Invocation.IsParamsMethodApplicable): Likewise.
692         (Invocation.OverloadResolve): When replacing a reflected override
693         method with its base definition, ensure that type arguments are
694         applied.
695
696 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
697
698         A fix for #77966.
699
700         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
701         was not specified.
702
703         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
704
705 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
706
707         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
708         phase.
709
710         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
711         LocalTemporary change.
712
713         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
714         TypeContainer.
715         (ClassOrStruct.DefineFieldInitializers): Implemented static field
716         initializers optimization.
717         (ClassOrStruct.TypeAttr): Moved from modifiers.
718         (Constructor.CheckBase): Don't crash when static ctor has parameters.
719         (FieldBase.ResolveInitializer): Resolves initializer.
720         (FieldBase.HasDefaultInitializer): New property.
721
722         * cs-parser.jay: Removed message.
723
724         * expression.cs (CompilerGeneratedThis): New specialization.
725
726         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
727
728 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
729
730         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
731
732 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
733
734         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
735         be now EnumConstants only.
736
737 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
738
739         * attribute.cs, driver.cs: Reset more caches.
740
741 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
742
743         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
744
745 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
746
747         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
748         for easier reuse. Updated all overrides.
749         (IntegralConstant): New base class for all integral constants.
750         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
751         of the constant range, report custom error.
752         (UIntConstant.Reduce): Fixed uint conversion.
753
754         * ecore.cs, literal.cs: Reduce updates.
755
756 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
757
758         A fix for #75813.
759
760         * class.cs (Constructor.Define): Removed extra if for default ctors.
761         A patch from Atsushi Enomoto.
762
763 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
764
765         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
766         GetAttributableValue.
767
768         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
769         when required.
770
771         * convert.cs (ImplicitConversionRequired): Error message moved to
772         DoubleLiteral.
773
774         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
775         automatic implicit conversion of an output value.
776         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
777
778         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
779         conversion.
780         (TypeOf.GetAttributableValue): Add extra handling for object type.
781
782         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
783         special error message.
784
785 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
786
787         * class.cs (Constructor.Emit): Don't crash when struct ctor is
788         InternalCall.
789         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
790         compatible with MS runtime.
791
792 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
793
794         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
795         attribute arguments here.
796
797         * class.cs (Indexer.Define): The check was moved to attribute class.
798
799 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
800
801         * expression.cs (StringConcat.Append): Reverted back to no warning state.
802
803 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
804
805         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
806
807         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
808         the blocks too.
809
810 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
811
812         * doc-bootstrap.cs : fix build.
813
814 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
815
816         * expression.cs (StringConcat.Append): Issue a warning when empty string
817         is going to append.
818
819 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
820
821         * assign.cs (CompoundAssign.ResolveSource): Removed.
822
823         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
824         clean up.
825
826         * class.cs (TypeContainer.FindMethods): Removed.
827         (TypeContainer.CheckMemberUsage): Made static.
828
829         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
830
831         * constant.cs (CheckRange): Removed unused type argument.
832         (CheckUnsigned): Removed unused type argument.
833
834         * cs-parser.jay: Updated after MemberAccess clean up.
835         Uses Length for empty string test.
836
837         * cs-tokenizer.cs: Uses Length for empty string test.
838         (IsCastToken): Made static.
839         (is_hex): Made static.
840         (real_type_suffix): Made static.
841
842         * decl.cs (SetupCache): Made static.
843         (OnGenerateDocComment): Removed unused ds argument.
844
845         * delegate.cs (VerifyDelegate): Removed unused argument.
846
847         * doc.cs: Uses Length for empty string test.
848
849         * driver.cs: Uses Length for empty string test.
850
851         * enum.cs (IsValidEnumType): Made static
852
853         * expression.cs (EnumLiftUp): Removed unused argument.
854         (ResolveMethodGroup): Ditto.
855         (BetterConversion): Ditto.
856         (GetVarargsTypes): Ditto.
857         (UpdateIndices): Ditto.
858         (ValidateInitializers): Ditto.
859         (MemberAccess.ctor): Ditto.
860         (GetIndexersForType): Ditto.
861
862         * flowanalysis.cs: (MergeFinally): Removed unused argument.
863
864         * iterators.cs: Updated after MemberAccess clean up.
865
866         * location.cs: Uses Length for empty string test.
867
868         * namespace.cs: Uses Length for empty string test.
869
870          * report.cs (CheckWarningCode): Made static.
871
872         * statement.cs (LabeledStatement): Removed unused argument.
873
874         * typemanager.cs (FilterNone): Removed.
875
876 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
877
878         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
879         obsolete.
880
881         * class.cs: Updated.
882
883 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
884
885         * cs-parser.jay.cs: __arglist is not allowed for delegates.
886
887 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
888
889         A fix for #77816.
890
891         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
892         host container.
893         (AnonymousMethod.ImplicitStandardConversionExists): New method.
894         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
895         Add more error reporting; Fixed issue with params.
896
897         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
898
899         * cs-parser.jay: AnonymousMethod requires host container.
900
901         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
902
903 2006-03-18  Raja R Harinath  <harinath@gmail.com>
904
905         * class.cs: Change 'TypeContainer ds' constructor argument to
906         'DeclSpace parent'.  Some classes were missed below due to
907         different naming convention.
908
909         * class.cs (MemberCore.Parent): Delete.  This makes the
910         ParentContainer changes below enforceable by the compiler.
911
912         Treat pointers to enclosing declaration space as 'DeclSpace', not
913         'TypeContainer'.
914         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
915         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
916
917         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
918         of TypeContainer.
919         (Block.AddThisVariable): Likewise.
920         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
921         (AbstractPropertyEventMethod.Emit): Likewise.
922         (AbstractPropertyEventMethod.EmitMethod): Likewise.
923         (GetMethod.Define, SetMethod.Define): Likewise.
924         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
925         (DelegateMethod.EmitMethod): Likewise.
926
927         Fix regression test-partial-13.cs.
928         Rationalize use of PartialContainer.  Ensure that the partial
929         class semantics can be tied to type-correctness, i.e., any
930         violation will cause a compile error.
931         * class.cs, const.cs: Access all fields that belong to class
932         TypeContainer via ParentContainer.  Arguments of EmitContexts and
933         Resolve()-like functions still use 'Parent'.
934
935         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
936         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
937         (PropertyMethod.CheckModifiers): Remove unused argument.
938         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
939         DeclSpace.
940
941 2006-03-28  Raja R Harinath  <rharinath@novell.com>
942
943         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
944
945 2006-03-17  Raja R Harinath  <harinath@gmail.com>
946
947         Make semantics of PartialContainer simpler.
948         * decl.cs (DeclSpace.IsPartial): Remove.
949         * class.cs (TypeContainer.IsPartial): Likewise.
950         (TypeContainer..ctor): Set PartialContainer to point to self.
951         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
952         (TypeContainer.FindNestedType): Likewise.
953         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
954
955 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
956
957         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
958
959 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
960
961         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
962         classes.
963
964 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
965
966         * class.cs (Operator.Define): An error for base conversion was not
967         reported correctly.
968
969 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
970
971         A fix for #77593, #77574.
972
973         * class.cs (MethodCore.CheckBase): Another if for operator.
974
975 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
976
977         A fix for #77822.
978
979         * expression.cs (VerifyArgumentsCompat): Reverted to double error
980         reporting, it's more tricky than I thought.
981
982 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
983
984         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
985         were not resolved
986
987         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
988         (DelegateCreation.ImplicitStandardConversionExists): New method for just
989         conversion test.
990         
991         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
992         not needed.
993
994 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
995
996         A fix for #77353.
997
998         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
999         (Event.Define): ditto
1000         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1001
1002         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1003         Removed redundant code and set NewSlot for Invoke method too.
1004
1005         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1006         (Parameters.MergeGenerated): New method. Use this method when you merge
1007         compiler generated argument with user arguments.
1008
1009 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1010
1011         * attribute.cs (ResolveAsTypeTerminal): Removed.
1012
1013         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1014         specialization for predefined types; 30% speed up.
1015         Finally placed obsolete check to right place.
1016         (Expression.ResolveType): Removed.
1017
1018         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1019         Updated after ResolveType was removed.
1020
1021         * expression.cs (Cast.ctor): Check void cast.
1022         (Binary.ResolveAsTypeTerminal): Is never type.
1023         (Conditional.ResolveAsTypeTerminal): Is never type.
1024
1025         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1026
1027 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1028
1029         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1030
1031 2006-03-23  Martin Baulig  <martin@ximian.com>
1032
1033         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1034         type check if either of the types is an open generic type.
1035
1036 2006-03-23  Martin Baulig  <martin@ximian.com>
1037
1038         * convert.cs
1039         (Convert.ExplicitTypeParameterConversion): New method; implement
1040         explicit type parameter conversions.
1041
1042 2006-03-23  Martin Baulig  <martin@ximian.com>
1043
1044         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1045         blindly allow all conversions if we do not have any constraints.
1046
1047 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1048
1049         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1050         these two separated members to simplify the code.
1051         (Attribute.Resolve): Refactored to use new fields and methods.
1052         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1053         implemented obsolete attribute checking.
1054         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1055         implemented obsolete checking again. It look line never ending quest ;-)
1056         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1057
1058         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1059
1060         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1061
1062         *class.cs (Property.Define): Add RegisterProperty call.
1063
1064         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1065         argument groups (only 2).
1066
1067         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1068         encoding expression to arguments.
1069         (Expression.ExprClassToResolveFlags): Just turned to property.
1070
1071         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1072         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1073         optimized as well as implemented support for zero-length attributes.
1074
1075         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1076         Add caching of PropertyInfo's.
1077
1078 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1079
1080         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1081         error multiple times.
1082
1083 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1084
1085         New partial class implementation.
1086         A fix for #77027, #77029, #77403
1087
1088         * attribute.cs (Attributable): Made attributes protected.
1089
1090         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1091         the replacements of ClassPart and PartialContainer.
1092         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1093         (TypeContainer.AddInterface): Ditto.
1094         (TypeContainer.AddPartial): The main method for partial classes. It checks
1095         for errors and merges ModFlags and attributes. At the end class is added to
1096         partial_parts list.
1097         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1098         required here.
1099         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1100         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1101         from the rest of partial classes.
1102         (TypeContainer.GetClassBases): Simplified.
1103         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1104         DefineType.
1105         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1106         (TypeContainer.HasExplicitLayout): Uses Flags now.
1107         (PartialContainer): Removed.
1108         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1109         (StaticClass): Was merged with Class.
1110         (Class.GetClassBases): class and static class bases are verified here.
1111         (Class.TypeAttr): Added static attributes when class is static.
1112         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1113         (MemberBase): In some cases we need to call parent container for partial
1114         class. It should be eliminated but it's not easy now.
1115
1116         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1117
1118         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1119         partial classed to accumulate class comments.
1120         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1121
1122         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1123
1124         * driver.cs (MainDriver): Tree.GetDecl was removed.
1125
1126         * modifiers.cs (Modifiers): Add partial modifier.
1127
1128         * tree.cs (Tree.decl): Removed.
1129         (RootTypes): Started to use this class more often for root types
1130         specializations.
1131
1132 2006-03-23  Raja R Harinath  <rharinath@novell.com>
1133
1134         * generic.cs (TypeParameter.UpdateConstraints): Update
1135         'constraints' if null.
1136
1137 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1138
1139         A fix for #77615
1140
1141         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1142         external interface does not have an attribute.
1143
1144 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1145
1146         Another prerequisites for new partial classs implementation.
1147         
1148         * attribute.cs (Attribute.Equal): Implemented.
1149         (Attribute.Emit): Changed as attributes can be applied more than twice.
1150         (Attributes.Emit): Check for duplicate attributes here.
1151
1152         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1153         as a parameter, clean-up.
1154
1155 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1156
1157         A fix for #77485
1158
1159         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1160         contains obsolete attribute check which can in some cases look for base
1161         type of current class which is not initialized yet.
1162         (TypeContainer.BaseType): Replacement of ptype.
1163
1164         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1165
1166 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1167
1168         First of prerequisites for new partial classs implemention.
1169         
1170         * attribute.cs (Attributable): Extended by ResolveContext;
1171         Attributes finally have correct context for resolving in all cases.
1172         (AttachTo): Attribute owner is assigned here.
1173
1174         * codegen.cs (IResolveContext): Introduce new interface to hold
1175         all information needed in resolving phase.
1176         (EmitContext): Implements IResolveContext; more clean-up needed here.
1177         
1178         * decl.cs (MemberCore): Implemented IResolveContext.
1179
1180         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1181         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1182         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1183         Refactored to use new IResolveContext instead of EmitContext; cleanup
1184
1185 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1186
1187         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1188         mcs to keep code differences small.
1189         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1190         * typemanager.cs (parameter_default_value_attribute_type): New.
1191         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1192         CS1908 check.
1193
1194 2006-03-22  Martin Baulig  <martin@ximian.com>
1195
1196         * generic.cs
1197         (Nullable.NullableLiteral): Derive from `NullLiteral'.
1198
1199         * convert.cs
1200         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1201         instead of the normal `NullLiteral'.
1202
1203 2006-03-21  Martin Baulig  <martin@ximian.com>
1204
1205         Fix #77583.
1206         * generic.cs (TypeManager.InferType): If `pt' is a generic
1207         parameter, don't check whether `pt == at'.
1208
1209 2006-03-20  Raja R Harinath  <rharinath@novell.com>
1210
1211         Fix #77852
1212         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1213         (TypeParameter.Resolve): Update to change.
1214         (ConstraintChecker.CheckConstraints): Resolve type-argument
1215         constraints before use.
1216
1217 2006-03-16  Martin Baulig  <martin@ximian.com>
1218
1219         * generic.cs
1220         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1221         and don't have any instance constructors, also lookup in the base class.
1222         (TypeManager.IsNullableValueType): New public method.
1223
1224         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1225         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1226         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1227
1228         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1229         instead of just TypeManager.IsNullableType() to determine whether
1230         a lifted operator exists.
1231         (UnaryMutator.DoResolve): Likewise.
1232         (Conditional.DoResolve): Likewise.
1233         (Binary.DoResolve): A lifted operator only exists if both operands
1234         are valuetypes and at least one of them is a nullable type.
1235
1236 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1237
1238         * iterator.cs : yield break is allowed in try statement which has
1239           catch clauses. Fixed bug #77767.
1240
1241 2006-03-12  Martin Baulig  <martin@ximian.com>
1242
1243         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1244         private IsSignatureEqual() to compare types; see the comment in
1245         that method; fixes #77674.
1246
1247 2006-03-10  Raja R Harinath  <rharinath@novell.com>
1248
1249         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1250         (Expression.ResolveAsTypeTerminal): Likewise.
1251         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1252         * expression.cs, generic.cs, iterators.cs: Likewise.
1253         * parameter.cs, statement.cs, typemanager.cs: Likewise.
1254
1255 2006-03-09  Martin Baulig  <martin@ximian.com>
1256
1257         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1258         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1259
1260 2006-03-09  Martin Baulig  <martin@ximian.com>
1261
1262         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1263         `prepared' flag is set.
1264
1265         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1266         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1267         issues; see gtest-254.cs.
1268
1269 2006-03-07  Martin Baulig  <martin@ximian.com>
1270
1271         * generic.cs (TypeManager.InferType): Allow infering
1272         `IEnumerable<T>' with an array of T; see gtest-251.cs.
1273
1274 2006-03-06  Martin Baulig  <martin@ximian.com>
1275
1276         * generic.cs
1277         (TypeManager.InferType): Fix gtest-250.cs.
1278
1279         * typemanager.cs
1280         (TypeManager.IsSubclassOf): Also check the base class.
1281
1282         * expression.cs
1283         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1284         fixes gtest-249.cs.
1285
1286 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1287
1288         Fix #77679.
1289         * expression.cs (ParameterReference.DoResolveBase): Change return
1290         type to bool.
1291         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1292         Update.
1293
1294         Fix #77628.
1295         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1296
1297         Fix #77642.
1298         * typemanager.cs (GetFullNameSignature): Don't nullref on
1299         protected accessors.
1300
1301 2006-02-16  Martin Baulig  <martin@ximian.com>
1302
1303         * generic.cs
1304         (TypeManager.GetGenericFieldDefinition): New public method; use it
1305         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1306
1307 2006-02-14  Martin Baulig  <martin@ximian.com>
1308
1309         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1310
1311 2006-02-14  Martin Baulig  <martin@ximian.com>
1312
1313         * generic.cs
1314         (TypeManager.DropGenericMethodArguments): New public method; don't
1315         use GetGenericMethodDefinition() on something which is not a
1316         generic method.
1317
1318 2006-02-14  Martin Baulig  <martin@ximian.com>
1319
1320         * generic.cs
1321         (ConstraintChecker.CheckConstraints): If a type parameter has the
1322         `struct' constraint, the type must be a non-nullable valuetype.
1323
1324 2006-02-10  Martin Baulig  <martin@ximian.com>
1325
1326         * typemanager.cs
1327         (TypeManager.IsOverride): Make this work for instantiated methods
1328         in a generic class; fixes #77509.
1329         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1330         rather than calling it directly; fixes #77488.  
1331
1332 2006-02-08  Martin Baulig  <martin@ximian.com>
1333
1334         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1335         reporting into CheckConstraint() so we can use the correctly
1336         instantiated type.
1337
1338 2006-02-08  Martin Baulig  <martin@ximian.com>
1339
1340         * expression.cs (BaseAccess): Add support for generic methods.
1341
1342         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1343         the new MethodGroupExpr.
1344
1345 2006-02-07  Martin Baulig  <martin@ximian.com>
1346
1347         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1348         also reference types; fixes #77483.
1349
1350 2006-02-07  Martin Baulig  <martin@ximian.com>
1351
1352         * generic.cs
1353         (TypeManager.IsGenericMethod): We now return whether something is
1354         an instantiated generic method (and not a generic method def).
1355         (TypeManager.IsGenericMethodDefinition): New public method.
1356
1357         * typemanager.cs
1358         (TypeManager.CSharpSignature): Only include type arguments for
1359         "real" generic methods, not for any instantiated method.
1360         (TypeManager.GetMethodName): Likewise, but also allow generic
1361         method definitions here.
1362
1363 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1364
1365         * codegen.cs (EmitScopeInitFromBlock): check here the
1366         capture_context, there is no need to make two calls to the
1367         EmitContext. 
1368
1369         * anonymous.cs: Add some debugging messages that might help me
1370         track other instances of this problem in the future (the
1371         regression of test 467).
1372
1373         * cs-parser.jay: track the variable block, as we need to initalize
1374         any captured variables declared in this block for the "catch"
1375         portion of the "Try" statement.
1376
1377         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1378         scope initialization for captured variables. 
1379
1380         Also, move the emit for the variables after the block location has
1381         been marked.
1382
1383 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1384
1385        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1386         
1387 2006-02-06  Martin Baulig  <martin@ximian.com>
1388
1389         * class.cs (TypeContainer.DefineType): If we're a struct, pass
1390         `TypeManager.value_type' as parent type to
1391         ModuleBuilder.DefineType().  Fixes #77358.      
1392
1393 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1394
1395         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1396         commit yesterday, the initialization for the roots is necessary.
1397         What is not necessary is the scope activation.
1398
1399 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1400
1401         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1402         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1403         CS0206 checks.
1404         (Argument.Resolve): Remove CS0206 checks.
1405
1406 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1407
1408         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1409         scopes for all the roots, the scopes will now be emitted when the
1410         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1411
1412         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1413         code.  This reduces a lot of existing cruft.
1414         
1415         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1416         that the ScopeInfo is generated as we enter the scope, not at the
1417         time of use, which is what we used to do before.
1418
1419         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1420         every time a Block is about to be emitted if we have a
1421         CaptureContext. 
1422
1423 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1424
1425         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1426         attribute for mscorlib too.
1427
1428         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1429         (Reset): Update.
1430         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1431
1432         * typemanager.cs (cons_param_array_attribute): Make private.
1433         (Reset): Set it to null.
1434         (InitCoreHelpers): Don't initialize it.
1435         (ConsParamArrayAttribute): New.  Initialize it as needed.
1436         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1437
1438 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1439
1440         * expression.cs: There might be errors reported during the
1441         selection of applicable methods.  If there are errors, do not
1442         continue execution as it will lead the compiler to crash.
1443
1444 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1445
1446         * expression.cs: Member access is not allowed on anonymous
1447         methods.  Fixes #77402.
1448
1449 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1450
1451         Fix #77401
1452         * cs-parser.jay (VariableDeclaration): Don't set
1453         current_array_type to null.
1454         (field_declaration, event_declaration, declaration_statement):
1455         Set it to null here.
1456
1457 2006-01-29  Raja R Harinath  <harinath@gmail.com>
1458
1459         Fix part of #77397
1460         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1461
1462 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1463
1464         * typemanager.cs (GenericParameterPosition): New.
1465         * doc.cs: Use it.
1466
1467 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1468
1469         * doc.cs : To process "include" elements, first we should create
1470           another list than XmlNodeList, because it could result in node
1471           removal, which could result in that the XmlNodeList gives up
1472           yielding next node.
1473
1474 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1475
1476         * expression.cs: Introduce an error report that we were not
1477         catching before.   Gonzalo ran into it.
1478
1479 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1480
1481         A fix for bug: #76957
1482         
1483         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1484         ComputeMethodHost before creating the method, this is a new
1485         requirement. 
1486
1487         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1488         that this method references (RegisterScope).  The actual scope
1489         where the method is hosted is computed with the ComputeMethodHost
1490         before we create the method.
1491
1492         Moved the Deepest routine here.
1493
1494         (AnonymousContainer.ComputeMethodHost): New routine used to
1495         compute the proper ScopeInfo that will host the anonymous method.
1496
1497         (ScopeInfo): Deal with multiple roots.  The problem was that we
1498         did not have a unique root where all ScopeInfos could be hanged
1499         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1500         of roots.  
1501
1502         Remove AdjustMethodScope which is now computed at the end.  Remove
1503         LinkScope which did a partial link, instead link all ScopeInfos
1504         before code generation from the new "LinkScopes" routine. 
1505
1506         Simplify all the Add* routines as they no longer need to maintain
1507         the tree, they just need to record that they are using variables
1508         from a ScopeInfo.
1509
1510         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1511         routines to produce the forest of ScopeInfo trees.
1512
1513         * class.cs (TypeContainer.AppendMethod): This is just like
1514         AddMethod, but ensures that an interface implementation method
1515         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1516         methods, but at the end.
1517
1518         We use this functionality to ensure that the generated MoveNext
1519         method in the iterator class is resolved/emitted before the
1520         enumerator methods created.   
1521
1522         This is required because the MoveNext method computes the right
1523         ScopeInfo for the method.  And the other methods will eventually
1524         need to resolve and fetch information computed from the anonymous
1525         method. 
1526
1527         
1528 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1529
1530         Improve implementation of section 14.4.2.2 (Better function member).
1531         * expression.cs (Invocation.MoreSpecific): Compare all type
1532         arguments before deciding if one type is more specific than
1533         another.  Handle array types too.  Return the more specific type.
1534         (Invocation.BetterFunction): Add more tie-breaking rules from
1535         section 14.4.2.2.  Perform "more specific" check after
1536         other tie-breaking rules.  Compare all parameter types before
1537         choosing the "more specific" method.
1538
1539 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1540             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1541
1542         Fix rest of #76995.
1543         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1544         the 'aliases' hash.
1545         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1546         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1547
1548 2006-01-18  Martin Baulig  <martin@ximian.com>
1549
1550         * class.cs (TypeContainer.AddToMemberContainer): Use
1551         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1552         fixes #77124.
1553
1554 2006-01-18  Martin Baulig  <martin@ximian.com>
1555
1556         Fix #76417: a generic class may now have methods which may unify
1557         for some type parameter substitutions.
1558
1559         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1560         for methods which may unify anymore.
1561
1562         * expression.cs (Invocation.MoreSpecific): New private static
1563         method; checks whether one method is more specific than another
1564         according to 14.4.2.2 of the spec.
1565         (Invocation.BetterFunction): Implement the tie-breaking rules from
1566         14.4.2.2 of the spec: if two methods unify for some type parameter
1567         substitution, we need to pick the more specific one.
1568
1569 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1570
1571         Fix #76656, cs0231-2.cs.
1572         * cs-parser.jay (formal_parameter_list): Make error case catch
1573         more issues.
1574         (parenthesized_expression_0): Add CS1026 check.
1575         (invocation_expression): Remove unused { $$ = lexer.Location }.
1576
1577 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1578
1579         Fix #76824.
1580         * cs-parser.jay (statement_expression): Don't list out the
1581         individual statement-expressions.  Convert syntax error into
1582         CS0201 check.
1583
1584 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1585
1586         Fix #76874.
1587         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1588         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1589         CheckIntermediateModification.
1590         (FieldExpr.DoResolve): Add new two-argument version that
1591         allows us to resolve the InstanceExpression as an lvalue.
1592         The one-argument variant is now just a wrapper.
1593         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1594         Resolve the lhs as an lvalue if the it has a value type.
1595         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1596         from Assign.DoResolve.
1597         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1598         resolved as an lvalue.
1599         (PropertyExpr.DoResolve): Update.
1600         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1601         has a value type.  Move CS1612 check here from
1602         CheckIntermediateModification.
1603         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1604         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1605         'right_side' of a ResolveLValue on an 'out' argument.
1606         (EmptyExpression.LValueMemberAccess): New.  Used as the
1607         'right_side' of a propagated ResolveLValue on a value type.
1608         (LocalVariableReference.DoResolveBase): Recognize
1609         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1610         Add CS1654 check.
1611         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1612         EmptyExpression.Null.
1613
1614 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1615
1616         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1617           Type.IsGenericParameter(). Fixed bug #77183.
1618         * doc.cs : it is now identical to doc.cs in mcs.
1619
1620 2006-01-16  Martin Baulig  <martin@ximian.com>
1621
1622         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1623
1624 2006-01-16  Martin Baulig  <martin@ximian.com>
1625
1626         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1627         ctors; fixes #77250.
1628
1629 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1630
1631         This fixes the problem where we used ldfld instead of ldflda to
1632         load the "THIS" pointer on captured parameters, when THIS is a
1633         value type.  See bug #77205.
1634         
1635         * iterators.cs (CapturedThisReference.Emit): Pass false to
1636         EmitThis (we do not need the address).
1637
1638         * codegen.cs (EmitThis): it needs to know whether we need the
1639         address of `this' or not.  This is used by value types.  
1640
1641         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1642         every other call passes false.
1643
1644 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1645
1646         Fix #77221.
1647         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1648         GetOverride.
1649         * expression.cs (Invocation.OverloadResolve): Update.
1650         (Invocation.DoResolve): Avoid double resolution of invocation.
1651
1652 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1653
1654         Fix #77180.
1655         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1656         unary negation of floating point types as 0-expr; negation cannot
1657         overflow in floating point types.
1658
1659         Fix #77204.
1660         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1661         on operands of 'void' type.
1662
1663         Fix #77200.
1664         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1665         and ExclusiveOr for boolean constants too.
1666
1667 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1668
1669         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1670
1671 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1672
1673         * cs-tokenizer.cs (Position): New class used to save and restore
1674         the position state in the tokenizer.  Before this patch the save
1675         and restore was not complete enough so the line and columns would
1676         start to drift and the debugger and stack traces will get the
1677         wrong data.
1678
1679 2006-01-10  Martin Baulig  <martin@ximian.com>
1680
1681         * generic.cs
1682         (TypeParameter.InflateConstraints): New public method.
1683
1684         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1685         constraints; fixes #77042.
1686
1687 2006-01-10  Martin Baulig  <martin@ximian.com>
1688
1689         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1690         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1691         #77061. 
1692
1693 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1694
1695         Fix #75636.
1696         * expression.cs (Invocation.OverloadResolve): Replace reflected
1697         override methods with their base virtual methods, rather than
1698         skipping over them.
1699         * typemanager.cs (TypeManager.GetOverride): New.
1700
1701 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1702
1703         * driver.cs: Report the case of no source files and no -out:
1704         argument provided.
1705
1706 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1707
1708         Fix #77035.
1709         * expression.cs (ComposedCast.GetSignatureForError): Define.
1710
1711 2006-01-05  Jb Evain  <jbevain@gmail.com>
1712
1713         * class.cs (Property.Define, Indexer.Define): do not tag the
1714         properties as SpecialName | RTSpecialName.
1715
1716 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1717
1718         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1719         doing a low-level comparission of parameter types.  It was lacking
1720         a check for __argslist. 
1721
1722 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1723
1724         * expression.cs (ParameterReference.DoResolveBase): Allow
1725         reference parameters if they are local to this block. 
1726
1727         This allows the ref and out parameters of a delegate to be used in
1728         an anonymous method, for example:
1729
1730         delegate void set (out int x);
1731
1732         set s = delegate (out int x){
1733                 x = 0;
1734         };
1735
1736         This is used by functionality introduced late in the C# language.
1737         
1738         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1739         method that take ref and out parameters. 
1740
1741         Fixes #77119 which was a late change in the spec.
1742
1743 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1744
1745         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1746         parent if its the same scope.  Fixes #77060.
1747
1748 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1749
1750         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1751
1752 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1753
1754         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1755         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1756         that doesn't contain the full public key. This is a update of the
1757         friend assemblies in .Net 2.0 release.
1758         
1759 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1760
1761         Fix #76995
1762
1763         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1764         ListDictionary, to contain the ExternAliasEntry entries (in
1765         addition to the NamespaceEntry.aliases hashtable). This field is
1766         shared between the original entry and its doppelganger (bodyless 
1767         copy of it).
1768         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1769         extern_aliases field.
1770         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1771         lookup in extern_aliases.
1772
1773 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1774
1775         Fix #77006.
1776         * class.cs (TypeContainer.Mark_HasEquals): New.
1777         (TypeContainer.Mark_HasGetHashCode): New.
1778         (ClassPart): Override them.
1779         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1780
1781         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1782         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1783         DeclSpace.
1784
1785         Fix #77008.
1786         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1787         'parent' argument to the base constructor.
1788
1789         Remove all mention of TypeContainer from decl.cs.
1790         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1791         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1792         (DeclSpace.DeclSpace): Likewise.
1793         (DeclSpace.DefineMembers): Remove unused argument.
1794         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1795         debugging check -- we don't care if the debug code throws an
1796         InvalidCastException instead of an InternalErrorException.
1797         * class.cs (TypeContainer.DefineMembers): Update to changes.
1798         (TypeContainer.DoDefineMembers): Likewise.
1799         (TypeContainer.GetMethods): Likewise.
1800         (PropertyMember.Define): Likewise.
1801         (MemberBase.Parent): New property that forwards to
1802         MemberCore.Parent, but ensures that we get a TypeContainer.
1803         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1804         (RootContext.PopulateTypes): Likewise.  Remove special case code
1805         for !RootContext.StdLib: DefineMembers is idempotent.
1806
1807 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1808
1809         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1810
1811 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1812
1813         * doc.cs : The search for referenced namespace was insufficient to
1814           get global one as it used to do. Fixed bug #76965.
1815
1816 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1817
1818         * doc.cs : check name in cref in the last phase that whether it is
1819           namespace or not.
1820
1821 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1822
1823         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1824           Mono.C5.
1825
1826 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1827
1828         * doc.cs : so it turned out that we cannot skip override check for 
1829           interface members. Fixed bug #76954.
1830
1831 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1832
1833         * cs-tokenizer.cs : fixed bug #75984:
1834           - #warning and #error should not be handled when the source line
1835             is disabled.
1836           - #line is not checked strictly when the source line is disabled.
1837           - #define and #undef is on the other hand checked strictly at any
1838             state.
1839
1840 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1841
1842         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1843           CS1027 report.
1844
1845 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1846
1847         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1848
1849         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1850         nested types.
1851
1852 2005-12-14  Martin Baulig  <martin@ximian.com>
1853
1854         * typemanager.cs (TypeManager.GetFullName): Make this public;
1855         `Type.Fullname' now never returns null.
1856
1857         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1858         explicit interface implementations; we're now using the same
1859         naming convention than csc does.
1860
1861 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1862
1863         * convert.cs (ExplicitConversionCore): Check the return value from
1864         ExplicitConversionCore which can return null on failure.  Fixes #76914
1865
1866 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1867
1868         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1869         instead of IsGenericInstance.
1870         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1871         code that's now covered by the more general test.
1872         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1873
1874         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1875         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1876         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1877         * generic.cs, report.cs, typemanager.cs: Likewise.
1878
1879 2005-12-08  Martin Baulig  <martin@ximian.com>
1880
1881         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1882
1883         * typemanager.cs (TypeManager.CSharpSignature): Include type
1884         arguments in the signature of a generic method.
1885
1886 2005-12-07  Martin Baulig  <martin@ximian.com>
1887
1888         Add support for custom attributes on type parameters.
1889
1890         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1891
1892         * generic.cs (TypeParameterName): New public class; we use this
1893         instead of a `string' to store the name of a type parameter, so we
1894         can also have `Attributes'.
1895         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1896         array instead of a `string[]' array.
1897         (TypeParameter.ctor): We now also take an `Attributes' argument.
1898         (TypeParameter.EmitAttributes): New public method; emit our
1899         `OptAttributes' here.
1900         (GenericMethod.EmitAttributes): New public method; emit the custom
1901         attributes on all our type parameters.
1902
1903         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1904         our type parameters.
1905         (MethodData.Define): If we're a generic method, call
1906         EmitAttributes() on it.
1907
1908 2005-12-07  Martin Baulig  <martin@ximian.com>
1909
1910         * generic.cs
1911         (ConstraintChecker): New public abstract class; move the
1912         constraint checking here from `ConstructedType' and also do
1913         constraint checking for generic methods here.
1914
1915         * expression.cs (Invocation.OverloadResolve): Use
1916         ConstraintChecker.CheckConstraints() if we resolved to a generic
1917         method.  Fix #76806.
1918
1919 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1920
1921         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1922
1923         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1924         event initializers.
1925         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1926         (FieldBase.Initializer): Initializer is now optional.
1927         (EventField.Define): Only event field can have initializer.
1928
1929         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1930
1931         * const.cs (Const): Reuse initializer.
1932
1933         * cs-parser.jay: Updated after FieldBase changes.
1934         Added current_array_type to simplify array initializers.
1935
1936         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1937
1938         * expression.cs, iterators.cs: Updated.
1939
1940         * namespace.cs (NamespaceEntry): Made UsingFound private.
1941
1942 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1943
1944         * parameterCollection.cs: Obsolete, removed.
1945         * parser.cs: Obsolete, removed.
1946
1947 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1948
1949         Fix #76849.
1950         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1951
1952         * enum.cs (Enum.Define): Set obsolete context here.
1953
1954 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1955
1956         * doc.cs :
1957           - FindDocumentedMember() now expects 1) paramList as null
1958             when "we don't have to check the number of parameters" and
1959             2) Type.EmptyTypes when "there is no arguments".
1960           - Introduced FoundMember struct to hold the exact type which was
1961             used to find the documented member (the above change broke
1962             test-xml-044; it might be better just to use DeclaringType than
1963             what MS does, like this change does, but it depends on usage.)
1964
1965 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1966
1967         * doc.cs : documented member might be from DeclaringType for nested
1968           types. Fixed bug #76782.
1969
1970 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1971
1972         * anonymous.cs: Have the param code handle leaving copies on the
1973         stack etc. Allows anonymous params to take part in the assignment
1974         code (++, +=, etc). Fixes bug #76550
1975
1976         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1977         it down to the anon code.
1978
1979         * iterators.cs: Use dummy var here
1980
1981         * codegen.cs: Handle new vars
1982
1983 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1984
1985         Fix #76849.
1986         * class.cs (MethodData.Define): Set proper Obsolete context.
1987
1988         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1989         obsolete context.
1990         (FieldExpr.DoResolve): Ditto.
1991
1992 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1993
1994         Fix #76849.
1995         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1996         parent is not obsolete.
1997
1998 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1999
2000         * doc.cs : (FindDocumentedMember) find parameterless members first
2001           and get CS0419 in the early stage. Fixed first case of bug #76727.
2002
2003 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2004
2005         Fix #76859.
2006         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2007         no error was reported.
2008
2009         *expression.cs (Binary.DoResolve): left can be null.
2010
2011 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2012
2013         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2014         abstract method and all overrides.
2015         * support.cs (ParameterData.GenericConstraints): Delete.
2016         (ReflectionParameters.type_params): Delete.
2017         (ReflectionParameters.ReflectionParameters): Make private.
2018         (ReflectionParameters.GetConstaints): New factory method.
2019         * generic.cs (TypeParameterDefineType): Use it.
2020         (TypeManager.GetTypeParameterConstraints): Likewise.
2021
2022 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2023
2024         Fix #76783.
2025         * class.cs (MethodData.Emit): Parameters should be labeled first.
2026
2027 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2028
2029         Fix #76761.
2030         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2031
2032 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2033
2034         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2035
2036         * class.cs (MethodCore): Parameter clean up.
2037         (IMethodData): Added ParameterInfo.
2038         (MethodData): Parameter clean up.
2039         (Indexer.Define): Parameter clean up.
2040
2041         * anonymous.cs,
2042         * codegen.cs,
2043         * cs-parser.jay,
2044         * decl.cs,
2045         * doc.cs,
2046         * ecore.cs,
2047         * flowanalysis.cs,
2048         * iterators.cs,
2049         * pending.cs,
2050         * statement.cs,
2051         * typemanager.cs: Parameter clean up.
2052
2053         * delegate.cs (Define): Get rid of duplicated code.
2054
2055         * expression.cs (ParameterReference): Removed useless parameters
2056         and simplified.
2057         (Invocation): Ditto.
2058
2059         * parameter.cs (ParamsParameter): New class, params specialization.
2060         (ArglistParameter): Attemp to separate arglist.
2061         (Parameter): Refactored to be reusable and faster.
2062         (Parameter.Modifier): Made understandable.
2063         (Parameters): Changed to be used as a class for `this' assembly
2064         parameters. Refactored to use new specialized classes.
2065
2066         * support.cs (ParameterData): Added Types property.
2067         (InternalParameters): Deleted.
2068
2069 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2070
2071         * doc.cs : the previous patch does not actually fix the bug.
2072           PropertyInfo override check is now implemented and really fixed it.
2073         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2074
2075 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2076
2077         * doc.cs : apply "override filter" also to properties.
2078           Fixed bug #76730.
2079
2080 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2081
2082         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2083           no need to check overrides. For classes, omit those results from 
2084           interfaces since they must exist in the class. Fixed bug #76726.
2085
2086 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2087
2088         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2089           with different parameters. Fixed the second problem in #76685.
2090
2091 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2092
2093         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2094           get expected 'protected' access in CheckValidFamilyAccess()).
2095           Fixed bug #76692.
2096
2097 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2098
2099         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2100           Fixed bug #76705.  CS1569 was incorrectly commented out.
2101
2102 2005-11-23  Martin Baulig  <martin@ximian.com>
2103
2104         * generic.cs (Constraints.Define): Removed.
2105         (TypeParameter.DefineConstraints): Removed.
2106         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2107         on the GenericTypeParameterBuilder here.
2108
2109 2005-11-23  Martin Baulig  <martin@ximian.com>
2110
2111         * typemanager.cs (TypeManager.GetProperty): Make this public.
2112
2113         * generic.cs (Nullable.NullableInfo.ctor): Use
2114         TypeManager.GetProperty() rather than using reflection directly.
2115
2116 2005-11-17  Martin Baulig  <martin@ximian.com>
2117
2118         * expression.cs (Indexers.GetIndexersForType): Added support for
2119         generic parameters; fixes #76587.
2120
2121 2005-11-17  Martin Baulig  <martin@ximian.com>
2122
2123         * anonymous.cs
2124         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2125         inherit the scope from our parent.  Fixes #76653.
2126
2127 2005-11-15  Martin Baulig  <martin@ximian.com>
2128
2129         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2130         instead of `ScopeTypeBuilder' to refer to the "current" type.
2131         (AnonymousMethod.CreateScopeType): Correctly create the helper
2132         class if we're inside a generic type definition.
2133
2134 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2135
2136         * doc.cs : use Invocation.IsOverride() to do real override check.
2137         * expression.cs : made Invocation.IsOverride() internal.
2138
2139 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2140
2141         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2142           TypeBuilder.FindMembers() and filter overriden base members out.
2143           Fixed bug #76990.
2144
2145 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2146
2147         * doc.cs : ref/out parameters are represented as '@' (instead of
2148           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2149
2150 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2151
2152         * doc.cs : when there was no '.' in cref to methods in doc comment,
2153           then parameters were missing in the output. Fixed bug #76691.
2154
2155 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2156
2157         * driver.cs : don't output docs when there is an error.
2158           Fixed bug #76693.
2159
2160 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2161
2162         * doc.cs :
2163           Now it should detect indexers. Fixed primary concern in bug #76685.
2164           Fixed CS0419 message to not show the identical member signature in
2165           the message.
2166
2167 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2168
2169         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2170           instead of Type.FindMembers() since it does not handle events.
2171           Fixed bug #71604.
2172
2173 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2174
2175         * codegen.cs: Fixed typo (speficied -> specified).
2176
2177 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2178
2179         Fix #76369.
2180         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2181
2182 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2183
2184         * attribute.cs: Changed error message.
2185
2186         * cs-tokenizer.cs: One more check.
2187
2188 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2189
2190         * statement.cs (Block.Resolve): Ignore empty statement.
2191
2192 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2193
2194         * report.cs: Made error/warning methods more strict to avoid
2195         their misuse.
2196
2197         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2198         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2199         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2200         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2201
2202 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2203
2204         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
2205         Use the more explicit AssemblyName.FullName instead of 
2206         AssemblyName.Name to report errors.
2207         
2208 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2209
2210         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2211         with mcs.
2212
2213 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2214
2215         * class.cs,
2216         * convert.cs,
2217         * cs-parser.jay,
2218         * decl.cs,
2219         * enum.cs,
2220         * expression.cs,
2221         * generic.cs,
2222         * pending.cs,
2223         * report.cs: Fixed error reporting and typos.
2224
2225         * generic.cs (TypeParameter.GetSignatureForError): New method.
2226         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2227
2228         * typemanager.cs (GetFullName): Refactored.
2229
2230 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2231
2232         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2233         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2234
2235         * class.cs (TypeContainer.IsComImport): New property.
2236         (Constructor.Define): Create proper ctor for ComImport types.
2237
2238         * expression.cs (New.CheckComImport): Fixed.
2239
2240 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2241
2242         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2243         that a parameter has been captured does not mean that we do not
2244         have to do the rest of the processing.  This fixes the second part
2245         of #76592.  If there was another anonymous method capturing
2246         values in the past, the Scope would never be set for the second
2247         method that captured the same parameter.
2248
2249         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2250         properly manipulate the stack.   Second part of fix for #76592.
2251
2252         * expression.cs (New): Add support for invoking "new" on
2253         interfaces that have been flagged with the ComImport attribute and
2254         the CoClass.  Fixes #76637 
2255
2256         * statement.cs (Try.DoEmit): When a variable is captured, do not
2257         try to emit the vi.LocalBuilder variable as it has been captured.
2258         Create a temporary variable and store the results on the
2259         FieldBuilder.  Fixes #76642
2260
2261 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2262
2263         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2264
2265         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2266
2267         * expression.cs (Binary.DoResolve): Added && optimalization.
2268     
2269         * typemanager.cs (AddUserType): Removed useless argument.
2270
2271 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2272
2273         * statement.cs (Block.variables): Uses ListDictionary.
2274
2275 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2276
2277         Fix #75969.
2278         * class.cs (PartialContainer.EmitType): Customized to emit
2279         security attributes.
2280         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2281         for partial classes.
2282
2283 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2284
2285         Fix #76599.
2286         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2287         access has to be fixed.
2288         
2289         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2290
2291 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2292
2293         Fix #76590.
2294         * ecore.cs (NullCast.Reduce): Implemented.
2295
2296         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2297         constant type.
2298         
2299         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2300         properly.
2301         (Foreach.Resolve): Catch null properly.
2302
2303 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2304  
2305         * cs-tokenizer.cs: Warning text fix.
2306
2307         * driver.cs: AllWarningNumbers exposed on public interface.
2308
2309         * report.cs (): Reviewed warning numbers.
2310         (IsValidWarning): Use binary search.
2311
2312 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2313  
2314         * driver.cs: Implemeted resource visibility.
2315         (Resources): New class for code sharing between /res: and
2316         /linkres:
2317  
2318 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2319
2320         decl.cs (CurrentTypeParameters): Fixed to be public.
2321
2322 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2323
2324         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2325
2326 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2327
2328         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2329
2330 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
2331
2332         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2333
2334 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2335
2336         Add friend assembly access support.
2337         * typemanager.cs: assembly_internals_vis_attrs
2338         cache for friend assembly access. 
2339         (TypeManager.IsFriendAssembly): New method for
2340         checking friend assembly access.
2341         (TypeManager.Error_FriendAccessNameNotMatching): New
2342         helper method.
2343         (TypeManager.CompareKeyTokens): Likewise.
2344         (TypeManager.Filter): Handle friend accessible
2345         members.
2346
2347         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2348         friend accessible types.
2349
2350         * ecore.cs (Expression.IsAccessorAccessible): Handle
2351         friend accessible properties.
2352
2353         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2354         accessible types.
2355         
2356 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2357
2358         Fix #76568.
2359         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2360         folding.
2361         
2362         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2363         contants only.
2364         
2365         * ecore.cs (NullCast): Child is contant only.
2366         
2367         * literal.cs (NullLiteral.Reduce): null can be converted to any
2368         reference type.
2369
2370 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2371
2372         * driver.cs: Use Encoding.Default as default code page instead
2373           of ISO-28591.
2374
2375 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2376
2377         Fix #76085.
2378         * expression.cs (Invocation.Error_InvalidArguments): Handle
2379         __arglist parameters.
2380         (Invocation.VerifyArgumentsCompat): Likewise.
2381         * support.cs (ReflectionParameters.GetSignatureForError): Print
2382         __arglist parameters.
2383         (InternalParamters.GetSignatureForError): Likewise.
2384         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2385
2386 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2387
2388         * attribute.cs (GetPropertyValue): Made public.
2389
2390         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2391         Resolve.
2392         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2393         attribute.
2394         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2395         is not defined.
2396         
2397         * driver.cs: Reflect method name change.
2398         
2399         * statement.cs (Try.Resolve): Warn when try has both general
2400         exception handlers.
2401         
2402         * typemanager.cs: runtime_compatibility_attr_type new predefined
2403         type.
2404
2405 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2406
2407         Fix #76419.
2408         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2409         treat it as an empty parameter list.
2410
2411 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2412
2413         Fix #76271.     
2414         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2415         ResolveAsTypeStep silent.
2416         * statement.cs (Block.AddConstant): Mark block as used.
2417         (Block.ResolveMeta): Avoid piling on error messages
2418         if a constant initializer resolution fails.
2419
2420 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2421
2422         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2423         Remove.
2424         (NamespaceEntry.VerifyAllUsing): New.
2425         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2426         behaviour.  Delegates actual resolution of alias to ...
2427         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2428         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2429         Update.
2430         * driver.cs (Driver.MainDriver): Update.
2431         
2432         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2433         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2434         property.
2435         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2436         Remove.
2437         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2438         RootNamespace.DefineNamespacesForAll.
2439
2440 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2441
2442         * typemanager.cs (assemblies, external_aliases, modules)
2443         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2444         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2445         overhead.  Move resposibility ...
2446         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2447         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2448
2449 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2450
2451         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2452         cached_namespaces.  Improve usage.
2453         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2454         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2455         Move from GlobalRootNamespace and simplify.
2456         (RootNamespace.Global): Make instance variable.
2457         (RootNamespace.RootNamespace): Add "alias name" parameter.
2458         (GlobalRootNamespace): Simplify drastically.
2459         (Namespace.Lookup): Don't use GetNamespace.
2460         * typemanager.cs (GetRootNamespace): Rename from
2461         ComputeNamespaceForAlias.
2462         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2463
2464 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2465
2466         * anonymous.cs (AnonymousContainer): Don't crash when container
2467         doesn't exist.
2468
2469 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2470
2471         * expression.cs (Binary.DoResolve): Warn when comparing same
2472         values.
2473
2474 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2475
2476         Fix #76486.
2477         * expression.cs (Binary.DoResolve): It looks like there are no
2478         convetsion rules in enum context.
2479
2480 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2481
2482         Add support for extern alias qualifiers.
2483         * typemanager.cs: Move some LookupTypeReflection code
2484         to namespace.cs, to have cleaner code. Added some methods
2485         to help us keep track of the extern aliased references.
2486         * driver.cs: Add suport for extern alias assemblies on command
2487         line and check for their warnings/errors. Also keep track of the
2488         extern aliased assemblies.
2489         * namespace.cs: Move the global functionality of Namespace
2490         to GlobalRootNamespace/RootNamespace. Now the global namespace
2491         is GlobalRootNamespace.Globa. Also the code moved from 
2492         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2493         Finally added LocalAliasEntry (AliasEntry before) and
2494         ExternAliasEntry, to handle alias statements.
2495         * cs-parser.jay: Add support in the grammar for extern alias
2496         statement.
2497         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2498         Update callings to Namespace (now in GlobalRootNamespace).
2499
2500 2005-10-25  Martin Baulig  <martin@ximian.com>
2501
2502         * convert.cs (ImplicitTypeParameterConversion): Make base
2503         interfaces actually work; fixes #76557.
2504
2505 2005-10-25  Martin Baulig  <martin@ximian.com>
2506
2507         * generic.cs
2508         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2509         all the type parameters; fixes #76551.
2510
2511 2005-10-25  Martin Baulig  <martin@ximian.com>
2512
2513         Fix #76472.
2514
2515         * generic.cs
2516         (GenericMethod.ctor): Added `Expression return_type' and
2517         `Parameters parameters' arguments.
2518         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2519         parameter and return types to check their constraints if they're
2520         generic types.
2521
2522         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2523         boolean field.
2524
2525         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2526         constraints of a generic type if `ec.ResolvingGenericMethod'.
2527
2528         * class.cs (MethodCore.DoDefineParameters): Set
2529         `ec.ResolvingGenericMethod' if we're a generic method.
2530         (MemberBase.MemberType): Likewise.
2531
2532 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2533
2534         * typemanager.cs (TypeManager): Added 
2535         TypeManager.internals_visible_attr_type to cache
2536         S.R.CompilerServices.InternalsVisibleToAttribute.
2537
2538         * codegen.cs (AssemblyClass): Added checks for 
2539         InternalsVisibleToAttribute in new method 
2540         CheckInternalsVisibleAttribute () and also cache the
2541         AssemblyName in AssemblyClass.Name.
2542         
2543 2005-10-24  Martin Baulig  <martin@ximian.com>
2544
2545         * typemanager.cs
2546         (TypeManager.ExpandInterfaces): Added overloaded version which
2547         just takes a `Type[]' array.
2548
2549         * generic.cs
2550         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2551         just use the interfaces which were explicitly specified and not
2552         the interfaces they inherit.  Fixes #76482.
2553         (TypeParameter.FindMembers): Expand the interfaces here.
2554
2555 2005-10-21  Martin Baulig  <martin@ximian.com>
2556
2557         * generic.cs
2558         (Constraints.Resolve): Also resolve the actual types here.
2559         (Constraints.ResolveTypes): Just check the constraints here.
2560         Fixes #76363; see gtest-218.cs.
2561
2562 2005-10-21  Martin Baulig  <martin@ximian.com>
2563
2564         * convert.cs
2565         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2566         instead of a `BoxedCast'; fixes gtest-217.cs.
2567
2568 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2569
2570         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2571           1) "new()" is specified as generic parameter constraint and 2) the
2572           type is TypeBuilder and 3) the type is abstract even if it has a
2573           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2574
2575 2005-10-20  Martin Baulig  <martin@ximian.com>
2576
2577         * generic.cs
2578         (GenericConstraints.TypeParameter): New public property.
2579         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2580         (TypeParameter.DeclSpace): New public property.
2581         (TypeParameter.DefineType): Inflate the constraints if our
2582         `DeclSpace' is an `Iterator'.   
2583
2584 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2585
2586         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2587           GenericMethod argument to compare methods' generic type arguments.
2588           Fixed bug #76382.
2589
2590 2005-10-19  Martin Baulig  <martin@ximian.com>
2591
2592         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2593         not ResolveType() when resolving the base type, so we're not
2594         checking the constraints here.
2595         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2596         if we have any.
2597
2598 2005-10-19  Martin Baulig  <martin@ximian.com>
2599
2600         * generic.cs (ConstructedType.CheckConstraints): Committing
2601         untested fix for #76441.
2602
2603 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2604
2605         Fix #76371.
2606         * class.cs (TypeContainer.DefineType): Move updating of
2607         topological sort earlier in the code.
2608         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2609
2610 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2611
2612         Fix #76273.
2613         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2614         
2615         * constant.cs (Constant.TryReduce): Moved from Cast class.
2616         (Reduce): Made little bit more OO and fixed missing conversions.
2617         
2618         * ecore.cs (Reduce): Implemented.
2619         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2620         
2621         * literal.cs (Reduce): Implemented.
2622         
2623         * class.cs: Reverted Miguel's wrong commit.
2624
2625 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2626
2627         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2628
2629 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2630
2631         * cs-parser.jay, expression.cs : CS0214 was missing error location
2632           for constants. Fixed bug #76404.
2633
2634 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2635
2636         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2637         InstanceExpression.
2638         (PropertyExpr.EmitCall): Likewise.
2639         * expression.cs (Invocation.EmitArguments): Handle case where
2640         arguments == null.
2641         (Invocation.EmitCall): Avoid allocating temporary variable if
2642         there are no arguments.
2643
2644 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2645
2646         Fix #76370.
2647         * convert.cs (ExplicitConversionCore): Fixed object->enum
2648         conversion.
2649
2650 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2651
2652         Fix #76323.
2653         * convert.cs (ImplicitConversionStandard): Move conversion of
2654         void* to arbitrary pointer types ...
2655         (ExplicitConversionStandard): .. here.
2656         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2657         error to always print typenames.
2658
2659 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2660
2661         * convert.cs (GetConversionOperator): Rename from
2662         GetConversionOperators.  Move operator selection code from ...
2663         (UserDefinedConversion): ... here.
2664
2665 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2666
2667         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2668         conversion.
2669
2670 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2671
2672         * assign.cs (Assign.DoResolve): Error method changed.
2673
2674         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2675         
2676         * const.cs (ResolveValue): Reset in_transit immediately.
2677         
2678         * constant.cs: Error method changed.
2679         
2680         * convert.cs: Removed useless location parameter.
2681         (ExplicitNumericConversion): Don't do double enum check.
2682         (ExplicitConversionCore): Renamed from ExplicitConversion.
2683         (ExplicitUnsafe): Extracted from ExplicitConversion.
2684         (ExplicitConversion): Uses for error reporting.
2685         
2686         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2687         error messages.
2688         (ResolveBoolean): Uses common error method.
2689         (CastToDecimal): Get rid of ec.
2690         (CastFromDecimal): Optimized.
2691         (ConvCast): Get rid of ec.
2692         
2693         * enum.cs (ResolveValue): Reset in_transit immediately.
2694         (Emit): Return after first error.
2695         
2696         * expression.cs: Convert changes.
2697         
2698         * literal.cs: Error method changed.
2699         
2700         * statement.cs: Error method changed.
2701
2702 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2703
2704         Fix gtest-131.cs and gtest-211.cs.
2705         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2706         Only emit code for a label if it is used.  Unreachable code can
2707         violate ECMA evaluation stack invariants.
2708
2709 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2710
2711         * anonymous.cs: Implemented ExprClassName.
2712         
2713         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2714         delegate.
2715         
2716         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2717         check.
2718         
2719         * class.cs (StaticClass.DefineContainerMembers): Report protected
2720         members as error.
2721         
2722         * codegen.cs: if(ed) PRODUCTION.
2723         
2724         * convert.cs (Error_CannotImplicitConversion): Better error
2725         distinction.
2726         
2727         * cs-parser.jay: More error checks.
2728         
2729         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2730         
2731         * driver.cs (CSCParseOption): Enabled wrong option check.
2732         
2733         * ecore.cs (Expression.ExprClassName): Turned to property.
2734         (MemberExpr.CheckIntermediateModification): For checking boxed
2735         value types     modification.
2736         
2737         * statement.cs (Fixed.Resolve): Expression type must be
2738         convertible to fixed type.
2739         (CollectionForeach.GetEnumeratorFilter,TryType):
2740         Small refactoring for easier error checking.
2741
2742 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2743
2744         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2745         attributes.
2746         
2747         * class.cs (GeneratedBaseInitializer): New class for customization
2748         compiler generated initializers.
2749         (MemberBase.DoDefine): Check Obsolete attribute here.
2750         (FieldMember.DoDefine): Ditto.
2751         
2752         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2753         constants.
2754         
2755         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2756         (MemberCore.GetObsoleteAttribute): Removed argument.
2757         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2758         (MemberCore.CheckObsoleteType): New helper.
2759         
2760         * delegate.cs,
2761         * enum.cs,
2762         * statement.cs: Updates after MemberCore changes.
2763         
2764         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2765         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2766         
2767         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2768         obsolete attribute for compiler construct.
2769         (As.DoResolve): Cache result.
2770         
2771         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2772
2773 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2774
2775         * expression.cs (Probe): instead of having a "Type probe_type"
2776         keep the extra information as a TypeExpr probe_type_expr since the
2777         "As" operator needs to perform some type checks.
2778
2779         * (As.DoResolve): If the type is a type parameter, ensure that it
2780         is constrained by a class.
2781
2782 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2783
2784         * statement.cs (Lock): Use the TemporaryVariable class instead of
2785         manually using local variables as those do not work when variables
2786         are captured.
2787
2788         * ecore.cs: Moved the TemporaryVariable class from being a nested
2789         class inside Foreach to be a public class that can be employed in
2790         other places. 
2791
2792 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2793
2794         * cs-parser.jay: interface_accessors replaced by
2795         accessor_declarations.
2796
2797         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2798         location.
2799         
2800         * statement.cs (GotoCase.Resolve): Convert null constant to
2801         null case.
2802         (SwitchLabel.ResolveAndReduce): Ditto.
2803         (SwitchLabel.NullStringCase): Custom null stamp.
2804         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2805         
2806         typemanager.cs (CSharpSignature): Don't skip first argument
2807         for full names.
2808
2809 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2810
2811         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2812         expression.cs, iterators.cs, literal.cs: Store constants and
2813         literals location.
2814         
2815         * class.cs (MemberBase.ShortName): Pass location.
2816         
2817         * cs-parser.jay: Some location fixes.
2818         
2819         * ecore.cs (Expression.Location): Made virtual.
2820
2821 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2822
2823         Fix #72930.
2824         * const.cs (Const.ResolveValue): Check for assigning non-null
2825         value to reference type.
2826
2827 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2828
2829         Fix #76133.
2830         * expression.cs (This.VerifyFixed): In a value type T, the type of
2831         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2832         value type R, 'this' is treated as a value parameter.
2833
2834 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2835
2836         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2837         if the underlying types are the same, otherwise we need to produce
2838         code that will do the proper cast.
2839
2840         This was exposed by Marek's constant rewrite which produced
2841         invalid code for the call site:
2842
2843         enum X : long { a }
2844         void Method (X v) {}
2845
2846         Method ((X) 5)
2847
2848         This fixes test-49.cs
2849
2850 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2851
2852         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2853           Type/Object should be allowed as well. Fixed bug #75968.
2854
2855 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2856
2857         * expression.cs : (Binary.DoResolve): when one is enum constant and
2858           another is constant 0, then return enum one *as enum type*.
2859           Fixed bug 74846.
2860
2861 2005-10-04  Martin Baulig  <martin@ximian.com>
2862
2863         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2864         `SetMemberIsUsed()' work for generics, too.
2865
2866 2005-10-04  Martin Baulig  <martin@ximian.com>
2867
2868         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2869         for corlib.  Fixes #75691.
2870
2871 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2872
2873         Fix #76255.
2874         * driver.cs: Fix compilation files with full root path.
2875
2876 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2877
2878         * report.cs (SymbolRelatedToPreviousError): Format the output so
2879         it does not use an open parenthesis that is never closed. 
2880
2881         * driver.cs: Follow coding guidelines
2882
2883 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2884
2885         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2886
2887         * location.cs (InEmacs): in this mode, do not report column
2888         location as it confuses Emacs.
2889
2890 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2891
2892         * support.cs (SeekableStreamReader.Position): Don't error out when
2893         the requested position is just beyond the end of the current
2894         buffered data.
2895
2896 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2897
2898         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2899         try to keep in sync with the byte count of the underlying Stream.
2900         However, this limits us to a window size of 2048 characters: i.e.,
2901         the maximum lookahead of our lexer/parser can be 2048 characters.
2902
2903 2005-09-22  Martin Baulig  <martin@ximian.com>
2904
2905         * driver.cs: Removed a debugging FIXME.
2906
2907 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2908
2909         * cs-parser.jay (type_arguments): Add CS1644 check.
2910         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2911
2912 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2913
2914         * Makefile (PROGRAM): Make profile specific.
2915         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2916         the current directory.
2917
2918         Fix test-455.cs.
2919         * expression.cs (Invocation.EmitCall): Remove optimization on
2920         this_call since it doesn't handle 'this' being a value type.
2921
2922 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2923
2924         * driver.cs: Ensure file handles are closed after parsing
2925
2926 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2927
2928         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2929         if the underlying types are the same, otherwise we need to produce
2930         code that will do the proper cast.
2931
2932         This was exposed by Marek's constant rewrite which produced
2933         invalid code for the call site:
2934
2935         enum X : long { a }
2936         void Method (X v) {}
2937
2938         Method ((X) 5)
2939
2940         This fixes test-49.cs
2941
2942 2005-09-05  Martin Baulig  <martin@ximian.com>
2943
2944         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2945         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2946
2947         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2948
2949 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2950
2951         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2952           to be a pointer type due to the spec 25.2, so check if declaring
2953           type is generic type definition. Fixed bug #75772.
2954
2955 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2956
2957         Fixed bug #75957.
2958         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2959           both types are not defined by methods.
2960         * expression.cs : (Invocation.IsApplicable): it should work when
2961           the argument type is equal to the parameter type, not only when
2962           ImplicitConversionExists() returns true.
2963
2964 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2965
2966         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2967         internal.
2968
2969         Fix #75941.
2970         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2971         flow-branching for LocalVariableReferences in case we were invoked
2972         from a MemberAccess.
2973         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2974         Carved out of ...
2975         (LocalVariableReference.DoResolveBase): ... this.
2976         (MemberAccess.Resolve): Do the check that was disabled during
2977         SimpleNameResolve.
2978
2979 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2980
2981         * class.cs :
2982           (PartialContainer.Create): check abstract/sealed/static strictly
2983           but abstract/sealed can exist only at one side. Fixed bug #75883.
2984
2985 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2986
2987         Fix #75945.
2988         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2989         specified, don't default to UnmanagedType.I4.
2990
2991 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2992
2993         * expression.cs : conditional operator should check possibly
2994           incorrect assign expression. Fixed bug #75946.
2995
2996 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2997
2998         Fix #75934.
2999         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3000         (ScopeInfo.EmitScopeType): Use it to construct field names from
3001         names of captured locals.
3002
3003         Fix #75929.
3004         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3005         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3006         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3007         (ExplicitConversion): Remove enum cases already handled by
3008         implicit conversion.  Move implicit conversion check to the beginning.
3009         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3010         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3011         Don't treat System.Enum as a struct.
3012
3013 2005-08-30  Jb Evain  <jbevain@gmail.com>
3014
3015         * attribute.cs: handles as expression in parameters.
3016
3017 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3018
3019         Fix #75802.
3020         * class.cs (TypeContainer.VerifyClsName): Don't use a
3021         PartialContainer when verifying CLS compliance.
3022         (AbstractPropertyEventMethod): Set Parent here, ...
3023         (PropertyMethod): ... not here.
3024
3025 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3026
3027         * attribute.cs : escaped attribute name should not be allowed to be
3028           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3029
3030 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3031
3032         Fix #75927.
3033         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3034         when converting a long constant to unsigned long.
3035         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3036         detect where IsApplicable and VerifyArgumentsCompat disagree.
3037
3038 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3039         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3040
3041         Fix #75848.
3042         * class.cs (TypeContainer.CanElideInitializer): New helper.
3043         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3044         can safely emitting the initializer of a field.
3045
3046 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3047
3048         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3049           allowed inside a switch (without loop). Fixed bug #75433.
3050
3051 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3052
3053         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3054         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3055
3056 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3057
3058         * driver.cs : kinda reverting the default encoding changes (not exact 
3059           revert since I noticed that "codepage:reset" might not work fine).
3060
3061 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3062
3063         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3064           Location. Now getter and setter store location correctly.
3065           (errors/cs0111-12.cs now reports the expected location.)
3066
3067 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3068
3069         * driver.cs : Use default encoding on the environment.
3070           Removed (now that) extra parameter for SeekableStreamReader.
3071         * support.cs : (SeekableStreamReader) third .ctor() argument for
3072           StreamReader is not required (always true). preamble size could
3073           be acquired in simpler and safe way.
3074
3075 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3076
3077         * cs-parser.jay: report CS0642 at warning level 3
3078           and report CS0642 for an if else statement also
3079           fixes bug #74745. Patch by John Luke (and a bit
3080           modified by me).
3081           Removed extra CS0642 warning check for "while",
3082           "for" and "fixed".
3083         * statement.cs: In Block.Resolve(), CS0642 check
3084           is reimplemented to check a sequence of an empty
3085           statement and a block.
3086
3087           Both fix bug #66777.
3088
3089 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3090
3091         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3092         detection until I fix it.
3093         
3094         * cs-tokenizer.cs: Changed error message.
3095         
3096         * cs-parser.jay: Fixed 2 error locations.
3097         
3098         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3099         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3100         properties.
3101         
3102         * enum.cs (GetSignatureForError): Fixed.
3103         
3104         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3105         method detection.
3106         
3107         * class.cs,
3108         * typemanager.cs (RegisterProperty): Removed.
3109         
3110         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3111
3112 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3113
3114         Fix #75874.
3115         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3116         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3117
3118 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3119
3120         * expression.cs : tiny fix is required for not warning positive ulong.
3121           See test-441.cs.
3122
3123 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3124
3125         * expression.cs : add CS0652 check for constant and integral
3126           expression. Fixed bug #53974.
3127
3128 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3129
3130         * expression.cs : in DoNumericPromotions(), check if there is implicit
3131           conversion overload for string (to check CS0034). Fixed bug #52492.
3132
3133 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3134
3135         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3136
3137 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3138
3139         * ecore.cs : report location when it is *not* Null.
3140
3141 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3142
3143         * codegen.cs,
3144           ecore.cs,
3145           flowanalysis.cs,
3146           expression.cs:
3147           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3148           correctly. Fixed bug #75721.
3149
3150 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3151
3152         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3153         loop that performs 'min (pos, char_count)'.
3154
3155         Fix #75862.
3156         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3157         converted value in Operator.OnesComplement.
3158
3159 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3160
3161         * anonymous.cs: If the anon method is pulled into a helper class,
3162         it needs to be `internal' not `private'. Fixes runtime behavior on
3163         msft. bug #75704
3164
3165 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3166
3167         Fix #75803
3168         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3169         is a partial class.
3170
3171 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3172
3173         The big constants rewrite
3174         Fix #75746, #75685 and more
3175         As a side effect saved 1MB for MWF ;-)
3176         
3177         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3178         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3179         enum based for corlib compilation.
3180         
3181         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3182         subtractions.
3183         
3184         * class.cs (FixedField.Define): Use ResolveAsConstant.
3185         
3186         * const.cs (IConstant): Interface constants and enums.
3187         (Const.ResolveValue): New method for constant resolvning.
3188         (ExternalConstant): Constants from imported assemblies.
3189         
3190         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3191         conversion; like enums.
3192         (Constant.ToType): Converts this constant to different type.
3193         (Constant.Increment): Adds 1.
3194         
3195         * convert.cs (ImplicitConversionRequired): Simplified.
3196         
3197         * cs-parser.jay: Create EnumMember directly.
3198         
3199         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3200         
3201         * doc.cs (GenerateEnumDocComment): Removed.
3202         
3203         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3204         (ConvertIntLiteral): Removed.
3205         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3206         
3207         * enum.cs (EnumMember): Implement IConstant.
3208         (Enum.IsValidEnumConstant): Removed.
3209         (Enum.GetNextDefaultValue): Removed.
3210         (Enum.FindMembers): Updated.
3211         (Enum.GenerateDocComment): Iterate enum members.
3212         
3213         * expression.cs (Cast.TryReduce): Handle enums correctly.
3214         (New.Constantify): Made public.
3215         (MemberAccess.DoResolve): Removed contant specific if(s).
3216         
3217         * literal.cs (NullLiteral): Implement new abstract methods.
3218         
3219         * statement.cs (GotoCase.Resolve): Use new constant methods.
3220         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3221         
3222         * typemanager.cs (LookupEnum): Removed.
3223         (IsEnumType): Fixed to work with corlib.
3224         (RegisterConstant): Removed.
3225         (LookupConstant): Removed.
3226         (GetConstant): Changed to work with IConstant.
3227
3228 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3229
3230         * location.cs : Fixed overflown (>255) column number.
3231
3232 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3233
3234         First cut of the qualified-alias-member feature.
3235         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3236         token.
3237         * cs-parser.jay (DOUBLE_COLON): New token.
3238         (namespace_or_type_name): Add rule for recognizing
3239         qualified-alias-members.
3240         (primary_expression): Likewise.
3241         (element_access): Allow QualifiedAliasMember as a possible
3242         type-bearing expression.
3243         (local_variable_type, local_variable_pointer_type): Likewise.
3244         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3245         aliases in the current and enclosing namespace declarations.
3246         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3247         * decl.cs (MemberName.is_double_colon): New.
3248         (MemberName.MemberName): Add new constructor for alias-member.
3249         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3250         * expression.cs (QualifiedAliasMember): New expression type.
3251
3252 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3253
3254         * location.cs : it borked when no argument was specified.
3255
3256 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3257
3258         * location.cs : tiny ToString() format fix.
3259
3260 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3261
3262         * statement.cs : oops, it was missing.
3263
3264 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3265
3266         A set of fixes for precise line/column location.
3267
3268         * location.cs :
3269           "token" field now holds a file/line "delta", a line number offset 
3270           from the segment, and a column number. See also:
3271           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3272           December/009508.html
3273           Removed static IsNull. Use instance IsNull property instead.
3274         * cs-tokenizer.cs :
3275           For some tokens it stores Location. For Identifier it stores
3276           LocatedToken which is a pair of string name and location.
3277           Column numbers are adjusted only at getChar().
3278         * report.cs :
3279           Use Location.ToString() for reporting (it now contains column).
3280         * cs-parser.jay :
3281           Largely modified to use LocatedToken instead of
3282           string (IDENTIFIER), and to acquire Location from some tokens.
3283         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3284           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3285           codegen.cs :
3286           Now MemberName holds Location. DeclSpace.ctor() receives Location
3287           as a parameter. Removed extra parameters to all derived classes.
3288           Replaced Location.IsNull() with instance property.
3289         * assign.cs, expression.cs :
3290           Added .ctor() overload that omits Location.
3291         * attribute.cs :
3292           Added "nameEscaped" flag that indicates the identifier was escaped
3293           in the source file. This fixes bug #57047.
3294
3295 2005-09-02  Martin Baulig  <martin@ximian.com>
3296
3297         * class.cs: Make CS3005 a warning, not an error.
3298
3299 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3300
3301         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3302         New method, looking for lo-case imported cls type.
3303
3304         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3305         here.
3306
3307         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3308
3309         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3310
3311         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3312         all_imported_types.
3313         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3314
3315         Optimized to save 3.5 MB for SWF compilation.
3316
3317 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3318
3319         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3320         (PartialContainer.Create): Moved logic AddToContainer.
3321         (PartialContainer.MarkForDuplicationCheck): Shares name.
3322         
3323         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3324         place.
3325         
3326         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3327         initialization.
3328         (Namespace.GetSignatureForError): New method.
3329         
3330         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3331         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3332
3333 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3334
3335         Fix #75669.
3336         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3337         member lookup rather than qualifier_type, since qualifier_type can
3338         be null.
3339
3340 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3341
3342         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3343         enum member.
3344
3345 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3346
3347         * statement.cs: Copy the local exception into the exception
3348         captured local.  Fixes 75674
3349
3350 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3351
3352         Fix #75658.
3353         * expression.cs (Invocation.OverloadResolve): Don't report error
3354         CS1501 if error CS1502 has been reported.
3355         (New.DoResolve): Delegate CS1501 reporting to
3356         Invocation.OverloadResolve.
3357
3358         Fix #75656.
3359         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3360         invariant-meaning-in-block property in an enclosing block if
3361         necessary.
3362
3363 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3364
3365         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3366         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3367         (Switch.CheckSwitch): Just save 50kb for SWF.
3368
3369 2005-07-27  Martin Baulig  <martin@ximian.com>
3370
3371         * anonymous.cs (CaptureContext.AddField): Added
3372         `AnonymousContainer am' argument; compute its toplevel scope if
3373         it's not already computed.  Fixes #75649.
3374
3375 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3376
3377         Fix #75628.
3378         * class.cs (Constructor.Emit): Reset block to null if the block
3379         resolve fails.
3380
3381 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3382
3383         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3384
3385 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3386
3387         * class.cs (MethodData.Define): Check whether accessor implementing
3388         interface is public.
3389
3390         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3391
3392 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3393
3394         Fix #57245
3395         * namespace.cs (LookupType): Moved same type check to...
3396         
3397         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3398         with the same name.
3399
3400 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3401
3402         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3403         already found a typebuilder.
3404         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3405         MemberNames, not strings.
3406
3407         * const.cs (Error_ExpressionMustBeConst): 
3408         Rename from Error_EpressionMustBeConst.
3409         * const.cs, class.cs, statement.cd: Update.
3410
3411 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3412
3413         Fix #65573
3414
3415         * const.cs (Const.LookupConstantValue): Report missing contant expression
3416         everytime.
3417         (Error_EpressionMustBeConstant): Only one error method.
3418
3419         * class.cs, statement.c: Updated.
3420
3421 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3422
3423         * statement.cs (Block.Flags): Add back HasVarargs.
3424         (Block.flags): Make protected.
3425         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3426
3427         * typemanager.cs (types, typecontainers, user_types): Remove.
3428         (UserTypes, TypeContainers): Likewise.
3429         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3430         (CleanUp, Reset): Update.
3431         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3432         (GetNestedType): Use Type.GetNestedType.
3433         (CoreLookupType): Take two arguments, the namespace and the
3434         basename of the type.  Update to use the Namespace.Lookup
3435         mechanism.
3436         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3437         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3438         string concatenation and substring matches.
3439         * class.cs, enum.cs, delegate.cs: Update to changes.
3440
3441 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3442
3443         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3444         Expression and made virtual.
3445
3446         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3447         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3448
3449         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3450
3451         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3452         error message.
3453
3454         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3455         change.
3456
3457 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3458
3459         Fix #57707
3460         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3461         AssemblyCultureAttribute is not used on executable.
3462
3463         * rootcontext.cs,
3464         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3465
3466 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3467
3468         Fix #60638.
3469         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3470         New.  Reports CS0252/CS0253.
3471         Mostly taken from preliminary patch by Duncak Mak.
3472         (Binary.DoResolveOperator): Store results of operator lookup.
3473         Use them to detect if we need to warn about unintended reference
3474         comparisons.
3475
3476 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3477
3478         Fix #72969.
3479         * namespace.cs (Namespace.Lookup): Add back location parameter.
3480         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3481         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3482
3483         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3484         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3485         (Namespace.LookupType): ... this.
3486         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3487         of namespaces.
3488         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3489         purported to handle pointers.
3490         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3491         CoreLookupType.
3492
3493 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3494
3495         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3496         type as namespace.
3497
3498 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3499
3500         * namespace.cs (Namespace.Lookup): Drop location parameter.
3501         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3502         (NamespaceEntry.Lookup): ... this.
3503         (NamespaceEntry.Error_AmbiguousTypeReference):
3504         Move here from DeclSpace.
3505         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3506         names ...
3507         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3508         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3509         Move to NamespaceEntry.
3510         * delegate.cs, expression.cs: Update to changes.
3511
3512 2005-08-31  Martin Baulig  <martin@ximian.com>
3513
3514         Committing a patch from Atsushi Enomoto for #75850.
3515
3516         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3517         Prefer a generic enumerator over a non-generic one.
3518
3519 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3520
3521         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3522         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3523
3524 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3525
3526         * driver.cs : reverting default encoding change as well as mcs.
3527
3528 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3529
3530         * driver.cs, support.cs : merged r48826.
3531           Marek Safer wrote:
3532           > could you integrate your mcs changes to gmcs otherwise
3533           > gmcs cannot compile some files.
3534
3535 2005-08-20  Martin Baulig  <martin@ximian.com>
3536
3537         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3538         scope if we don't already have it.
3539
3540         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3541         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3542         fixes #75867.
3543
3544 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3545
3546         * statement.cs: Copy the local exception into the exception
3547         captured local.  Fixes 75674
3548
3549 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3550
3551         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3552         type as namespace.
3553
3554 2005-08-12  Martin Baulig  <martin@ximian.com>
3555
3556         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3557         for nested types here to avoid hitting the cache too early.
3558
3559 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3560
3561         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3562         an error. 
3563
3564 2005-08-03  Martin Baulig  <martin@ximian.com>
3565
3566         Make iterators in generic methods work; see gtest-191.cs.
3567
3568         * generic.cs
3569         (Constraints.Resolve): Protect against being called twice.
3570
3571         * class.cs
3572         (TypeContainer.GetClassBases): Make this `protected virtual'.
3573
3574         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3575         (Iterator.GetClassBases): Override this and compute the base
3576         classes here.
3577         (Iterator.DefineNestedTypes): If we're a generic method, all our
3578         method type parameters become class type parameters on the proxy
3579         class.
3580
3581         * statement.cs
3582         (ToplevelBlock.Parameters): Make this a property, not a field.
3583         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3584
3585 2005-08-03  Martin Baulig  <martin@ximian.com>
3586
3587         * typemanager.cs (TypeManager.IsSubclassOf): Use
3588         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3589         (TypeManager.GetFullName_recursed): Improved.
3590
3591 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3592
3593         Fix #75417
3594         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3595         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3596         invocation_type == mi.DeclaringType, since the first one also checks
3597         other condition used by generic instances.
3598         
3599 2005-07-27  Martin Baulig  <martin@ximian.com>
3600
3601         * anonymous.cs (CaptureContext.AddField): Added
3602         `AnonymousContainer am' argument; compute its toplevel scope if
3603         it's not already computed.  Fixes #75649.
3604
3605 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3606
3607         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3608         CheckAttributeType and refactored.
3609         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3610         ResolveAsTypeTerminal error handling.
3611         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3612         handling.
3613         (GetSignatureForError): Print errors in same way.
3614
3615         * class.cs,
3616         * codegen.cs: Reflect attribute GetSignatureForError change.
3617
3618         * ecore.cs,
3619         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3620
3621         * namespace.cs (UsingEntry): Refactored to make fields private.
3622
3623         * assign.cs,
3624         statement.cs: Error_UnexpectedKind has extra parameter.
3625
3626 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3627
3628         * ecore.cs (IAlias): Remove.
3629         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3630         that implement the interface.
3631         * namespace.cs (Namespace): Likewise.
3632         (Namespace.declspaces): Renamed from 'defined_names'.
3633         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3634         DeclSpace instead of an IAlias.
3635         * tree.cs (Tree.AddDecl): Update.
3636
3637 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3638
3639         * statement.cs (Block.Flags); Remove HasVarargs.
3640         (Block.HasVarargs): Move to ToplevelBlock.
3641         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3642         (Block.Variables): Make protected.  Initialize variable hashtable
3643         if necessary.
3644         (Block.AddVariable): Update.
3645         (Block.Resolve): Update to changes.
3646         (ToplevelBlock.HasVarargs): New boolean.
3647         (ToplevelBlock.ThisVariable): Move here from Block.
3648         (ToplevelBlock.AddThisVariable): Likewise.
3649         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3650         * expression.cs (This.ResolveBase): Update to changes.
3651         (ArglistAccess.DoResolve): Likewise.
3652
3653 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3654
3655         Fix #75321
3656         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3657
3658         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3659         not used and not used & assigned.
3660         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3661
3662 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3663
3664         Fix #75053
3665         * expression.cs (Is.DoResolve): null is never provided type.
3666
3667 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3668
3669         Fix #52496
3670         * cs-parser.jay: Less strict event error rule to catch more errors.
3671
3672 2005-07-11  Martin Baulig  <martin@ximian.com>
3673
3674         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3675         for the constructor constraint: we do not only have to check
3676         whether the class has a public constructor, but also ensure that
3677         it's parameterless.  Fixes #75492.
3678
3679 2005-07-11  Martin Baulig  <martin@ximian.com>
3680
3681         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3682         between type parameters if they either have the reference type
3683         constraint or the class constraint.
3684
3685 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3686
3687         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3688
3689 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3690
3691         Fix #74975
3692         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3693         (ExtractSecurityPermissionSet): Cope with self referencing security
3694         attributes properly.
3695
3696         * driver.cs (SetOutputFile): Made public property OutputFile.
3697
3698 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3699
3700         Fix #75486.
3701         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3702         has_nonstatic_fields.  Make into a FieldBase pointer.
3703         (TypeContainer.AddField): Add CS0282 check.
3704         (TypeContainer.EmitType): Update.
3705
3706 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3707
3708         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3709         compare if they start with __.
3710
3711 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3712
3713         * statement.cs (Switch.SwitchGoverningType): Only look at
3714         UserCasts that don't need implicit standard conversions to one of
3715         the allowed switch types (Fixes test-322.cs).
3716         (LocalInfo.Resolve): Re-enable sanity-test.
3717
3718 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3719
3720         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3721         
3722         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3723         
3724         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3725
3726 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3727
3728         Fix #75472.
3729         * ecore.cs (SimpleName.GetSignatureForError): Add.
3730         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3731         (MemberAccess.GetSignatureForError): Add.
3732
3733 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3734  
3735         The big error and warning messages review.
3736         
3737         * anonymous.cs,
3738         * assign.cs,
3739         * attribute.cs,
3740         * class.cs,
3741         * codegen.cs,
3742         * convert.cs,
3743         * cs-parser.jay,
3744         * cs-tokenizer.cs,
3745         * decl.cs,
3746         * delegate.cs,
3747         * doc.cs,
3748         * driver.cs,
3749         * ecore.cs,
3750         * enum.cs,
3751         * expression.cs,
3752         * flowanalysis.cs,
3753         * iterators.cs,
3754         * literal.cs,
3755         * location.cs,
3756         * modifiers.cs,
3757         * namespace.cs,
3758         * parameter.cs,
3759         * pending.cs,
3760         * report.cs,
3761         * rootcontext.cs,
3762         * statement.cs,
3763         * support.cs,
3764         * tree.cs,
3765         * typemanager.cs: Updated.
3766         
3767         * class.cs: (MethodCore.SetYields): Moved here to share.
3768         (PropertyMethod.Define): Moved iterator setup here.
3769         
3770         * iterators.cs: Add orig_method to have full access to parent
3771         container.
3772
3773 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3774
3775         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3776         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3777         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3778         variable of struct type.
3779         * expression.cs (Unary.ResolveOperator): Update to change.
3780         (Indirection.VerifyFixed): Likewise.
3781         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3782         (ParameterReference.VerifyFixed): Value parameters are fixed.
3783         (This.VerifyFixed): Treat 'this' as a value parameter.
3784         * statement.cs (LocalInfo.IsFixed): Remove.
3785
3786 2005-07-01  Martin Baulig  <martin@ximian.com>
3787
3788         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3789         `ec.EmitThis ()' to get the correct scope.
3790
3791 2005-07-01  Martin Baulig  <martin@ximian.com>
3792
3793         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3794         instance is a ParameterReference; fixes #75299.
3795
3796 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3797
3798         Fix #75412.
3799         * expression.cs (Indexers.map): Remove.
3800         (Indexers.Append): Filter out inaccessible setters and getters.
3801         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3802
3803         Fix #75283.
3804         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3805         Refactored from ...
3806         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3807         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3808         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3809         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3810
3811 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3812
3813         Fix #75322
3814         * class.cs (FieldBase.GetInitializerExpression): One more field
3815         for backup.
3816
3817 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3818
3819         * pending.cs: Do not define a proxy if the base method is virtual,
3820         it will be picked up by the runtime (bug 75270).
3821
3822 2005-07-08  Martin Baulig  <martin@ximian.com>
3823
3824         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3825         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3826
3827 2005-07-07  Martin Baulig  <martin@ximian.com>
3828
3829         * generic.cs (ConstructedType.CheckConstraint): Use
3830         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3831         called recursively; fixes #75329.
3832
3833 2005-07-06  Martin Baulig  <martin@ximian.com>
3834
3835         * generic.cs (TypeManager.InferTypeArguments): Added support for
3836         anonymous methods; fixes #75461.
3837
3838 2005-07-01  Martin Baulig  <martin@ximian.com>
3839
3840         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3841         `ec.EmitThis ()' to get the correct scope.
3842
3843 2005-07-01  Martin Baulig  <martin@ximian.com>
3844
3845         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3846         instance is `This'; fixes #75299.
3847
3848 2005-06-30  Martin Baulig  <martin@ximian.com>
3849
3850         * class.cs (Indexer): Implement IIteratorContainer; added support
3851         for iterators in indexers.
3852
3853         * codegen.cs
3854         (EmitContext.CurrentIterator): Make this a property, not a field.
3855
3856         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3857
3858 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3859
3860         * pending.cs: Do not define a proxy if the base method is virtual,
3861         it will be picked up by the runtime (bug 75270).
3862
3863 2005-06-28  Martin Baulig  <martin@ximian.com>
3864
3865         * cs-parser.jay (interface_method_declaration): Avoid a
3866         reduce/reduce conflict by moving some of the code into a separate
3867         `interface_method_declaration_body' rule; fixes #75368.
3868
3869 2005-06-28  Martin Baulig  <martin@ximian.com>
3870
3871         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3872         array check after the check for TypeBuilder's.
3873
3874 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3875
3876         * convert.cs (FindMostEncompassedType): Add two trivial special
3877         cases (number_of_types == 0 || number_of_types == 1).
3878         (FindMostEncompasingType): Likewise.
3879
3880 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3881
3882         Some cleanups preparing for the fix of #75283.
3883         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3884         error testing.
3885         (EventExpr.InstanceResolve): Likewise.
3886         (EventExpr.DoResolve): Remove redundant checks.
3887
3888 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3889
3890         * class.cs: Small fix.
3891
3892 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3893
3894         Fix #75160.
3895         * class.cs (GetPartialBases): Fix return value check of
3896         part.GetClassBases.
3897
3898 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3899
3900         Ensure that partial classes are registered in their enclosing
3901         namespace.  Initial part of fix of #75160.
3902         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3903         Register declspace with namespace here, not in
3904         DeclSpace.RecordDecl.
3905         * cs-parser.jay: Pass namespace to RecordDecl.
3906         * class.cs (PartialContainer.Create): Likewise.
3907         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3908         called.
3909         * decl.cs (Declspace.RecordDecl): Remove.
3910         * namespace.cs (NamespaceEntry.DefineName): Remove.
3911
3912 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3913
3914         * rootcontext.cs: Reset TargetExt as well.
3915
3916 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3917
3918         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3919         -langversion:ISO-1.
3920
3921 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3922
3923         Fix #75080, cs0119.cs.
3924         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3925         of ...
3926         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3927         allowing ExprClass.Type and ExprClass.Namespace for
3928         ResolveFlags.VariableOrValue.
3929         (Expression.Resolve) [1-argument variant]: Change default resolve
3930         flags based on language version.
3931         (Expression.Error_UnexpectedKind): Use a simple string array
3932         rather than an ArrayList.
3933         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3934         not ExprClass.Type.
3935         (TypeOfVoid.DoResolve): Likewise.
3936         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3937         flags argument -- it always has the same value.
3938
3939 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3940
3941         Fix #75081.
3942         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3943         Use it in the error message.
3944         * assign.cs, expression.cs, statement.cs: Update.
3945
3946 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3947
3948         Fix #75088.
3949         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3950         the "almostMatchedMember" case too.
3951         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3952         that failed the accessibility checks to 'almost_match'.
3953
3954 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3955
3956         * attribute.cs: Use internal MethodBuilder methods to set
3957         ExactSpelling and SetLastError on PInvoke methods, instead
3958         of passing them via charset.  Fixes #75060.
3959
3960 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3961
3962         * parameter.cs (Parameter): Remove TODO comment.
3963         (Parameter.DefineParameter): Remove Location parameter.
3964         (Parameters.LabelParameters): Likewise.
3965         * class.cs (Constructor.Emit): Update to change.
3966         (MethodData.Emit): Likewise.
3967         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3968         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3969
3970 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3971
3972         * parameter.cs,
3973           Removed Parameters.Location and added Parameter.Location instead.
3974           Removed Location parameter from Emit() and GetSignature().
3975         * anonymous.cs,
3976           class.cs,
3977           cs-parser.jay,
3978           delegate.cs,
3979           iterators.cs,
3980           statement.cs :
3981           Modified all related calls.
3982
3983 2005-06-21  Martin Baulig  <martin@ximian.com>
3984
3985         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3986         left-hand side is not a nullable type; fixes #75328.
3987
3988 2005-06-21  Martin Baulig  <martin@ximian.com>
3989
3990         * typemanager.cs
3991         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3992         (TypeManager.GetFullNameSignature): Likewise.
3993
3994         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3995         `source.FullName' and `target.FullName' to check whether there are
3996         two conflicting definitions.
3997
3998 2005-06-21  Martin Baulig  <martin@ximian.com>
3999
4000         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4001         a BoxedCast - also for reference types - to be compatible with csc.
4002
4003 2005-06-21  Martin Baulig  <martin@ximian.com>
4004
4005         * expression.cs (MemberAccess.DoResolve): Add support for nested
4006         types in a generic instance; fixes #75320.
4007
4008 2005-06-20  Martin Baulig  <martin@ximian.com>
4009
4010         * generic.cs (TypeManager.InferType): Also walk the class
4011         hierarchy for generic instances; fixes #75261.
4012
4013 2005-06-17  Martin Baulig  <martin@ximian.com>
4014
4015         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4016         to make things work for corlib.
4017
4018 2005-06-15  Martin Baulig  <martin@ximian.com>
4019
4020         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4021         obsolete `SecurityAction' values.
4022
4023 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4024
4025         * rootcontext.cs: Reset TargetExt as well.
4026         
4027 2005-06-09  Martin Baulig  <martin@ximian.com>
4028
4029         * delegate.cs (Delegate.VerifyMethod): Added
4030         `MethodGroupExpr old_mg' argument; inherit its
4031         `HasTypeParameters'; fix #75085.
4032
4033 2005-06-09  Martin Baulig  <martin@ximian.com>
4034
4035         * expression.cs (Invocation.OverloadResolve): Correctly handle
4036         generic methods for the SetMemberIsUsed(); fix #75064.
4037
4038 2005-06-09  Martin Baulig  <martin@ximian.com>
4039
4040         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4041         fixes #75062.
4042
4043 2005-06-08  Martin Baulig  <martin@ximian.com>
4044
4045         * cs-parser.jay (nullable_type_or_conditional): If we put the
4046         nullable back and our `type' is a `ComposedCast', remove the
4047         nullable from it.  Fixes #75156.
4048
4049         * expression.cs (ComposedCast.RemoveNullable): New public method.
4050
4051 2005-06-08  Martin Baulig  <martin@ximian.com>
4052
4053         The big Iterators rewrite :-)
4054
4055         * iterators.cs: Rewrite this to use the anonymous methods framework.
4056
4057         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4058         before the TypeContainers; see 2test-21.cs.
4059
4060         * class.cs
4061         (TypeContainer.DefineType): Don't create a new EmitContext if we
4062         already have one (this only happens if we're an Iterator).
4063         (TypeContainer.Define): Also call Define() on all our iterators.
4064         (Method.CreateEmitContext): Added support for iterators.
4065
4066         * anonymous.cs
4067         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4068         (AnonymousContainer.CreateMethodHost): Moved here from
4069         AnonymousMethod and made abstract.
4070         (AnonymousContainer.CreateScopeType): New abstract method.
4071         (AnonymousContainer.IsIterator): New public property.
4072         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4073         get the ScopeTypeBuilder rather than manually defining it here. 
4074         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4075         iterators here.
4076
4077         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4078         before RootContext.DefineTypes().
4079
4080         * codegen.cs (EmitContext.RemapToProxy): Removed.
4081         (EmitContext.CurrentAnonymousMethod): Changed type from
4082         AnonymousMethod -> AnonymousContainer.
4083         (EmitContext.ResolveTopBlock): Protect from being called twice.
4084         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4085         (EmitContext.EmitThis): Removed the iterators hacks; use the
4086         anonymous methods framework for that.
4087
4088         * statement.cs
4089         (ToplevelBlock.Container): Make this a property, not a field.
4090         (ToplevelBlock.ReParent): New public method; move the
4091         ToplevelBlock into a new container.
4092         (Foreach.TemporaryVariable): Simplify.
4093
4094 2005-06-05  Martin Baulig  <martin@ximian.com>
4095
4096         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4097         (Block.AddTemporaryVariable): New public method; creates a new
4098         `LocalInfo' for a temporary variable.
4099         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4100         variables here.
4101         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4102         non-iterator variables.
4103
4104 2005-06-05  Martin Baulig  <martin@ximian.com>
4105
4106         * statement.cs (Foreach.TemporaryVariable): Create the
4107         LocalBuilder in the Emit phase and not in Resolve since in some
4108         situations, we don't have an ILGenerator during Resolve; see
4109         2test-19.cs for an example.
4110
4111 2005-06-04  Martin Baulig  <martin@ximian.com>
4112
4113         The big Foreach rewrite - Part II.
4114
4115         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4116         with `PropertyInfo ienumerator_getcurrent'.
4117
4118         * codegen.cs (VariableStorage): Removed.
4119
4120         * statement.cs
4121         (Foreach): Derive from Statement, not ExceptionStatement.
4122         (Foreach.CollectionForeach): New nested class.  Moved all the code
4123         dealing with collection foreach here.
4124         (Foreach.ForeachHelperMethods): Removed.
4125         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4126
4127 2005-05-23  Martin Baulig  <martin@ximian.com>
4128
4129         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4130         don't need to.  Fix #75014.
4131
4132 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4133
4134         Improve user-defined conversion handling.
4135         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4136         applicable operators.
4137         (AddConversionOperators): New.  Helper for GetConversionOperators.
4138         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4139         there is only one most encompassed/encompassing type.
4140         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4141         "applicable operator" handling.
4142         (UserConversion): Move cache here from GetConversionOperators.
4143         Directly cache the chosen operator, rather than the whole
4144         MethodGroup.
4145         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4146         case.  Allow conversion of decimal to sbyte and byte too.
4147         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4148         New static methods.  Used to avoid allocating EmptyExpressions in
4149         convert.cs.
4150
4151 2005-05-24  Duncan Mak  <duncan@novell.com>
4152
4153         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4154         another class, used in Convert.ExplicitNumericConversion.
4155         (CastToDecimal): New class, similar to above, but casts to
4156         System.Decimal, used in Convert.ImplicitNumericConversion and also
4157         in explicit convesion from double/float to decimal.
4158
4159         * convert.cs (ImplicitNumericConversion): Handle implicit
4160         conversions to System.Decimal.
4161         (ExplicitNumericConversion): handle explicit conversions to
4162         System.Decimal.
4163
4164         This fixes #68711.
4165         
4166 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4167
4168         * typemanager.cs: Do not throw an exception in the TypeBuilder
4169         case, we take care of it on the TypeCode.
4170
4171 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4172         
4173         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4174         is back.
4175         
4176         * cs-parser.jay: Catch more lexical errors.
4177         
4178         * report.cs: Add one more Error method.
4179         
4180         * rootcontext.cs,
4181         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4182
4183 2005-05-20  Martin Baulig  <martin@ximian.com>
4184
4185         * class.cs (TypeContainer.CircularDepException): Removed.
4186         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4187         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4188         (CS0146) and interface (CS0529) dependencies here.
4189
4190 2005-05-20  Martin Baulig  <martin@ximian.com>
4191
4192         * expression.cs (New.DoResolve): Move the CS0712 check above the
4193         CS0144 check; otherwise it can never be reached.
4194
4195 2005-05-20  Martin Baulig  <martin@ximian.com>
4196
4197         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4198
4199 2005-05-20  Martin Baulig  <martin@ximian.com>
4200
4201         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4202
4203         * typemanager.cs (TypeManager.IsAttributeType): New public method.
4204
4205 2005-05-19  Martin Baulig  <martin@ximian.com>
4206
4207         * delegate.cs
4208         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4209         to disable error reporting.
4210
4211         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4212         here since we don't want to report an error; see the new test-336.cs.
4213
4214 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4215
4216         * statement.cs (ToplevelBlock.GetParameterReference)
4217         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4218         Move here from class Block.
4219         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4220         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4221
4222 2005-05-18  Martin Baulig  <martin@ximian.com>
4223
4224         Fix #74978.
4225
4226         * flowanalysis.cs
4227         (FlowBranching.Reachability): Add non-static public And() and Or()
4228         methods.
4229         (FlowBranchingSwitch): New class; do the `break_origins' thing
4230         like in FlowBranchingLoop.
4231         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4232         reachability, not just locals and parameters.
4233         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4234         switch; MergeBreakOrigins() now takes care of that.
4235
4236 2005-05-18  Martin Baulig  <martin@ximian.com>
4237
4238         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4239         a loop and may leave it, reset the barrier; fixes #74974.
4240
4241 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4242
4243         Fix test-382.cs.  Emit values of decimal constants.
4244         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4245         Carved out of ...
4246         (TypeContainer.AddField): ... this.
4247         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4248         with initializers to include 'Const's.
4249         (ClassPart.RegisterFieldForInitialization): Forward to
4250         PartialContainer.
4251         * const.cs (Const.Const): Pass initializer to base class.
4252         (Const.Define): In case of decimal constants, register them for
4253         initialization in a static constructor.
4254
4255 2005-05-14  Martin Baulig  <martin@ximian.com>
4256
4257         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4258         do not call ResolveUnreachable() on unreachable statements in
4259         here, see the comment in the source code.
4260
4261 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4262
4263         Fix #74934.
4264         * expression.cs (BinaryResolveOperator): If one of the operands of
4265         an equality comparison is 'null' and the other is a pointer type,
4266         convert the null to a NullPointer.
4267         * convert.cs (ImplicitReferenceConversion): If the expression is a
4268         NullLiteral and the target type is a pointer type, return a
4269         NullPointer instead.
4270         (ImplicitConversionStandard): Likewise.
4271
4272 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4273         
4274         * cs-parser.jay: Set readonly context based on special constructs.
4275         
4276         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4277         readonly variable error handling.
4278         
4279         * rootcontext.cs (EmitCode): Don't verify members when error
4280         occurred.
4281         
4282         * statement.cs (LocalInfo): Add reaodnly context information.
4283         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4284
4285 2005-05-17  Martin Baulig  <martin@ximian.com>
4286
4287         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4288         #70970. 
4289
4290 2005-05-13  Martin Baulig  <martin@ximian.com>
4291
4292         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4293         handle unreachable blocks.
4294
4295 2005-05-13  Martin Baulig  <martin@ximian.com>
4296
4297         * class.cs
4298         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4299         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4300         #74905. 
4301
4302 2005-05-13  Martin Baulig  <martin@ximian.com>
4303
4304         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4305         instance variable, not a local.  Fix #74873.
4306         (Block.ResolveUnreachable): Set it to true here.
4307
4308 2005-05-12  Martin Baulig  <martin@ximian.com>
4309
4310         * cs-parser.jay (property_declaration): Pass the `current_class',
4311         not the `current_container' to Property's .ctor.  Fixes #74912.
4312
4313 2005-05-11  Martin Baulig  <martin@ximian.com>
4314
4315         * typemanager.cs (Closure): Copy this from MCS and merge all the
4316         GMCS-specific changes into it.
4317
4318 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4319
4320         Fix #74920.
4321         * typemanager.cs (unmanaged_enclosing_types): New.
4322         (IsUnmanagedType): Avoid infloops by using
4323         'unmanaged_enclosing_types' to talk with recursive invocations.
4324
4325 2005-05-11  Duncan Mak  <duncan@novell.com>
4326
4327         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4328         continuing to process for 'arg'.
4329         (handle_preprocessing_directive): Check the argument of the #endif
4330         directive and report error CS1025 if there are any trailing
4331         characters.
4332
4333         According to the C# spec, having even whitespace after the #endif
4334         directive is illegal; however, because we call arg.TrimEnd ()
4335         beforehand, we have the same behavior as csc, allowing whitespace
4336         after the directive.
4337
4338         Fixes #74892.
4339
4340 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4341
4342         Fix #74863.
4343         
4344         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4345         (Constructor.GetObsoleteAttribute): Implemented correctly.
4346
4347 2005-05-10  Martin Baulig  <martin@ximian.com>
4348
4349         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4350         resolve the type; fixes #74864.
4351         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4352         in DoResolve(); fixes #74862.
4353
4354 2005-05-10  Martin Baulig  <martin@ximian.com>
4355
4356         * support.cs (ReflectionParameters.ParameterModifier): Use
4357         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4358         and `ParameterAttributes.In'.  Fixes #74884.
4359
4360 2005-05-10  Martin Baulig  <martin@ximian.com>
4361
4362         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4363         the cache if we're just looking for `MemberTypes.NestedType' in a
4364         generic instance.
4365
4366         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4367         constraints if we're still resolving the type tree.
4368         (Expression.MemberLookup): If we're resolving the type tree, only
4369         look for `MemberTypes.NestedType' since we're only interested in
4370         getting types.
4371
4372         * class.cs (TypeContainer.DefineType): Don't resolve the type
4373         parameters here; do this later in ResolveType() after the type
4374         tree has been resolved.
4375         (TypeContainer.ResolveType): New public method; this is called
4376         after the type tree is resolved and before the types are being
4377         populated.  We resolve the generic constraints here.
4378         (TypeContainer.DoDefineMember): Check the constraints on our base
4379         class and interfaces.
4380
4381         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4382         set the `ResolvingTypeTree' flag on the EmitContext.
4383
4384         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4385
4386 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4387
4388         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4389         
4390         * expression.cs (Argument.GetParameterModifier): Turned to property.
4391         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4392         
4393         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4394         its C# equivalent.
4395         
4396 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4397
4398         Fix #74852.
4399         * decl.cs (MemberCache.AddMethods): Register override methods,
4400         rather than non-override methods.
4401         * typemanager.cs (RegisterOverride): New.
4402         (IsOverride): Update.
4403
4404 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4405
4406         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4407
4408 2005-05-06  Martin Baulig  <martin@ximian.com>
4409
4410         * attribute.cs
4411         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4412         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4413
4414 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4415
4416         Fix #73105.
4417         
4418         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4419         recursive declaration.
4420         
4421         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4422         
4423 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4424
4425         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4426         
4427         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4428
4429 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4430
4431         Fix #74797.
4432         * decl.cs (DeclSpace.FamilyAccessible): 
4433         Use TypeManager.IsNestedFamilyAccessible.
4434
4435         Fix reopened #64812.
4436         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4437         internal'.
4438
4439 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4440             Abin Thomas  <projectmonokochi@rediffmail.com>
4441             Anoob V E  <projectmonokochi@rediffmail.com>
4442             Harilal P R  <projectmonokochi@rediffmail.com>
4443
4444         Fix #64812.
4445         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4446         allow access to all static members.
4447
4448 2005-05-04  Martin Baulig  <martin@ximian.com>
4449
4450         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4451
4452 2005-05-04  Martin Baulig  <martin@ximian.com>
4453
4454         Fix #74655.
4455
4456         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4457         section at the end; make things work if `default' is not the last
4458         section.        
4459
4460 2005-05-04  Martin Baulig  <martin@ximian.com>
4461
4462         Fix #70400.
4463
4464         * statement.cs (Switch): Replaced the `got_default' field with a
4465         `default_section' one.
4466         (Switch.CheckSwitch): Set `default_section' here.
4467         (Switch.Resolve): If we're a constant switch and the constant is
4468         not found, use the default section.
4469
4470 2005-05-03  Martin Baulig  <martin@ximian.com>
4471
4472         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4473
4474         * statement.cs (Foreach.ArrayForeach): New nested class.
4475         (Foreach.TemporaryVariable): New nested class.
4476         (Foreach.EmitArrayForeach): Removed; this is now in the new
4477         ArrayForeach class.
4478
4479 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4480
4481         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4482         more conservative.
4483         (VerifyPendingMethods): Revert change below.
4484
4485         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4486         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4487         that used to trigger warning -28.  Remove warning -28.
4488         * expression.cs (Invocation.OverloadResolve): Use
4489         TypeManager.IsOverride to distinguish override methods.
4490
4491         Fix #74773.
4492         * pending.cs (VerifyPendingMethods): If a base type implements the
4493         requested interface, don't bother checking individual methods of
4494         the base type.  As a side-effect, this prevents the creation of
4495         unnecessary proxies.
4496
4497 2005-05-02  Martin Baulig  <martin@ximian.com>
4498
4499         Fix #70182.
4500
4501         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4502         Also `And' the locals if the old vector is null.
4503         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4504         null; in this case we basically reset all the variables.        
4505
4506 2005-05-02  Martin Baulig  <martin@ximian.com>
4507
4508         Fix #74529.
4509
4510         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4511         Added `FlowBranching branching' argument; always `and' the
4512         variables instead of `or'ing them unless we're an infinite loop.
4513
4514         * statement.cs (While.Resolve): Create a new sibling unless we're
4515         infinite.       
4516
4517 2005-05-02  Martin Baulig  <martin@ximian.com>
4518
4519         Fix #70140.
4520
4521         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4522         arguments; use it instead of creating a new TopLevelBlock.
4523         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4524         our ConstructorInitializer.
4525
4526         * statement.cs
4527         (TopLevelBlock.TopLevelBranching): New public property.
4528         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4529         and create our `TopLevelBranching'.
4530
4531         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4532         anonymous method host, use `block.TopLevelBranching' rather than
4533         creating a new branching.
4534
4535 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4536
4537         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4538         a ScopeInfo, if any of the current children is a child of the new
4539         entry, move those children there.
4540
4541 2005-04-30  Martin Baulig  <martin@ximian.com>
4542
4543         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4544         at the beginning of a SwitchSection.  Fix #73335.
4545
4546 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4547
4548         Fix #74378
4549         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4550         
4551         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4552         (FieldExpr.DoResolve): Obsolete members are ignored for field
4553         initializers.
4554         
4555 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4556
4557         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4558         of arrays detection.
4559
4560         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4561         verification.
4562         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4563
4564         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4565         arrays report.
4566
4567 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4568
4569         * cs-parser.jay: Use the prefered version of -unsafe in error
4570         message.
4571
4572 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4573
4574         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4575         circumstances.
4576
4577 2005-04-20  John Luke  <john.luke@gmail.com>
4578
4579         * driver.cs: fix typo in error message, --outout to --output
4580
4581 2005-04-30  Martin Baulig  <martin@ximian.com>
4582
4583         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4584         handle the .NET 2.x security attributes.
4585
4586 2005-04-30  Martin Baulig  <martin@ximian.com>
4587
4588         * typemanager.cs
4589         (TypeManager.ExpandInterfaces): Don't add things twice.
4590
4591         * class.cs
4592         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4593
4594 2005-04-29  Martin Baulig  <martin@ximian.com>
4595
4596         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4597
4598         * anonymous.cs: Added support for anonymous generic methods.
4599
4600 2005-04-29  Martin Baulig  <martin@ximian.com>
4601
4602         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4603         generic instances.
4604
4605 2005-04-29  Martin Baulig  <martin@ximian.com>
4606
4607         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4608
4609         * expression.cs (New.DoResolve): Fix the CS0304 check.
4610
4611 2005-04-29  Martin Baulig  <martin@ximian.com>
4612
4613         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4614         naming schema.
4615
4616         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4617         explicit interface implementation, compare the interface types.
4618         (MethodData.Define): Use the new naming scheme from the latest
4619         .NET 2.x beta2.
4620         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4621
4622         * decl.cs (MemberName.GetMemberName): Removed.
4623         (MemberName.MethodName, FullName): New properties.
4624
4625 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4626
4627         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4628
4629 2005-04-22  Martin Baulig  <martin@ximian.com>
4630
4631         * generic.cs (GenericMethod): Create the EmitContext in the
4632         `Define()'; in `Define(MethodBuilder)', create the type parameters
4633         before calling `Define()'.  Fixes #73933.
4634
4635 2005-04-22  Martin Baulig  <martin@ximian.com>
4636
4637         * generic.cs
4638         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4639         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4640
4641         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4642         ConstructedType, check its constraints.
4643
4644 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4645
4646         * codegen.cs (InRefOutArgumentResolving): New field.
4647         
4648         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4649         fields outside contructor.
4650         
4651         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4652         
4653 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4654
4655         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4656         parameter code was not completed ever, so it was not as up-to-date
4657         as local variables.  Must finish it.
4658
4659         The bug fix was to compare the Toplevel of the block, not the
4660         current block.  Thanks for Ben for pointing this out. 
4661
4662 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4663
4664         * decl.cs (AddMethods): Use the declaring type of the problem
4665         method to determine if we want to squash a warning.
4666
4667 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4668
4669         * attribute.cs: Removed debug output.
4670
4671         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4672         
4673         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4674         Report.Stderr.
4675         
4676 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4677
4678         Fix #74481.
4679         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4680         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4681         all null comparisons against reference types.
4682
4683 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4684
4685         Fix# 74565
4686         * class.cs (TypeContainer.CircularDepException) New nested
4687         exception class.
4688         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4689         (TypeContainer.DefineType): Removed error, reset InTransit before
4690         exit.
4691         (Class.DefineType): Throw exception when is in Transit.
4692         Catch exception and report error.
4693         (Struct.DefineType): Throw exception when is in Transit.
4694         Catch exception and report error.
4695         (Interface.DefineType): Throw exception when is in Transit.
4696         Catch exception and report error.
4697
4698         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4699         handle nested exception handlers.
4700
4701         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4702         a catch.
4703
4704         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4705         InFinally and InCatch storage.
4706
4707         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4708         (Catch.Resolve): Set and Restore ec.InCatch.
4709         (Try.Resolve): Set and Restore ec.InFinally.
4710         (Try.HasCatch): True when try has catch.
4711
4712 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4713
4714         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4715           for the same event member, so exclude such cases from warning 419.
4716           Fixed bug #74633.
4717
4718 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4719
4720         * expression.cs (Binary.ResolveOperator): Apply patch from John
4721         Luke to fix bug 59864: operators &, | and ^ on enumerations
4722         require that the same enum type on both sides.
4723
4724         * driver.cs: Add warnings to old flag usage, this is to assist
4725         people who produce Makefiles and hope that the Makefiles will be
4726         used on Windows.
4727
4728         * class.cs (TypeContainer.EmitType): Moved the definition of the
4729         special $PRIVATE$ field from the resolve phase to the Emit phase.
4730         During resolve we do not know if we are a struct with
4731         HasExplicitLayout, we know this only after the attributes for the
4732         type are emitted.
4733
4734         Set the FieldOffset to zero on the dummy field that we create for
4735         the class.   Fixes 74590.
4736
4737 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4738
4739         Fix #73834.
4740         * ecore.cs (PropertyExpr.resolved): New.
4741         (DoResolve): Use it to handle a case of double resolution here.
4742         Handle a case of identical-name-and-type-name.
4743         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4744         resolution by storing the results of expression resolution back
4745         into the "probes" array.
4746
4747 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4748
4749         Fix cs0208-7.cs and cs0208-8.cs.
4750         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4751         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4752         error reporting to point out the reason a struct is not unmanaged.
4753
4754 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4755
4756         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4757           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4758
4759 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4760
4761         Fix #74528.
4762         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4763         IdenticalNameAndTypeName here.
4764         (EventExpr.InstanceResolve): Likewise.
4765
4766 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4767
4768         C# 2.0 DefaultCharSetAttribute implementation
4769         
4770         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4771         which allows us to set GlobalNamespace for every resolve.
4772         (Attribute.ResolveArguments): Cut from Resolve.
4773         (Attribute.GetCharSetValue): Returns CharSet named argument.
4774         (Attribute.DefinePInvokeMethod): Gets default charset from
4775         module settings.
4776         (GlobalAttribute.ResolveAsTypeStep): Override.
4777         (GlobalAttribute.ResolveArguments): Override.
4778         
4779         * class.cs (TypeAttr): Is protected.
4780         
4781         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4782         (ModuleClass.DefaultCharSetType): New memeber.
4783         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4784         
4785         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4786         charset from module.
4787         
4788         * delegate.cs (TypeAttr): Override.
4789         (Delegate.DefineType): Use this TypeAttr.
4790         
4791         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4792         at very early stage (before types are defined) to resolve model
4793         module attributes. It will probably not work with corlib but it
4794         should be ok.
4795         
4796         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4797         charset from module.
4798         
4799         * typemanager.cs (default_charset_type): New type.
4800
4801 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4802
4803         * decl.cs (MemberCache.AddMethods): Don't warn if
4804         System.Object.Finalize has buggy MethodAttributes.
4805
4806         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4807         removed below.
4808
4809 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4810
4811         * doc.cs : detect ambiguous reference to overloaded members.
4812           Fixed bug #71603. MS 1.1 csc does not detect it.
4813
4814 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4815
4816         * doc.cs : delegates must not be referenced with parameters.
4817           Fixed bug #71605.
4818
4819 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4820
4821         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4822
4823 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4824
4825         * driver.cs (MainDriver): Stop processing if the CLS stage found
4826         errors. 
4827
4828         (CompilerCallableEntryPoint.InvokeCompiler): Always
4829         reset after execution;   Take a TextWriter argument for the
4830         output.
4831
4832         * report.cs: Use the error stream instead of hardcoding stderr. 
4833
4834 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4835
4836         * class.cs: Reduce code paths to test, too small of an
4837         optimization to make it worth the extra testing.  Always perform
4838         it. 
4839
4840 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4841
4842         Fix #74510.
4843         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4844         operators that had errors reported on them.
4845
4846 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4847
4848         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4849         argument types.
4850         (Attribute.Resolve): Add named argument type checking.
4851         
4852         * class.cs (FixedField.Define): Use IsPrimitiveType
4853         
4854         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4855         
4856         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4857         unsafe parameter types.
4858         
4859         * statement.cs (Using.ResolveExpression): Add better error description.
4860         
4861         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4862         
4863 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4864
4865         Fix #74484.
4866         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4867         AttributeUsageAttribute in the emitcontext of the attribute class,
4868         not in the emitcontext of the attributable entity it was attached to.
4869         * cs-parser.jay: Use 'current_class', not 'current_container',
4870         when creating a GlobalAttribute.
4871
4872 2005-04-08  Alp Toker  <alp@atoker.com>
4873
4874         * pending.cs: The fix to #58413 failed to compile methods implementing
4875         interfaces with/without params modifiers and vice versa, even though
4876         params modifiers aren't part of the signature. Make the modifier check
4877         less strict as in csc.
4878
4879 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4880             Anoob V E  <projectmonokochi@rediffmail.com>
4881             Harilal P R  <projectmonokochi@rediffmail.com>
4882
4883         Fix #58413.
4884         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4885         modifiers of pending methods.
4886         (PendingImplementation.PendingImplementation): Initialize it.
4887         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4888         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4889         with ParameterData.  Add check for modifiers.
4890         * class.cs (MethodData.Define): Update to changes.
4891
4892 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4893
4894         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4895
4896 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4897
4898         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4899         property.
4900         
4901         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4902         
4903         * rootcontext.cs,
4904         * typemanager.cs: Registered RequiredAttributeAttribute.
4905         
4906 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4907
4908         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4909         Warning CS0169 is back at level 3.
4910         (IMethodData.SetMemberIsUsed): New method.
4911         
4912         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4913         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4914         
4915         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4916
4917         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4918         contants.
4919         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4920         is used.
4921         
4922         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4923         is used.
4924         
4925         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4926         to avoid the problems with nested types.
4927
4928 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4929             Anoob V.E  <projectmonokochi@rediffmail.com>
4930             Harilal P.R  <projectmonokochi@rediffmail.com>
4931             Raja R Harinath  <rharinath@novell.com>
4932
4933         Fix #73820.
4934         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4935         attribute.
4936         * typemanager (GetConstructor): Make public.
4937
4938 2005-04-05  John Luke  <john.luke@gmail.com>
4939             Raja R Harinath  <rharinath@novell.com>
4940
4941         Fix #62232.
4942         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4943         struct too.  Return false quicker in a few cases.
4944         (VerifyUnManaged): Use it.
4945
4946 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4947
4948         Fix #74041.
4949         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4950         not 'unreachable_seen'.
4951
4952 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4953
4954         * attribute.cs (Attribute.GetValue): Removed unused.
4955         
4956         * codegen.cs (CodeGen.TrimExt): Removed unused.
4957         
4958         * cs-parser.jay (output): Removed unused.
4959         
4960         * cs-tokenizer.cs (hex_digits): Removed unused.
4961         
4962         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4963         
4964         * expression.cs (Indirection.LoadExprValue): Removed unused.
4965         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4966         
4967         * iterators.cs (Iterator.param_types): Removed unused.
4968         
4969         * statement.cs (Goto.block): Removed unused.
4970         (ToplevelBlock.did): Removed unused.
4971         (Switch.ResolveConstantSwitch): Removed unused.
4972
4973 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4974
4975         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4976         resetting thingy.
4977
4978 2005-04-19  Martin Baulig  <martin@ximian.com>
4979
4980         Merged r42462 from MCS and made it work for GMCS.
4981
4982         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4983
4984         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4985
4986 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4987
4988         Fix #74232 and cs0208-3.cs.
4989         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4990         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4991         unmanaged type.  Don't use FieldBuilders when 't' is a
4992         TypeBuilder.  Use ModFlags and MemberType fields.
4993         * class.cs (MemberBase.member_type): Rename from MemberType.
4994         (MemberBase.MemberType): New property.  Determines member_type on
4995         demand.
4996         (MemberBase.DoDefine): Don't initialize MemberType here.
4997         (FieldMember.Define): Likewise.
4998
4999 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5000
5001         Fix #74241
5002         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5003         Attributes are emitted there.
5004         
5005 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5006
5007         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5008         keyword in 'partial enum' too.
5009         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5010         is not allowed).
5011         Report from Kamil Skalski <nazgul@omega.pl>.
5012
5013         Fix #74309.
5014         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5015         have partial containers too.
5016
5017         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5018         in block' checks to Block.CheckInvariantMeaningInBlock.
5019         * statement.cs (Block.GetKnownVariableInfo): Make private.
5020         (Block.IsVariableUsedInChildBlock): Remove.
5021         (Block.IsVariableUsedInBlock): Likewise.
5022         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5023         conflicting declaration.
5024         (Block.AddVariable): Make error messages less long-winded and more
5025         specific.  Show location of conflicting declaration.
5026         * parameter.cs (Parameters.Location): New readonly property.
5027
5028 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5029
5030         Clean up semantics of invoking ResolveMemberAccess.
5031         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5032         can have an instance, ensure that we pass in a non-TypeExpression
5033         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5034         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5035         argument.  Update to changes and simplify.
5036         (FieldExpr.Emitinstance): Remove CS0120 check.
5037         (PropertyExpr.EmitInstance): Likewise.
5038         * expression.cs (Argument.Resolve): Likewise.
5039         (Invocation.DoResolve): Update to changes in semantics of
5040         InstanceExpression.
5041
5042 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5043
5044         Fix #74241
5045         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5046         customization.
5047         
5048         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5049
5050 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5051
5052         Fix difference in behaviour with commandline invocation.
5053         * driver.cs (Driver.Reset): New.
5054         (CompilerCallableEntryPoint): Call it.
5055
5056         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5057         variable" warnings if the boolean expression failed to resolve.
5058
5059 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5060
5061         * attribute.cs: Fix the union of several permissions when some of them
5062         are unrestricted (so the result isn't an unrestricted permission set).
5063         Fix #74036.
5064
5065 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5066
5067         * ecore.cs (MemberExpr): New class.  Convert from interface
5068         IMemberExpr.
5069         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5070         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5071         error checks.
5072         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5073         (MethodGroupExpr.IsExplicitImpl): Remove.
5074         (Expression.GetFieldFromEvent): Remove.
5075         (SimpleName.MemberStaticCheck): Remove.
5076         (SimpleName.DoSimpleNameResolve): Update to changes.
5077         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5078         (MemberAccess.IdenticalNameAndTypeName): Remove.
5079         (MemberAccess.error176): Move to MemberExpr.
5080         (MemberAccess.DoResolve): Update to changes.
5081         (BaseAccess.DoResolve): Likewise.
5082
5083 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5084
5085         C# 2.0 Conditional attribute class implementation
5086         
5087         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5088         Analyzes class whether it has attribute which has ConditionalAttribute
5089         and its condition is not defined.
5090         
5091         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5092         (Class.IsExcluded): New method. Search for at least one defined
5093         condition in ConditionalAttribute of attribute class.
5094
5095 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5096
5097         * ecore.cs (PropertyExpr): Derive from Expression, not
5098         ExpressionStatement.
5099         (PropertyExpr.EmitStatement): Remove.
5100
5101 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5102
5103         Fix #74060.
5104         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5105         internal field "value__" of an enum be private.  The examples for
5106         "value__" that I found on MSDN all used FieldAttributes.Private.
5107
5108         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5109         Don't mention IL method attribute names.
5110
5111         Fix #47991.  Remove a TODO.
5112         * statement.cs (Block.Toplevel): Make into a field.
5113         (Block.Parameters): Move into ToplevelBlock.
5114         (Block.known_variables): Rename from child_variable_names.
5115         (Block.Block): Remove variants that take Parameters.  Initialize
5116         'Toplevel' with the immediately surrounding toplevel block.
5117         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5118         LocalInfo parameter.
5119         (Block.GetKnownVariableInfo): New.
5120         (Block.IsVariableNameUsedInChildBlock): Update.
5121         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5122         the block, even though it may not be in scope.
5123         (Block.AddVariable): Remove Parameters parameter.  Use
5124         Toplevel.Parameters instead.
5125         (Block.AddConstant): Remove Parameters parameter.
5126         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5127         (Block.IsParamaterReference): Likewise.
5128         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5129         (ToplevelBlock.Parameters): New.  Moved from Block.
5130         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5131         initialize Parameters to a non-null value.
5132         * cs-parser.jay: Update to changes.
5133         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5134         simple names that mean different things in the same block.  Use
5135         Block.IsVariableNameUsedInBlock.
5136
5137 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5138
5139         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5140
5141 2005-03-26  Raja R Harinath  <harinath@acm.org>
5142
5143         Fix #73038.
5144         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5145         fails to resolve, ensure that the LHS is still resolved as an
5146         lvalue.
5147
5148 2005-03-25  Raja R Harinath  <harinath@acm.org>
5149
5150         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5151         ec.ContainerType.
5152         (Enum.current_ec): Remove.
5153         (Enum.LookupEnumValue): Remove EmitContext argument.
5154         Just uses the one created during DefineType.
5155         (Enum.FindMembers): Update.
5156         * expression.cs (MemberAccess.DoResolve): Update.
5157
5158 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5159
5160         * assign.cs (Assign.DoResolve): Check for CS1717 when
5161         source and target are same (uses Equals).
5162
5163         * expression.cs (LocalVariableReference, ParameterReference,
5164         This): Implemented Equals, GetHashCode.
5165
5166         * statement.cs (Block.GetParameterReference): Removed useless
5167         local variable.
5168
5169 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5170
5171         Fix cs0128.cs
5172         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5173         blocks before deciding whether the error is cs0136 or cs0128.
5174
5175         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5176         (using_alias_directive, using_namespace_directive): Pass
5177         MemberName, not an expression to Namespace.UsingAlias and
5178         Namespace.Using.
5179         (MakeName): Use the MemberName of the namespace.
5180         * namespace.cs (Namespace.MemberName): New.
5181         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5182         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5183         Likewise.
5184         * decl.cs (MemberName.Name): Make readonly.
5185         (MemberName.FromDotted): New "constructor".
5186         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5187         (MemberCore.Name): Compute from MemberName on demand.
5188         (MemberCore.SetMemberName): Provide a way to change the
5189         MemberName.
5190         (MemberCore.AddToContainer): Don't take a fullname parameter.
5191         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5192         fully qualified name of the container to the member name.
5193         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5194         only if the type is a member of the root container.
5195         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5196         MemberName.Left rather than searching for an embedded ".".
5197         (PartialContainer.CreatePart): Update to changes in RootContext.
5198         (MemberBase.ShortName): Turn into a property.  Use
5199         MemberCore.SetMemberName.
5200         (MemberBase.ExplicitInterfaceName): Remove.
5201         (MemberBase.UpdateMemberName): Remove.
5202         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5203         (PropertyBase.SetMemberName): New override.
5204         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5205         (Tree.GetDecl): New.
5206         (Tree.AllDecls): Rename from Decls.
5207         * attribute.cs, enum.cs, report.cs: Update to changes.
5208         * driver.cs (MainDriver): Use MemberName.FromDotted on
5209         RootContext.MainClass.
5210
5211 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5212
5213         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5214         checks.
5215
5216         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5217
5218 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5219
5220         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5221         property accessor modifiers.
5222
5223         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5224         fixed buffer attribute (CS1716).
5225         (PropertyMethod.HasCustomAccessModifier): When property accessor
5226         has custom modifier.
5227
5228         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5229         modifiers.
5230         (PropertyExpr.DoResolveLValue): Add CS0272.
5231
5232 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5233
5234         * convert.cs: When converting to a pointer, use the proper Conv.U
5235         or Conv.I depending on the source data type.
5236
5237         * cs-tokenizer.cs: Make the size for large decimal constants,
5238         fixes #72957.
5239
5240 2005-03-17  Martin Baulig  <martin@ximian.com>
5241
5242         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5243         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5244
5245 2005-03-17  Martin Baulig  <martin@ximian.com>
5246
5247         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5248         to bool so we can return an error condition.
5249         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5250         returned an error.
5251
5252 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5253
5254         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5255         attributes.
5256
5257 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5258
5259         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5260         Refactor to avoid traversing the list of assemblies, and to avoid
5261         string concatenation.
5262         * typemanager.cs (guid_attr_type): Remove.
5263         (negative_hits, pointers, references): Remove hashes.
5264         (type_hash): New.
5265         (GetConstructedType): New.  Uses type_hash to handle constructed
5266         types (arrays, references, pointers).
5267         (GetReferenceType, GetPointerType): Use it.
5268         (GetNestedType): New.  Uses type_hash to handle nested types of
5269         reflected types.
5270         (LookupType, LookupTypeDirect): Remove.
5271         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5272         'types' hash and LookupTypeReflection directly.
5273         (params_string, params_object): Use GetConstructedType.
5274         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5275         top-level types.
5276         (Namespace.Lookup): Use cached_types.
5277         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5278         provided by old TypeManager.LookupType.
5279         * rootcontext.cs (MakeFQN): Remove.
5280         * decl.cs (DeclSpace.MakeFQN): Likewise.
5281         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5282         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5283         TypeManager.GetConstructedType.
5284         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5285
5286 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
5287
5288         * cs-parser.jay: Fix build.
5289
5290 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5291
5292         * class.cs (TypeContainer.CircularDepException) New nested
5293         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5294
5295         * cs-parser.jay: Reports CS1527 for any namespace element.
5296
5297         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5298         Added CS0407.
5299
5300         * expression.cs (ParameterReference.IsAssigned): Changed error to
5301         CS0269.
5302         (Error_WrongNumArguments): Moved CS0245 detection here.
5303
5304         * statement.cs (Return.Resolve): Add CS1622 report.
5305
5306 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5307
5308         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5309
5310 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5311
5312         * attribute.cs expression.cs: Get rid of some allocations.
5313
5314 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5315
5316         * doc.cs : just eliminate the latest change.
5317
5318 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5319
5320         * doc.cs : commented out the latest change. It breaks xml-030.cs
5321
5322 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5323
5324         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5325           fail. So invoke CreateType() in FindDocumentedType().
5326
5327 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5328
5329         * cs-tokenizer.cs : added IsKeyword().
5330         * doc.cs : Detect keyword incorrectly used as identifier.
5331           Allow identifiers prefixed by @.
5332
5333 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5334
5335         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5336         It caused exception in namespace resolving (again!).
5337         
5338         * class.cs (Class.ctor): Removed exit.
5339         (PropertyMethod.ctor): ditto.
5340         
5341         * codegen.cs (Codegen.Reset): Reset static data.
5342         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5343         
5344         * cs-tokenizer.cs (Cleanup): Removed.
5345         
5346         * driver.cs (GetSystemDir): Rewrote to one line command.
5347         It caused problem with unloaded dynamic modules.
5348         (UnixParseOption): Removed Exit.
5349         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5350         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5351         Now can be mcs used as library.
5352         
5353         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5354         empty location.
5355         
5356         * location.cs (Reset): Reset static data.
5357         
5358         * namespace.cs (Reset): Reset static data.
5359         
5360         * report.cs (Report.Reset): Reset static data.
5361         
5362         * rootcontext.cs (RootContext.Reset): Reset static data.
5363         
5364         * tree.cs (RootTypes.ctor): Use Location.Null
5365         
5366         * typemanager.cs (TypeManager.Reset): Reset static data.
5367         (CoreLookupType): Removed Exit.
5368         (TypeHandle.Reset): Reset static data.
5369         
5370 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5371
5372         Fix #73516.
5373         * typemanager.cs (ComputeNamespaces): Import namespaces from
5374         referenced modules too.
5375
5376 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5377
5378         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5379         than '.'.
5380
5381 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5382
5383         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5384         enclosing DeclSpace.  This ensures that a name-lookup populates
5385         more caches and there are fewer 'TypeExpression's.  Carve out
5386         nested type lookup into ...
5387         (LookupNestedTypeInHierarchy): ... this.
5388
5389 2005-04-15  Martin Baulig  <martin@ximian.com>
5390
5391         Merged r41590 from MCS and make it work in the generics land.
5392
5393         * generic.cs (TypeParameter.UpdateConstraints): Removed the
5394         `check' argument.
5395
5396         * class.cs (PartialContainer.UpdateConstraints): Removed.
5397         (PartialContainer.CheckConstraints): Removed.
5398         (PartialContainer.SetParameterInfo): Store the constraints here.
5399         (PartialContainer.DefineTypeParameters): New public method;
5400         resolve the type parameter's constraints here.  Note that the
5401         PartialContainer doesn't have an EmitContext anymore, so we must
5402         do this in the ClassPart.
5403
5404 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5405
5406         Clean up a few partial-class semantics.  
5407         Fixes test-357.cs and cs1618-2.cs.
5408         * cs-parser.jay (struct_declaration): Use 'current_class' as
5409         parent of newly-created struct.  Remove call to Register ().
5410         Use 'pop_current_class' to complete handing the current struct.
5411         (interface_declaration): Likewise.
5412         (class_declaration): Likewise.
5413         (enum_declaration): Use 'current_class' as parent of newly created
5414         enum.
5415         (delegate_declaration): Likewise.
5416         (pop_current_class): New function.  This is used to handle closing
5417         up the 'current_class' and 'current_container', and pointing them
5418         to the enclosing class/container.
5419         (CSharpParser): Initialize 'current_class' too.
5420         * decl.cs (MemberCore): Add check for invariant: a partial
5421         container is not a parsed entity, and thus does not enclose any
5422         parsed members.
5423         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5424         (DeclSpace.BaseTypeExpr): Use it.
5425         (DeclSpace.LookupType): Add check for invariant.
5426         * class.cs (TypeContainer): Add check for invariant: a nested
5427         class should have the same NamespaceEntry as its enclosing class.
5428         (TypeContainer.EmitFieldInitializers): Make virtual.
5429         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5430         MemberCore.
5431         (TypeContainer.Register): Remove.
5432         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5433         null.  Use TypeResolveEmitContext for resolving base types and
5434         interfaces.  Move initialization of Parts.TypeBuilder here from
5435         ...
5436         (TypeContainer.DefineNestedTypes): ... here.
5437         (PartialContainer): Take a Namespace not a NamespaceEntry.
5438         (PartialContainer.Create): Don't use Register.  Call the
5439         appropriate Add... function directly.
5440         (ClassPart): Take both the PartialContainer and the enclosing
5441         class as constructor arguments.
5442         (ClassPart.EmitFieldInitializers): Override.
5443         (ClassPart.PartFindNestedTypes): Remove.
5444         (FieldBase.GetInitializerExpression): Resolve the initializer
5445         expression in the emit context of the enclosing class.
5446         * tree.cs (RootTypes): Remove Register ().
5447         
5448 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5449
5450         * cs-parser.jay: Removed CS0134.
5451         
5452         * driver.cs: Removed CS1901.
5453         
5454         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5455         for predefined types.
5456
5457 2005-03-07  Duncan Mak  <duncan@novell.com>
5458
5459         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5460         well. Fixes bug #73454.
5461
5462 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5463
5464         * cs-tokenizer.cs (xtoken): Add CS1035.
5465         
5466         * class.cs (MethodData.Define): Add CS0683.
5467         (FieldMember.ctor): Add CS0681.
5468
5469 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5470
5471         * ecore.cs (SimpleName.DoResolve): Rename from
5472         SimpleName.DoResolveAllowStatic.
5473         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5474         Pass 'intermediate' flag to MemberStaticCheck.
5475         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5476         of "intermediate" lookups via MemberAccess.
5477         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5478         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5479
5480 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5481
5482         Fix #73394.
5483         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5484         slipped in because of variable names that are identical to a
5485         builtin type's BCL equivalent ('string String;', 'int Int32;').
5486         (PropertyExpr.EmitInstance): Likewise.
5487
5488 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5489
5490         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5491         
5492         * report.cs (warning_ignore_table): Made public.
5493
5494 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5495
5496         Fix #73282.
5497         * class.cs (MethodData.Emit): Pass 'container' to
5498         container.GetObsoleteAttribute instead of 'container.Parent'.
5499
5500 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5501
5502         * cs-parser.jay: Add 1534 error test.
5503
5504         * iterators.cs (Yield.CheckContext): Add error 1629.
5505         (Iterator.ctor): Save unsafe modifier.
5506         (MoveNextMethod.DoEmit): Restore unsafe context.
5507
5508         * namespace.cs (UsingAlias): Better error message.
5509
5510 2005-03-03  Dan Winship  <danw@novell.com>
5511
5512         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5513         the warning message [#73219]
5514
5515 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5516
5517         Fix compile with MCS 1.0.0.0.
5518         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5519         w_restore to not depend on string constant folding.
5520
5521 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5522
5523         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5524         CS0246 check to users who passed 'silent = false'.
5525         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5526         check.
5527         (SimpleName.SimpleNameResolve): Update.
5528         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5529         (MemberAccess.IdenticalNameAndTypeName): Update.
5530         * doc.cs (FindDocumentedTypeNonArray): Update.
5531
5532 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5533
5534         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5535         * parameters.cs (ComputeAndDefineParameters): Remove.
5536         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5537         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5538         Use GetParameterInfo.
5539
5540 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5541
5542         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5543
5544 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5545
5546         Unify DeclSpace.LookupType and DeclSpace.FindType.
5547         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5548         is in charge of defining nested types on demand.
5549         (DeclSpace.LookupType): Use it when the current_type is a
5550         TypeBuilder.  Use LookupTypeDirect for reflected types.
5551         (DeclSpace.FindType): Remove.
5552         (DeclSpace.LookupInterfaceOrClass): Likewise.
5553         (DeclSpace.DefineTypeAndParents): Likewise.
5554         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5555         DeclSpace.LookupType.
5556         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5557         * typemanager.cs (LookupType): Simplify.
5558         (AddUserType): Remove type from negative_hits.
5559         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5560         * class.cs (TypeContainer.FindMembers): Move handling of nested
5561         types ...
5562         (TypeContainer.FindMembers_NestedTypes): ... here.
5563         (TypeContainer.FindNestedType): Implement override.
5564         (ClassPart.FindNestedType): Delegate to PartialContainer.
5565         (ClassPart.PartFindNestedType): Looks up the nested types of the
5566         part alone.
5567
5568 2005-04-14  Martin Baulig  <martin@ximian.com>
5569
5570         * generic.cs (ConstructedType): Moved all the type lookup and
5571         nested class logic into SimpleName.
5572         (ConstructedType.ResolveConstructedType): Our underlying type is
5573         already fully resolved; all the type lookup stuff is in
5574         SimpleName.
5575
5576         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5577         constructed types here instead of in ConstructedType.
5578
5579         * decl.cs (MemberName.GetTypeExpression): Always create a
5580         SimpleName, not a ConstructedType.
5581         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5582
5583 2005-03-02  Martin Baulig  <martin@ximian.com>
5584
5585         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5586         static constructor in static classes.
5587
5588 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5589
5590         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5591         sizeParamIndex is not specified.
5592
5593 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5594
5595         Fix #73117
5596         * report.cs (WarningMessage.IsEnabled): Missing null check.
5597
5598 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5599
5600         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5601         in the fields and not in the properties.
5602
5603 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5604
5605         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5606         fields as well.
5607
5608 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5609
5610         * attribute.cs: Small refactoring (improved robustness).
5611         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5612         (ValidateGuid): Removed.
5613         (Resolve): Removed referenced to above mentioned.
5614         (GetAttributeUsage): Made private and changed to work without
5615         class assistance.
5616         (GetIndexerAttributeValue): Don't crash.
5617         (GetConditionalAttributeValue): Ditto.
5618         (GetClsCompliantAttributeValue): Ditto.
5619         (ExtractSecurityPermissionSet): All attributes exceptions are
5620         error 648.
5621         (GetPropertyValue): New helper.
5622         (GetMethodImplOptions): New method.
5623         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5624         some missing properties.
5625         
5626         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5627         (Method.ApplyAttributeBuilder): Updated.
5628         
5629         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5630         exception.
5631
5632 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5633
5634         Fix #73052.
5635         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5636         non-simple types (array, pointer, reference).
5637
5638 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5639
5640         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5641
5642         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5643         for operators.
5644         (Method.CheckBase): Catch wrong destructor here.
5645         (MethodData.Define): Add errors 550, 668.
5646
5647         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5648
5649         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5650
5651         * pending.cs (VerifyPendingMethods): Add error 551.
5652
5653         * typemanager.cs (CSharpName): Next error report helper.
5654
5655 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5656
5657         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5658         attributes. Removed useless attribute double check.
5659         It saves almost 2MBs for corlib.
5660
5661 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5662
5663         Fix #72924.
5664         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5665         called twice in case of error.
5666
5667 2005-02-23  Chris Toshok  <toshok@ximian.com>
5668
5669         Fix compiler portions of #72827.
5670         * statement.cs (Block.Emit): call Begin/EndScope on the
5671         EmitContext instead of the ILGenerator.
5672
5673         * codegen.cs (EmitContext.BeginScope): new method, call
5674         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5675         we have one.)
5676         (EmitContext.BeginScope): same, but EndScope and CloseScope
5677
5678         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5679         offset and call the superclass's OpenScope(int) with it.
5680         (SymbolWriter.CloseScope): get the current il
5681         offset and call superclass's CloseScope(int) with it.
5682
5683 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5684
5685         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5686         CS1677 for out and ref as well.
5687
5688         * class.cs (Method.Define): Add error CS1599 detection.
5689         
5690         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5691         
5692         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5693         
5694         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5695         
5696         * support.cs.cs (ModifierDesc): New helper method.
5697
5698 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5699             Abin Thomas  <projectmonokochi@rediffmail.com>
5700             Anoob V E  <projectmonokochi@rediffmail.com>
5701             Harilal P R  <projectmonokochi@rediffmail.com>
5702
5703         Fix #57851, #72718.
5704         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5705         MemberLookup (used for error reporting) actually returns a result.
5706         Fix error report number (122, not 112).
5707
5708 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5709             Anoob V E  <projectmonokochi@rediffmail.com>
5710             Harilal P R  <projectmonokochi@rediffmail.com>
5711
5712         Fix #71134.
5713         * pending.cs (PendingImplementation.GetAbstractMethods):
5714         Find NonPublic members too.
5715
5716 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5717
5718         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5719         Fixed error 217.
5720         
5721         * class.cs (MethodCore.CheckMethodAgainstBase):
5722         Add error 239 report.
5723
5724 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5725
5726         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5727         
5728         * class.cs (Operator.Define): Add error 217 report.
5729         
5730 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5731
5732         Fix #68955.
5733         * expression.cs (Invocation.IsApplicable): Make public.
5734         (Invocation.IsParamsMethodApplicable): Likewise.
5735         * delegate.cs (Delegate.VerifyApplicability): Don't use
5736         Invocation.VerifyArgumentCompat for parameter applicability
5737         testing.  Use Invocation.IsApplicable and
5738         Invocation.IsParamsMethodApplicable.
5739
5740 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5741
5742         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5743         
5744         * class.cs (Operator.Define): Add error 217 report.
5745         
5746 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5747
5748         * namespace.cs (UsingEntry.Resolve): Undo change below.
5749
5750 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5751
5752         Fix #72756.
5753         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5754         disable the error message when the extended MemberLookup also
5755         fails.
5756         (Expression.MemberLookupFinal): Update.
5757         (SimpleName.DoSimpleNameResolve): Update.
5758         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5759         Don't use MemberLookupFinal.
5760         (New.DoResolve): Update.
5761         (BaseAccess.CommonResolve): Update.
5762
5763 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5764
5765         Fix #72732.
5766         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5767         occured previously, don't resolve again.
5768
5769 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5770
5771         Fix #69949
5772         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5773         argument. Call ResolveAttributeUsage for unresolved.
5774         when types doesn't match ctor arguments.
5775         
5776         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5777         for nested attribute classes.
5778         (Class.attribute_usage): Removed.
5779         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5780         for attribute class.
5781         
5782         * ecore.cs (IsAttribute): Removed.
5783         
5784         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5785         
5786         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5787         now normal types.
5788         (attribute_types): Removed.
5789         (EmitCode): Global attributes are emited as the latest.
5790
5791 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5792
5793         * class.cs (EmitFieldInitializers): Don't emit field initializer
5794         for default values when optimilization is on.
5795         
5796         * constant.cs (Constant.IsDefaultValue): New property.
5797         
5798         * driver.cs: Add /optimize handling.
5799         
5800         * constant.cs,
5801         * ecore.cs,
5802         * literal.cs: Implement new IsDefaultValue property.
5803         
5804         * rootcontext.cs (Optimize): New field, holds /optimize option.
5805
5806 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5807
5808         Fix crasher in re-opened #72347.
5809         * namespace.cs (Namespace.Lookup): Return null if
5810         DeclSpace.DefineType returns null.
5811
5812         Fix #72678.
5813         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5814
5815 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5816
5817         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5818         now returns null if it cannot resolve to an lvalue.
5819         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5820         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5821         returned null.  Remove check for SimpleName.
5822         (EventExpr.DoResolveLValue): New.
5823         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5824         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5825         error from ...
5826         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5827         avoid CS0131 error.
5828         (Unary.ResolveOperator): Move CS0211 check ...
5829         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5830         CS0131 error.
5831         (Unary.DoResolveLValue): Simplify.
5832         (AddressOf.DoResolveLValue): New.
5833         (ArrayAccess.DoResolveLValue): New.
5834
5835 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5836
5837         * attribute.cs (Attribute.Resolve): Add arguments casting for
5838         when types doesn't match ctor arguments.
5839
5840 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5841
5842         Fix parts of #63202.
5843         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5844         lookup of operator in base type.  Ensure that all checks happen
5845         when the operator resolves to an "op_..." method.
5846
5847 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5848
5849         Fix #71992.
5850         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5851         'ignore_cs0104' parameter.  Pass it to ...
5852         (NamespaceEntry.Lookup): ... this.
5853         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5854         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5855         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5856         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5857         Update.  Request that cs0104 errors be ignored.
5858         (ComposedCast.ResolveAsTypeStep): Update.
5859
5860 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5861
5862         Fix #59209.
5863         * expression.cs (Invocation.BetterFunction): Remove support for
5864         comparing virtual functions and their overrides.
5865         (Invocation.IsOverride): New.
5866         (Invocation.OverloadResolve): Don't consider 'override' functions
5867         during candidate selection.  Store them in a lookaside list.
5868         If the selected method is a 'virtual' function, use the list to
5869         find any overrides that are closer to the LHS type.
5870
5871 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5872
5873         * expression.cs (New.DoResolve): Add complex core type reduction.
5874         (New.Constantify): Converts complex core type syntax like 'new int ()'
5875         to simple constant.
5876         
5877 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5878
5879         * decl.cs (EntryType.EntryType): New constructor to create an
5880         updated copy of a cache entry.
5881         (MemberCache.AddMethods): Use it.
5882         (MemberCache.ClearDeclaredOnly): Remove.
5883         (MemberCache.MemberCache): Update.
5884
5885 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5886
5887         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5888         variable.  This one is represents the actual low-level declaration
5889         of the method, as opposed to the semantic level `IsStatic'.   
5890
5891         An anonymous method which is hosted into a static method might be
5892         actually an instance method.  IsStatic would reflect the
5893         container, while MethodIsStatic represents the actual code
5894         generated.
5895
5896         * expression.cs (ParameterReference): Use the new MethodIsStatic
5897         instead of IsStatic.
5898
5899         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5900         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5901         set on the current EmitContext. 
5902
5903         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5904         resolve our casted expression as an LValue.  This triggers the
5905         proper LValue processing that is later required by Assign.
5906
5907         This fixes 72347.
5908
5909         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5910
5911 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5912
5913         C# 2.0 Fixed buffer implementation
5914
5915         * anonymous.cs: Update after RegisterHelperClass renaming.
5916
5917         * attribute.cs (AttributeTester.fixed_buffer_cache):
5918         Cache of external fixed buffers.
5919         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5920         implementation if field is fixed buffer else null.
5921
5922         * class.cs
5923         (TypeContainer.AddField): Accept FieldMember instead of Field.
5924         (FieldBase.IsFieldClsCompliant): Extracted code from
5925         VerifyClsCompliance descendant customization.
5926         (FixedField): New class handles fixed buffer fields.
5927         (FixedFieldExternal): Keeps information about imported fixed
5928         buffer.
5929         (IFixedField): Make access to internal or external fixed buffer
5930         same.
5931
5932         * cs-parser.jay: Add fixed buffer parsing.
5933
5934         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5935         buffer.
5936
5937         * expression.cs (Indirection): Extended implementation to accept
5938         fixed buffer field.
5939         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5940         (ElementAccess.MakePointerAccess): Get type as parameter.
5941         (DoResolve): Add fixed buffer field expression conversion.
5942         (DoResolveLValue): Ditto.
5943         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5944         (ArrayPtr): Derives from FixedBufferPtr.
5945         (ArrayPtr.Emit): Add extra emit for array elements.
5946
5947         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5948
5949         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5950         for compiler generated types.
5951         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5952
5953         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5954         and consume less memory.
5955         (Fixed.Resolve): Add fixed buffer case.
5956
5957         * typemanager.cs (compiler_generated_attr_ctor,
5958         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5959         (HasElementType): Add our own implementation to work on every
5960         runtime.
5961
5962 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5963
5964         * anonymous.cs (CaptureContext): Track whether `this' has been
5965         referenced.   
5966
5967         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5968         only captured `this' if it was implicitly done (instance
5969         methods/variables were used). 
5970
5971         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5972         `this' must be captured.
5973
5974 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5975  
5976         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5977         is null it means that there has been no need to capture anything,
5978         so we just create a sibling.
5979
5980         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5981
5982         Just a partial fix.  The other half is fairly elusive.
5983         
5984 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5985
5986         Fix #52586, cs0121-4.cs.
5987         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5988         and return a hashtable.
5989         (MemberCache.ClearDeclaredOnly): New.
5990         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5991         the method_hash of a base type too.
5992         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5993         type methods.  Overwrite entries with the same MethodHandle so
5994         that the ReflectedType is correct.  The process leaves in base
5995         virtual functions and their overrides as distinct entries.
5996         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5997         matters since it was boxed in a ArrayList before.
5998         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5999         modifier.
6000         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6001         case of a virtual function and its override (choose the overload
6002         as better).
6003         (Invocation.OverloadResolve): Avoid 'override' members during
6004         'applicable_type' calculation.
6005
6006 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6007
6008         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6009         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6010         GetTypeHandle.  It is possible for a reflected type to derive from
6011         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6012         System.Array during mscorlib compilation).
6013         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6014         contain a method_hash, don't create one either.  Don't create a
6015         deep copy of the base cache's method_hash.
6016         (MemberCache.SetupCache): Rename back from DeepCopy.
6017         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6018         already initialized.  If we see an override function, add its
6019         underlying base virtual function to the member_hash too.
6020
6021 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6022
6023         Combine two near-redundant caches.
6024         * typemanager.cs (method_params): Rename from method_internal_params.
6025         (TypeManager.GetParameterData): New.  Replace
6026         Invocation.GetParameterData.
6027         (TypeManager.LookupParametersByBuilder): Remove.
6028         * expression.cs (Invocation.method_parameter_cache): Remove.
6029         (Invocation.GetParameterData): Remove.
6030         Update to changes.
6031         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6032         Update to changes.
6033
6034 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6035
6036         Fix #72015.
6037         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6038         TypeManager.multicast_delegate_type is null, resolve it by looking
6039         up "System.MulticastDelegate".
6040         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6041
6042 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6043             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6044             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6045
6046         Fix cs0164.cs.
6047         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6048         (LabeledStatement.AddReference): New.  Set 'referenced'.
6049         (Goto.Resolve): Use it.
6050
6051 2005-02-05  John Luke  <john.luke@gmail.com>
6052
6053         * driver.cs: remove duplicate -doc line in Usage ()
6054
6055 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6056
6057         * location.cs (Location.AddFile): Fix CS2002 error report.
6058
6059 2005-02-02  Martin Baulig  <martin@ximian.com>
6060
6061         * delegate.cs (Delegate.DefineType): Report an internal error if
6062         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6063         details.        
6064
6065 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6066
6067         Fix a crasher in a variant of #31984.
6068         * const.cs (Constant.CheckBase): New override that defers the
6069         new-or-override check in case the base type hasn't been populated
6070         yet.
6071         (Constant.Define): Ensure the new-or-override check is performed.
6072
6073 2005-02-01  Duncan Mak  <duncan@ximian.com>
6074
6075         * const.cs (LookupConstantValue): Check that `ce' is not null
6076         before calling GetValue ().
6077
6078 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6079
6080         Fix test-334.cs (#69519).
6081         * cs-parser.jay (using_alias_directive): Pass in an expression to
6082         NamespaceEntry.UsingAlias.
6083         (using_namespace_directive): Pass in an expression to
6084         NamespaceEntry.Using.
6085         (namespace_name): Don't flatten to a string.
6086         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6087         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6088         ResolveAsTypeStep.
6089         (NamespaceEntry.UsingEntry): Likewise.
6090         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6091         changes.
6092         (NamespaceEntry.LookupForUsing): Remove.
6093         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6094         names.
6095         (NamespaceEntry.Lookup): Remove support for dotted names.
6096
6097 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6098
6099         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6100         split into two.
6101         (NamespaceEntry.ImplicitParent): Compute on demand.
6102         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6103         parallels the current.
6104         (NamespaceEntry.LookupForUsing): Use it.
6105         (NamespaceEntry.Lookup): If the current namespace-entry is
6106         implicit, don't search aliases and using tables.
6107
6108 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6109
6110         Fix #31984.
6111         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6112         BaseCache here.
6113         (TypeContainer.BaseCache): Compute on demand.
6114         (TypeContainer.FindMembers): Define constants and types if they're
6115         not already created.
6116         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6117         check.
6118         * const.cs (Constant.Define): Make idempotent.
6119
6120 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6121
6122         * pending.cs: Produce better code (no nops produced by using Ldarg
6123         + value).
6124         
6125         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6126         i - 1' it should be arg + 1.
6127
6128         Fixes bug #71819.
6129
6130 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6131
6132         * attribute.cs (Attribute.CheckAttributeType): Make private
6133         non-virtual.
6134         (Attribute.ResolveType): Make virtual.
6135         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6136         handling of RootContext.Tree.Types.
6137
6138 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6139
6140         Update attribute-handling to use the SimpleName/MemberAccess
6141         mechanisms.
6142         * cs-parser.jay (attribute): Pass in an expression to the
6143         constructors of Attribute and GlobalAttribute.
6144         * attribute.cs (Attribute): Take an expression for the name.
6145         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6146         passed in attribute name expression.
6147         (Attribute.CheckAttributeType): Use it.
6148         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6149         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6150         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6151         argument to prevent error messages if the lookup fails.
6152
6153 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6154
6155         * expression.cs (Indirection): Implemented IVariable interface
6156         to support indirection in AddressOf operator.
6157         (PointerArithmetic.Emit): Add optimalization for case where
6158         result can be precomputed.
6159
6160 2005-01-26  Martin Baulig  <martin@ximian.com>
6161
6162         * class.cs (TypeContainer.AttributeTargets): Return the correct
6163         AttributeTargets depending on our `Kind' instead of throwing an
6164         exception; fixes #71632.
6165
6166 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6167
6168         Fix #71257
6169         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6170         constant members.
6171
6172 2005-03-17  Martin Baulig  <martin@ximian.com>
6173
6174         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6175         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6176
6177 2005-03-17  Martin Baulig  <martin@ximian.com>
6178
6179         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6180         to bool so we can return an error condition.
6181         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6182         returned an error.
6183
6184 2005-03-17  Martin Baulig  <martin@ximian.com>
6185
6186         * generic.cs (TypeMananager.IsIEnumerable): New public method.
6187
6188         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6189         converting from an array-type of T to `IEnumerable<T>'.
6190
6191 2005-03-16  Martin Baulig  <martin@ximian.com>
6192
6193         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6194         (Nullable.LiftedUnaryMutator): New public class.
6195
6196         * expression.cs (UnaryMutator.DoResolve): Added support for
6197         Nullable Types.
6198
6199 2005-03-14  Martin Baulig  <martin@ximian.com>
6200
6201         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6202
6203 2005-03-14  Martin Baulig  <martin@ximian.com>
6204
6205         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6206         the comparision operators `<', `>', `<=' and `>='.
6207
6208 2005-03-13  Martin Baulig  <martin@ximian.com>
6209
6210         * generic.cs
6211         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6212         avoid confusion with the `NullLiteral'.
6213         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6214
6215 2005-03-13  Martin Baulig  <martin@ximian.com>
6216
6217         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6218         comparing arbitrary types with the null literal.
6219
6220 2005-03-13  Martin Baulig  <martin@ximian.com>
6221
6222         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6223         boolean operators '&&', '||', '&' and '|'.
6224         (Nullable.OperatorTrueOrFalse): New public class.
6225
6226         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6227         instead of a `StaticCallExpr'; added support for nullables.
6228
6229 2005-03-10  Martin Baulig  <martin@ximian.com>
6230
6231         * expression.cs
6232         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6233         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
6234
6235 2005-03-07  Martin Baulig  <martin@ximian.com>
6236
6237         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6238         it work if `expr' is not an IMemoryLocation.
6239         (Nullable.Lifted): Implement IMemoryLocation.
6240         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6241         target type.
6242
6243 2005-03-05  Martin Baulig  <martin@ximian.com>
6244
6245         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6246         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6247         (Nullable): Added support for lifted unary and binary operators.
6248
6249         * expression.cs (Unary.DoResolve): Added support for nullable types.
6250         (Binary.DoResolve): Likewise.
6251         (Conditional.DoResolve): Likewise.
6252
6253 2005-03-02  Martin Baulig  <martin@ximian.com>
6254
6255         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6256
6257         * class.cs (ClassPart.SetParameterInfo): Override this.
6258         (PartialContainer.SetParameterInfo): Override this.
6259         (TypeContainer.CheckConstraints): New protected method.
6260         (PartialContainer.CheckConstraints): Override this and check
6261         whether the same contraints were specified in all parts of a
6262         partial generic type definition.
6263         (PartialContainer.UpdateConstraints): New public method.
6264
6265         * generic.cs (TypeParameter.UpdateConstraints): New public method.
6266
6267 2005-03-02  Martin Baulig  <martin@ximian.com>
6268
6269         Committing a patch from Carlos Alberto Cortez to fix #72887.
6270
6271         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6272         casts from `T []' to `int []'.
6273
6274 2005-03-02  Martin Baulig  <martin@ximian.com>
6275
6276         * generic.cs (TypeManager.IsEqual): Make this symmetric.
6277
6278         * expression.cs (Binary.ResolveOperator): When resolving a
6279         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6280         `=='.  Fixes #71866.  See gen-127.cs.
6281
6282 2005-03-02  Martin Baulig  <martin@ximian.com>
6283
6284         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6285         static constructor in static classes.
6286
6287 2005-03-02  Martin Baulig  <martin@ximian.com>
6288
6289         * generic.cs
6290         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6291         (Nullable.LiftedConversion): Added support for user-defined
6292         conversions.
6293
6294         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6295
6296         * cs-parser.jay: Use ComposedCast everywhere instead of
6297         NullableType, so we don't need to check for NullableType
6298         everywhere.
6299         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6300         case where we'll be resolved into a `parenthesized_expression_0'
6301         afterwards.
6302
6303         * convert.cs
6304         (Convert.UserDefinedConversion): Added nullable conversions.
6305
6306 2005-02-28  Martin Baulig  <martin@ximian.com>
6307
6308         * generic.cs (TypeManager.IsNullableType): New static method.
6309         (Nullable): New abstract class.
6310         (Nullable.NullLiteral): New public class.
6311         (Nullable.LiftedConversion): New public class.
6312
6313         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6314         `builtin_types opt_nullable'.
6315
6316         * convert.cs
6317         (Convert.ImplicitConversionStandard): Added nullable conversions.
6318         (Convert.ExplicitConversionStandard): Likewise.
6319         (Convert.ExplicitConversion): Likewise.
6320
6321 2005-02-26  Martin Baulig  <martin@ximian.com>
6322
6323         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6324         begin with a "?", for instance "?[]".  Don't do a type lookup if
6325         `dim' is empty.
6326
6327 2005-02-25  Martin Baulig  <martin@ximian.com>
6328
6329         The first part of Nullable Types :-)
6330
6331         * generic.cs (NullableType): New public class.
6332         (NullCoalescingOperator): New public class.
6333         (TypeArguments.Resolve): Add a CS0306 check.
6334
6335         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6336         (opt_nullable): New rule.
6337         (type): Added `opt_nullable' to `namespace_or_type_name',
6338         `builtin_types' and `pointer_type'.
6339         (array_type): Added `opt_nullable'.
6340         (opt_rank_specifier_or_nullable): New rule; this is the
6341         combination of `opt_rank_specifier' and `opt_nullable'.
6342         (opt_error): New rule; catch errors here.
6343         (nullable_type_or_conditional): New rule; we use this to check for
6344         nullable and still detect the conditional operator.
6345         (local_variable_type): Use `opt_rank_specifier_or_nullable'
6346         instead `opt_rank_specifier'.
6347
6348         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6349         for nullables.
6350
6351 2005-02-24  Martin Baulig  <martin@ximian.com>
6352
6353         * README, README.Changes: Removed; they're old and obsolete.
6354
6355 2005-02-22  Martin Baulig  <martin@ximian.com>
6356
6357         * generic.cs (TypeParameter.Resolve): If resolving the constraints
6358         returned an error, set `constraints' to null to avoid a crash
6359         later on.
6360         (TypeParameter.ResolveType): Likewise.
6361
6362 2005-02-22  Martin Baulig  <martin@ximian.com>
6363
6364         * generic.cs
6365         (Constraints.ResolveTypes): Protect against being called twice.
6366         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6367         (TypeParameter.ResolveType): New public method; calls
6368         constraints.ResolveTypes().
6369         (TypeParameter.DefineType): Moved constraints.ResolveType() out
6370         into the new ResolveType().
6371         (GenericMethod.Define): Call ResolveType() on all our
6372         TypeParameter's.        
6373
6374 2005-02-21  Martin Baulig  <martin@ximian.com>
6375
6376         * generic.cs
6377         (TypeManager.generic_nullable_type): New static public field.
6378         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6379
6380         * rootcontext.cs
6381         (RootContext.ResolveCore): Resolve "System.Nullable`1".
6382
6383 2005-02-15  Martin Baulig  <martin@ximian.com>
6384
6385         * generic.cs (ConstructedType.Constraints): Correctly check
6386         constraints if the argument type is a type parameter; fixes
6387         #72326. 
6388
6389 2005-02-02  Martin Baulig  <martin@ximian.com>
6390
6391         * delegate.cs (Delegate.DefineType): Report an internal error if
6392         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6393         details.        
6394
6395 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6396
6397         * pending.cs: Produce better code (no nops produced by using Ldarg
6398         + value).
6399         
6400         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6401         i - 1' it should be arg + 1.
6402
6403         Fixes bug #71819.
6404         
6405 2005-01-26  Martin Baulig  <martin@ximian.com>
6406
6407         * cs-parser.jay (indexer_declarator): Don't report an error if we
6408         have type parameters since we can be an explicit interface
6409         implementation; fixes #71449.
6410
6411 2005-01-26  Martin Baulig  <martin@ximian.com>
6412
6413         * class.cs (TypeContainer.AttributeTargets): Return the correct
6414         AttributeTargets depending on our `Kind' instead of throwing an
6415         exception; fixes #71632.
6416
6417 2005-01-26  Martin Baulig  <martin@ximian.com>
6418
6419         * delegate.cs (Delegate.DefineType): Correctly define our type
6420         parameters.  Fixes #71483.
6421
6422 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6423
6424         Fix #71602.
6425         * expression.cs (MemberAccess.DoResolve): Don't complain with
6426         cs0572 when the LHS of a member access has identical name and type
6427         name.
6428
6429 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6430
6431         Fix #71651, #71675
6432         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6433         CreatePermission.
6434         Create custom PermissionSet only for PermissionSetAttribute.
6435
6436 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6437
6438         Fix #71649
6439         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6440         delegates in static class.
6441
6442 2005-01-24  Martin Baulig  <martin@ximian.com>
6443
6444         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6445         merging an implicit block, just use its reachability.
6446
6447         * statement.cs (Block.Resolve): Make the unreachable code check
6448         work wrt. implicit blocks; see test-337 from #63842.
6449
6450 2005-01-21  Alp Toker  <alp@atoker.com>
6451  
6452         * cs-parser.jay: destructor_declaration's container is PartialContainer
6453         not Class when partial types are used, so use Kind prop instead of
6454         'is'.
6455         
6456 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6457
6458         * cs-parser.jay: Improve error reporting when an interface
6459         declares new types.
6460
6461 2005-01-20  Dick Porter  <dick@ximian.com>
6462
6463         * support.cs: SeekableStreamReader fix from Sandor Dobos
6464         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6465         chars are read.  Fixes bug 70369.
6466
6467 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6468
6469         * cs-parser.jay (catch_clause): Simplify current_block handling
6470         somewhat.
6471
6472 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6473
6474         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6475         code with ImplicitStandardConversion to handle the implicit
6476         conversion of method groups into valid delegate invocations. 
6477
6478         The problem is that in parameter handling we were using this code
6479         path.  Fixes bug #64698
6480
6481 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6482
6483         * cs-parser.jay: Fix several infelicities.
6484         - Avoid assigning to the parser value stack.  Code like 
6485           '$3 = null' is unclean.  Synthesize a value for the code block
6486           instead. 
6487         - Avoid using oob_stack for storing location information.  Use ...
6488         (_mark_): ... this.  New (empty) rule.  Saves the current location
6489         in $$.
6490         (foreach_statement): Avoid using oob_stack for current_block
6491         handling.  Use technique used in for_statement and
6492         using_statement.  Synthesize a value for the code block to store
6493         additional intermediate information.
6494
6495 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6496
6497         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6498         of a different type is only allowed to private fields of a
6499         containing type, not on fields of a base class.
6500
6501         See test-174.cs and error cs0122-9.cs
6502
6503 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6504
6505         Fix test-335.cs (bug #58126).
6506         * cs-parser.jay (argument): Split out non-expression parts of the
6507         rule into 'non_simple_argument'.
6508         (invocation_expression): Support parenthesized invocations with
6509         multiple arguments, and with single non-simple arguments.
6510
6511 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6512
6513         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6514         places.
6515
6516 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6517
6518         Fix cs0038-1.cs, cs1640-6.cs.
6519         * ecore.cs (Expression.Resolve): Remove special-case for
6520         SimpleName in error-handling.
6521         (Expression.almostMatchedMembers): Relax access permission to
6522         protected.
6523         (Expression.MemberLookupFailed): Handle duplicates in
6524         almostMatchedMembers list.
6525         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6526         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6527         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6528         overload if the passed in MemberInfo is a MethodBase.
6529
6530 2005-01-25  Martin Baulig  <martin@ximian.com>
6531
6532         * doc.cs
6533         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6534
6535 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6536
6537         Fix #70749
6538         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6539         for non-CAS & merge permission sets properly.
6540
6541 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6542
6543         Improve standard-compliance of simple name and member access 
6544         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6545         * ecore.cs (FullNamedExpression): New abstract base class 
6546         for Namespaces and TypeExpressions.
6547         (ResolveFlags.SimpleName): Remove.
6548         (SimpleName): Remove support for dotted names.
6549         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6550         DeclSpace.FindType and DeclSpace.LookupType.
6551         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6552         (Expression.ExprClassName): Make member function.
6553         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6554         a namespace.  Remove creation of dotted "SimpleName"s.
6555         (MemberAccess.DoResolve): Likewise.
6556         * decl.cs (DeclSpace.Cache): Make private.
6557         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6558         (DeclSpace.FindType): Update.
6559         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6560         FullNamedExpression.
6561         * namespace.cs (Namespace): Derive from FullNamedExpression
6562         so that it can be part of expression resolution.
6563         (Namespace.Lookup): Return an FullNamedExpression.
6564         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6565         namespace.
6566         * rootcontext.cs (NamespaceLookup): Remove.
6567         (LookupType): Move to DeclSpace.
6568         * attribute.cs (CheckAttributeType): Update.
6569         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6570         (FindDocumentedTypeNonArray): Likewise.
6571
6572 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6573
6574         Fix cs0509.cs, cs1632.cs.
6575         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6576         is the same as IsInterface.
6577         (TypeContainer.GetClassBases): Likewise.
6578         * statement.cs (LabeledStatement.ig): New field.
6579         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6580         label.
6581         (LabeledStatement.DoEmit): Check that the label was created with
6582         the same ILGenerator.
6583
6584 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6585
6586         Fix #71058
6587         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6588         accessors to its properties.
6589
6590         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6591         from accessors to property.
6592         
6593 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6594
6595         Fix #70722
6596         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6597         only for overrides.
6598         
6599 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6600
6601         * attribute.cs: Check for null and empty strings.  
6602
6603         I have lost another battle to Paolo.
6604
6605 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6606
6607         Fix #70942
6608         * class.cs (PropertyMethod): Set Parent field in ctors.
6609         (SetMethod.InternalParameters): Add unsafe switch hack.
6610         Override MarkForDuplicationCheck where it is appropriate.
6611
6612         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6613         It says whether container allows members with the same name.
6614         Base default is no.
6615         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6616         Removed is_method parameter.
6617
6618 2005-01-06  Duncan Mak  <duncan@ximian.com>
6619
6620         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6621         because the previous change led to incorrect reporting of CS1032
6622         ("Cannot define/undefine preprocessor symbols after first token in
6623         file"). Instead of using `tokens_seen' as the only flag that
6624         triggers CS1040, introduce `comments_seen'. This new flag is used
6625         to signify having seen comments on the current line, so it is
6626         unset after a newline.
6627
6628 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6629
6630         * doc.cs : When searching for a type, find nested type too.
6631           This fixes bug #71040.
6632
6633 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6634
6635         * doc.cs :
6636           - Warn missing member comment on those classes which also does not
6637             have doc comments. Fixed bug #71041.
6638           - Don't warn missing doc comment on default constructor.
6639             Fixed bug #71042.
6640
6641 2005-01-06  Duncan Mak  <duncan@ximian.com>
6642
6643         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6644         comments, set `tokens_seen' to true. This allows us to detect
6645         misplaced preprocessor directives (i.e. not at the beginning of
6646         the a line, nor after whitespaces). In that case, report error
6647         CS1040. This fixes bug #56460.
6648
6649         * cs-parser.jay (interface_member_declaration): Add checks for
6650         IsExplicitImpl, and report CS0541 error if an interface member is
6651         defined as an explicit interface declaration.
6652
6653 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6654
6655         Fix #70817
6656         * class.cs (PropertyMethod): Set Parent field in ctors.
6657         (SetMethod.InternalParameters): Add unsafe switch hack.
6658         
6659         * decl.cs (MemberCore.Parent): Cannot be readonly.
6660
6661 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6662
6663         * decl.cs (DeclSpace.ResolveType): Remove.
6664         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6665         Merge in code from ...
6666         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6667         * class.cs, enum.cs: Update to changes.
6668
6669 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6670
6671         * anonymous.cs: Ensure that we init the scope of our parent if it
6672         has not been initialized yet.
6673
6674 2004-12-30  Duncan Mak  <duncan@ximian.com>
6675
6676         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6677         if field.FieldBuilder is null. Fixes #70758.
6678
6679         * convert.cs: Fixed some typos and updated some of the comments.
6680         (ImplicitStandardConversionExists):
6681         (TryImplicitIntConversion): If `target_type' is an interface and
6682         the type of `ic' implements this interface, return true or a new
6683         BoxedCast instead of null. This fixes #70468.
6684
6685 2004-12-29  Duncan Mak  <duncan@ximian.com>
6686
6687         * expression.cs (Argument.Emit): Check that Expr is
6688         IMemoryLocation before casting to it, and report CS1510 otherwise.
6689
6690         This fixes #70402.
6691
6692 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6693
6694         * statement.cs (Block.ThisVariable): remove the recursion here, to
6695         make the --profile more sane.
6696
6697 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6698
6699         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6700         assembly, by JB Evain.
6701
6702 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6703
6704         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6705           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6706         "parent" refers to enclosing type/class.  "base" refers to superclass.
6707
6708 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6709
6710         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6711         Ensure that we only have GlobalAttributes.
6712         * attribute.cs (Attribute.Emit): Make non-virtual.
6713         (GlobalAttribute.Emit): Remove.
6714         (Attribute.Resolve): Make virtual.
6715         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6716         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6717         the argument. Don't create one.
6718         (Attribute.GetObsoleteAttribute): Likewise.
6719         (Attribute.GetClsCompliantAttributeValue): Likewise.
6720         * class.cs, decl.cs: Update to changes.
6721
6722 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6723
6724         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6725         
6726         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6727         
6728         * statement.cs (Foreach.Resolve): Add error 186 report.
6729
6730 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6731
6732         * expression.cs (Conditional.DoResolve): Add warning 429.
6733         
6734         * statement.cs (If.Resolve): Add warning 665.
6735
6736 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6737
6738         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6739         except when in the parser, and in GlobalAttribute.
6740         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6741         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6742         RootContext.Tree.Types.NamespaceEntry once work is done.
6743         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6744         and resets RootContext.Tree.Types.NamespaceEntry.
6745
6746 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6747
6748         * cs-parser.jay: Don't create a block for every variable.
6749
6750 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6751
6752         * location.cs: Provide extra information.
6753
6754         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6755         variables from the captured environment, it is the ldarg_0.
6756
6757 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6758
6759         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6760         find a conclusion.
6761         
6762         * class.cs: Changed warning level for 169 to avoid developer
6763         displeasure from warning flooding. It will be changed back when they
6764         fix most of current BCL warnings.
6765         
6766         * RootContext.cs: Pushed default WarningLevel to 3.
6767         
6768         * statement.cs: Removed unused variable.
6769
6770 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6771
6772         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6773         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6774         Add error 502 report.
6775         (StaticClass.DefineType): Add error 441 report.
6776         (Class.AllowedModifiersProp): New virtual property as temporary
6777         extension to AllowedModifiers.
6778         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6779         to share implementation with StaticClass and don't call virtual
6780         methods from ctor.
6781         
6782         * driver.cs (MainDriver): Add error 1558 test.
6783
6784         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6785         report. Moved error 36 test here.
6786
6787         * statement.cs (Throw.Resolve): Add error 724 report.
6788
6789         * typemanager.cs: Add out_attribute_type core type.
6790         
6791 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6792
6793         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6794         3018 report.
6795         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6796
6797         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6798         3017 report.
6799         
6800         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6801
6802         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6803         Add error 3023 report.
6804         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6805
6806         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6807         implementation.
6808
6809 2004-12-12  John Luke  <john.luke@gmail.com>
6810
6811         * driver.cs (AddArgs): take -- into account when
6812         adding arguments, fixes bug 65710 
6813
6814 2004-12-12  Martin Baulig  <martin@ximian.com>
6815
6816         * expression.cs (Unary.TryReduceNegative): Added support for
6817         SByteConstant and ByteConstant.
6818         (Unary.Reduce): Check error values from TryReduceNegative().
6819
6820 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6821
6822         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6823         and report exception as error 182.
6824
6825 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6826
6827         * driver.cs (Main): Fix message when there are warnings.
6828
6829 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6830
6831         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6832
6833 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6834
6835         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6836         Reduced number of warnings.
6837         
6838         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6839
6840 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6841
6842         * driver.cs: Removed message.
6843
6844         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6845
6846 2004-12-08    <vargaz@freemail.hu>
6847
6848         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6849
6850 2004-12-08  Martin Baulig  <martin@ximian.com>
6851
6852         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6853         instead of a CS3002 for properties and indexer.
6854
6855 2004-12-08  Martin Baulig  <martin@ximian.com>
6856
6857         * decl.cs (MemberName.ToString): Make this work again.
6858
6859 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6860
6861         * attribute.cs (Resolve): Add error 591 detection.
6862
6863         * class.cs (FieldMember.Define): Add error 1547 detection.
6864         (Indexer.Define): Add error 620 detection.
6865         (Operator.Define): Add error 590 detection.
6866
6867         * ecore.cs: Missing argument for error 79.
6868
6869         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6870         detection.
6871
6872 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6873
6874         Fix #70106
6875         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6876         only.
6877
6878 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6879
6880         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6881           Some operator comments were suppressed.
6882         * doc.cs : Implicit/explicit operator name in doc comments are like
6883           "op_Explicit(type)~returnType", so added suffix handling.
6884
6885 2005-01-21  Alp Toker  <alp@atoker.com>
6886
6887         * cs-parser.jay: destructor_declaration's container is PartialContainer
6888         not Class when partial types are used, so use Kind prop instead of 'is'.
6889
6890 2004-12-12  Martin Baulig  <martin@ximian.com>
6891
6892         * expression.cs (Unary.TryReduceNegative): Added support for
6893         SByteConstant and ByteConstant.
6894         (Unary.Reduce): Check error values from TryReduceNegative().
6895
6896 2004-12-11  Martin Baulig  <martin@ximian.com>
6897
6898         * support.cs (ReflectionParameters.ParameterName): If we have a
6899         `gpd', call `ParameterName' on it.
6900
6901         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6902
6903         * pending.cs (PendingImplementation.DefineProxy): Call
6904         DefineParameter() for all of the MethodBuilder's arguments.
6905
6906 2004-12-09  Martin Baulig  <martin@ximian.com>
6907
6908         * doc.cs (DocUtil): Make this a static class.
6909
6910 2004-12-09  Martin Baulig  <martin@ximian.com>
6911
6912         * expression.cs (Invocation.InferType): Moved the type inference
6913         implementation into TypeManager.
6914
6915         * generics.cs (TypeManager): Moved the type inference
6916         implementation here.
6917
6918 2004-12-09  Martin Baulig  <martin@ximian.com>
6919
6920         * typemanager.cs (TypeManager): Make this a partial class.
6921
6922         * generics.cs
6923         (TypeManager): Move the generics part of `TypeManager' here.
6924
6925 2004-12-08  Martin Baulig  <martin@ximian.com>
6926
6927         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6928         instead of a CS3002 for properties and indexer.  Added CS3024
6929         check for generic interfaces.
6930
6931         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6932         instances are not CLS-compliant.
6933
6934 2004-12-08  Martin Baulig  <martin@ximian.com>
6935
6936         * cs-parser.jay
6937         (void_pointer_expression): New rule for `void*', `void**' etc.
6938         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6939
6940 2004-12-08  Martin Baulig  <martin@ximian.com>
6941
6942         * expression.cs (Invocation.InferType): Removed the hack for
6943         MethodCore.MayUnify().  
6944
6945         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6946         this actually work.
6947
6948         * class.cs (MethodCore.MayUnify): Use
6949         TypeManager.MayBecomeEqualGenericTypes().       
6950
6951 2004-12-08  Martin Baulig  <martin@ximian.com>
6952
6953         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6954         parameter, box it.  Fixes #69233.
6955
6956 2004-12-08  Martin Baulig  <martin@ximian.com>
6957
6958         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6959         have the ctor constraint.  Fixes #68326.
6960
6961 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6962
6963         * cs-parser.jay : interface comment was not consumed because of
6964           extra opt_semicolon before doc handling.
6965
6966 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6967
6968         Fix test-327.cs, test-328.cs, and put in early infrastructure
6969         for eventually fixing #52697.
6970         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6971         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6972         from other methods.
6973         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6974         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6975         (VerifyUsing, error246): Update.
6976         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6977         'NamespaceEntry.LookupNamespaceOrType'.
6978
6979 2004-12-07  Martin Baulig  <martin@ximian.com>
6980
6981         * driver.cs: Call it "BETA SOFTWARE" :-)
6982
6983 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6984
6985         Fix crash on cs0657-17.cs.
6986         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6987         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6988         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6989         the case where the NamespaceEntry gets overwritten.
6990
6991 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6992
6993         Fixed #69195, #56821
6994         * ecore.cs (ResolveBoolean): Tiny refactoring.
6995
6996         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6997         of right expression resolving when left is false constant and
6998         operator is LogicalAnd OR true constant and operator is LogicalOr.
6999
7000         * statement.cs (ResolveUnreachable): Always reports warning.
7001
7002 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7003
7004         * class.cs: Distinguish between 1721 and 1722 (just a little help
7005         for the programmer).
7006
7007 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7008
7009         * delegate.cs: Only allow this on new versions of the language. 
7010
7011 2004-12-02  Duncan Mak  <duncan@ximian.com>
7012
7013         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7014         Expression class.
7015         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7016         here as a static method. Take an additional bool out parameter
7017         `must_do_cs1540_check' for signaling to InstanceResolve.
7018         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7019         member field from PropertyExpr class and made it an argument of
7020         the method instead.
7021         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7022         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7023         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7024         and `remove_accessor' as well as InstanceResolve: report CS0122
7025         where applicable.
7026
7027         Fixes #70129.
7028
7029 2004-12-07  Martin Baulig  <martin@ximian.com>
7030
7031         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7032         and CS0692 where appropriate.
7033
7034 2004-12-06  Martin Baulig  <martin@ximian.com>
7035
7036         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7037         IsDuplicateImplementation() and improved it.
7038
7039         * expression.cs (Invocation.InferTypeArguments): Added
7040         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7041         and removed the "ref" modifier from `infered_types'.
7042
7043         * decl.cs (MemberName.ToString): Removed the exception.
7044
7045 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7046
7047         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7048           comments are allowed.
7049
7050 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7051
7052         * delegate.cs: Add checks for subtypes in paramaters and return values
7053         in VerifyMethod () to add support for Covariance/Contravariance
7054         in delegates.
7055         
7056 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7057
7058         * report.cs: Remove extra closing parenthesis.
7059
7060         * convert.cs (Error_CannotImplicitConversion): If the name of the
7061         types are the same, provide some extra information.
7062
7063 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7064
7065         Fix bug #70102
7066         * attribute.cs (Resolve): Improved implementation of params
7067         attribute arguments.
7068
7069         * support.cs (ParameterData): Add HasParams to be faster.
7070
7071 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7072
7073         all things are for /doc support:
7074
7075         * doc.cs: new file that supports XML documentation generation.
7076         * mcs.exe.sources: added doc.cs.
7077         * driver.cs:
7078           Handle /doc command line option.
7079           Report error 2006 instead of 5 for missing file name for /doc.
7080           Generate XML documentation when required, after type resolution.
7081         * cs-tokenizer.cs:
7082           Added support for picking up documentation (/// and /** ... */),
7083           including a new XmlCommentState enumeration.
7084         * cs-parser.jay:
7085           Added lines to fill Documentation element for field, constant,
7086           property, indexer, method, constructor, destructor, operator, event
7087           and class, struct, interface, delegate, enum.
7088           Added lines to warn incorrect comment.
7089         * rootcontext.cs :
7090           Added Documentation field (passed only when /doc was specified).
7091         * decl.cs:
7092           Added DocComment, DocCommentHeader, GenerateDocComment() and
7093           OnGenerateDocComment() and some supporting private members for
7094           /doc feature to MemberCore.
7095         * class.cs:
7096           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7097         * delegate.cs:
7098           Added overriden DocCommentHeader.
7099         * enum.cs:
7100           Added overriden DocCommentHeader and GenerateDocComment().
7101
7102 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7103
7104         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7105         unwrapping the enumeration values, chain to
7106         DoConstantNumericPromotions again, so we can promote things to the
7107         fundamental types (takes care of enums that are bytes, sbytes).
7108
7109         Fixes bug #62054.
7110
7111 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7112
7113         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7114         Fix long-standing bug in type-lookup.  Use FindType instead of
7115         LookupType when ec.ResolvingTypeTree.
7116         (Attribute.ResolveType, Attribute.Resolve)
7117         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7118         Update to changes.
7119         (Attributes.Search): Remove internal version.  Update.
7120         (Attributes.SearchMulti): Update.
7121         (Attributes.GetClsCompliantAttribute): Remove.
7122         (Attributes.GetIndexerNameAttribute): Remove.
7123         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7124         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7125         * class.cs (Indexer.Define): Likewise.
7126
7127 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7128
7129         Fix bug #68790
7130         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7131         MarshallByReference members access.
7132
7133         * expression.cs: Use CheckMarshallByRefAccess;
7134         Better error CS0197 message.
7135
7136         * report.cs: Print whole related error message.
7137
7138 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7139
7140         * class (GetClassBases): Better error 60 report.
7141         (EventProperty): Disabled warning 67 detection.
7142
7143 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7144
7145         Fix bug #60324
7146         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7147
7148         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7149         precise values.
7150
7151 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7152
7153         Fix bug #49488
7154         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7155
7156         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7157
7158 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7159
7160         * attribute.cs (Attribute.Resolve): Refine error reporting and
7161         report a cs0117 if the identifier does not exist, to distinguish
7162         from 0617 which is a miss-use of the actual identifier.
7163
7164         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7165         between cs0070 and cs0079.
7166
7167         * class.cs (MemberBase.DoDefine): When reporting a wrong
7168         accessibility level, we use MethodCore to compare instead of
7169         Method (this was a regression in some refactoring effort).
7170
7171         So now we correctly report cs0056 again.
7172
7173         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7174         testing the target_type (which was known to be object_type) and
7175         not the source type (which is anonymous_method).
7176
7177         Fixed reporting of error cs1660.
7178
7179         * expression.cs (UserCast.Source): Expose the underlying cast.
7180
7181         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7182         allowed types to find a match to int32 first (most common).
7183
7184         In addition, it ignores any ImplicitUserConversions that did an
7185         internal implicit conversion (as the switch statement allows only
7186         one integral conversion to exist).
7187
7188         * class.cs (PartialContainer.Create): rename `name' to
7189         `member_name' for clarity.  Then replace the string calls with a
7190         call to MemberName.GetPartialName, as now using
7191         MemberName.ToString is an error (this is due to the side effects
7192         it had, that were fixed in the past).
7193
7194         This will restore the error reporting on a number of partial class
7195         errors that were missusing this (and getting an exception as a
7196         results, which is now just a plain textual warning, because
7197         yyparse debug output would crash otherwise).
7198
7199 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7200
7201         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7202
7203 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7204
7205         * rootcontext.cs (LookupType): Make sure to cache lookups that
7206         don't give us a negative result. This saves about 5% of corlib
7207         compilation time.
7208
7209 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7210
7211         * report.cs (AbstractMessage.Print): messages are sent to stderr
7212
7213         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7214         non-interface in the list of interfaces (at this point, either
7215         parent was properly set, or a base class is being listed in the
7216         interfaces section).
7217
7218         This flags error 1722, and resolves the crash from bug 69259.
7219
7220 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7221
7222         * statement.cs (Using.EmitExpressionFinally): make this work right
7223         for valuetypes. Fixes 69926.
7224
7225 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7226
7227         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7228         converted to an enum" here, before we try to change the underlying
7229         type.  This code exists, but it is a different code path than the
7230         one used while encoding constants.
7231
7232         (ImplicitReferenceConversionExists): In addition, resynchronized
7233         the code here, so it matches the same code in
7234         ImplicitReferenceConversionExists for the `from any class-type S
7235         to any interface-type T'.       
7236
7237 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7238
7239         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7240
7241 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7242
7243         * cs-parser.jay: Use verbosity accordingly. 
7244
7245 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7246
7247         * expression.cs (Unary.ResolveOperator): Do not report warning;
7248         AddressOf reads from variable.
7249         
7250         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7251
7252 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7253
7254         Fix bug #69462
7255
7256         * attribute.cs (Attributable): Removed CheckTargets.
7257         (Attributes.Emit): Explicit attribute targets are tested here.
7258
7259         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7260         not enabled for interfaces.
7261
7262         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7263         (GetAssemblyName): Ouch next bug there.
7264
7265 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7266
7267         * expression.cs: Error 275 added.
7268         
7269 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7270
7271         Fix bug #69177 (Implemented decimal constant support)
7272
7273         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7274         (BinaryFold): Add DecimalConstant.
7275
7276         * const.cs (Define): Decimal constant 
7277         (is not constant.
7278         (ChangeType): Add decimal type handling.
7279         (LookupConstantValue): Don't set value for decimal type but
7280         emit DecimalConstantAttribute. Needed for constant optimization.
7281
7282         * constant.cs (ToDecimal): New method.
7283         (ConvertToDecimal): New method.
7284         (IntConstant): Implemented ConvertToDecimal.
7285         (DecimalConstant.Emit): Emit optimized version for decimals in
7286         int range.
7287
7288         * expression.cs (ResolveOperator): Changed order of constant
7289         reduction to work correctly with native types which have
7290         overloaded operators.
7291         (ResolveMemberAccess): Extract constant value from attribute
7292         for decimal type.
7293
7294         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7295
7296         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7297         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7298         (ChangeType): Decimal is special.
7299         (TypeToCoreType): Add decimal type.
7300
7301 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7302
7303         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7304         decimal types.
7305
7306 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7307
7308         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7309         test cs1667-5.cs.
7310
7311 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7312
7313         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7314
7315         * pending.cs (PendingImplementation): Grab only interfaces.
7316
7317 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7318
7319         * statement.cs (ForeachHelperMethods): Add location member and
7320         error 202 detection.
7321
7322 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7323
7324         * expression.cs (DoResolveBase): Fixed wrong warning for out
7325         variables.
7326
7327 2004-12-04  Martin Baulig  <martin@ximian.com>
7328
7329         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7330         to check whether the conversion is ok.
7331
7332         * typemanager.cs (TypeManager.GetTypeArguments): Just return
7333         `Type.EmptyTypes' if we're not a generic TypeContainer.
7334
7335 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7336
7337         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7338         old bug: when converting from the null literal to a pointer,
7339         return an EmptyCast, not the NullLiteral.
7340
7341         This fixes #69921, the recent null_type changes probably made this
7342         bug more prominent.
7343
7344 2004-12-03  Martin Baulig  <martin@ximian.com>
7345
7346         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7347         method as our child, call AnonymousMethod.Compatible() on it.
7348
7349 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7350
7351         * class.cs (FieldBase): Use an unused bit field from the field to
7352         encode the `has_offset' property from the FieldMember.  This saves
7353         a couple of Ks on bootstrap compilation.
7354
7355         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7356         method as our child, return the AnonymousMethod resolved
7357         expression.
7358
7359         * expression.cs (New.DoResolve): Allow return values from
7360         NewDelegate to also include AnonymousMethods.
7361
7362         Fixes #70150.
7363
7364 2004-11-29  Raja R Harinath  <rharinath@novell.com>
7365
7366         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7367         cs1648 report.
7368         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7369         System.Runtime.InteropServices._Exception, since it's a base
7370         interface of the core type System.Exception in the net_2_0 profile.
7371
7372 2004-11-27  Martin Baulig  <martin@ximian.com>
7373
7374         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7375
7376 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7377
7378         * Makefile: Convert to use executable.make.
7379         * gmcs.exe.sources: New.
7380
7381 2004-11-25  Martin Baulig  <martin@ximian.com>
7382
7383         * expression.cs (Invocation.InferType): Added support for byref types.
7384
7385 2004-11-25  Martin Baulig  <martin@ximian.com>
7386
7387         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7388         in TypeManager.TypeToCoreType().
7389
7390 2004-11-25  Martin Baulig  <martin@ximian.com>
7391
7392         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7393         "Dispose" method from the `current_type'.
7394         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7395         DoDefineMembers() instead of using the MethodBuilder; this is
7396         required for generic iterators.
7397
7398         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7399
7400 2004-11-24  Martin Baulig  <martin@ximian.com>
7401
7402         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7403
7404 2004-11-20  Martin Baulig  <martin@ximian.com>
7405
7406         * expression.cs (Invocation.InferType): Correctly infer generic
7407         instances; see gen-103.cs.
7408         (Invocation.InferTypeArguments): If a generic method doesn't have
7409         any unbound type parameters, we don't need to infer anything.
7410
7411 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7412
7413         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7414
7415 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7416
7417         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7418         (TypeHandle.GetMemberCache): New.
7419         (TypeHandle.TypeHandle): Update.
7420         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7421         (TypeManager.LookupParentInterfacesCache):
7422         Rename from LookupInterfaceCache.  Optimize slightly.
7423         (TypeManager.MemberLookup_FindMembers): Update.
7424         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7425         multi-type variant.
7426         (AddCacheContents): Rename from AddHashtable.
7427         * class.cs (TypeContainer.parent_container): Remove.
7428         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7429         (TypeContainer.DoDefineMembers): Don't initialize it.
7430         Update to name changes.
7431         
7432 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7433
7434         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7435         that factors the code to check access modifiers on override.  
7436
7437         (PropertyBase): Use the code here.
7438
7439         Patch from Lluis S'anchez, fixes bug #69361.
7440
7441 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7442
7443         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7444         routine that is used to report the use of a captured variable
7445         whose address has been taken.
7446
7447         There are two checks: one when variables are being captured and
7448         the other check is when the address of a variable is taken. 
7449         
7450         (because an anonymous methods might be resolved before *or* after
7451         the address has been taken) and 
7452
7453         * expression.cs (Conditional.DoResolve): Remove the special
7454         casing that Martin added to trueExpr and falseExpr being both
7455         NullLiteral.  We get the right behavior now just by introducing
7456         the null_type into the compiler. 
7457
7458         * convert.cs (ExplicitConversion): Change the code to use
7459         null_type instead of testing `expr is NullLiteral'.
7460         (ImplicitConversionStandard): use null_type too.
7461         (ImplicitReferenceConversionExists): use null_type too.
7462         (ImplicitReferenceConversion): use null_type too.
7463
7464         * literal.cs: The type of `NullLiteral' is now null_type instead
7465         of object_type. 
7466         (Resolve): Set the type here.
7467
7468         * typemanager.cs: Introduce null_type.
7469
7470 2004-11-18  Martin Baulig  <martin@ximian.com>
7471
7472         * rootcontext.cs
7473         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7474
7475 2004-11-18  Martin Baulig  <martin@ximian.com>
7476
7477         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7478
7479 2004-11-18  Martin Baulig  <martin@ximian.com>
7480
7481         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7482         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7483         call ResolveConstructedType() on it to resolve it without checking
7484         constraints.
7485         (Constraints.ResolveTypes): Check them here.
7486         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7487         but don't check constraints.
7488         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7489         check constraints here.
7490         (ConstructedType.ResolveConstructedType): New public method.  This
7491         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7492         resolve ourselves without checking constraints.
7493
7494         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7495
7496 2004-11-18  Martin Baulig  <martin@ximian.com>
7497
7498         * decl.cs
7499         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7500
7501         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7502
7503 2004-11-18  Martin Baulig  <martin@ximian.com>
7504
7505         * ecore.cs (TypeExpr.ResolveType): Removed.
7506         (Expression.ResolveAsTypeTerminal): We always return a fully
7507         resolved `TypeExpr', so we can just access its `Type'.
7508
7509         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7510
7511 2004-11-17  Martin Baulig  <martin@ximian.com>
7512
7513         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7514         sure we don't return any unresolved TypeExpr's.
7515         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7516         a `TypeExpr'.
7517         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7518
7519         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7520         unresolved `ConstructedType's.
7521
7522 2004-11-17  Martin Baulig  <martin@ximian.com>
7523
7524         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7525
7526 2004-11-17  Martin Baulig  <martin@ximian.com>
7527
7528         * ecore.cs
7529         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7530
7531         * decl.cs (DeclSpace.ResolveType): Removed.
7532         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7533
7534 2004-11-17  Martin Baulig  <martin@ximian.com>
7535
7536         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7537         direction, like FindMembers() does.  Fixes #69546, testcase is in
7538         test-315.cs.    
7539
7540 2004-11-16  Martin Baulig  <martin@ximian.com>
7541
7542         This is based on a patch from Marek Safar, see bug #69082.
7543         Fixes bugs #63705 and #67130.
7544
7545         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7546         method; create a MemberCache for an interface type and cache the
7547         result.
7548
7549         * decl.cs (IMemberContainer.ParentContainer): Removed.
7550         (IMemberContainer.ParentCache): New property.
7551         (MemberCache.SetupCacheForInterface): Removed.
7552         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7553         to create a cache for an interface's "parent".
7554
7555         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7556         interfaces too.
7557
7558 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7559
7560         * statement.cs: Avoid adding bools to a hashtable.
7561
7562 2004-11-15  Martin Baulig  <martin@ximian.com>
7563
7564         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7565
7566 2004-11-11  Martin Baulig  <martin@ximian.com>
7567
7568         * typemanager.cs (TypeManager.GetMethodName): New method.
7569
7570         * class.cs (MethodData.Define): Include the generic arity in the
7571         name of an explicit interface; also add it to the method name.
7572
7573         * pending.cs (PendingImplementation.InterfaceMethod): The method
7574         name now includes the generic arity.
7575
7576 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7577
7578         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7579         calling an unsafe method from a safe location.
7580
7581 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7582
7583         Fix #69167
7584         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7585
7586 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7587
7588         * namespace.cs (VerifyUsing): use GetPartialName instead of
7589         ToString. 
7590
7591 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7592
7593         * statement.cs (Return.Resolve): Fix regression in typo: if
7594         `in_exc', we have to request a NeedReturnLabel, this was a typo
7595         introduced in the anonymous method check-in.  Fixes #69131.
7596
7597         * Indexers were using the ShortName when defining themselves,
7598         causing a regression in the compiler bootstrap when applying the
7599         patch from 2004-11-02 (first part), now they use their full name
7600         and the bug is gone.
7601
7602 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7603
7604         * driver.cs: Strip the path from the names of embedded resources. Fixes
7605         #68519.
7606
7607 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7608
7609         Fix error message regression: cs0104-2.cs.
7610         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7611         (AliasEntry.Resolve): Update.
7612         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7613         'silent' flag.
7614         (RootContext.LookupType): Update.
7615
7616 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7617
7618         * cs-parser.jay: Add support for handling accessor modifiers
7619         * class: Add support port accessor modifiers and error checking,
7620         define PropertyMethod.Define as virtual (not abstract anymore)
7621         * ecore.cs: Add checking for proeprties access with access modifiers
7622         * iterators.cs: Modify Accessor constructor call based in the modified
7623         constructor
7624 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7625
7626         * expression.cs (StringConcat): Handle being called twice,
7627         as when we have a concat in a field init with more than two
7628         ctors in the class
7629
7630 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7631
7632         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7633         special case explicit implementations, we should always produce
7634         the .property or .event declaration.
7635         
7636         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7637         since it will not return correct data if people use this
7638         unresolved in the presence of using statements (see test-313).
7639
7640         * class.cs (MethodData.Define): If we are an explicit interface
7641         implementation, set the method name to the full name of the
7642         interface plus the name of the method.  
7643
7644         Notice that using the method.MethodName.GetFullName() does not
7645         work, as it will only contain the name as declared on the source
7646         file (it can be a shorthand in the presence of using statements)
7647         and not the fully qualifed type name, for example:
7648
7649         using System;
7650
7651         class D : ICloneable {
7652                 object ICloneable.Clone ()  {
7653                 }
7654         }
7655
7656         Would produce a method called `ICloneable.Clone' instead of
7657         `System.ICloneable.Clone'.
7658
7659         * namespace.cs (Alias.Resolve): Use GetPartialName.
7660         
7661 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7662
7663         * cs-parser.jay: Add error 1055 report.
7664
7665 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7666
7667         * assign.cs (Assign.DoResolve): Only do the transform of
7668         assignment into a New if the types are compatible, if not, fall
7669         through and let the implicit code deal with the errors and with
7670         the necessary conversions. 
7671
7672 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7673
7674         * cs-parser.jay: Add error 1031 report.
7675
7676         * cs-tokenizer.cs: Add location for error 1038.
7677
7678 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7679
7680         * cs-parser.jay: Add error 1016 report.
7681
7682 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7683
7684         * cs-parser.jay: Add errors 1575,1611 report.
7685
7686 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7687
7688         * cs-parser.jay: Add error 1001 report.
7689
7690 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7691
7692         Fix #68850
7693         * attribute.cs (GetMarshal): Add method argument for
7694         caller identification.
7695
7696         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7697         agument for GetMarshal and RuntimeMissingSupport.
7698
7699 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7700
7701         * attribute.cs (ExtractSecurityPermissionSet): Removed
7702         TypeManager.code_access_permission_type.
7703
7704         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7705
7706 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7707
7708         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7709         for obsolete use of a variable here.   Fixes regression on errors
7710         cs0619-25 and cs0619-26.
7711
7712 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7713
7714         Fix #62358, implemented security attribute encoding.
7715
7716         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7717         Tests permitted SecurityAction for assembly or other types.
7718         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7719         data from SecurityPermissionAttribute to PermisionSet class.
7720
7721         * class.cs (ApplyAttributeBuilder): Added special handling
7722         for System.Security.Permissions.SecurityAttribute based types.
7723
7724         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7725         special handling for System.Security.Permissions.SecurityAttribute
7726         based types.
7727
7728         * enum.cs (ApplyAttributeBuilder): Added special handling
7729         for System.Security.Permissions.SecurityAttribute based types.
7730
7731         * parameter.cs (ApplyAttributeBuilder): Added special handling
7732         for System.Security.Permissions.SecurityAttribute based types.
7733
7734         * rootcontext.cs: Next 2 core types.
7735
7736         * typemanager.cs (TypeManager.security_permission_attr_type):
7737         Built in type for the SecurityPermission Attribute.
7738         (code_access_permission_type): Build in type.
7739
7740 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7741
7742         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7743         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7744         all of this information into
7745         EmitContext.EmitCapturedVariableInstance.
7746         
7747         * codegen.cs (EmitCapturedVariableInstance): move here the
7748         funcionality of emitting an ldarg.0 in the presence of a
7749         remapping.   This centralizes the instance emit code.
7750
7751         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7752         then emit a load of this: it means that we have reached the
7753         topmost ScopeInfo: the one that contains the pointer to the
7754         instance of the class hosting the anonymous method.
7755
7756         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7757         captures to the topmost CaptureContext.
7758
7759 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7760
7761         * expression.cs (LocalVariableReference): Move the knowledge about
7762         the iterators into codegen's EmitCapturedVariableInstance.
7763
7764 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7765
7766         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7767         all code paths return a value from an anonymous method (it is the
7768         same as the 161 error, but for anonymous methods).
7769
7770 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7771
7772         The introduction of anonymous methods in the compiler changed
7773         various ways of doing things in the compiler.  The most
7774         significant one is the hard split between the resolution phase
7775         and the emission phases of the compiler.
7776
7777         For instance, routines that referenced local variables no
7778         longer can safely create temporary variables during the
7779         resolution phase: they must do so from the emission phase,
7780         since the variable might have been "captured", hence access to
7781         it can not be done with the local-variable operations from the runtime.
7782         
7783         * statement.cs 
7784
7785         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7786         is a toplevel block.
7787
7788         (ToplevelBlock): A new kind of Block, these are the blocks that
7789         are created by the parser for all toplevel method bodies.  These
7790         include methods, accessors and anonymous methods.
7791
7792         These contain some extra information not found in regular blocks:
7793         A pointer to an optional CaptureContext (for tracking captured
7794         local variables and parameters).  A pointer to the parent
7795         ToplevelBlock.
7796         
7797         (Return.Resolve): Catch missmatches when returning a value from an
7798         anonymous method (error 1662).
7799         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7800         phase.
7801
7802         (Break.Resolve): ditto.
7803
7804         (SwitchLabel): instead of defining the labels during the
7805         resolution phase, we now turned the public ILLabel and ILLabelCode
7806         labels into methods called GetILLabelCode() and GetILLabel() that
7807         only define the label during the Emit phase.
7808
7809         (GotoCase): Track the SwitchLabel instead of the computed label
7810         (its contained therein).  Emit the code by using
7811         SwitchLabel.GetILLabelCode ().
7812
7813         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7814         whether the Local has been captured or not.
7815
7816         (LocalInfo.IsCaptured): New property, used to tell whether the
7817         local has been captured.
7818         
7819         * anonymous.cs: Vastly updated to contain the anonymous method
7820         support.
7821
7822         The main classes here are: CaptureContext which tracks any
7823         captured information for a toplevel block and ScopeInfo used to
7824         track the activation frames for various local variables.   
7825
7826         Each toplevel block has an optional capture context associated
7827         with it.  When a method contains an anonymous method both the
7828         toplevel method and the anonymous method will create a capture
7829         context.   When variables or parameters are captured, they are
7830         recorded on the CaptureContext that owns them, for example:
7831
7832         void Demo () {
7833              int a;
7834              MyDelegate d = delegate {
7835                  a = 1;
7836              }
7837         }
7838
7839         Here `a' will be recorded as captured on the toplevel
7840         CapturedContext, the inner captured context will not have anything
7841         (it will only have data if local variables or parameters from it
7842         are captured in a nested anonymous method.
7843
7844         The ScopeInfo is used to track the activation frames for local
7845         variables, for example:
7846
7847         for (int i = 0; i < 10; i++)
7848                 for (int j = 0; j < 10; j++){
7849                    MyDelegate d = delegate {
7850                         call (i, j);
7851                    }
7852                 }
7853
7854         At runtime this captures a single captured variable `i', but it
7855         captures 10 different versions of the variable `j'.  The variable
7856         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7857         recorded on a child.  
7858
7859         The toplevel ScopeInfo will also track information like the `this'
7860         pointer if instance variables were referenced (this is necessary
7861         as the anonymous method lives inside a nested class in the host
7862         type of the method). 
7863
7864         (AnonymousMethod): Expanded to track the Toplevel, implement
7865         `AnonymousMethod.Compatible' to tell whether an anonymous method
7866         can be converted to a target delegate type. 
7867
7868         The routine now also produces the anonymous method content
7869
7870         (AnonymousDelegate): A helper class that derives from
7871         DelegateCreation, this is used to generate the code necessary to
7872         produce the delegate for the anonymous method that was created. 
7873
7874         * assign.cs: API adjustments for new changes in
7875         Convert.ImplicitStandardConversionExists.
7876
7877         * class.cs: Adjustments to cope with the fact that now toplevel
7878         blocks are of type `ToplevelBlock'. 
7879
7880         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7881         insteda of standard blocks.
7882
7883         Flag errors if params arguments are passed to anonymous methods.
7884
7885         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7886         `CurrentAnonymousMethod' which points to the current Anonymous
7887         Method.  The variable points to the AnonymousMethod class that
7888         holds the code being compiled.  It is set in the new EmitContext
7889         created for the anonymous method.
7890
7891         (EmitContext.Phase): Introduce a variable and an enumeration to
7892         assist in enforcing some rules about when and where we are allowed
7893         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7894         only one that enfonces this right now).
7895
7896         (EmitContext.HaveCaptureInfo): new helper method that returns
7897         whether we have a CapturedContext initialized.
7898
7899         (EmitContext.CaptureVariable): New method used to register that a
7900         LocalInfo must be flagged for capturing. 
7901
7902         (EmitContext.CapturedParameter): New method used to register that a
7903         parameters must be flagged for capturing. 
7904         
7905         (EmitContext.CapturedField): New method used to register that a
7906         field must be flagged for capturing. 
7907
7908         (EmitContext.HaveCapturedVariables,
7909         EmitContext.HaveCapturedFields): Return whether there are captured
7910         variables or fields. 
7911
7912         (EmitContext.EmitMethodHostInstance): This is used to emit the
7913         instance for the anonymous method.  The instance might be null
7914         (static methods), this (for anonymous methods that capture nothing
7915         and happen to live side-by-side with the current method body) or a
7916         more complicated expression if the method has a CaptureContext.
7917
7918         (EmitContext.EmitTopBlock): Routine that drives the emission of
7919         code: it will first resolve the top block, then emit any metadata
7920         and then emit the code.  The split is done so that we can extract
7921         any anonymous methods and flag any captured variables/parameters.
7922         
7923         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7924         during this phase, the ILGenerator should not be used as labels
7925         and local variables declared here might not be accessible to any
7926         code that is part of an anonymous method.  
7927
7928         Exceptions to this include the temporary variables that are
7929         created by some statements internally for holding temporary
7930         variables. 
7931         
7932         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7933         metadata for a cb
7934
7935         (EmitContext.TemporaryReturn): This method is typically called
7936         from the Emit phase, and its the only place where we allow the
7937         ReturnLabel to be defined other than the EmitMeta.  The reason is
7938         that otherwise we would have to duplicate a lot of logic in the
7939         Resolve phases of various methods that today is on the Emit
7940         phase. 
7941
7942         (EmitContext.NeedReturnLabel): This no longer creates the label,
7943         as the ILGenerator is not valid during the resolve phase.
7944
7945         (EmitContext.EmitThis): Extended the knowledge in this class to
7946         work in anonymous methods in addition to iterators. 
7947
7948         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7949         code is necessary on the stack to access the instance to a local
7950         variable (the variable will be accessed as a field).
7951
7952         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7953         EmitContext.EmitAddressOfParameter): Routines to support
7954         parameters (not completed at this point). 
7955         
7956         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7957         will also remove the parameters.
7958
7959         * convert.cs (Convert): Define a `ConstantEC' which points to a
7960         null.  This is just to prefity some code that uses
7961         ImplicitStandardConversion code and do not have an EmitContext
7962         handy.
7963
7964         The idea is to flag explicitly that at that point in time, it is
7965         known that the conversion will not trigger the delegate checking
7966         code in implicit conversions (which requires a valid
7967         EmitContext). 
7968
7969         Everywhere: pass new EmitContext parameter since
7970         ImplicitStandardConversionExists now requires it to check for
7971         anonymous method conversions. 
7972
7973         (Convert.ImplicitStandardConversionExists): If the type of an
7974         expression is the anonymous_method_type, and the type is a
7975         delegate, we invoke the AnonymousMethod.Compatible method to check
7976         whether an implicit conversion is possible. 
7977
7978         (Convert.ImplicitConversionStandard): Only do implicit method
7979         group conversions if the language level is not ISO_1.
7980
7981         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7982         MethodInfo for the Invoke method.  used by Delegate and
7983         AnonymousDelegate.
7984
7985         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7986         method conversions if the target type is a delegate.
7987
7988         Removed extra debugging nops.
7989
7990         (LocalVariableReference): Turn the `local_info' into a public
7991         field. 
7992
7993         Add `prepared' field, the same hack used for FieldExprs to cope
7994         with composed assignments, as Local variables do not necessarily
7995         operate purely on the stack as they used to: they can be captured
7996         fields. 
7997
7998         Add `temp' for a temporary result, like fields.
7999
8000         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8001
8002         It now copes with Local variables that are captured and emits the
8003         proper instance variable to load it from a field in the captured
8004         case. 
8005
8006         (ParameterReference.DoResolveBase): During the resolve phase,
8007         capture parameters if we are in an anonymous method.
8008
8009         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8010         anonymous method, use the EmitContext helper routines to emit the
8011         parameter reference.
8012
8013         * iterators.cs: Set RemapToProxy to true/false during the
8014         EmitDispose class.
8015
8016         * parameters.cs (GetParameterByName): New helper method. 
8017
8018         * typemanager.cs (anonymous_method_type) a new type that
8019         represents an anonyous method.  This is always an internal type,
8020         used as a fencepost to test against the anonymous-methodness of an
8021         expression. 
8022         
8023 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8024
8025         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8026         561 report.
8027         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8028
8029 2004-11-10  Martin Baulig  <martin@ximian.com>
8030
8031         * expression.cs (Invocation.BetterFunction): If two methods have
8032         equal parameter types, but only one of them is generic, the
8033         non-generic one wins.
8034         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8035         instance; just use `Type.IsValueType' to determine whether
8036         something is a struct or not.
8037         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8038         so we can be called multiple times.
8039
8040 2004-11-10  Martin Baulig  <martin@ximian.com>
8041
8042         * generic.cs (TypeParameter.DefineConstraints): New public method.
8043         (TypeParameter.CheckAccessLevel): Override this and return true.
8044         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8045         override ResolveType() anymore.
8046         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8047
8048 2004-11-10  Martin Baulig  <martin@ximian.com>
8049
8050         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8051         call DeclSpace.ResolveNestedType() on it.
8052
8053 2004-11-10  Martin Baulig  <martin@ximian.com>
8054
8055         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8056         non-null, call ParameterModifier() on it.
8057
8058 2004-11-10  Martin Baulig  <martin@ximian.com>
8059
8060         * iterators.cs
8061         (Iterators): Added `current_type' and `this_type' fields.
8062         (Iterators.DefineIterator): Create a new EmitContext and store it
8063         in `ec'; compute `this_type'.
8064
8065 2004-11-10  Martin Baulig  <martin@ximian.com>
8066
8067         * typemanager.cs
8068         (TypeManager.IsPrivateAccessible): New public method.
8069         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8070
8071 2004-11-10  Martin Baulig  <martin@ximian.com>
8072
8073         * class.cs (TypeContainer.DefineType): Call
8074         TypeBuilder.DefineGenericParameters() before resolving the type
8075         parameters.
8076         (MethodData.parent_method): New protected field.
8077         (MethodData..ctor): Added `MethodInfo parent_method' argument.
8078         (MethodData.Define): Compute `parent_method'.
8079
8080         * decl.cs
8081         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8082         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8083         (DeclSpace.ec): New protected field; store the EmitContext here.
8084         (DeclSpace.EmitContext): New public property.
8085         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8086         (DeclSpace.ResolveNestedType): New public method.
8087         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8088         (DeclSpace.NestedAccessible): Added `Type tb' argument.
8089         (DeclSpace.FamilyAccessible): Likewise.
8090         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8091         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8092         EmitContext.
8093
8094         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8095         field.
8096
8097         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8098         (Enum.Emit): Don't create a new EmitContext.
8099
8100 2004-10-18  Martin Baulig  <martin@ximian.com>
8101
8102         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8103         `Type' directly, but call ResolveType() on it.
8104         (Catch.Resolve): Likewise.
8105         (Foreach.Resolve): Likewise.
8106
8107 2004-10-18  Martin Baulig  <martin@ximian.com>
8108
8109         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8110         `Type' directly, but call ResolveType() on it.
8111         (Probe.DoResolve): Likewise.
8112         (ArrayCreation.LookupType): Likewise.
8113         (TypeOf.DoResolve): Likewise.
8114         (SizeOf.DoResolve): Likewise.
8115
8116 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8117
8118         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8119         the ResolveType.
8120
8121 2004-10-17  John Luke  <john.luke@gmail.com>
8122
8123         * class.cs (Operator.GetSignatureForError): use CSharpName
8124
8125         * parameter.cs (Parameter.GetSignatureForError): Returns
8126         correct name even if was not defined.
8127
8128 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8129
8130         Fix #65816.
8131         * class.cs (TypeContainer.EmitContext): New property.
8132         (DefineNestedTypes): Create an emitcontext for each part.
8133         (MethodCore.DoDefineParameters): Use container's emitcontext.
8134         Pass type array to InternalParameters.
8135         (MemberBase.DoDefine): Use container's emitcontext.
8136         (FieldMember.Define): Likewise.
8137         (Event.Define): Likewise.
8138         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8139         Pass type array to InternalParameters.
8140         (SetIndexerMethod.GetParameterInfo): Likewise.
8141         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8142         * delegate.cs (Define): Pass emitcontext to
8143         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8144         array to InternalParameters.
8145         * expression.cs (ParameterReference.DoResolveBase): Pass
8146         emitcontext to GetParameterInfo.
8147         (ComposedCast.DoResolveAsTypeStep): Remove check on
8148         ec.ResolvingTypeTree.
8149         * parameter.cs (Parameter.Resolve): Change argument to
8150         EmitContext.  Use ResolveAsTypeTerminal.
8151         (Parameter.GetSignature): Change argument to EmitContext.
8152         (Parameters.ComputeSignature): Likewise.
8153         (Parameters.ComputeParameterTypes): Likewise.
8154         (Parameters.GetParameterInfo): Likewise.
8155         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8156         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8157         * support.cs (InternalParameters..ctor): Remove variant that takes
8158         a DeclSpace.
8159         * typemanager.cs (system_intptr_expr): New.
8160         (InitExpressionTypes): Initialize it.
8161
8162 2004-10-12  Chris Toshok  <toshok@ximian.com>
8163
8164         * cs-parser.jay: fix location for try_statement and catch_clause.
8165
8166 2004-10-18  Martin Baulig  <martin@ximian.com>
8167
8168         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8169         `Type' directly, but call ResolveType() on it.
8170         (MemberBase.DoDefine): Likewise.
8171
8172         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8173         `Type' directly, but call ResolveType() on it.
8174         (ComposedCast.DoResolveAsTypeStep): Likewise.
8175
8176         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8177         `Type' directly, but call ResolveType() on it.
8178
8179 2004-10-17  John Luke  <john.luke@gmail.com>
8180
8181         * class.cs (Operator.GetSignatureForError): use CSharpName
8182
8183         * parameter.cs (Parameter.GetSignatureForError): Returns
8184         correct name even if was not defined.
8185
8186 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8187
8188         Fix #65816.
8189         * class.cs (TypeContainer.EmitContext): New property.
8190         (DefineNestedTypes): Create an emitcontext for each part.
8191         (MethodCore.DoDefineParameters): Use container's emitcontext.
8192         Pass type array to InternalParameters.
8193         (MemberBase.DoDefine): Use container's emitcontext.
8194         (FieldMember.Define): Likewise.
8195         (Event.Define): Likewise.
8196         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8197         Pass type array to InternalParameters.
8198         (SetIndexerMethod.GetParameterInfo): Likewise.
8199         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8200         * delegate.cs (Define): Pass emitcontext to
8201         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8202         array to InternalParameters.
8203         * expression.cs (ParameterReference.DoResolveBase): Pass
8204         emitcontext to GetParameterInfo.
8205         (ComposedCast.DoResolveAsTypeStep): Remove check on
8206         ec.ResolvingTypeTree.
8207         * parameter.cs (Parameter.Resolve): Change argument to
8208         EmitContext.  Use ResolveAsTypeTerminal.
8209         (Parameter.GetSignature): Change argument to EmitContext.
8210         (Parameters.ComputeSignature): Likewise.
8211         (Parameters.ComputeParameterTypes): Likewise.
8212         (Parameters.GetParameterInfo): Likewise.
8213         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8214         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8215         * support.cs (InternalParameters..ctor): Remove variant that takes
8216         a DeclSpace.
8217         * typemanager.cs (system_intptr_expr): New.
8218         (InitExpressionTypes): Initialize it.
8219
8220 2004-10-12  Chris Toshok  <toshok@ximian.com>
8221
8222         * cs-parser.jay: fix location for try_statement and catch_clause.
8223
8224 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8225
8226         More DeclSpace.ResolveType avoidance.
8227         * decl.cs (MemberCore.InUnsafe): New property.
8228         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8229         with newly created EmitContext.
8230         (FieldMember.Define): Likewise.
8231         * delegate.cs (Delegate.Define): Likewise.
8232         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8233         only if normal name-lookup fails.
8234         (TypeExpr.DoResolve): Enable error-checking.
8235         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8236         (SizeOf.DoResolve): Likewise.
8237         (ComposedCast.DoResolveAsTypeStep): Likewise.
8238         (StackAlloc.DoResolve): Likewise.
8239         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8240         (Block.Unsafe): New property.
8241         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8242         (Unsafe): Set 'unsafe' flag of contained block.
8243         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8244         (Fixed.Resolve): Likewise.
8245         (Catch.Resolve): Likewise.
8246         (Using.ResolveLocalVariableDecls): Likewise.
8247         (Foreach.Resolve): Likewise.
8248
8249 2004-10-05  John Luke <john.luke@gmail.com>
8250
8251         * cs-parser.jay: add location to error CS0175
8252
8253 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8254
8255         * ecore.cs (Expression.Constantity): Add support for turning null
8256         into a constant.
8257
8258         * const.cs (Const.Define): Allow constants to be reference types
8259         as long as the value is Null.
8260
8261 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8262
8263         * namespace.cs (NamespaceEntry.Using): No matter which warning
8264         level is set, check if this namespace name has already been added.
8265
8266 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8267
8268         * expression.cs: reftype [!=]= null should always use br[true,false].
8269         # 67410
8270
8271 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8272
8273         Fix #67108
8274         * attribute.cs: Enum conversion moved to 
8275         GetAttributeArgumentExpression to be applied to the all
8276         expressions.
8277
8278 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8279
8280         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8281         * class.c (TypeContainer.DefineType): Flag error if
8282         base types aren't accessible due to access permissions.
8283         * decl.cs (DeclSpace.ResolveType): Move logic to
8284         Expression.ResolveAsTypeTerminal.
8285         (DeclSpace.ResolveTypeExpr): Thin layer over
8286         Expression.ResolveAsTypeTerminal.
8287         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8288         Refactor code into NestedAccess.  Use it.
8289         (DeclSpace.NestedAccess): New.
8290         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8291         argument to silence errors.  Check access permissions.
8292         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8293         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8294         (Cast.DoResolve): Likewise.
8295         (New.DoResolve): Likewise.
8296         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8297         (TypeOf.DoResolve): Likewise.
8298
8299         * expression.cs (Invocation.BetterConversion): Return the Type of
8300         the better conversion.  Implement section 14.4.2.3 more faithfully.
8301         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8302         section 14.4.2.2 explicit.
8303         (Invocation.OverloadResolve): Update.
8304         (Invocation): Remove is_base field.
8305         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8306         (Invocation.Emit): Likewise.
8307
8308 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8309
8310         * cs-parser.jay: Reverted 642 warning fix.
8311
8312 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8313
8314         Fix bug #66615
8315         * decl.cs (FindMemberWithSameName): Indexer can have more than
8316         1 argument.
8317
8318 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8319
8320         * expression.cs (LocalVariableReference.DoResolveLValue):
8321         Do not report warning 219 for out values.
8322         (EmptyExpression.Null): New member to avoid extra allocations.
8323
8324 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8325
8326         * cs-parser.jay: Fix wrong warning 642 report.
8327
8328         * cs-tokenizer.cs (CheckNextToken): New helper;
8329         Inspect next character if is same as expected.
8330
8331 2004-09-23  Martin Baulig  <martin@ximian.com>
8332
8333         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8334         (Convert.ImplicitReferenceConversionExists): Likewise.
8335
8336 2004-11-09  Raja R Harinath  <rharinath@novell.com>
8337
8338         * Makefile (DISTFILES): Comment out a few missing files.
8339
8340 2004-10-29  Raja R Harinath  <rharinath@novell.com>
8341
8342         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8343         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
8344         (gmcs.exe): Invoke bootstrap-libs.
8345         (clean-local): Clean the net_2_0_bootstrap profile too.
8346         (PROGRAM_INSTALL_DIR): New.
8347         (install-local): Use it.
8348
8349 2004-10-13  Martin Baulig  <martin@ximian.com>
8350
8351         * generic.cs (TypeManager.InflatedConstraints): New nested class.
8352         (TypeParameter.DefineType): If we're a method type parameter and
8353         that method is overriding something, "inflate" its constraints.
8354
8355 2004-10-12  Martin Baulig  <martin@ximian.com>
8356
8357         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8358         and have type arguments, create and resolve a ConstructedType.
8359
8360 2004-10-12  Martin Baulig  <martin@ximian.com>
8361
8362         * decl.cs (MemberCache.FindMemberToOverride): Use
8363         TypeManager.IsEqual() to compare the parameters and Type.Equals()
8364         to compare the invocationType.
8365
8366         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8367         When comparing two type parameters, only do the signature-only
8368         comparision for method type parameters.
8369
8370 2004-10-11  Martin Baulig  <martin@ximian.com>
8371
8372         * report.cs: Don't make --fatal abort on warnings, we have
8373         -warnaserror for that.
8374
8375 2004-10-11  Martin Baulig  <martin@ximian.com>
8376
8377         * typemanager.cs
8378         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8379         (TypeManager.IsEqual): Call ourself recursively instead of using
8380         Type.IsEqual(). 
8381
8382 2004-10-11  Martin Baulig  <martin@ximian.com>
8383
8384         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8385         on our own type parameters, not on the ones we inherit from a containing
8386         class.
8387
8388         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8389         the comparision.
8390
8391         * generic.cs (TypeParameter.Define): We may only be called once.
8392
8393         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8394         instead of TypeManager.IsEqual().
8395
8396 2004-09-28  Martin Baulig  <martin@ximian.com>
8397
8398         * generic.cs
8399         (GenericConstraints.EffectiveBaseClass): New public property.
8400         (TypeParameter.GenericConstraints): New public property.
8401         (ConstructedType.CheckConstraints): Improved.
8402
8403         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8404         (Convert.TypeParameterConversion): New private method; use this in
8405         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8406         for all conversions related to type parameters.
8407
8408 2004-09-24  Martin Baulig  <martin@ximian.com>
8409
8410         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8411         type parameter conversions for type parameters which are known to
8412         be reference types.
8413
8414 2004-09-24  Martin Baulig  <martin@ximian.com>
8415
8416         * generic.cs (GenericConstraints): Added `IsReferenceType' and
8417         `IsValueType' properties.
8418
8419         * support.cs (ReflectionConstraints): Use
8420         Type.GetGenericParameterConstraints() instead of the old hack.
8421
8422 2004-09-24  Martin Baulig  <martin@ximian.com>
8423
8424         * generic.cs (GenericConstraints): Moved here and made it an
8425         abstract class.
8426
8427         * support.cs (GenericConstraints): Moved to generic.cs.
8428
8429 2004-09-24  Martin Baulig  <martin@ximian.com>
8430
8431         * support.cs
8432         (ReflectionConstraints): Un-nested this class and made it public.
8433
8434         * typemanager.cs
8435         (TypeManager.GetTypeParameterConstraints): New public method.
8436         (TypeManager.HasConstructorConstraint): Use the attributes.
8437
8438 2004-09-24  Martin Baulig  <martin@ximian.com>
8439
8440         * support.cs (GenericConstraints): Replaced `HasConstructor',
8441         `IsReferenceType' and `IsValueType' with `Attributes'.
8442         (ReflectionParameters.ReflectionConstraints): Removed the Create()
8443         method and made the .ctor public.
8444
8445         * generic.cs (Constraints.Attributes): New public property.
8446         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8447         `IsReferenceType' -> `HasReferenceTypeConstraint' and
8448         `IsValueType' -> `HasValueTypeConstraint'.
8449
8450 2004-09-23  Martin Baulig  <martin@ximian.com>
8451
8452         * generic.cs (Constraints): Reflect latest runtime changes.
8453
8454 2004-09-23  Martin Baulig  <martin@ximian.com>
8455
8456         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8457         (Convert.ImplicitReferenceConversionExists): Likewise.
8458
8459 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8460
8461         * class.cs (Operator.Define): Add error 448 and 559 report.
8462         
8463 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8464
8465         * class.cs (MemberBase.IsTypePermitted): New protected
8466         method for checking error CS0610.
8467
8468 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8469
8470         * class.cs (TypeContainer.HasExplicitLayout): New property
8471         Returns whether container has StructLayout attribute set Explicit.
8472         (FieldMember): New abstract class for consts and fields.
8473         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8474         (Field): Reuse FieldMember.
8475
8476         * const.cs (Const): Reuse FieldMember.
8477
8478         * rootcontext.cs: EmitConstants call moved to class.
8479
8480 2004-09-22  Martin Baulig  <martin@ximian.com>
8481
8482         Marek and me just fixed one of our oldest bugs: #28562 :-)
8483
8484         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8485
8486         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8487         we're an EnumConstant, just return that.
8488         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8489         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8490         to get the value which'll actually be written into the attribute.
8491         However, we have to use GetValue() to access the attribute's value
8492         in the compiler.        
8493
8494 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8495
8496         * constant.cs (Constant.IsNegative): New abstract property
8497         IsNegative.
8498
8499         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8500         (StackAlloc.DoResolve): Reused IsNegative.
8501
8502 2004-09-22  Martin Baulig  <martin@ximian.com>
8503
8504         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8505         public method; like LookupTypeContainer, but also works for
8506         generic instances.
8507
8508         * report.cs (Report.SymbolRelatedToPreviousError): Use
8509         TypeManager.LookupGenericTypeContainer().       
8510
8511 2004-09-22  Martin Baulig  <martin@ximian.com>
8512
8513         Thanks to Peter Sestoft for this bug report.
8514
8515         * expression.cs (Conditional): If both the `trueExpr' and the
8516         `falseExpr' is a NullLiteral, return a NullLiteral.
8517
8518 2004-09-22  Martin Baulig  <martin@ximian.com>
8519
8520         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8521         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8522         for the "get_Current" call.
8523
8524 2004-09-21  Martin Baulig  <martin@ximian.com>
8525
8526         * convert.cs (Convert.ImplicitReferenceConversion): When
8527         converting to an interface type, first check whether we're
8528         converting from a reference type.
8529
8530 2004-09-14  Martin Baulig  <martin@ximian.com>
8531
8532         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8533
8534 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8535
8536         Fixed bug #61902
8537         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8538         called and is obsolete then this member suppress message
8539         when call is inside next [Obsolete] method or type.
8540
8541         * expression.cs: Use TestObsoleteMethodUsage member.
8542
8543 2004-09-14  Martin Baulig  <martin@ximian.com>
8544
8545         * genericparser.cs: Removed.
8546
8547 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8548
8549         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8550
8551 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8552
8553         * attribute.cs (Attribute.Resolve): Add error 653 report.
8554
8555         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8556         report.
8557         (Method.ApplyAttributeBuilder): Add error 685 report.
8558         (Operator.Define): Add error 564 report.
8559
8560         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8561
8562         * expression.cs (Invocation.DoResolve): Add error
8563         245 and 250 report.
8564
8565         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8566         error 674 report.
8567
8568 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8569
8570         * class.cs (ConstructorInitializer.Resolve):
8571         Wrong error number (515->516).
8572
8573 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8574
8575         * class.cs (Indexer.Define): Add error 631 report.
8576
8577 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8578
8579         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8580
8581 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8582
8583         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8584
8585 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8586
8587         * cs-parser.jay: Added error CS0241 report.
8588
8589 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8590
8591         * cs-parser.jay (fixed_statement): Introduce a scope for the
8592         declaration in the 'fixed' statement.
8593
8594 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8595
8596         * cs-parser.jay: Added CS0230 error report.
8597
8598 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8599
8600         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8601
8602 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8603
8604         * expression.cs (Argument.Resolve): Added error CS0192 and
8605         CS0199 report.
8606
8607 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8608
8609         C# 2.0 #pragma warning feature
8610
8611         * cs-tokenizer.cs (PreProcessPragma): New method; 
8612         Handles #pragma directive.
8613
8614         * report.cs (WarningRegions): New class; Support
8615         class for #pragma warning directive. It tests whether
8616         warning is enabled for a given line.
8617
8618 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8619
8620         * const.cs: Add more descriptive error report, tahnks to
8621         Sebastien. 
8622
8623 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8624
8625         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8626
8627 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8628
8629         * expression.cs: Apply patch from Ben: Remove dead code from
8630         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8631         as that code just threw an exception anwyays.
8632
8633         * const.cs: Remove the call to the turnintoconstant, for details
8634         see bug: #63144
8635         
8636         * literal.cs: The type of the null-literal is the null type;  So
8637         we use a placeholder type (literal.cs:System.Null, defined here)
8638         for it.
8639
8640         * expression.cs (Conditional.DoResolve): Remove some old code that
8641         is no longer needed, conversions have been fixed.
8642
8643         (ArrayCreationExpression.DoResolve): Return false if we fail to
8644         resolve the inner expression.
8645
8646 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8647
8648         Fix test-290.cs.
8649         * cs-parser.jay (delegate_declaration): Record a delegate
8650         declaration as a type declaration.
8651         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8652
8653 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8654
8655         * parameter.cs: Do not crash if the type can not be resolved. 
8656
8657         * expression.cs: Report errors with unsafe pointers, fixes #64896
8658
8659 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8660
8661         * expression.cs: Pointer arith always needs to do a conv.i
8662         if the operand is a long. fix 65320
8663
8664 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8665
8666         Fixed cs0619-37.cs, cs0619-38.cs
8667
8668         * enum.cs (GetObsoleteAttribute): Removed.
8669
8670         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8671         on Enum member is double staged. The first is tested member
8672         and then enum.
8673
8674 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8675
8676         Fixed #56986, #63631, #65231
8677
8678         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8679         adds member to name container.
8680         (TypeContainer.AddToTypeContainer): New method, adds type to
8681         name container.
8682         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8683         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8684         AddOperator): Simplified by reusing AddToMemberContainer.
8685         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8686         instead of field.
8687         (Method.CheckForDuplications): Fixed implementation to test all
8688         possibilities.
8689         (MemberBase): Detection whether member is explicit interface
8690         implementation is now in constructor.
8691         (MemberBase.UpdateMemberName): Handles IndexerName.
8692         (Accessor): Changed to keep also location information.
8693         (AbstractPropertyEventMethod): Is derived from MemberCore.
8694         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8695         will be emited or not.
8696         (PropertyBase.AreAccessorsDuplicateImplementation):
8697         Tests whether accessors are not in collision with some method.
8698         (Operator): Is derived from MethodCore to simplify common
8699         operations.
8700
8701         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8702         must be performed.
8703         (DeclSpace.AddToContainer): Adds the member to defined_names
8704         table. It tests for duplications and enclosing name conflicts.
8705
8706         * enum.cs (EnumMember): Clean up to reuse the base structures
8707
8708 2004-09-03  Martin Baulig  <martin@ximian.com>
8709
8710         Merged latest changes into gmcs.  Please keep this comment in
8711         here, it makes it easier for me to see what changed in MCS since
8712         the last time I merged.
8713
8714 2004-09-03  Martin Baulig  <martin@ximian.com>
8715
8716         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8717         into TypeContainer, to make partial classes work again.
8718
8719 2004-09-03  Martin Baulig  <martin@ximian.com>
8720
8721         * rootcontext.cs (RootContext.V2): Removed.
8722
8723 2004-03-23  Martin Baulig  <martin@ximian.com>
8724
8725         * expression.cs (Invocation.OverloadResolve): Added `bool
8726         may_fail' argument and use it instead of the Location.IsNull() hack.
8727
8728 2004-09-09  Martin Baulig  <martin@ximian.com>
8729
8730         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8731
8732 2004-09-09  Martin Baulig  <martin@ximian.com>
8733
8734         * generic.cs (TypeParameter.DefineType): Added support for
8735         explicit interface methods.
8736
8737 2004-09-09  Martin Baulig  <martin@ximian.com>
8738
8739         * README.Changes: New document.  Started to list important changes
8740         between MCS and GMCS here.
8741
8742 2004-09-08  Martin Baulig  <martin@ximian.com>
8743
8744         * class.cs
8745         (TypeContainer.CheckRecursiveDefinition): New protected method.
8746         (TypeContainer.DefineType): Move the CS0146 check into
8747         CheckRecursiveDefinition().     
8748
8749 2004-09-06  Martin Baulig  <martin@ximian.com>
8750
8751         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8752         types for the constructor constraint.
8753
8754 2004-09-03  Martin Baulig  <martin@ximian.com>
8755
8756         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8757         into TypeContainer, to make partial classes work again.
8758
8759 2004-09-03  Martin Baulig  <martin@ximian.com>
8760
8761         * rootcontext.cs (RootContext.V2): Removed.
8762
8763 2004-03-23  Martin Baulig  <martin@ximian.com>
8764
8765         * expression.cs (Invocation.OverloadResolve): Added `bool
8766         may_fail' argument and use it instead of the Location.IsNull() hack.
8767
8768 2004-09-03  Martin Baulig  <martin@ximian.com>
8769
8770         Merged latest changes into gmcs.  Please keep this comment in
8771         here, it makes it easier for me to see what changed in MCS since
8772         the last time I merged.
8773
8774 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8775
8776         Fix #61128.
8777         * expression.cs (BetterConversion): Don't allow either conversion 
8778         to be null.  Remove redundant implicit conversion test when 'q ==
8779         null' -- when this function is invoked, we already know that the
8780         implicit conversion exists.
8781         (BetterFunction): Assume that 'best' is non-null.  Remove
8782         redundant reimplementation of IsApplicable when 'best' is null.
8783         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8784         number of arguments.
8785         (IsAncestralType): Extract from OverloadResolve.
8786         (OverloadResolve): Make robust to the MethodGroupExpr being
8787         unsorted.  Implement all the logic of Section 14.5.5.1, and
8788         support overloading of methods from multiple applicable types.
8789         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8790
8791         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8792         (RealError, Warning): Append type of report to related symbol.
8793
8794 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8795
8796         * enum.cs: Fixed CLS-Compliance checks for enum members.
8797         Error tests cs3008-8.cs, cs3014-8.cs
8798
8799 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8800
8801         Fixed bug #62342, #63102
8802         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8803         like ImplementMethod.
8804
8805 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8806
8807         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8808         Fixed bug #65170.
8809
8810 2004-09-02  Martin Baulig  <martin@ximian.com>
8811
8812         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8813         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8814         on the MethodBase.
8815
8816 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8817
8818         C# 2.0 Static classes implemented
8819
8820         * class.cs (TypeContainer): instance_constructors,
8821         initialized_fields, initialized_static_fields,
8822         default_constructor, base_inteface_types are protected to be
8823         accessible from StaticClass.
8824         (TypeContainer.DefineDefaultConstructor): New virtual method
8825         for custom default constructor generating
8826         (StaticClass): New class to handle "Static classes" feature.
8827
8828         * cs-parser.jay: Handle static keyword on class like instance
8829         of StaticClass.
8830
8831         * driver.cs: Added "/langversion" command line switch with two
8832         options (iso-1, default).
8833
8834 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8835
8836         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8837
8838 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8839
8840         * delegate.cs: Style.
8841
8842 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8843
8844         * delegate.cs: Add seperate instance expr field for miguel.
8845
8846 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8847
8848         * PointerArithmetic (Resolve): make sure we are not doing
8849         pointer arith on void*. Also, make sure we are resolved
8850         by not setting eclass until resolve.
8851
8852         All callers: Make sure that PointerArithmetic gets resolved.
8853
8854 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8855
8856         * ArrayCreation (LookupType): If the type does not resolve 
8857         to an array, give an error.
8858
8859 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8860
8861         * statement.cs (Try.Resolve): Fixed bug #64222
8862
8863 2004-08-27  Martin Baulig  <martin@ximian.com>
8864
8865         * class.cs
8866         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8867         crash here.     
8868
8869 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8870
8871         * ecore.cs (Constantify): Get underlying type via
8872         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8873         Windows in special cases.
8874
8875 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8876
8877         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8878         for obtaining also private methods.
8879         (GetRemoveMethod): Used GetRemoveMethod (true)
8880         for obtaining also private methods.
8881
8882 2004-09-02  Martin Baulig  <martin@ximian.com>
8883
8884         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8885         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8886         on the MethodBase.
8887
8888 2004-08-27  Martin Baulig  <martin@ximian.com>
8889
8890         * class.cs
8891         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8892         crash here.     
8893
8894 2004-08-25  Martin Baulig  <martin@ximian.com>
8895
8896         * support.cs (ReflectionParameters..ctor): If this is a generic
8897         method, retrieve and store its type parameters.
8898         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8899         (ReflectionParameters.GenericConstraints): The argument specifies
8900         the type parameter, not the method parameter.
8901         (InternalParameters.GenericConstraints): Likewise.
8902
8903         * generic.cs (TypeParameter.DefineType): Correctly handle
8904         constraints wrt. generic methods in interfaces and their
8905         implementations.        
8906
8907 2004-08-24  Martin Baulig  <martin@ximian.com>
8908
8909         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8910         (Constraints.IsSubclassOf): New internal method.
8911
8912         * typemanager.cs (TypeManager.FindMembers): Added special support
8913         for GenericTypeParameterBuilder's.      
8914         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8915         type parameters.
8916
8917 2004-08-24  Martin Baulig  <martin@ximian.com>
8918
8919         * typemanager.cs
8920         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8921         this for accessibility checks.
8922         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8923         IsNestedFamilyAccessible.
8924         (TypeManager.IsSubclassOf): New method, do what the name actually
8925         says.   
8926
8927 2004-08-24  Martin Baulig  <martin@ximian.com>
8928
8929         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8930         as a SimpleName, include the generic arity.
8931
8932 2004-08-24  Martin Baulig  <martin@ximian.com>
8933
8934         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8935         MethodAttributes.HideBySig for operators.
8936
8937 2004-08-23  Martin Baulig  <martin@ximian.com>
8938
8939         Back to the old error reporting system :-)
8940
8941         * report.cs (Message): Removed.
8942         (Report.MessageData, ErrorData, WarningData): Removed.
8943         (Report.Error, Warning): Back to the old system.
8944
8945 2004-08-23  Martin Baulig  <martin@ximian.com>
8946
8947         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8948
8949         * class.cs (TypeContainer.ParentContainer): New public virtual
8950         method; replaces the explicit interface implementation.
8951         (ClassPart.ParentContainer): Override.
8952
8953 2004-08-23  Martin Baulig  <martin@ximian.com>
8954
8955         * statement.cs (Switch): Added support for constant switches; see
8956         #59428 or test-285.cs.
8957
8958 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8959
8960         Fixed bug #62740.
8961         * statement.cs (GetEnumeratorFilter): Removed useless
8962         logic because C# specs is strict. GetEnumerator must be
8963         public.
8964
8965 2004-08-22  Martin Baulig  <martin@ximian.com>
8966
8967         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8968         a switch and may break, reset the barrier.  Fixes #59867.
8969
8970 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8971
8972         CLS-Compliance speed up (~5% for corlib)
8973
8974         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8975         New method. Tests container for CLS-Compliant names
8976
8977         * class.cs (TypeContainer.VerifyClsName): New method.
8978         Checks whether container name is CLS Compliant.
8979         (Constructor): Implements IMethodData.
8980
8981         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8982         low-case table for CLS Compliance test.
8983         (MemberCache.VerifyClsParameterConflict): New method.
8984         Checks method parameters for CS3006 error.
8985
8986         * enum.cs (EnumMember): Is derived from MemberCore.
8987         (Enum.VerifyClsName): Optimized for better performance.
8988
8989 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8990
8991         * report.cs: Renamed Error_T to Error and changed all
8992         references.
8993
8994 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8995
8996         * class.cs (TypeContainer.IndexerArrayList): New inner class
8997         container for indexers.
8998         (TypeContainer.DefaultIndexerName): New constant for default
8999         indexer name. Replaced all "Item" with this constant.
9000         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9001
9002         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9003         DefaultMemberAttribute constructor.
9004
9005 2004-08-05  Martin Baulig  <martin@ximian.com>
9006
9007         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9008         Fix bug #59429.
9009
9010 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9011
9012         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9013         multi platforms problem.
9014
9015         * compiler.csproj: Included shared files.
9016
9017 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9018
9019         Fix bug 60333, 55971 in the more general way
9020         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9021         Added arg_type argument for constant conversion.
9022         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9023
9024 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9025
9026         Fix bug #59760
9027         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9028         OperatorArrayList, MethodCoreArrayList for typecontainer
9029         containers. Changed class member types to these new types.
9030         (MethodArrayList.DefineMembers): Added test for CS0659.
9031
9032 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9033
9034         * cfold.cs: Synchronize the folding with the code in expression.cs
9035         Binary.DoNumericPromotions for uint operands.
9036
9037         * attribute.cs: Revert patch from Raja, it introduced a regression
9038         while building Blam-1.2.1 (hard to isolate a test case).
9039
9040 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9041
9042         Fix for #55382
9043         * class.cs:
9044         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9045         name collision.
9046         (MethodCore.parent_method): New member. The method we're overriding
9047         if this is an override method.
9048         (MethodCore.CheckBase): Moved from Method class and made common.
9049         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9050         private.
9051         (MethodCore.CheckForDuplications): New abstract method. For custom
9052         member duplication search in a container
9053         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9054         method and its return type.
9055         (Event.conflict_symbol): New member. Symbol with same name in the
9056         parent class.
9057
9058         * decl.cs:
9059         (MemberCache.FindMemberWithSameName): New method. The method
9060         is looking for conflict with inherited symbols.
9061
9062 2004-08-04  Martin Baulig  <martin@ximian.com>
9063
9064         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9065
9066         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9067
9068 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9069
9070         * report.cs (Message): New enum for better error, warning reference in
9071         the code.
9072         (MessageData): New inner abstract class. It generally handles printing of
9073         error and warning messages.
9074         Removed unused Error, Warning, Message methods.
9075
9076 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9077
9078         Fix for cs0592-8.cs test
9079         * attribute.cs
9080         (Attributable.ValidAttributeTargets): Made public.
9081         (Attribute.ExplicitTarget): New member for explicit target value.
9082         (Attribute.CheckTargets): Now we translate explicit attribute
9083         target to Target here.
9084
9085 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9086
9087         * ecore.cs (MethodGroupExpr): new IsBase property.
9088
9089         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9090
9091         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9092         rather than an instance expr.
9093
9094         (DelegateCreation.Emit): Use the method group rather than
9095         the instance expression. Also, if you have base.Foo as the
9096         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9097
9098         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9099
9100         (NewDelegate.DoResolve): Only check for the existance of Invoke
9101         if the method is going to be needed. Use MethodGroupExpr.
9102
9103         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9104
9105         * expression.cs: For pointer arith., make sure to use
9106         the size of the type, not the size of the pointer to
9107         the type.
9108
9109 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9110
9111         Fix for #60722
9112         * class.cs (Class): Added error CS0502 test.
9113
9114 2004-08-03  John Luke  <jluke@cfl.rr.com>
9115             Raja R Harinath  <rharinath@novell.com>
9116
9117         Fix for #60997.
9118         * attribute.cs (Attribute.complained_before): New flag.
9119         (Attribute.ResolveType, Attribute.Resolve),
9120         (Attribute.DefinePInvokeMethod): Set it.
9121         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9122         
9123 2004-08-03  Martin Baulig  <martin@ximian.com>
9124
9125         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9126         use a user-defined operator; we still need to do numeric
9127         promotions in case one argument is a builtin type and the other
9128         one has an implicit conversion to that type.  Fixes #62322.
9129
9130 2004-08-18  Martin Baulig  <martin@ximian.com>
9131
9132         * class.cs (Method.Define): Use the correct method name when
9133         creating the MethodBuilder for a generic method.
9134
9135 2004-08-17  Martin Baulig  <martin@ximian.com>
9136
9137         * generic.cs (Constraints): Support type parameter constraints.
9138
9139 2004-08-16  Martin Baulig  <martin@ximian.com>
9140
9141         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9142         (Token.GENERIC_DIMENSION): New token; this is returned if we
9143         encounter an unbound generic type in a typeof() expression.
9144
9145         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9146         this token is only generated while parsing a typeof() expression.
9147         (typeof_expression): Removed the old unbound_type hack.
9148
9149         * generic.cs (TypeArguments.IsUnbound): New public property.
9150
9151         * decl.cs (MemberName): Added support for unbound types.
9152
9153 2004-08-14  Martin Baulig  <martin@ximian.com>
9154
9155         * typemanager.cs
9156         (TypeManager.IsEqualGenericInstance): New static method.
9157         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9158         just used to check accessibility, so follow the rules of 26.1.6.        
9159
9160         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9161         ConstructedType instead of a TypeExpression if we have type arguments.
9162
9163         * cs-parser.jay (typeof_expression): Support unbound generic types.
9164
9165         * ecore.cs (UnboundTypeExpression): New public class.
9166
9167 2004-08-12  Martin Baulig  <martin@ximian.com>
9168
9169         * typemanager.cs (TypeManager.IsNestedChildOf): Use
9170         TypeManager.IsEqual() rather than `=='.
9171
9172         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9173         generic instances as well.
9174
9175 2004-08-12  Martin Baulig  <martin@ximian.com>
9176
9177         * expression.cs (Invocation.InferType): We can only infer method
9178         type parameters.  Fixes #62647.
9179
9180 2004-08-11  Martin Baulig  <martin@ximian.com>
9181
9182         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9183         before resolving the base classes.
9184
9185 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9186
9187         * Makefile: install .mdb file too.
9188
9189 2004-08-05  Martin Baulig  <martin@ximian.com>
9190
9191         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9192         initializer, the current type is just the TypeBuilder, not the
9193         instantiated generic type.
9194         (FieldExpr.IsFieldInitializer): New public property.
9195
9196 2004-08-04  Martin Baulig  <martin@ximian.com>
9197
9198         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9199
9200         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9201
9202 2004-08-03  Martin Baulig  <martin@ximian.com>
9203
9204         * class.cs (MethodData.Define): If we're an explicit
9205         implementation, remove the generic arity from the type name.
9206
9207 2004-08-03  Martin Baulig  <martin@ximian.com>
9208
9209         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9210         use a user-defined operator; we still need to do numeric
9211         promotions in case one argument is a builtin type and the other
9212         one has an implicit conversion to that type.  Fixes #62322.
9213
9214 2004-08-02  Martin Baulig  <martin@ximian.com>
9215
9216         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9217         `TypeExpr[]' array.
9218         (TypeContainer.GetClassBases): Return the unexpanded list of
9219         interfaces; we expand them later.
9220         (TypeContainer.DefineType): After creating the TypeBuilder, call
9221         TypeManager.ExpandInterfaces() to get an expanded and resolved
9222         list of interfaces.
9223
9224         * ecore.cs (TypeExpr.GetInterfaces): Removed
9225
9226         * generics.cs (Constraints.InterfaceConstraints): Remove.
9227         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9228         register the interface constraints.
9229
9230         * typemanager.cs
9231         (TypeManager.AddUserType): Removed the `ifaces' argument.
9232         (TypeManager.AddTypeParameter): Likewise.
9233         (TypeManager.AddUserInterface): Removed, was unused.
9234         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9235         `TypeExpr[]' array for the interfaces.
9236         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9237         has been defined, returns a list of the resolved interfaces types.
9238         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9239         (TypeManager.GetExplicitInterfaces): Likewise.  
9240
9241 2004-08-02  Martin Baulig  <martin@ximian.com>
9242
9243         * expression.cs (Invocation.EmitCall): If we're invoking a method
9244         on a type parameter, use the new `Constrained' prefix opcode.
9245
9246 2004-08-02  Martin Baulig  <martin@ximian.com>
9247
9248         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9249         (LocalInfo.IsThis): New public property.
9250         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9251
9252 2004-08-01  Martin Baulig  <martin@ximian.com>
9253
9254         * class.cs (TypeContainer.GetClassBases): Don't set the default
9255         here since we may get called from GetPartialBases().
9256         (TypeContainer.DefineType): If GetClassBases() didn't return a
9257         parent, use the default one.
9258
9259 2004-07-30  Martin Baulig  <martin@ximian.com>
9260
9261         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9262
9263         * class.cs (SourceMethod): New public class, derive from the
9264         symbol writer's ISourceMethod.
9265         (Method): Use the new symbol writer API.
9266
9267         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9268         as argument and use the new symbol writer.
9269
9270         * location.cs
9271         (SourceFile): Implement the symbol writer's ISourceFile.
9272         (Location.SymbolDocument): Removed.
9273         (Location.SourceFile): New public property.
9274
9275         * symbolwriter.cs: Use the new symbol writer API.
9276
9277 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9278
9279         * Makefile (install-local): Remove.  Functionality moved to
9280         executable.make.
9281
9282 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9283
9284         * Makefile: Install mcs.exe.config file together with mcs.exe.
9285         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9286         correct runtime version.
9287         
9288 2004-07-25  Martin Baulig  <martin@ximian.com>
9289
9290         * class.cs
9291         (TypeContainer.RegisterOrder): Removed, this was unused.
9292         (TypeContainer, interface_order): Removed.
9293         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9294         TypeContainer as argument since we can also be called with a
9295         `PartialContainer' for a partial class/struct/interface.
9296         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9297         of checking whether we're an `Interface' - we could be a
9298         `PartialContainer'.
9299         (PartialContainer.Register): Override; call
9300         AddClass()/AddStruct()/AddInterface() on our parent.
9301
9302         * cs-parser.jay (interface_member_declaration): Add things to the
9303         `current_container', not the `current_class'.
9304
9305         * rootcontext.cs (RegisterOrder): The overloaded version which
9306         takes an `Interface' was unused, removed.
9307
9308         * typemanager.cs (TypeManager.LookupInterface): Return a
9309         `TypeContainer', not an `Interface'.
9310         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9311         contain a `PartialContainer' for an interface, so check it's
9312         `Kind' to figure out what it is.
9313
9314 2004-07-25  Martin Baulig  <martin@ximian.com>
9315
9316         * class.cs (Class.DefaultTypeAttributes): New public constant.
9317         (Struct.DefaultTypeAttributes): Likewise.
9318         (Interface.DefaultTypeAttributes): Likewise.
9319         (PartialContainer.TypeAttr): Override this and add the
9320         DefaultTypeAttributes.
9321
9322 2004-07-25  Martin Baulig  <martin@ximian.com>
9323
9324         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9325         we can just use the `Parent' field instead.
9326
9327 2004-07-25  Martin Baulig  <martin@ximian.com>
9328
9329         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9330
9331 2004-07-25  Martin Baulig  <martin@ximian.com>
9332
9333         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9334         our parts before defining any methods.
9335         (TypeContainer.VerifyImplements): Make this virtual.
9336         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9337         on our PartialContainer.
9338
9339 2004-07-25  Martin Baulig  <martin@ximian.com>
9340
9341         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9342
9343         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9344         argument, we can just use the `Parent' field instead.
9345
9346         * class.cs
9347         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9348         (MemberBase.DoDefine): Likewise.
9349
9350 2004-07-24  Martin Baulig  <martin@ximian.com>
9351
9352         * decl.cs (MemberCore.Parent): New public field.
9353         (DeclSpace.Parent): Moved to MemberCore.
9354
9355         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9356         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9357         parent's .ctor.
9358         (FieldBase, Field, Operator): Likewise.
9359         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9360         (EventField, Event): Likewise.
9361
9362 2004-07-23  Martin Baulig  <martin@ximian.com>
9363
9364         * class.cs (PartialContainer): New public class.
9365         (ClassPart): New public class.
9366         (TypeContainer): Added support for partial classes.
9367         (TypeContainer.GetClassBases): Splitted some of the functionality
9368         out into GetNormalBases() and GetPartialBases().
9369
9370         * cs-tokenizer.cs (Token.PARTIAL): New token.
9371         (Tokenizer.consume_identifier): Added some hacks to recognize
9372         `partial', but only if it's immediately followed by `class',
9373         `struct' or `interface'.
9374
9375         * cs-parser.jay: Added support for partial clases.
9376
9377 2004-07-23  Martin Baulig  <martin@ximian.com>
9378
9379         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9380         a `DeclSpace' and also made it readonly.
9381         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9382         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9383         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9384
9385         * cs-parser.jay: Pass the `current_class', not the
9386         `current_container' (at the moment, this is still the same thing)
9387         to a new Method, Property, Event, Indexer or Constructor.
9388
9389 2004-07-23  Martin Baulig  <martin@ximian.com>
9390
9391         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9392         and removed the `current_interface' one.
9393         (struct_declaration, class_declaration, interface_declaration):
9394         Set `current_class' to the newly created class/struct/interface;
9395         set their `Bases' and call Register() before parsing their body.
9396
9397 2004-07-23  Martin Baulig  <martin@ximian.com>
9398
9399         * class.cs (Kind): New public enum.
9400         (TypeContainer): Made this class abstract.
9401         (TypeContainer.Kind): New public readonly field.
9402         (TypeContainer.CheckDef): New public method; moved here from
9403         cs-parser.jay.
9404         (TypeContainer.Register): New public abstract method.
9405         (TypeContainer.GetPendingImplementations): New public abstract
9406         method.
9407         (TypeContainer.GetClassBases): Removed the `is_class' and
9408         `is_iface' parameters.
9409         (TypeContainer.DefineNestedTypes): Formerly known as
9410         DoDefineType().
9411         (ClassOrStruct): Made this class abstract.
9412
9413         * tree.cs (RootTypes): New public type. 
9414
9415 2004-07-20  Martin Baulig  <martin@ximian.com>
9416
9417         * tree.cs (Tree.RecordNamespace): Removed.
9418         (Tree.Namespaces): Removed.
9419
9420         * rootcontext.cs (RootContext.IsNamespace): Removed.
9421
9422         * cs-parser.jay (namespace_declaration): Just create a new
9423         NamespaceEntry here.
9424
9425 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
9426
9427         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9428         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9429         entry to make sure it runs in the correct runtime version.
9430         
9431 2004-07-18  Martin Baulig  <martin@ximian.com>
9432
9433         * generic.cs (ConstructedType.CheckConstraints): Improved
9434         constraints checking.
9435
9436 2004-07-18  Martin Baulig  <martin@ximian.com>
9437
9438         * expression.cs (Invocation.BetterMethod): Call
9439         TypeManager.TypeToCoreType() on all types and removed my previous
9440         hack; we're already doig the right thing here.
9441
9442 2004-07-17  Martin Baulig  <martin@ximian.com>
9443
9444         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9445
9446 2004-07-16  Martin Baulig  <martin@ximian.com>
9447
9448         * iterators.cs: Added generics support.
9449
9450 2004-07-16  Martin Baulig  <martin@ximian.com>
9451
9452         * iterators.cs: Rewrote this.  We're now using one single Proxy
9453         class for both the IEnumerable and the IEnumerator interface and
9454         `Iterator' derives from Class so we can use the high-level API.
9455
9456         * class.cs (TypeContainer.AddIterator): New method.
9457         (TypeContainer.DoDefineType): New protected virtual method, which
9458         is called from DefineType().
9459         (TypeContainer.DoDefineMembers): Call DefineType() and
9460         DefineMembers() on all our iterators.
9461         (TypeContainer.Emit): Call Emit() on all our iterators.
9462         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9463
9464         * codegen.cs (EmitContext.CurrentIterator): New public field.
9465
9466 2004-07-15  Martin Baulig  <martin@ximian.com>
9467
9468         * typemanager.cs
9469         (TypeManager.not_supported_exception_type): New type.   
9470
9471 2004-07-14  Martin Baulig  <martin@ximian.com>
9472
9473         * typemanager.cs
9474         (TypeManager.generic_ienumerable_type): New type.
9475         (TypeManager.generic_ienumerator_type): New type.
9476
9477         * rootcontext.cs
9478         (RootContext.interfaces_first_stage): Added
9479         "System.Collections.Generic.IEnumerator`1" and
9480         "System.Collections.Generic.IEnumerable`1".     
9481
9482 2004-07-14  Martin Baulig  <martin@ximian.com>
9483
9484         * iterators.cs: Use real error numbers.
9485
9486 2004-07-14  Martin Baulig  <martin@ximian.com>
9487
9488         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9489         requires this to be a System.Collection.IEnumerable and not a
9490         class implementing that interface.
9491         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9492
9493 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9494
9495         * class.cs: Fixed previous fix, it broke some error tests.
9496
9497 2004-07-12  Martin Baulig  <martin@ximian.com>
9498
9499         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9500         Fixes #61293.
9501
9502 2004-07-14  Martin Baulig  <martin@ximian.com>
9503
9504         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9505         an exclamation mark (!) for the generic arity to reflect the
9506         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9507
9508 2004-07-13  Martin Baulig  <martin@ximian.com>
9509
9510         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9511         specifiers being part of a type argument.
9512
9513 2004-07-13  Martin Baulig  <martin@ximian.com>
9514
9515         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9516         name for generic types.
9517
9518 2004-07-13  Martin Baulig  <martin@ximian.com>
9519
9520         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9521         bit to fix #60119.
9522
9523 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9524
9525         * assign.cs (LocalTemporary): Add new argument: is_address,If
9526         `is_address' is true, then the value that we store is the address
9527         to the real value, and not the value itself.
9528         
9529         * ecore.cs (PropertyExpr): use the new local temporary
9530         stuff to allow us to handle X.Y += z (where X is a struct)
9531
9532 2004-07-08  Martin Baulig  <martin@ximian.com>
9533
9534         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9535         not always return, just like we're doing in Using.Resolve().
9536
9537 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9538
9539         * cs-parser.jay (fixed_statement): flag this as Pinned.
9540
9541 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9542
9543         * typemanager.cs (TypeManager): Removed MakePinned method, this
9544         mechanism is replaced with the .NET 2.x compatible mechanism of
9545         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9546
9547         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9548         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9549         `IsFixed' property which has a different meaning.
9550
9551 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9552
9553         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9554         visible from inside a nested class, not just the names of the
9555         immediately enclosing class.
9556         Fix for bug #60730.
9557
9558 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9559
9560         * expression.cs (BetterConversion): Remove buggy special-case
9561         handling of "implicit constant expression conversions".  At this
9562         point, we already know that the conversion is possible -- we're
9563         only checking to see which is better.
9564
9565 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9566
9567         * cs-parser.jay: Added error CS0210 test.
9568
9569 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9570
9571         * cs-parser.jay: Added error CS0134 test.
9572
9573 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9574
9575         Fix bug #52507
9576         * cs-parser.jay: Added error CS0145 test.
9577
9578 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9579
9580         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9581
9582 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9583         
9584         * expression.cs (StackAlloc.Resolve): The argument may not
9585         be a constant; deal with this case.
9586         
9587 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9588
9589         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9590         GetIndexerAttributeValue.
9591         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9592
9593         * class.cs (Indexer.Define): Added error tests for CS0415,
9594         CS0609.
9595
9596 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9597
9598         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9599         property code.
9600
9601 2004-06-23  Martin Baulig  <martin@ximian.com>
9602
9603         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9604         neither return nor throw, reset the barrier as well.  Fixes #60457.
9605
9606 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9607
9608         * class.cs : EventAttributes is now set to None by default.
9609           This fixes bug #60459.
9610
9611 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9612
9613         Fix bug #60219
9614         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9615         Don't throw exception but return null (it's sufficient now).
9616
9617 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9618
9619         * typemanager.cs (GetArgumentTypes): Faster implementation.
9620
9621 2004-06-18  Martin Baulig  <martin@ximian.com>
9622
9623         * attribute.cs (Attribute.Resolve): Check whether we're an
9624         EmptyCast which a Constant child.  Fixes #60333.
9625
9626 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9627
9628         * statement.cs (EmitCollectionForeach): Account for the fact that
9629         not all valuetypes are in areas which we can take the address of.
9630         For these variables, we store to a temporary variable. Also, make
9631         sure that we dont emit a `callvirt' on a valuetype method.
9632
9633 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9634
9635         * expression.cs (StackAlloc.DoReSolve): Added test for
9636         negative parameter (CS0247).
9637
9638 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9639
9640         Fix bug #59792
9641         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9642
9643 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9644
9645         Fix bug #59781
9646         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9647         ulong.
9648
9649 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9650
9651         Fix bug #58254 & cs1555.cs, cs1556.cs
9652         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9653
9654 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9655
9656         * cs-parser.jay: Added error CS1669 test for indexers.
9657
9658 2004-06-18  Martin Baulig  <martin@ximian.com>
9659
9660         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9661         argument.  Fixes #60441.
9662
9663 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9664         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9665         The name needs to have the actual name of the method in order
9666         for other tests (such as the one in OverloadResolve for Invoke
9667         on a delegate) to work. As well, it does not really help
9668         error reporting because the method group had multiple methods.
9669         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9670         Make profiling work.
9671         
9672 2004-06-13  Martin Baulig  <martin@ximian.com>
9673
9674         * cs-parser.jay: Don't allow generic attributes.
9675
9676 2004-06-13  Martin Baulig  <martin@ximian.com>
9677
9678         * class.cs (MemberBase.DoDefineBase): New protected method.
9679         (MemberBase.DoDefine): Compute the `flags' in the new
9680         DoDefineBase() which must be called first.
9681         (Method.Define): Call DoDefineBase() first so we have the flags
9682         when defining the generic method.
9683
9684         * cs-parser.jay (interface_method_declaration): Support generic methods.
9685
9686 2004-06-13  Martin Baulig  <martin@ximian.com>
9687
9688         * decl.cs (TypeName): Removed.
9689         (MemberName): Removed TypeName and MemberNow; now we just have
9690         MemberName.
9691
9692         * cs-parser.jay: Don't distinguish between type arguments and type
9693         parameters in the grammar and simplified the rules a bit.  The
9694         reduce/reduce conflicts are now gone (except the one we inherited
9695         from mcs).
9696
9697 2004-06-11  Martin Baulig  <martin@ximian.com>
9698
9699         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9700         call this twice: for params and varargs methods.
9701
9702 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9703
9704         * class.cs:
9705         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9706
9707 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9708
9709         * attribute.cs (Attribute.GetValidTargets): Made public.
9710
9711         * class.cs: 
9712         (AbstractPropertyEventMethod): New class for better code sharing.
9713         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9714         CS1667 report.
9715         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9716
9717 2004-06-09  Martin Baulig  <martin@ximian.com>
9718
9719         * cs-parser.jay: Removed a reduce/reduce conflict.
9720
9721 2004-06-03  Martin Baulig  <martin@ximian.com>
9722
9723         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9724         GetSimpleName() and return a SimpleName.
9725
9726         * ecore.cs (SimpleName.Arguments): New public field.
9727         (SimpleName): Added overloaded ctor which takes an additional
9728         TypeArguments argument.
9729         (SimpleName.SimpleNameResolve): Added support for generic methods.
9730         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9731         formerly in MemberAccess.DoResolve(), but we also need it in
9732         SimpleNameResolve().
9733
9734         * expression.cs (MemberAccess.DoResolve): Use the new
9735         MethodGroupExpr.ResolveGeneric().       
9736
9737 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9738
9739         * decl.cs: If possible, use lookuptypedirect here. We can only do
9740         this if there is no `.' after the namespace. Avoids using
9741         LookupType, which does lots of slow processing.
9742         (FindNestedType) New method, does what it says :-).
9743         * namespace.cs: use LookupTypeDirect.
9744         * rootcontext.cs: use membercache, if possible.
9745         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9746
9747 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9748
9749         * expression.cs:
9750         According to the spec, 
9751
9752         In a member access of the form E.I, if E is a single identifier,
9753         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9754         field, property, localvariable, or parameter with the same type as
9755         the meaning of E as a type-name (§3.8), then both possible
9756         meanings of E are permitted.
9757
9758         We did not check that E as a simple-name had the same type as E as
9759         a type name.
9760
9761         This trivial check gives us 5-7% on bootstrap time.
9762
9763 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9764
9765         * expression.cs (Invocation.OverloadResolve): Avoid the
9766         use of hashtables and boxing here by allocating on demand.
9767
9768 2004-05-30  Martin Baulig  <martin@ximian.com>
9769
9770         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9771         we're doing a silent lookup.  Don't try to lookup nested types in
9772         TypeManager.object_type (thanks to Ben Maurer).
9773
9774 2004-05-30  Martin Baulig  <martin@ximian.com>
9775
9776         Committing a patch from Ben Maurer.
9777
9778         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9779
9780 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9781
9782         * convert.cs: add a trivial cache for overload operator resolution.
9783
9784 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9785
9786         * attribute.cs
9787         (AttributeTester.GetObsoleteAttribute): Returns instance of
9788         ObsoleteAttribute when type is obsolete.
9789
9790         * class.cs
9791         (TypeContainer.VerifyObsoleteAttribute): Override.
9792         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9793         (MethodCode.VerifyObsoleteAttribute): Override.
9794         (MemberBase.VerifyObsoleteAttribute): Override.
9795
9796         * decl.cs
9797         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9798         and report proper error.
9799
9800         *delegate.cs
9801         (Delegate.VerifyObsoleteAttribute): Override.
9802
9803         * ecore.cs
9804         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9805         and report proper error.
9806         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9807
9808         * enum.cs
9809         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9810         and enum member.
9811
9812         * expression.cs
9813         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9814         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9815         Added test for ObsoleteAttribute.
9816
9817         * statement.cs
9818         (Catch): Derived from Statement.
9819
9820 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9821
9822         * decl.cs: If possible, use lookuptypedirect here. We can only do
9823         this if there is no `.' after the namespace. Avoids using
9824         LookupType, which does lots of slow processing.
9825         (FindNestedType) New method, does what it says :-).
9826         * namespace.cs: use LookupTypeDirect.
9827         * rootcontext.cs: use membercache, if possible.
9828         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9829
9830 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9831
9832         * expression.cs:
9833         According to the spec, 
9834
9835         In a member access of the form E.I, if E is a single identifier,
9836         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9837         field, property, localvariable, or parameter with the same type as
9838         the meaning of E as a type-name (§3.8), then both possible
9839         meanings of E are permitted.
9840
9841         We did not check that E as a simple-name had the same type as E as
9842         a type name.
9843
9844         This trivial check gives us 5-7% on bootstrap time.
9845
9846 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9847
9848         Fixed bug #59071 & cs0160.cs
9849         * statement.cs (Try.Resolve): Check here whether order of catch
9850         clauses matches their dependencies.
9851
9852 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9853
9854         Fixed bug #58624
9855         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9856         unsafe type.
9857
9858 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9859
9860         * expression.cs (Invocation.OverloadResolve): Avoid the
9861         use of hashtables and boxing here by allocating on demand.
9862
9863 2004-05-30  Martin Baulig  <martin@ximian.com>
9864
9865         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9866         we're doing a silent lookup.  Don't try to lookup nested types in
9867         TypeManager.object_type (thanks to Ben Maurer).
9868
9869 2004-05-30  Martin Baulig  <martin@ximian.com>
9870
9871         Committing a patch from Ben Maurer.
9872
9873         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9874
9875 2004-05-29  Martin Baulig  <martin@ximian.com>
9876
9877         * class.cs (IMethodData.ShouldIgnore): New method.
9878
9879         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9880         `Location' argument, we don't need it anywhere.  Use
9881         `IMethodData.ShouldIgnore ()' instead of
9882         `MethodData.GetMethodFlags ()'.
9883         (TypeManager.AddMethod): Removed.
9884         (TypeManager.AddMethod2): Renamed to AddMethod.
9885
9886 2004-05-29  Martin Baulig  <martin@ximian.com>
9887
9888         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9889
9890         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9891         converting from a class type S to an interface type and we already
9892         have an object on the stack, don't box it again.  Fixes #52578.
9893
9894 2004-05-29  Martin Baulig  <martin@ximian.com>
9895
9896         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9897         Added support for `params' parameters.  Fixes #59267.
9898
9899 2004-05-29  Martin Baulig  <martin@ximian.com>
9900
9901         * literal.cs (NullPointer): Provide a private .ctor which sets
9902         `type' to TypeManager.object_type.  Fixes #59048.
9903
9904 2004-05-29  Martin Baulig  <martin@ximian.com>
9905
9906         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9907         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9908
9909         * ecore.cs (EventExpr.instance_expr): Make the field private.
9910
9911 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9912
9913         Fixed bug #50080 & cs0214-2.cs
9914         * expression.cs (Cast.DoResolve): Check unsafe context here.
9915         
9916         * statement.cs (Resolve.DoResolve): Likewise.
9917
9918 2004-05-26  Martin Baulig  <martin@ximian.com>
9919
9920         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9921
9922         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9923         (RootContext.LookupType): Pass down the `silent' flag.
9924
9925 2004-05-25  Martin Baulig  <martin@ximian.com>
9926
9927         * expression.cs
9928         (MethodGroupExpr.IdenticalTypeName): New public property.
9929         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9930         expression actually refers to a type.
9931
9932 2004-05-25  Martin Baulig  <martin@ximian.com>
9933
9934         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9935         for #56176 and made it actually work.
9936
9937 2004-05-25  Martin Baulig  <martin@ximian.com>
9938
9939         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9940         (FieldExpr, PropertyExpr): Override and implement
9941         CacheTemporaries.  Fixes #52279.
9942
9943 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9944
9945         * location.cs: In the new compiler listing a file twice is a
9946         warning, not an error.
9947
9948 2004-05-24  Martin Baulig  <martin@ximian.com>
9949
9950         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9951         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9952
9953 2004-05-24  Martin Baulig  <martin@ximian.com>
9954
9955         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9956         walking the `using' list.  Fixes #53921.
9957
9958 2004-05-24  Martin Baulig  <martin@ximian.com>
9959
9960         * const.cs (Const.LookupConstantValue): Added support for
9961         EmptyCast's; fixes #55251.
9962
9963 2004-05-24  Martin Baulig  <martin@ximian.com>
9964
9965         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9966         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9967         which does the CS0135 check.  The reason is that we first need to
9968         check whether the variable actually exists.
9969
9970 2004-05-24  Martin Baulig  <martin@ximian.com>
9971
9972         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9973         than RootContext.LookupType() to find the explicit interface
9974         type.  Fixes #58584.
9975
9976 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9977
9978         * Makefile: Simplify.  Use executable.make.
9979         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9980
9981 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9982
9983         * decl.cs:
9984         * enum.cs:
9985         Use the invariant culture when doing String.Compare for CLS case
9986         sensitivity.
9987         
9988 2004-05-23  Martin Baulig  <martin@ximian.com>
9989
9990         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9991         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9992
9993         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9994
9995 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9996
9997         * class.cs (MemberBase.Define): Reuse MemberType member for 
9998         resolved type. Other methods can use it too.
9999
10000 2004-05-23  Martin Baulig  <martin@ximian.com>
10001
10002         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10003         the variable also exists in the current block (otherwise, we need
10004         to report a CS0103).  Fixes #58670.
10005
10006 2004-05-23  Martin Baulig  <martin@ximian.com>
10007
10008         * flowanalysis.cs (Reachability.Reachable): Compute this
10009         on-the-fly rather than storing it as a field.
10010
10011 2004-05-23  Martin Baulig  <martin@ximian.com>
10012
10013         * flowanalysis.cs (Reachability.And): Manually compute the
10014         resulting `barrier' from the reachability.      
10015        
10016 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10017
10018         Fix bug #57835
10019         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10020         instance of ObsoleteAttribute when symbol is obsolete.
10021
10022         * class.cs
10023         (IMethodData): Extended interface for ObsoleteAttribute support.
10024
10025 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10026
10027         * attribute.cs: Fix bug #55970
10028
10029 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10030
10031         Fix bug #52705
10032         * attribute.cs
10033         (GetObsoleteAttribute): New method. Creates the instance of
10034         ObsoleteAttribute.
10035         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10036         ObsoleteAttribute when member is obsolete.
10037         (AttributeTester.Report_ObsoleteMessage): Common method for
10038         Obsolete error/warning reporting.
10039
10040         * class.cs
10041         (TypeContainer.base_classs_type): New member for storing parent type.
10042
10043         * decl.cs
10044         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10045         for this MemberCore.
10046
10047 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10048
10049         * attribute.cs, const.cs: Fix bug #58590
10050
10051 2004-05-21  Martin Baulig  <martin@ximian.com>
10052
10053         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10054         out parameters if the end of the method is unreachable.  Fixes
10055         #58098. 
10056
10057 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10058
10059         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10060         Hari was right, why extra method.
10061
10062 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10063
10064         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10065
10066 2004-05-20  Martin Baulig  <martin@ximian.com>
10067
10068         * delegate.cs: Convert this file to Unix mode - like the original
10069         version in mcs is.
10070
10071 2004-05-20  Martin Baulig  <martin@ximian.com>
10072
10073         * attribute.cs: Convert this file to Unix mode - like the original
10074         version in mcs is.
10075
10076 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10077
10078        Fix bug #58688 (MCS does not report error when the same attribute
10079        is assigned twice)
10080
10081        * attribute.cs (Attribute.Emit): Distinction between null and default.
10082
10083 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10084
10085        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10086        of a top-level attribute without an attribute target.
10087        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10088        Make non-static.
10089        (Attribute.Conditional_GetConditionName), 
10090        (Attribute.Obsolete_GetObsoleteMessage): Update.
10091        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10092        part of ScanForIndexerName.
10093        (Attribute.CanIgnoreInvalidAttribute): New function.
10094        (Attribute.ScanForIndexerName): Move to ...
10095        (Attributes.ScanForIndexerName): ... here.
10096        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10097        (Attributes.Search): New internal variant that can choose not to
10098        complain if types aren't resolved.  The original signature now
10099        complains.
10100        (Attributes.GetClsCompliantAttribute): Use internal variant, with
10101        complaints suppressed.
10102        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10103        only if it not useful.
10104        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10105        top-level for attributes that are shared between the assembly
10106        and a top-level class.
10107        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10108        * class.cs: Update to reflect changes.
10109        (DefineIndexers): Fuse loops.
10110        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10111        a couple more variants of attribute names.
10112
10113 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10114
10115         Fix bug #52585 (Implemented explicit attribute declaration)
10116
10117         * attribute.cs:
10118         (Attributable.ValidAttributeTargets): New abstract method. It gets
10119         list of valid attribute targets for explicit target declaration.
10120         (Attribute.Target): It holds target itself.
10121         (AttributeSection): Removed.
10122         (Attribute.CheckTargets): New method. It checks whether attribute
10123         target is valid for the current element.
10124
10125         * class.cs:
10126         (EventProperty): New class. For events that are declared like
10127         property (with add and remove accessors).
10128         (EventField): New class. For events that are declared like field.
10129         class.cs
10130
10131         * cs-parser.jay: Implemented explicit attribute target declaration.
10132
10133         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10134         Override ValidAttributeTargets.
10135
10136         * parameter.cs:
10137         (ReturnParameter): Class for applying custom attributes on 
10138         the return type.
10139         (ParameterAtribute): New class. Class for applying custom
10140         attributes on the parameter type.
10141
10142 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10143
10144         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10145         definitions. 
10146
10147         (Method): Allow UNSAFE here.
10148
10149         * modifiers.cs: Support unsafe reporting.
10150
10151 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10152
10153         * decl.cs: Fix bug #58478.
10154
10155 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10156
10157         * statement.cs: When checking for unreachable code on an EmptyStatement,
10158         set the location. Fixes bug #58488.
10159
10160 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10161
10162         * driver.cs: Add -pkg handling.
10163
10164         From Gonzalo: UseShelLExecute=false
10165
10166 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10167
10168         * attribute.cs:
10169         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10170         for attribute.
10171         (Attribute.IsClsCompliaceRequired): Moved to base for better
10172         accesibility.
10173         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10174         when attribute is AttributeUsageAttribute.
10175         (Attribute.GetValidTargets): Simplified.
10176         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10177         attribute for this type.
10178         (Attribute.ApplyAttributes): Method renamed to Emit and make
10179         non-static.
10180         (GlobalAttributeSection): New class for special handling of global
10181         attributes (assembly, module).
10182         (AttributeSection.Emit): New method.
10183
10184         * class.cs: Implemented Attributable abstract methods.
10185         (MethodCore.LabelParameters): Moved to Parameter class.
10186         (Accessor): Is back simple class.
10187         (PropertyMethod): Implemented Attributable abstract class.
10188         (DelegateMethod): Implemented Attributable abstract class.
10189         (Event): New constructor for disctintion between normal Event
10190         and Event with accessors.
10191
10192         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10193
10194         * codegen.cs, const.cs, decl.cs, delegate.cs:
10195         (CommonAssemblyModulClass): Implemented Attributable abstract class
10196         and simplified.
10197
10198         * enum.cs: Implement IAttributeSupport interface.
10199         (EnumMember): New class for emum members. Implemented Attributable
10200         abstract class
10201
10202         * parameter.cs:
10203         (ParameterBase): Is abstract.
10204         (ReturnParameter): New class for easier [return:] attribute handling.
10205
10206         * typemanager.cs: Removed builder_to_attr.
10207
10208 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10209
10210         Fix bug #57151.
10211         * attribute.cs (Attribute.GetPositionalValue): New function.
10212         * class.cs (TypeContainer.VerifyMembers): New function.
10213         (TypeContainer.Emit): Use it.
10214         (ClassOrStruct): New base class for Class and Struct.
10215         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10216         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10217         class.
10218         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10219         then each non-static field should have a FieldOffset attribute.
10220         Otherwise, none of the fields should have a FieldOffset attribute.
10221         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10222         and FieldOffset attributes.
10223         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10224         (TypeManager.field_offset_attribute_type): New core types.
10225         (TypeManager.InitCoreTypes): Initialize them.
10226
10227 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10228
10229         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10230         Return correct type.
10231         From bug #58270.
10232
10233 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10234
10235         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10236         be implicitly converted to ulong.
10237         
10238         * expression.cs: The logic for allowing operator &, | and ^ worked
10239         was wrong, it worked before because we did not report an error in
10240         an else branch.  Fixes 57895.
10241
10242         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10243         allow volatile fields to be reference types.
10244
10245 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10246
10247         * driver.cs: Add support for /debug-
10248
10249 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10250
10251         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10252         Add a 'complain' parameter to silence errors.
10253         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10254         silently overlooked type-resolutions.
10255         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10256         to reflect changes.
10257         (Attributes.Search): New function.
10258         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10259         (Attributes.GetAttributeFullName): Remove hack.
10260         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10261         Update to reflect changes.
10262         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10263         Use Attributes.Search instead of nested loops.
10264
10265 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10266
10267         * decl.cs:
10268         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10269         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10270         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10271
10272         * report.cs: (Report.Warning): Renamed to Warning_T because of
10273         parameter collision.
10274
10275 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10276
10277         * expression.cs (MemberAccess.ResolveMemberAccess):
10278         Exit with non-zero status after Report.Error.
10279         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10280         Likewise.
10281         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10282
10283 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10284
10285         * support.cs: Don't hang when the file is empty.
10286
10287 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10288
10289         * support.cs: In SeekableStreamReader, compute the preamble size of the
10290           underlying stream. Position changes should take into account that initial
10291           count of bytes.
10292
10293 2004-05-03  Todd Berman  <tberman@sevenl.net>
10294
10295         * driver.cs: remove unused GetSysVersion function.
10296
10297 2004-05-03  Todd Berman  <tberman@sevenl.net>
10298
10299         * driver.cs: Remove the hack from saturday, as well as the hack
10300         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10301         link_paths to get that bit proper.
10302
10303 2004-05-01  Todd Berman  <tberman@sevenl.net>
10304
10305         * driver.cs: Try a LoadFrom before a Load, this checks the current
10306         path. This is currently a bug in mono that is be fixed, however, this
10307         provides a workaround for now. This will be removed when the bug
10308         is fixed.
10309
10310 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10311
10312         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10313         incomplete key pairs (#57941).
10314
10315 2004-05-01  Todd Berman  <tberman@sevenl.net>
10316
10317         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10318         from the GAC
10319
10320 2004-04-30  Jackson Harper  <jackson@ximian.com>
10321
10322         * codegen.cs: Open keys readonly.
10323         
10324 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10325
10326         * typemanager.cs: don't report cyclic struct layout when a struct
10327         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10328         which has 2 Pango.Rectangle fields.
10329
10330 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10331
10332         * expression.cs: Handle IntPtr comparisons with IL code
10333         rather than a method call.
10334
10335 2004-04-29  Martin Baulig  <martin@ximian.com>
10336
10337         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10338         the list of PropertyInfo's in class hierarchy and find the
10339         accessor.  Fixes #56013.
10340
10341 2004-04-29  Martin Baulig  <martin@ximian.com>
10342
10343         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10344
10345 2004-04-29  Martin Baulig  <martin@ximian.com>
10346
10347         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10348
10349         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10350
10351 2004-04-29  Martin Baulig  <martin@ximian.com>
10352
10353         * class.cs (ConstructorInitializer.Resolve): Check whether the
10354         parent .ctor is accessible.  Fixes #52146.
10355
10356 2004-04-29  Martin Baulig  <martin@ximian.com>
10357
10358         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10359
10360         * statement.cs (Using.EmitLocalVariableDecls): Use
10361         TypeManager.idisposable_type, not typeof (IDisposable).
10362         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10363
10364 2004-04-29  Martin Baulig  <martin@ximian.com>
10365
10366         * class.cs (Event.Define): Don't emit the field and don't set
10367         RTSpecialName and SpecialName for events on interfaces.  Fixes
10368         #57703. 
10369
10370 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10371
10372         Refactor Attribute.ApplyAttributes.
10373         * attribute.cs (Attributable): New base class for objects that can
10374         have Attributes applied on them.
10375         (Attribute): Make AttributeUsage fields public.
10376         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10377         (Attribute.IsInternalCall): New property.
10378         (Attribute.UsageAttr): Convert to a public read-only property.
10379         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10380         (Attribute.ResolveType, Attribute.Resolve)
10381         (Attribute.ScanForIndexerName): Update to reflect changes.
10382         (Attribute.CheckAttributeTarget): Re-format.
10383         (Attribute.ApplyAttributes): Refactor, to various
10384         Attributable.ApplyAttributeBuilder methods.
10385         * decl.cs (MemberCore): Make Attributable.
10386         * class.cs (Accessor): Make Attributable.
10387         (MethodData.ApplyAttributes): Use proper attribute types, not
10388         attribute names.
10389         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10390         (TypeContainer.ApplyAttributeBuilder)
10391         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10392         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10393         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10394         (Operator.ApplyAttributeBuilder): New factored-out methods.
10395         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10396         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10397         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10398         * parameter.cs (ParameterBase): New Attributable base class
10399         that can also represent Return types.
10400         (Parameter): Update to the changes.
10401
10402 2004-04-29  Jackson Harper  <jackson@ximian.com>
10403
10404         * driver.cs: Prefer the corlib system version when looking for
10405         assemblies in the GAC. This is still a hack, but its a better hack
10406         now.
10407         
10408 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10409
10410         * decl.cs, enum.cs: Improved error 3005 reporting.
10411   
10412         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10413         (related_symbols): New private member for list of symbols
10414         related to reported error/warning.
10415         
10416         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10417
10418 2004-04-29  Martin Baulig  <martin@ximian.com>
10419
10420         * ecore.cs (Expression.Constantify): If we're an enum and
10421         TypeManager.TypeToCoreType() doesn't give us another type, use
10422         t.UnderlyingSystemType.  Fixes #56178.  
10423
10424 2004-04-29  Martin Baulig  <martin@ximian.com>
10425
10426         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10427         interfaces and for each interface, only add members directly
10428         declared in that interface.  Fixes #53255.
10429
10430 2004-04-28  Martin Baulig  <martin@ximian.com>
10431
10432         * expression.cs (ConditionalLogicalOperator): Use a temporary
10433         variable for `left' to avoid that we evaluate it more than once;
10434         bug #52588.
10435
10436 2004-04-28  Martin Baulig  <martin@ximian.com>
10437
10438         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10439         `void[]' (CS1547).
10440
10441 2004-04-28  Martin Baulig  <martin@ximian.com>
10442
10443         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10444         void (CS1547).
10445
10446         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10447         whether the type is not void (CS1547).
10448
10449 2004-04-28  Martin Baulig  <martin@ximian.com>
10450
10451         * expression.cs (Unary.DoResolveLValue): Override this and report
10452         CS0131 for anything but Operator.Indirection.
10453
10454 2004-04-28  Martin Baulig  <martin@ximian.com>
10455
10456         Committing a patch from Ben Maurer; see bug #50820.
10457
10458         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10459         check for classes.
10460
10461         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10462         classes.        
10463
10464 2004-04-28  Martin Baulig  <martin@ximian.com>
10465
10466         Committing a patch from Ben Maurer; see bug #50820.
10467
10468         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10469         check for classes.
10470
10471         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10472         classes.        
10473
10474 2004-04-28  Martin Baulig  <martin@ximian.com>
10475
10476         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10477         (Block.AddLabel): Call DoLookupLabel() to only search in the
10478         current block.
10479
10480 2004-04-28  Martin Baulig  <martin@ximian.com>
10481
10482         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10483         comparing StringConstants and NullLiterals in Equality and Inequality.
10484
10485 2004-04-28  Jackson Harper  <jackson@ximian.com>
10486
10487         * driver.cs: Attempt to load referenced assemblies from the
10488         GAC. This is the quick and dirty version of this method that
10489         doesnt take into account versions and just takes the first
10490         canidate found. Will be good enough for now as we will not have more
10491         then one version installed into the GAC until I update this method.
10492
10493 2004-04-28  Martin Baulig  <martin@ximian.com>
10494
10495         * typemanager.cs (TypeManager.CheckStructCycles): New public
10496         static method to check for cycles in the struct layout.
10497
10498         * rootcontext.cs (RootContext.PopulateTypes): Call
10499         TypeManager.CheckStructCycles() for each TypeContainer.
10500         [Note: We only need to visit each type once.]
10501
10502 2004-04-28  Martin Baulig  <martin@ximian.com>
10503
10504         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10505
10506         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10507         success and added `out object value'.  Use a `bool resolved' field
10508         to check whether we've already been called rather than
10509         `ConstantValue != null' since this breaks for NullLiterals.
10510
10511 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10512
10513         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10514         setting of this flag, since the 'set' method may be non-public.
10515
10516 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10517
10518         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10519         check on current_vector.Block.
10520
10521 2004-04-27  Martin Baulig  <martin@ximian.com>
10522
10523         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10524         a field initializer.  Fixes #56459.
10525
10526 2004-04-27  Martin Baulig  <martin@ximian.com>
10527
10528         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10529         we're not attempting to use an indexer.  Fixes #52154.
10530
10531 2004-04-27  Martin Baulig  <martin@ximian.com>
10532
10533         * statement.cs (Return): Don't create a return label if we don't
10534         need it; reverts my change from January 20th.  Thanks to Ben
10535         Maurer for this.
10536
10537 2004-04-27  Martin Baulig  <martin@ximian.com>
10538
10539         According to the spec, `goto' can only leave a nested scope, but
10540         never enter it.
10541
10542         * statement.cs (Block.LookupLabel): Only lookup in the current
10543         block, don't recurse into parent or child blocks.
10544         (Block.AddLabel): Check in parent and child blocks, report
10545         CS0140/CS0158 if we find a duplicate.
10546         (Block): Removed this indexer for label lookups.
10547         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10548         this already does the error reporting for us.
10549
10550         * flowanalysis.cs
10551         (FlowBranching.UsageVector.Block): New public variable; may be null.
10552         (FlowBranching.CreateSibling): Added `Block' argument.
10553         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10554         label for the target of a `goto' and check whether we're not
10555         leaving a `finally'.
10556
10557 2004-04-27  Martin Baulig  <martin@ximian.com>
10558
10559         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10560         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10561         just for returns).
10562
10563 2004-04-27  Martin Baulig  <martin@ximian.com>
10564
10565         * statement.cs (Block.AddLabel): Also check for implicit blocks
10566         and added a CS0158 check.
10567
10568 2004-04-27  Martin Baulig  <martin@ximian.com>
10569
10570         * flowanalysis.cs (FlowBranchingLoop): New class.
10571         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10572         UsageVector's instead of an ArrayList.
10573         (FlowBranching.Label): Likewise.
10574         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10575         (FlowBranching.AddBreakVector): New method.
10576
10577 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10578
10579         * attribute.cs: Small regression fix: only convert the type if we
10580         the type is different, fixes System.Drawing build.
10581
10582 2004-04-27  Martin Baulig  <martin@ximian.com>
10583
10584         * attribute.cs (Attribute.Resolve): If we have a constant value
10585         for a named field or property, implicity convert it to the correct
10586         type.
10587
10588 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10589
10590         * statement.cs (Block.Block): Implicit blocks share
10591         'child_variable_names' fields with parent blocks.
10592         (Block.AddChildVariableNames): Remove.
10593         (Block.AddVariable): Mark variable as "used by a child block" in
10594         every surrounding block.
10595         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10596         been used in a child block, complain about violation of "Invariant
10597         meaning in blocks" rule.
10598         * cs-parser.jay (declare_local_variables): Don't use
10599         AddChildVariableNames.
10600         (foreach_statement): Don't create an implicit block: 'foreach'
10601         introduces a scope.
10602
10603 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10604
10605         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10606         converting from 0L to ulong.  Fixes 57522.
10607
10608 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10609
10610         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10611         derived class hides via 'new' keyword field from base class (test-242.cs).
10612         TODO: Handle this in the more general way.
10613         
10614         * class.cs (CheckBase): Ditto.
10615
10616 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10617
10618         * decl.cs (caching_flags): New member for storing cached values
10619         as bit flags.
10620         (MemberCore.Flags): New enum where bit flags for caching_flags
10621         are defined.
10622         (MemberCore.cls_compliance): Moved to caching_flags.
10623         (DeclSpace.Created): Moved to caching_flags.
10624
10625         * class.cs: Use caching_flags instead of DeclSpace.Created
10626         
10627 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10628
10629         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10630         if we are only a derived class, not a nested class.
10631
10632         * typemanager.cs: Same as above, but do this at the MemberLookup
10633         level (used by field and methods, properties are handled in
10634         PropertyExpr).   Allow for the qualified access if we are a nested
10635         method. 
10636
10637 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10638
10639         * class.cs: Refactoring.
10640         (IMethodData): New inteface; Holds links to parent members
10641         to avoid member duplication (reduced memory allocation).
10642         (Method): Implemented IMethodData interface.
10643         (PropertyBase): New inner classes for get/set methods.
10644         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10645         (Event): New inner classes for add/remove methods.
10646         (Event.DelegateMethod): Implemented IMethodData interface.
10647
10648         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10649         EmitContext (related to class.cs refactoring).
10650
10651 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10652
10653         * delegate.cs (Delegate.VerifyApplicability): If the number of
10654         arguments are the same as the number of parameters, first try to
10655         verify applicability ignoring  any 'params' modifier on the last
10656         parameter.
10657         Fixes #56442.
10658
10659 2004-04-08  Martin Baulig  <martin@ximian.com>
10660
10661         Merged latest changes into gmcs.  Please keep this comment in
10662         here, it makes it easier for me to see what changed in MCS since
10663         the last time I merged.
10664
10665 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10666
10667         * class.cs (TypeContainer.AddIndexer): Use
10668         'ExplicitInterfaceName' to determine if interface name was
10669         explicitly specified.  'InterfaceType' is not initialized at this time.
10670         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10671         Indexers array is already in the required order.  Initialize
10672         'IndexerName' only if there are normal indexers.
10673         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10674         (TypeContainer.Emit): Emit DefaultMember attribute only if
10675         IndexerName is initialized.
10676         Fixes #56300.
10677
10678 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10679
10680         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10681         Fixes #57007
10682
10683 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10684
10685         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10686         attributes.
10687         Fix for #56456.
10688
10689         * attribute.cs (Attribute.Resolve): Check for duplicate named
10690         attributes.
10691         Fix for #56463.
10692
10693 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10694
10695         * iterators.cs (MarkYield): track whether we are in an exception,
10696         and generate code accordingly.  Use a temporary value to store the
10697         result for our state.
10698
10699         I had ignored a bit the interaction of try/catch with iterators
10700         since their behavior was not entirely obvious, but now it is
10701         possible to verify that our behavior is the same as MS .NET 2.0
10702
10703         Fixes 54814
10704
10705 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10706
10707         * iterators.cs: Avoid creating temporaries if there is no work to
10708         do. 
10709
10710         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10711         Enumerations, use TypeManager.EnumToUnderlying and call
10712         recursively. 
10713
10714         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10715         bug #57013
10716
10717         (This.Emit): Use EmitContext.EmitThis to emit our
10718         instance variable.
10719
10720         (This.EmitAssign): Ditto.
10721
10722         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10723         codepaths, we will move all the functionality into
10724         Mono.CSharp.This 
10725
10726         (FieldExpr.EmitAssign): Ditto.
10727
10728         This fixes several hidden bugs that I uncovered while doing a code
10729         review of this today.
10730
10731         * codegen.cs (EmitThis): reworked so the semantics are more clear
10732         and also support value types "this" instances.
10733
10734         * iterators.cs: Changed so that for iterators in value types, we
10735         do not pass the value type as a parameter.  
10736
10737         Initialization of the enumerator helpers is now done in the caller
10738         instead of passing the parameters to the constructors and having
10739         the constructor set the fields.
10740
10741         The fields have now `assembly' visibility instead of private.
10742
10743 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10744
10745         * expression.cs (Argument.Resolve): Check if fields passed as ref
10746         or out are contained in a MarshalByRefObject.
10747
10748         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10749         another compiler type.
10750
10751 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10752
10753         * class.cs (Indexer.Define): use the new name checking method.
10754         Also, return false on an error.
10755         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10756         (is_identifier_[start/part]_character): make static.
10757
10758 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10759
10760         * expression.cs (Binary.ResolveOperator): Do no append strings
10761         twice: since we can be invoked more than once (array evaluation)
10762         on the same concatenation, take care of this here.  Based on a fix
10763         from Ben (bug #56454)
10764
10765 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10766
10767         * codegen.cs: Fix another case where CS1548 must be reported (when 
10768         delay-sign isn't specified and no private is available #56564). Fix
10769         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10770         error when MCS is used on the MS runtime and we need to delay-sign 
10771         (which seems unsupported by AssemblyBuilder - see #56621).
10772
10773 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10774
10775         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10776         (TypeManager.ComputeNamespaces): Faster implementation for
10777         Microsoft runtime.
10778
10779         * compiler.csproj: Updated AssemblyName to mcs.
10780
10781 2004-05-11  Jackson Harper  <jackson@ximian.com>
10782
10783         * Makefile: Preserve MONO_PATH
10784         
10785 2004-05-11  Jackson Harper  <jackson@ximian.com>
10786
10787         * Makefile: Use mono and mcs to build gmcs
10788         
10789 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10790
10791         * codegen.cs: Add patch from Robert Shade
10792         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10793         sync with mcs.
10794
10795 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10796
10797         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10798         incomplete key pairs (#57941).
10799
10800 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10801
10802         * codegen.cs: Fix another case where CS1548 must be reported (when 
10803         delay-sign isn't specified and no private is available #56564). Fix
10804         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10805         error when MCS is used on the MS runtime and we need to delay-sign 
10806         (which seems unsupported by AssemblyBuilder - see #56621).
10807
10808 2004-04-29  Jackson Harper  <jackson@ximian.com>
10809
10810         * Makefile: Set MONO_PATH to use the bootstrap corlib
10811         * driver.cs: Check the GAC for referenced assemblies.
10812                 
10813 2004-04-29  Martin Baulig  <martin@ximian.com>
10814
10815         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10816
10817 2004-04-07  Martin Baulig  <martin@ximian.com>
10818
10819         * expression.cs (Binary.ResolveOperator): Added special case for
10820         Equality/Inequality between a type parameter and a null literal.
10821
10822 2004-04-07  Martin Baulig  <martin@ximian.com>
10823
10824         * convert.cs: Check null literal -> type parameter conversions.
10825
10826 2004-04-07  Martin Baulig  <martin@ximian.com>
10827
10828         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10829         `class' and `struct' constraints.
10830
10831 2004-04-07  Martin Baulig  <martin@ximian.com>
10832
10833         * generic.cs (SpecialConstraint): New public enum.
10834         (Constraints.Resolve): Added support for the `class' and `struct'
10835         constraints.
10836
10837         * cs-parser.jay (type_parameter_constraint): Added support for the
10838         `class' and `struct' constraints.
10839
10840 2004-04-07  Martin Baulig  <martin@ximian.com>
10841
10842         * support.cs (GenericConstraints): Replaced `Types' by
10843         `ClassConstraint' and `InterfaceConstraints'; added
10844         `HasClassConstraint'.   
10845
10846 2004-04-07  Martin Baulig  <martin@ximian.com>
10847
10848         * generic.cs
10849         (Constraints.InterfaceConstraints): New public property.
10850         (Constraints.Types): Make this property public
10851         (TypeParameter): Implement IMemberContainer.
10852         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10853         instead of a TypeBuilder/MethodBuilder; pass the interface
10854         constraints to TypeManager.AddTypeParameter().
10855         (TypeParameter.DefineType): Just take an EmitContext and no
10856         TypeBuilder/MethodBuilder.  Use the new public API.
10857
10858         * typemanager.cs (TypeManager.AddTypeParameter): Added
10859         `TypeExpr[]' argument; add the interfaces to the
10860         `builder_to_ifaces' hash.
10861         (TypeManager.LookupMemberContainer): For
10862         GenericTypeParameterBuilders, get the TypeParameter from the
10863         `builder_to_type_param'.
10864         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10865         the TypeParameter and call FindMembers on it.
10866
10867 2004-04-07  Martin Baulig  <martin@ximian.com>
10868
10869         * class.cs
10870         (MethodCore.GenericMethod): Moved this field here from Method.
10871         (MethodCore.IsDuplicateImplementation): Take the number of type
10872         parameters into account if we're a generic method.
10873
10874         * expression.cs (Invocation.InferTypeArguments): Don't return true
10875         if `arguments' is null; we still need to check whether we actually
10876         don't need to infer anything in this case.
10877         (MemberAccess): Merged the functionality from GenericMemberAccess
10878         into this class.
10879
10880         * generic.cs (GenericMemberAccess): Removed.
10881
10882 2004-04-05  Martin Baulig  <martin@ximian.com>
10883
10884         * decl.cs (MemberCore): For generic classes, interfaces and
10885         structs, `Name' now includes the number of type parameters
10886         ("Stack!1.Node!1").
10887         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10888         encode the number of type arguments in the type name.
10889
10890         * expression.cs (Expression.MemberLookup): Removed the
10891         `num_type_args' argument; we now encode the number of type
10892         arguments in the type name.
10893
10894         * ecore.cs (SimpleName): Encode the number of type arguments in
10895         the type name itself.
10896
10897         * generic.cs (ConstructedType): Likewise.
10898
10899         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10900         `MemberName'; we now include the number of type parameters in the
10901         type name.
10902
10903         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10904         (TypeManager.MemberLookup): Removed the
10905         `num_type_args' argument; we now encode the number of type
10906         arguments in the type name.     
10907
10908 2004-04-03  Martin Baulig  <martin@ximian.com>
10909
10910         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10911         (MemberCore.MemberName): Moved here from MemberBase.
10912         (DeclSpace.SetParameterInfo): Just take the constraints as an
10913         ArrayList; we already have the type parameters in our
10914         `MemberName'; also do the CS0080 reporting here.
10915
10916         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10917         `IDENTIFIER opt_type_parameter_list'; when constructing our
10918         `MemberName', it'll already include our type parameters.
10919         (class_declaration, interface_declaration): Likewise.
10920         (delegate_declaration): Likewise.
10921         (MakeName): Take a MemberName and return a MemberName.
10922         The following two changes are required to avoid shift/reduce conflicts:
10923         (member_name): Don't include a TypeName anymore; ie. this is now
10924         just 'IDENTIFIER opt_type_parameter_list'.
10925         (property_declaration, event_declaration): Use a
10926         `namespace_or_type_name' instead of a `member_name'.            
10927
10928 2004-04-03  Martin Baulig  <martin@ximian.com>
10929
10930         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10931         `MemberName' class.
10932         (TypeName): Formerly known as MemberName.
10933
10934         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10935         instead of a `MemberName'.
10936
10937         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10938         (member_name): New rule; create a MemberName.
10939
10940 2004-04-02  Martin Baulig  <martin@ximian.com>
10941
10942         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10943         (CS0305 and CS0308).
10944
10945 2004-04-02  Martin Baulig  <martin@ximian.com>
10946
10947         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10948         support for nested types.
10949
10950 2004-04-02  Martin Baulig  <martin@ximian.com>
10951
10952         * ecore.cs (IAlias): New public interface.
10953         (TypeExpr, TypeExpression): Implement IAlias.
10954         (TypeAliasExpression): New public class.
10955
10956         * namespace.cs (Namespace): Implement IAlias.
10957         (Namespace.Lookup): Return an IAlias instead on an object.
10958         (Namespace.DefineName): Take an IAlias instead of an object.
10959         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10960         an object.
10961         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10962         Expression.
10963         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10964         object.
10965         (NamespaceEntry.Lookup): Likewise.
10966
10967         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10968         instead of a Type.      
10969
10970         * decl.cs (DeclSpace): Implement IAlias.
10971         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10972
10973         * generic.cs (ConstructedType): Improved error checking.
10974
10975 2004-04-02  Martin Baulig  <martin@ximian.com>
10976
10977         * convert.cs: Added type parameter conversions.
10978
10979         * ecore.cs
10980         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10981         (ClassCast.Emit): If the source type is a type parameter, box it.
10982         If the target type is a type parameter, emit an `unbox.any'
10983         instead of a `classcast'.1      
10984
10985 2004-04-01  Martin Baulig  <martin@ximian.com>
10986
10987         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10988
10989 2004-04-01  Martin Baulig  <martin@ximian.com>
10990
10991         * generic.cs (ConstructedType.CheckConstraints): Use
10992         Convert.ImplicitStandardConversionExists(); user-defined implicit
10993         conversions are not allowed according to the spec.
10994
10995 2004-03-30  Martin Baulig  <martin@ximian.com>
10996
10997         * expression.cs (New): Added support for type parameters.
10998
10999         * typemanager.cs
11000         (TypeManager.activator_type): New public static field.
11001         (TypeManager.activator_create_instance): Likewise.
11002
11003 2004-03-30  Martin Baulig  <martin@ximian.com>
11004
11005         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11006         public method.
11007
11008 2004-03-30  Martin Baulig  <martin@ximian.com>
11009
11010         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11011         the spec here: the argument type must be convertible to the
11012         constraints.
11013
11014 2004-03-30  Martin Baulig  <martin@ximian.com>
11015
11016         * generic.cs
11017         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11018         TypeManager.AddTypeParameter().
11019         (ConstructedType.CheckConstraints): Re-enable this and actually
11020         check whether we have a constructor constraint.
11021
11022         * typemanager.cs
11023         (TypeManager.builder_to_type_param): New static field.
11024         (TypeManager.AddTypeParameter): New static method.
11025         (TypeManager.LookupTypeParameter): New public method.
11026
11027 2004-03-30  Martin Baulig  <martin@ximian.com>
11028
11029         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11030         the new API to actually define the constructor constraint.
11031
11032         * typemanager.cs
11033         (TypeManager.new_constraint_attr_type): New static field.
11034         (TypeManager.InitCoreTypes): Initialize it.
11035
11036 2004-03-30  Martin Baulig  <martin@ximian.com>
11037
11038         * generic.cs (Constraints): Completed error checking, use correct
11039         error numbers.
11040
11041 2004-03-29  Martin Baulig  <martin@ximian.com>
11042
11043         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11044
11045         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11046         public version which takes a `ParameterData pd' instead of an
11047         `ArrayList args'.
11048
11049 2004-03-29  Martin Baulig  <martin@ximian.com>
11050
11051         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11052         not a MethodInfo.       
11053
11054 2004-03-29  Martin Baulig  <martin@ximian.com>
11055
11056         * expression.cs (Argument.ResolveMethodGroup): If we're a
11057         ConstructedType, call GetMemberAccess() on it.  
11058
11059 2004-03-29  Martin Baulig  <martin@ximian.com>
11060
11061         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11062         (MethodCore.CheckGenericOverride): When overriding a generic
11063         method, check whether the constraints match.
11064
11065         * support.cs (GenericConstraints): New public interface.
11066         (ParameterData.GenericConstraints): New public method.
11067
11068         * parameter.cs (Parameter.Resolve): Check whether we're a generic
11069         method parameter and compute our constraints if appropriate.
11070         (Parameter.GenericConstraints): New public property.
11071
11072         * generic.cs (Constraints): Implement GenericConstraints.
11073
11074 2004-03-29  Martin Baulig  <martin@ximian.com>
11075
11076         * decl.cs (MemberCache.FindMemberToOverride): Use
11077         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11078
11079 2004-03-29  Martin Baulig  <martin@ximian.com>
11080
11081         * generic.cs (GenericMethod.Define): Resolve our type parameters.
11082
11083 2004-03-29  Martin Baulig  <martin@ximian.com>
11084
11085         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11086         not allowed on non-generic declarations").
11087
11088 2004-03-29  Martin Baulig  <martin@ximian.com>
11089
11090         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11091         public version of this method.
11092
11093         * class.cs (MethodCore.IsDuplicateImplementation): Use
11094         Invocation.InferTypeArguments() to check this.
11095
11096 2004-03-29  Martin Baulig  <martin@ximian.com>
11097
11098         * convert.cs: Use TypeManager.IsDelegateType() instead of
11099         comparing types correctly.
11100
11101 2004-03-29  Martin Baulig  <martin@ximian.com>
11102
11103         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11104         types directly to make it work for generic instances.
11105
11106         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11107
11108 2004-03-29  Martin Baulig  <martin@ximian.com>
11109
11110         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11111         support for arrays.     
11112
11113 2004-03-24  Martin Baulig  <martin@ximian.com>
11114
11115         * decl.cs (DeclSpace.FindType): Also use
11116         TypeManager.CheckGeneric() for types from the using clauses.
11117
11118 2004-03-23  Martin Baulig  <martin@ximian.com>
11119
11120         * expression.cs (Invocation.OverloadResolve): Added `bool
11121         may_fail' argument and use it instead of the Location.IsNull() hack.
11122
11123 2004-03-23  Martin Baulig  <martin@ximian.com>
11124
11125         * expression.cs (Invocation.InferType): Use correct type inference
11126         rules here.     
11127
11128 2004-03-23  Martin Baulig  <martin@ximian.com>
11129
11130         * ecore.cs (MethodGroupExpr.Name): Use
11131         TypeManager.CSharpSignature() instead of just the name.
11132
11133         * expression.cs (Invocation.OverloadResolve): Provide better error
11134         reporting.
11135         (Invocation.DoResolve): OverloadResolve() never returns null
11136         without reporting an error, so removed the error -6 reporting here.
11137
11138 2004-03-23  Martin Baulig  <martin@ximian.com>
11139
11140         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11141         generic methods.
11142
11143         * cs-parser.jay (delegate_declaration): Support generic delegates.
11144
11145         * delegate.cs: Support generic delegates.
11146
11147 2004-03-22  Martin Baulig  <martin@ximian.com>
11148
11149         * expression.cs (Invocation.InferParamsTypeArguments): New static
11150         method; does type inference for params arguments.
11151
11152 2004-03-21  Martin Baulig  <martin@ximian.com>
11153
11154         * typemanager.cs (TypeManager.IsGenericMethod): New public static
11155         method; checks whether a method is a generic method.    
11156
11157         * expression.cs (Invocation.InferTypeArguments): New static method;
11158         infer type arguments for generic method invocation.
11159
11160         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11161         property; we set this to true if we're resolving a generic method
11162         invocation and the user specified type arguments, ie. we're not
11163         doing type inference.
11164
11165 2004-03-20  Martin Baulig  <martin@ximian.com>
11166
11167         * class.cs (MethodData.DeclaringType): New public property.
11168         (MethodData.Define): Set DeclaringType here.
11169         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11170         instead of OperatorMethodBuilder.DeclaringType.
11171
11172 2004-03-20  Martin Baulig  <martin@ximian.com>
11173
11174         * cs-tokenizer.cs (xtoken): Return a special
11175         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11176
11177         * cs-parser.jay (default_value_expression): Switch to the new
11178         syntax (14.5.13).
11179
11180 2004-03-19  Martin Baulig  <martin@ximian.com>
11181
11182         * decl.cs (MemberName): New class.  We use this to "construct"
11183         namespace_or_type_name's.
11184
11185         * generics.cs (TypeArguments.GetDeclarations): New public method;
11186         returns the type arguments as a string[] and reports a CS0081 if
11187         one of them is not an identifier.
11188
11189         * class.cs (MemberBase): The .ctor now takes the name as a
11190         MemberName instead of a string.
11191         (MemberBase.ExplicitInterfaceName): Changed type from string to
11192         Expression.
11193         (MemberBase.DoDefine): If we're an explicit implementation, the
11194         InterfaceType may be a generic instance.
11195
11196         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11197         (namespace_name): Call MemberName.GetName () to transform the
11198         MemberName into a string and ensure we don't have any type
11199         arguments.
11200         (type_name): Call MemberName.GetTypeExpression() to transfrom the
11201         MemberName into an expression.
11202         (method_header): Use namespace_or_type_name instead of member_name.     
11203
11204 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11205
11206         * rootcontext.cs: Add new types to the boot resolution.
11207
11208         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11209         MulticastDelegate is not allowed.
11210
11211         * typemanager.cs: Add new types to lookup: System.TypedReference
11212         and ArgIterator.
11213
11214         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11215         check for TypedReference or ArgIterator, they are not allowed. 
11216
11217         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11218         makes us properly catch 1510 in some conditions (see bug 56016 for
11219         details). 
11220
11221 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11222
11223         * CryptoConvert.cs: update from corlib version
11224         with endian fixes.
11225
11226 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11227
11228         * class.cs (Indexer.Define): Check indexername declaration
11229
11230 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11231
11232         * attribute.cs (IsClsCompliant): Fixed problem with handling
11233         all three states (compliant, not-compliant, undetected).
11234
11235 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11236
11237         * attribute.cs (Attribute): Location is now public.
11238         (Resolve): Store resolved arguments (pos_values) in attribute class.
11239         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11240         (GetClsCompliantAttributeValue): New method that gets
11241         CLSCompliantAttribute value.
11242         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11243         if exists else null.
11244         (AttributeTester): New class for CLS-Compliant verification routines.
11245
11246         * class.cs (Emit): Add CLS-Compliant verification.
11247         (Method.GetSignatureForError): Implemented.
11248         (Constructor.GetSignatureForError): Implemented
11249         (Constructor.HasCompliantArgs): Returns if constructor has
11250         CLS-Compliant arguments.
11251         (Constructor.Emit): Override.
11252         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11253         is needed to test only parameters.
11254         (FieldBase.GetSignatureForError): Implemented.
11255         (TypeContainer): New member for storing base interfaces.
11256         (TypeContainer.FindMembers): Search in base interfaces too.
11257
11258         * codegen.cs (GetClsComplianceAttribute): New method that gets
11259         assembly or module CLSCompliantAttribute value.
11260         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11261         for assembly.
11262         (ModuleClass.Emit): Add error 3012 test.
11263
11264         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11265
11266         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11267         state for all decl types.
11268         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11269         if CLS-Compliant tests are required.
11270         (IsClsCompliaceRequired): New method. Analyze whether code
11271         must be CLS-Compliant.
11272         (IsExposedFromAssembly): New method. Returns true when MemberCore
11273         is exposed from assembly.
11274         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11275         value or gets cached value.
11276         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11277         is explicitly marked with CLSCompliantAttribute.
11278         (IsIdentifierClsCompliant): New abstract method. This method is
11279         used to testing error 3005.
11280         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11281         for identifier and parameters CLS-Compliant testing.
11282         (VerifyClsCompliance): New method. The main virtual method for
11283         CLS-Compliant verifications.
11284         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11285         null. I don't know why is null (too many public members !).
11286         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11287         and get value of first CLSCompliantAttribute that found.
11288
11289         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11290         (VerifyClsCompliance): Override and add extra tests.
11291
11292         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11293         clscheck- disable CLS-Compliant verification event if assembly is has
11294         CLSCompliantAttribute(true).
11295
11296         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11297         ApllyAttribute is now called in emit section as in the other cases.
11298         Possible future Emit integration.
11299         (IsIdentifierClsCompliant): New override.
11300         (VerifyClsCompliance): New override.
11301         (GetEnumeratorName): Returns full enum name.
11302
11303         * parameter.cs (GetSignatureForError): Implemented.
11304
11305         * report.cs (WarningData): New struct for Warning message information.
11306         (LocationOfPreviousError): New method.
11307         (Warning): New method. Reports warning based on the warning table.
11308         (Error_T): New method. Reports error based on the error table.
11309
11310         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11311         verifications are done here.
11312
11313         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11314
11315         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11316         CLSCompliantAttribute.
11317         (all_imported_types): New member holds all imported types from other
11318         assemblies.
11319         (LoadAllImportedTypes): New method fills static table with exported types
11320         from all referenced assemblies.
11321         (Modules): New property returns all assembly modules.
11322
11323 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11324
11325         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11326         throwing a parser error.
11327
11328         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11329         which removes the hardcoded get_/set_ prefixes for properties, as
11330         IL allows for the properties to be named something else.  
11331
11332         Bug #56013
11333
11334         * expression.cs: Do not override operand before we know if it is
11335         non-null.  Fix 56207
11336
11337 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11338
11339         * typemanager.cs: support for pinned variables.
11340
11341 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11342
11343         * decl.cs, typemanager.cs: Avoid using an arraylist
11344         as a buffer if there is only one result set.
11345
11346 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11347
11348         * expression.cs: Make sure you cant call a static method
11349         with an instance expression, bug #56174.
11350
11351 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11352
11353         * class.cs (IsDuplicateImplementation): Improve error reporting to
11354         flag 663 (method only differs in parameter modifier).
11355
11356         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11357         in preprocessor directives.
11358
11359         * location.cs (LookupFile): Allow for the empty path.
11360
11361         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11362         better approach for some of that patch, but its failing with the
11363         CharSet enumeration.  For now try/catch will do.
11364
11365         * typemanager.cs: Do not crash if a struct does not have fields.
11366         Fixes 56150.
11367
11368 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11369
11370         * expression.cs: cs0213, cant fix a fixed expression.
11371         fixes 50231.
11372
11373 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11374
11375         * cs-parser.jay: detect invalid embeded statements gracefully.
11376         bug #51113.
11377
11378 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11379
11380         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11381         As a regex:
11382         s/
11383         the invocation type may not be a subclass of the tye of the item/
11384         The type of the item must be a subclass of the invocation item.
11385         /g
11386
11387         Fixes bug #50820.
11388
11389 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11390
11391         * attribute.cs: Added methods to get a string and a bool from an
11392         attribute. Required to information from AssemblyKeyFileAttribute,
11393         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11394         * codegen.cs: Modified AssemblyName creation to include support for
11395         strongnames. Catch additional exceptions to report them as CS1548.
11396         * compiler.csproj: Updated include CryptoConvert.cs.
11397         * compiler.csproj.user: Removed file - user specific configuration.
11398         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11399         Mono.Security assembly. The original class is maintained and tested in
11400         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11401         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11402         like CSC 8.0 (C# v2) supports.
11403         * Makefile: Added CryptoConvert.cs to mcs sources.
11404         * rootcontext.cs: Added new options for strongnames.
11405
11406 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11407
11408         * driver.cs: For --expect-error, report error code `2'
11409         if the program compiled with no errors, error code `1' if
11410         it compiled with an error other than the one expected.
11411
11412 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11413
11414         * compiler.csproj: Updated for Visual Studio .NET 2003.
11415         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11416         * compiler.sln: Updated for Visual Studio .NET 2003.
11417
11418 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11419
11420         * expression.cs: Fix bug #47234. We basically need to apply the
11421         rule that we prefer the conversion of null to a reference type
11422         when faced with a conversion to 'object' (csc behaviour).
11423
11424 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11425
11426         * statement.cs: Shorter form for foreach, eliminates
11427         a local variable. r=Martin.
11428
11429 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11430
11431         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11432         checks if we can use brtrue/brfalse to test for 0.
11433         * expression.cs: use the above in the test for using brtrue/brfalse.
11434         cleanup code a bit.
11435
11436 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11437
11438         * expression.cs: Rewrite string concat stuff. Benefits:
11439
11440         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11441         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11442         rather than a concat chain.
11443
11444         * typemanager.cs: Add lookups for more concat overloads.
11445
11446 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11447
11448         * expression.cs: Emit shorter il code for array init.
11449
11450         newarr
11451         dup
11452         // set 1
11453
11454         // set 2
11455
11456         newarr
11457         stloc.x
11458
11459         ldloc.x
11460         // set 1
11461
11462         ldloc.x
11463         // set 2
11464
11465 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11466
11467         * statement.cs: Before, two switch blocks would be merged if the
11468         total size of the blocks (end_item - begin_item + 1) was less than
11469         two times the combined sizes of the blocks.
11470
11471         Now, it will only merge if after the merge at least half of the
11472         slots are filled.
11473
11474         fixes 55885.
11475
11476 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11477
11478         * class.cs : csc build fix for GetMethods(). See bug #52503.
11479
11480 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11481
11482         * expression.cs: Make sure fp comparisons work with NaN.
11483         This fixes bug #54303. Mig approved this patch a long
11484         time ago, but we were not able to test b/c the runtime
11485         had a related bug.
11486
11487 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11488
11489         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11490
11491 2004-03-19  Martin Baulig  <martin@ximian.com>
11492
11493         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11494         two overloads may unify for some type parameter substitutions and
11495         report a CS0408 if appropriate.
11496
11497 2004-03-19  Martin Baulig  <martin@ximian.com>
11498
11499         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11500         error here and not in our caller.
11501
11502 2004-03-19  Martin Baulig  <martin@ximian.com>
11503
11504         * interface.cs: Completely killed this file.
11505         (Interface): We're now a TypeContainer and live in class.cs.
11506
11507         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11508         argument; we're now also called for interfaces.
11509         (TypeContainer.DefineMembers): Allow this method being called
11510         multiple times.
11511         (TypeContainer.GetMethods): New public method; formerly known as
11512         Interface.GetMethod().  This is used by PendingImplementation.
11513         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11514         it's now private and non-static.
11515         (Interface): Moved this here; it's now implemented similar to
11516         Class and Struct.
11517         (Method, Property, Event, Indexer): Added `bool is_interface'
11518         argument to their .ctor's.
11519         (MemberBase.IsInterface): New public field.
11520
11521         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11522         instances instead of InterfaceMethod, InterfaceProperty, etc.
11523         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11524         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11525
11526 2004-03-19  Martin Baulig  <martin@ximian.com>
11527
11528         * class.cs (MethodCore.IsDuplicateImplementation): New private
11529         method which does the CS0111 checking.
11530         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11531         Use IsDuplicateImplementation().
11532
11533 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11534
11535         * decl.cs (FindMemberToOverride): New method to find the correct
11536         method or property to override in the base class.
11537         * class.cs
11538             - Make Method/Property use the above method to find the
11539               version in the base class.
11540             - Remove the InheritableMemberSignatureCompare as it is now
11541               dead code.
11542
11543         This patch makes large code bases much faster to compile, as it is
11544         O(n) rather than O(n^2) to do this validation.
11545
11546         Also, it fixes bug 52458 which is that nested classes are not
11547         taken into account when finding the base class member.
11548
11549         Reviewed/Approved by Martin.
11550
11551 2004-03-17  Martin Baulig  <martin@ximian.com>
11552
11553         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11554         of type arguments into account; use the `real_num_type_args'
11555         approach like in DoResolveAsTypeStep().
11556
11557         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11558         nested types.
11559
11560 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11561
11562         * interface.cs: In all interface classes removed redundant
11563         member initialization.
11564
11565 2004-03-16  Martin Baulig  <martin@ximian.com>
11566
11567         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11568
11569 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11570
11571         * decl.cs (DefineTypeAndParents): New helper method to define a
11572         type's containers before the type itself is defined;  This is a
11573         bug exposed by the recent changes to Windows.Forms when an
11574         implemented interface was defined inside a class that had not been
11575         built yet.   
11576
11577         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11578
11579         (Check): Loop correctly to report errors modifiers
11580         (UNSAFE was not in the loop, since it was the same as TOP).
11581
11582         * interface.cs: Every interface member now takes a ModFlags,
11583         instead of a "is_new" bool, which we set on the base MemberCore. 
11584
11585         Every place where we called "UnsafeOk" in the interface, now we
11586         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11587         the unsafe settings from the member declaration instead of the
11588         container interface. 
11589
11590         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11591
11592         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11593         `set_indexer_name' to the pending bits (one per type).
11594
11595         We fixed a bug today that was picking the wrong method to
11596         override, since for properties the existing InterfaceMethod code
11597         basically ignored the method name.  Now we make sure that the
11598         method name is one of the valid indexer names.
11599
11600 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11601  
11602         * support.cs (SeekableStreamReader): Keep track of stream byte
11603         positions and don't mix them with character offsets to the buffer.
11604
11605         Patch from Gustavo Giráldez
11606
11607 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11608
11609         * interface.cs (InterfaceSetGetBase): Removed double member
11610         initialization, base class does it as well.
11611
11612 2004-03-13  Martin Baulig  <martin@ximian.com>
11613
11614         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11615         when compiling corlib.
11616
11617 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11618
11619         * convert.cs (ExplicitConversion): We were reporting an error on
11620         certain conversions (object_type source to a value type, when the
11621         expression was `null') before we had a chance to pass it through
11622         the user defined conversions.
11623
11624         * driver.cs: Replace / and \ in resource specifications to dots.
11625         Fixes 50752
11626
11627         * class.cs: Add check for duplicate operators.  Fixes 52477
11628
11629 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11630
11631         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11632         that are in the middle of the statements, not only at the end.
11633         Fixes #54987
11634
11635         * class.cs (TypeContainer.AddField): No longer set the
11636         `HaveStaticConstructor' flag, now we call it
11637         `UserDefineStaticConstructor' to diferentiate the slightly
11638         semantic difference.
11639
11640         The situation is that we were not adding BeforeFieldInit (from
11641         Modifiers.TypeAttr) to classes that could have it.
11642         BeforeFieldInit should be set to classes that have no static
11643         constructor. 
11644
11645         See:
11646
11647         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11648
11649         And most importantly Zoltan's comment:
11650
11651         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11652
11653         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11654          before its static fields are used', i.e. initialization does not need
11655          to be triggered by the first access to the type. Setting this flag
11656          helps the JIT to compile better code, since it can run the static
11657          constructor at JIT time, and does not need to generate code to call it
11658          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11659          this flag for lots of classes like String. 
11660          
11661          csc sets this flag if the type does not have an explicit static 
11662          constructor. The reasoning seems to be that if there are only static
11663          initalizers for a type, and no static constructor, then the programmer
11664          does not care when this initialization happens, so beforefieldinit
11665          can be used.
11666          
11667          This bug prevents the AOT compiler from being usable, since it 
11668          generates so many calls to mono_runtime_class_init that the AOT code
11669          is much slower than the JITted code. The JITted code is faster, 
11670          because it does not generate these calls if the vtable is type is
11671          already initialized, which is true in the majority of cases. But the
11672          AOT compiler can't do this."
11673
11674 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11675
11676         * class.cs (MethodData.Emit): Refactor the code so symbolic
11677         information is generated for destructors;  For some reasons we
11678         were taking a code path that did not generate symbolic information
11679         before. 
11680
11681 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11682
11683         * class.cs: Create a Constructor.CheckBase method that
11684         takes care of all validation type code. The method
11685         contains some code that was moved from Define.
11686
11687         It also includes new code that checks for duplicate ctors.
11688         This fixes bug #55148.
11689
11690 2004-03-09  Joshua Tauberer <tauberer@for.net>
11691
11692         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11693         a { ... }-style array creation invokes EmitStaticInitializers
11694         which is not good for reference-type arrays.  String, decimal
11695         and now null constants (NullCast) are not counted toward
11696         static initializers.
11697
11698 2004-03-05  Martin Baulig  <martin@ximian.com>
11699
11700         * location.cs (SourceFile.HasLineDirective): New public field;
11701         specifies whether the file contains or is referenced by a "#line"
11702         directive.
11703         (Location.DefineSymbolDocuments): Ignore source files which
11704         either contain or are referenced by a "#line" directive.        
11705
11706 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11707
11708         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11709         direct access to our parent, so check the method inline there.
11710
11711 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11712
11713         * expression.cs (Invocation.EmitCall): Miguel's last commit
11714         caused a regression. If you had:
11715
11716             T t = null;
11717             t.Foo ();
11718
11719         In Foo the implict this would be null.
11720
11721 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11722
11723         * expression.cs (Invocation.EmitCall): If the method is not
11724         virtual, do not emit a CallVirt to it, use Call.
11725
11726         * typemanager.cs (GetFullNameSignature): Improve the method to
11727         cope with ".ctor" and replace it with the type name.
11728
11729         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11730         as an argument the ConstructorBuilder where it is being defined,
11731         to catch the recursive constructor invocations.
11732
11733 2004-03-16  Martin Baulig  <martin@ximian.com>
11734
11735         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11736         ConstructedType, call ResolveType() on it to get the type rather
11737         than just using `expr.Type'.
11738
11739 2004-03-16  Martin Baulig  <martin@ximian.com>
11740
11741         * generics.cs (ConstructedType.GetMemberAccess): Take the
11742         EmitContext instead on the TypeExpr and use
11743         ec.TypeContainer.CurrentType/ec.ContainerType.
11744
11745 2004-03-16  Martin Baulig  <martin@ximian.com>
11746
11747         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11748         parameters before aliases.
11749
11750 2004-03-16  Martin Baulig  <martin@ximian.com>
11751
11752         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11753         New oublic function; checks whether two generic instances may become
11754         equal under some instantiations (26.3.1).
11755
11756         * class.cs (TypeContainer.Define): Call
11757         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11758         error.
11759
11760 2004-03-16  Martin Baulig  <martin@ximian.com>
11761
11762         * class.cs (TypeContainer.GetClassBases): Moved
11763         Error_TypeParameterAsBase() here and also check whether the base
11764         class is not an attribute.
11765
11766 2004-03-16  Martin Baulig  <martin@ximian.com>
11767
11768         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11769
11770 2004-03-16  Martin Baulig  <martin@ximian.com>
11771
11772         * class.cs (Error_TypeParameterAsBase): Use correct error number
11773         here (CS0689).  
11774
11775 2004-03-16  Martin Baulig  <martin@ximian.com>
11776
11777         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11778         for generics.
11779
11780         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11781         error reporting.
11782
11783 2004-03-15  Martin Baulig  <martin@ximian.com>
11784
11785         * typemanager.cs (TypeManager.GetFullName): New public method.
11786         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11787         argument; only return members with the correct number of type
11788         arguments.
11789         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11790         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11791         whether the number of type arguments matches.
11792
11793         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11794         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11795
11796         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11797         field; it's set by the protected .ctor when we're actually a
11798         GenericMemberAccess.
11799         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11800         arguments and pass it to MemberLookupFinal ().
11801
11802         * ecore.cs (Expression.MemberLookup): Added `int
11803         num_type_arguments' argument; only return members with the correct
11804         number of type arguments.
11805         (Expression.MemberLookupFailed): Check whether the MemberLookup
11806         failed because we did not have the correct number of type
11807         arguments; report CS0305 in this case.
11808
11809         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11810         `e.ResolveAsTypeTerminal()' already did so.
11811
11812 2004-03-15  Martin Baulig  <martin@ximian.com>
11813
11814         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11815         we're a ConstructedType; in this case, the caller must report an
11816         error (for instance CS0131).
11817
11818         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11819         (TypeArguments.Resolve): Actually report errors here.
11820
11821 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11822
11823         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11824         `set_indexer_name' to the pending bits (one per type).
11825
11826         We fixed a bug today that was picking the wrong method to
11827         override, since for properties the existing InterfaceMethod code
11828         basically ignored the method name.  Now we make sure that the
11829         method name is one of the valid indexer names.
11830
11831 2004-03-15  Martin Baulig  <martin@ximian.com>
11832
11833         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11834         for generic instances.
11835
11836 2004-03-13  Martin Baulig  <martin@ximian.com>
11837
11838         * class.cs (TypeContainer.DefineType): Call
11839         TypeManager.AddUserType() immediately after creating the
11840         TypeBuilder; pass all type parameters when creating the
11841         CurrentType.
11842
11843         * decl.cs (DeclSpace.FindNestedType): New public method.
11844         (DeclSpace.FindType): Added `int num_type_args' argument; only
11845         return types with the correct number of type parameters.
11846         (DeclSpace.CountTypeParams): New public property.
11847
11848         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11849         the number of type parameters; defaults to zero.
11850
11851         * generic.cs (TypeArguments.Count): New public property.
11852         (ConstructedType.DoResolveAsTypeStep): First call
11853         ds.FindNestedType() to find out whether we're nested in the
11854         current generic type; in this case, we inherit all type parameters
11855         from the current class.
11856
11857         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11858         num_type_args' argument.
11859         (RootContext.LookupType): Added overloaded version which takes the
11860         number of type arguments; only return types with the correct
11861         number of type arguments.
11862
11863         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11864         checks whether `Type t' has `int num_type_args'.
11865
11866 2004-03-13  Martin Baulig  <martin@ximian.com>
11867
11868         * generic.cs (GenericMethod.DefineType): New method; calls
11869         DefineType() on all the type parameters.
11870
11871         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11872         (MethodData.Define): If we're a generic method, call
11873         GenericMethod.DefineType() to define the type parameters.       
11874
11875 2004-03-10  Martin Baulig  <martin@ximian.com>
11876
11877         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11878         instead of IsAssignableFrom.    
11879
11880 2004-03-10  Martin Baulig  <martin@ximian.com>
11881
11882         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11883
11884         * support.cs (ParameterData.HasArrayParameter): New property.
11885         (ReflectionParameters.ctor): Take a MethodBase instead of a
11886         ParameterInfo[].  If we have any type parameters, get the generic
11887         method definition and ask it whether we have variable arguments.
11888
11889 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11892         routines to check if a type is an enumerable/enumerator allow
11893         classes that implement the IEnumerable or IEnumerator interfaces.
11894
11895         * class.cs (Property, Operator): Implement IIteratorContainer, and
11896         implement SetYields.
11897
11898         (Property.Define): Do the block swapping for get_methods in the
11899         context of iterators.   We need to check if Properties also
11900         include indexers or not.
11901
11902         (Operator): Assign the Block before invoking the
11903         OperatorMethod.Define, so we can trigger the Iterator code
11904         replacement. 
11905
11906         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11907         Property and Operator classes are not created when we parse the
11908         declarator but until we have the block completed, so we use a
11909         singleton SimpleIteratorContainer.Simple to flag whether the
11910         SetYields has been invoked.
11911
11912         We propagate this setting then to the Property or the Operator to
11913         allow the `yield' to function.
11914
11915 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11916
11917         * codegen.cs: Implemented attribute support for modules.
11918         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11919         Assembly/Module functionality.
11920
11921         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11922         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11923         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11924
11925 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11926
11927         * interface.cs (FindMembers): The operation is performed on all base
11928         interfaces and not only on the first. It is required for future CLS Compliance patch.
11929
11930 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11931
11932         * statement.cs, codegen.cs:
11933         This patch deals with patterns such as:
11934
11935         public class List : IEnumerable {
11936
11937                 public MyEnumerator GetEnumerator () {
11938                         return new MyEnumerator(this);
11939                 }
11940
11941                 IEnumerator IEnumerable.GetEnumerator () {
11942                         ...
11943                 }
11944                 
11945                 public struct MyEnumerator : IEnumerator {
11946                         ...
11947                 }
11948         }
11949
11950         Before, there were a few things we did wrong:
11951         1) we would emit callvirt on a struct, which is illegal
11952         2) we emited ldarg when we needed to emit ldarga
11953         3) we would mistakenly call the interface methods on an enumerator
11954         type that derived from IEnumerator and was in another assembly. For example:
11955
11956         public class MyEnumerator : IEnumerator
11957
11958         Would have the interface methods called, even if there were public impls of the
11959         method. In a struct, this lead to invalid IL code.
11960
11961 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11962
11963         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11964           renamed to Emit.
11965
11966         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11967
11968 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11969
11970         * cs-parser.jay: Fix small regression: we were not testing V2
11971         compiler features correctly.
11972
11973         * interface.cs: If the emit context is null, then create one
11974
11975 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11976
11977         * decl.cs (GetSignatureForError): New virtual method to get full name
11978           for error messages.
11979
11980         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11981           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11982
11983         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11984           Duplicated members and code in these classes has been removed.
11985           Better encapsulation in these classes.
11986
11987 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11988
11989         * assign.cs (Assign.DoResolve): When dealing with compound
11990         assignments, there is a new rule in ECMA C# 2.4 (might have been
11991         there before, but it is documented here) that states that in:
11992
11993         a op= b;
11994
11995         If b is of type int, and the `op' is a shift-operator, then the
11996         above is evaluated as:
11997
11998         a = (int) a op b 
11999
12000         * expression.cs (Binary.ResolveOperator): Instead of testing for
12001         int/uint/long/ulong, try to implicitly convert to any of those
12002         types and use that in pointer arithmetic.
12003
12004         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12005         method to print information for from the type, not from the
12006         null-method we were given.
12007
12008 2004-02-01  Duncan Mak  <duncan@ximian.com>
12009
12010         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12011         parsing for cmd, fixes bug #53694.
12012
12013 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12014
12015         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12016         in the member name duplication tests. Property and operator name duplication
12017         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12018
12019 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12020
12021         * interface.cs (PopulateMethod): Fixed crash when interface method
12022         returns not existing type (error test cs0246-3.cs).
12023
12024 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12025
12026         * cs-parser.jay (interface_accessors): Re-write actions to also
12027         store attributes attached to get and set methods. Fix spelling
12028         while at it.
12029
12030         (inteface_property_declaration): Modify accordingly.
12031
12032         (InterfaceAccessorInfo): New helper class to store information to pass
12033         around between rules that use interface_accessors.
12034
12035         * interface.cs (Emit): Apply attributes on the get and set
12036         accessors of properties and indexers too.
12037
12038         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12039         right MethodBuilder when applying attributes to the get and set accessors.
12040
12041 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12042
12043         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12044
12045 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12046
12047         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12048
12049 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12052         changes that treat `yield' specially when present before `break'
12053         or `return' tokens.
12054
12055         * cs-tokenizer.cs: yield is no longer a keyword.
12056
12057 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12058
12059         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12060         setting for default constructors.
12061         For default constructors are almost every time set wrong Modifier. The
12062         generated IL code has been alright. But inside mcs this values was
12063         wrong and this was reason why several of my CLS Compliance tests
12064         failed.
12065
12066 2004-02-27  Martin Baulig  <martin@ximian.com>
12067
12068         * generics.cs (ConstructedType.ResolveType): Make the nested type
12069         stuff actually work.
12070
12071 2004-02-25  Martin Baulig  <martin@ximian.com>
12072
12073         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12074         property; returns the type parameters just from the current type,
12075         ie. with the ones from outer classes.
12076         (DeclSpace.LookupGeneric): First search in the current class, then
12077         in outer classes.
12078         (DeclSpace.initialize_type_params): When hiding a type parameter
12079         from an outer class, put it into the `type_param_list' anyways.
12080
12081         * expression.cs (MemberAccess.expr): Made this field protected.
12082
12083         * class.cs (TypeContainer.Define): The `CurrentType' just contains
12084         the type parameters from the current class.
12085
12086         * generic.cs (ConstructedType.ResolveType): Support nested generic
12087         types by taking the type parameters which we inherit from outer
12088         classes into account.
12089         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12090         support for nested generic types.
12091
12092 2004-02-23  Martin Baulig  <martin@ximian.com>
12093
12094         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12095         field and check whether we're nested inside a generic type.
12096         (DeclSpace.ResolveType): If we're resolving to a generic type
12097         definition, create a ConstructedType and return its resolved type.
12098         (DeclSpace.initialize_type_params): New private method;
12099         initializes the `type_param_list' field from the type parameters
12100         from this and all enclosing classes.
12101         (DeclSpace.TypeParameters): Call initialize_type_params() unless
12102         we're already initialized.
12103
12104 2004-02-23  Martin Baulig  <martin@ximian.com>
12105
12106         * class.cs (Method.Define): Create the generic method before
12107         calling DoDefine().
12108         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12109         the TypeContainer one); we use this for generic methods.
12110
12111         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12112         parent's TypeBuilder.
12113
12114 2004-02-18  Martin Baulig  <martin@ximian.com>
12115
12116         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12117         to check for equality.
12118
12119 2004-02-05  Martin Baulig  <martin@ximian.com>
12120
12121         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12122         `ec.TypeContainer.CurrentType', use it instead of
12123         `ec.ContainerType' to check whether we're in the type's ctor.
12124
12125 2004-01-29  Martin Baulig  <martin@ximian.com>
12126
12127         * expression.cs (Invocation.DoResolve): If we're a
12128         `ConstructedType', then we're actually a generic method, so
12129         rewrite the expr as a GenericMemberAccess.
12130
12131         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12132         here; manually parse it into a string.
12133
12134 2004-01-28  Martin Baulig  <martin@ximian.com>
12135
12136         * typemanager.cs (TypeManager.IsEqual): New static method.
12137         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12138         check for equality instead of using `=='.
12139
12140 2004-01-26  Martin Baulig  <martin@ximian.com>
12141
12142         * decl.cs (DeclSpace.CurrentType): New public field.
12143
12144         * expression.cs (This.ResolveBase): If we have an
12145         `ec.TypeContainer.CurrentType', use it instead of
12146         `ec.ContainerType'.
12147
12148         * class.cs (TypeContainer.DefineType): If we're a generic type,
12149         create the `CurrentType' (unresolved).
12150         (TypeContainer.GenericType): New private field.
12151         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12152         it and store it in `GenericType' before creating the MemberCache.
12153         (TypeContainer.GetMembers): If we have a `GenericType', call
12154         TypeManager.FindMembers() on it.
12155
12156         * interface.cs (Interface.GenericType): New private field.
12157         (Interface.DefineType): If we're a generic type, create the
12158         `CurrentType' (unresolved).
12159         (Interface.DefineMembers): If we have a `CurrentType', resolve it
12160         and store it in `GenericType' before creating the MemberCache.
12161         (Interface.GetMembers): If we have a `GenericType', call
12162         TypeManager.FindMembers() on it.
12163
12164 2004-01-22  Martin Baulig  <martin@ximian.com>
12165
12166         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12167         not a QualifiedIdentifier.  This is what `type_name_expression'
12168         was previously doing.
12169         (type_name_expression): Removed; the code is now in
12170         `namespace_or_type_name'.
12171         (qualified_identifier): Removed, use `namespace_or_type_name'
12172         instead.
12173         (QualifiedIdentifier): Removed this class.      
12174
12175 2004-01-22  Martin Baulig  <martin@ximian.com>
12176
12177         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12178         not a string as alias name.
12179
12180 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12181
12182         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12183         #52730 bug, and instead compute correctly the need to use a
12184         temporary variable when requesting an address based on the
12185         static/instace modified of the field and the constructor.
12186  
12187 2004-01-21  Martin Baulig  <martin@ximian.com>
12188
12189         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12190         class and namespace before looking up aliases.  Fixes #52517.
12191
12192 2004-01-21  Martin Baulig  <martin@ximian.com>
12193
12194         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12195         assinged in a 'try'; fixes exception4.cs.
12196
12197 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12198         * class.cs : Implemented parameter-less constructor for TypeContainer
12199
12200         * decl.cs: Attributes are now stored here. New property OptAttributes
12201
12202         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12203
12204         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12205
12206 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12207
12208         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12209           (CSharpSignature): New method for indexer and property signature.
12210
12211 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12212
12213         * pending.cs (IsVirtualFilter): Faster implementation.
12214
12215 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12216
12217         * typemanager.cs: Avoid inclusion of same assembly more than once.
12218
12219 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12220
12221         * cs-parser.jay: Fixed problem where the last assembly attribute
12222           has been applied also to following declaration (class, struct, etc.)
12223           
12224 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12225
12226         * class.cs: Added error CS0538, CS0539 reporting.
12227         Fixed crash on Microsoft runtime when field type is void.
12228
12229         * cs-parser.jay: Added error CS0537 reporting.
12230
12231         * pending.cs: Added error CS0535 reporting.
12232         Improved error report for errors CS0536, CS0534.
12233
12234 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12235
12236         Merge a few bits from the Anonymous Method MCS tree.
12237
12238         * statement.cs (ToplevelBlock): New class for toplevel methods,
12239         will hold anonymous methods, lifted variables.
12240
12241         * cs-parser.jay: Create toplevel blocks for delegates and for
12242         regular blocks of code. 
12243
12244 2004-01-20  Martin Baulig  <martin@ximian.com>
12245
12246         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12247         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12248         and `NeedExplicitReturn'; added `IsLastStatement'.
12249         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12250         have a `ReturnLabel' or we're not unreachable.
12251
12252         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12253         child's reachability; don't just override ours with it.  Fixes
12254         #58058 (lluis's example).
12255         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12256         InFinally(), InLoop(), InSwitch() and
12257         BreakCrossesTryCatchBoundary() methods.
12258
12259         * statement.cs (Return): Do all error checking in Resolve().
12260         Unless we are the last statement in a top-level block, always
12261         create a return label and jump to it.
12262         (Break, Continue): Do all error checking in Resolve(); also make
12263         sure we aren't leaving a `finally'.
12264         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12265         statement in a top-level block.
12266         (Block.Flags): Added `IsDestructor'.
12267         (Block.IsDestructor): New public property.
12268
12269 2004-01-20  Martin Baulig  <martin@ximian.com>
12270
12271         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12272
12273 2004-01-20  Martin Baulig  <martin@ximian.com>
12274
12275         * statement.cs (Statement.ResolveUnreachable): New public method.
12276         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12277         (Block.Resolve): Resolve unreachable statements.
12278
12279 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12280
12281         * expression.cs: We need to fix the case where we do
12282         not have a temp variable here.
12283
12284         * assign.cs: Only expression compound assignments need
12285         temporary variables.
12286
12287 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12288
12289         * flowanalysis.cs: Reduce memory allocation in a few ways:
12290           - A block with no variables should not allocate a bit
12291             vector for itself.
12292           - A method with no out parameters does not need any tracking
12293             for assignment of the parameters, so we need not allocate
12294             any data for it.
12295           - The arrays:
12296                 public readonly Type[] VariableTypes;
12297                 public readonly string[] VariableNames;
12298             Are redundant. The data is already stored in the variable
12299             map, so we need not allocate another array for it.
12300           - We need to add alot of checks for if (params | locals) == null
12301             due to the first two changes.
12302
12303 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12304
12305         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12306         implement IMemoryLocation, we store a copy on a local variable and
12307         take the address of it.  Patch from Benjamin Jemlich
12308
12309         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12310         to use a special "type_name_expression" rule which reduces the
12311         number of "QualifiedIdentifier" classes created, and instead
12312         directly creates MemberAccess expressions.
12313
12314 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12315
12316         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12317         that fixes #52853.  Null literal assignment to ValueType
12318
12319         * class.cs (MethodData.Emit): Instead of checking the name of the
12320         method to determine if its a destructor, create a new derived
12321         class from Method called Destructor, and test for that.  
12322
12323         * cs-parser.jay: Create a Destructor object instead of a Method.  
12324
12325         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12326
12327         Fixes: 52933
12328
12329 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12330
12331         * expression.cs (Binary.ResolveOperator): Perform an implicit
12332         conversion from MethodGroups to their delegate types on the
12333         Addition operation.
12334
12335         * delegate.cs: Introduce a new class DelegateCreation that is the
12336         base class for `NewDelegate' and `ImplicitDelegateCreation',
12337         factor some code in here.
12338
12339         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12340         conversion from MethodGroups to compatible delegate types. 
12341
12342         * ecore.cs (Expression.Resolve): Do not flag error 654
12343         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12344         we allow conversions from MethodGroups to delegate types now.
12345
12346         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12347         assignments in v2 either.
12348
12349 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12350
12351         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12352         static read-only fields in ctors.
12353
12354         Applied patch from Benjamin Jemlich 
12355
12356         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12357
12358 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12359
12360         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12361         here to return true, as they can be used like this:
12362
12363                 (XXX) int.MEMBER ()
12364
12365         Fixed 49836 and all the other dups
12366
12367 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12368
12369         * driver.cs: Implement /win32res and /win32icon.
12370
12371 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12372
12373         * cs-parser.jay: Add a rule to improve error handling for the
12374         common mistake of placing modifiers after the type.
12375
12376 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12377
12378         * cs-parser.jay (interface_event_declaration): Catch
12379         initialization of events on interfaces, and report cs0068
12380
12381         * cs-parser.jay (interface_event_declaration): Catch
12382         initialization of events. 
12383
12384         * ecore.cs: Better report missing constructors.
12385
12386         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12387         the error reporting done in the wrong place.  Fix.
12388
12389         * expression.cs (Binary.ResolveOperator): Catch the 
12390         operator + (E x, E y) error earlier, and later allow for implicit
12391         conversions in operator +/- (E e, U x) from U to the underlying
12392         type of E.
12393
12394         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12395         52596, if the container class is abstract, the default constructor
12396         is protected otherwise its public (before, we were always public).
12397
12398         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12399         fixed statement.
12400
12401         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12402         Jemlich that fixes bug #52597, MCS was generating invalid code for
12403         idisposable structs.   Thanks to Ben for following up with this
12404         bug as well.
12405
12406 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12407
12408         * driver.cs: Allow assemblies without code to be generated, fixes
12409         52230.
12410
12411 2004-01-07  Nick Drochak <ndrochak@gol.com>
12412
12413         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12414
12415 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12416
12417         * cs-parser.jay: Add rules to improve error reporting if fields or
12418         methods are declared at the namespace level (error 116)
12419
12420         * Add rules to catch event add/remove
12421
12422 2004-01-04  David Sheldon <dave-mono@earth.li>
12423
12424   * expression.cs: Added matching ")" to error message for 
12425   CS0077
12426
12427 2004-01-03 Todd Berman <tberman@gentoo.org>
12428
12429         * ecore.cs, attribute.cs:
12430         Applying fix from #52429.
12431
12432 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12433
12434         * ecore.cs, expression.cs, statement.cs:
12435         Total rewrite of how we handle branching. We
12436         now handle complex boolean expressions with fewer
12437         jumps. As well if (x == 0) no longer emits a ceq.
12438
12439         if (x is Foo) is much faster now, because we generate
12440         better code.
12441
12442         Overall, we get a pretty big improvement on our benchmark
12443         tests. The code we generate is smaller and more readable.
12444
12445         I did a full two-stage bootstrap. The patch was reviewed
12446         by Martin and Miguel.
12447
12448 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12449
12450         * cs-parser.jay: Make primary_expression not take a QI.
12451         we dont need this because the member_access rule covers
12452         us here. So we replace the rule with just IDENTIFIER.
12453
12454         This has two good effects. First, we remove a s/r conflict.
12455         Second, we allocate many fewer QualifiedIdentifier objects.
12456
12457 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12458
12459         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12460         set the correct information via SRE. This prevents
12461         hanging on the MS runtime. Fixes #29374.
12462
12463 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12464
12465         * convert.cs: correctly handle conversions to value types
12466         from Enum and ValueType as unboxing conversions.
12467
12468         Fixes bug #52569. Patch by Benjamin Jemlich.
12469
12470 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12471
12472         * expression.cs (BetterConversion): Prefer int -> uint
12473         over int -> ulong (csc's behaviour). This fixed bug #52046.
12474
12475 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12476
12477         * decl.cs (MemberCache.FindMembers): now returns a
12478         MemberInfo [].
12479
12480         * typemanager.cs: In general, go with with ^^.
12481         (CopyNewMethods): take an IList.
12482         (RealMemberLookup): Only allocate an arraylist
12483         if we copy from two sets of methods.
12484
12485         This change basically does two things:
12486         1) Fewer array lists allocated due to CopyNewMethods.
12487         2) the explicit cast in MemberList costed ALOT.
12488
12489 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12490
12491         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12492         a hashtable to avoid needless string allocations when an identifier is
12493         used more than once (the common case).
12494
12495 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12496
12497         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12498         is broken, it will not return anything. So, we
12499         have to use the information we have in mcs to
12500         do the task.
12501
12502         * typemanager.cs: Add a cache for GetInterfaces,
12503         since this will now be used more often (due to ^^)
12504
12505         (GetExplicitInterfaces) New method that gets the
12506         declared, not effective, interfaces on a type
12507         builder (eg, if you have interface IFoo, interface
12508         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12509         { IBar }.
12510
12511         This patch makes MCS able to bootstrap itself on
12512         Windows again.
12513
12514 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12515
12516         * expression.cs: Remove the Nop's that Miguel put
12517         in by mistake.
12518
12519 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12520
12521         * report.cs, codegen.cs: Give the real stack trace to
12522         the error when an exception is thrown.
12523
12524 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12525
12526         * decl.cs: only allocate hashtables for ifaces if 
12527         it is an iface!
12528
12529 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12530
12531         * expression.cs: fix the error from cs0121-2.cs
12532         (a parent interface has two child interfaces that
12533         have a function with the same name and 0 params
12534         and the function is called through the parent).
12535
12536 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12537
12538         * class.cs, rootcontext.cs, typmanager.cs: do not
12539         leak pointers.
12540
12541 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12542
12543         * codegen.cs: remove stack for the ec flow branching.
12544         It is already a linked list, so no need.
12545
12546 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12547
12548         * Makefile: Allow custom profiler here.
12549
12550 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12551
12552         * typemanager.cs (LookupType):
12553           - Use a static char [], because split takes
12554             a param array for args, so it was allocating
12555             every time.
12556           - Do not store true in a hashtable, it boxes.
12557
12558 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12559
12560         * flowanalysis.cs: bytify common enums.
12561
12562 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12563
12564         * modifiers.cs: Add a new set of flags for the
12565         flags allowed on explicit interface impls.
12566         * cs-parser.jay: catch the use of modifiers in
12567         interfaces correctly.
12568         * class.cs: catch private void IFoo.Blah ().
12569
12570         All related to bug #50572.
12571
12572 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12573
12574         * decl.cs: Rewrite the consistant accessability checking.
12575         Accessability is not linear, it must be implemented in
12576         a tableish way. Fixes #49704.
12577
12578 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12579
12580         * expression.cs: Handle negation in a checked context.
12581         We must use subtraction from zero. Fixes #38674.
12582
12583 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12584
12585         * class.cs: Ignore static void main in DLLs.
12586         * rootcontext.cs: Handle the target type here,
12587         since we are have to access it from class.cs
12588         * driver.cs: account for the above.
12589
12590 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12591
12592         * report.cs: Give line numbers and files if available.
12593
12594 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12595
12596         * driver.cs: Implement /addmodule.
12597
12598         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12599         ModuleBuilders.
12600
12601 2003-12-20  Martin Baulig  <martin@ximian.com>
12602
12603         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12604         (FieldBase.IsAssigned): Removed this field.
12605         (FieldBase.SetAssigned): New public method.
12606         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12607
12608 2003-12-20  Martin Baulig  <martin@ximian.com>
12609
12610         * expression.cs (LocalVariableReference.DoResolve): Don't set
12611         `vi.Used' if we're called from DoResolveLValue().
12612
12613         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12614         returns the usage vector it just merged into the current one -
12615         pass this one to UsageWarning().
12616         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12617         of the `EmitContext', don't call this recursively on our children.
12618
12619 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12620
12621         * driver.cs: Implement /target:module.
12622
12623 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12624
12625         * support.cs (CharArrayHashtable): New helper class.
12626
12627         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12628         char arrays, not strings, so we can avoid creating a string in
12629         consume_identifier if the identifier is a keyword.
12630
12631 2003-12-16  Martin Baulig  <martin@ximian.com>
12632
12633         * statement.cs (LocalInfo.Assigned): Removed this property.
12634         (LocalInfo.Flags): Removed `Assigned'.
12635         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12636         and uses flow analysis.
12637         (Block.UsageWarning): Made this method private.
12638         (Block.Resolve): Call UsageWarning() if appropriate.
12639
12640         * expression.cs (LocalVariableReference.DoResolve): Always set
12641         LocalInfo.Used here.
12642
12643 2003-12-13  Martin Baulig  <martin@ximian.com>
12644
12645         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12646         any value here; we're now using flow analysis to figure out
12647         whether a statement/block returns a value.
12648
12649 2003-12-13  Martin Baulig  <martin@ximian.com>
12650
12651         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12652         working again.
12653         (FlowBranching.MergeFinally): Don't call
12654         `branching.CheckOutParameters()' here, this is called in
12655         MergeTopBlock().
12656         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12657         when adding the `finally' vector.       
12658
12659 2003-12-13  Martin Baulig  <martin@ximian.com>
12660
12661         * flowanalysis.cs
12662         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12663         actually work and also fix #48962.
12664
12665 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12666
12667         * decl.cs: Do not check System.Object for nested types,
12668         since we know it does not have any. Big bang for buck:
12669
12670         BEFORE:
12671            Run 1:   8.35 seconds
12672            Run 2:   8.32 seconds
12673            corlib:  17.99 seconds
12674         AFTER:
12675            Run 1:   8.17 seconds
12676            Run 2:   8.17 seconds
12677            corlib:  17.39 seconds
12678
12679 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12680
12681         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12682         time we are returning 0 members, so we save alot here.
12683
12684 2003-12-11  Martin Baulig  <martin@ximian.com>
12685
12686         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12687         `MergeChild()', also just take the `FlowBranching' as argument;
12688         call Merge() on it and return the result.
12689         (FlowBranching.Merge): We don't need to do anything if we just
12690         have one sibling.
12691
12692 2003-12-11  Martin Baulig  <martin@ximian.com>
12693
12694         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12695         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12696         Maurer for this idea.
12697
12698 2003-12-11  Martin Baulig  <martin@ximian.com>
12699
12700         * flowanalysis.cs (MergeResult): This class is now gone; we now
12701         use the `UsageVector' for this.  The reason for this is that if a
12702         branching just has one sibling, we don't need to "merge" them at
12703         all - that's the next step to do.
12704         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12705         `MergeResult'.
12706
12707 2003-12-11  Martin Baulig  <martin@ximian.com>
12708
12709         Reworked flow analyis and made it more precise and bug-free.  The
12710         most important change is that we're now using a special `Reachability'
12711         class instead of having "magic" meanings of `FlowReturns'.  I'll
12712         do some more cleanups and optimizations and also add some more
12713         documentation this week.
12714
12715         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12716         largely reworked this class.
12717         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12718         the new `Reachability' class instead of having "magic" values here.
12719         (FlowBranching): We're now using an instance of `Reachability'
12720         instead of having separate `Returns', `Breaks' etc. fields.
12721
12722         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12723         based on flow analysis; ignore the return value of block.Emit ().
12724
12725 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12726
12727         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12728         if they are private.
12729
12730 2003-12-09  Martin Baulig  <martin@ximian.com>
12731
12732         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12733         call them directly on the UsageVector.
12734
12735 2003-12-09  Martin Baulig  <martin@ximian.com>
12736
12737         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12738         Changed return type from `FlowReturns' to `Reachability'.
12739
12740 2003-12-09  Martin Baulig  <martin@ximian.com>
12741
12742         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12743         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12744         `Reachable' fields with a single `Reachability' one.
12745
12746 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12747
12748         * class.cs (FindMembers): Remove foreach's.
12749
12750         Bootstrap times:
12751
12752         BEFORE
12753                 Run 1:   8.74 seconds
12754                 Run 2:   8.71 seconds
12755
12756         AFTER
12757                 Run 1:   8.64 seconds
12758                 Run 2:   8.58 seconds
12759
12760
12761 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12762
12763         * cs-parser.jay:
12764         * gen-treedump.cs:
12765         * statement.cs:
12766         This patch does a few things:
12767                 1. EmptyStatement is now a singleton, so it is never reallocated.
12768                 2. All blah is EmptyStatement constructs have been changed to
12769                    blah == EmptyStatement.Value, which is much faster and valid
12770                    now that EmptyStatement is a singleton.
12771                 3. When resolving a block, rather than allocating a new array for
12772                    the non-empty statements, empty statements are replaced with
12773                    EmptyStatement.Value
12774                 4. Some recursive functions have been made non-recursive.
12775         Mainly the performance impact is from (3), however (1) and (2) are needed for
12776         this to work. (4) does not make a big difference in normal situations, however
12777         it makes the profile look saner.
12778
12779         Bootstrap times:
12780
12781         BEFORE
12782         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12783         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12784         Total memory allocated: 56397 KB
12785
12786         AFTER
12787         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12788         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12789         Total memory allocated: 55666 KB
12790
12791 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12792
12793         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12794         than the hashtable in a hashtable version
12795
12796         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12797         we always end up concating a string. This results in a huge perf
12798         loss, because many strings have to be tracked by the GC. In this
12799         patch, we first use a hashtable that works with two keys, so that
12800         the strings do not need to be concat'ed.
12801
12802         Bootstrap times:
12803         BEFORE
12804                 Run 1:   8.74 seconds
12805                 Run 2:   8.71 seconds
12806
12807         AFTER
12808                 Run 1:   8.65 seconds
12809                 Run 2:   8.56 seconds
12810
12811 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12812
12813         * Makefile: Add a new target `do-time' that does a quick and simple
12814         profile, leaving easy to parse output.
12815
12816 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12817
12818         * codegen.cs (Init): Create the dynamic assembly with 
12819         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12820
12821 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12822
12823         * support.cs: Make the PtrHashtable use only one
12824         instance of its comparer.
12825
12826 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12827
12828         * typemanager.cs: Fix lookup of GetNamespaces.
12829
12830 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12831
12832         * expression.cs: Removed redundant line.
12833
12834         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12835         ArrayLists, use for loops with bounds.  
12836
12837         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12838         arraylist.
12839
12840         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12841         arraylists, use for loop with bounds.
12842
12843         The above three changes give us a 0.071 second performance
12844         improvement out of 3.294 seconds down to 3.223.  On my machine
12845         the above changes reduced the memory usage by 1,387 KB during
12846         compiler bootstrap.
12847
12848         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12849         QualifiedIdentifiers.  Before we created a new string through
12850         concatenation, and mostly later on, the result would be
12851         manipulated by DecomposeQI through string manipulation.
12852
12853         This reduced the compiler memory usage for bootstrapping from
12854         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12855         compile times in 0.05 seconds.
12856
12857 2003-11-28  Dick Porter  <dick@ximian.com>
12858
12859         * support.cs: Do string compares with the Invariant culture.
12860
12861         * rootcontext.cs: 
12862         * gen-treedump.cs: 
12863         * expression.cs: 
12864         * driver.cs: 
12865         * decl.cs: 
12866         * codegen.cs: 
12867         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12868         the comparison is done with the Invariant culture.
12869
12870 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12871
12872         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12873         GetEnumerator method.
12874
12875         (ProbeCollectionType): Iterate starting at the most specific type
12876         upwards looking for a GetEnumerator
12877
12878         * expression.cs: Shift count can be up to 31 for int/uint and 63
12879         for long/ulong.
12880
12881 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12882
12883         * statement.cs (Block.LookupLabel): Also look for the label on the
12884         children blocks.  Use a hash table to keep track of visited
12885         nodes. 
12886
12887         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12888         we actually did transform the other operand, otherwise fall back
12889         to the common codepath that casts to long.
12890
12891         * cs-tokenizer.cs: Use the same code pattern as the int case.
12892         Maybe I should do the parsing myself, and avoid depending on the
12893         Parse routines to get this done.
12894
12895 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12896
12897         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12898         which fixes bug 51347.  This time test it.
12899
12900         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12901         attributes for example can not tell the difference between these.
12902         The difference was only a syntax feature of the language. 
12903
12904         * attribute.cs: Apply attributes to delegates.
12905
12906         * delegate.cs: Call the apply attributes method.
12907
12908 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12909
12910         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12911         comparing 0 vs Byte.MinValue, not the value
12912
12913         (ImplicitConversionRequired): When reporting a conversion error,
12914         use error 31 to print out the constant error instead of the
12915         simpler 29.
12916
12917         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12918         which fixes bug 51347.
12919
12920 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12921
12922         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12923         which fixes the -warnaserror command line option.
12924
12925 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12926
12927         * cfold.cs (DoNumericPromotions): During constant folding of
12928         additions on UIntConstant, special case intconstants with
12929         IntConstants like we do on the expression binary operator. 
12930
12931 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12932
12933         * convert.cs (ImplicitReferenceConversion): We were missing a case
12934         (System.Enum are not value types or class types, so we need to
12935         classify them separatedly).
12936
12937         * driver.cs: We do not support error 2007.
12938
12939 2003-11-12 Jackson Harper <jackson@ximian.com>
12940
12941         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12942         system directory. Also use the full file name so users can
12943         libraries names mscorlib-o-tron.dll in a non system dir.
12944         
12945 2004-01-04  David Sheldon <dave-mono@earth.li>
12946
12947         * expression.cs: Added matching ")" to error message for CS0077.
12948
12949 2003-12-19  Martin Baulig  <martin@ximian.com>
12950
12951         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12952         static method; see documentation in the method.
12953         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12954
12955         * convert.cs (Convert.ImplicitReferenceConversion,
12956         Convert.ImplicitReferenceConversionExists): Add support for
12957         generic type declarations; see gen-36.cs.
12958
12959 2003-12-19  Martin Baulig  <martin@ximian.com>
12960
12961         * pending.cs (Pending.InterfaceMethod): Use
12962         `Type.IsAssignableFrom()' instead of `=='.
12963
12964 2003-12-18  Martin Baulig  <martin@ximian.com>
12965
12966         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12967         byref types first.
12968
12969         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12970         `expr_type.Equals (target_type)' instead of `=='.
12971
12972 2003-12-08  Martin Baulig  <martin@ximian.com>
12973
12974         * generics.cs (Constraints.Types): Removed.
12975         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12976         to Type's.
12977         (Constraints.ResolveTypes): New public method; resolves the
12978         TypeExpr's to Type's.
12979         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12980         longer takes the constraints.
12981         (TypeParameter.DefineMethod): Likewise.
12982         (TypeParameter.DefineType): New public method.  Calls
12983         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12984         the constraints.
12985
12986 2003-12-08  Martin Baulig  <martin@ximian.com>
12987
12988         * convert.cs (Convert.ImplicitConversionStandard): Use
12989         `expr_type.Equals (target_type)' instead of `=='.
12990
12991 2003-12-08  Martin Baulig  <martin@ximian.com>
12992
12993         * typemanager.cs (TypeManager.GetReferenceType): Call
12994         `Type.MakeByRefType ()'.
12995
12996 2003-12-08  Martin Baulig  <martin@ximian.com>
12997
12998         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12999         just has some special meaning in some situations.  For instance,
13000         it is allowed to use `where' as the name of a variable etc.
13001
13002 2003-12-04  Martin Baulig  <martin@ximian.com>
13003
13004         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13005         `Type.MakeArrayType()' for array types.
13006
13007 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13008
13009         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13010         debugging message.
13011
13012         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13013         corlib to compile.
13014
13015 2003-11-16  Martin Baulig  <martin@ximian.com>
13016
13017         * codegen.cs (EmitContext.IsGeneric): Removed.
13018
13019         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13020         ResolveGeneric() on the DeclSpace.
13021
13022 2003-11-16  Martin Baulig  <martin@ximian.com>
13023
13024         * generic.cs (TypeArguments.Resolve):
13025         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13026         `ResolveType()' on it to get the Type.
13027
13028 2003-11-15  Martin Baulig  <martin@ximian.com>
13029
13030         * generic.cs (ConstructedType.GetInterfaces): Override this.
13031
13032 2003-11-14  Martin Baulig  <martin@ximian.com>
13033
13034         * interface.cs (Interface.DefineType): Define all type parameters
13035         before adding the interfaces we inherit.
13036
13037 2003-11-11  Martin Baulig  <martin@ximian.com>
13038
13039         * generic.cs (ConstructedType.ResolveType): Always call
13040         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13041
13042 2003-11-10  Martin Baulig  <martin@ximian.com>
13043
13044         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13045         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13046         calling `ResolveType()' on them, directly assign their `Type'.
13047
13048 2003-11-08  Martin Baulig  <martin@ximian.com>
13049
13050         * generic.cs (ConstructedType): Override `IsClass' etc.
13051
13052 2003-11-08  Martin Baulig  <martin@ximian.com>
13053
13054         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13055         return value and the `out parent' parameter.
13056         (TypeContainer.DefineType): Moved the CS0644 check into
13057         GetClassBases().  Don't pass the interface types to the
13058         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13059         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13060
13061         * ecore.cs (TypeExpr.IsAttribute): New property.
13062         (TypeExpr.GetInterfaces): New method.
13063
13064         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13065         TypeExpr instead of a Type.
13066         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13067         (Interface.DefineType): Don't pass the interface types to the
13068         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13069         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13070
13071         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13072         instead of a `Type[]'.
13073         (TypeManager.RegisterBuilder): Likewise.
13074         (TypeManager.AddUserInterface): Likewise.
13075         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13076         `Type[]' and also return a `TypeExpr[]'.
13077         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13078
13079 2003-11-08  Martin Baulig  <martin@ximian.com>
13080
13081         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13082         Expression.     
13083
13084 2003-11-08  Martin Baulig  <martin@ximian.com>
13085
13086         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13087         TypeManager.ResolveExpressionTypes().
13088
13089         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13090         instead of an Expression.
13091         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13092         (TypeExpression): New public class; formerly known as `TypeExpr'.
13093
13094         * expression.cs (ComposedCast): Derive from TypeExpr.
13095
13096         * typemanager.cs (TypeManager.system_*_expr): These are now
13097         TypExpr's instead of Expression's.
13098         (TypeManager.ResolveExpressionTypes): New public static function;
13099         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13100         of them.        
13101
13102 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13103
13104         * expression.cs (New.DoResolve): Do not dereference value that
13105         might be a null return.
13106
13107         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13108         sure that the constant value has the right type.  Fixes an
13109         unreported bug, similar to 50425.
13110
13111         * const.cs (Const.LookupConstantValue): Call
13112         ImplicitStandardConversionExists before doing a conversion to
13113         avoid havng the TypeManager.ChangeType do conversions.
13114
13115         Reduced the number of casts used
13116
13117         (Const.ChangeType): New routine to enable reuse of the constant
13118         type changing code from statement.
13119
13120         * typemanager.cs (ChangeType): Move common initialization to
13121         static global variables.
13122
13123         Fixes #50425.
13124
13125         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13126         every value type to go through, even if it was void.  Fix that. 
13127
13128         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13129         character of the define, and the is_identifier_part_character for
13130         the rest of the string.
13131
13132 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * expression.cs (UnaryMutator.EmitCode): When I updated
13135         LocalVariableReference.DoResolve, I overdid it, and dropped an
13136         optimization done on local variable references.
13137
13138 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13139
13140         * ecore.cs: Convert the return from Ldlen into an int.
13141
13142 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13143
13144         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13145         the accessibility, this is a special case for toplevel non-public
13146         classes (internal for instance).
13147
13148 2003-10-20  Nick Drochak <ndrochak@gol.com>
13149
13150         * ecore.cs: Fix typo and build.  Needed another right paren.
13151
13152 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13153
13154         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13155         `internal' case regular and protected, but not allowing protected
13156         to be evaluated later.  Bug 49840
13157
13158 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13161         to kb.Nlast, and not the kb.nFirst to isolate the switch
13162         statement.
13163
13164         Extract the underlying type, so enumerations of long/ulong are
13165         treated like long/ulong.
13166
13167 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * expression.cs (New): Overload the meaning of RequestedType to
13170         track the possible creation of the NewDelegate type, since
13171         DoResolve is invoked more than once for new constructors on field
13172         initialization.
13173
13174         See bugs: #48800 and #37014
13175
13176         * cs-parser.jay (declare_local_constants): Take an arraylist
13177         instead of a single constant.
13178
13179         (local_constant_declaration): It should take a
13180         constant_declarators, not a constant_declarator.  Fixes 49487
13181
13182         * convert.cs: Fix error report.
13183
13184 2003-10-13 Jackson Harper <jackson@ximian.com>
13185
13186         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13187         bug #49611
13188         
13189 2003-11-03  Martin Baulig  <martin@ximian.com>
13190
13191         * expression.cs (ArrayAccess.GetStoreOpcode): Added
13192         `out bool has_type_arg'; if set, we need to pass the type to
13193         ig.Emit().
13194         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13195         Stelem_Any/Ldelem_Any for generic parameters.   
13196
13197 2003-11-02  Martin Baulig  <martin@ximian.com>
13198
13199         * expression.cs (Invocation.EmitCall): Use
13200         `TypeManager.IsValueType()' to check whether it's a value type.
13201         Don't set `struct_call' when calling a method on a type parameter.
13202
13203 2003-11-02  Martin Baulig  <martin@ximian.com>
13204
13205         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13206         and removed the TypeBuilder argument.
13207
13208         * typemanager.cs (TypeManager.IsValueType): Return
13209         `t.IsGenericParameter || t.IsValueType'.
13210
13211 2003-10-25  Martin Baulig  <martin@ximian.com>
13212
13213         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13214         call ConstructedType.Resolve() on it.
13215
13216         * generic.cs (ConstructedType.Resolve): Set `type' on success.
13217
13218 2003-10-25  Martin Baulig  <martin@ximian.com>
13219
13220         * class.cs (TypeContainer.GetClassBases): Changed
13221         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
13222         CS8214 reporting here.
13223         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13224         instead of a `Type' for our parent.  In case of a recursive
13225         declaration (see tests/gen-23.cs for an example), our parent is a
13226         ConstructedType and it doesn't have its type set.  So, first
13227         create our own TypeBuilder, then call constructed.Resolve() to get
13228         the parent's type and finally TypeBuilder.SetParent() it.
13229
13230         * ecore.cs (TypeExpr.Name): New public virtual property.
13231
13232         * generic.cs
13233         (ConstructedType): We're now a TypeExpr and not just an Expression.
13234         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13235         arguments here; this is done later.
13236         (ConstructedType.Resolve): New public method to resolve the type
13237         arguments and bind them.
13238
13239 2003-10-21  Martin Baulig  <martin@ximian.com>
13240
13241         * convert.cs: Use `TypeManager.IsValueType' instead of
13242         'type.IsValueType' everywhere.
13243
13244         * typemanager.cs (TypeManager.IsValueType): Return true for type
13245         parameters.  The reason for this is that we need to box a type
13246         parameter when converting it to a reference type.
13247
13248         * cs-parser.jay: Added support for default value expressions.
13249
13250         * generics.cs (DefaultValueExpression): New public class.       
13251
13252 2003-10-17  Martin Baulig  <martin@ximian.com>
13253
13254         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13255         TypeContainer so we can also use this for Interfaces.
13256         (TypeParameter.Resolve): Likewise.
13257
13258         * interface.cs (Interface.DefineType): Added support for generic
13259         interfaces.
13260
13261         * cs-parser.jay: Added support for generic structs and interfaces.
13262
13263 2003-10-17  Martin Baulig  <martin@ximian.com>
13264
13265         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13266         call generic methods :-)
13267
13268 2003-10-16  Martin Baulig  <martin@ximian.com>
13269
13270         * cs-parser.jay (namespace_or_type_name): Only create a
13271         GenericMemberAccess if we actually have type arguments.
13272
13273 2003-10-13  Martin Baulig  <martin@ximian.com>
13274
13275         * class.cs (Method.Define): If we're a generic method, call
13276         TypeBuilder.DefineGenericMethod () before resolving
13277         the parameters.
13278         (MethodData): Added .ctor which takes an additional MethodBuilder
13279         argument; this is used for generic methods.
13280         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13281         we already have a MethodBuilder.
13282
13283 2003-10-10  Martin Baulig  <martin@ximian.com>
13284
13285         * class.cs (Method): Added .ctor which takes a `GenericMethod'
13286         instead of a `DeclSpace'.  This is used for generic methods.
13287
13288         * cs-parser.jay (method_header): Added support for generic
13289         methods; create a `GenericMethod' instance and pass it to the
13290         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13291         parameters and locals.
13292
13293         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13294         since we already have the location.  Check whether we're a generic
13295         type declaration or a generic method and create the correct type
13296         parameter.
13297
13298         * generic.cs (TypeParameter.DefineMethod): New public method.
13299         (GenericMethod): New public class; derives from DeclSpace and is
13300         used for generic methods.       
13301
13302 2003-10-09  Martin Baulig  <martin@ximian.com>
13303
13304         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13305         to the .ctor.
13306         (MethodCore.DoDefineParameters): Removed the TypeContainer
13307         argument; use the DeclSpace which was passed to the .ctor instead.
13308         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13309         TypeContainer; we only need a DeclSpace here.
13310
13311 2003-10-09  Martin Baulig  <martin@ximian.com>
13312
13313         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13314         to the .ctor.
13315         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13316         EmitContext's .ctor.    
13317
13318 2003-10-09  Martin Baulig  <martin@ximian.com>
13319
13320         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13321         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13322         AsAccessible(), moved them as well.
13323
13324         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13325
13326 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13327
13328         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13329         generation for >=, as spotted by Paolo, bug 48679.  
13330         Patch from David Waite.
13331
13332         * cs-tokenizer.cs: Add handling for #pragma.
13333
13334         * cs-parser.jay: Allow for both yield and yield return in the
13335         syntax.  The anti-cobolization of C# fight will go on!
13336
13337         * class.cs (TypeBuilder.DefineType): Catch error condition here
13338         (Parent.DefineType erroring out and returning null).
13339
13340         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13341         coping with enumerations variables, we were mistakenly processing
13342         them as a regular value type instead of built-in types.  Fixes the
13343         bug #48063
13344
13345         * typemanager.cs (IsBuiltinOrEnum): New method.
13346
13347 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13348
13349         * cs-parser.jay: Upgrade: yield now needs the return clause.
13350
13351 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13352
13353         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13354
13355 2003-09-29  Martin Baulig  <martin@ximian.com>
13356
13357         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13358         inflated generic methods.
13359
13360         * generics.cs (ConstructedType): Distinguish between open and
13361         closed constructed types; correctly resolve the arguments.
13362
13363 2003-09-22  Martin Baulig  <martin@ximian.com>
13364
13365         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13366         all type arguments meet their constraints.
13367
13368 2003-09-19  Martin Baulig  <martin@ximian.com>
13369
13370         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13371         `MemberCache parent' argument.  Normally, an interface doesn't
13372         have a parent type except System.Object, but we use this in gmcs
13373         for generic type parameters.
13374
13375 2003-09-18  Martin Baulig  <martin@ximian.com>
13376
13377         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13378         on `type.IsInterface'; don't check whether the type has a parent
13379         to determine whether it's an interface.
13380
13381 2003-09-17  Martin Baulig  <martin@ximian.com>
13382
13383         * generic.cs (ConstructedType.ToString): Always use `name' as the
13384         type name.
13385
13386 2003-09-15  Martin Baulig  <martin@ximian.com>
13387
13388         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13389
13390         * generic.cs (Constraints.Resolve): New public method; this is
13391         called to resolve the constraint types and to check whether all
13392         the constraints are correct.
13393         (Constraints.Types): New public property.
13394         (TypeParameter.Resolve): New public method; resolves all the
13395         type's constraints.
13396
13397         * class.cs (TypeContainer.DefineType): Call
13398         TypeParameter.Resolve() before actually defining the type.
13399
13400 2003-09-15  Martin Baulig  <martin@ximian.com>
13401
13402         * class.cs (TypeContainer.DefineType): Added an error flag to
13403         avoid reporting duplicate CS0146's ("class definition is
13404         circular.").
13405
13406         * driver.cs (Driver.MainDriver): Abort if
13407         RootContext.ResolveTree() reported any errors.
13408
13409 2003-09-07  Martin Baulig  <martin@ximian.com>
13410
13411         * report.cs (Error, Warning): Added overloaded versions which take
13412         a `params object[] args' and call String.Format().
13413
13414 2003-09-07  Martin Baulig  <martin@ximian.com>
13415
13416         * decl.cs (DeclSpace..ctor): Don't call
13417         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13418         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13419         (DeclSpace.RecordDecl): New method.
13420
13421         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13422
13423 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13424
13425         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13426         value attributes to be applied to ParameterBuilders.
13427
13428         * class.cs (MethodCore.LabelParameters): Make static and more
13429         generic so that it can be used from other places - like interface
13430         methods, for instance.
13431
13432         * interface.cs (Interface.Emit): Call LabelParameters before
13433         emitting attributes on the InterfaceMethod.
13434
13435 2003-09-07  Martin Baulig  <martin@ximian.com>
13436
13437         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13438         if the number of type parameters doesn't match.
13439
13440 2003-09-04  Martin Baulig  <martin@ximian.com>
13441
13442         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13443         for arrays of generic type params (ie. `!0[]').
13444
13445 2003-09-04  Martin Baulig  <martin@ximian.com>
13446
13447         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13448         for the moment.
13449
13450 2003-09-04  Martin Baulig  <martin@ximian.com>
13451
13452         * decl.cs (DeclSpace.LookupGeneric): New method.
13453         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13454         moment.
13455
13456         * generic.cs (TypeParameterExpr): Take a TypeParameter as
13457         argument, not just a string.
13458         (TypeParameter.Define): New public method; this is called to
13459         actually define the generic parameter; after this, you can use the
13460         new `Type' property to get the type.
13461
13462 2003-09-04  Martin Baulig  <martin@ximian.com>
13463
13464         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13465         is now an ArrayList; initialize the result of the `TypeParameters'
13466         property here.
13467         (DeclSpace.GetGenericData): Removed.
13468         (DeclSpace.LookupGeneric): Temporarily removed; we need to
13469         implement this in a different way.
13470         (DeclSpace.GetTypeParameters): Removed; there's now a
13471         `TypeParameters' property.
13472         (DeclSpace.TypeParameters): New public property.
13473
13474         * generic.cs (Constraints): Make this class public.
13475         (TypeParameter): New public class.
13476
13477 2003-09-04  Martin Baulig  <martin@ximian.com>
13478
13479         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13480         generic parameters.
13481
13482         * class.cs (TypeContainer.DefineType): Call
13483         TypeBuilder.DefineGenericParameter () on all generic parameters if
13484         this is a generic type.
13485
13486 2003-08-28  Martin Baulig  <martin@ximian.com>
13487
13488         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13489         sample-stack.il".
13490
13491         * sample-hello.cs: Compile this with gmcs: "gmcs
13492         /r:sample-stack.dll sample-hello.cs".
13493
13494 2003-08-28  Martin Baulig  <martin@ximian.com>
13495
13496         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13497         the parameters to the generic type.
13498
13499 2003-08-28  Martin Baulig  <martin@ximian.com>
13500
13501         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13502
13503 2003-08-28  Martin Baulig  <martin@ximian.com>
13504
13505         * cs-parser.jay (opt_type_argument_list): Use
13506         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13507         (primary_expression): Replace `qualified_identifier' with `type_name'.
13508         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13509
13510         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13511         parser to check whether it is syntactically a type parameter list;
13512         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13513         this case.
13514
13515 2003-08-26  Martin Baulig  <martin@ximian.com>
13516
13517         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13518         resolving aliases; fixes #47927.
13519
13520 2003-08-26  Martin Baulig  <martin@ximian.com>
13521
13522         * statement.cs (Using.DoResolve): This is internally emitting a
13523         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13524         do not always return.  Fixes #47681.
13525
13526 2003-08-26  Martin Baulig  <martin@ximian.com>
13527
13528         * decl.cs (MemberCore): Moved WarningNotHiding(),
13529         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13530         into MemberBase.
13531         (AdditionResult): Make this nested in DeclSpace.
13532         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13533         argument; call NamespaceEntry.Define() unless we're nested in a
13534         class or struct.
13535
13536         * namespace.cs (Namespace.DefineName): New public function.  This
13537         is called from DeclSpace's .ctor to add 
13538         (Namespace.Lookup): Include DeclSpaces in the lookup.
13539
13540         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13541
13542         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13543
13544 2003-08-25  Martin Baulig  <martin@ximian.com>
13545
13546         * convert.cs (Convert.ExplicitReferenceConversion): When
13547         converting from an interface type to a class, unbox if the target
13548         type is a struct type.  Fixes #47822.
13549
13550 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13551
13552         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13553         #47854.
13554
13555 2003-08-22  Martin Baulig  <martin@ximian.com>
13556
13557         * class.cs (TypeManager.DefineType): When defining a nested type,
13558         call DefineType() on our parent; fixes #47801.
13559
13560 2003-08-22  Martin Baulig  <martin@ximian.com>
13561
13562         * class.cs (MethodData.Define): While checking if a method is an
13563         interface implementation, improve the test a bit more to fix #47654.
13564
13565 2003-08-22  Martin Baulig  <martin@ximian.com>
13566
13567         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13568         correctly; fixes #47722.
13569
13570 2003-08-22  Martin Baulig  <martin@ximian.com>
13571
13572         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13573         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13574
13575         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13576
13577 2003-08-22  Martin Baulig  <martin@ximian.com>
13578
13579         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13580         can only be assigned in static constructors.  Fixes #47161.
13581
13582 2003-08-22  Martin Baulig  <martin@ximian.com>
13583
13584         Rewrote and improved the flow analysis code.
13585
13586         * flowbranching.cs (FlowBranching): Make this class abstract.
13587         (FlowBranching.CreateBranching): New static function to create a
13588         new flow branching.
13589         (FlowBranchingBlock, FlowBranchingException): New classes.
13590         (FlowBranching.UsageVector.Type): New public readonly field.
13591         (FlowBranching.UsageVector.Breaks): Removed the setter.
13592         (FlowBranching.UsageVector.Returns): Removed the setter.
13593         (FlowBranching.UsageVector): Added Break(), Return(),
13594         NeverReachable() and Throw() methods to modify the reachability.
13595         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13596         done by FlowBranching.Merge().
13597         (FlowBranching.UsageVector.MergeChild): New method; merges the
13598         merge result into the current vector.
13599         (FlowBranching.Merge): New abstract method to merge a branching.
13600
13601 2003-08-12  Martin Baulig  <martin@ximian.com>
13602
13603         * expression.cs (Indirection.CacheTemporaries): Create the
13604         LocalTemporary with the pointer type, not its element type.
13605
13606 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13607
13608         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13609         token was a keyword or not.
13610
13611         Add `error' options where an IDENTIFIER was expected;  Provide
13612         CheckToken and CheckIdentifierToken convenience error reporting
13613         functions. 
13614
13615         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13616
13617         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13618         NameSpaceEntry NameSpaceEntry.
13619
13620         (LookupInterfaceOrClass): Avoid creating a full qualified name
13621         from namespace and name: avoid doing lookups when we know the
13622         namespace is non-existant.   Use new Tree.LookupByNamespace which
13623         looks up DeclSpaces based on their namespace, name pair.
13624
13625         * driver.cs: Provide a new `parser verbose' to display the
13626         exception thrown during parsing.  This is turned off by default
13627         now, so the output of a failure from mcs is more graceful.
13628
13629         * namespace.cs: Track all the namespaces defined in a hashtable
13630         for quick lookup.
13631
13632         (IsNamespace): New method
13633
13634 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13635
13636         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13637         we know that we need to concatenate (full typename can never be
13638         null). 
13639
13640         * class.cs: ditto.
13641
13642         * statement.cs: Use a bitfield;  Do not initialize to null things
13643         which are done by the constructor by default.
13644
13645         * cs-parser.jay: bug fix, parameter was 4, not 3.
13646
13647         * expression.cs: Just use the property;
13648
13649         * statement.cs: No need for GetVariableInfo method.
13650
13651 2003-08-08  Martin Baulig  <martin@ximian.com>
13652
13653         * flowanalysis.cs (FlowReturns): This is now nested in the
13654         `FlowBranching' class.
13655         (MyBitVector): Moved this here from statement.cs.
13656         (FlowBranching.SiblingType): New enum type.
13657         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13658
13659 2003-08-07  Martin Baulig  <martin@ximian.com>
13660
13661         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13662         `FlowBranching' class and called `BranchingType'.
13663
13664 2003-08-07  Martin Baulig  <martin@ximian.com>
13665
13666         * flowanalysis.cs: Moved all the control flow analysis code into
13667         its own file.
13668
13669 2003-08-07  Martin Baulig  <martin@ximian.com>
13670
13671         * assign.cs (Assign.DoResolve): `target' must either be an
13672         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13673         #37319.
13674
13675 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13676
13677         * expression.cs (BinaryMethod): This kind of expression is created by the
13678         Binary class if it determines that the operator has to be handled
13679         by a method.
13680
13681         (BinaryDelegate): This kind of expression is created if we are
13682         dealing with a + or - operator on delegates.
13683
13684         (Binary): remove method, argumetns, and DelegateOperator: when
13685         dealing with methods, 
13686
13687         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13688
13689         * statement.cs (Block): use bitfields for the three extra booleans
13690         we had in use.   Remove unused topblock parameter.
13691
13692         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13693
13694         * assign.cs: Drop extra unneeded tests.
13695
13696 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13697
13698         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13699
13700         * statement.cs (Foreach): Use VariableStorage instead of
13701         LocalBuilders.   
13702
13703         * codegen.cs (VariableStorage): New class used by clients that
13704         require a variable stored: locals or fields for variables that
13705         need to live across yield.
13706
13707         Maybe provide a convenience api for EmitThis+EmitLoad?
13708
13709         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13710         these bad boys.
13711
13712 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13713
13714         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13715         RemapParameterLValue): New methods that are used to turn a
13716         precomputed FieldInfo into an expression like this:
13717
13718                 instance.FieldInfo
13719
13720         The idea is to use this instead of making LocalVariableReference
13721         have more than one meaning.
13722
13723         * cs-parser.jay: Add error production to BASE.
13724
13725         * ecore.cs: Deal with TypeManager.GetField returning null, which
13726         is now a valid return value.
13727
13728         (FieldExprNoAddress): New expression for Fields whose address can
13729         not be taken.
13730
13731         * expression.cs (LocalVariableReference): During the resolve
13732         phases, create new expressions if we are in a remapping context.
13733         Remove code that dealt with remapping here.
13734
13735         (ParameterReference): same.
13736
13737         (ProxyInstance): New expression, like the `This' expression, but
13738         it is born fully resolved.  We know what we are doing, so remove
13739         the errors that are targeted to user-provided uses of `this'.
13740
13741         * statement.cs (Foreach): our variable is now stored as an
13742         Expression;  During resolution, follow the protocol, dont just
13743         assume it will return this.
13744
13745 2003-08-06  Martin Baulig  <martin@ximian.com>
13746
13747         * support.cs (SeekableStreamReader.cs): New public class.
13748
13749         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13750         SeekableStreamReader instead of the normal StreamReader.
13751
13752 2003-08-04  Martin Baulig  <martin@ximian.com>
13753
13754         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13755         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13756         deambiguate casts and delegate invocations.
13757         (parenthesized_expression): Use the new tokens to ensure this is
13758         not a cast of method invocation.
13759
13760         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13761         when reading a `)' and Deambiguate_CloseParens () was previously
13762         called.
13763
13764         * expression.cs (ParenthesizedExpression): New class.  This is
13765         just used for the CS0075 test.
13766         (Binary.DoResolve): Check for CS0075.   
13767
13768 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13769
13770         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13771         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13772         reference comparison.
13773
13774         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13775         examine the ReturnType for equality - this is necessary in the
13776         cases of implicit and explicit operators whose signature also
13777         includes the return type.
13778
13779 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13780
13781         * namespace.cs: Cache the result of the namespace computation,
13782         instead of computing it every time.
13783
13784 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13785
13786         * decl.cs: Use a global arraylist that we reuse over invocations
13787         to avoid excesive memory consumption.  Reduces memory usage on an
13788         mcs compile by one meg (45 average).
13789
13790         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13791         private, work around that.
13792
13793 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13794
13795         * literal.cs (IntLiteral): Define Zero and One static literals. 
13796
13797         * cs-parser.jay (integer_literal): use static literals to reduce
13798         memory usage for the most used literals (0, 1 and -1).  211kb
13799         reduced in memory usage.
13800
13801         Replace all calls to `new ArrayList' with `new
13802         ArrayList(4)' which is a good average number for most allocations,
13803         and also requires only 16 bytes of memory for its buffer by
13804         default. 
13805
13806         This reduced MCS memory usage in seven megabytes for the RSS after
13807         bootstrapping.
13808
13809 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13810
13811         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13812         handle params methods the correct way by forming only one
13813         applicable set with params and normal methods in them. Earlier we
13814         were looking at params methods only if we found no normal methods
13815         which was not the correct thing to do.
13816
13817         (Invocation.BetterFunction): Take separate arguments indicating
13818         when candidate and the best method are params methods in their
13819         expanded form.
13820
13821         This fixes bugs #43367 and #46199.
13822
13823         * attribute.cs: Documentation updates.
13824
13825         (CheckAttribute): Rename to CheckAttributeTarget.
13826         (GetValidPlaces): Rename to GetValidTargets.
13827
13828         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13829         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13830
13831         Fixes bug #44468.
13832
13833 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13834
13835         * codegen.cs: Compute IsGeneric correctly.
13836
13837         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13838         resolution. 
13839
13840         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13841         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13842         regressions, and I was chasing more bugs than I required.
13843
13844         * interface.cs: Use expressions for base type names (like classes
13845         and structs have been doing for a while now), and resolve that.
13846         This patch should probably go into head as well.
13847
13848         This makes it one less user of FindType.
13849
13850 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13851
13852         This compiler can not self host currently.  Need to fix that.
13853         
13854         * Makefile: compile to `gmcs.exe'
13855
13856         * driver.cs: Turn on v2 by default on gmcs.
13857
13858         * generic.cs (ConstructedType): Does no longer take a container
13859         type argument;  That will be taken care of later.
13860
13861         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13862         Use SimpleName to resolve for now, so we can continue the work on
13863         the parser, until we get Type.GetType that understands generics.
13864
13865         (ConstructedType.ToString): Implement
13866
13867         (TypeArguments.Resolve): Resolve the child expressions as types. 
13868         
13869         * cs-parser.jay: Rename interface_constraints to
13870         type_parameter_constraints
13871
13872         (namespace_or_type_name): Only use constructed types for the basic
13873         construction, we will deal with identifier<...> later.
13874
13875         (type/type_name): No longer call DecomposeQI, as
13876         namespace_or_type_name is always decoded now.
13877         
13878 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13879
13880         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13881         closely: we eliminate methods in base types when we have an
13882         applicable method in a top-level type.
13883
13884         Please see section 14.5.5.1 for an exact description of what goes
13885         on. 
13886
13887         This fixes bug #45127 and a host of other related to corlib compilation.
13888
13889         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13890         array is the method corresponding to the top-level type (this is
13891         because of the changes made to icall.c) so we change this
13892         accordingly.
13893
13894         (MethodGroupExpr.Name): This too.
13895
13896         * typemanager.cs (GetElementType): New method which does the right
13897         thing when compiling corlib. 
13898
13899         * everywhere: Make use of the above in the relevant places.
13900
13901 2003-07-22  Martin Baulig  <martin@ximian.com>
13902
13903         * cs-parser.jay (invocation_expression): Moved
13904         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13905         `cast_expression', but create a InvocationOrCast which later
13906         resolves to either an Invocation or a Cast.
13907
13908         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13909         method; call this before EmitStatement() to make sure that this
13910         expression can be used as a statement.
13911
13912         * expression.cs (InvocationOrCast): New class; resolves to either
13913         an Invocation or a Cast.
13914
13915         * statement.cs (StatementExpression): Call ResolveStatement() on
13916         the ExpressionStatement before emitting it.
13917
13918 2003-07-21  Martin Baulig  <martin@ximian.com>
13919
13920         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13921         `ref' and `out' attributes match; fixes #46220.
13922         (MemberAccess.ResolveMemberAccess): You can't reference a type
13923         through an expression; fixes #33180.
13924         (Indexers.GetIndexersForType): Don't return the indexers from
13925         interfaces the class implements; fixes #46502.
13926
13927 2003-07-21  Martin Baulig  <martin@ximian.com>
13928
13929         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13930         CS0661 checks; fixes bug #30442.
13931
13932 2003-07-21  Martin Baulig  <martin@ximian.com>
13933
13934         * decl.cs (AdditionResult): Added `Error'.
13935
13936         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13937
13938         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13939         cs0031.cs actually work.
13940
13941  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13942  
13943         * cs-parser.jay (namespace_name): do not use
13944         namespace_or_type_name, use qualified_identifier, because
13945         namespace_or_type_name will soon return a composed expression
13946         instead of a string.
13947  
13948         (namespace_or_type_name): Instead of returning a string, now this
13949         production returns an expression.
13950  
13951         * codegen.cs (EmitContext): Setup IsGeneric property based on
13952         whether our DeclSpace is generic, our the method is generic.
13953  
13954         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13955         the method is generic.
13956  
13957         * cs-parser.jay (type_arguments, opt_type_argument_list,
13958         type_parameters, type_parameter_list, opt_type_parameter_list,
13959         type_parameter,, opt_type_parameter_constraints_clauses,
13960         type_parameter_constraints_clauses,
13961         type_parameter_constraint_clause, type_parameter_constraint,
13962         interface_constraints): Add new production
13963  
13964         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13965         DeclSpace is generic or not.
13966  
13967         (DeclSpace.SetParameterInfo): New routine, used to set the
13968         parameter info for a type.
13969  
13970         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13971         returns a GenericTypeExpr
13972  
13973         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13974         generic, lookup the generic argument.
13975  
13976         * attribute.cs: Do not allow TypeParameterExpressions in
13977         Attributes.
13978  
13979         * class.cs: Do not allow the Main method to be defined in a
13980         Generic container.
13981  
13982         * expression.cs (SizeOf): Do not allow generic types to be used as
13983         arguments to sizeof.
13984  
13985         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13986         it: whether a type is generic or not.  Only works for types we are
13987         currently building for now.
13988         
13989 2003-07-20  Martin Baulig  <martin@ximian.com>
13990
13991         * namespace.cs: Fixed that bug which caused a crash when compiling
13992         the debugger's GUI.
13993
13994 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13995
13996         * typemanager.cs (LookupTypeReflection): Never expose types which
13997         are NotPublic, NestedPrivate, NestedAssembly, or
13998         NestedFamANDAssem.  We used to return these, and later do a check
13999         that would report a meaningful error, but the problem is that we
14000         would not get the real match, if there was a name override.
14001
14002 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14003
14004         * namespace.cs (Namespace, Name): Do not compute the namespace
14005         name dynamically, compute it in the constructor.  This reduced
14006         memory usage by 1697 KB.
14007
14008         * driver.cs: Use --pause to pause at the end.
14009
14010 2003-07-17  Peter Williams  <peter@newton.cx>
14011
14012         * Makefile: Change the name of the test target so that it doesn't
14013         conflict with the recursive test target.
14014
14015 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14016
14017         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14018         AddressOf): Do not use EmitThis, that was wrong, use the actual
14019         this pointer.
14020
14021 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14022
14023         * class.cs (MethodData.Define): While checking if a method is an
14024         interface implementation, improve the test: If we are not public
14025         (use new test here: use the computed MethodAttributes directly,
14026         instead of the parsed modifier flags) check if the `implementing'
14027         method comes from an interface or not.
14028
14029         * pending.cs (VerifyPendingMethods): Slightly better error
14030         message.
14031
14032         * makefile: add test target that does the mcs bootstrap.
14033
14034 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14035
14036         * interface.cs (Define): Do nothing here since there are no
14037         members to populate etc. Move the attribute emission out of here
14038         since this was just totally the wrong place to put it. Attribute
14039         application happens during the 'Emit' phase, not in the 'Define'
14040         phase.
14041
14042         (Emit): Add this method and move the attribute emission here
14043
14044         * rootcontext.cs (EmitCode): Call the Emit method on interface
14045         types too.
14046
14047 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14048
14049         * expression.cs (OverloadResolve): Report error only if Location
14050         is not 'Null' which means that there was a probe going on.
14051
14052 2003-07-14  Martin Baulig  <martin@ximian.com>
14053
14054         * expression.cs (ConditionalLogicalOperator): New public class to
14055         implement user defined conditional logical operators.
14056         This is section 14.11.2 in the spec and bug #40505.
14057
14058 2003-07-14  Martin Baulig  <martin@ximian.com>
14059
14060         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14061
14062 2003-07-14  Martin Baulig  <martin@ximian.com>
14063
14064         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14065
14066         * ecore.cs (IVariable.VerifyFixed): New interface method.
14067
14068         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14069         operator, check whether the variable is actually fixed.  Fixes bug
14070         #36055.  Set a variable definitely assigned when taking its
14071         address as required by the spec.
14072
14073         * statement.cs (LocalInfo.IsFixed): New field.
14074         (LocalInfo.MakePinned): Set `IsFixed' to true.
14075
14076 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14077
14078         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14079         for .ctors, ensure that we only ask for members declared in the
14080         attribute type (BindingFlags.DeclaredOnly).
14081
14082         Fixes bug #43632.
14083
14084         * expression.cs (Error_WrongNumArguments): Report error 1501
14085         correctly the way CSC does.
14086
14087 2003-07-13  Martin Baulig  <martin@ximian.com>
14088
14089         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14090         lookup on the fully qualified name, to make things like "X.X" work
14091         where "X.X" is a fully qualified type name, but we also have a
14092         namespace "X" in the using list.  Fixes #41975.
14093
14094 2003-07-13  Martin Baulig  <martin@ximian.com>
14095
14096         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14097         function. If we're a CompoundAssign, we need to create an embedded
14098         CompoundAssign, not an embedded Assign.
14099         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14100         Fixes #45854.
14101
14102 2003-07-13  Martin Baulig  <martin@ximian.com>
14103
14104         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14105         work to fix bug #46088.
14106
14107 2003-07-13  Ravi Pratap <ravi@ximian.com>
14108
14109         * class.cs (Operator.Emit): Do not emit attributes here - it is
14110         taken care of by the Method class that we delegate too. This takes
14111         care of bug #45876.
14112
14113 2003-07-10  Martin Baulig  <martin@ximian.com>
14114
14115         * expression.cs (TypeOfVoid): New class.
14116         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14117
14118 2003-07-10  Martin Baulig  <martin@ximian.com>
14119
14120         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14121         bug #35957.
14122
14123 2003-07-10  Martin Baulig  <martin@ximian.com>
14124
14125         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14126         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14127
14128         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14129
14130         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14131
14132 2003-07-10  Martin Baulig  <martin@ximian.com>
14133
14134         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14135         of decimal.  Fixes #42850.
14136
14137         NOTE: I also fixed the created byte blob, but this doesn't work on
14138         the MS runtime and csc never produces any byte blobs for decimal
14139         arrays.
14140
14141 2003-07-10  Martin Baulig  <martin@ximian.com>
14142
14143         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14144         structs; fixes #32068.
14145         (Block.AddChildVariableNames): Fixed #44302.
14146
14147 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14148
14149         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14150
14151 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14152
14153         * attribute.cs: And this test is onger needed.
14154
14155 2003-07-08  Martin Baulig  <martin@ximian.com>
14156
14157         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14158         inaccessible types.  Fixes #36313.
14159
14160         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14161
14162         * namespace.cs (NamespaceEntry): Create implicit entries for all
14163         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14164         implicit entries for N1.N2 and N1.
14165
14166 2003-07-08  Martin Baulig  <martin@ximian.com>
14167
14168         Rewrote the handling of namespaces to fix a lot of the issues
14169         wrt. `using' aliases etc.
14170
14171         * namespace.cs (Namespace): Splitted this class into a
14172         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14173
14174         * typemanager.cs (TypeManager.IsNamespace): Removed.
14175         (TypeManager.ComputeNamespaces): Only compute namespaces from
14176         loaded assemblies here, not the namespaces from the assembly we're
14177         currently compiling.
14178
14179 2003-07-08  Martin Baulig  <martin@ximian.com>
14180
14181         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14182
14183 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14184
14185         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14186         already fixed it.  
14187
14188         I thought about the memory savings here, but LookupTypeReflection
14189         is used under already very constrained scenarios.  Compiling
14190         corlib or mcs only exposes one hit, so it would not really reduce
14191         any memory consumption.
14192
14193 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14194
14195         * typemanager.cs: fixes bug #45889 by only adding public types from
14196         other assemblies to the list of known types.
14197
14198 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14199
14200         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14201         on the type we resolved.
14202
14203 2003-07-05  Martin Baulig  <martin@ximian.com>
14204
14205         * pending.cs (PendingImplementation.ParentImplements): Don't
14206         create the proxy if the parent is abstract.
14207
14208         * class.cs (TypeContainer.DefineIndexers): Process explicit
14209         interface implementations first.  Fixes #37714.
14210
14211 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14212
14213         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14214         defined recursively;  but since we modify the input parameters
14215         (left is set to `this' temporarily), we reset this value if the
14216         left_is_explicit is false, which gives the original semantics to
14217         the code.  
14218
14219         * literal.cs (NullPointer): new class used to represent a null
14220         literal in a pointer context.
14221
14222         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14223         type is a pointer, use a NullPointer object instead of a
14224         NullLiteral.   Closes 43687
14225
14226         (ExplicitConversion): Convert pointer values using
14227         the conv opcode to the proper type.
14228
14229         * ecore.cs (New): change ValueTypeVariable property into a method,
14230         that returns whether the valuetype is suitable for being used.
14231
14232         * expression.cs (Binary.DoNumericPromotions): Only return if we
14233         the int constant was a valid uint, and we can return both left and
14234         right as uints.  If not, we continue processing, to trigger the
14235         type conversion.  This fixes 39018.
14236
14237         * statement.cs (Block.EmitMeta): During constant resolution, set
14238         the CurrentBlock property on the emitcontext, so that we resolve
14239         constants propertly.
14240
14241 2003-07-02  Martin Baulig  <martin@ximian.com>
14242
14243         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14244         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14245
14246         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14247         than emitting it here.
14248
14249         * statement.cs: Fixed some more flow analysis bugs.
14250
14251 2003-07-02  Martin Baulig  <martin@ximian.com>
14252
14253         * class.cs (MethodData.Define): When implementing interface
14254         methods, set Final unless we're Virtual.
14255
14256         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14257         check work for interface methods.
14258
14259 2003-07-01  Martin Baulig  <martin@ximian.com>
14260
14261         * ecore.cs (EmitContext.This): Replaced this property with a
14262         GetThis() method which takes a Location argument.  This ensures
14263         that we get the correct error location for a CS0188.
14264
14265 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14266
14267         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14268         ImplicitStandardConversion.
14269
14270         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14271
14272 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14273
14274         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14275         optimization.
14276
14277 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14278
14279         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14280         constructors.
14281
14282         (MethodData.Define): Turn off initlocals for unsafe methods.
14283
14284 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14285
14286         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14287         complete;  Fixes #37521.
14288
14289         * delegate.cs: Use Modifiers.TypeAttr to compute the
14290         TypeAttributes, instead of rolling our own.  This makes the flags
14291         correct for the delegates.
14292
14293 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14294
14295         * class.cs (Constructor.Define): Set the private flag for static
14296         constructors as well.
14297
14298         * cs-parser.jay (statement_expression): Set the return value to
14299         null, to avoid a crash when we catch an error.
14300
14301 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14302
14303         * cs-parser.jay: Applied patch from Jackson that adds support for
14304         extern and unsafe modifiers to destructor declarations.
14305
14306         * expression.cs: Report error 21 if the user is trying to index a
14307         System.Array.
14308
14309         * driver.cs: Add an error message, suggested by the bug report.
14310
14311         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14312         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14313
14314 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14315
14316         * namespace.cs: Add some information to reduce FAQs.
14317
14318 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14321         underlying enumeration types.  Fixes #43915.
14322
14323         * expression.cs: Treat ushort/short as legal values to be used in
14324         bitwise operations.
14325
14326 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14327
14328         * delegate.cs: transfer custom attributes for paramenters from
14329         the delegate declaration to Invoke and BeginInvoke.
14330
14331 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14332
14333         * attribute.cs: handle custom marshalers and emit marshal info
14334         for fields, too.
14335
14336 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14337
14338         * makefile.gnu: Added anonymous.cs to the compiler sources.
14339
14340 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14341
14342         * iterators.cs: Change the name of the proxy class to include two
14343         underscores.
14344
14345         * cs-parser.jay: Update grammar to include anonymous methods.
14346
14347         * anonymous.cs: new file.
14348
14349 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14350
14351         * class.cs (Field.Define): Add missing test for pointers and
14352         safety. 
14353
14354 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14355
14356         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14357         we use the stobj opcode.
14358
14359         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14360         since it wasn't the correct fix. 
14361
14362         It still is puzzling that we are required to use stobj for IntPtr
14363         which seems to be a ValueType.
14364
14365 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14366
14367         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14368         during regular simple name resolution.   Now, the trick is that
14369         instead of returning for processing the simplename, we do a
14370         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14371         contextual lookup type).   If a match is found, return that, if
14372         not, return for further composition.
14373
14374         This fixes long-standing 30485.
14375
14376         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14377         using the address to initialize an object, do an Stobj instead of
14378         using the regular Stelem.
14379
14380         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14381         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14382         Because if we are a BaseIndexerAccess that value will be true.
14383         Fixes 43643.
14384
14385         * statement.cs (GotoCase.Resolve): Return after reporting an
14386         error, do not attempt to continue. 
14387
14388         * expression.cs (PointerArithmetic.Emit): If our operand is a
14389         long, convert our constants to match the operand before
14390         multiplying.  Convert to I type before adding.   Fixes 43670.
14391
14392 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14393
14394         * enum.cs (ImplicitConversionExists) : Rename to
14395         ImplicitEnumConversionExists to remove ambiguity. 
14396
14397         * ecore.cs (NullCast): New type of cast expression class which
14398         basically is very similar to EmptyCast with the difference being
14399         it still is a constant since it is used only to cast a null to
14400         something else
14401         (eg. (string) null)
14402
14403         * convert.cs (ImplicitReferenceConversion): When casting a null
14404         literal, we return a NullCast.
14405
14406         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14407         should be around anymore.
14408
14409         The renaming (reported was slightly wrong). Corrections:
14410
14411         ConvertImplicitStandard -> ImplicitConversionStandard
14412         ConvertExplicitStandard -> ExplicitConversionStandard
14413
14414         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14415         before passing them in !
14416
14417         * convert.cs (ImplicitConversionStandard): When comparing for
14418         equal expr and target types, ensure that expr is not a
14419         NullLiteral.
14420
14421         In general, we must not be checking (expr_type ==
14422         target_type) in the top level conversion methods
14423         (ImplicitConversion, ExplicitConversion etc). This checking is
14424         done in the methods that they delegate to.
14425
14426 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14427
14428         * convert.cs: Move Error_CannotConvertType,
14429         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14430         ImplicitNumericConversion, ImplicitConversionExists,
14431         ImplicitUserConversionExists, StandardConversionExists,
14432         FindMostEncompassedType, FindMostSpecificSource,
14433         FindMostSpecificTarget, ImplicitUserConversion,
14434         ExplicitUserConversion, GetConversionOperators,
14435         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14436         TryImplicitIntConversion, Error_CannotConvertImplicit,
14437         ConvertImplicitRequired, ConvertNumericExplicit,
14438         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14439         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14440         its own file.
14441
14442         Perform the following renames:
14443
14444         StandardConversionExists -> ImplicitStandardConversionExists
14445         ConvertImplicit -> ImplicitConversion
14446         ConvertImplicitStandard -> ImplicitStandardConversion
14447         TryImplicitIntConversion -> ImplicitIntConversion
14448         ConvertImplicitRequired -> ImplicitConversionRequired
14449         ConvertNumericExplicit -> ExplicitNumericConversion
14450         ConvertReferenceExplicit -> ExplicitReferenceConversion
14451         ConvertExplicit -> ExplicitConversion
14452         ConvertExplicitStandard -> ExplicitStandardConversion
14453
14454 2003-05-19  Martin Baulig  <martin@ximian.com>
14455
14456         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14457         (TypeInfo): Added support for structs having structs as fields.
14458
14459         * ecore.cs (FieldExpr): Implement IVariable.
14460         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14461         VariableInfo for the field.
14462
14463 2003-05-18  Martin Baulig  <martin@ximian.com>
14464
14465         * expression.cs (This.DoResolve): Report a CS0027 if we're
14466         emitting a field initializer.
14467
14468 2003-05-18  Martin Baulig  <martin@ximian.com>
14469
14470         * expression.cs (This.ResolveBase): New public function.
14471         (This.DoResolve): Check for CS0188.
14472
14473         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14474         This.Resolve().
14475
14476         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14477         `instance_expression' to null if we don't have any non-static
14478         methods.
14479
14480 2003-05-18  Martin Baulig  <martin@ximian.com>
14481
14482         Reworked the way how local variables and parameters are handled by
14483         the flow analysis code.
14484
14485         * statement.cs (TypeInfo, VariableMap): New public classes.
14486         (VariableInfo): New public class.  This is now responsible for
14487         checking whether a variable has been assigned.  It is used for
14488         parameters and local variables.
14489         (Block.EmitMeta): Take the InternalParameters as argument; compute
14490         the layout of the flow vectors here.
14491         (Block.LocalMap, Block.ParameterMap): New public properties.
14492         (FlowBranching): The .ctor doesn't get the InternalParameters
14493         anymore since Block.EmitMeta() now computes the layout of the flow
14494         vector.
14495         (MyStructInfo): This class is now known as `StructInfo' and nested
14496         in `TypeInfo'; we don't access this directly anymore.
14497
14498         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14499         property and removed IsAssigned(), IsFieldAssigned(),
14500         SetAssigned() and SetFieldAssigned(); we now call them on the
14501         VariableInfo so we don't need to duplicate this code everywhere.
14502
14503         * expression.cs (ParameterReference): Added `Block block' argument
14504         to the .ctor.
14505         (LocalVariableReference, ParameterReference, This): The new
14506         VariableInfo class is now responsible for all the definite
14507         assignment stuff.
14508
14509         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14510         IsParameterAssigned, SetParameterAssigned): Removed.
14511
14512 2003-05-18  Martin Baulig  <martin@ximian.com>
14513
14514         * typemanager.cs (InitCoreTypes): Try calling
14515         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14516         the 3-args-version.  Corlib now also needs our `void_type'.
14517         (GetMethod): Added overloaded version which takes an optional
14518         `bool report_errors' to allow lookups of optional methods.
14519
14520 2003-05-12  Martin Baulig  <martin@ximian.com>
14521
14522         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14523         only used for locals and not for parameters.
14524
14525 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14526
14527         * support.cs (InternalParameters.ParameterType): Return the
14528         ExternalType of the parameter.
14529
14530         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14531         they were unused.
14532
14533 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14534
14535         * class.cs (MethodData.Define): Do not set the `newslot' on
14536         interface members, if they are also flagged as "override".
14537
14538         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14539         better code for ++i and i++.  This only works for static fields
14540         and local variables.
14541
14542         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14543         want to pull the DeclSpace out of the builder_to_declspace instead
14544         of the TypeBuilder (like in TypeContainer.FindMembers).
14545
14546         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14547         instead of LookupTypeContainer.  Fixes the crash on .NET for
14548         looking up interface members.
14549
14550         * const.cs: Create our own emit context during the Definition
14551         stage, so that constants are evaluated in the proper context, when
14552         a recursive definition happens.
14553
14554 2003-05-11  Martin Baulig  <martin@ximian.com>
14555
14556         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14557         new block for a switch section.
14558         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14559         the adding/lookup in the switch block.  Fixes #39828.
14560
14561 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14562
14563         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14564         functionality: I needed to convert the data after I had performed
14565         the add/sub operation into the operands type size.
14566
14567         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14568         pass the type for the box operation, otherwise the resulting
14569         object would have been of type object.
14570
14571         (BoxedCast): Add constructor to specify the type to box as.
14572
14573 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14574
14575         * iterators.cs: I was reusing the `count' variable inadvertently,
14576         take steps to not allow this to happen.
14577
14578 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14579
14580         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14581         by creating an array at the point where the params starts and
14582         putting all those arguments there, then adjusting the size of the
14583         array.
14584
14585 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14586
14587         * expression.cs (New.AddressOf): Implement interface
14588         IMemoryLocation.  This is used when the `new' operator is used in
14589         the context of an invocation to a method on a value type.
14590
14591         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14592         example. 
14593
14594         * namespace.cs: Also check the using aliases here.
14595
14596         * driver.cs: Move the test for using validity after the types have
14597         been entered, so we do a single pass that also includes the using
14598         aliases. 
14599
14600         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14601         in the regular case.   CreateSiblingForFinally is doing extra
14602         error checking.
14603
14604         * attribute.cs (GetAttributeArgumentExpression): Store the result
14605         on an out value, and use the return value to indicate failure
14606         instead of using null (which is a valid return for Constant.GetValue).
14607
14608         * statement.cs: Perform the analysis flow for the increment
14609         portion after the statement, because this will be the real flow of
14610         execution.  Fixes #42385
14611
14612         * codegen.cs (EmitContext.EmitArgument,
14613         EmitContext.EmitStoreArgument): New helper functions when the
14614         RemapToProxy flag is set.
14615
14616         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14617         function.
14618
14619         Add support for remapping parameters. 
14620
14621         * iterators.cs: Propagate parameter values;  Store parameter
14622         values in the proxy classes.
14623
14624 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14625
14626         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14627         need a proxy reference;  I do not know what I was thinking
14628
14629         * cs-parser.jay (constructor_initializer): catch another error,
14630         and display nice message.
14631
14632         (field_declaration): catch void field declaration
14633         to flag a better error. 
14634
14635         * class.cs (MemberBase.CheckBase): Report an error instead of a
14636         warning if a new protected member is declared in a struct. 
14637         (Field.Define): catch the error of readonly/volatile.
14638
14639         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14640
14641         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14642         volatile variable is taken
14643
14644 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14645
14646         * statement.cs (Fixed.Resolve): Report an error if we are not in
14647         an unsafe context.
14648
14649 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14650
14651         * typemanager.cs: reuse the code that handles type clashes for
14652         delegates and enumerations.
14653
14654         * class.cs (Report28): Always report.
14655
14656         * expression.cs (EncodeAsAttribute): Allow nulls here.
14657
14658 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14659
14660         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14661         the functionality for testing whether an expression is valid for
14662         an attribute here.  Also handle the case of arrays of elements
14663         being stored. 
14664
14665         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14666         encoding a linear array into an array of objects that are suitable
14667         to be passed to an CustomAttributeBuilder.
14668
14669         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14670
14671         * ecore.cs: (FieldExpr): Handle field remapping here.
14672
14673         * iteratators.cs: Pass the instance variable (if the method is an
14674         instance method) to the constructors, so we can access the field
14675         variables on the class.
14676
14677         TODO: Test this with structs.  I think the THIS variable on
14678         structs might have to be a pointer, and not a refenrece
14679
14680 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14681
14682         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14683         local variables to fields in a proxy class.
14684
14685         * iterators.cs (PopulateProxy): Rename our internal fields to
14686         <XXX>.  
14687         Create a <THIS> field if we are an instance method, so we can
14688         reference our parent container variables.
14689         (MapVariable): Called back from the EmitContext code to enter a
14690         new variable to field mapping into the proxy class (we just create
14691         a FieldBuilder).
14692
14693         * expression.cs
14694         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14695         for using the remapped locals to fields.
14696
14697         I placed the code here, because that gives the same semantics to
14698         local variables, and only changes the Emit code.
14699
14700         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14701         statements inside iterators.
14702         (VariableInfo): Add a FieldBuilder for the cases when we are
14703         remapping local variables to fields in a proxy class
14704
14705         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14706         current_block != null.
14707
14708         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14709         not cope with strings, as it has been moved to the
14710         TableSwitchEmit.  Fixed bug in switch generation.
14711
14712         * expression.cs (New.DoResolve): Provide more context for the user
14713         when reporting an error.
14714
14715         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14716         pointers. 
14717
14718         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14719         check the permissions for it.  Note than in a type-resolution
14720         context the check was already present in DeclSpace.ResolveType,
14721         but was missing from the MemberAccess.
14722
14723         (ArrayCreation.CheckIndices): warn if the user has
14724         more nested levels of expressions, but there are no more
14725         dimensions specified.  Avoids crash on bug 41906.
14726
14727 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14728
14729         * statement.cs (Block): replace Implicit bool, for a generic
14730         flags.   
14731         New flag: `Unchecked'.  This is used during the EmitMeta phase
14732         (which is out-of-line with the regular Resolve/Emit process for a
14733         statement, as this is done ahead of time, but still gets a chance
14734         to call constant resolve).
14735
14736         (Block.Flags): new enum for adding a new flag.
14737
14738         (Block.EmitMeta): track the state of unchecked.
14739
14740         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14741         to enable constant resolution to work there as well.
14742
14743 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14744
14745         * typemanager.cs (ienumerable_type): Also look up
14746         System.Collections.IEnumerable. 
14747
14748 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14749
14750         TODO: Test more than one conditional per method.
14751
14752         * class.cs (Indexer.Define): Report the location where the user is
14753         referencing the unsupported feature.
14754
14755         (MethodData): Overload the use of `conditionals' to
14756         minimize the creation of needless ArrayLists.   This saves roughly
14757         212kb on my machine.
14758
14759         (Method): Implement the new IIteratorContainer interface.
14760         (Method.SetYields): Implement the method by setting the ModFlags
14761         to contain METHOD_YIELDS.
14762
14763         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14764         which just got set to null.
14765
14766         * iterators.cs: New file.
14767
14768         (Yield, YieldBreak): New statements.
14769
14770         * statement.cs (Return.Resolve): Flag an error if we are used in
14771         an iterator method.
14772
14773         * codegen.cs (InIterator): New flag set if the code is being
14774         compiled in an iterator method.
14775
14776         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14777         internal modifier, and we just use it to avoid adding extra
14778         fields, as this is seldom used.  
14779
14780         * cs-parser.jay: Add yield_statement (yield and yield break).
14781
14782         * driver.cs: New flag -v2 to turn on version 2 features. 
14783
14784         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14785         hashtable when v2 is enabled.
14786
14787 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14788
14789         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14790         there is already a namespace defined with this name.
14791
14792         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14793         people upgraded their corlibs.
14794
14795         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14796         always use fully qualified types, no need to use the compiler
14797         front end.
14798
14799         (TypeManager.IsNamespace): Use binarysearch.
14800
14801         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14802         AddDelegate): I did not quite use the new IsValid API properly: I
14803         have to pass the short-name and the fullname.  I was passing only
14804         the basename instead of the fullname sometimes. 
14805
14806         (TypeContainer.DefineType): call NamespaceClash.
14807
14808         * interface.cs (Interface.DefineType): use NamespaceClash before
14809         defining the type.
14810
14811         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14812         defining the type.
14813
14814         * enum.cs: (Enum.DefineType): use NamespaceClash before
14815         defining the type.
14816
14817         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14818         speed increase.  First, use the negative_hits cache when we get a
14819         negative.  Second, add the type with its full original name
14820         instead of the new . and + encoded name (reflection uses + to
14821         separate type from a nested type).  Use LookupTypeReflection
14822         directly which bypasses the type->name hashtable (that we already
14823         know does not contain the type.
14824
14825         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14826         location/container type. 
14827
14828         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14829
14830 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14831
14832         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14833
14834         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14835         method is being referenced in the method group from a static
14836         context, and report error 120 if so.
14837
14838         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14839         Error118. 
14840
14841         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14842         is created, we create the A namespace).
14843
14844         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14845         Fixes #41591
14846
14847 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14848
14849         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14850         invocation to ModuleBuilder.GetType with the same values will
14851         return a new type instance, so we need to cache its return
14852         values. 
14853
14854         * expression.cs (Binary.ResolveOperator): Only allow the compare
14855         operators on enums if they are of the same type.
14856
14857         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14858         types of ValueType on their own case.  Before we were giving them
14859         the same treatment as objects.
14860
14861         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14862         fullname.  Short name is used to compare against container name.
14863         Fullname is used to check against defined namespace names.
14864
14865         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14866         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14867
14868         (Method.CheckBase): Call parent.
14869         (MemberBase.CheckBase): Check for protected members on sealed
14870         classes.
14871         (PropertyBase.CheckBase): Call parent.
14872         (Field.Define): Call parent.
14873
14874         * report.cs: Negative error codes are now mapped to 8000 - code,
14875         so that the display is render more nicely.
14876
14877         * typemanager.cs: Do not use try/catch, instead report a regular
14878         error. 
14879
14880         (GetPointerType, GetReferenceType): These methods provide
14881         mechanisms to obtain the T* and T& from a T.  We had the code
14882         previously scattered around the code base, and it also used
14883         TypeManager.LookupType that would go through plenty of caches.
14884         This one goes directly to the type source.
14885
14886         In some places we did the Type.GetType followed by
14887         ModuleBuilder.GetType, but not in others, so this unifies the
14888         processing as well.
14889
14890         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14891         statements now that we have namespace information.
14892
14893         * typemanager.cs (IsNamespace): New method, returns whether the
14894         string presented is a namespace or not.
14895
14896         (ComputeNamespaces): New public entry point, computes the list of
14897         available namespaces, using the GetNamespaces API call in Mono, or
14898         the slower version in MS.NET.   
14899
14900         Now before we start the semantic analysis phase, we have a
14901         complete list of namespaces including everything that the user has
14902         provided.
14903
14904         Deleted old code to cache namespaces in .nsc files.
14905
14906 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14907
14908         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14909         class/struct location definition Location for the implicit
14910         constructor location.
14911
14912         (Operator.Define): Use the location of the operator for the
14913         implicit Method definition.
14914
14915         (Constructor.Emit): use the constructor location for the implicit
14916         base initializer constructor.
14917
14918         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14919         and the Expression class now contains two new methods:
14920
14921         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14922         isolate type lookup from the rest of the resolution process.
14923
14924         Since we use Expressions to hold type definitions due to the way
14925         we parse the input we have historically overloaded Resolve to
14926         perform the Type lookups if a special flag is passed.  Now this is
14927         eliminated and two methods take their place. 
14928
14929         The differences in the two methods between xStep and xTerminal is
14930         that xStep is involved in our current lookup system that uses
14931         SimpleNames to compose a name, while xTerminal is used just to
14932         catch the case where the simplename lookup failed.
14933
14934 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14935
14936         * expression.cs (ResolveMemberAccess): Remove redundant code.
14937         TypeExpr expressions are always born fully resolved.
14938
14939         * interface.cs (PopulateMethod): Do not lookup the types twice.
14940         We were doing it once during SemanticAnalysis and once during
14941         PopulateMethod.
14942
14943         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14944         in local variable type definitions, were being returned as a
14945         SimpleName (we decomposed everything into a string), that is
14946         because primary_expression was being used instead of a type in the
14947         grammar (reduce/reduce conflicts).
14948
14949         The part that was wrong is that we converted the expression into a
14950         string (an oversimplification in one hand, compounded with primary
14951         expressions doing string concatenation).
14952
14953         So things like:
14954
14955         A.B.C [] x;
14956
14957         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14958         using clauses from working on this particular context.  And a type
14959         was being matched directly against "A.B.C[]".
14960
14961         We now use the correct approach, and allow for ComposedCast to be
14962         part of the unary expression.  So the "A.B.C []" become a composed
14963         cast of "A.B.C" (as a nested group of MemberAccess with a
14964         SimpleName at the end) plus the rank composition "[]". 
14965
14966         Also fixes 35567
14967
14968 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14969
14970         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14971         for the access level checking.
14972
14973         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14974         `TypeContainer container', because I kept getting confused when I
14975         was debugging this code.
14976
14977         * expression.cs (Indexers): Instead of tracking getters/setters,
14978         we now track them in parallel.  We create one arraylist less, but
14979         most importantly it is possible now for the LValue code to find a
14980         matching get for a set.
14981
14982         (IndexerAccess.DoResolveLValue): Update the code.
14983         GetIndexersForType has been modified already to extract all the
14984         indexers from a type.  The code assumed it did not.
14985
14986         Also make the code set the correct return type for the indexer.
14987         This was fixed a long time ago for properties, but was missing for
14988         indexers.  It used to be void_type.
14989
14990         (Binary.Emit): Test first for doubles instead of
14991         floats, as they are more common.
14992
14993         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14994         when dealing with floats and the <=, >= operators.  This fixes bug
14995         #39314 
14996
14997         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14998         to load the array value by emitting a load on the foreach variable
14999         type.  This was incorrect.  
15000
15001         We now emit the code to load an element using the the array
15002         variable type, and then we emit the conversion operator.
15003
15004         Fixed #40176
15005
15006 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15007
15008         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15009
15010 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15011
15012         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15013         test for protection before we test for signatures. 
15014
15015         (MethodSignature.ToString): implement.
15016
15017         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15018         to the case where we reduced into a LongConstant.
15019
15020         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15021         depend on whether the information is acurrate, because the
15022         Microsoft runtime will always claim that the array type is public,
15023         regardless of the real state.
15024
15025         If the type is a pointer, another problem happens: the type is
15026         reported as non-public in Microsoft.  
15027
15028         In both cases we have to call CheckAccessLevel recursively with
15029         the underlying type as the argument to be tested.
15030
15031 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15032
15033         * assign.cs (Assign.Emit): If we are dealing with a compound
15034         assignment expression, we should use the code path that stores the
15035         intermediate result in a temporary value.  This fixes #40903.
15036
15037         *expression.cs (Indirection.ToString): Provide ToString method for
15038         debugging. 
15039
15040 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15041
15042         * class.cs: Null out fields holding references to Block objects so
15043         they can be garbage collected.
15044
15045         * expression.cs (OverloadResolve): Remove unused local.
15046
15047 2003-04-07  Martin Baulig  <martin@ximian.com>
15048
15049         * codegen.cs (EmitContext.CurrentFile): New public field.
15050         (EmitContext.Mark): Use the CurrentFile to check whether the
15051         location is in the correct file.
15052         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15053
15054 2003-04-07  Martin Baulig  <martin@ximian.com>
15055
15056         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15057
15058         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15059         location.  [FIXME: The location argument which gets passed to this
15060         method is sometimes wrong!]
15061
15062 2003-04-07  Nick Drochak <ndrochak@gol.com>
15063
15064         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15065
15066 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15067
15068         * expression.cs (Indirection.EmitAssign): We were using the
15069         temporary, but returning immediately instead of continuing the
15070         EmitAssing flow.
15071
15072 2003-04-06  Martin Baulig  <martin@ximian.com>
15073
15074         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15075         if it's a nested child, but also deriving from the outer class.
15076         See test 190.cs.
15077
15078         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15079         nested child, but also deriving from the outer class.  See
15080         test-190.cs.
15081         (FilterWithClosure): We may access private members of the outer
15082         class if we're a nested child and deriving from the outer class.
15083         (RealMemberLookup): Only set `closure_private_ok' if the
15084         `original_bf' contained BindingFlags.NonPublic.
15085
15086 2003-04-05  Martin Baulig  <martin@ximian.com>
15087
15088         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15089         probe if its a type parameter, and if so, flag an error.
15090
15091         * decl.cs: Move here the SetParameterInfo code from class.cs.
15092         Handle IsGeneric here.
15093
15094         Handle a variety of errors in the parameter info definition.
15095
15096         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15097         type parameters here.
15098
15099         * cs-parser.jay (class_declaration): report errors for parameters
15100         here as well.
15101
15102 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
15103
15104         * generic.cs: New file, contains support code for generics.
15105
15106         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15107         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15108
15109         Update parser for the above removals.
15110
15111         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
15112         now taken care of in the parser.
15113
15114 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15115
15116         * class.cs (Event.Define): Do not allow abstract events to have
15117         initializers. 
15118
15119 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15120
15121         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15122         block in event declarations.
15123
15124         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15125         value type, get its address.
15126
15127         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15128         leaving a class on the stack instead of a boolean value (int
15129         0/1).  Change the code so we compare against null, and then the
15130         result against zero.
15131
15132         * class.cs (TypeContainer.GetClassBases): We were checking for the
15133         parent class being sealed too late.
15134
15135         * expression.cs (Binary.Emit): For <= and >= when dealing with
15136         floating point values, use cgt.un and clt.un instead of cgt and
15137         clt alone.
15138
15139 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15140
15141         * statement.cs: Apply the same optimization as MS: skip the 
15142         GetEnumerator returning an IEnumerator, and use the one returning a 
15143         CharEnumerator instead. This allows us to avoid the try-finally block 
15144         and the boxing.
15145
15146 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15147
15148         * cs-parser.jay: Attributes cannot be applied to
15149                          namespaces. Fixes #40473
15150
15151 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15152
15153         * class.cs:
15154         (Add*): check if the name is valid using the full name for constants,
15155         fields, properties and events.
15156
15157 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15158
15159         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15160         char constants to be part of the enumeration.
15161
15162         * expression.cs (Conditional.DoResolve): Add support for operator
15163         true. Implements the missing functionality from 14.12
15164
15165         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15166         operator true/false as required by the spec.
15167
15168         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15169         implicit conversion to boolean.
15170
15171         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15172         also one where the type implements `operator true'. 
15173
15174         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15175         get an expression that will invoke operator true based on an
15176         expression.  
15177
15178         (GetConversionOperators): Removed the hack that called op_True
15179         here.  
15180
15181         (Expression.ResolveBoolean): Move this from Statement.
15182
15183 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15184
15185         * ecore.cs (FieldExpr): do not allow initialization of initonly
15186         fields on derived classes
15187
15188 2003-03-13  Martin Baulig  <martin@ximian.com>
15189
15190         * statement.cs (Block.Emit): Call ig.BeginScope() and
15191         ig.EndScope() when compiling with debugging info; call
15192         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15193
15194 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15195
15196         * expression.cs (Indexers): Do not construct immediately, allow
15197         for new members to be appended as we go.  Fixes 38143
15198
15199 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15200
15201         * expression.cs: save/restore context when resolving an unchecked
15202         expression.
15203
15204 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15205
15206         * cfold.cs: Catch division by zero in modulus operator during
15207         constant folding.
15208
15209 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15210
15211         * interface.cs (Interface.DefineMembers): Avoid defining members
15212         twice. 
15213
15214 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15215
15216         * driver.cs: handle the +/- options for -noconfig
15217
15218         * statement.cs (Unckeched.Resolve): Also track the state of
15219         unchecked in the Resolve phase.
15220
15221 2003-02-27  Martin Baulig  <martin@ximian.com>
15222
15223         * ecore.cs (Expression.MemberLookup): Don't create a
15224         MethodGroupExpr for something which is not a method.  Fixes #38291.
15225
15226 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15227
15228         * class.cs (MemberBase.CheckParameters): Also check that the type
15229         is unmanaged if it is a pointer.
15230
15231         * expression.cs (SizeOf.Resolve): Add location information.
15232
15233         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15234         a managed type is declared.
15235
15236         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15237         parameter modifiers as well.  Fixes bug 38606
15238
15239         * class.cs: Very sad.  Am backing out the speed up changes
15240         introduced by the ArrayList -> Array in the TypeContainer, as they
15241         were not actually that much faster, and introduced a bug (no error
15242         reports on duplicated methods).
15243
15244         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15245         source first, this will guarantee that we have a valid expression
15246         before calling in lower levels functions that will require a
15247         resolved object.  Then use this original_source in the
15248         target.ResolveLValue instead of the original source that was
15249         passed to us.
15250
15251         Another change.  Use target.Resolve instead of LValueResolve.
15252         Although we are resolving for LValues, we will let the Assign code
15253         take care of that (it will be called again from Resolve).  This
15254         basically allows code like this:
15255
15256         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15257         class Y { void A (X x) { x [0] += o; }
15258
15259         The problem was that the indexer was trying to resolve for
15260         set_Item (idx, object o) and never finding one.  The real set_Item
15261         was set_Item (idx, X).  By delaying the process we get the right
15262         semantics. 
15263
15264         Fixes bug 36505
15265
15266 2003-02-23  Martin Baulig  <martin@ximian.com>
15267
15268         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15269         while calling DoEmit ().
15270
15271         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15272         source files; if you use the #line directive inside a method, the
15273         compiler stops emitting line numbers for the debugger until it
15274         reaches the end of the method or another #line directive which
15275         restores the original file.
15276
15277 2003-02-23  Martin Baulig  <martin@ximian.com>
15278
15279         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15280
15281 2003-02-23  Martin Baulig  <martin@ximian.com>
15282
15283         * statement.cs (Block.AddChildVariableNames): We need to call this
15284         recursively, not just for our immediate children.
15285
15286 2003-02-23  Martin Baulig  <martin@ximian.com>
15287
15288         * class.cs (Event.Define): Always make the field private, like csc does.
15289
15290         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15291         actually work, fixes bug #37521.
15292
15293 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15294
15295         * delegate.cs: When creating the various temporary "Parameters"
15296         classes, make sure that we call the ComputeAndDefineParameterTypes
15297         on those new parameters (just like we do with the formal ones), to
15298         allow them to be resolved in the context of the DeclSpace.
15299
15300         This fixes the bug that Dick observed in Bugzilla #38530.
15301
15302 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15303
15304         * expression.cs (ResolveMemberAccess): When resolving a constant,
15305         do not attempt to pull a constant if the value was not able to
15306         generate a valid constant.
15307
15308         * const.cs (LookupConstantValue): Do not report more errors than required.
15309
15310 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15311
15312         * expression.cs: fixes bug #38328.
15313
15314 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15315
15316         * class.cs: Changed all the various members that can be part of a
15317         class from being an ArrayList to be an Array of the right type.
15318         During the DefineType type_list, interface_list, delegate_list and
15319         enum_list are turned into types, interfaces, delegates and enums
15320         arrays.  
15321
15322         And during the member population, indexer_list, event_list,
15323         constant_list, field_list, instance_constructor_list, method_list,
15324         operator_list and property_list are turned into their real arrays.
15325
15326         Although we could probably perform this operation earlier, for
15327         good error reporting we need to keep the lists and remove the
15328         lists for longer than required.
15329
15330         This optimization was triggered by Paolo profiling the compiler
15331         speed on the output of `gen-sample-program.pl' perl script. 
15332
15333         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15334         not crash in methods like MemberLookupFailed that use this field.  
15335
15336         This problem arises when the compiler fails to resolve a type
15337         during interface type definition for example.
15338
15339 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15340
15341         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15342         inherit from System.Object, so we have to stop at null, not only
15343         when reaching System.Object.
15344
15345 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15346
15347         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15348         DeclaredOnly because the parent indexer might have had a different
15349         name, but did not loop until the top of the hierarchy was reached.
15350
15351         The problem this one fixes is 35492: when a class implemented an
15352         indexer from an interface, we were getting the interface method
15353         (which was abstract) and we were flagging an error (can not invoke
15354         abstract method).
15355
15356         This also keeps bug 33089 functioning, and test-148 functioning.
15357
15358         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15359         out if a method is special is to see if it is declared in a
15360         property or event, or whether it is one of the predefined operator
15361         names.   This should fix correctly #36804.
15362
15363 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15364
15365         The goal here is to remove the dependency on EmptyCast.Peel ().
15366         Killing it completely.
15367
15368         The problem is that currently in a number of places where
15369         constants are expected, we have to "probe" for an EmptyCast, and
15370         Peel, which is not the correct thing to do, as this will be
15371         repetitive and will likely lead to errors. 
15372
15373         The idea is to remove any EmptyCasts that are used in casts that
15374         can be reduced to constants, so we only have to cope with
15375         constants. 
15376
15377         This bug hunt was triggered by Bug 37363 and the desire to remove
15378         the duplicate pattern where we were "peeling" emptycasts to check
15379         whether they were constants.  Now constants will always be
15380         constants.
15381
15382         * ecore.cs: Use an enumconstant here instead of wrapping with
15383         EmptyCast.  
15384
15385         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15386         throwing me off.  By handling this we can get rid of a few hacks.
15387
15388         * statement.cs (Switch): Removed Peel() code.
15389
15390 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15391
15392         * class.cs: Location information for error 508
15393
15394         * expression.cs (New.DoResolve): Add a guard against double
15395         resolution of an expression.  
15396
15397         The New DoResolve might be called twice when initializing field
15398         expressions (see EmitFieldInitializers, the call to
15399         GetInitializerExpression will perform a resolve on the expression,
15400         and later the assign will trigger another resolution
15401
15402         This leads to bugs (#37014)
15403
15404         * delegate.cs: The signature for EndInvoke should contain any ref
15405         or out parameters as well.  We were not doing this in the past. 
15406
15407         * class.cs (Field.Define): Do not overwrite the type definition
15408         inside the `volatile' group.  Turns out that volatile enumerations
15409         were changing the type here to perform a validity test, which
15410         broke conversions. 
15411
15412 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15413
15414         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15415         and structs, we do not want to load the instance variable
15416
15417         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15418         enum_type has to be handled like an object reference (implicit
15419         conversions exists from this to object), but the regular IsClass
15420         and IsValueType tests will never return true for this one.
15421
15422         Also we use TypeManager.IsValueType instead of type.IsValueType,
15423         just for consistency with the rest of the code (this is only
15424         needed if we ever use the construct exposed by test-180.cs inside
15425         corlib, which we dont today).
15426
15427 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15428
15429         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15430         just InternalCall.
15431
15432 2003-02-09  Martin Baulig  <martin@ximian.com>
15433
15434         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15435         (Namespace.DefineNamespaces): New static public method; this is
15436         called when we're compiling with debugging to add all namespaces
15437         to the symbol file.
15438
15439         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15440         pass it to the Namespace's .ctor.
15441
15442         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15443         and MethodBase arguments; pass the namespace ID to the symwriter;
15444         pass the MethodBase instead of the token to the symwriter.
15445         (SymbolWriter.DefineNamespace): New method to add a namespace to
15446         the symbol file.
15447
15448 2003-02-09  Martin Baulig  <martin@ximian.com>
15449
15450         * symbolwriter.cs: New file.  This is a wrapper around
15451         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15452         methods here in near future.
15453
15454 2003-02-09  Martin Baulig  <martin@ximian.com>
15455
15456         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15457         ILGenerator.MarkSequencePoint() which are actually used by the
15458         symbol writer.
15459
15460 2003-02-09  Martin Baulig  <martin@ximian.com>
15461
15462         * location.cs (SourceFile): New public sealed class.  This
15463         contains the name and an index which is used in the location's token.
15464         (Location): Reserve an appropriate number of bits in the token for
15465         the source file instead of walking over that list, this gives us a
15466         really huge performance improvement when compiling with debugging.
15467
15468         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15469         `SourceFile' argument instead of a string.
15470         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15471         but don't parse/tokenize here, we need to generate the list of all
15472         source files before we do that.
15473         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15474         the files.
15475
15476         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15477         instead of a string.
15478
15479         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15480         of a string.
15481
15482 2003-02-09  Martin Baulig  <martin@ximian.com>
15483
15484         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15485         filename on `#line default'.
15486
15487 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15488
15489         * statement.cs: don't clear the pinned var when the fixed statement
15490         returns from the method (fixes bug#37752).
15491
15492 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15493
15494         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15495         to IsValueType.
15496
15497 2003-02-07  Martin Baulig  <martin@ximian.com>
15498
15499         * driver.cs: Removed the `--debug-args' command line argument.
15500
15501         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15502         automatically by the AsssemblyBuilder.
15503         (CodeGen.InitializeSymbolWriter): We don't need to call any
15504         initialization function on the symbol writer anymore.  This method
15505         doesn't take any arguments.
15506
15507 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15508
15509         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15510         from referenced assemblies as well.
15511
15512 2003-02-02  Martin Baulig  <martin@ximian.com>
15513
15514         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15515
15516 2003-02-02  Martin Baulig  <martin@ximian.com>
15517
15518         * class.cs (Constructor.Emit): Open the symbol writer before
15519         emitting the constructor initializer.
15520         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15521         single-stepping through constructor initializers.
15522
15523 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15524
15525         * class.cs: Handle error 549: do not allow virtual methods in
15526         sealed classes. 
15527
15528 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15529
15530         * decl.cs: Check access levels when resolving types
15531
15532 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15533
15534         * statement.cs: Add parameters and locals set in catch blocks that might 
15535         return to set vector
15536
15537 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15538
15539         * class.cs (Operator): Set the SpecialName flags for operators.
15540
15541         * expression.cs (Invocation.DoResolve): Only block calls to
15542         accessors and operators on SpecialName methods.
15543
15544         (Cast.TryReduce): Handle conversions from char constants.
15545
15546
15547 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15548
15549         * statement.cs: small memory and time optimization in FlowBranching.
15550
15551 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15552
15553         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15554         problem that the last fix but in the other sid (Set).
15555
15556         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15557         access when there is no indexer in the hierarchy.
15558
15559 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15560
15561         * class.cs: Combine some if statements.
15562
15563 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15564
15565         * driver.cs: fixed bug #37187.
15566
15567 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15568
15569         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15570         any indexer, it's needed to build a list with all the indexers in the
15571         hierarchy (AllGetters), else we have problems. Fixes #35653.
15572
15573 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15574
15575         * class.cs (MethodData.Define): It is wrong for an interface
15576         implementation to be static in both cases: explicit and implicit.
15577         We were only handling this in one case.
15578
15579         Improve the if situation there to not have negations.
15580
15581         * class.cs (Field.Define): Turns out that we do not need to check
15582         the unsafe bit on field definition, only on usage.  Remove the test.
15583
15584 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15585
15586         * driver.cs: use assembly.Location instead of Codebase (the latest
15587         patch made mcs fail when using MS assemblies).
15588
15589 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15590
15591         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15592         get the path to *corlib.dll.
15593
15594 2003-01-21  Nick Drochak <ndrochak@gol.com>
15595
15596         * cs-tokenizer.cs:
15597         * pending.cs:
15598         * typemanager.cs: Remove compiler warnings
15599
15600 2003-01-20  Duncan Mak  <duncan@ximian.com>
15601
15602         * AssemblyInfo.cs: Bump the version number to 0.19.
15603
15604 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15605
15606         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15607
15608 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15609
15610         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15611
15612 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15613
15614         * cs-parser.jay: Small fix: we were not comparing the constructor
15615         name correctly.   Thanks to Zoltan for the initial pointer.
15616
15617 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15618
15619         * cs-tokenizer.cs: Set file name when specified with #line
15620
15621 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15622
15623         * cs-parser.jay: Only perform the constructor checks here if we
15624         are named like the class;  This will help provider a better
15625         error.  The constructor path is taken when a type definition is
15626         not found, but most likely the user forgot to add the type, so
15627         report that rather than the constructor error.
15628
15629 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15630
15631         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15632         allocations.
15633
15634 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15635
15636         * cs-parser.jay: Add cleanup call.
15637
15638 2003-01-13  Duncan Mak  <duncan@ximian.com>
15639
15640         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15641         consistent with other methods.
15642
15643 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15644
15645         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15646
15647 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15648
15649         * attribute.cs: only set GuidAttr to true when we have a
15650         GuidAttribute.
15651
15652 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15653
15654         * ecore.cs:
15655         * expression.cs:
15656         * typemanager.cs: fixes to allow mcs compile corlib with the new
15657         Type.IsSubclassOf fix.
15658
15659 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15660
15661         * expression.cs (LocalVariableReference.DoResolve): Classify a
15662         constant as a value, not as a variable.   Also, set the type for
15663         the variable.
15664
15665         * cs-parser.jay (fixed_statement): take a type instead of a
15666         pointer_type, so we can produce a better error message later.
15667
15668         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15669         as an error.  
15670
15671         (For.DoEmit): Make inifinite loops have a
15672         non-conditional branch back.
15673
15674         (Fixed.DoEmit): First populate the pinned variables, then emit the
15675         statement, then clear the variables.  Before I was emitting the
15676         code once for each fixed piece.
15677
15678
15679 2003-01-08  Martin Baulig  <martin@ximian.com>
15680
15681         * statement.cs (FlowBranching.MergeChild): A break in a
15682         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15683
15684 2003-01-08  Martin Baulig  <martin@ximian.com>
15685
15686         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15687         lives in the same number space than `param_map'.  Fixes #36154.
15688
15689 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15690
15691         * cs-parser.jay (constructor_declaration): Set the
15692         Constructor.ModFlags before probing for it.  This makes the
15693         compiler report 514, 515 and 132 (the code was there, but got
15694         broken). 
15695
15696         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15697         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15698         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15699
15700 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15701
15702         * enum.cs: create the enum static fields using the enum type.
15703
15704 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15705
15706         * class.cs: don't try to create the ParamBuilder for the return
15707         type if it's not needed (and handle it breaking for the ms runtime
15708         anyway).
15709
15710 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15711
15712         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15713
15714 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15715
15716         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15717         the command.   This showed up while compiling the JANET source
15718         code, which used \r as its only newline separator.
15719
15720 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15721
15722         * class.cs (Method.Define): If we are an operator (because it
15723         reuses our code), then set the SpecialName and HideBySig.  #36128
15724
15725 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15726
15727         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15728         exception, report error 120 `object reference required'.
15729
15730         * driver.cs: Add --pause option, used during to measure the size
15731         of the process as it goes with --timestamp.
15732
15733         * expression.cs (Invocation.DoResolve): Do not allow methods with
15734         SpecialName to be invoked.
15735
15736 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15737
15738         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15739         number before adding it.
15740
15741 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15742
15743         * ecore.cs (StandardImplicitConversion): When in an unsafe
15744         context, we allow conversion between void * to any other pointer
15745         type. This fixes bug #35973.
15746
15747 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15748
15749         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15750         is not thrown when extensionless outputs are used 
15751
15752 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15753
15754         * rootcontext.cs: fixed compilation of corlib.
15755
15756 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15757
15758         * attribute.cs (Attributes.Contains): Add new method.
15759
15760         * class.cs (MethodCore.LabelParameters): if the parameter is an
15761         `out' parameter, check that no attribute `[In]' has been passed.
15762
15763         * enum.cs: Handle the `value__' name in an enumeration.
15764
15765 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15766
15767         * decl.cs: Added special case to allow overrides on "protected
15768         internal" methods
15769
15770 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15771
15772         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15773         since it makes much more sense.
15774
15775         (Attributes.ctor): Don't require a Location parameter.
15776
15777         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15778
15779         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15780         since we already have that information per attribute.
15781
15782         * everywhere : make appropriate changes.
15783
15784         * class.cs (LabelParameters): Write the code which actually
15785         applies attributes to the return type. We can't do this on the MS
15786         .NET runtime so we flag a warning in the case an exception is
15787         thrown.
15788
15789 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15790
15791         * const.cs: Handle implicit null conversions here too.
15792
15793 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15794
15795         * class.cs (MethodCore.LabelParameters): Remove the extra
15796         Type [] parameter since it is completely unnecessary. Instead
15797         pass in the method's attributes so that we can extract
15798         the "return" attribute.
15799
15800 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15801
15802         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15803         of ignoring it and letting the compile continue.
15804
15805         * typemanager.cs (ChangeType): use an extra argument to return an
15806         error condition instead of throwing an exception.
15807
15808 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15809
15810         * expression.cs (Unary.TryReduce): mimic the code for the regular
15811         code path.  Perform an implicit cast in the cases where we can
15812         implicitly convert to one of the integral types, and then reduce
15813         based on that constant.   This fixes bug #35483.
15814
15815 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15816
15817         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15818
15819 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15820
15821         * namespace.cs: fixed bug #35489.
15822
15823 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15824
15825         * class.cs: Remove some dead code.
15826
15827         * cs-parser.jay: Estimate the number of methods needed
15828         (RootContext.MethodCount);
15829
15830         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15831         numbers instead of StringBuilders.
15832
15833         * support.cs (PtrHashtable): Add constructor with initial size;
15834         We can now reduce reallocations of the method table.
15835
15836 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15837
15838         * attribute.cs (ApplyAttributes): Keep track of the emitted
15839         attributes on a per-target basis. This fixes bug #35413.
15840
15841 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15842
15843         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15844         default to the Windows 1252 encoding.
15845
15846         (UnixParseOption): Support version, thanks to Alp for the missing
15847         pointer. 
15848
15849         * AssemblyInfo.cs: Add nice assembly information.
15850
15851         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15852         (bug 35169).
15853
15854         * cs-parser.jay: Allow a trailing comma before the close bracked
15855         in the attribute_section production.
15856
15857         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15858         address of the instance was being taken, I will take this out,
15859         because we take the address of the object immediately here.
15860
15861 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15862
15863         * typemanager.cs (AreMultipleAllowed): Take care of the most
15864         obvious case where attribute type is not in the current assembly -
15865         stupid me ;-)
15866
15867 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15868
15869         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15870         definitions, instead of doing that afterwards.  
15871
15872         Also we use a nice little hack, depending on the constructor, we
15873         know if we are a "composed" name or a simple name.  Hence, we
15874         avoid the IndexOf test, and we avoid 
15875
15876         * codegen.cs: Add code to assist in a bug reporter to track down
15877         the source of a compiler crash. 
15878
15879 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15880
15881         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15882         types have been emitted for a given element and flag an error
15883         if something which does not have AllowMultiple set is used more
15884         than once.
15885
15886         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15887         attribute types and their corresponding AllowMultiple properties
15888
15889         (AreMultipleAllowed): Check the property for a given type.
15890
15891         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15892         property in the case we have a TypeContainer.
15893
15894         (Attributes.AddAttribute): Detect duplicates and just skip on
15895         adding them. This trivial fix catches a pretty gross error in our
15896         attribute emission - global attributes were being emitted twice!
15897
15898         Bugzilla bug #33187 is now fixed.
15899
15900 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15903         instead of pp_and).
15904
15905         * expression.cs (Binary.ResolveOperator): I can only use the
15906         Concat (string, string, string) and Concat (string, string,
15907         string, string) if the child is actually a concatenation of
15908         strings. 
15909
15910 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15911
15912         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15913         context where we need a 2-character lookahead.
15914
15915         * pending.cs (PendingImplementation): Rework so we can keep track
15916         of interface types all the time, and flag those which were
15917         implemented by parents as optional.
15918
15919 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15920
15921         * expression.cs (Binary.ResolveOperator): Use
15922         String.Concat(string,string,string) or
15923         String.Concat(string,string,string,string) when possible. 
15924
15925         * typemanager: More helper methods.
15926
15927
15928 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15929
15930         * pending.cs: remove the bogus return from GetMissingInterfaces()
15931         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15932
15933 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15934
15935         * namespace.cs: avoid duplicated 'using xxx' being added to
15936         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15937         when we get more than one 'using' statement for the same namespace.
15938         Report a CS0105 warning for it.
15939
15940 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15943         of calling getChar/putback, uses internal knowledge of it.    
15944
15945         (xtoken): Reorder tokenizer so most common patterns are checked
15946         first.  This reduces the compilation time in another 5% (from 8.11s
15947         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15948
15949         The parsing time is 22% of the compilation in mcs, and from that
15950         64% is spent on the tokenization process.  
15951
15952         I tried using a binary search for keywords, but this is slower
15953         than the hashtable.  Another option would be to do a couple of
15954         things:
15955
15956                 * Not use a StringBuilder, instead use an array of chars,
15957                   with a set value.  Notice that this way we could catch
15958                   the 645 error without having to do it *afterwards*.
15959
15960                 * We could write a hand-parser to avoid the hashtable
15961                   compares altogether.
15962
15963         The identifier consumption process takes 37% of the tokenization
15964         time.  Another 15% is spent on is_number.  56% of the time spent
15965         on is_number is spent on Int64.Parse:
15966
15967                 * We could probably choose based on the string length to
15968                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15969                   computations. 
15970
15971         Another 3% is spend on wrapping `xtoken' in the `token' function.
15972
15973         Handle 0xa0 as whitespace (#34752)
15974
15975 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15976
15977         * typemanager.cs (IsCLRType): New routine to tell whether a type
15978         is one of the builtin types.  
15979
15980         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15981         typecode in more places instead of doing pointer comparissions.
15982         We could leverage some knowledge about the way the typecodes are
15983         laid out.
15984
15985         New code to cache namespaces in assemblies, it is currently not
15986         invoked, to be used soon.
15987
15988         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15989
15990         * expression.cs (Binary.ResolveOperator): specially handle
15991         strings, and do not perform user-defined operator overloading for
15992         built-in types.
15993
15994 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15995
15996         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15997         internalcall as it is a pretty simple operation;  Avoid whenever
15998         possible to call Char.IsLetter.
15999
16000         (consume_identifier): Cut by half the number of
16001         hashtable calls by merging the is_keyword and GetKeyword behavior.
16002
16003         Do not short-circuit, because if we do, we
16004         report errors (ie, #if false && true would produce an invalid
16005         directive error);
16006
16007
16008 2002-11-24  Martin Baulig  <martin@ximian.com>
16009
16010         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16011         check constant ranges and report a CS0221.  Fixes #33186.
16012
16013 2002-11-24  Martin Baulig  <martin@ximian.com>
16014
16015         * cs-parser.jay: Make this work for uninitialized variable
16016         declarations in the `for' initializer.  Fixes #32416.
16017
16018 2002-11-24  Martin Baulig  <martin@ximian.com>
16019
16020         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16021         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16022
16023 2002-11-24  Martin Baulig  <martin@ximian.com>
16024
16025         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16026         argument; if true, we also check for user-defined conversions.
16027         This is only needed if both arguments are of a user-defined type.
16028         Fixes #30443, added test-175.cs.
16029         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16030
16031         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16032
16033 2002-11-24  Martin Baulig  <martin@ximian.com>
16034
16035         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16036         function to get the store opcode.
16037         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16038         only emit the Ldelema if the store opcode is Stobj.  You must run
16039         both test-34 and test-167 to test this.  Fixes #34529.
16040
16041 2002-11-23  Martin Baulig  <martin@ximian.com>
16042
16043         * ecore.cs (Expression.MemberLookup): Added additional
16044         `qualifier_type' argument which is used when we're being called
16045         from MemberAccess.DoResolve() and null if we're called from a
16046         SimpleName lookup.
16047         (Expression.MemberLookupFailed): New method to report errors; this
16048         does the CS1540 check and reports the correct error message.
16049
16050         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16051         argument for the CS1540 check and redone the way how we're dealing
16052         with private members.  See the comment in the source code for details.
16053         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16054         `closure_start_type' to `closure_qualifier_type' and check whether
16055         it's not null.  It was not this filter being broken, it was just
16056         being called with the wrong arguments.
16057
16058         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16059         and pass it the correct `qualifier_type'; this also does the error
16060         handling for us.
16061
16062 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16063
16064         * expression.cs (Invocation.EmitParams): If the we are dealing
16065         with a non-built-in value type, load its address as well.
16066
16067         (ArrayCreation): Use a a pretty constant instead
16068         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16069         static initializers.  
16070
16071         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16072         because they are not really value types, just glorified integers. 
16073
16074         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16075
16076         * ecore.cs: Remove redundant code for enumerations, make them use
16077         the same code path as everything else, fixes the casting issue
16078         with enumerations in Windows.Forms.
16079
16080         * attribute.cs: Do only cast to string if it is a string, the
16081         validation happens later.
16082
16083         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16084         people upgrade their corlibs.
16085
16086         * ecore.cs: Oops, enumerations were not following the entire code path
16087
16088 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * typemanager.cs (FilterWithClosure): Commented out the test for
16091         1540 in typemanager.cs, as it has problems when accessing
16092         protected methods from a parent class (see test-174.cs). 
16093
16094         * attribute.cs (Attribute.ValidateGuid): new method.
16095         (Attribute.Resolve): Use above.
16096
16097 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16098
16099         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16100
16101         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16102         handling for enumerations, as we only needed the TypeContainer
16103         functionality to begin with (this is required for the fix below to
16104         work for enums that reference constants in a container class for
16105         example). 
16106
16107         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16108
16109         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16110         a valid TypeBuilder to perform lookups on.o
16111
16112         * class.cs (InheritableMemberSignatureCompare): Use true in the
16113         call to GetGetMethod and GetSetMethod, because we are comparing
16114         the signature, and we need to get the methods *even* if they are
16115         private. 
16116
16117         (PropertyBase.CheckBase): ditto.
16118
16119         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16120         GotoCase.Resolve): Use Peel on EmpytCasts.
16121
16122         * ecore.cs (EmptyCast): drop child, add Peel method.
16123
16124 2002-11-17  Martin Baulig  <martin@ximian.com>
16125
16126         * ecore.cs (EmptyCast.Child): New public property.
16127
16128         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16129         label resolved to an EmptyCast.  Fixes #34162.
16130         (GotoCase.Resolve): Likewise.
16131         (Block.EmitMeta): Likewise.
16132
16133 2002-11-17  Martin Baulig  <martin@ximian.com>
16134
16135         * expression.cs (Invocation.BetterConversion): Prefer int over
16136         uint; short over ushort; long over ulong for integer literals.
16137         Use ImplicitConversionExists instead of StandardConversionExists
16138         since we also need to check for user-defined implicit conversions.
16139         Fixes #34165.  Added test-173.cs.
16140
16141 2002-11-16  Martin Baulig  <martin@ximian.com>
16142
16143         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16144         with the `true' and `false' literals.  Fixes #33151.
16145
16146 2002-11-16  Martin Baulig  <martin@ximian.com>
16147
16148         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16149         October 22nd; don't do the cs1540 check for static members.
16150
16151         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16152         now using our own filter here and doing the cs1540 check again.
16153
16154 2002-11-16  Martin Baulig  <martin@ximian.com>
16155
16156         * support.cs (InternalParameters): Don't crash if we don't have
16157         any fixed parameters.  Fixes #33532.
16158
16159 2002-11-16  Martin Baulig  <martin@ximian.com>
16160
16161         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16162         when looking up static methods to make this work on Windows.
16163         Fixes #33773.
16164
16165 2002-11-16  Martin Baulig  <martin@ximian.com>
16166
16167         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16168         a setter rather than using PropertyInfo.CanWrite.
16169
16170 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16171
16172         * class.cs: Allow acces to block member by subclasses. Fixes build
16173         breaker.
16174
16175 2002-11-14  Martin Baulig  <martin@ximian.com>
16176
16177         * class.cs (Constructor.Emit): Added the extern/block check.
16178         Fixes bug #33678.
16179
16180 2002-11-14  Martin Baulig  <martin@ximian.com>
16181
16182         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16183         iteration while looking for indexers, this is needed because the
16184         indexer may have a different name in our base classes.  Fixed the
16185         error reporting (no indexers at all, not get accessor, no
16186         overloaded match).  Fixes bug #33089.
16187         (IndexerAccess.DoResolveLValue): Likewise.
16188
16189 2002-11-14  Martin Baulig  <martin@ximian.com>
16190
16191         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16192         indexers.  Fixes the first part of bug #33089.
16193         (MethodSignature.InheritableMemberSignatureCompare): Added support
16194         for properties.
16195
16196 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16197
16198         * attribute.cs (Attribute.Resolve): Catch the
16199         NullReferenceException and report it since it isn't supposed to
16200         happen. 
16201
16202 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16203
16204         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16205         LogicalOr and LogicalAnd that can benefit from recursively
16206         handling EmitBranchable.  The code now should be nice for Paolo.
16207
16208 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16209
16210         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16211         the Type lookups, as we perform quite a number of lookups on
16212         non-Types.  This can be removed once we can deterministically tell
16213         whether we have a type or a namespace in advance.
16214
16215         But this might require special hacks from our corlib.
16216
16217         * TODO: updated.
16218
16219         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16220         and double which avoids a conversion from an integer to a double.
16221
16222         * expression.cs: tiny optimization, avoid calling IsConstant,
16223         because it effectively performs the lookup twice.
16224
16225 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16226
16227         But a bogus return here to keep the semantics of the old code
16228         until the Mono runtime is fixed.
16229
16230         * pending.cs (GetMissingInterfaces): New method used to remove all
16231         the interfaces that are already implemented by our parent
16232         classes from the list of pending methods. 
16233
16234         * interface.cs: Add checks for calls after ResolveTypeExpr.
16235
16236 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16237
16238         * class.cs (Class.Emit): Report warning 67: event not used if the
16239         warning level is beyond 3.
16240
16241         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16242         being a NullLiteral.
16243
16244         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16245         specifiers. 
16246
16247         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16248         path that might fail if a type can not be resolved.
16249
16250         * expression.cs (Binary.Emit): Emit unsigned versions of the
16251         operators. 
16252
16253         * driver.cs: use error 5.
16254
16255 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16256
16257         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16258
16259 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16260
16261         * cs-parser.jay (switch_section): A beautiful patch from Martin
16262         Baulig that fixed 33094.
16263
16264 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16265
16266         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16267         Check whether the base is abstract and report an error if so.
16268
16269         * expression.cs (IndexerAccess.DoResolveLValue,
16270         IndexerAccess.DoResolve): ditto. 
16271
16272         (Invocation.DoResolve): ditto.
16273
16274         (Invocation.FullMethodDesc): Improve the report string.
16275
16276         * statement.cs (Block): Eliminate IsVariableDefined as it is
16277         basically just a wrapper for GetVariableInfo.
16278
16279         * ecore.cs (SimpleName): Use new 
16280
16281         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16282         type, as we return the actual parameter ref/unref state on a
16283         different call.
16284
16285 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16286
16287         * support.cs: Return proper flags REF/OUT fixing the previous
16288         commit.  
16289
16290         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16291         not used to mean `ref' but `ref or out' in ParameterReference
16292
16293         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16294         full type signature instead of calling TypeManger.CSharpName
16295         ourselves. 
16296
16297         * support.cs (InternalParameters.ParameterDesc): Do not compare
16298         directly to the modflags, because REF/OUT will actually be bitsets
16299         if set. 
16300
16301         * delegate.cs (VerifyMethod): Check also the modifiers.
16302
16303         * cs-tokenizer.cs: Fix bug where floating point values with an
16304         exponent where a sign was missing was ignored.
16305
16306         * driver.cs: Allow multiple assemblies to be specified in a single
16307         /r: argument
16308
16309 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16310
16311         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16312         because identifiers after a parenthesis would end up in this kind
16313         of production, and we needed to desamiguate it for having casts
16314         like:
16315
16316                 (UserDefinedType *) xxx
16317
16318 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16319
16320         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16321         we should set on the Bindingflags.NonPublic, but not turn on
16322         private_ok.  private_ok controls whether a Private member is
16323         returned (this is chekced on the filter routine), while the
16324         BindingFlags.NonPublic just controls whether private/protected
16325         will be allowed.   This fixes the problem part of the problem of
16326         private properties being allowed to be used in derived classes.
16327
16328         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16329         so we can call the children DoResolveLValue method (this will
16330         properly signal errors on lvalue assignments to base properties)
16331
16332         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16333         getter are null, and we have a property info, we know that this
16334         happened because the lookup failed, so we report an error 122 for
16335         protection level violation.
16336
16337         We also silently return if setter and getter are null in the
16338         resolve functions, this condition only happens if we have flagged
16339         the error before.  This is the other half of the problem. 
16340
16341         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16342         not have accessibility information, that is why we were returning
16343         true in the filter function in typemanager.cs.
16344
16345         To properly report 122 (property is inaccessible because of its
16346         protection level) correctly, we report this error in ResolveAccess
16347         by failing if both the setter and the getter are lacking (ie, the
16348         lookup failed). 
16349
16350         DoResolve and DoLResolve have been modified to check for both
16351         setter/getter being null and returning silently, the reason being
16352         that I did not want to put the knowledge about this error in upper
16353         layers, like:
16354
16355         int old = Report.Errors;
16356         x = new PropertyExpr (...);
16357         if (old != Report.Errors)
16358                 return null;
16359         else
16360                 return x;
16361
16362         So the property expr is returned, but it is invalid, so the error
16363         will be flagged during the resolve process. 
16364
16365         * class.cs: Remove InheritablePropertySignatureCompare from the
16366         class, as we no longer depend on the property signature to compute
16367         whether it is possible to implement a method or not.
16368
16369         The reason is that calling PropertyInfo.GetGetMethod will return
16370         null (in .NET, in Mono it works, and we should change this), in
16371         cases where the Get Method does not exist in that particular
16372         class.
16373
16374         So this code:
16375
16376         class X { public virtual int A { get { return 1; } } }
16377         class Y : X { }
16378         class Z : Y { public override int A { get { return 2; } } }
16379
16380         Would fail in Z because the parent (Y) would not have the property
16381         defined.  So we avoid this completely now (because the alternative
16382         fix was ugly and slow), and we now depend exclusively on the
16383         method names.
16384
16385         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16386         reference method, instead of using the property.
16387
16388         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16389         routines are gone now.
16390
16391         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16392         names, they were incorrectly named.
16393
16394         * cs-tokenizer.cs: Return are more gentle token on failure. 
16395
16396         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16397         had an out-of-sync index variable, which caused it to remove from
16398         the list of pending methods the wrong method sometimes.
16399
16400 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16401
16402         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16403         CanWrite, because those refer to this particular instance of the
16404         property, and do not take into account the fact that we can
16405         override single members of a property.
16406
16407         Constructor requires an EmitContext.  The resolution process does
16408         not happen here, but we need to compute the accessors before,
16409         because the resolution does not always happen for properties.
16410
16411         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16412         subclass, before we did not update this flag, but we did update
16413         bindingflags. 
16414
16415         (GetAccessors): Drop this routine, as it did not work in the
16416         presence of partially overwritten set/get methods. 
16417
16418         Notice that this broke the cs1540 detection, but that will require
16419         more thinking. 
16420
16421 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16422
16423         * class.cs:
16424         * codegen.cs:
16425         * driver.cs: issue a warning instead of an error if we don't support
16426         debugging for the platform. Also ignore a couple of errors that may
16427         arise when trying to write the symbols. Undo my previous patch.
16428
16429 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16430
16431         * driver.cs: ignore /debug switch except for Unix platforms.
16432
16433 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16434
16435         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16436
16437 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16438
16439         * driver.cs: Do not make mcs-debug conditional, so we do not break
16440         builds that use it.
16441
16442         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16443         review this patch.  But basically after all the children variables
16444         have been merged, the value of "Breaks" was not being set to
16445         new_breaks for Switch blocks.  I think that it should be set after
16446         it has executed.  Currently I set this to the value of new_breaks,
16447         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16448         conservative, but I do not understand this code very well.
16449
16450         I did not break anything in the build, so that is good ;-)
16451
16452         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16453
16454 2002-10-20  Mark Crichton  <crichton@gimp.org>
16455
16456         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16457
16458 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16459
16460         * cfold.cs: Fixed compile blocker.
16461
16462 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16463
16464         * driver.cs: I was chekcing the key, not the file.
16465
16466 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16467
16468         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16469         message that we were generating - we just need to silently return
16470         a null.
16471
16472 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16473
16474         * class.cs (Event.Define): Change my previous commit, as this
16475         breaks the debugger.  This is a temporary hack, as it seems like
16476         the compiler is generating events incorrectly to begin with.
16477
16478         * expression.cs (Binary.ResolveOperator): Added support for 
16479         "U operator - (E x, E y)"
16480
16481         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16482         y)".
16483
16484         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16485         init-only variables, but this path did not take into account that
16486         there might be also instance readonly variables.  Correct this
16487         problem. 
16488
16489         This fixes bug 32253
16490
16491         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16492         delegates as well.
16493
16494         * driver.cs: Change the extension for modules to `netmodule'
16495
16496         * cs-parser.jay: Improved slightly the location tracking for
16497         the debugger symbols.
16498
16499         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16500         modifiers that were specified instead of the hardcoded value
16501         (FamAndAssem).  This was basically ignoring the static modifier,
16502         and others.  Fixes 32429.
16503
16504         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16505         fixed a bug in the process (32476)
16506
16507         * expression.cs (ArrayAccess.EmitAssign): Patch from
16508         hwang_rob@yahoo.ca that fixes bug 31834.3
16509
16510 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * driver.cs: Make the module extension .netmodule.
16513
16514 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * driver.cs: Report an error if the resource file is not found
16517         instead of crashing.
16518
16519         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16520         false, like Emit does.
16521
16522 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16523
16524         * typemanager.cs: Remove unused private member.  Also reported mcs
16525         bug to report this as a warning like csc.
16526
16527 2002-10-15  Martin Baulig  <martin@gnome.org>
16528
16529         * statement.cs (Statement.Emit): Made this a virtual method; emits
16530         the line number info and calls DoEmit().
16531         (Statement.DoEmit): New protected abstract method, formerly knows
16532         as Statement.Emit().
16533
16534         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16535
16536 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16537
16538         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16539         have fixed a remaining problem: not every AddXXXX was adding a
16540         fully qualified name.  
16541
16542         Now everyone registers a fully qualified name in the DeclSpace as
16543         being defined instead of the partial name.  
16544
16545         Downsides: we are slower than we need to be due to the excess
16546         copies and the names being registered this way.  
16547
16548         The reason for this is that we currently depend (on the corlib
16549         bootstrap for instance) that types are fully qualified, because
16550         we dump all the types in the namespace, and we should really have
16551         types inserted into the proper namespace, so we can only store the
16552         basenames in the defined_names array.
16553
16554 2002-10-10  Martin Baulig  <martin@gnome.org>
16555
16556         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16557         from bug #31834, see the bug report for a testcase which is
16558         miscompiled.
16559
16560 2002-10-10  Martin Baulig  <martin@gnome.org>
16561
16562         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16563         flow analysis code for this.
16564
16565         * statement.cs (Do, While, For): Tell the flow analysis code about
16566         infinite loops.
16567         (FlowBranching.UsageVector): Added support for infinite loops.
16568         (Block.Resolve): Moved the dead code elimination here and use flow
16569         analysis to do it.
16570
16571 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16572
16573         * class.cs (Field.Define): Catch cycles on struct type
16574         definitions. 
16575
16576         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16577         fields if the fields are static.  We only need to check instance
16578         fields. 
16579
16580         * expression.cs (As.DoResolve): Test for reference type.
16581
16582         * statement.cs (Using.ResolveExpression): Use
16583         ConvertImplicitRequired, not ConvertImplicit which reports an
16584         error on failture
16585         (Using.ResolveLocalVariableDecls): ditto.
16586
16587         * expression.cs (Binary.ResolveOperator): Report errors in a few
16588         places where we had to.
16589
16590         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16591
16592 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16593
16594         * expression.cs: Use StoreFromPtr instead of extracting the type
16595         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16596
16597         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16598         an enumeration value to a System.Enum, but System.Enum is not a
16599         value type, but an class type, so we need to box.
16600
16601         (Expression.ConvertExplicit): One codepath could return
16602         errors but not flag them.  Fix this.  Fixes #31853
16603
16604         * parameter.cs (Resolve): Do not allow void as a parameter type.
16605
16606 2002-10-06  Martin Baulig  <martin@gnome.org>
16607
16608         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16609         if it's a class type and not a struct.  Fixes #31815.
16610
16611 2002-10-06  Martin Baulig  <martin@gnome.org>
16612
16613         * statement.cs: Reworked the flow analysis code a bit to make it
16614         usable for dead code elimination.
16615
16616 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16617
16618         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16619
16620 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16621
16622         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16623         to fix the test 165, will investigate deeper.
16624
16625 2002-10-04  Martin Baulig  <martin@gnome.org>
16626
16627         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16628         finally blocks actually work.
16629         (Try.Resolve): We don't need to create a sibling for `finally' if
16630         there is no finally block.
16631
16632 2002-10-04  Martin Baulig  <martin@gnome.org>
16633
16634         * class.cs (Constructor.Define): The default accessibility for a
16635         non-default constructor is private, not public.
16636
16637 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16638
16639         * class.cs (Constructor): Make AllowedModifiers public, add
16640         EXTERN.
16641
16642         * cs-parser.jay: Perform the modifiers test here, as the
16643         constructor for the Constructor class usually receives a zero
16644         because of the way we create it (first we create, later we
16645         customize, and we were never checking the modifiers).
16646
16647         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16648         is a version of LookupTypeReflection that includes the type-name
16649         cache.  This can be used as a fast path for functions that know
16650         the fully qualified name and are only calling into *.GetType() to
16651         obtain a composed type.
16652
16653         This is also used by TypeManager.LookupType during its type
16654         composition.
16655
16656         (LookupType): We now also track the real type name, as sometimes
16657         we can get a quey for the real type name from things like
16658         ComposedCast.  This fixes bug 31422.
16659
16660         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16661         complete type fullname, it does not have to go through the type
16662         resolution system to obtain the composed version of the type (for
16663         obtaining arrays or pointers).
16664
16665         (Conditional.Emit): Use the EmitBoolExpression to
16666         generate nicer code, as requested by Paolo.
16667
16668         (ArrayCreation.CheckIndices): Use the patch from
16669         hwang_rob@yahoo.ca to validate the array initializers. 
16670
16671 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16672
16673         * class.cs (ConstructorInitializer.Emit): simplify code by using
16674         Invocation.EmitCall, and at the same time, fix the bugs in calling
16675         parent constructors that took variable arguments. 
16676
16677         * ecore.cs (Expression.ConvertNumericExplicit,
16678         Expression.ImplicitNumericConversion): Remove the code that
16679         manually wrapped decimal (InternalTypeConstructor call is now gone
16680         as well).
16681
16682         * expression.cs (Cast.TryReduce): Also handle decimal types when
16683         trying to perform a constant fold on the type.
16684
16685         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16686
16687         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16688         that only turned off an error report, and did nothing else. 
16689
16690 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16691
16692         * driver.cs: Handle and ignore /fullpaths
16693
16694 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16695
16696         * expression.cs (Binary.ResolveOperator): Catch the case where
16697         DoNumericPromotions returns true, 
16698
16699         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16700
16701 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16702
16703         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16704         report error 70.
16705
16706 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16707
16708         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16709         conversion exists, but it is also required that the conversion be
16710         performed.  This manifested in "(Type64Enum) 2".  
16711
16712         * class.cs (TypeManager.AddMethod): The fix is not to change
16713         AddEnum, because that one was using a fully qualified name (every
16714         DeclSpace derivative does), but to change the AddMethod routine
16715         that was using an un-namespaced name.  This now correctly reports
16716         the duplicated name.
16717
16718         Revert patch until I can properly fix it.  The issue
16719         is that we have a shared Type space across all namespaces
16720         currently, which is wrong.
16721
16722         Options include making the Namespace a DeclSpace, and merge
16723         current_namespace/current_container in the parser.
16724
16725 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16726
16727         * cs-parser.jay: Improve error reporting when we get a different
16728         kind of expression in local_variable_type and
16729         local_variable_pointer_type. 
16730
16731         Propagate this to avoid missleading errors being reported.
16732
16733         * ecore.cs (ImplicitReferenceConversion): treat
16734         TypeManager.value_type as a target just like object_type.   As
16735         code like this:
16736
16737         ValueType v = 1;
16738
16739         Is valid, and needs to result in the int 1 being boxed before it
16740         is assigned to the value type v.
16741
16742         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16743         to validate the enumeration name.
16744
16745         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16746         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16747         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16748
16749         * ecore.cs (TryImplicitIntConversion): When doing an
16750         implicit-enumeration-conversion, check if the type is 64-bits and
16751         perform a conversion before passing to EnumConstant.
16752
16753 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16754
16755         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16756         report ambiguous type references.  Unlike the MS version, we
16757         report what the ambiguity is.   Innovation at work ;-)
16758
16759         (DeclSpace.FindType): Require a location argument to
16760         display when we display an ambiguous error.
16761
16762         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16763
16764         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16765
16766         * expression.cs (EmitDynamicInitializers): Apply patch from
16767         hwang_rob@yahoo.ca that fixes the order in which we emit our
16768         initializers. 
16769
16770 2002-09-21  Martin Baulig  <martin@gnome.org>
16771
16772         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16773         delegate takes no arguments.
16774
16775 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16776
16777         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16778         from integers.
16779
16780         * expression.cs: Extract the underlying type.
16781
16782         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16783
16784         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16785
16786 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * class.cs (TypeContainer.DefineType): We can not use the nice
16789         PackingSize with the size set to 1 DefineType method, because it
16790         will not allow us to define the interfaces that the struct
16791         implements.
16792
16793         This completes the fixing of bug 27287
16794
16795         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16796         means also structs.  This fixes part of the problem. 
16797         (Expresion.ImplicitReferenceConversionExists): ditto.
16798
16799         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16800         error if there were no errors reported during the type lookup
16801         process, to avoid duplicates or redundant errors.  Without this
16802         you would get an ambiguous errors plus a type not found.  We have
16803         beaten the user enough with the first error.  
16804
16805         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16806         reference. 
16807
16808         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16809         during the resolution process, stop the lookup, this avoids
16810         repeated error reports (same error twice).
16811
16812         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16813
16814         * typemanager.cs (LookupType): Redo the type lookup code to match
16815         the needs of System.Reflection.  
16816
16817         The issue is that System.Reflection requires references to nested
16818         types to begin with a "+" sign instead of a dot.  So toplevel
16819         types look like: "NameSpace.TopLevelClass", and nested ones look
16820         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16821         levels. 
16822
16823 2002-09-19  Martin Baulig  <martin@gnome.org>
16824
16825         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16826         says that a method always returns or always throws an exception,
16827         don't report the CS0161.
16828
16829         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16830         set `Returns = new_returns'.
16831
16832 2002-09-19  Martin Baulig  <martin@gnome.org>
16833
16834         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16835         to an enum constant, check for a CS0176.
16836
16837 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16838
16839         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16840         for operators that must be in pairs and report errors.
16841
16842         * ecore.cs (SimpleName.DoResolveType): During the initial type
16843         resolution process, when we define types recursively, we must
16844         check first for types in our current scope before we perform
16845         lookups in the enclosing scopes.
16846
16847         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16848
16849         (Invocation.VerifyArgumentsCompat): Call
16850         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16851         I thought we were supposed to always call this, but there are a
16852         few places in the code where we dont do it.
16853
16854 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16855
16856         * driver.cs: Add support in -linkres and -resource to specify the
16857         name of the identifier.
16858
16859 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16860
16861         * ecore.cs (StandardConversionExists): Sync with the conversion
16862         code: allow anything-* to void* conversions.
16863
16864         (FindMostSpecificSource): Use an Expression argument
16865         instead of a Type, because we might be handed over a Literal which
16866         gets a few more implicit conversions that plain types do not.  So
16867         this information was being lost.
16868
16869         Also, we drop the temporary type-holder expression when not
16870         required.
16871
16872 2002-09-17  Martin Baulig  <martin@gnome.org>
16873
16874         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16875         this is an explicit interface implementation.
16876
16877 2002-09-17  Martin Baulig  <martin@gnome.org>
16878
16879         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16880         different `IndexerName' attributes.
16881
16882         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16883         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16884         virtual CommonResolve().
16885
16886 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16887
16888         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16889         and convert that to the UnderlyingType.
16890
16891         * statement.cs (Foreach.Resolve): Indexers are just like variables
16892         or PropertyAccesses.
16893
16894         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16895         inside quoted strings, we were not doing this before.
16896
16897 2002-09-16  Martin Baulig  <martin@gnome.org>
16898
16899         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16900         resolve it.  This is needed for the definite assignment check of the
16901         instance expression, fixes bug #29846.
16902         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16903
16904 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16905
16906         * parameter.cs: Fix compile error.  Cannot reference static member
16907         from an instance object.  Is this an mcs bug?
16908
16909 2002-09-14  Martin Baulig  <martin@gnome.org>
16910
16911         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16912         multiple times.  Fixes bug #30295, added test-166.cs.
16913
16914 2002-09-14  Martin Baulig  <martin@gnome.org>
16915
16916         * statement.cs (Block.Emit): Don't emit unreachable code.
16917         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16918         `break' statements.
16919         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16920
16921 2002-09-14  Martin Baulig  <martin@gnome.org>
16922
16923         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16924         is set.
16925
16926 2002-09-14  Martin Baulig  <martin@gnome.org>
16927
16928         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16929         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16930         be false on the ms runtime.
16931
16932 2002-09-13  Martin Baulig  <martin@gnome.org>
16933
16934         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16935         the CS0038 error message.
16936
16937 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16938
16939         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16940         constant inside, return it.
16941
16942 2002-09-12  Martin Baulig  <martin@gnome.org>
16943
16944         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16945         implicit conversion can be done between enum types.
16946
16947         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16948         check whether an implicit conversion to the current enum's UnderlyingType
16949         exists and report an error if not.
16950
16951         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16952         without debugging support.
16953
16954         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16955         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16956
16957 2002-09-12  Martin Baulig  <martin@gnome.org>
16958
16959         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16960
16961         * ecore.cs (IMemberExpr.DeclaringType): New property.
16962         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16963         nonstatic member of an outer type (CS0038).
16964
16965 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16966
16967         * driver.cs: Activate the using-error detector at warning level
16968         4 (at least for MS-compatible APIs).
16969
16970         * namespace.cs (VerifyUsing): Small buglett fix.
16971
16972         * pending.cs (PendingImplementation): pass the container pointer. 
16973
16974         * interface.cs (GetMethods): Allow for recursive definition.  Long
16975         term, I would like to move every type to support recursive
16976         definitions, not the current ordering mechanism that we have right
16977         now.
16978
16979         The situation is this: Attributes are handled before interfaces,
16980         so we can apply attributes to interfaces.  But some attributes
16981         implement interfaces, we will now handle the simple cases
16982         (recursive definitions will just get an error).  
16983
16984         * parameter.cs: Only invalidate types at the end if we fail to
16985         lookup all types.  
16986
16987 2002-09-09  Martin Baulig  <martin@gnome.org>
16988
16989         * ecore.cs (PropertyExpr.Emit): Also check for
16990         TypeManager.system_int_array_get_length so this'll also work when
16991         compiling corlib.  Fixes #30003.
16992
16993 2002-09-09  Martin Baulig  <martin@gnome.org>
16994
16995         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16996         and throw an exception if we can't get the type's size.  Fixed #30040,
16997         added test-165.cs.
16998
16999 2002-09-09  Martin Baulig  <martin@gnome.org>
17000
17001         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17002
17003         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17004         context.  Fixes bug #30027.
17005
17006         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17007         virtual functions.  Fixes bug #30043, added test-164.cs.
17008
17009 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17010
17011         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17012
17013 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17014
17015         * driver.cs: Use an object to get the windows codepage since it's not a
17016         static property.
17017
17018 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17019
17020         * statement.cs (For.Emit): for infinite loops (test == null)
17021         return whether there is a break inside, not always "true".
17022
17023         * namespace.cs (UsingEntry): New struct to hold the name of the
17024         using definition, the location where it is defined, and whether it
17025         has been used in a successful type lookup.
17026
17027         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17028         strings.
17029
17030         * decl.cs: ditto.
17031
17032 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17033
17034         * attribute.cs : Fix incorrect code which relied on catching
17035         a NullReferenceException to detect a null being passed in
17036         where an object was expected.
17037
17038 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17039
17040         * statement.cs (Try): flag the catch variable as assigned
17041
17042         * expression.cs (Cast): Simplified by using ResolveType instead of
17043         manually resolving.
17044
17045         * statement.cs (Catch): Fix bug by using ResolveType.
17046
17047 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17048
17049         * expression.cs (BetterConversion): Special case for when we have
17050         a NullLiteral as the argument and we have to choose between string
17051         and object types - we choose string the way csc does.
17052
17053         * attribute.cs (Attribute.Resolve): Catch the
17054         NullReferenceException and report error #182 since the Mono
17055         runtime no more has the bug and having this exception raised means
17056         we tried to select a constructor which takes an object and is
17057         passed a null.
17058
17059 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17060
17061         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17062         message (1502, 1503) when we can't locate a method after overload
17063         resolution. This is much more informative and closes the bug
17064         Miguel reported.
17065
17066         * interface.cs (PopulateMethod): Return if there are no argument
17067         types. Fixes a NullReferenceException bug.
17068
17069         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17070         expressions too. Previously we were checking only in one place for
17071         positional arguments leaving out named arguments.
17072
17073         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17074         type to the enum type is not allowed. Remove code corresponding to
17075         that.
17076
17077         (ConvertNumericExplicit): Allow explicit conversions from
17078         the underlying type to enum type. This precisely follows the spec
17079         and closes a bug filed by Gonzalo.
17080
17081 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17082
17083         * compiler.csproj:
17084         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17085
17086 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17087
17088         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17089         it was important that we stored the right value after the
17090         reduction in `converted'.
17091
17092 2002-09-04  Martin Baulig  <martin@gnome.org>
17093
17094         * location.cs (Location.SymbolDocument): Use full pathnames for the
17095         source files.
17096
17097 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17098
17099         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17100         of the expression resolve mechanism, because that will catch the
17101         SimpleName error failures.
17102
17103         (Conditional): If we can not resolve the
17104         expression, return, do not crash.
17105
17106 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17107
17108         * cs-tokenizer.cs:
17109         (location): display token name instead of its number.
17110
17111 2002-08-28  Martin Baulig  <martin@gnome.org>
17112
17113         * expression.cs (Binary.ResolveOperator): Don't silently return
17114         but return an error if an operator cannot be applied between two
17115         enum types.
17116
17117 2002-08-28  Martin Baulig  <martin@gnome.org>
17118
17119         * class.cs (Constructor.Define): Set the permission attributes
17120         correctly instead of making all constructors public.
17121
17122 2002-08-28  Martin Baulig  <martin@gnome.org>
17123
17124         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17125         for private members before reporting a CS0103; if we find anything,
17126         it's a CS0122.
17127
17128 2002-08-28  Martin Baulig  <martin@gnome.org>
17129
17130         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17131         to check whether `closure_start_type == closure_invocation_type',
17132         we also need to check whether `m.DeclaringType == closure_invocation_type'
17133         before bypassing the permission checks.  We might be accessing
17134         protected/private members from the base class.
17135         (TypeManager.RealMemberLookup): Only set private_ok if private
17136         members were requested via BindingFlags.NonPublic.
17137
17138         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17139
17140         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17141         MethodGroupExpr.IsExplicitImpl if appropriate.
17142         (Invocation.DoResolve): Don't report the CS0120 for explicit
17143         interface implementations.
17144
17145 2002-08-27  Martin Baulig  <martin@gnome.org>
17146
17147         * expression.cs (Invocation.DoResolve): If this is a static
17148         method and we don't have an InstanceExpression, we must report
17149         a CS0120.
17150
17151 2002-08-25  Martin Baulig  <martin@gnome.org>
17152
17153         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17154         `==' between a valuetype and an object.
17155
17156 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17157
17158         * ecore.cs (TypeExpr): Provide a ToString method.
17159
17160 2002-08-24  Martin Baulig  <martin@gnome.org>
17161
17162         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17163         now called proggie.dbg and it's a binary file.
17164
17165 2002-08-23  Martin Baulig  <martin@gnome.org>
17166
17167         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17168
17169 2002-08-23  Martin Baulig  <martin@gnome.org>
17170
17171         * struct.cs (MyStructInfo.ctor): Make this work with empty
17172         structs; it's not allowed to use foreach() on null.
17173
17174 2002-08-23  Martin Baulig  <martin@gnome.org>
17175
17176         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17177         writer the full pathname of the generated assembly.
17178
17179 2002-08-23  Martin Baulig  <martin@gnome.org>
17180
17181         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17182         A `finally' block never returns or breaks; improved handling of
17183         unreachable code.
17184
17185 2002-08-23  Martin Baulig  <martin@gnome.org>
17186
17187         * statement.cs (Throw.Resolve): Allow `throw null'.
17188
17189 2002-08-23  Martin Baulig  <martin@gnome.org>
17190
17191         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17192         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17193         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17194         MemberLookup would return a wrong event if this is an explicit
17195         interface implementation and the class has an event with the same
17196         name.
17197
17198 2002-08-23  Martin Baulig  <martin@gnome.org>
17199
17200         * statement.cs (Block.AddChildVariableNames): New public method.
17201         (Block.AddChildVariableName): Likewise.
17202         (Block.IsVariableNameUsedInChildBlock): Likewise.
17203         (Block.AddVariable): Check whether a variable name has already
17204         been used in a child block.
17205
17206         * cs-parser.jay (declare_local_variables): Mark all variable names
17207         from the current block as being used in a child block in the
17208         implicit block.
17209
17210 2002-08-23  Martin Baulig  <martin@gnome.org>
17211
17212         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17213         find the symbol writer.
17214
17215         * driver.cs: csc also allows the arguments to /define being
17216         separated by commas, not only by semicolons.
17217
17218 2002-08-23  Martin Baulig  <martin@gnome.org>
17219
17220         * interface.cs (Interface.GetMembers): Added static check for events.
17221
17222 2002-08-15  Martin Baulig  <martin@gnome.org>
17223
17224         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17225         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17226
17227         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17228         why the MethodData.EmitDestructor() change was necessary.
17229
17230 2002-08-20  Martin Baulig  <martin@gnome.org>
17231
17232         * class.cs (TypeContainer.FindMembers): Added static check for events.
17233
17234         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17235
17236         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17237         use Type.GetEvents(), not Type.FindMembers().
17238
17239 2002-08-20  Martin Baulig  <martin@gnome.org>
17240
17241         * decl.cs (MemberCache): Added a special method cache which will
17242         be used for method-only searched.  This ensures that a method
17243         search will return a MethodInfo with the correct ReflectedType for
17244         inherited methods.      
17245
17246 2002-08-20  Martin Baulig  <martin@gnome.org>
17247
17248         * decl.cs (DeclSpace.FindMembers): Made this public.
17249
17250 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17251
17252         * delegate.cs: fixed build on windows.
17253         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17254
17255 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17256
17257         * ecore.cs (StandardConversionExists): Return a false
17258         if we are trying to convert the void type to anything else
17259         since that is not allowed.
17260
17261         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17262         we flag error 70 in the event an event is trying to be accessed
17263         directly from outside the declaring type.
17264
17265 2002-08-20  Martin Baulig  <martin@gnome.org>
17266
17267         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17268         MemberCache from typemanager.cs to decl.cs.
17269
17270 2002-08-19  Martin Baulig  <martin@gnome.org>
17271
17272         * class.cs (TypeContainer): Implement IMemberContainer.
17273         (TypeContainer.DefineMembers): Create the MemberCache.
17274         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17275         return public members if BindingFlags.Public was given, check
17276         whether members are static.
17277
17278 2002-08-16  Martin Baulig  <martin@gnome.org>
17279
17280         * decl.cs (DeclSpace.Define): Splitted this in Define and
17281         DefineMembers.  DefineMembers is called first and initializes the
17282         MemberCache.
17283
17284         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17285         DefineMembers() on all our DeclSpaces.
17286
17287         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17288         but call DefineMembers() on all nested interfaces.  We call their
17289         Define() in our new Define() function.
17290
17291         * interface.cs (Interface): Implement IMemberContainer.
17292         (Interface.Define): Moved all code except the attribute stuf to
17293         DefineMembers().
17294         (Interface.DefineMembers): Initialize the member cache.
17295
17296         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17297         need this anymore since we can use MemberCache.FindMembers directly.
17298
17299 2002-08-19  Martin Baulig  <martin@gnome.org>
17300
17301         * typemanager.cs (MemberCache): When creating the cache for an
17302         interface type, add all inherited members.
17303         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17304         to `out bool used_cache' and documented it.
17305         (TypeManager.MemberLookup): If we already used the cache in the first
17306         iteration, we don't need to do the interfaces check.
17307
17308 2002-08-19  Martin Baulig  <martin@gnome.org>
17309
17310         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17311         here from IMemberFinder and don't implement this interface anymore.
17312         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17313
17314         * typemanager.cs (IMemberFinder): This interface is now only used by
17315         classes which actually support the member cache.
17316         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17317         since we only put DeclSpaces into this Hashtable.
17318         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17319         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17320
17321 2002-08-16  Martin Baulig  <martin@gnome.org>
17322
17323         * typemanager.cs (ICachingMemberFinder): Removed.
17324         (IMemberFinder.MemberCache): New property.
17325         (TypeManager.FindMembers): Merged this with RealFindMembers().
17326         This function will never be called from TypeManager.MemberLookup()
17327         so we can't use the cache here, just the IMemberFinder.
17328         (TypeManager.MemberLookup_FindMembers): Check whether the
17329         IMemberFinder has a MemberCache and call the cache's FindMembers
17330         function.
17331         (MemberCache): Rewrote larger parts of this yet another time and
17332         cleaned it up a bit.
17333
17334 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17335
17336         * driver.cs (LoadArgs): Support quoting.
17337
17338         (Usage): Show the CSC-like command line arguments.
17339
17340         Improved a few error messages.
17341
17342 2002-08-15  Martin Baulig  <martin@gnome.org>
17343
17344         * typemanager.cs (IMemberContainer.Type): New property.
17345         (IMemberContainer.IsInterface): New property.
17346
17347         The following changes are conditional to BROKEN_RUNTIME, which is
17348         defined at the top of the file.
17349
17350         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17351         class'es members, but add all members from TypeHandle.ObjectType
17352         if we're an interface.
17353         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17354         is the current type.
17355         (MemberCache.CacheEntry.Container): Removed this field.
17356         (TypeHandle.GetMembers): Include inherited members.
17357
17358 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17359
17360         * typemanager.cs: fixed compilation and added a comment on a field that
17361         is never used.
17362
17363 2002-08-15  Martin Baulig  <martin@gnome.org>
17364
17365         * class.cs (ConstructorInitializer.Resolve): In the
17366         Expression.MemberLookup call, use the queried_type as
17367         invocation_type.
17368
17369         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17370         declared' attribute, it's always true.
17371         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17372         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17373         temporary wrapper for FindMembers which tells MemberLookup whether
17374         members from the base classes are included in the return value.
17375         This will go away soon.
17376         (TypeManager.MemberLookup): Use this temporary hack here; once the
17377         new MemberCache is completed, we don't need to do the DeclaredOnly
17378         looping here anymore since the MemberCache will take care of this.
17379         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17380         (MemberCache): When creating the MemberCache for a class, get
17381         members from the current class and all its base classes.
17382         (MemberCache.CacheEntry.Container): New field.  This is a
17383         temporary hack until the Mono runtime is fixed to distinguish
17384         between ReflectedType and DeclaringType.  It allows us to use MCS
17385         with both the MS runtime and the unfixed Mono runtime without
17386         problems and without accecting performance.
17387         (MemberCache.SearchMembers): The DeclaredOnly looping from
17388         TypeManager.MemberLookup is now done here.      
17389
17390 2002-08-14  Martin Baulig  <martin@gnome.org>
17391
17392         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17393         Type.GetFields on dynamic types but get the fields from the
17394         corresponding TypeContainer.
17395         (MyStructInfo.GetStructInfo): Added check for enum types.
17396
17397         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17398         (MemberList.SyncRoot): Implemented.
17399         (TypeManager.FilterWithClosure): No need to check permissions if
17400         closure_start_type == closure_invocation_type, don't crash if
17401         closure_invocation_type is null.
17402
17403 2002-08-13  Martin Baulig  <martin@gnome.org>
17404
17405         Rewrote TypeContainer.FindMembers to use a member cache.  This
17406         gives us a speed increase of about 35% for the self-hosting MCS
17407         build and of about 15-20% for the class libs (both on GNU/Linux).
17408
17409         * report.cs (Timer): New class to get enhanced profiling.  This
17410         whole class is "TIMER" conditional since it remarkably slows down
17411         compilation speed.
17412
17413         * class.cs (MemberList): New class.  This is an IList wrapper
17414         which we're now using instead of passing MemberInfo[]'s around to
17415         avoid copying this array unnecessarily.
17416         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17417         (ICachingMemberFinder, IMemberContainer): New interface.
17418         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17419         has already been checked, otherwise use it for the name comparision.
17420         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17421         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17422         if possible.  Returns a MemberList, not a MemberInfo [].
17423         (TypeHandle): New class, implements IMemberContainer.  We create
17424         one instance of this class per type, it contains a MemberCache
17425         which is used to do the member lookups.
17426         (MemberCache): New class.  Each instance of this class contains
17427         all members of a type and a name-based hash table.
17428         (MemberCache.FindMembers): This is our new member lookup
17429         function.  First, it looks up all members of the requested name in
17430         the hash table.  Then, it walks this list and sorts out all
17431         applicable members and returns them.
17432
17433 2002-08-13  Martin Baulig  <martin@gnome.org>
17434
17435         In addition to a nice code cleanup, this gives us a performance
17436         increase of about 1.4% on GNU/Linux - not much, but it's already
17437         half a second for the self-hosting MCS compilation.
17438
17439         * typemanager.cs (IMemberFinder): New interface.  It is used by
17440         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17441         Enum, Delegate or Interface.
17442         (TypeManager.finder_to_member_finder): New PtrHashtable.
17443         (TypeManager.finder_to_container): Removed.
17444         (TypeManager.finder_to_delegate): Removed.
17445         (TypeManager.finder_to_interface): Removed.
17446         (TypeManager.finder_to_enum): Removed.
17447
17448         * interface.cs (Interface): Implement IMemberFinder.
17449
17450         * delegate.cs (Delegate): Implement IMemberFinder.
17451
17452         * enum.cs (Enum): Implement IMemberFinder.
17453
17454         * class.cs (TypeContainer): Implement IMemberFinder.
17455
17456 2002-08-12  Martin Baulig  <martin@gnome.org>
17457
17458         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17459
17460 2002-08-12  Martin Baulig  <martin@gnome.org>
17461
17462         * ecore.cs (ITypeExpression): New interface for expressions which
17463         resolve to a type.
17464         (TypeExpression): Renamed to TypeLookupExpression.
17465         (Expression.DoResolve): If we're doing a types-only lookup, the
17466         expression must implement the ITypeExpression interface and we
17467         call DoResolveType() on it.
17468         (SimpleName): Implement the new ITypeExpression interface.
17469         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17470         hack, the situation that we're only looking up types can't happen
17471         anymore when this method is called.  Moved the type lookup code to
17472         DoResolveType() and call it.
17473         (SimpleName.DoResolveType): This ITypeExpression interface method
17474         is now doing the types-only lookup.
17475         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17476         (ResolveFlags): Added MaskExprClass.
17477
17478         * expression.cs (MemberAccess): Implement the ITypeExpression
17479         interface.
17480         (MemberAccess.DoResolve): Added support for a types-only lookup
17481         when we're called via ITypeExpression.DoResolveType().
17482         (ComposedCast): Implement the ITypeExpression interface.
17483
17484         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17485         Expression.Resolve() with ResolveFlags.Type instead.
17486
17487 2002-08-12  Martin Baulig  <martin@gnome.org>
17488
17489         * interface.cs (Interface.Define): Apply attributes.
17490
17491         * attribute.cs (Attribute.ApplyAttributes): Added support for
17492         interface attributes.
17493
17494 2002-08-11  Martin Baulig  <martin@gnome.org>
17495
17496         * statement.cs (Block.Emit): Only check the "this" variable if we
17497         do not always throw an exception.
17498
17499         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17500         whether the property has a set accessor.
17501
17502 2002-08-11  Martin Baulig  <martin@gnome.org>
17503
17504         Added control flow analysis support for structs.
17505
17506         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17507         with control flow analysis turned off.
17508         (IVariable): New interface.
17509         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17510         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17511         (FieldExpr.DoResolve): Resolve the instance expression with flow
17512         analysis turned off and do the definite assignment check after the
17513         resolving when we know what the expression will resolve to.
17514
17515         * expression.cs (LocalVariableReference, ParameterReference):
17516         Implement the new IVariable interface, only call the flow analysis
17517         code if ec.DoFlowAnalysis is true.
17518         (This): Added constructor which takes a Block argument.  Implement
17519         the new IVariable interface.
17520         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17521         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17522         This does the definite assignment checks for struct members.
17523
17524         * class.cs (Constructor.Emit): If this is a non-static `struct'
17525         constructor which doesn't have any initializer, call
17526         Block.AddThisVariable() to tell the flow analysis code that all
17527         struct elements must be initialized before control returns from
17528         the constructor.
17529
17530         * statement.cs (MyStructInfo): New public class.
17531         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17532         argument to this indexer.  If non-zero, check an individual struct
17533         member, not the whole struct.
17534         (FlowBranching.CheckOutParameters): Check struct members.
17535         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17536         overloaded versions of these methods which take an additional
17537         `int field_idx' argument to check struct members.
17538         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17539         overloaded versions of these methods which take an additional
17540         `string field_name' argument to check struct member.s
17541         (VariableInfo): Implement the IVariable interface.
17542         (VariableInfo.StructInfo): New public property.  Returns the
17543         MyStructInfo instance of the variable if it's a struct or null.
17544         (Block.AddThisVariable): New public method.  This is called from
17545         Constructor.Emit() for non-static `struct' constructor which do
17546         not have any initializer.  It creates a special variable for the
17547         "this" instance variable which will be checked by the flow
17548         analysis code to ensure that all of the struct's fields are
17549         initialized before control returns from the constructor.
17550         (UsageVector): Added support for struct members.  If a
17551         variable/parameter is a struct with N members, we reserve a slot
17552         in the usage vector for each member.  A struct is considered fully
17553         initialized if either the struct itself (slot 0) or all its
17554         members are initialized.
17555
17556 2002-08-08  Martin Baulig  <martin@gnome.org>
17557
17558         * driver.cs (Driver.MainDriver): Only report an error CS5001
17559         if there were no compilation errors.
17560
17561         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17562         `UnsafeContext' property to determine whether the parent is in
17563         unsafe context rather than checking the parent's ModFlags:
17564         classes nested in an unsafe class are unsafe as well.
17565
17566 2002-08-08  Martin Baulig  <martin@gnome.org>
17567
17568         * statement.cs (UsageVector.MergeChildren): Distinguish between
17569         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17570         we return.  Added test17() and test18() to test-154.cs.
17571
17572 2002-08-08  Martin Baulig  <martin@gnome.org>
17573
17574         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17575         Family access, make sure the invoking type isn't a subclass of the
17576         queried type (that'd be a CS1540).
17577
17578         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17579         this method which takes an additional `Type invocation_type'.
17580
17581         * expression.cs (BaseAccess.DoResolve): Use the base type as
17582         invocation and query type.
17583         (MemberAccess.DoResolve): If the lookup failed and we're about to
17584         report a CS0122, try a lookup with the ec.ContainerType - if this
17585         succeeds, we must report a CS1540.
17586
17587 2002-08-08  Martin Baulig  <martin@gnome.org>
17588
17589         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17590         (MethodGroupExpr): Implement the IMemberExpr interface.
17591
17592         * expression (MemberAccess.ResolveMemberAccess): No need to have
17593         any special code for MethodGroupExprs anymore, they're now
17594         IMemberExprs.   
17595
17596 2002-08-08  Martin Baulig  <martin@gnome.org>
17597
17598         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17599         Family, FamANDAssem and FamORAssem permissions.
17600         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17601
17602 2002-08-08  Martin Baulig  <martin@gnome.org>
17603
17604         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17605         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17606         or loop block.
17607
17608 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17609
17610         * driver.cs: implemented /resource option to embed managed resources.
17611
17612 2002-08-07  Martin Baulig  <martin@gnome.org>
17613
17614         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17615         (FieldBase.HasFieldInitializer): New public property.
17616         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17617         returns the field initializer and makes sure it is only resolved once.
17618         (TypeContainer.EmitFieldInitializers): Call
17619         FieldBase.GetInitializerExpression to get the initializer, this ensures
17620         that it isn't resolved multiple times.
17621
17622         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17623         the resolving process (SimpleName/MemberLookup) that we're currently
17624         emitting a field initializer (which must not access any instance members,
17625         this is an error CS0236).
17626
17627         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17628         argument, if the `IsFieldInitializer' flag is set, we must report and
17629         error CS0236 and not an error CS0120.   
17630
17631 2002-08-07  Martin Baulig  <martin@gnome.org>
17632
17633         * ecore.cs (IMemberExpr): New public interface.
17634         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17635         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17636         if the expression is an IMemberExpr.
17637
17638         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17639         to be null, implicitly default to `this' if we're non-static in
17640         this case.  Simplified the code a lot by using the new IMemberExpr
17641         interface.  Also fixed bug #28176 here.
17642
17643 2002-08-06  Martin Baulig  <martin@gnome.org>
17644
17645         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17646         ParameterReferences during semantic analysis so that we can do a
17647         type-only search when resolving Cast, TypeOf and SizeOf.
17648         (block): Pass the `current_local_parameters' to the Block's
17649         constructor.
17650
17651         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17652         argument to the constructor.
17653         (ConstructorInitializer.Resolve): Create a temporary implicit
17654         block with the parameters.
17655
17656         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17657         references here if we aren't doing a type-only search.
17658
17659         * statement.cs (Block): Added constructor which takes a
17660         `Parameters parameters' argument.
17661         (Block.Parameters): New public property.
17662
17663         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17664         to `Parameters' and made it public readonly.
17665
17666 2002-08-06  Martin Baulig  <martin@gnome.org>
17667
17668         * ecore.cs (Expression.Warning): Made this public as well.
17669
17670         * report.cs (Report.Debug): Print the contents of collections.
17671
17672 2002-08-06  Martin Baulig  <martin@gnome.org>
17673
17674         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17675         used to tell Resolve() which kinds of expressions it may return.
17676         (Expression.Resolve): Added overloaded version of this method which
17677         takes a `ResolveFlags flags' argument.  This can be used to tell
17678         Resolve() which kinds of expressions it may return.  Reports a
17679         CS0118 on error.
17680         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17681         ResolveFlags.SimpleName.
17682         (Expression.Error118): Added overloaded version of this method which
17683         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17684         which kinds of expressions are allowed.
17685
17686         * expression.cs (Argument.ResolveMethodGroup): New public method.
17687         Resolves an argument, but allows a MethodGroup to be returned.
17688         This is used when invoking a delegate.
17689
17690         * TODO: Updated a bit.
17691
17692 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17693
17694         Fixed compilation with csc.
17695
17696         * ecore.cs: Expression.Error made public. Is this correct? Should
17697         Warning be made public too?
17698
17699         * expression.cs: use ea.Location instead of ea.loc.
17700         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17701
17702 2002-08-06  Martin Baulig  <martin@gnome.org>
17703
17704         * ecore.cs (Expression.loc): Moved the location here instead of
17705         duplicating it in all derived classes.
17706         (Expression.Location): New public property.
17707         (Expression.Error, Expression.Warning): Made them non-static and
17708         removed the location argument.
17709         (Expression.Warning): Added overloaded version which takes an
17710         `int level' argument.
17711         (Expression.Error118): Make this non-static and removed the
17712         expression and location arguments.
17713         (TypeExpr): Added location argument to the constructor.
17714
17715         * expression.cs (StaticCallExpr): Added location argument to
17716         the constructor.
17717         (Indirection, PointerArithmetic): Likewise.
17718         (CheckedExpr, UnCheckedExpr): Likewise.
17719         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17720         (StringPtr): Likewise.
17721
17722
17723 2002-08-05  Martin Baulig  <martin@gnome.org>
17724
17725         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17726
17727         * assign.cs (Assign.DoResolve): Check whether the source
17728         expression is a value or variable.
17729
17730         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17731         while resolving the corresponding blocks.
17732
17733         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17734         an error, don't silently return null.
17735
17736         * statement.cs (Block.AddVariable): Do the error reporting here
17737         and distinguish between CS0128 and CS0136.
17738         (Block.DoResolve): Report all unused labels (warning CS0164).
17739         (LabeledStatement): Pass the location to the constructor.
17740         (LabeledStatement.HasBeenReferenced): New property.
17741         (LabeledStatement.Resolve): Set it to true here.
17742
17743         * statement.cs (Return.Emit): Return success even after reporting
17744         a type mismatch error (CS0126 or CS0127), this is what csc does and
17745         it avoids confusing the users with any consecutive errors.
17746
17747 2002-08-05  Martin Baulig  <martin@gnome.org>
17748
17749         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17750
17751         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17752
17753         * expression.cs (MemberAccess.DoResolve): Silently return if an
17754         error has already been reported.
17755
17756         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17757         error has already been reported.
17758
17759 2002-08-05  Martin Baulig  <martin@gnome.org>
17760
17761         * statement.cs (UsageVector): Only initialize the `parameters'
17762         vector if we actually have any "out" parameters.
17763
17764 2002-08-05  Martin Baulig  <martin@gnome.org>
17765
17766         * expression.cs (Binary.ResolveOperator): When combining delegates,
17767         they must have the same type.
17768
17769 2002-08-05  Martin Baulig  <martin@gnome.org>
17770
17771         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17772         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17773         work with the ms runtime and we also don't need it: if we're a
17774         PropertyBuilder and not in the `indexer_arguments' hash, then we
17775         are a property and not an indexer.
17776
17777         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17778         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17779         since the latter one doesn't work with the ms runtime.
17780
17781 2002-08-03  Martin Baulig  <martin@gnome.org>
17782
17783         Fixed bugs #27998 and #22735.
17784
17785         * class.cs (Method.IsOperator): New public field.
17786         (Method.CheckBase): Report CS0111 if there's already a method
17787         with the same parameters in the current class.  Report CS0508 when
17788         attempting to change the return type of an inherited method.
17789         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17790         and it's not marked abstract or extern.
17791         (PropertyBase): New abstract base class for Property and Indexer.
17792         (PropertyBase.CheckBase): Moved here from Property and made it work
17793         for indexers.
17794         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17795         the same so we can reuse it there.
17796         (Property, Indexer): Derive from PropertyBase.
17797         (MethodSignature.inheritable_property_signature_filter): New delegate
17798         to find properties and indexers.
17799
17800         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17801         argument and improved error reporting.
17802
17803         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17804         EmptyReadOnlyParameters and made it a property.
17805
17806         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17807         version of this method which takes a `PropertyInfo indexer'.
17808         (TypeManager.RegisterIndexer): New method.
17809
17810         * class.cs: Added myself as author of this file :-)
17811
17812 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17813
17814         * class.cs: fixed compilation on windoze.
17815
17816 2002-08-03  Martin Baulig  <martin@gnome.org>
17817
17818         * interface.cs (Interface.GetInterfaceBases): Check whether all
17819         base interfaces are at least as accessible than the current one.
17820
17821         * class.cs (TypeContainer.GetClassBases): Check whether base types
17822         are at least as accessible than the current type.
17823         (TypeContainer.AsAccessible): Implemented and made non-static.
17824         (MemberBase.CheckParameters): Report errors if the accessibility
17825         checks fail.
17826
17827         * delegate.cs (Delegate.Delegate): The default visibility is
17828         internal for top-level types and private for nested types.
17829         (Delegate.Define): Report errors if the accessibility checks fail.
17830
17831         * enum.cs (Enum.Enum): The default visibility is internal for
17832         top-level types and private for nested types.
17833         (Enum.DefineType): Compute the correct visibility.
17834
17835         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17836         function which takes a `bool is_toplevel' instead of a TypeContainer.
17837
17838         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17839         builtin type.
17840
17841 2002-08-02  Martin Baulig  <martin@gnome.org>
17842
17843         * expression.cs (LocalVariableReferenc): Added constructor which
17844         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17845         (LocalVariableReference.IsReadOnly): New property.
17846         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17847         variable is readonly, use our own readonly flag to do this; you can
17848         use the new constructor to get a writable reference to a read-only
17849         variable.
17850
17851         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17852         reference to the local variable.
17853
17854 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17855
17856         * rootcontext.cs (ResolveCore): Also include System.Exception
17857
17858         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17859         we reach an EmptyStatement.
17860
17861         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17862         is also fine.
17863
17864         * expression.cs (Binary.ResolveOperator): Check error result in
17865         two places.
17866
17867         use brtrue/brfalse directly and avoid compares to null.
17868
17869 2002-08-02  Martin Baulig  <martin@gnome.org>
17870
17871         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17872         Fixes bug #28407, added test-155.cs.
17873
17874 2002-08-01  Martin Baulig  <martin@gnome.org>
17875
17876         * class.cs (Event.EmitDefaultMethod): Make this work with static
17877         events.  Fixes #28311, added verify-3.cs.
17878
17879 2002-08-01  Martin Baulig  <martin@gnome.org>
17880
17881         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17882         `is_disposable' fields.
17883         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17884         `hm.is_disposable' if we're using the collection pattern.
17885         (Foreach.EmitCollectionForeach): Use the correct type for the
17886         enumerator's local variable, only emit the try/finally block if
17887         necessary (fixes #27713).
17888
17889 2002-08-01  Martin Baulig  <martin@gnome.org>
17890
17891         * ecore.cs (Expression.report118): Renamed to Error118 and made
17892         it public static.
17893
17894         * statement.cs (Throw.Resolve): Check whether the expression is of
17895         the correct type (CS0118) and whether the type derives from
17896         System.Exception (CS0155).
17897         (Catch.Resolve): New method.  Do the type lookup here and check
17898         whether it derives from System.Exception (CS0155).
17899         (Catch.CatchType, Catch.IsGeneral): New public properties.
17900
17901         * typemanager.cs (TypeManager.exception_type): Added.
17902
17903 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17904
17905         * driver.cs: Updated About function.
17906
17907 2002-07-31  Martin Baulig  <martin@gnome.org>
17908
17909         Implemented Control Flow Analysis.
17910
17911         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17912         (EmitContext.CurrentBranching): Added.
17913         (EmitContext.StartFlowBranching): Added.
17914         (EmitContext.EndFlowBranching): Added.
17915         (EmitContext.KillFlowBranching): Added.
17916         (EmitContext.IsVariableAssigned): Added.
17917         (EmitContext.SetVariableAssigned): Added.
17918         (EmitContext.IsParameterAssigned): Added.
17919         (EmitContext.SetParameterAssigned): Added.
17920         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17921         Added control flow analysis stuff here.
17922
17923         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17924         resolve the expression as lvalue.
17925         (LocalVariableReference.DoResolve): Check whether the variable has
17926         already been assigned.
17927         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17928         the parameter as assigned here.
17929         (ParameterReference.DoResolve): Check whether the parameter has already
17930         been assigned.
17931         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17932         expression as lvalue.
17933
17934         * statement.cs (FlowBranching): New class for the flow analysis code.
17935         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17936         (LabeledStatement.IsDefined): New public property.
17937         (LabeledStatement.AddUsageVector): New public method to tell flow
17938         analyis that the label may be reached via a forward jump.
17939         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17940         flow analysis.
17941         (VariableInfo.Number): New public field.  This is used by flow analysis
17942         to number all locals of a block.
17943         (Block.CountVariables): New public property.  This is the number of
17944         local variables in this block (including the locals from all parent
17945         blocks).
17946         (Block.EmitMeta): Number all the variables.
17947
17948         * statement.cs: Added flow analysis support to all classes.
17949
17950 2002-07-31  Martin Baulig  <martin@gnome.org>
17951
17952         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17953         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17954         then use this argument.
17955
17956         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17957
17958         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17959         use this to specify /define options.
17960
17961 2002-07-29  Martin Baulig  <martin@gnome.org>
17962
17963         * statement.cs (Fixed): Moved all code that does variable lookups
17964         and resolvings from Emit to Resolve.
17965
17966         * statement.cs (For): Moved all code that does variable lookups
17967         and resolvings from Emit to Resolve.
17968
17969         * statement.cs (Using): Moved all code that does variable lookups
17970         and resolvings from Emit to Resolve.
17971
17972 2002-07-29  Martin Baulig  <martin@gnome.org>
17973
17974         * attribute.cs (Attribute.Resolve): Explicitly catch a
17975         System.NullReferenceException when creating the
17976         CustromAttributeBuilder and report a different warning message.
17977
17978 2002-07-29  Martin Baulig  <martin@gnome.org>
17979
17980         * support.cs (ParameterData.ParameterName): Added method to
17981         get the name of a parameter.
17982
17983         * typemanager.cs (TypeManager.IsValueType): New public method.
17984
17985 2002-07-29  Martin Baulig  <martin@gnome.org>
17986
17987         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17988         is a flag which specifies that it's either ref or out.
17989         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17990         the out parameter to `out Parameter.Modifier mod', also set the
17991         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17992
17993         * support.cs (InternalParameters.ParameterModifier): Distinguish
17994         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17995         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17996
17997         * expression.cs (Argument.GetParameterModifier): Distinguish
17998         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17999         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18000
18001 2002-07-29  Martin Baulig  <martin@gnome.org>
18002
18003         * expression.cs (ParameterReference.ParameterReference): Added
18004         `Location loc' argument to the constructor.
18005
18006         * cs-parser.jay: Pass location to ParameterReference.
18007
18008 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18009
18010         * statement.cs (Try): Initialize the location.
18011
18012         * cs-parser.jay: pass location to Try.
18013
18014         * expression.cs (Unary.Reduce): Change the prototype to return
18015         whether a constant fold could be performed or not.  The result is
18016         returned in an out parameters.  In the case of Indirection and
18017         AddressOf, we want to perform the full tests.
18018
18019 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18020
18021         * statement.cs (Statement.Emit): Flag dead code.
18022
18023 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18024
18025         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18026
18027 2002-07-27  Martin Baulig  <martin@gnome.org>
18028
18029         * class.cs (MethodData.Define): Put back call to
18030         TypeManager.AddMethod(), accidentally commented this out.
18031
18032         * report.cs (Debug): New public method to print debugging information,
18033         this is `[Conditional ("DEBUG")]'.
18034
18035 2002-07-26  Martin Baulig  <martin@gnome.org>
18036
18037         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18038         (switch_statement): Push the current_block to the switch_stack and
18039         pop it again when we're done with the switch.
18040         (switch_section): The new block is a child of the current_block.
18041         Fixes bug #24007, added test-152.cs.
18042
18043 2002-07-27  Martin Baulig  <martin@gnome.org>
18044
18045         * expression.cs (Invocation.EmitArguments): When calling a varargs
18046         function with only its fixed arguments, we need to pass an empty
18047         array.
18048
18049 2002-07-27  Martin Baulig  <martin@gnome.org>
18050
18051         Mono 0.13 has been released.
18052
18053 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18054
18055         * driver.cs: Rename --resource to --linkres, because that is what
18056         we do currently, we dont support --resource yet.
18057
18058         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18059
18060 2002-07-25  Martin Baulig  <martin@gnome.org>
18061
18062         * class.cs (MethodData): New public class.  This is a `method builder'
18063         class for a method or one accessor of a Property/Indexer/Event.
18064         (MethodData.GetMethodFlags): Moved here from MemberBase.
18065         (MethodData.ApplyAttributes): Likewise.
18066         (MethodData.ApplyObsoleteAttribute): Likewise.
18067         (MethodData.ApplyConditionalAttribute): Likewise.
18068         (MethodData.ApplyDllImportAttribute): Likewise.
18069         (MethodData.CheckAbstractAndExternal): Likewise.
18070         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18071         (MethodData.Emit): Formerly known as Method.Emit().
18072         (MemberBase): Moved everything which was specific to a single
18073         accessor/method to MethodData.
18074         (Method): Create a new MethodData and call Define() and Emit() on it.
18075         (Property, Indexer, Event): Create a new MethodData objects for each
18076         accessor and call Define() and Emit() on them.
18077
18078 2002-07-25  Martin Baulig  <martin@gnome.org>
18079
18080         Made MethodCore derive from MemberBase to reuse the code from there.
18081         MemberBase now also checks for attributes.
18082
18083         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18084         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18085         as virtual.
18086         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18087         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18088         (MemberBase.ApplyAttributes): New virtual method; applies the
18089         attributes to a method or accessor.
18090         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18091         (MemberBase.ApplyConditionalAttribute): Likewise.
18092         (MemberBase.ApplyDllImportAttribute): Likewise.
18093         (MemberBase.CheckAbstractAndExternal): Likewise.
18094         (MethodCore.ParameterTypes): This is now a property instead of a
18095         method, it's initialized from DoDefineParameters().
18096         (MethodCore.ParameterInfo): Removed the set accessor.
18097         (MethodCore.DoDefineParameters): New protected virtual method to
18098         initialize ParameterTypes and ParameterInfo.
18099         (Method.GetReturnType): We can now simply return the MemberType.
18100         (Method.GetMethodFlags): Override the MemberBase version and add
18101         the conditional flags.
18102         (Method.CheckBase): Moved some code from Define() here, call
18103         DoDefineParameters() here.
18104         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18105         here to avoid some larger code duplication.
18106         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18107         ensure that abstract and external accessors don't declare a body.
18108
18109         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18110         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18111         lookup in the attribute's parent classes, so we need to abort as soon
18112         as we found the first match.
18113         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18114         the attribute has no arguments.
18115
18116         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18117         of a Method.
18118
18119 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18120
18121         * cs-parser.jay: reverted previous patch.
18122
18123 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18124
18125         * cs-parser.jay: fixed bug #22119.
18126
18127 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18128
18129         * attribute.cs: fixed compilation. The error was:
18130         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18131         be assigned to before control leaves the current method."
18132         [FIXME:  Filed as bug #28186: MCS must report this error.]
18133
18134 2002-07-25  Martin Baulig  <martin@gnome.org>
18135
18136         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18137         method to pull the condition name ouf of a Conditional attribute.
18138         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18139         the obsolete message and error flag out of an Obsolete attribute.
18140
18141         * class.cs (Method.GetMethodFlags): New public method to get the
18142         TypeManager.MethodFlags for this method.
18143         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18144         private methods.
18145         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18146         if we're overriding a virtual function, set the new private variable
18147         `parent_method'; call the new TypeManager.AddMethod().
18148
18149         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18150         the MethodBuilder and the Method in a PtrHashtable.
18151         (TypeManager.builder_to_method): Added for this purpose.
18152         (TypeManager.MethodFlags): Added IsObsoleteError.
18153         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18154         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18155         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18156         the message from the attribute.
18157
18158 2002-07-24  Martin Baulig  <martin@gnome.org>
18159
18160         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18161         preprocessor directives, ensure that the argument to #define/#undef is
18162         exactly one identifier and that it's actually an identifier.
18163
18164         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18165         did not work ....
18166
18167 2002-07-24  Martin Baulig  <martin@gnome.org>
18168
18169         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18170         initialize it to TypeManager.object_type in the constructor.
18171         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18172         of the `hm.get_current' method if we're using the collection pattern.
18173         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18174         for the explicit conversion to make it work when we're using the collection
18175         pattern and the `Current' property has a different return type than `object'.
18176         Fixes #27713.
18177
18178 2002-07-24  Martin Baulig  <martin@gnome.org>
18179
18180         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18181         does not match, but don't report any errors.  This method is called in
18182         order for all methods in a MethodGroupExpr until a matching method is
18183         found, so we don't want to bail out if the first method doesn't match.
18184         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18185         matches, report the 123.  Fixes #28070.
18186
18187 2002-07-24  Martin Baulig  <martin@gnome.org>
18188
18189         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18190         TypeManager.TypeToCoreType() to the top of the method so the
18191         following equality checks will work.  Fixes #28107.
18192
18193 2002-07-24  Martin Baulig  <martin@gnome.org>
18194
18195         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18196         operand is of type uint, and the other operand is of type sbyte,
18197         short or int, the operands are converted to type long." -
18198         Actually do what this comment already told us.  Fixes bug #28106,
18199         added test-150.cs.
18200
18201 2002-07-24  Martin Baulig  <martin@gnome.org>
18202
18203         * class.cs (MethodBase): New abstract class.  This is now a base
18204         class for Property, Indexer and Event to avoid some code duplication
18205         in their Define() and DefineMethods() methods.
18206         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18207         generic methods for Define() and DefineMethods().
18208         (FieldBase): Derive from MemberBase, not MemberCore.
18209         (Property): Derive from MemberBase, not MemberCore.
18210         (Property.DefineMethod): Moved all the code from this method to the
18211         new MethodBase.DefineAccessor(), just call it with appropriate
18212         argumetnts.
18213         (Property.Define): Call the new Property.DoDefine(), this does some
18214         sanity checks and we don't need to duplicate the code everywhere.
18215         (Event): Derive from MemberBase, not MemberCore.
18216         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18217         accessors, this will also make them work with interface events.
18218         (Indexer): Derive from MemberBase, not MemberCore.
18219         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18220         (Indexer.Define): Use the new MethodBase functions.
18221
18222         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18223         argument to the constructor.
18224         (Interface.FindMembers): Added support for interface events.
18225         (Interface.PopluateEvent): Implemented.
18226
18227         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18228
18229 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18230
18231         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18232         but this is required to check for a method name being the same as
18233         the containing class.  
18234
18235         Handle this now.
18236
18237 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18238
18239         * interface.cs: initialize variable.
18240
18241 2002-07-23  Martin Baulig  <martin@gnome.org>
18242
18243         Implemented the IndexerName attribute in interfaces.
18244
18245         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18246         name if this is an explicit interface implementation.
18247         (Indexer.InterfaceIndexerName): New public variable.  If we're
18248         implementing an interface indexer, this is the IndexerName in that
18249         interface.  Otherwise, it's the IndexerName.
18250         (Indexer.DefineMethod): If we're implementing interface indexer,
18251         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18252         and Pending.ImplementIndexer methods.
18253         (Indexer.Define): Also define the PropertyBuilder if we're
18254         implementing an interface indexer and this is neither an explicit
18255         interface implementation nor do the IndexerName match the one in
18256         the interface.
18257
18258         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18259         If a method is defined here, then we always need to create a proxy
18260         for it.  This is used when implementing interface indexers.
18261         (Pending.IsInterfaceIndexer): New public method.
18262         (Pending.ImplementIndexer): New public method.
18263         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18264         This is used when implementing interface indexers to define a proxy
18265         if necessary.
18266         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18267         define a proxy if necessary.
18268
18269         * interface.cs (Interface.IndexerName): New public variable.
18270         (Interface.PopulateIndexer): Set the IndexerName.
18271         (Interface.DefineIndexers): New private method.  Populate all the
18272         indexers and make sure their IndexerNames match.
18273
18274         * typemanager.cs (IndexerPropertyName): Added support for interface
18275         indexers.
18276
18277 2002-07-22  Martin Baulig  <martin@gnome.org>
18278
18279         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18280         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18281         ret if HasReturnLabel.
18282         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18283         variables.
18284
18285         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18286         and set the ec.LoopBeginTryCatchLevel.
18287         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18288         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18289         the current ec.TryCatchLevel, the branch goes out of an exception
18290         block.  In this case, we need to use Leave and not Br.
18291
18292 2002-07-22  Martin Baulig  <martin@gnome.org>
18293
18294         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18295         block unless the block does not always return or it is contained in
18296         another try { ... } catch { ... } block.  Fixes bug #26506.
18297         Added verify-1.cs to the test suite.
18298
18299 2002-07-22  Martin Baulig  <martin@gnome.org>
18300
18301         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18302         then we do not always return.  Fixes bug #24985.
18303
18304 2002-07-22  Martin Baulig  <martin@gnome.org>
18305
18306         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18307         lookup on a per-class level; ie. walk up the class hierarchy until we
18308         found at least one applicable method, then choose the best among them.
18309         Fixes bug #24463 and test-29.cs.
18310
18311 2002-07-22  Martin Baulig  <martin@gnome.org>
18312
18313         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18314         return types of the methods.  The return type is not part of the
18315         signature and we must not check it to make the `new' modifier work.
18316         Fixes bug #27999, also added test-147.cs.
18317         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18318
18319         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18320         on the method's return type.
18321
18322 2002-07-21  Martin Baulig  <martin@gnome.org>
18323
18324         * assign.cs: Make this work if the rightmost source is a constant and
18325         we need to do an implicit type conversion.  Also adding a few more tests
18326         to test-38.cs which should have caught this.
18327
18328         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18329         target in the makefile for this.  The makefile.gnu is primarily intended
18330         for end-users who don't want to debug the compiler.
18331
18332 2002-07-21  Martin Baulig  <martin@gnome.org>
18333
18334         * assign.cs: Improved the Assign class so it can now handle embedded
18335         assignments (X = Y = Z = something).  As a side-effect this'll now also
18336         consume less local variables.  test-38.cs now passes with MCS, added
18337         a few new test cases to that test.
18338
18339 2002-07-20  Martin Baulig  <martin@gnome.org>
18340
18341         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18342         instructions.  Fixes bug #27977, also added test-146.cs.
18343
18344 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18345
18346         * cs-tokenizer.cs: fixed getHex ().
18347
18348 2002-07-19  Martin Baulig  <martin@gnome.org>
18349
18350         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18351         not Type.GetType() to lookup the array type.  This is needed when
18352         we're constructing an array of a user-defined type.
18353         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18354         single-dimensional arrays, but also for single-dimensial arrays of
18355         type decimal.
18356
18357 2002-07-19  Martin Baulig  <martin@gnome.org>
18358
18359         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18360         this function is called, it's not allowed to share LocalBuilders
18361         among ILGenerators.
18362
18363 2002-07-19  Martin Baulig  <martin@gnome.org>
18364
18365         * expression.cs (Argument.Resolve): Report an error 118 when trying
18366         to pass a type as argument.
18367
18368 2002-07-18  Martin Baulig  <martin@gnome.org>
18369
18370         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18371         Conv_R_Un for the signed `long' type.
18372
18373 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18376         `expr' for the temporary result, as that will fail if we do
18377         multiple resolves on the same expression.
18378
18379 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18380
18381         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18382         ec.TypeContainer for looking up aliases. 
18383
18384         * class.cs (TypeContainer): Remove LookupAlias from here.
18385
18386         * decl.cs (DeclSpace); Move here.
18387
18388 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18389
18390         * class.cs (FindMembers): Only call filter if the constructor
18391         bulider is not null.
18392
18393         Also handle delegates in `NestedTypes' now.  Now we will perform
18394         type lookups using the standard resolution process.  This also
18395         fixes a bug.
18396
18397         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18398         This uses Expressions (the limited kind that can be parsed by the
18399         tree) instead of strings.
18400
18401         * expression.cs (ComposedCast.ToString): Implement, used to flag
18402         errors since now we have to render expressions.
18403
18404         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18405         FormArrayType. 
18406
18407         * ecore.cs (SimpleName.ToString): ditto.
18408
18409         * cs-parser.jay: Instead of using strings to assemble types, use
18410         Expressions to assemble the type (using SimpleName, ComposedCast,
18411         MemberAccess).  This should fix the type lookups in declarations,
18412         because we were using a different code path for this.
18413
18414         * statement.cs (Block.Resolve): Continue processing statements
18415         even when there is an error.
18416
18417 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18418
18419         * class.cs (Event.Define): Also remove the `remove' method from
18420         the list of pending items.
18421
18422         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18423         generate more compact code. 
18424
18425 2002-07-17  Martin Baulig  <martin@gnome.org>
18426
18427         * const.cs (Const.LookupConstantValue): Add support for constant
18428         `unchecked' and `checked' expressions.
18429         Also adding test case test-140.cs for this.
18430
18431 2002-07-17  Martin Baulig  <martin@gnome.org>
18432
18433         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18434         check whether mi.ReturnType implements the IEnumerator interface; the
18435         `==' and the IsAssignableFrom() will fail in this situation.
18436
18437 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18438
18439         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18440         here too.
18441
18442 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18443
18444         * expression.cs: fixed bug #27811.
18445
18446 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18447
18448         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18449         Molaro: when we are a ref, the value already contains a pointer
18450         value, do not take the address of it.
18451
18452 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18453         * removed mb-parser.jay and mb-tokenizer.cs
18454
18455 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18456
18457         * expression.cs: check against the building corlib void type.
18458
18459 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18460
18461         * ecore.cs: fix for valuetype static readonly fields: when 
18462         initializing them, we need their address, not the address of a copy.
18463
18464 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18465
18466         * typemanager.cs: register also enum_type in corlib.
18467
18468 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18469
18470         * class.cs: allow calling this (but not base) initializers in structs.
18471
18472 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18473
18474         * ecore.cs: make sure we compare against the building base types
18475         in GetTypeSize ().
18476
18477 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18478
18479         * typemanager.cs: fix TypeToCoreType() to handle void and object
18480         (corlib gets no more typerefs after this change).
18481
18482 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18483
18484         * expression.cs (ArrayCreation.EmitArrayArguments): use
18485         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18486
18487         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18488         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18489         array indexes, the runtime actually forbids them.
18490
18491         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18492         for array arguments here.
18493
18494         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18495         instead of the default for ValueTypes.
18496
18497         (New.DoEmit): Use IsValueType instead of
18498         IsSubclassOf (value_type)
18499         (New.DoResolve): ditto.
18500         (Invocation.EmitCall): ditto.
18501
18502         * assign.cs (Assign): ditto.
18503
18504         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18505         Statements *are* currently doing part of their resolution during
18506         Emit.  
18507
18508         Expressions do always resolve during resolve, but statements are
18509         only required to propagate resolution to their children.
18510
18511 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18512
18513         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18514
18515         (LoadAssembly): Do not add the dll if it is already specified
18516
18517         (MainDriver): Add the System directory to the link path at the end,
18518         after all the other -L arguments. 
18519
18520         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18521         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18522         ldelem.u1) and using the opposite for sbytes.
18523
18524         This fixes Digger, and we can finally run it.
18525
18526         * driver.cs (UnixParseOption): Move the option parsing here.  
18527         (CSCParseOption): Implement CSC-like parsing of options.
18528
18529         We now support both modes of operation, the old Unix way, and the
18530         new CSC-like way.  This should help those who wanted to make cross
18531         platform makefiles.
18532
18533         The only thing broken is that /r:, /reference: and /lib: are not
18534         implemented, because I want to make those have the same semantics
18535         as the CSC compiler has, and kill once and for all the confussion
18536         around this.   Will be doing this tomorrow.
18537
18538         * statement.cs (Unsafe.Resolve): The state is checked during
18539         resolve, not emit, so we have to set the flags for IsUnsfe here.
18540
18541 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18542
18543         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18544         not catch the Error_ObjectRefRequired in SimpleName (as it is
18545         possible to have a class/instance variable name that later gets
18546         deambiguated), we have to check this here.      
18547
18548 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18549
18550         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18551         make static and put into Expression.
18552
18553         (Event.Define): Register the private field of the event with the 
18554         TypeManager so that GetFieldFromEvent can get at it.
18555
18556         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18557         keep track of the private field associated with an event which
18558         has no accessors.
18559
18560         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18561         private field.
18562
18563         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18564
18565 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18566
18567         * expression.cs (Binary.EmitBranchable): this routine emits the
18568         Binary expression in a branchable context.  This basically means:
18569         we need to branch somewhere, not just get the value on the stack.
18570
18571         This works together with Statement.EmitBoolExpression.
18572
18573         * statement.cs (Statement.EmitBoolExpression): Use
18574         EmitBranchable. 
18575
18576 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18577
18578         * statement.cs (For): Reduce the number of jumps in loops.
18579
18580         (For): Implement loop inversion for the For statement.
18581
18582         (Break): We can be breaking out of a Try/Catch controlled section
18583         (foreach might have an implicit try/catch clause), so we need to
18584         use Leave instead of Br.
18585
18586         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18587         now).  If the instace expression supports IMemoryLocation, we use
18588         the AddressOf method from the IMemoryLocation to extract the
18589         address instead of emitting the instance.
18590
18591         This showed up with `This', as we were emitting the instance
18592         always (Emit) instead of the Address of This.  Particularly
18593         interesting when This is a value type, as we dont want the Emit
18594         effect (which was to load the object).
18595
18596 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18597
18598         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18599
18600         * statement.cs (Checked): Set the CheckedState during the resolve
18601         process too, as the ConvCast operations track the checked state on
18602         the resolve process, and not emit.
18603
18604         * cs-parser.jay (namespace_member_declaration): Flag that we have
18605         found a declaration when we do.  This is used to flag error 1529
18606
18607         * driver.cs: Report ok when we display the help only.
18608
18609 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18610
18611         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18612
18613 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18614
18615         * cs-tokenizer.cs (define): We also have to track locally the
18616         defines.  AllDefines is just used for the Conditional Attribute,
18617         but we also need the local defines for the current source code. 
18618
18619 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18620
18621         * statement.cs (While, For, Do): These loops can exit through a
18622         Break statement, use this information to tell whether the
18623         statement is the last piece of code.
18624
18625         (Break): Flag that we break.
18626
18627         * codegen.cs (EmitContexts): New `Breaks' state variable.
18628
18629 2002-07-03  Martin Baulig  <martin@gnome.org>
18630
18631         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18632         modifiers in method declarations in structs.  Otherwise, you won't
18633         be able to override things like Object.Equals().
18634
18635 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18636
18637         * class.cs (Method, Property, Indexer): Do not allow the public
18638         modifier to be used in explicit interface implementations.
18639
18640         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18641         override modifiers in method declarations in structs
18642
18643 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18644
18645         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18646         integer or real overflow, report an error
18647
18648 2002-07-02  Martin Baulig  <martin@gnome.org>
18649
18650         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18651         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18652         to tell the runtime about our newly created System.Object and
18653         System.ValueType types.
18654
18655 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18656
18657         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18658         struct instead of Ldarg/Starg.
18659
18660 2002-07-02  Martin Baulig  <martin@gnome.org>
18661
18662         * expression.cs (Indirection.Indirection): Call
18663         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18664
18665 2002-07-02  Martin Baulig  <martin@gnome.org>
18666
18667         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18668         ValueType, call TypeManager.TypeToCoreType() on it.
18669         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18670         the OpCodes.Newarr argument.
18671
18672 2002-07-02  Martin Baulig  <martin@gnome.org>
18673
18674         * expression.cs (Invocation.EmitCall): When compiling corlib,
18675         replace all calls to the system's System.Array type to calls to
18676         the newly created one.
18677
18678         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18679         System.Array methods.
18680         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18681         from the system's System.Array type which must be replaced.
18682
18683 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18684
18685         * typemanager.cs: load unverifiable_code_ctor so we can build
18686         corlib using the correct type. Avoid using GetTypeCode() with
18687         TypeBuilders.
18688         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18689         TypeManager.object_type to allow building corlib.
18690
18691 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18692
18693         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18694
18695 2002-07-01  Martin Baulig  <martin@gnome.org>
18696
18697         * class.cs: Make the last change actually work, we need to check
18698         whether `ifaces != null' to avoid a crash.
18699
18700 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18701
18702         * class.cs: when we build structs without fields that implement
18703         interfaces, we need to add the interfaces separately, since there is
18704         no API to both set the size and add the interfaces at type creation
18705         time.
18706
18707 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18708
18709         * expression.cs: the dimension arguments to the array constructors
18710         need to be converted if they are a long.
18711
18712 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18713
18714         * class.cs: don't emit ldarg.0 if there is no parent constructor
18715         (fixes showstopper for corlib).
18716
18717 2002-06-29  Martin Baulig  <martin@gnome.org>
18718
18719         MCS now compiles corlib on GNU/Linux :-)
18720
18721         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18722         ie. check for MethodImplOptions.InternalCall.
18723
18724         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18725         and TypeManager.attribute_type are null, so we must explicitly check
18726         whether parent is not null to find out whether it's an attribute type.
18727         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18728         and SetBuilder, not only if the property is neither abstract nor external.
18729         This is necessary to set the MethodImplOptions on the accessor methods.
18730         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18731         SetBuilder, see Property.Emit().
18732
18733         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18734         populate "System.Object", "System.ValueType" and "System.Attribute" since
18735         they've already been populated from BootCorlib_PopulateCoreTypes().
18736
18737 2002-06-29  Martin Baulig  <martin@gnome.org>
18738
18739         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18740         is the NullLiteral, we also need to make sure that target_type is not
18741         an enum type.   
18742
18743 2002-06-29  Martin Baulig  <martin@gnome.org>
18744
18745         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18746         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18747         before calling BootstrapCorlib_ResolveDelegate ().
18748
18749 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18750
18751         * statement.cs: fixed build-breaker. All tests passed ok.
18752
18753 2002-06-27  Martin Baulig  <martin@gnome.org>
18754
18755         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18756         for System.Decimal when compiling corlib.
18757
18758 2002-06-27  Martin Baulig  <martin@gnome.org>
18759
18760         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18761         switch blocks which contain nothing but a default clause.
18762
18763 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18764
18765        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18766
18767 2002-06-27  Martin Baulig  <martin@gnome.org>
18768
18769         * ecore.cs (PropertyExpr.PropertyExpr): Call
18770         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18771
18772         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18773         is already a TypeBuilder.
18774
18775 2002-06-27  Martin Baulig  <martin@gnome.org>
18776
18777         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18778         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18779         the "from an array-type to System.Array" case.  This makes it work
18780         when compiling corlib.
18781
18782 2002-06-27  Martin Baulig  <martin@gnome.org>
18783
18784         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18785         non-static PropertyExpr, set its InstanceExpression.  This makes
18786         the `ICollection.Count' property work in System/Array.cs.
18787
18788 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18789
18790         * driver.cs: Made error handling more consistent.  Errors now
18791         tracked by Report class, so many methods which used to return int
18792         now return void.  Main() now prints success/failure and 
18793         errors/warnings message.
18794
18795         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18796         the magic number return values (123 and 124).  Now, if the
18797         expected error occurs, the compiler exits with success (exit value
18798         0).  If the compilation completes without seeing that particular
18799         error, the compiler exits with failure (exit value 1).  The
18800         makefile in mcs/errors has been changed to handle the new behaviour.
18801
18802         * report.cs: Made 'expected error' number a property and renamed
18803         it from 'Probe' to 'ExpectedError'.
18804
18805         * genericparser.cs: Removed error handling support, since it is
18806         now all done by Report class.
18807
18808         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18809         class, so parse() no longer returns an int.
18810
18811         * namespace.cs: Use Report.Error instead of GenericParser.error
18812
18813 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18814
18815         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18816         TypeContainer.AddOperator): At the front of the list put the
18817         explicit implementations, so they get resolved/defined first. 
18818
18819 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18820
18821         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18822         interface type is implemented by this TypeContainer.  Used during
18823         explicit interface implementation.
18824
18825         (Property.Define, Indexer.Define, Method.Define): Validate that
18826         the given interface in the explicit implementation is one of the
18827         base classes for the containing type.
18828
18829         Also if we are explicitly implementing an interface, but there is
18830         no match in the pending implementation table, report an error.
18831
18832         (Property.Define): Only define the property if we are
18833         not explicitly implementing a property from an interface.  Use the
18834         correct name also for those properties (the same CSC uses,
18835         although that is really not needed).
18836
18837         (Property.Emit): Do not emit attributes for explicitly implemented
18838         properties, as there is no TypeBuilder.
18839
18840         (Indexer.Emit): ditto.
18841
18842         Hiding then means that we do not really *implement* a pending
18843         implementation, which makes code fail.
18844
18845 2002-06-22  Martin Baulig  <martin@gnome.org>
18846
18847         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18848         the return value of Object.GetType().  [FIXME: we need to do this whenever
18849         we get a type back from the reflection library].
18850
18851 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18852
18853         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18854
18855 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18856
18857         * attribute.cs: Return null if we can not look up the type.
18858
18859         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18860         the interface types found.
18861
18862         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18863         interface types found.
18864
18865         * typemanager.cs (GetInterfaces): Make this routine returns alll
18866         the interfaces and work around the lame differences between
18867         System.Type and System.Reflection.Emit.TypeBuilder in the results
18868         result for GetInterfaces.
18869
18870         (ExpandInterfaces): Given an array of interface types, expand and
18871         eliminate repeated ocurrences of an interface.  This expands in
18872         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18873         be IA, IB, IC.
18874
18875 2002-06-21  Martin Baulig  <martin@gnome.org>
18876
18877         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18878         on System.Enum.
18879
18880 2002-06-21  Martin Baulig  <martin@gnome.org>
18881
18882         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18883         and called with one of the core types, return the corresponding typebuilder for
18884         that type.
18885
18886         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18887         element type.
18888
18889 2002-06-21  Martin Baulig  <martin@gnome.org>
18890
18891         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18892         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18893         (Expression.ConvertReferenceExplicit): Likewise.
18894
18895         * expression.cs (ElementAccess.DoResolve): Likewise.
18896         (ElementAccess.DoResolveLValue): Likewise.
18897
18898 2002-06-10  Martin Baulig  <martin@gnome.org>
18899
18900         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18901         add the "value" parameter to the parameter list.
18902
18903         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18904         to our caller.
18905
18906 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18909         the argument to an int, uint, long or ulong, per the spec.  Also
18910         catch negative constants in array creation.
18911
18912 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18913
18914         * class.cs: do not allow the same interface to appear twice in
18915         the definition list.
18916
18917 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18918
18919         * ecore.cs: don't use ldlen with System.Array.
18920
18921 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18922
18923         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18924
18925 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18926
18927         * modifiers.cs: produce correct field attributes for protected
18928         internal. Easy fix so miguel can work on ther harder stuff:-)
18929
18930 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18931
18932         * pending.cs: New file.  Move the code from class.cs here.
18933         Support clearning the pending flag for all methods (when not doing
18934         explicit interface implementation).
18935
18936 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18937
18938         * rootcontext.cs: added a couple more types needed to bootstrap.
18939
18940 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18941
18942         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18943         constructor in the type, instead of any constructor in the type
18944         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18945         a bug in the Mono runtime when applying the params attribute). 
18946
18947 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18948         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18949
18950 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18951
18952         * expression.cs (Unary.ResolveOperator): Use TypeManager
18953         to resolve the type.
18954
18955 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18956
18957         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18958         attached.
18959
18960         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18961         with each member too.
18962
18963         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18964         field builders too - this takes care of the enum member case.
18965
18966 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18967
18968         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18969         address-of operator on both value types and pointers.
18970
18971 2002-06-10  Martin Baulig  <martin@gnome.org>
18972
18973         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18974         PropertyBuilder to the `property_builders' list.
18975
18976         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18977         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18978         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18979         find any indexers which are inherited from an interface.
18980
18981 2002-06-09  Martin Baulig  <martin@gnome.org>
18982
18983         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18984         the same type as the constant if necessary.  There's also a test-130.cs
18985         for this.
18986
18987         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18988
18989         * typemanager.cs (TypeManager.ChangeType): Previously known as
18990         Enum.ChangeEnumType().
18991
18992 2002-06-09  Martin Baulig  <martin@gnome.org>
18993
18994         * expression.cs (Cast.TryReduce): Added support for consts.
18995
18996 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18997
18998         * class.cs (Accessor): Hold attributes information so we can pass
18999         it along.
19000
19001         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19002         Modify to pass in attributes attached to the methods.
19003
19004         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19005
19006         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19007         to handle the Accessor kind :-)
19008
19009         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19010
19011 2002-06-08  Martin Baulig  <martin@gnome.org>
19012
19013         * expression.cs (Unary.TryReduceNegative): Added support for
19014         ULongConstants.
19015
19016 2002-06-08  Martin Baulig  <martin@gnome.org>
19017
19018         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19019         name can't be found in the `defined_names' - the caller will do a
19020         MemberLookup in this case and thus find methods in System.Enum
19021         such as Enum.IsDefined().
19022
19023 2002-06-08  Martin Baulig  <martin@gnome.org>
19024
19025         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19026         Convert.ChangeType() which works with TypeBuilder created types.
19027         (Enum.LookupEnumValue, Enum.Define): Use it here.
19028
19029         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19030         `TypeBuilder.BaseType != null' check.
19031         (TypeContainer.FindMembers): Only lookup parent members if we
19032         actually have a parent.
19033         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19034         (ConstructorInitializer.Resolve): Likewise.
19035
19036         * interface.cs (Interface.FindMembers): Added
19037         `TypeBuilder.BaseType != null' check.
19038
19039         * rootcontext.cs (RootContext.ResolveCore): Added
19040         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19041         classes_second_stage.
19042
19043         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19044         debug_type and trace_type when compiling with --nostdlib.       
19045
19046 2002-06-07  Martin Baulig  <martin@gnome.org>
19047
19048         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19049         (AddField): Set it to true when adding a non-static field.
19050         (DefineType): Use `have_nonstatic_fields' to find out whether we
19051         have non-static fields, not `Fields != null'.
19052
19053 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19054
19055         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19056         dereferencing a null on the static-field code path)
19057
19058 2002-05-30  Martin Baulig  <martin@gnome.org>
19059
19060         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19061         to take command line arguments.  Use reflection to call the new
19062         custom `Initialize' function on the symbol writer and pass it the
19063         command line arguments.
19064
19065         * driver.cs (--debug-args): New command line argument to pass command
19066         line arguments to the symbol writer.
19067
19068 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19069
19070         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19071         the target type for indexers and properties.  Thanks to Joe for
19072         catching this.
19073
19074 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19075
19076         * typemanager.cs (MethodFlags): returns the method flags
19077         (Obsolete/ShouldIgnore) that control warning emission and whether
19078         the invocation should be made, or ignored. 
19079
19080         * expression.cs (Invocation.Emit): Remove previous hack, we should
19081         not do this on matching a base type, we should do this based on an attribute
19082
19083         Only emit calls to System.Diagnostics.Debug and
19084         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19085         on the command line.
19086
19087         * rootcontext.cs: Global settings for tracing and debugging.
19088
19089         * cs-tokenizer.cs (define): New utility function to track
19090         defines.   Set the global settings for TRACE and DEBUG if found.
19091
19092 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19093
19094         * interface.cs (Populate*): Pass in the TypeContainer as well as
19095         the DeclSpace as parameters so that we can create EmitContexts and
19096         then use that to apply attributes etc.
19097
19098         (PopulateMethod, PopulateEvent, PopulateProperty)
19099         (PopulateIndexer): Apply attributes everywhere.
19100
19101         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19102         etc.
19103
19104         (ApplyAttributes): Update accordingly.
19105
19106         We now apply interface attributes for all members too.
19107
19108 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19109
19110         * class.cs (Indexer.Define); Correctly check if we are explicit
19111         implementation (instead of checking the Name for a ".", we
19112         directly look up if the InterfaceType was specified).
19113
19114         Delay the creation of the PropertyBuilder.
19115
19116         Only create the PropertyBuilder if we are not an explicit
19117         interface implementation.   This means that explicit interface
19118         implementation members do not participate in regular function
19119         lookups, and hence fixes another major ambiguity problem in
19120         overload resolution (that was the visible effect).
19121
19122         (DefineMethod): Return whether we are doing an interface
19123         implementation. 
19124
19125         * typemanager.cs: Temporary hack until we get attributes in
19126         interfaces (Ravi is working on that) and we get IndexerName
19127         support in interfaces.
19128
19129         * interface.cs: Register the indexers as properties.
19130
19131         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19132         warning, I have verified that this is a bug in the .NET runtime
19133         (JavaScript suffers of the same problem).
19134
19135         * typemanager.cs (MemberLookup): When looking up members for
19136         interfaces, the parent of an interface is the implicit
19137         System.Object (so we succeed in searches of Object methods in an
19138         interface method invocation.  Example:  IEnumerable x;  x.ToString
19139         ()) 
19140
19141 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19142
19143         * class.cs (Event): Events should also register if they do
19144         implement the methods that an interface requires.
19145
19146         * typemanager.cs (MemberLookup); use the new GetInterfaces
19147         method. 
19148
19149         (GetInterfaces): The code used to lookup interfaces for a type is
19150         used in more than one place, factor it here. 
19151
19152         * driver.cs: Track the errors at the bottom of the file, we kept
19153         on going.
19154
19155         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19156         instance if the method we are calling is static!
19157
19158 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19159
19160         * attribute.cs (ApplyAttributes): Make this function filter out
19161         the IndexerName attribute (as that attribute in reality is never
19162         applied) and return the string constant for the IndexerName
19163         attribute. 
19164
19165         * class.cs (TypeContainer.Emit): Validate that all the indexers
19166         have the same IndexerName attribute, and if so, set the
19167         DefaultName attribute on the class. 
19168
19169         * typemanager.cs: The return value might contain other stuff (not
19170         only methods).  For instance, consider a method with an "Item"
19171         property and an Item method.
19172
19173         * class.cs: If there is a problem with the parameter types,
19174         return. 
19175
19176 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19177
19178         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19179         looks at user defined conversion after making a call to 
19180         StandardConversionExists - we need this for overload resolution.
19181
19182         * expression.cs : Update accordingly the various method calls.
19183
19184         This fixes 2 bugs filed against implicit user defined conversions 
19185
19186 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19187
19188         * statement.cs: Track the result of the assignment.
19189
19190 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19191
19192         * expression.cs (MemberAccess): Improved error reporting for
19193         inaccessible members.
19194
19195 2002-05-22  Martin Baulig  <martin@gnome.org>
19196
19197         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19198         itself with debugging support.
19199
19200 2002-05-22  Martin Baulig  <martin@gnome.org>
19201
19202         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19203         Removed, this isn't needed anymore.
19204
19205 2002-05-20  Martin Baulig  <martin@gnome.org>
19206
19207         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19208         be underlying type for an enum.
19209
19210 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19211
19212         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19213         that splits out the loading of just the core types.
19214
19215         * rootcontext.cs (ResolveCore): Split the struct resolution in
19216         two, so we can load the enumeration underlying types before any
19217         enums are used.
19218
19219         * expression.cs (Is): Bandaid until we fix properly Switch (see
19220         bug #24985 for details).
19221
19222         * typemanager.cs (ImplementsInterface): The hashtable will contain
19223         a null if there are no interfaces implemented.
19224
19225 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19226
19227         * cs-parser.jay (indexer_declarator): It is fine to have array
19228         parameters
19229
19230 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19231
19232         * typemanager.cs: (RegisterBuilder): New function used to register
19233         TypeBuilders that implement interfaces.  Since
19234         TypeBuilder.GetInterfaces (as usual) does not work with lame
19235         Reflection.Emit. 
19236         (AddUserType): register interfaces.
19237
19238         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19239         dealing with TypeBuilder.  Also, arrays are showing up as
19240         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19241         methods can not be invoked on them!
19242
19243         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19244         (ImplicitReferenceConversionExists): Split out from
19245         StandardConversionExists. 
19246
19247         * expression.cs (As): We were only implementing one of the three
19248         cases for the as operator.  We now implement them all.
19249         (Is): Implement the various other cases for Is as well.
19250
19251         * typemanager.cs (CACHE): New define used to control if we want or
19252         not the FindMembers cache.  Seems to have a negative impact on
19253         performance currently
19254
19255         (MemberLookup): Nested types have full acess to
19256         enclosing type members
19257
19258         Remove code that coped with instance/static returns for events, we
19259         now catch this in RealFindMembers.
19260
19261         (RealFindMembers): only perform static lookup if the instance
19262         lookup did not return a type or an event.  
19263
19264 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19265
19266         * assign.cs (CompoundAssign): We pass more semantic information
19267         now to Compound Assignments than we did before: now we have all
19268         the information at hand, and now we resolve the target *before* we
19269         do the expression expansion, which allows the "CacheValue" method
19270         to have the effect we intended (before, a [x] += 1 would generate
19271         two differen ArrayAccess expressions from the ElementAccess,
19272         during the resolution process).
19273
19274         (CompoundAssign.DoResolve): Resolve target and original_source here.
19275
19276 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19277
19278         * expression.cs (ArrayAccess): dropped debugging information. 
19279
19280         * typemanager.cs: Small bug fix: I was always returning i_members,
19281         instead of one of i_members or s_members (depending on which had
19282         the content).
19283
19284         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19285         method is invoked before any code generation takes place, and it
19286         is a mechanism to inform that the expression will be invoked more
19287         than once, and that the method should use temporary values to
19288         avoid having side effects
19289
19290         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19291
19292         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19293         implementation.
19294
19295         * expression.cs (Indirection, ArrayAccess): Add support for
19296         CacheTemporaries in these two bad boys. 
19297
19298         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19299         ldobj or ldind_ref.  
19300         (StoreFromPtr): Handle stobj as well.
19301
19302         * expression.cs (UnaryMutator): Share more code.
19303
19304         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19305         down: I was not tracking the Filter function as well, which
19306         was affecting the results of the cache.
19307
19308 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19309
19310         * attribute.cs: Remove the hack to handle the CharSet property on
19311         StructLayouts. 
19312
19313 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19314
19315         * attribute.cs (DoResolve): More uglyness, we now only try to
19316         resolve the attribute partially, to extract the CharSet
19317         information (only if we are a StructLayout attribute).  Otherwise 
19318
19319         (GetExtraTypeInfo): Add some code to conditionally kill in the
19320         future this.   I am more and more convinced that the .NET
19321         framework has special code to handle the attribute setting on
19322         certain elements.
19323
19324         * expression.cs (IsParamsMethodApplicable): Revert my previous
19325         foreach change here, it was wrong.
19326
19327 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19328
19329         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19330         (pp_expr): do not abort on unknown input, just return.
19331         (eval): abort if there are pending chars.
19332
19333         * attribute.cs (Attribute.Resolve): Positional parameters are
19334         optional.  Deal with that case.
19335
19336         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19337         the Ansi/Unicode/Auto information for the type.
19338
19339         (TypeContainer.DefineType): instantiate the EmitContext here, as
19340         we will be using it during the type definition (to resolve
19341         attributes) and during the emit phase.
19342
19343         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19344         to pull type information out of the attributes
19345
19346         (Attribute.Resolve): track the constructor builder, and allow for
19347         multiple invocations (structs and classes will use this).
19348
19349         * ecore.cs (MemberLookupFinal): new version with all the
19350         parameters customizable.
19351
19352         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19353         constructors.  Return if the result value is null (as the error
19354         would have been flagged already by MemberLookupFinal)
19355
19356         Do not allow instances of abstract classes or interfaces to be
19357         created.
19358
19359         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19360         We have to compare the assembly property here when dealing with
19361         FamANDAssem and Assembly access modifiers, because we might be
19362         creating an assembly from *modules* (that means that we are not
19363         getting TypeBuilders for types defined in other modules that are
19364         part of this assembly).
19365
19366         (Method.Emit): If the method is marked abstract and has a body,
19367         emit an error. 
19368
19369         (TypeContainer.DefineMembers): If both the defined member and the
19370         parent name match are methods, then do not emit any warnings: let
19371         the Method.Define routine take care of flagging warnings.  But if
19372         there is a mismatch (method overrides something else, or method is
19373         overriwritten by something, then emit warning).
19374
19375         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19376         set to null, this means `do not check for the return type on the
19377         signature'. 
19378
19379         (Method.Define): set the return type for the method signature to
19380         null, so that we get methods with the same name and parameters and
19381         different return types.  This is used to flag warning 114 (you are
19382         hiding a method, and you probably want to use the new/override
19383         keywords instead).
19384
19385         * typemanager.cs (MemberLookup): Implemented proper access
19386         control, closing a long standing set of bug reports.  The problem
19387         was that the Framework only has two bits: Public and NonPublic,
19388         and NonPublic includes private and protected methods, but we need
19389         to enforce the FamANDAssem, FamOrAssem and Family. 
19390
19391 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19392
19393         * statement.cs (GotoCase): Return true: Ammounts to giving up
19394         knowledge on whether we return or not, and letting the other case
19395         be responsible for it.
19396
19397 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19398
19399         * driver.cs: Do not load directories for each file processed, only
19400         do it if there is a pattern.
19401
19402         * ecore.cs: Report readonly assigns here as well, as we might have
19403         been resolved only by MemberAccess.
19404
19405         (SimpleName.SimpleNameResolve): Also be useful for LValue
19406         resolution.   We need this to propagate assign to local readonly variables
19407
19408         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19409         do not want to reuse potential criteria memory.
19410
19411         * class.cs (MyEventBuilder): Set reflected_type;
19412
19413         * ecore.cs (Constantify): Added support for constifying bools.
19414
19415         (RootContext.LookupType): Added a cache for values looked up in
19416         the declaration space.
19417
19418         * typemanager.cs (FindMembers): Now is a front-end to
19419         RealFindMembers, and provides a two-level hashtable-based cache to
19420         the request.  
19421
19422         15% performance improvement: from 22.5 to 19.2 seconds.
19423
19424         * expression.cs (IsParamsMethodApplicable): use foreach.
19425         (Invocation.DoResolve): ditto.
19426         (New.DoResolve): ditto.
19427         (ArrayCreation.DoResolve): ditto.
19428
19429         * ecore.cs (FindMostEncompassingType): use foreach.
19430
19431         * delegate.cs (NewDelegate.DoResolve): Use foreach
19432
19433         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19434         (RemoveMethods): use foreach.
19435
19436         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19437         nested foreach statements instead of for, and also break out of
19438         the inner loop once a match is found.
19439
19440         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19441
19442 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19443
19444         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19445         we actually unwrap the expression to allow for extra information
19446         to be extracted. 
19447
19448         * expression.cs: Use Shr_Un on unsigned operations. 
19449
19450 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19451
19452         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19453         applicable operators was not being considered correctly. This closes
19454         the bug Miguel reported.
19455
19456 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19457
19458         * attribute.cs: check that the type derives from System.Attribute
19459         and report the correct error in that case (moved the duplicate code to
19460         its own method, too).
19461
19462 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19463
19464         * attribute.cs: lookup attribute type name as the spec says: first the
19465         bare attribute name and then name + "Attribute" (nant compiles with
19466         mcs after this fix).
19467
19468 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19469
19470         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19471         Because of the way we parse things, we should try to see if a
19472         UIntConstant can fit in an integer.
19473
19474 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19475
19476         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19477         when we are in an explicit context.
19478
19479         (ConvertReferenceExplicit): When converting from Iface type S to Class
19480         T make sure the rules are implemented as an OR.
19481
19482         * parameter.cs (ParameterType): Make it a property for now although the
19483         purpose really isn't anything immediate.
19484
19485         * expression.cs (Is*Applicable): Do better checking on the parameter type
19486         of a ref/out parameter. The ones from the system assemblies are already 
19487         marked with the correct type so we don't need to do any correction.
19488
19489         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19490         the object type is standard too so include that.
19491
19492 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19493
19494         * ecore.cs (StandardConversionExists): Augment with missing code:
19495         deal with IntConstant, LongConstants and Enumerations.
19496
19497         * assign.cs: Report the error, instead of failing silently
19498
19499         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19500         typecontainer that they are declared, because the
19501         typecontainer/namespace will have the list of using clauses that
19502         need to be applied.
19503
19504         Assembly Attributes were escaping the normal registration
19505         mechanism. 
19506
19507         (EmitCode): Apply attributes within an EmitContext that represents
19508         the container they were declared on.
19509
19510         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19511
19512 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19513
19514         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19515         Revamp completely - make much cleaner as we now operate only
19516         on a set of Types.
19517
19518         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19519         to implement the logic detailed in the spec more correctly.
19520
19521         (UserDefinedConversion): Update accordingly.
19522
19523 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19524
19525         * statement.cs: Return flow analysis information up.
19526
19527         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19528         and the default.
19529
19530         (token): Do not consume an extra character before calling
19531         decimal_digits.
19532
19533 2002-05-06  Piers Haken <piersh@friskit.com>
19534
19535         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19536
19537 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19538
19539         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19540         EmitContext during the instance constructor initializer
19541         resolution, to stop access to instance variables.
19542
19543         This is mandated by the spec, last paragraph of the `constructor
19544         initializers' section. 
19545
19546 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19547
19548         * cs-parser.jay, class.cs (Accessor): new class used to represent
19549         an accessor (get or set).  In the past we used `null' to represent
19550         a missing accessor.  But this is ambiguous because there was no
19551         way to tell in abstract indexers/properties if one of them was
19552         specified.
19553
19554         Now there is a way of addressing that.
19555
19556         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19557         instead of FindMembers.
19558
19559         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19560         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19561
19562         * attribute.cs: Treat indexers and properties as the same in terms
19563         of applying attributes
19564
19565         * ecore.cs (FindMostEncompassedType): Use statically initialized
19566         EmptyExpressions()s like we do elsewhere to avoid creating useless
19567         objects (and we take this out of the tight loop).
19568
19569         (GetConversionOperators): Move the code to extract the actual
19570         operators to a separate routine to clean things up.
19571
19572 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19573
19574         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19575         events are always registered FieldBuilders.
19576
19577         * class.cs (FieldBase): New class shared by Fields 
19578
19579         * delegate.cs: If we are a toplevel delegate, use our full name.
19580         If we are a nested delegate, then only use our tail name.
19581
19582 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19583
19584         * expression.cs (IsApplicable): Ensure that we add the "&" to
19585         ref/out types before comparing it with the type of the argument.
19586
19587         (IsParamsMethodApplicable): Ditto.
19588
19589         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19590         silly me ;-)
19591
19592         * delegate.cs : Handle the case when we have more than one applicable
19593         method. Flag an error only when we finish checking all.
19594
19595 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19596
19597         * expression.cs: Add support for boolean static initializers.
19598
19599 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19600
19601         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19602
19603         * parameter.cs (ComputeParameterTypes,
19604         ComputeAndDefineParameterTypes): Better error handling: now we
19605         clear the `types' cache if we fail during any of the type lookups.
19606         We also return the status code correctly to our caller
19607
19608         * delegate.cs: If we fail to define a delegate, abort the extra
19609         steps. 
19610
19611         * expression.cs (Binary.ResolveOperator): for
19612         operator==(object,object) and operator !=(object, object) we also
19613         have to verify that there is an implicit conversion from one to
19614         the other.
19615
19616         (ArrayAccess.DoResolve): Array Access can operate on
19617         non-variables. 
19618
19619 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19620
19621         * assign.cs (CompoundAssign): A new class used as a "flag" that
19622         the assignment actually is happening as part of a compound
19623         assignment operator.
19624
19625         During compound assignment, a few new rules exist to enable things
19626         like:
19627
19628         byte b |= 1 + 2
19629
19630         From the spec:
19631
19632         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19633         to the type of x) if y is implicitly convertible to the type of x,
19634         and the operator is a builtin operator and the return type of the
19635         operator is explicitly convertible to the type of x. 
19636
19637         * rootcontext.cs: Reset warning level to 2.  4 catches various
19638         "interesting" features in mcs, we must clean this up at some
19639         point, but currently am trying to kill other bugs ;-)
19640
19641         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19642         in container classes as well.  
19643
19644         * expression.cs (Binary.ResolveOperator): Handle string case
19645         before anything else (as operator overloading does emit an error
19646         before doing anything else).
19647
19648         This code could go away when we move to a table driven model, but
19649         i could not come up with a good plan last night.
19650
19651 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19652
19653         * typemanager.cs (CSharpName): reimplementation using regex.
19654         * class.cs: added null check for fields in Emit
19655         * rootcontext.cs: set warninglevel to 4
19656
19657 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19658
19659         * typemanager.cs (CSharpName): reimplemented with Lupus
19660         suggestion.
19661
19662 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19663
19664         * statement.cs (If): correclty implement Resolve, because we were
19665         not catching sem errors in there.  The same process is needed
19666         everywhere else. 
19667         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19668
19669
19670         (Statement.Warning_DeadCodeFound): Factorize code.
19671         (While): Report dead code here too.
19672
19673         (Statement): Added Resolve virtual method to allow
19674         for resolution split from the emit code.
19675
19676 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19677
19678         * statement.cs (EmitBoolExpression): No longer try to resolve the
19679         expression here.    
19680         (MakeBoolean): New utility function that resolve, implicitly
19681         converts to boolean and tags the expression. 
19682
19683
19684         (If, Do): Implement dead code elimination.
19685         (While): Implement loop inversion
19686
19687         (Do, While, For, If): Resolve the expression prior to calling our
19688         code generation.
19689
19690 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19691
19692         * class.cs:
19693           - added method Report28 (warning: program has more than one entry point)
19694           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19695           - modified method Method.Define, the part at the end of the method
19696
19697         * rootcontext.cs: added static public Location EntryPointLocation;
19698           
19699         * ../errors/cs0028.cs : Add test case for the above warning.              
19700
19701         * typemanager.cs:
19702           - modified method CSharpName to allow arrays of primitive type to
19703             be printed nicely (e.g. instead of System.Int32[][] it now prints
19704             int[][])
19705           - added method CSharpSignature: returns the signature of a method
19706             in string format to be used in reporting errors, warnings, etc.
19707
19708         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19709         with String.Empty.
19710
19711 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19712
19713         * delegate.cs (Define): Fix extremely silly bug where I was
19714         setting the type of the 'object' parameter of the BeginInvoke
19715         method to System.IAsyncResult instead of System.Object ;-)
19716
19717 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19718
19719         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19720         here. 
19721
19722         (Constructor.Emit): return if we fail to initialize the
19723         constructor.  Another door closed!  
19724
19725         * expression.cs (New.DoResolve): Improve error message (from -6 to
19726         1501).  Use DeclaredOnly lookup to find the exact constructor.
19727
19728         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19729         loop.  This is useful.
19730
19731         * cs-parser.jay: Adjust the default parameters so that destructors
19732         have the proper signature.
19733
19734 2002-04-26  Martin Baulig  <martin@gnome.org>
19735
19736         * driver.cs (LoadAssembly): If `assembly' contains any characters
19737         which are only valid in path names and not in assembly names
19738         (currently slash, backslash and point), use Assembly.LoadFrom ()
19739         instead of Assembly.Load () on the `assembly' (before iteration
19740         over the link_paths).
19741
19742 2002-04-26  Martin Baulig  <martin@gnome.org>
19743
19744         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19745
19746 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19747
19748         * class.cs (Property): use the new typemanager.MemberLookup
19749
19750         (TypeContainer.MemberLookup): Implement using the
19751         TypeManager.MemberLookup now. 
19752
19753         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19754         and return MemberInfos, so that these can be used without an
19755         EmitContext (what we had before).
19756
19757 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19758
19759         * expression.cs: Fix the case where the argument to params if the
19760         type of the params.  I omitted handling this before.   Fixed
19761
19762 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19763
19764         * driver.cs: Call BootCorlib_PopulateCoreType
19765
19766         * class.cs (Property.CheckBase): Check for properties only, not
19767         for all members. 
19768
19769         * interface.cs: Temporary hack: try/catch around the
19770         CustomAttributeBuilder, because I am getting an exception that I
19771         do not understand.
19772
19773         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19774         types whose definitions are required to be there (attributes are
19775         defined before standard types).
19776
19777         Compute definitions as we boot the various types, as they are used
19778         immediately (value_type class will need object_type, but if we do
19779         not initialize object_type, we will pass a null, which will let
19780         the runtime pick the System.Object from the existing corlib, which
19781         is not what we want).
19782
19783 2002-04-22  Patrik Torstensson <totte@labs2.com>
19784
19785         * cs-tokenizer.cs: fixed a number of trim() issues.
19786
19787 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19788
19789         * expression.cs (Argument.Type): Ensure that we return the correct
19790         type when we have out or ref parameters [in which case we 
19791         append a "&"].
19792
19793 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * class.cs (Property, Indexer): Allow extern modifier in there. 
19796
19797         * typemanager.cs (InitBaseTypes): Initializes object_type and
19798         value_type, since those will be used early on during the bootstrap
19799         process to compile corlib.
19800
19801         (InitCoreTypes): Move code from here to InitBaseTypes.
19802
19803 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19804
19805         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19806         single-dimension arrays as using the ldlen opcode.  
19807
19808         Daniel Lewis discovered this optimization.  
19809
19810         * typemanager.cs: Add signature for System.Array::get_Length
19811
19812 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19813
19814         * statement.cs: report the error when the foreach does not apply to an
19815         array nor a collection.
19816
19817 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19818
19819         * expression.cs: Add implicit conversions to the operator ~.
19820
19821         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19822
19823         * typemanager.cs: Locate the decimal constructor.
19824
19825 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19826
19827         * attribute.cs: use the new property of TypeOf.
19828         * expression.cs: added 'get' property around typearg.
19829
19830         These changes fix a build breaker reported by NickD. Is this the
19831         correct way to fix?  If not, please, revert my changes and make it
19832         work :-).
19833
19834 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19835
19836         * attribute.cs: Add support for typeof in attribute invocations.
19837         I am not sure that this is right though.
19838
19839 2002-04-14  Duncan Mak  <duncan@ximian.com>
19840
19841         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19842         Binary.Operator.Division case.
19843
19844 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19845
19846         * class.cs (DefineType): Ensure that we do a proper check on
19847         attribute types and also register it with the TypeManager.
19848
19849         (TypeContainer.Targets): The default for attribute types is
19850         AttributeTargets.All.
19851
19852         * attribute.cs (ApplyAttributes): Registering the attribute type
19853         is done elsewhere, not when we discover we have a Usage attribute.
19854
19855 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19856
19857         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19858         and get rid of is_delegate parameter.
19859
19860         * everywhere : update.
19861
19862 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19863
19864         * cs-parser.jay (compilation_unit): Revamp completely to use
19865         some new ideas that I got from Rhys' grammar to solve the problems
19866         with assembly level attributes.
19867
19868         (outer_declaration): New grammar production.
19869
19870         (attribute_sections): Add.
19871
19872         (opt_attributes): Base on attribute_sections
19873
19874         (namespace_declaration): Allow opt_attributes to tackle the case
19875         when we have assembly level attributes - we are clever in this
19876         regard now ;-)
19877
19878         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19879         attributes in the non-global context.
19880
19881         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19882         instead of SetGlobalAttributes.
19883
19884         * class.cs, rootcontext.cs : Ensure we define and generate 
19885         attribute types before anything else.
19886
19887         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19888         and flag the new error -20 for the case when the attribute type
19889         does not have valid targets specified. csc does not catch this.
19890
19891         * ../errors/errors.txt : update for error # -20
19892
19893 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19894
19895         * support.cs (InternalParameters.ParameterModifier): Do some null
19896         checking and return sane values.
19897
19898         * class.cs (Method.Define): If we are a PInvoke method, ensure
19899         that we are static and extern. Report error # 601
19900
19901         * ../errors/cs0601.cs : Add test case for the above error.
19902
19903 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19904
19905         * rootcontext.cs (attribute_types): We need to keep type of
19906         all attribute types separately and emit code for them first.
19907
19908         (RegisterAttribute) : Implement.
19909
19910         * class.cs (DefineType): Check if the current Type is a custom
19911         attribute type and register it accordingly.
19912
19913         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19914         adding the first attribute twice and rename to
19915
19916         (SetGlobalAttributes): this.
19917
19918         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19919         lookups.
19920
19921         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19922         if we are processing global arguments. Hmm, I am unsure of this.
19923
19924 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19925
19926         * expression.cs: added static array of strings to avoid calling
19927         Enum.ToString () for Operator in Binary. Significant recover of
19928         performance.
19929
19930 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19931
19932         * class.cs (FindMembers): Allow the Builders of the various
19933         members to be null.  If they are skip them.  This only happens
19934         during the PInvoke declaration.
19935
19936 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19937
19938         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19939         failure, so we do not keep going afterwards.
19940
19941         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19942         wanted to pass `false' as the `is_delegate' argument.  If this is
19943         the case, why not use delegate_type == null to mean `is_delegate =
19944         false' and anything else as is_delegate = true.
19945
19946 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19947
19948         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19949         code for the section, not the beginning of the tests.
19950
19951 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19952
19953         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19954
19955         * expression.cs (Binary): same.  Warn about errors where we have
19956         Enum/Enum in operator + as well.
19957
19958 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19959
19960         * statement.cs:
19961                 - added support for switch(bool)
19962                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19963                 - add TableSwitchEmit() to handle table-based switch statements
19964
19965 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19966
19967         * expression.cs (Invocation.OverloadResolve): Factor out code which
19968         does parameter compatibility checking with arguments so that we can 
19969         re-use the code even from Delegate.VerifyApplicability
19970
19971         (VerifyArgumentsCompat): Move above code here.
19972
19973         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19974         and instead make a call to the above method.
19975
19976 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19977
19978         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19979         We use it to keep track of classes which are attribute types.
19980
19981 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19982
19983         * delegate.cs (Delegate.Define): Correctly define the types in the
19984         presence of fixed and array parameters.
19985
19986         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19987         doing FindMembers.
19988
19989         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19990         include NonPublic after the first iteration.
19991
19992         * class.cs (Indexer.CheckBase): Only check if both parents are
19993         non-null. 
19994
19995         * cs-parser.jay (accessor_body): If empty, set to null.
19996
19997         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19998         same code path here to resolve constants names that we did have in
19999         MemberAccess.DoResolve.  There is too much code duplicated here.
20000
20001 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20004
20005         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20006         to MakeUnionSet.
20007
20008         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20009         tokens, numbers and strings.
20010
20011         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20012         parenthesis.
20013
20014         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20015         asyncronous parameters and the regular parameters.  
20016
20017         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20018         specify the target directory.
20019
20020         * expression.cs: (This.DoResolve): Simplify
20021         (As.Emit): Optimize, do not generate IsInst if the expression is
20022         always of the given type.
20023
20024         (Is.DoResolve): Bug fix, we were reporting both always/never for
20025         the is expression.
20026
20027         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20028         creating too many unnecessary arrays.
20029
20030 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20031
20032         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20033         fields instead of rolling our own initializer.   Takes care of all
20034         implicit conversions, and drops unnecessary static checks/argument.
20035
20036 2002-03-31  Dick Porter  <dick@ximian.com>
20037
20038         * driver.cs: use the GetDirectories() return values properly, and
20039         use "/" as path separator.
20040
20041 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20042
20043         * expression.cs (Unary): Optimize - - expr into expr.
20044         (Binary): Optimize a + (-b) into a -b.
20045
20046         * codegen.cs (CodeGen): Made all methods static.
20047
20048 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20049
20050         * rootcontext.cs: 
20051
20052         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20053         TypeBuilder property.
20054
20055         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20056         instead. 
20057
20058         * tree.cs: Removed the various RecordXXXX, and replaced with a
20059         single RecordDecl.  Removed all the accessor methods, and just
20060         left a single access point Type 
20061
20062         * enum.cs: Rename DefineEnum to DefineType.
20063
20064         * decl.cs: New abstract method `DefineType' used to unify the
20065         Defines for Enumerations, Interfaces, TypeContainers and
20066         Delegates.
20067
20068         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20069         LookupBaseClasses method that used to live in class.cs and
20070         interface.cs here, and renamed to FindType.
20071
20072         * delegate.cs: Implement DefineType.  Take advantage of the
20073         refactored pattern for locating the parent builder without taking
20074         the parent_builder argument (which we know does not work if we are
20075         nested, and triggering a toplevel definition).
20076
20077 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20078
20079         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20080         accessibility of a member has changed during override and report
20081         an error if so.
20082
20083         * class.cs (Method.Define, Property.Define): Only complain on
20084         overrides if the method is private, any other accessibility is
20085         fine (and since we just checked the permission is the same, we are
20086         good to go).
20087
20088         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20089         and elif are processed always.  The other pre-processing
20090         directives are only processed if we are "taking" the path
20091
20092 2002-03-29  Martin Baulig  <martin@gnome.org>
20093
20094         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20095         current location is not Null.
20096
20097         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20098         a separate method so we can profile it.
20099
20100         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20101         `span.Seconds' are just seconds, but no minutes or hours.
20102         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20103
20104 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20105
20106         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20107         Remove the gratuitous set of Final:
20108
20109                                 // If an interface implementation, then we can set Final.
20110                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20111                                     implementing.DeclaringType.IsInterface)
20112                                         flags |= MethodAttributes.Final;
20113
20114         I do not know what I was smoking when I used that.
20115
20116
20117         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20118         step into fixing the name resolution issues for delegates and
20119         unifying the toplevel name resolution.
20120
20121 2002-03-28  Martin Baulig  <martin@gnome.org>
20122
20123         * class.cs (Method.Emit): If we have a symbol writer, call its
20124         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20125         tell it about the current method.
20126
20127         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20128         writer that we're going to emit the first byte of IL code for a new
20129         statement (a new source line).
20130         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20131         EmitContext.Mark() before emitting any code.
20132
20133         * location.cs (SymbolDocument): Return null when we're Null.
20134
20135         * statement.cs (Statement): Moved the `Location loc' variable here.
20136         (Statement.EmitBoolExpression): If we have a symbol writer, call
20137         ec.Mark() before emitting any code to tell it that we're at the
20138         beginning of a new statement.
20139         (StatementExpression): Added `Location' argument to the constructor.
20140         (Block): Added public readonly variable `StartLocation' and public
20141         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20142         (Block): Added constructor which takes a start and end location.
20143         (Block.SetEndLocation): New method. This sets the end location.
20144         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20145         local variables we create.
20146         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20147         each statement and do also mark the begin and end of the block.
20148
20149         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20150         tell it the current lexer.Location, use Location.Null for the end of the
20151         block.
20152         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20153         current block, set its end location using SetEndLocation().
20154         (statement_expression): StatementExpression constructor now takes the
20155         lexer.Location as additional argument.
20156         (for_statement, declare_local_variables): Likewise.
20157         (declare_local_variables): When creating a new implicit block, use the
20158         new Block constructor and pass it the lexer.Location.
20159
20160 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20161
20162         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20163         members also on the parent interfaces recursively.
20164
20165 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20166
20167         * report.cs: Use new formats, since Gonzalo finished the missing
20168         bits. 
20169
20170         * expression.cs (Binary.ResolveOperator): added missing operator|
20171         operator& and operator^ for bool/bool.
20172
20173         * cs-parser.jay: CheckDef now takes a Location argument that is
20174         used to report errors more precisly (instead of reporting the end
20175         of a definition, we try to track something which is a lot closer
20176         to the source of the problem).
20177
20178         * cs-tokenizer.cs: Track global token use, so we can properly flag
20179         the use of #define/#undef after the first token has been seen.
20180
20181         Also, rename the reportXXXX to Error_DescriptiveName
20182
20183         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20184         TypeContainer, so that Enum and Interface can use this too.
20185
20186         * class.cs (TypeContainer.LookupInterfaceOrClass,
20187         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20188         `builder' argument.  Typically this was used to pass the parent
20189         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20190         the definition).  
20191
20192         The problem is that a nested class could trigger the definition of
20193         a toplevel class, and the builder would be obviously wrong in that
20194         case. 
20195
20196         So we drop this argument, and we compute dynamically the
20197         TypeBuilder/ModuleBuilder (the correct information was available
20198         to us anyways from DeclSpace.Parent)
20199
20200         * interface.cs (Interface.DefineInterface): Drop builder
20201         parameter cleanup like class.cs
20202
20203         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20204         like class.cs
20205
20206         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20207         values. 
20208
20209         (Try.Emit): Propagate the returns value from the statement.
20210
20211         (Return.Emit): Even if we are leavning 
20212
20213         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20214
20215         * modifiers.cs: Fix the computation of MethodAttributes flags.
20216
20217 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20218
20219         * driver.cs: allow compilation of files that start with '/'.
20220         Add a default case when checking the argument of --target.
20221
20222 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20223
20224         * interface.cs: Implement the same search algorithm for types in
20225         the interface code.
20226
20227         * delegate.cs: Do not allow multiple definition.
20228
20229         * Recovered ChangeLog that got accidentally amputated
20230
20231         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20232
20233         * rootcontext.cs: Load manually enum to allow core classes to
20234         contain enumerations.
20235
20236         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20237         Update to new static methods in TypeManager.
20238
20239         * typemanager.cs (GetMethod, GetConstructor): Use our
20240         implementation of FindMembers to find the members, since during
20241         corlib compilation, the types are TypeBuilders and GetMethod and
20242         GetConstructor do not work.
20243
20244         Make all methods in TypeManager static.
20245
20246         (InitCodeHelpers): Split the functionality from
20247         the InitCodeTypes function.
20248
20249         * driver.cs: Call InitCodeHelpers after we have populated the
20250         types. 
20251
20252         * cs-parser.jay (delegate_declaration): we did not used to compute
20253         the delegate name correctly for void delegates.
20254
20255 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20256
20257         * rootcontext.cs (RootContext): Init the interface_resolve_order
20258         and type_container_resolve_order always.
20259
20260         (ResolveCore, BootstrapCorlib_ResolveClass,
20261         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20262         compiler when compiling with --nostdlib
20263
20264         * class.cs (TypeContainer.DefineType): Check that our parent is
20265         not null.  This test is most important when we are bootstraping
20266         the core types.
20267
20268         * codegen.cs: Split out the symbol writing code.
20269
20270 2002-03-25  Martin Baulig  <martin@gnome.org>
20271
20272         * driver.cs (-g): Made -g an alias for --debug.
20273
20274 2002-03-24  Martin Baulig  <martin@gnome.org>
20275
20276         * codegen.cs (SymbolWriter): New public variable. Returns the
20277         current symbol writer.
20278         (CodeGen): Added `bool want_debugging_support' argument to the
20279          constructor. If true, tell the ModuleBuild that we want debugging
20280         support and ask it for the ISymbolWriter.
20281         (Save): If we have a symbol writer, call it's Close() method after
20282         saving the assembly.
20283
20284         * driver.c (--debug): New command line argument to create a
20285         debugger information file.
20286
20287         * location.cs (SymbolDocument): New public property. Returns an
20288         ISymbolDocumentWriter object for the current source file or null
20289         if we don't have a symbol writer.
20290
20291 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20292
20293         * driver.cs (LoadAssembly): Correctly return when all the paths
20294         have been tried and not before.
20295
20296         * statement.cs (Switch.Emit): return the actual coverage for this
20297         statement (returns/not-returns)
20298
20299         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20300         switch of the statement if we are the last switch section.  That
20301         kills two problems: try/catch problems (we used to emit an empty
20302         nop at the end) and switch statements where all branches would
20303         return. 
20304
20305 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20306
20307         * driver.cs: Add default assemblies (the equivalent to the
20308         Microsoft CSC.RSP file)
20309
20310         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20311         also update tokens_seen and set it to false.
20312
20313         * driver.cs: Implement --recurse for Mike.
20314
20315         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20316         correctly splitting out the paths.
20317
20318 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * interface.cs (Interface.PopulateProperty): Instead of using
20321         `parent' as the declaration space for the set parameters, use
20322         `this' 
20323
20324         * support.cs (InternalParameters): InternalParameters constructor
20325         takes a DeclSpace instead of a TypeContainer.
20326
20327         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20328         types are being initialized, load the address of it before calling
20329         the function.  
20330
20331         (New): Provide a mechanism to disable the generation of local
20332         value type temporaries when the caller will be providing us with
20333         an address to store it.
20334
20335         (ArrayCreation.EmitDynamicInitializers): Use it.
20336
20337 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20338
20339         * expression.cs (Invocation.EmitArguments): Only probe for array
20340         property if there is more than one argument.  Sorry about that.
20341
20342         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20343         empty param arrays.
20344
20345         * class.cs (Method.LabelParameters): Fix incorrect code path that
20346         prevented the `ParamArrayAttribute' from being applied to the
20347         params attribute.
20348
20349 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20350
20351         * support.cs (ReflectionParameters): Correctly compute whether the
20352         last argument is a params array.  Fixes the problem with
20353         string.Split ('a')
20354
20355         * typemanager.cs: Make the assemblies array always be non-null
20356         (empty, but non-null)
20357
20358         * tree.cs (RecordDecl): New function that abstracts the recording
20359         of names.  This reports error 101, and provides a pointer to the
20360         previous declaration.  Fixes a crash in the compiler.
20361
20362         * cs-parser.jay (constructor_declaration): Update to new grammar,
20363         and provide a constructor_body that can be empty.
20364
20365 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20366
20367         * driver.cs: Add support for --resources.
20368
20369         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20370         Make all types for the various array helper methods be integer.
20371
20372         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20373         CheckState to ConvCast.
20374
20375         (ConvCast): Now it takes a `checked' state argument, to avoid
20376         depending on the emit context for the conversion, and just using
20377         the resolve time setting.
20378
20379         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20380         instead of Invocation.EmitArguments.  We do not emit the original
20381         arguments, instead we emit those which have been converted to
20382         unsigned int expressions.
20383
20384         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20385
20386         * codegen.cs: ditto.
20387
20388         * expression.cs (LocalVariableReference): Drop the use of the
20389         Store function that depended on the variable index.
20390
20391         * statement.cs (VariableInfo): Drop the `Idx' property from this
20392         class, as this is not taking into account the indexes for
20393         temporaries tat we generate during the execution, getting the
20394         indexes wrong.
20395
20396         * class.cs: First emit class initializers, then call the parent
20397         constructor. 
20398
20399         * expression.cs (Binary): Fix opcode emision.
20400         (UnaryMutator.EmitCode): Support checked code generation
20401
20402         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20403         matches for events for both the Static and Instance scans,
20404         pointing to the same element.   Fix that.
20405
20406 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20407
20408         * rootcontext.cs (ResolveTree): Always set the
20409         interface_resolve_order, because nested interfaces will be calling
20410         into us.
20411
20412         * class.cs (GetInterfaceOrClass): Track the same resolution
20413         process used by TypeManager.LookupType.  This fixes the nested
20414         type lookups in class declarations (separate path from
20415         LookupType). 
20416
20417         (TypeContainer.DefineType): Also define nested interfaces.
20418         (TypeContainer.RegisterOrder): New public function used to
20419         register the order in which child interfaces need to be closed.
20420
20421         Nested interfaces need to be closed after their parents have been
20422         created. 
20423
20424         * interface.cs (InterfaceAttr): Put all the logic for computing
20425         the interface attribute here. 
20426
20427         (DefineInterface): Register our interface order with the
20428         RootContext or with the TypeContainer depending on the case.
20429
20430 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20431
20432         * cs-parser.jay: rework foreach statement to work with the new
20433         changes to the policy on SimpleNames.
20434
20435         * report.cs: support Stacktrace on warnings as well.
20436
20437         * makefile: drop --unsafe and /unsafe from the compile.
20438
20439 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20440
20441         * ecore.cs (StandardConversionExists): Modify to take an Expression
20442         as the first parameter. Ensure we do null -> reference type conversion
20443         checking.
20444
20445         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20446         temporary Expression objects.
20447
20448 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20449
20450         * interface.cs: workaround bug in method overloading resolution
20451         (there is already a bugzilla bug for it).
20452
20453 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20454
20455         We could also solve this problem by having a separate path for
20456         performing type lookups, instead of DoResolve, we could have a
20457         ResolveType entry point, and only participating pieces of the
20458         production (simplename, deref, array) would implement this. 
20459
20460         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20461         signal SimpleName to only resolve type names and not attempt to
20462         resolve anything else.
20463
20464         * expression.cs (Cast): Set the flag.
20465
20466         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20467
20468         * class.cs: Only report 108 if there is no `new' modifier.
20469
20470         * cs-parser.jay: rework foreach statement to work with the new
20471         changes to the policy on SimpleNames.
20472         
20473         * report.cs: support Stacktrace on warnings as well.
20474
20475         * makefile: drop --unsafe and /unsafe from the compile.
20476
20477 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20478
20479         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20480         lookups here, instead of doing that at parse time.  This means
20481         that our grammar will not introduce `LocalVariableReferences' as
20482         expressions at this point.  That solves the problem of code like
20483         this:
20484
20485         class X {
20486            static void Main ()
20487            { int X = 1;
20488             { X x = null }}}
20489
20490         This is only half the fix.  The full fix requires parameters to
20491         also be handled in this way.
20492
20493         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20494         makes the use more obvious of the DeclSpace.  The
20495         ec.TypeContainer.TypeBuilder is now only used to pull the
20496         TypeBuilder for it.
20497
20498         My theory is that I can get rid of the TypeBuilder completely from
20499         the EmitContext, and have typecasts where it is used (from
20500         DeclSpace to where it matters).  
20501
20502         The only pending problem is that the code that implements Aliases
20503         is on TypeContainer, and probably should go in DeclSpace.
20504
20505         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20506         lookups here, instead of doing that at parse time.  This means
20507         that our grammar will not introduce `LocalVariableReferences' as
20508         expressions at this point.  That solves the problem of code like
20509         this:
20510
20511         class X {
20512            static void Main ()
20513            { int X = 1;
20514             { X x = null }}}
20515
20516         This is only half the fix.  The full fix requires parameters to
20517         also be handled in this way.
20518
20519         * class.cs (Property.DefineMethod): When implementing an interface
20520         method, set newslot, when implementing an abstract method, do not
20521         set the flag (before we tried never setting it, or always setting
20522         it, which is the difference).
20523         (Indexer.DefineMethod): same.
20524         (Method.DefineMethod): same.
20525
20526         * ecore.cs: Only set the status used flag if we get back a Field.
20527
20528         * attribute.cs: Temporary hack, so Paolo can keep working.
20529
20530 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20531
20532         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20533         the unmanaged type in the case we have a MarshalAs attribute.
20534
20535         (Resolve): Handle the case when we are parsing the special MarshalAs
20536         attribute [we need to store the unmanaged type to use later]
20537
20538         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20539         MarshalAs Attribute.
20540
20541         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20542         on parameters and accordingly set the marshalling info.
20543
20544 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20545
20546         * class.cs: Optimizing slightly by removing redundant code after
20547         we switched to the `NoTypes' return value.
20548         (Property.DefineMethod): use NoTypes here too.
20549
20550         This fixes the bug I introduced in my last batch of changes.
20551
20552 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20553
20554         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20555
20556         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20557         Enums since those are types too. 
20558
20559         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20560
20561         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20562         thanks to a call during the lookup process.
20563
20564 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20565
20566         * statement.cs (Foreach): Lots of work to accomodate a particular
20567         kind of foreach statement that I had not kept in mind.  It is
20568         possible to have foreachs on classes that provide a GetEnumerator
20569         method that return objects that implement the "pattern" for using
20570         a foreach, there is no need to support GetEnumerator
20571         specifically. 
20572
20573         This is needed to compile nant.
20574
20575         * decl.cs: Only report 114 if the member is not `Finalize' and if
20576         the warning level is at least 2.
20577
20578         * class.cs: Moved the compare function from Method to
20579         MethodSignature. 
20580
20581         (MethodSignature.InheritableMemberSignatureCompare): Add new
20582         filter function that is used to extract inheritable methods from a
20583         class. 
20584
20585         (Method.Define): Use the new `inheritable_method_signature_filter'
20586         delegate
20587
20588         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20589         command. 
20590
20591 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20592
20593         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20594
20595         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20596
20597         * expression.cs: Pass location information to
20598         ConvertImplicitStandard. 
20599
20600         * class.cs: Added debugging code to track return values from
20601         interfaces. 
20602
20603 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * expression.cs (Is.DoResolve): If either side of the `is' is an
20606         interface, do not flag the warning.
20607
20608         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20609         for interfaces
20610
20611         * report.cs: Allow for --fatal to be used with --probe.
20612
20613         * typemanager.cs (NoTypes): Move the definition for the empty Type
20614         array here. 
20615
20616         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20617         properties. 
20618         (TypeContainer.DefineProxy): New function used to proxy to parent
20619         implementations when implementing interfaces.
20620         (TypeContainer.ParentImplements): used to lookup if our parent
20621         implements a public function that is required by an interface.
20622         (TypeContainer.VerifyPendingMethods): Hook this up.
20623
20624         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20625         `modules' and `assemblies' arraylists into arrays.  We only grow
20626         these are the very early start up of the program, so this improves
20627         the speedof LookupType (nicely measured).
20628
20629         * expression.cs (MakeByteBlob): Replaced unsafe code with
20630         BitConverter, as suggested by Paolo.
20631
20632         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20633         folding of string concatenation, but if either side is a string,
20634         and the other is not, then return null, and let the runtime use
20635         the concatenation on the string plus the object (using
20636         `Object.ToString'). 
20637
20638 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20639
20640         Constant Folding has been implemented now.
20641
20642         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20643         the error instead on types that are not supported in one's
20644         complement. 
20645
20646         * constant.cs (Constant and all children): New set of functions to
20647         perform implict and explicit conversions.
20648
20649         * ecore.cs (EnumConstant): Implement the new functions to perform
20650         conversion by proxying to the child expression.
20651
20652         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20653         own separate setting that can not be turned off from the command
20654         line using --unchecked or --checked and is only controlled using
20655         the checked/unchecked statements and expressions.  This setting is
20656         used by the constant folder to flag errors.
20657
20658         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20659         ConstantCheckState as well.   
20660
20661         During Resolve, they also have to flag the state, because the
20662         constant folder runs completely in the Resolve phase.
20663
20664         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20665         well.
20666
20667 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20668
20669         * cfold.cs: New file, this file contains the constant folder.
20670
20671         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20672         argument to track whether we are using the resulting address to
20673         load or store a value and provide better error messages. 
20674
20675         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20676         new AddressOf arguments.
20677
20678         * statement.cs (Foreach.EmitCollectionForeach): Update
20679
20680         * expression.cs (Argument.Emit): Call AddressOf with proper
20681         arguments to track usage.
20682
20683         (New.DoEmit): Call AddressOf with new arguments.
20684
20685         (Unary.Emit): Adjust AddressOf call.
20686
20687 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20688
20689         * cs-parser.jay (member_access): Change the case for pre-defined types
20690         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20691         this suggestion.
20692
20693         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20694         a method body.
20695
20696         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20697         essentially like methods and apply attributes like MethodImplOptions to them too.
20698
20699         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20700         not being null.
20701
20702         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20703         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20704         is the DeclSpace.
20705
20706         * Update code everywhere accordingly.
20707
20708         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20709
20710         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20711
20712 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20713
20714         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20715         try performing lookups against those instead of jumping straight into using
20716         the 'using' clauses.
20717
20718         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20719
20720         (LookupType): Perform lookups in implicit parents too.
20721
20722         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20723         sequence as RootContext.LookupType. 
20724
20725         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20726         the various cases of namespace lookups into this method.
20727
20728 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20729
20730         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20731         in positional arguments)
20732
20733         * class.cs (Operator): Update the AllowedModifiers to contain
20734         extern. 
20735
20736         * cs-parser.jay: Update operator declaration to allow for the
20737         operator body to be empty.
20738
20739         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20740         values. 
20741
20742 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20743
20744         * class.cs (Method.Emit): Label parameters.
20745
20746         * driver.cs: Return 1 or 0 as the program exit code.
20747
20748 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20749
20750         * expression.cs: Special case the `null' object when trying to
20751         auto-compute the type, as anything can be explicitly converted to
20752         that. 
20753
20754         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20755         spotting this Paolo.
20756
20757         (Expression.ImplicitNumericConversion): Perform comparissions of
20758         the type using the underlying type in the case of an enumeration
20759         rather than using the enumeration type for the compare.
20760
20761         Cope with the underlying == type case, which is not possible to
20762         catch before. 
20763
20764         (Expression.ConvertNumericExplicit): Perform comparissions of
20765         the type using the underlying type in the case of an enumeration
20766         rather than using the enumeration type for the compare.
20767
20768         * driver.cs: If the user does not supply an extension, assume .exe
20769
20770         * cs-parser.jay (if_statement): Rewrote so that we can track the
20771         location for the if statement.
20772
20773         * expression.cs (Binary.ConstantFold): Only concat strings when
20774         the operation is "+", not everything ;-)
20775
20776         * statement.cs (Statement.EmitBoolExpression): Take a location
20777         argument. 
20778         (If, While, Do): Track location.
20779
20780         * expression.cs (Binary.ResolveOperator): In the object + string
20781         case, I was missing a call to ConvertImplicit
20782
20783 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20784
20785         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20786         Location arguments. Ensure we use RootContext.LookupType to do our work
20787         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20788
20789         * interface.cs (PopulateMethod): Handle the type of the parameter being
20790         null gracefully.
20791
20792         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20793         have a params method with no fixed arguments and a call is made with no
20794         arguments.
20795
20796 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20797
20798         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20799         the verbatim-string-literal
20800
20801         * support.cs (InternalParameters.ParameterModifier): handle null
20802         fixed parameters.
20803         (InternalParameters.ParameterType): ditto.
20804
20805         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20806         duplicating the name of the variable parameter.
20807         (GetParameterByName): Fix bug where we were not looking up array
20808         paramters if they were the only present (thanks Paolo!).
20809         (GetParameterInfo): We only have an empty set of types if both
20810         fixed and array are set to null.
20811         (GetParameterInfo-idx): Handle FixedParameter == null
20812
20813         * cs-parser.jay: Handle the case where there is no catch
20814         statements (missing null test).
20815
20816 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20817
20818         * driver.cs (MainDriver): Be conservative on our command line
20819         handling.
20820
20821         Catch DirectoryNotFoundException when calling GetFiles.
20822
20823         (SplitPathAndPattern): Used to split the input specification into
20824         a path and a pattern that we can feed to Directory.GetFiles.
20825
20826 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20827
20828         * statement.cs (Fixed): Implement the last case of the Fixed
20829         statement (string handling).
20830
20831         * expression.cs (StringPtr): New class used to return a char * to
20832         a string;  Used by the Fixed statement.
20833
20834         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20835
20836         * expression.cs (Binary.ResolveOperator): Remove redundant
20837         MemberLookup pn parent type.
20838         Optimize union call, we do not need a union if the types are the same.
20839         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20840         type.
20841
20842         Specialize the use of MemberLookup everywhere, instead of using
20843         the default settings. 
20844
20845         (StackAlloc): Implement stackalloc keyword.
20846
20847         * cs-parser.jay: Add rule to parse stackalloc.
20848
20849         * driver.cs: Handle /h, /help, /?
20850
20851         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20852         before we supported unsafe code.
20853
20854         * makefile: add --unsafe to the self compilation of mcs.
20855
20856 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20857
20858         * expression.cs (PointerArithmetic): New class that is used to
20859         perform pointer arithmetic.
20860         (Binary.Resolve): Handle pointer arithmetic
20861         Handle pointer comparission.
20862         (ArrayPtr): Utility expression class that is used to take the
20863         address of an array.
20864
20865         (ElementAccess): Implement array access for pointers
20866
20867         * statement.cs (Fixed): Implement fixed statement for arrays, we
20868         are missing one more case before we are done.
20869
20870         * expression.cs (Indirection): Implement EmitAssign and set the
20871         ExprClass to Variable.  This allows pointer dereferences to be
20872         treated as variables, and to have values assigned to them.
20873
20874         * ecore.cs (Expression.StoreFromPtr): New utility function to
20875         store values dereferencing.
20876
20877 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20878
20879         * expression.cs (Binary.ResolveOperator): Ensure that we are
20880         not trying to operate on a void type - this fixes the reported
20881         bug.
20882
20883         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20884         the parent implementation is sealed.
20885
20886         * ../errors/cs0239.cs : Add.
20887
20888         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20889
20890         * typemanager.cs (unverifiable_code_type): Corresponds to 
20891         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20892         which have unsafe code in them.
20893
20894         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20895         unsafe context.
20896
20897 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20898
20899         * cs-tokenizer.cs: Add support for @"litreal strings"
20900
20901         Make tokenizer accept pre-processor directives
20902         on any column (remove the old C-like limitation). 
20903
20904         * rootcontext.cs (EmitCode): Emit any global attributes.
20905         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20906
20907         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20908
20909         * cs-parser.jay: Add support for global attributes.  
20910
20911 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20912
20913         * expression.cs (Indirection): New helper class.  Unary will
20914         create Indirection classes to be able to implement the
20915         IMemoryLocation interface on it.
20916
20917 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20918
20919         * cs-parser.jay (fixed_statement): reference the right statement.
20920
20921         * statement.cs (Fixed.Emit): Finish implementing the fixed
20922         statement for the &x case.
20923
20924 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20925
20926         * class.cs (Property.Define, Method.Define): Remove newslot when
20927         `implementing'.  
20928
20929         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20930         wrong.  NewSlot should only be used if the `new' keyword is present.
20931
20932         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20933         locating our system dir.  Sorry about this.
20934
20935 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20936
20937         * driver.cs (GetSystemDir): Compute correctly the location of our
20938         system assemblies.  I was using the compiler directory instead of
20939         the library directory.
20940
20941 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20942
20943         * expression.cs (BetterFunction): Put back in what Miguel commented out
20944         since it is the correct fix. The problem is elsewhere ;-)
20945
20946         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20947         parameters of the parms method are themselves compatible or not !
20948
20949         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20950         to check that a class implements an interface before saying that an implicit
20951         conversion was allowed. Use ImplementsInterface to do the checking.
20952
20953 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20954
20955         * class.cs (Method.Define): Track whether we are an explicit
20956         implementation or not.  And only call DefineMethodOverride if we
20957         are an explicit implementation.
20958
20959         (Property.DefineMethod): Ditto.
20960
20961 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20962
20963         * expression.cs (BetterFunction): Catch hideous bug which was
20964          preventing us from detecting ambiguous calls due to implicit casts i.e
20965         cs0121.
20966
20967 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20968
20969         * support.cs (Pair): Remove un-needed method.  I figured why I was
20970         getting the error in cs-parser.jay, the variable in a foreach loop
20971         is readonly, and the compiler does not really treat this as a variable.
20972
20973         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20974         instead of EQUALS in grammar.  
20975
20976         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20977
20978         * expression.cs (Unary.DoResolve): Check whether the argument is
20979         managed or not.
20980
20981 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20982
20983         * support.cs: Api for Pair to set a value.  Despite the fact that
20984         the variables are public the MS C# compiler refuses to compile
20985         code that accesses the field if the variable is part of a foreach
20986         statement. 
20987
20988         * statement.cs (Fixed): Begin implementation of the fixed
20989         statement.
20990
20991         (Block.AddVariable): Return the VariableInfo on success and null
20992         on failure instead of true/false. 
20993
20994         * cs-parser.jay (foreach): Catch errors on variables already
20995         defined (we were ignoring this value before) and properly unwind
20996         the block hierarchy
20997
20998         (fixed_statement): grammar for the fixed statement.
20999
21000 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21001
21002         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21003         pointer types to be incretemented.
21004
21005         (SizeOf): Implement.
21006
21007         * cs-parser.jay (pointer_member_access): Implement
21008         expr->IDENTIFIER production.
21009
21010         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21011         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21012         on safe contexts.
21013
21014         (Unary): Implement indirection.
21015
21016         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21017         use in non-unsafe context).
21018
21019         (SimpleName.DoResolve): Check for pointers in field access on safe
21020         contexts. 
21021
21022         (Expression.LoadFromPtr): Factor the load-indirect code in this
21023         function.  This was duplicated in UnboxCast and ParameterReference
21024
21025 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21026
21027         * expression.cs (ComposedCast): report an error if a pointer cast
21028         is used in a safe region.
21029
21030         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21031         pointer type casts in unsafe context.
21032
21033         * codegen.cs (EmitContext): Set up IsUnsafe.
21034
21035         * cs-parser.jay (non_expression_type): Add productions for pointer
21036         casts. 
21037
21038         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21039         code.  We should not use force into static mode if the method is
21040         not virtual.  Fixes bug in MIS
21041
21042         * statement.cs (Do.Emit, While.Emit, For.Emit,
21043         Statement.EmitBoolExpression): Add support to Do and While to
21044         propagate infinite loop as `I do return' semantics.
21045
21046         Improve the For case to also test for boolean constants.
21047
21048         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21049         to the list of attributes we can add.
21050
21051         Remove `EmitContext' argument.
21052
21053         * class.cs (Method.Define): Apply parameter attributes.
21054         (Constructor.Define): Apply parameter attributes.
21055         (MethodCore.LabelParameters): Move here the core of labeling
21056         parameters. 
21057
21058         * support.cs (ReflectionParameters.ParameterModifier,
21059         InternalParameters.ParameterModifier): Use IsByRef on the type and
21060         only return the OUT bit for these parameters instead of in/out/ref
21061         flags.
21062
21063         This is because I miss-understood things.  The ParameterInfo.IsIn
21064         and IsOut represent whether the parameter has the [In] and [Out]
21065         attributes set.  
21066
21067 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21068
21069         * ecore.cs (FieldExpr.Emit): Release temporaries.
21070
21071         * assign.cs (LocalTemporary.Release): new function.
21072
21073         * codegen.cs (EmitContext.GetTemporaryStorage,
21074         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21075         temporary storage.  Now we can "put back" localbuilders when we
21076         are done with them
21077
21078 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21079
21080         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21081         need to make a copy of the variable to generate verifiable code.
21082
21083 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21084
21085         * driver.cs: Compute dynamically the system directory.
21086
21087         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21088         Slower, but more generally useful.  Used by the abstract
21089         registering implementation. 
21090
21091         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21092         the rules for the special rule on Type/instances.  First check if
21093         we have the same name, and if so, try that special static path
21094         rather than the instance path.
21095
21096 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21097
21098         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21099         for, while and if.
21100
21101         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21102         Enum, ValueType, Delegate or Array for non-corlib compiles.
21103
21104         * cs-tokenizer.cs: Catch long identifiers (645)
21105
21106         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21107         piece of code.
21108
21109         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21110         fix, we were returning too early, so we were not registering
21111         pending methods from abstract classes.
21112
21113         Do not register pending methods if the class is abstract.
21114
21115         * expression.cs (Conditional.DoResolve): Report circular implicit
21116         conversions when we neecd to compute it for conditional
21117         expressions. 
21118
21119         (Is.DoResolve): If the expression is always of the provided type,
21120         flag warning 183.  If the expression can not ever be of the
21121         provided type flag warning 184.
21122
21123         * class.cs: Catch 169 as well.
21124
21125         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21126         read. 
21127
21128 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21129
21130         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21131
21132 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21133
21134         * interface.cs: (PopulateMethod): Check for pointers being defined
21135         only if the unsafe context is active.
21136         (PopulateProperty): ditto.
21137         (PopulateIndexer): ditto.
21138
21139         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21140         specified.  If pointers are present, make sure that they are
21141         present in an unsafe context.
21142         (Constructor, Constructor.Define): ditto.
21143         (Field, Field.Define): ditto.
21144         (Property, Property.Define): ditto.
21145         (Event, Event.Define): ditto.
21146
21147         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21148         hashtable if there are classes or structs defined.
21149
21150         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21151         code, as the constant resolution moved.
21152
21153         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21154         the metadata, so we can flag error 133. 
21155
21156         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21157         pointer is being declared in an unsafe context.
21158
21159 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21160
21161         * modifiers.cs (Modifiers.Check): Require a Location argument.
21162         Report error 227 for Unsafe use.
21163
21164         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21165
21166         * statement.cs (For.Emit): If the test is null, then report that
21167         we do `return', as we wont reach anything afterwards.
21168
21169         (Switch.SwitchGoverningType): Track the expression that matched
21170         the conversion.
21171
21172         * driver.cs: Allow negative numbers as an error code to flag.
21173
21174         * cs-parser.jay: Handle 1551.
21175
21176         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21177
21178 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21179
21180         * cs-parser.jay: Report 1518 (type declaration can only contain
21181         class, struct, interface, enum or delegate)
21182
21183         (switch_label): Report 1523 (keywords `case' or `default' must
21184         preced code)
21185
21186         (opt_switch_sections): Report 1522 (empty switch)
21187
21188         * driver.cs: Report 1515 (response file specified multiple times)
21189         Report 1516 (Source file specified multiple times).
21190
21191         * expression.cs (Argument.Resolve): Signal 1510
21192
21193         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21194         access not allowed in static code)
21195
21196 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21197
21198         * typemanager.cs (IsPointerType): Utility method which we are going
21199         to need a lot.
21200
21201         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21202         the object type, so we take care of that.
21203
21204         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21205
21206         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21207         added to non-params parameters :-)
21208
21209         * typemanager.cs (CSharpName): Include 'void' type too. 
21210
21211         (void_ptr_type): Include in the set of core types.
21212
21213         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21214         duplicating code.
21215
21216         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21217         an unsafe context.
21218
21219         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21220         completely forgotten about it.
21221
21222 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21223
21224         * cs-parser.jay (pointer_type): Add. This begins our implementation
21225         of parsing rules for unsafe code.
21226
21227         (unsafe_statement): Implement.
21228
21229         (embedded_statement): Modify to include the above.
21230
21231         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21232
21233         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21234         if the current context is an unsafe one.
21235
21236         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21237         are handled differently, we need separate rules for them.
21238
21239         (local_variable_declaration): Update to use local_variable_pointer_type
21240         to allow variable declarations of unmanaged pointer types.
21241
21242         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21243         in unsafe contexts.
21244
21245         * ../errors/cs0214.cs : Add.
21246
21247 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21248
21249         * makefile: remove 'response' file when cleaning.
21250
21251 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21252
21253         * cs-parser.jay: Report 1524.
21254
21255 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21256
21257         * typemanager.cs (RegisterMethod): drop checking if we have
21258         registered this from here
21259
21260 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21261
21262         * class.cs (Method.EmitDestructor): Implement calling our base
21263         destructor. 
21264
21265         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21266         value of InFinally.
21267
21268         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21269         this routine and will wrap the call in a try/catch block.  Deal
21270         with the case.
21271
21272 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21273
21274         * ecore.cs (Expression.MemberLookup): instead of taking a
21275         parameter `same_type' that was used to tell whether we could
21276         access private members we compute our containing type from the
21277         EmitContext.
21278
21279         (FieldExpr): Added partial support for volatile fields.  This does
21280         not work for volatile fields exposed from assemblies, as I can not
21281         figure out how to extract the modreq from it.
21282
21283         Updated all the source files to use this.
21284
21285         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21286         because it is referenced by MemberLookup very often. 
21287
21288 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21289
21290         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21291         TypeBuilder.GetCustomAttributes to retrieve what we need.
21292
21293         Get rid of redundant default_member_attr_type as this is the same as
21294         default_member_type which already exists.
21295
21296         * interface.cs, attribute.cs : Update accordingly.
21297
21298 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21299
21300         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21301         work for TYpeBuilders though.  Ravi, can you please fix this?
21302
21303         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21304
21305         * expression.cs (Argument.Emit): Handle the case of ref objects
21306         being passed to ref functions;  
21307
21308         (ParameterReference.EmitLoad): Loads the content of the pointer
21309         without dereferencing.
21310
21311 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21312
21313         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21314
21315 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21316
21317         * class.cs (Indexer.DefineMethod): Incorporate the interface
21318         type in the name of the method if we are doing explicit interface
21319         implementation.
21320
21321         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21322
21323         (BetterConversion): Fix extremely trivial bug where we were referring to
21324         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21325         again !
21326
21327         * ../errors/bug16.cs : Add although we have fixed it.
21328
21329 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21330
21331         * expression.cs (BaseIndexer): Begin implementation.
21332
21333         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21334
21335         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21336         production directly to remove a shift/reduce, and implement
21337         explicit interface implementation.
21338
21339         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21340         after a floating point suffix.
21341
21342         * expression.cs (DoNumericPromotions): Improved the conversion for
21343         uint/uint.  If we have a constant, we avoid doing a typecast to a
21344         larger type.
21345
21346         * class.cs (Indexer): Implement explicit interface implementation
21347         for indexers.
21348
21349 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21350
21351         * class.cs: make the default instance constructor public and hidebysig.
21352
21353 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21354
21355         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21356         so we can call it from elsewhere.
21357
21358         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21359         we emit it internally if the class has a defined indexer; otherwise the user
21360         emits it by decorating the class definition with the DefaultMemberAttribute.
21361
21362         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21363         attribute is not used on a type which defines an indexer.
21364
21365         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21366         character when we skip whitespace.
21367
21368         * ../errors/cs0646.cs : Add.
21369
21370 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21371
21372         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21373         again. 
21374
21375         * makefile: Add practical target `mcs3.exe' which builds the third
21376         generation compiler. 
21377
21378         * expression.cs (New): Fix structures constructor calling.
21379
21380         * class.cs (Property, Method, Indexer): Emit Final flag on the
21381         method if we are an interface implementation and we are not
21382         abstract. 
21383
21384         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21385         whether this property is referencing a `base' method.
21386
21387         * expression.cs (Invocation.EmitCall): take an extra argument:
21388         is_base, this is used to determine whether the `call' or
21389         `callvirt' opcode should be used.
21390
21391
21392         * delegate.cs: update EmitCall.
21393
21394         * class.cs (Method.Define): Set NewSlot for the cases where we are
21395         not implementing an interface method.
21396
21397         (Property.Define): ditto.
21398
21399 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21400
21401         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21402         'r'.  Allows mcs to parse itself fully.
21403
21404 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21405
21406         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21407         of the number of initializers that require the InitializeArray method.
21408
21409         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21410         update the above field where necessary.
21411
21412         (MakeByteBlob): Update accordingly.
21413
21414         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21415         greater than 2.
21416
21417         (EmitDynamicInitializers): Update in accordance with the new optimization.
21418
21419         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21420         same OpCode applies.
21421
21422         * cs-parser.jay : Fix some glaring errors I introduced.
21423
21424 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21425
21426         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21427         so that we can check for name clashes there too.
21428
21429         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21430         for interface indexers.
21431
21432         * interfaces.cs (Define): Emit the default member attribute.
21433
21434         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21435         variable was being referred to while setting the value ;-)
21436
21437 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21438
21439         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21440         byte-by-byte information when we know the data is zero.
21441
21442         Make the block always a multiple of 4, because
21443         DefineInitializedData has a bug.
21444
21445         * assign.cs: Fix, we should assign from the temporary, not from
21446         the source. 
21447
21448         * expression.cs (MakeByteBlob): Fix my incorrect code.
21449
21450 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21451
21452         * typemanager.cs (EnumToUnderlying): This function is used to get
21453         the underlying type from an enumeration, because it does not
21454         always work. 
21455
21456         * constant.cs: Use the I4_S form for values between -128 and 127.
21457
21458         * statement.cs (Block.LookupLabel): Looks up a label.
21459         (Block): Drop support for labeled blocks.
21460
21461         (LabeledStatement): New kind of statement that represents a label
21462         only.
21463
21464         (Goto): Finally implement this bad boy.
21465
21466         * cs-parser.jay: Update to reflect new mechanism to implement
21467         labels.
21468
21469 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21470
21471         * codegen.cs (EmitContext.This): a codegen property that keeps the
21472         a single instance of this instead of creating many different this
21473         instances. 
21474
21475         * delegate.cs (Delegate.DoResolve): Update to use the property;
21476
21477         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21478
21479         * expression.cs (BaseAccess.DoResolve): Ditto.
21480
21481 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21482
21483         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21484         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21485
21486         (InitCoreTypes): Update accordingly.
21487
21488         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21489         so we can quickly store the state.
21490
21491         (ApplyAttributes): Set the correct implementation flags
21492         for InternalCall methods.
21493
21494 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21495
21496         * expression.cs (EmitCall): if a method is not virtual, then do
21497         not use callvirt on it.
21498
21499         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21500         user defined stuff) requires the use of stobj, which takes an
21501         address on the stack instead of an array and an index.  So emit
21502         the Ldelema operation for it.
21503
21504         (EmitStoreOpcode): Use stobj for valuetypes.
21505
21506         (UnaryMutator.EmitCode): Use the right 1 value depending on
21507         whether we are dealing with int64/uint64, float or doubles.
21508
21509         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21510         constructors that I implemented last night.
21511
21512         (Constructor.IsDefault): Fix to work properly for static
21513         constructors.
21514
21515         * cs-parser.jay (CheckDef): report method signature errors.
21516         Update error number 103 to be 132.
21517
21518         * decl.cs: New AdditionResult enumeration value: MethodExists.
21519         Although we do this check for methods later on in the semantic
21520         analysis, catching repeated default constructors is so easy that
21521         we catch these here. 
21522
21523         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21524         promotions code.
21525
21526         (ParameterReference.EmitAssign, Emit): handle
21527         bools as bytes.
21528
21529         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21530         (ArrayAccess.EmitStoreOpcode): ditto.
21531
21532         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21533
21534         * expression.cs (MakeByteBlob): Complete all the missing types
21535         (uint, short, ushort, byte, sbyte)
21536
21537         * class.cs: Only init instance field initializers on instance
21538         constructors. 
21539
21540         Rename `constructors' to instance_constructors. 
21541
21542         (TypeContainer.AddConstructor): Only add constructors to the list
21543         if it is not static.
21544
21545         Make sure that we handle default_static_constructor independently
21546         everywhere where we handle instance_constructors
21547
21548 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21549
21550         * class.cs: Do not lookup or create a base initializer for a
21551         static constructor.
21552
21553         (ConstructorInitializer.Resolve): use the proper type to lookup
21554         for constructors.
21555
21556         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21557
21558         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21559         in DeclSpace. 
21560
21561         * decl.cs: CloseType is now an virtual method, the default
21562         implementation just closes this type.
21563
21564 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21565
21566         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21567         to PreserveSig by default. Also emit HideBySig on such methods.
21568
21569         Basically, set the defaults to standard values.
21570
21571         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21572         argument, if candidate is better, it can't be worse than the best !
21573
21574         (Invocation): Re-write bits to differentiate between methods being
21575         applicable in their expanded form and their normal form - for params
21576         methods of course.
21577
21578         Get rid of use_standard everywhere as only standard conversions are allowed
21579         in overload resolution. 
21580
21581         More spec conformance.
21582
21583 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21584
21585         * driver.cs: Add --timestamp, to see where the compiler spends
21586         most of its time.
21587
21588         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21589         `this' in static code.
21590
21591         (SimpleName.DoResolve): Implement in terms of a helper function
21592         that allows static-references to be passed upstream to
21593         MemberAccess.
21594
21595         (Expression.ResolveWithSimpleName): Resolve specially simple
21596         names when called by MemberAccess to implement the special
21597         semantics. 
21598
21599         (Expression.ImplicitReferenceConversion): Handle conversions from
21600         Null to reference types before others, as Null's type is
21601         System.Object. 
21602
21603         * expression.cs (Invocation.EmitCall): Handle the special case of
21604         calling methods declared on a reference type from a ValueType
21605         (Base classes System.Object and System.Enum)
21606
21607         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21608         the left hand side is a TypeExpr, not on every enumeration. 
21609
21610         (Binary.Resolve): If types are reference types, then do a cast to
21611         object on operators != and == of both arguments.
21612
21613         * typemanager.cs (FindMembers): Extract instance and static
21614         members if requested.
21615
21616         * interface.cs (PopulateProperty): Use void_type instead of null
21617         as the return type for the setter method.
21618
21619         (PopulateIndexer): ditto.
21620
21621 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21622
21623         * support.cs (ReflectionParameters): Fix minor bug where we
21624         were examining the wrong parameter for the ParamArray attribute.
21625
21626         Cope with requests for the type of the parameter at position
21627         greater than the params parameter's. We now return the element
21628         type of the params array as that makes more sense.
21629
21630         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21631         accordingly as we no longer have to extract the element type
21632         ourselves.
21633
21634         (Invocation.OverloadResolve): Update.
21635
21636 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21637
21638         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21639         against IEnumerator, test whether the return value is a descendant
21640         of the IEnumerator interface.
21641
21642         * class.cs (Indexer.Define): Use an auxiliary method to implement
21643         the other bits of the method definition.  Begin support for
21644         explicit interface implementation.
21645
21646         (Property.DefineMethod): Use TypeManager.void_type instead of null
21647         for an empty return value.
21648
21649 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21650
21651         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21652         dealing with a FieldExpr which is composed of a FieldBuilder, in
21653         the code path we did extract the constant, but we should have
21654         obtained the underlying value to be able to cast it (otherwise we
21655         end up in an infinite loop, this is what Ravi was running into).
21656
21657         (ArrayCreation.UpdateIndices): Arrays might be empty.
21658
21659         (MemberAccess.ResolveMemberAccess): Add support for section
21660         14.5.4.1 that deals with the special case of E.I when E is a type
21661         and something else, that I can be a reference to a static member.
21662
21663         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21664         handle a particular array type to create byte blobs, it is just
21665         something we dont generate byteblobs for.
21666
21667         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21668         arguments. 
21669
21670         * location.cs (Push): remove the key from the hashtable that we
21671         are about to add.   This happens for empty files.
21672
21673         * driver.cs: Dispose files after we have parsed them.
21674
21675         (tokenize): new function that only runs the tokenizer on its
21676         input, for speed testing.
21677
21678 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21679
21680         * class.cs (Event.Define): Define the private field only if there
21681         are no accessors defined.
21682
21683         * expression.cs (ResolveMemberAccess): If there is no associated
21684         field with the event, that means we have an event defined with its
21685         own accessors and we should flag error cs0070 since transforming
21686         ourselves into a field is not valid in that case.
21687
21688         * ecore.cs (SimpleName.DoResolve): Same as above.
21689
21690         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21691         and charset to sane values.
21692
21693 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21694
21695         * assign.cs (DoResolve): Perform check on events only if they 
21696         are being accessed outside the declaring type.
21697
21698         * cs-parser.jay (event_declarations): Update rules to correctly
21699         set the type of the implicit parameter etc.
21700
21701         (add_accessor, remove_accessor): Set current local parameters.
21702
21703         * expression.cs (Binary): For delegate addition and subtraction,
21704         cast the return value from the method into the appropriate delegate
21705         type.
21706
21707 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21708
21709         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21710         of these as the workaround is unnecessary.
21711
21712         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21713         delegate data - none of that is needed at all.
21714
21715         Re-write bits to extract the instance expression and the delegate method
21716         correctly.
21717
21718         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21719         on delegates too.
21720
21721         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21722         of attaching attributes instead of duplicating code everywhere.
21723
21724         * everywhere : Update code to do attribute emission using the above method.
21725
21726 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21727
21728         * expression.cs (IsParamsMethodApplicable): if there are not
21729         parameters, return immediately.
21730
21731         * ecore.cs: The 0 literal can be implicity converted to an enum
21732         type. 
21733
21734         (SimpleName.DoResolve): First lookup the type, then lookup the
21735         members. 
21736
21737         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21738         want to get its address.  If the InstanceExpression is not
21739         addressable, store the result in a temporary variable, then get
21740         the address of it.
21741
21742         * codegen.cs: Only display 219 errors on warning level or above. 
21743
21744         * expression.cs (ArrayAccess): Make it implement the
21745         IMemoryLocation interface.
21746
21747         (Binary.DoResolve): handle the operator == (object a, object b)
21748         and operator != (object a, object b) without incurring into a
21749         BoxedCast (because 5 != o should never be performed).
21750
21751         Handle binary enumerator operators.
21752
21753         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21754         value type, otherwise use Ldelem_ref.
21755
21756         Use precomputed names;
21757
21758         (AddressOf): Implement address of
21759
21760         * cs-parser.jay (labeled_statement): Fix recursive block
21761         addition by reworking the production.
21762
21763         * expression.cs (New.DoEmit): New has a special case:
21764                 
21765                  If we are dealing with a ValueType, we have a few
21766                  situations to deal with:
21767                 
21768                     * The target of New is a ValueType variable, that is
21769                       easy, we just pass this as the variable reference
21770                 
21771                     * The target of New is being passed as an argument,
21772                       to a boxing operation or a function that takes a
21773                       ValueType.
21774                 
21775                       In this case, we need to create a temporary variable
21776                       that is the argument of New.
21777
21778
21779 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21780
21781         * rootcontext.cs (LookupType): Check that current_type is not null before
21782         going about looking at nested types.
21783
21784         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21785         not implement the IAssignMethod interface any more.
21786
21787         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21788         where we tranform them into FieldExprs if they are being resolved from within
21789         the declaring type.
21790
21791         * ecore.cs (SimpleName.DoResolve): Do the same here.
21792
21793         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21794
21795         * ../errors/bug10.cs : Add.
21796
21797         * ../errors/cs0070.cs : Add.
21798
21799         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21800
21801         * assign.cs : Get rid of EventIsLocal everywhere.
21802
21803 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21804
21805         * ecore.cs (ConvertIntLiteral): finished the implementation.
21806
21807         * statement.cs (SwitchLabel): Convert the value we are using as a
21808         key before looking up the table.
21809
21810 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21811
21812         * codegen.cs (EmitTopBlock): Require a Location argument now.
21813
21814         * cs-parser.jay (constructor_declarator): We need to setup
21815         current_local_parameters before we parse the
21816         opt_constructor_initializer, to allow the variables to be bound
21817         to the constructor arguments.
21818
21819         * rootcontext.cs (LookupType): First lookup nested classes in our
21820         class and our parents before we go looking outside our class.
21821
21822         * expression.cs (ConstantFold): Extract/debox the values at the
21823         beginnning. 
21824
21825         * rootcontext.cs (EmitCode): Resolve the constants first before we
21826         resolve the types.  This is not really needed, but it helps debugging.
21827
21828         * statement.cs: report location.
21829
21830         * cs-parser.jay: pass location to throw statement.
21831
21832         * driver.cs: Small bug fix.
21833
21834         * report.cs: Updated format to be 4-zero filled digits.
21835
21836 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21837
21838         * expression.cs (CheckIndices): Fix minor bug where the wrong
21839         variable was being referred to ;-)
21840
21841         (DoEmit): Do not call EmitStaticInitializers when the 
21842         underlying type is System.Object.
21843
21844 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21845
21846         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21847         and do the usual workaround for SRE.
21848
21849         * class.cs (MyEventBuilder.EventType): New member to get at the type
21850         of the event, quickly.
21851
21852         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21853
21854         * assign.cs (Assign.DoResolve): Handle the case when the target
21855         is an EventExpr and perform the necessary checks.
21856
21857         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21858         interface.
21859
21860         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21861
21862         (EventExpr): Set the type in the constructor itself since we 
21863         are meant to be born fully resolved.
21864
21865         (EventExpr.Define): Revert code I wrote earlier.
21866                 
21867         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21868         instance expression is null. The instance expression is a This in that case
21869         or a null, depending on whether it is a static method or not.
21870
21871         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21872         refers to more than one method.
21873
21874         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21875         and accordingly flag errors.
21876
21877 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21878
21879         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21880
21881 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21882
21883         * location.cs (ToString): Provide useful rutine.
21884
21885 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21886
21887         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21888         objects, return the actual integral boxed.
21889
21890         * statement.cs (SwitchLabel): define an ILLabel for each
21891         SwitchLabel. 
21892
21893         (Switch.CheckSwitch): If the value is a Literal, extract
21894         the underlying literal.
21895
21896         Also in the unused hashtable we had, add the SwitchLabel so we can
21897         quickly look this value up.
21898
21899         * constant.cs: Implement a bunch of new constants.  Rewrite
21900         Literal based on this.  Made changes everywhere to adapt to this.
21901
21902         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21903         dereferencing array only once, and also copes with enumrations.
21904
21905         bytes are two bytes wide, not one.
21906
21907         (Cast): Perform constant conversions.
21908
21909         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21910         wrappers to the literals here.
21911
21912         * expression.cs (DoNumericPromotions): long literals can converted
21913         to ulong implicity (this is taken care of elsewhere, but I was
21914         missing this spot).
21915
21916         * ecore.cs (Expression.Literalize): Make the return type Literal,
21917         to improve type checking.
21918
21919         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21920
21921 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21922
21923         * literal.cs: Revert code from ravi that checked the bounds.  The
21924         bounds are sane by the definition of the type itself. 
21925
21926         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21927         need to actually look up in our parent hierarchy for interfaces
21928         implemented. 
21929
21930         * const.cs: Use the underlying type for enumerations
21931
21932         * delegate.cs: Compute the basename for the delegate creation,
21933         that should fix the delegate test case, and restore the correct
21934         Type Lookup semantics in rootcontext
21935
21936         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21937         referencing a nested type with the Reflection API is using the "+"
21938         sign. 
21939
21940         * cs-parser.jay: Do not require EOF token at the end.
21941
21942 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21943
21944         * rootcontext.cs (LookupType): Concatenate type names with
21945         a '.' instead of a '+' The test suite passes again.
21946
21947         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21948         field of the enumeration.
21949
21950         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21951         the case when the member is an EventExpr.
21952
21953         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21954         static has an associated instance expression.
21955
21956         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21957
21958         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21959
21960         * class.cs (Event.Define): Register event and perform appropriate checks
21961         for error #111.
21962
21963         We define the Add and Remove methods even if the use provides none because
21964         in that case, we provide default implementations ourselves.
21965
21966         Define a private field of the type of the event. This is done by the CSC compiler
21967         and we should be doing it too ;-)
21968
21969         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21970         More methods we use in code we generate.
21971
21972         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21973         is important.
21974
21975         (InitCoreTypes): Update accordingly for the above.
21976
21977         * class.cs (Event.Emit): Generate code for default accessors that we provide
21978
21979         (EmitDefaultMethod): Do the job in the above.
21980
21981         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21982         appropriate place.
21983
21984 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21985
21986         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21987         builders even if we were missing one.
21988
21989         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21990         pass the Basename as our class name instead of the Name.  The
21991         basename will be correctly composed for us.
21992
21993         * parameter.cs (Paramters): Now takes a Location argument.
21994
21995         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21996         make all the code call directly LookupType in RootContext and take
21997         this chance to pass the Location information everywhere.
21998
21999         * Everywhere: pass Location information.
22000
22001 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22002
22003         * class.cs (Constructor.Define): Updated way of detecting the
22004         length of the parameters.
22005
22006         (TypeContainer.DefineType): Use basename as the type name for
22007         nested types.
22008
22009         (TypeContainer.Define): Do not recursively define types here, as
22010         definition is taken care in order by the RootContext.
22011
22012         * tree.cs: Keep track of namespaces in a per-file basis.
22013
22014         * parameter.cs (Parameter.ComputeSignature): Update to use
22015         DeclSpace. 
22016
22017         (Parameters.GetSignature): ditto.
22018
22019         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22020         instead of a TypeContainer.
22021
22022         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22023         resolve names.  Because we need to be resolve in our context, not
22024         our parents.
22025
22026         * driver.cs: Implement response files.
22027
22028         * class.cs (TypeContainer.DefineType): If we are defined, do not
22029         redefine ourselves.
22030
22031         (Event.Emit): Emit the code for add/remove handlers.
22032         (Event.Define): Save the MethodBuilders for add/remove.
22033
22034         * typemanager.cs: Use pair here too.
22035
22036         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22037         DictionaryEntry requires the first argument to be non-null.  
22038
22039         (enum_declaration): Compute full name for registering the
22040         enumeration.
22041
22042         (delegate_declaration): Instead of using
22043         formal_parameter_list, use opt_formal_parameter_list as the list
22044         can be empty.
22045
22046         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22047         (EventParsing): New property that controls whether `add' and
22048         `remove' are returned as tokens or identifiers (for events);
22049
22050 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22051
22052         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22053         use MyEventBuilder only and let it wrap the real builder for us.
22054
22055         (MyEventBuilder): Revamp constructor etc.
22056
22057         Implement all operations that we perform on EventBuilder in precisely the same
22058         way here too.
22059
22060         (FindMembers): Update to use the EventBuilder member.
22061
22062         (Event.Emit): Update accordingly.
22063
22064 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22065
22066         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22067         by calling the appropriate methods.
22068
22069         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22070         useful.
22071
22072         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22073
22074 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22075
22076         * delegate.cs (Delegate.Populate): Check that the return type
22077         and various parameters types are indeed accessible.
22078
22079         * class.cs (Constructor.Define): Same here.
22080
22081         (Field.Define): Ditto.
22082
22083         (Event.Define): Ditto.
22084
22085         (Operator.Define): Check that the underlying Method defined itself
22086         correctly - so it's MethodBuilder should not be null.
22087
22088         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22089         expression happens to be null.
22090
22091         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22092         members but as of now we don't seem to be able to do anything really useful with it.
22093
22094         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22095         not the EventBuilder.
22096
22097 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22098
22099         * cs-tokenizer.cs: Add support for defines.
22100         Add support for #if, #elif, #else, #endif
22101
22102         (eval_var): evaluates a variable.
22103         (eval): stubbed for evaluating functions.
22104
22105         * cs-parser.jay: Pass the defines information
22106
22107         * driver.cs: Add --define command line option.
22108
22109         * decl.cs: Move MemberCore here.
22110
22111         Make it the base class for DeclSpace.  This allows us to catch and
22112         report 108 and 109 for everything now.
22113
22114         * class.cs (TypeContainer.Define): Extract all the members
22115         before populating and emit the warning 108 (new keyword required
22116         to override) instead of having each member implement this.
22117
22118         (MemberCore.Define): New abstract method, we will be using this in
22119         the warning reporting engine in Populate.
22120
22121         (Operator.Define): Adjust to new MemberCore protocol. 
22122
22123         * const.cs (Const): This does not derive from Expression, it is a
22124         temporary object we use to create fields, it is a MemberCore. 
22125
22126         * class.cs (Method.Define): Allow the entry point to be in a
22127         specific class.
22128
22129         * driver.cs: Rewrite the argument handler to clean it up a bit.
22130
22131         * rootcontext.cs: Made it just an auxiliary namespace feature by
22132         making everything static.
22133
22134         * driver.cs: Adapt code to use RootContext type name instead of
22135         instance variable.
22136
22137         * delegate.cs: Remove RootContext argument.
22138
22139         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22140         argument. 
22141
22142         * class.cs (Event.Define): The lookup can fail.
22143
22144         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22145
22146         * expression.cs: Resolve the this instance before invoking the code.
22147
22148 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22149
22150         * cs-parser.jay: Add a production in element_access that allows
22151         the thing to become a "type" reference.  This way we can parse
22152         things like "(string [])" as a type.
22153
22154         Note that this still does not handle the more complex rules of
22155         casts. 
22156
22157
22158         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22159
22160         * ecore.cs: (CopyNewMethods): new utility function used to
22161         assemble the list of methods from running FindMembers.
22162
22163         (MemberLookup): Rework FindMembers so that 
22164
22165 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22166
22167         * class.cs (TypeContainer): Remove Delegates who fail to be
22168         defined.
22169
22170         * delegate.cs (Populate): Verify that we dont get null return
22171         values.   TODO: Check for AsAccessible.
22172
22173         * cs-parser.jay: Use basename to emit error 574 (destructor should
22174         have the same name as container class), not the full name.
22175
22176         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22177         possible representation.  
22178
22179         Also implements integer type suffixes U and L.
22180
22181 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22182
22183         * expression.cs (ArrayCreation.DoResolve): We need to do the
22184         argument resolution *always*.
22185
22186         * decl.cs: Make this hold the namespace.  Hold the root context as
22187         well.
22188         (LookupType): Move here.
22189
22190         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22191
22192         * location.cs (Row, Name): Fixed the code, it was always returning
22193         references to the first file.
22194
22195         * interface.cs: Register properties defined through interfaces.
22196
22197         * driver.cs: Add support for globbing on the command line
22198
22199         * class.cs (Field): Make it derive from MemberCore as well.
22200         (Event): ditto.
22201
22202 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22203
22204         * class.cs (Event::Define): Check that the type of the event is a delegate
22205         type else flag error #66.
22206
22207         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22208         same.
22209
22210         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22211         values of EntryPoint, CharSet etc etc.
22212
22213         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22214
22215         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22216         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22217         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22218         which needs this to do its work.
22219
22220         * ../errors/cs0066.cs : Add.
22221
22222 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22223
22224         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22225         helper functions.
22226
22227         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22228         clears out the parameters field.
22229         (MemberSignatureCompare): Cleanup
22230
22231         (MemberCore): New base class used to share code between MethodCore
22232         and Property.
22233
22234         (RegisterRequiredImplementations) BindingFlags.Public requires
22235         either BindingFlags.Instace or Static.  Use instance here.
22236
22237         (Property): Refactored code to cope better with the full spec.
22238
22239         * parameter.cs (GetParameterInfo): Return an empty array instead
22240         of null on error.
22241
22242         * class.cs (Property): Abstract or extern properties have no bodies.
22243
22244         * parameter.cs (GetParameterInfo): return a zero-sized array.
22245
22246         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22247         method modifier validation to the typecontainer so we can reuse
22248         this on properties.
22249
22250         (MethodCore.ParameterTypes): return an empty sized array of types.
22251
22252         (Property.Define): Test property modifier validity.
22253
22254         Add tests for sealed/override too.
22255
22256         (Method.Emit): abstract or extern methods have no bodies.
22257
22258 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22259
22260         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22261         thing.
22262
22263         (Method::Define, ::Emit): Modify accordingly.
22264
22265         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22266
22267         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22268
22269         * makefile: Pass in /unsafe.
22270
22271 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22272
22273         * class.cs (MakeKey): Kill routine.
22274
22275         * class.cs (TypeContainer.Define): Correctly define explicit
22276         method implementations (they require the full interface name plus
22277         the method name).
22278
22279         * typemanager.cs: Deply the PtrHashtable here and stop using the
22280         lame keys.  Things work so much better.
22281
22282         This of course broke everyone who depended on `RegisterMethod' to
22283         do the `test for existance' test.  This has to be done elsewhere.
22284
22285         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22286         the object stupid Equals method (because, that like fails all over
22287         the place).  We still do not use it.
22288
22289         * class.cs (TypeContainer.SetRequiredInterface,
22290         TypeContainer.RequireMethods): Killed these two routines and moved
22291         all the functionality to RegisterRequiredImplementations.
22292
22293         (TypeContainer.RegisterRequiredImplementations): This routine now
22294         registers all the implementations required in an array for the
22295         interfaces and abstract methods.  We use an array of structures
22296         which can be computed ahead of time to reduce memory usage and we
22297         also assume that lookups are cheap as most classes will not
22298         implement too many interfaces.
22299
22300         We also avoid creating too many MethodSignatures.
22301
22302         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22303         clear the "pending" bit if we find that there are problems with
22304         the declaration.
22305
22306         (TypeContainer.VerifyPendingMethods): Update to report errors of
22307         methods that look like implementations but are not.
22308
22309         (TypeContainer.Define): Add support for explicit interface method
22310         implementation. 
22311
22312 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22313
22314         * typemanager.cs: Keep track of the parameters here instead of
22315         being a feature of the TypeContainer.
22316
22317         * class.cs: Drop the registration of parameters here, as
22318         InterfaceMethods are also interface declarations.
22319
22320         * delegate.cs: Register methods with the TypeManager not only with
22321         the TypeContainer.  This code was buggy.
22322
22323         * interface.cs: Full registation here.
22324
22325 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22326
22327         * expression.cs: Remove reducer for binary expressions, it can not
22328         be done this way.
22329
22330         * const.cs: Put here the code that used to go into constant.cs
22331
22332         * constant.cs: Put here the code for constants, this is a new base
22333         class for Literals.
22334
22335         * literal.cs: Make Literal derive from Constant.
22336
22337 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22338
22339         * statement.cs (Return.Emit): Report error 157 if the user
22340         attempts to return from a finally block.
22341
22342         (Return.Emit): Instead of emitting a return, jump to the end of
22343         the function.
22344
22345         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22346         LocalBuilder to store the result of the function.  ReturnLabel is
22347         the target where we jump.
22348
22349
22350 2001-12-09  Radek Doulik  <rodo@ximian.com>
22351
22352         * cs-parser.jay: remember alias in current namespace
22353
22354         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22355         namespaces
22356
22357         * class.cs (LookupAlias): lookup alias in my_namespace
22358
22359         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22360         aliases hashtable
22361         (LookupAlias): lookup alias in this and if needed in parent
22362         namespaces
22363
22364 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22365
22366         * support.cs: 
22367
22368         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22369         making things static.  I need this to avoid passing the
22370         TypeContainer when calling ParameterType.
22371
22372         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22373         that did string manipulation to compute the type and then call
22374         GetType.  Use Parameter.ParameterType instead.
22375
22376         * cs-tokenizer.cs: Consume the suffix for floating values.
22377
22378         * expression.cs (ParameterReference): figure out whether this is a
22379         reference parameter or not.  Kill an extra variable by computing
22380         the arg_idx during emission.
22381
22382         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22383         function that returns whether a parameter is an out/ref value or not.
22384
22385         (Parameter.ParameterType): The type of the parameter (base,
22386         without ref/out applied).
22387
22388         (Parameter.Resolve): Perform resolution here.
22389         (Parameter.ExternalType): The full type (with ref/out applied).
22390
22391         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22392         support for expressions on the using statement.
22393
22394 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22395
22396         * statement.cs (Using.EmitLocalVariableDecls): Split the
22397         localvariable handling of the using statement.
22398
22399         (Block.EmitMeta): Keep track of variable count across blocks.  We
22400         were reusing slots on separate branches of blocks.
22401
22402         (Try.Emit): Emit the general code block, we were not emitting it. 
22403
22404         Check the type of the declaration to be an IDisposable or
22405         something that can be implicity converted to it. 
22406
22407         Emit conversions if required.
22408
22409         * ecore.cs (EmptyExpression): New utility class.
22410         (Expression.ImplicitConversionExists): New utility function.
22411
22412 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22413
22414         * statement.cs (Using): Implement.
22415
22416         * expression.cs (LocalVariableReference): Support read only variables.
22417
22418         * statement.cs: Remove the explicit emit for the Leave opcode.
22419         (VariableInfo): Add a readonly field.
22420
22421 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22422
22423         * ecore.cs (ConvCast): new class used to encapsulate the various
22424         explicit integer conversions that works in both checked and
22425         unchecked contexts.
22426
22427         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22428         properly generate the overflow opcodes.
22429
22430 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22431
22432         * statement.cs: The correct type for the EmptyExpression is the
22433         element_type, not the variable type.  Ravi pointed this out.
22434
22435 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22436
22437         * class.cs (Method::Define): Handle PInvoke methods specially
22438         by using DefinePInvokeMethod instead of the usual one.
22439
22440         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22441         above to do the task of extracting information and defining the method.
22442
22443 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22444
22445         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22446         of the condition for string type.
22447
22448         (Emit): Move that here. 
22449
22450         (ArrayCreation::CheckIndices): Keep string literals in their expression
22451         form.
22452
22453         (EmitDynamicInitializers): Handle strings appropriately.
22454
22455 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22456
22457         * codegen.cs (EmitContext): Replace multiple variables with a
22458         single pointer to the current Switch statement.
22459
22460         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22461         EmitContext.
22462
22463 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22464
22465         * statement.cs 
22466
22467         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22468         default'.
22469
22470         (Foreach.Emit): Foreach on arrays was not setting
22471         up the loop variables (for break/continue).
22472
22473         (GotoCase): Semi-implented.
22474
22475 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22476
22477         * attribute.cs (CheckAttribute): Handle system attributes by using
22478         Attribute.GetAttributes to examine information we need.
22479
22480         (GetValidPlaces): Same here.
22481
22482         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22483
22484         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22485
22486         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22487
22488         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22489
22490         (Method::Emit): Handle the case when we are a PInvoke method.
22491
22492 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22493
22494         * expression.cs: Use ResolveWithSimpleName on compound names.
22495
22496 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22497
22498         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22499         before trying to reduce it.
22500
22501         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22502
22503         * constant.cs (LookupConstantValue): Implement.
22504
22505         (EmitConstant): Use the above in emitting the constant.
22506
22507         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22508         that are user-defined by doing a LookupConstantValue on them.
22509
22510         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22511         too, like above.
22512
22513 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22514
22515         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22516
22517         (BaseAccess.DoResolve): Implement.
22518
22519         (MemberAccess.DoResolve): Split this routine into a
22520         ResolveMemberAccess routine that can be used independently
22521
22522 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22523
22524         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22525         As that share bits of the implementation.  Is returns a boolean,
22526         while As returns the Type that is being probed.
22527
22528 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22529
22530         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22531         instead of a Literal - much easier.
22532
22533         (EnumInTransit): Remove - utterly useless :-)
22534
22535         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22536
22537         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22538
22539         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22540         chain when we have no associated expression.
22541
22542 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22543
22544         * constant.cs (Define): Use Location while reporting the errror.
22545
22546         Also emit a warning when 'new' is used and there is no inherited
22547         member to hide.
22548
22549         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22550         populated.
22551
22552         (LookupEnumValue): Implement to lookup an enum member's value and define it
22553         if necessary.
22554
22555         (Populate): Re-write accordingly to use the above routine.
22556
22557 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22558
22559         * expression.cs (This): Fix prototype for DoResolveLValue to
22560         override the base class DoResolveLValue.
22561
22562         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22563         declarations) 
22564
22565         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22566         (we need to load the address of the field here).  This fixes
22567         test-22. 
22568
22569         (FieldExpr.DoResolveLValue): Call the DoResolve
22570         function to initialize the Instance expression.
22571
22572         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22573         correctly the GetEnumerator operation on a value type.
22574
22575         * cs-parser.jay: Add more simple parsing error catches.
22576
22577         * statement.cs (Switch): Add support for string switches.
22578         Handle null specially.
22579
22580         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22581
22582 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22583
22584         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22585
22586         (declare_local_constant): New helper function.
22587
22588         * statement.cs (AddConstant): Keep a separate record of constants
22589
22590         (IsConstant): Implement to determine if a variable is a constant.
22591
22592         (GetConstantExpression): Implement.
22593
22594         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22595
22596         * statement.cs (IsVariableDefined): Re-write.
22597
22598 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22599
22600         * class.cs (TypeContainer::FindMembers): Look for constants
22601         in the case when we are looking for MemberTypes.Field
22602
22603         * expression.cs (MemberAccess::DoResolve): Check that in the
22604         case we are a FieldExpr and a Literal, we are not being accessed
22605         by an instance reference.
22606
22607         * cs-parser.jay (local_constant_declaration): Implement.
22608
22609         (declaration_statement): Implement for constant declarations.
22610
22611 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22612
22613         * statement.cs (Switch): Catch double defaults.
22614
22615         (Switch): More work on the switch() statement
22616         implementation.  It works for integral values now, need to finish
22617         string support.
22618
22619
22620 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22621
22622         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22623         integer literals into other integer literals.  To be used by
22624         switch. 
22625
22626 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22627
22628         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22629         some memory.
22630
22631         (EmitDynamicInitializers): Cope with the above since we extract data
22632         directly from ArrayData now.
22633
22634         (ExpectInitializers): Keep track of whether initializers are mandatory
22635         or not.
22636
22637         (Bounds): Make it a hashtable to prevent the same dimension being 
22638         recorded for every element in that dimension.
22639
22640         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22641         from being found.
22642
22643         Also fix bug which was causing the indices to be emitted in the reverse
22644         order.
22645
22646 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22647
22648         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22649         unfinished.  They do not work, because the underlying code is
22650         sloppy.
22651
22652 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22653
22654         * cs-parser.jay: Remove bogus fixme.
22655
22656         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22657         on Switch statement.
22658
22659 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22660
22661         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22662         the same. 
22663
22664         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22665         parameter. Apparently, any expression is allowed. 
22666
22667         (ValidateInitializers): Update accordingly.
22668
22669         (CheckIndices): Fix some tricky bugs thanks to recursion.
22670
22671         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22672         I was being completely brain-dead.
22673
22674         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22675         and re-write acordingly.
22676
22677         (DelegateInvocation): Re-write accordingly.
22678
22679         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22680
22681         (MakeByteBlob): Handle types more correctly.
22682
22683         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22684         initialization from expressions but it is incomplete because I am a complete
22685         Dodo :-|
22686
22687 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22688
22689         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22690         on If.  Basically, we have to return `true' (ie, we do return to
22691         our caller) only if both branches of the if return.
22692
22693         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22694         short-circuit operators, handle them as short circuit operators. 
22695
22696         (Cast.DoResolve): Resolve type.
22697         (Cast.Cast): Take an expression as the target type.
22698
22699         * cs-parser.jay (cast_expression): Remove old hack that only
22700         allowed a limited set of types to be handled.  Now we take a
22701         unary_expression and we resolve to a type during semantic
22702         analysis.
22703
22704         Use the grammar productions from Rhys to handle casts (this is
22705         not complete like Rhys syntax yet, we fail to handle that corner
22706         case that C# has regarding (-x), but we will get there.
22707
22708 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22709
22710         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22711         field which is an array type.
22712
22713         * cs-parser.jay (declare_local_variables): Support array initialization too.
22714
22715         * typemanager.cs (MakeKey): Implement.
22716
22717         (everywhere): Use the above appropriately.
22718
22719         * cs-parser.jay (for_statement): Update for array initialization while
22720         declaring variables.
22721
22722         * ecore.cs : The error message was correct, it's the variable's names that
22723         were misleading ;-) Make the code more readable.
22724
22725         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22726         the correct type etc.
22727
22728         (ConvertExplicit): Handle Enum types by examining the underlying type.
22729
22730 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22731
22732         * parameter.cs (GetCallingConvention): Always return
22733         CallingConventions.Standard for now.
22734
22735 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22736
22737         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22738         and `r' after calling DoNumericPromotions.
22739
22740         * ecore.cs: Fix error message (the types were in the wrong order).
22741
22742         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22743         BindingFlags.Instance as well 
22744
22745         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22746         implicit int literal conversion in an empty cast so that we
22747         propagate the right type upstream.
22748
22749         (UnboxCast): new class used to unbox value types.
22750         (Expression.ConvertExplicit): Add explicit type conversions done
22751         by unboxing.
22752
22753         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22754         the target type before applying the implicit LongLiterals to ULong
22755         literal cast.
22756
22757 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22758
22759         * cs-parser.jay (for_statement): Reworked the way For works: now
22760         we declare manually any variables that are introduced in
22761         for_initializer to solve the problem of having out-of-band code
22762         emition (that is what got for broken).
22763
22764         (declaration_statement): Perform the actual variable declaration
22765         that used to be done in local_variable_declaration here.
22766
22767         (local_variable_declaration): Do not declare anything, just pass
22768         the information on a DictionaryEntry
22769
22770 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22771
22772         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22773         re-write of the logic to now make it recursive.
22774
22775         (UpdateIndices): Re-write accordingly.
22776
22777         Store element data in a separate ArrayData list in the above methods.
22778
22779         (MakeByteBlob): Implement to dump the array data into a byte array.
22780
22781 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22782
22783         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22784         into CheckIndices.
22785
22786         * constant.cs (Define): Implement.
22787
22788         (EmitConstant): Re-write fully.
22789
22790         Pass in location info.
22791
22792         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22793         respectively.
22794
22795         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22796         DictionaryEntry since we need location info too.
22797
22798         (constant_declaration): Update accordingly.
22799
22800         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22801         code into another method : UpdateIndices.
22802
22803 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22804
22805         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22806         some type checking etc.
22807
22808 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22809
22810         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22811         bits to provide dimension info if the user skips doing that.
22812
22813         Update second constructor to store the rank correctly.
22814
22815 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22816
22817         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22818         and try to implement.
22819
22820         * ../errors/cs0150.cs : Add.
22821
22822         * ../errors/cs0178.cs : Add.
22823
22824 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22825
22826         * statement.cs: Implement foreach on multi-dimensional arrays. 
22827
22828         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22829         name of the params argument.
22830
22831         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22832         initializing the array.
22833
22834         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22835         we can use this elsewhere.
22836
22837         * statement.cs: Finish implementation of foreach for single
22838         dimension arrays.
22839
22840         * cs-parser.jay: Use an out-of-band stack to pass information
22841         around, I wonder why I need this.
22842
22843         foreach_block: Make the new foreach_block the current_block.
22844
22845         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22846         function used to return a static Parameters structure.  Used for
22847         empty parameters, as those are created very frequently.
22848
22849         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22850
22851 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22852
22853         * interface.cs : Default modifier is private, not public. The
22854         make verify test passes again.
22855
22856 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22857
22858         * support.cs (ReflectionParameters): Fix logic to determine
22859         whether the last parameter is a params one. Test 9 passes again.
22860
22861         * delegate.cs (Populate): Register the builders we define with
22862         RegisterParameterForBuilder. Test 19 passes again.
22863
22864         * cs-parser.jay (property_declaration): Reference $6 instead
22865         of $$ to get at the location.
22866
22867         (indexer_declaration): Similar stuff.
22868
22869         (attribute): Ditto.
22870
22871         * class.cs (Property): Register parameters for the Get and Set methods
22872         if they exist. Test 23 passes again.
22873
22874         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22875         call to EmitArguments as we are sure there aren't any params arguments. 
22876         Test 32 passes again.
22877
22878         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22879         IndexOutOfRangeException. 
22880
22881         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22882         Test 33 now passes again.
22883
22884 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22885
22886         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22887         broke a bunch of things.  Will have to come up with a better way
22888         of tracking locations.
22889
22890         * statement.cs: Implemented foreach for single dimension arrays.
22891
22892 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22893
22894         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22895         an error.  This removes the lookup from the critical path.
22896
22897         * cs-parser.jay: Removed use of temporary_loc, which is completely
22898         broken. 
22899
22900 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22901
22902         * support.cs (ReflectionParameters.ParameterModifier): Report
22903         whether the argument is a PARAMS argument or not.
22904
22905         * class.cs: Set the attribute `ParamArrayAttribute' on the
22906         parameter argument.
22907
22908         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22909         and cons_param_array_attribute (ConstructorInfo for
22910         ParamArrayAttribute)., 
22911
22912         * codegen.cs: Emit the return using the `Return' statement, that
22913         way we can report the error correctly for missing return values. 
22914
22915         * class.cs (Method.Emit): Clean up.
22916
22917         * expression.cs (Argument.Resolve): Take another argument: the
22918         location where this argument is used.  Notice that this is not
22919         part of the "Argument" class as to reduce the size of the
22920         structure (we know the approximate location anyways).
22921
22922         Test if the argument is a variable-reference, if not, then
22923         complain with a 206.
22924
22925         (Argument.Emit): Emit addresses of variables.
22926
22927         (Argument.FullDesc): Simplify.
22928
22929         (Invocation.DoResolve): Update for Argument.Resolve.
22930
22931         (ElementAccess.DoResolve): ditto.
22932
22933         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22934         method should be virtual, as this method is always virtual.
22935
22936         (NewDelegate.DoResolve): Update for Argument.Resolve.
22937
22938         * class.cs (ConstructorInitializer.DoResolve): ditto.
22939
22940         * attribute.cs (Attribute.Resolve): ditto.
22941
22942 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22943
22944         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22945
22946         * expression.cs (ParameterReference): Drop IStackStorage and implement
22947         IAssignMethod instead. 
22948
22949         (LocalVariableReference): ditto.
22950
22951         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22952         IAssignMethod instead. 
22953
22954 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22955
22956         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22957         enumerations that are used in heavily used structures derive from
22958         byte in a laughable and pathetic attempt to reduce memory usage.
22959         This is the kind of pre-optimzations that you should not do at
22960         home without adult supervision.
22961
22962         * expression.cs (UnaryMutator): New class, used to handle ++ and
22963         -- separatedly from the other unary operators.  Cleans up the
22964         code, and kills the ExpressionStatement dependency in Unary.
22965
22966         (Unary): Removed `method' and `Arguments' from this class, making
22967         it smaller, and moving it all to SimpleCall, so I can reuse this
22968         code in other locations and avoid creating a lot of transient data
22969         strucutres when not required.
22970
22971         * cs-parser.jay: Adjust for new changes.
22972
22973 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22974
22975         * enum.cs (Enum.Populate): If there is a failure during
22976         definition, return
22977
22978         * cs-parser.jay (opt_enum_base): we used to catch type errors
22979         here, but this is really incorrect.  The type error should be
22980         catched during semantic analysis.
22981
22982 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22983
22984         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22985         current_local_parameters as expected since I, in my stupidity, had forgotten
22986         to do this :-)
22987
22988         * attribute.cs (GetValidPlaces): Fix stupid bug.
22989
22990         * class.cs (Method::Emit): Perform check on applicability of attributes.
22991
22992         (Constructor::Emit): Ditto.
22993
22994         (Field::Emit): Ditto.
22995
22996         (Field.Location): Store location information.
22997
22998         (Property, Event, Indexer, Operator): Ditto.
22999
23000         * cs-parser.jay (field_declaration): Pass in location for each field.
23001
23002         * ../errors/cs0592.cs : Add.
23003
23004 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23005
23006         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23007
23008         (InitCoreTypes): Update accordingly.
23009
23010         (RegisterAttrType, LookupAttr): Implement.
23011
23012         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23013         info about the same.
23014
23015         (Resolve): Update to populate the above as necessary.
23016
23017         (Error592): Helper.
23018
23019         (GetValidPlaces): Helper to the above.
23020
23021         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23022
23023         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23024
23025 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23026
23027         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23028
23029         * ../errors/cs0617.cs : Add.
23030
23031 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23032
23033         * enum.cs (Emit): Rename to Populate to be more consistent with what
23034         we expect it to do and when exactly it is called.
23035
23036         * class.cs, rootcontext.cs : Update accordingly.
23037
23038         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23039         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23040
23041         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23042
23043         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23044         of a fieldinfo using the above, when dealing with a FieldBuilder.
23045
23046 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23047
23048         * ../errors/cs0031.cs : Add.
23049
23050         * ../errors/cs1008.cs : Add.
23051
23052         * ../errrors/cs0543.cs : Add.
23053
23054         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23055         enum type.
23056
23057         (FindMembers): Implement.
23058
23059         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23060         enums and delegates too.
23061
23062         (enum_types): Rename to builder_to_enum.
23063
23064         (delegate_types): Rename to builder_to_delegate.
23065
23066         * delegate.cs (FindMembers): Implement.
23067
23068 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23069
23070         * typemanager.cs (IsEnumType): Implement.
23071
23072         * enum.cs (Emit): Re-write parts to account for the underlying type
23073         better and perform checking etc.
23074
23075         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23076         of the underlying type.
23077
23078         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23079         value
23080
23081         * enum.cs (error31): Helper to report error #31.
23082
23083         * cs-parser.jay (enum_declaration): Store location of each member too.
23084
23085         * enum.cs (member_to_location): New hashtable. 
23086
23087         (AddEnumMember): Update location hashtable.
23088
23089         (Emit): Use the location of each member while reporting errors.
23090
23091 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23092
23093         * cs-parser.jay: A for_initializer if is a
23094         local_variable_declaration really ammount to have an implicit
23095         block with the variable declaration and no initializer for for.
23096
23097         * statement.cs (For.Emit): Cope with null initializers.
23098
23099         This fixes the infinite loop on for initializers.
23100
23101 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23102
23103         * enum.cs: More cleanup.
23104
23105         * ecore.cs: Remove dead code.
23106
23107         * class.cs (Property.Emit): More simplification.
23108         (Event.Emit): ditto.
23109
23110         Reworked to have less levels of indentation.
23111
23112 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23113
23114         * class.cs (Property): Emit attributes.
23115
23116         (Field): Ditto.
23117
23118         (Event): Ditto.
23119
23120         (Indexer): Ditto.
23121
23122         (Operator): Ditto.
23123
23124         * enum.cs (Emit): Ditto.
23125
23126         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23127         Enums too.
23128
23129         * class.cs (Field, Event, etc.): Move attribute generation into the
23130         Emit method everywhere.
23131
23132         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23133         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23134         as we had no way of defining nested enums !
23135
23136         * rootcontext.cs : Adjust code accordingly.
23137
23138         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23139
23140 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23141
23142         * expression.cs (EvalConstantExpression): Move into ecore.cs
23143
23144         * enum.cs (Enum): Rename some members and make them public and readonly
23145         according to our convention.
23146
23147         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23148         nothing else.
23149
23150         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23151
23152         (Enum::Emit): Write a simple version for now which doesn't try to compute
23153         expressions. I shall modify this to be more robust in just a while.
23154
23155         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23156
23157         (TypeContainer::CloseType): Create the Enum types too.
23158
23159         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23160
23161         * expression.cs (EvalConstantExpression): Get rid of completely.
23162
23163         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23164         user-defined values and other cases.
23165
23166         (IsValidEnumLiteral): Helper function.
23167
23168         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23169         out there in the case we had a literal FieldExpr.
23170
23171         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23172
23173         (Literalize): Revamp a bit to take two arguments.
23174
23175         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23176
23177 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23178
23179         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23180
23181         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23182
23183         (Resolve): Use the above to ensure we have proper initializers.
23184
23185 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23186
23187         * expression.cs (Expression::EvalConstantExpression): New method to 
23188         evaluate constant expressions.
23189
23190         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23191
23192 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23193
23194         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23195         in an array.
23196
23197         (Binary.ResolveOperator): Handle operator != (object a, object b)
23198         and operator == (object a, object b);
23199
23200         (Binary.DoNumericPromotions): Indicate whether the numeric
23201         promotion was possible.
23202
23203         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23204         Implement.  
23205
23206         Made the ArrayAccess implement interface IAssignMethod instead of
23207         IStackStore as the order in which arguments are passed reflects
23208         this.
23209
23210         * assign.cs: Instead of using expr.ExprClass to select the way of
23211         assinging, probe for the IStackStore/IAssignMethod interfaces.
23212
23213         * typemanager.cs: Load InitializeArray definition.
23214
23215         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23216         static data that can be used to initialize arrays. 
23217
23218 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23219
23220         * expression.cs: Handle operator== and operator!= for booleans.
23221
23222         (Conditioal.Reduce): Implement reducer for the ?: operator.
23223
23224         (Conditional.Resolve): Implement dead code elimination.
23225
23226         (Binary.Resolve): Catch string literals and return a new
23227         concatenated string.
23228
23229         (Unary.Reduce): Implement reduction of unary expressions.
23230
23231         * ecore.cs: Split out the expression core handling here.
23232
23233         (Expression.Reduce): New method used to perform constant folding
23234         and CSE.  This is needed to support constant-expressions. 
23235
23236         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23237         targets, and optimize for !x.
23238
23239 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23240
23241         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23242         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23243         set custom atttributes.
23244
23245         * literal.cs (Literal::GetValue): New abstract method to return the actual
23246         value of the literal, cast as an object.
23247
23248         (*Literal): Implement GetValue method.
23249
23250         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23251         expressions to the arraylist but objects of type Argument.
23252
23253         * class.cs (TypeContainer::Emit): Emit our attributes too.
23254
23255         (Method::Emit, Constructor::Emit): Ditto.
23256
23257         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23258         to be ignoring earlier.
23259
23260 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23261
23262         * attribute.cs (AttributeSection::Define): Implement to do the business
23263         of constructing a CustomAttributeBuilder.
23264
23265         (Attribute): New trivial class. Increases readability of code.  
23266
23267         * cs-parser.jay : Update accordingly.
23268
23269         (positional_argument_list, named_argument_list, named_argument): New rules
23270
23271         (attribute_arguments): Use the above so that we are more correct.
23272
23273 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23274
23275         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23276         to perform all checks for a method with a params parameter.
23277
23278         (Invocation::OverloadResolve): Update to use the above method and therefore
23279         cope correctly with params method invocations.
23280
23281         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23282         params too.
23283
23284         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23285         constructors in our parent too because we can't afford to miss out on 
23286         protected ones ;-)
23287
23288         * attribute.cs (AttributeSection): New name for the class Attribute
23289
23290         Other trivial changes to improve readability.
23291
23292         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23293         use the new class names.
23294
23295 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23296
23297         * class.cs (Method::Define): Complete definition for params types too
23298
23299         (Indexer::Define): Ditto.
23300
23301         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23302         Cope everywhere with a request for info about the array parameter.
23303
23304 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23305
23306         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23307
23308         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23309         local_variable_type to extract the string corresponding to the type.
23310
23311         (local_variable_type): Fixup the action to use the new helper method.
23312
23313         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23314         go.
23315
23316         * expression.cs : Clean out code which uses the above.
23317
23318 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23319
23320         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23321         and bale out if necessary by returning a false.
23322
23323         (RegisterProperty): Ditto.
23324
23325         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23326         and print out appropriate error messages.
23327
23328         * interface.cs (everywhere): Ditto.
23329
23330         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23331         location to constructor.
23332
23333         * class.cs (Property, Event, Indexer): Update accordingly.
23334
23335         * ../errors/cs111.cs : Added.
23336
23337         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23338         of a method, as laid down by the spec.
23339
23340         (Invocation::OverloadResolve): Use the above method.
23341
23342 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23343
23344         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23345         now take a TypeContainer and a Parameters object.
23346
23347         (ParameterData): Modify return type of ParameterModifier method to be 
23348         Parameter.Modifier and not a string.
23349
23350         (ReflectionParameters, InternalParameters): Update accordingly.
23351
23352         * expression.cs (Argument::GetParameterModifier): Same here.
23353
23354         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23355         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23356         symbol in it at all so maybe this is only for now.
23357
23358 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23359
23360         * support.cs (InternalParameters): Constructor now takes an extra argument 
23361         which is the actual Parameters class.
23362
23363         (ParameterDesc): Update to provide info on ref/out modifiers.
23364
23365         * class.cs (everywhere): Update call to InternalParameters to pass in
23366         the second argument too.
23367
23368         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23369         to return the modifier info [ref/out etc]
23370
23371         (InternalParameters, ReflectionParameters): Implement the above.
23372
23373         * expression.cs (Argument::ParameterModifier): Similar function to return
23374         info about the argument's modifiers.
23375
23376         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23377         too.
23378
23379         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23380         a new SetFormalParameters object which we pass to InternalParameters.
23381
23382 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23383
23384         * expression.cs (NewArray): Merge into the ArrayCreation class.
23385
23386 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23387
23388         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23389         NewUserdefinedArray into one as there wasn't much of a use in having
23390         two separate ones.
23391
23392         * expression.cs (Argument): Change field's name to ArgType from Type.
23393
23394         (Type): New readonly property which returns the proper type, taking into 
23395         account ref/out modifiers.
23396
23397         (everywhere): Adjust code accordingly for the above.
23398
23399         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23400         whether we are emitting for a ref or out parameter.
23401
23402         * expression.cs (Argument::Emit): Use the above field to set the state.
23403
23404         (LocalVariableReference::Emit): Update to honour the flag and emit the
23405         right stuff.
23406
23407         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23408
23409         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23410
23411         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23412
23413         (ReflectionParameters, InternalParameters): Implement the above method.
23414
23415         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23416         reporting errors.
23417
23418         (Invocation::FullMethodDesc): Ditto. 
23419
23420 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23421
23422         * cs-parser.jay: Add extra production for the second form of array
23423         creation. 
23424
23425         * expression.cs (ArrayCreation): Update to reflect the above
23426         change. 
23427
23428         * Small changes to prepare for Array initialization.
23429
23430 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23431
23432         * typemanager.cs (ImplementsInterface): interface might be null;
23433         Deal with this problem;
23434
23435         Also, we do store negative hits on the cache (null values), so use
23436         this instead of calling t.GetInterfaces on the type everytime.
23437
23438 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23439
23440         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23441
23442         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23443         split functionality out into different classes.
23444
23445         (New::FormArrayType): Move into NewBuiltinArray.
23446
23447         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23448         quite useless.
23449
23450         (NewBuiltinArray): New class to handle creation of built-in arrays.
23451
23452         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23453         account creation of one-dimensional arrays.
23454
23455         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23456
23457         (NewUserdefinedArray::DoResolve): Implement.
23458
23459         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23460
23461         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23462         we maintain inside the TypeManager. This is necessary to perform lookups on the
23463         module builder.
23464
23465         (LookupType): Update to perform GetType on the module builders too.     
23466
23467         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23468
23469         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23470
23471 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23472
23473         * expression.cs (New::DoResolve): Implement guts of array creation.
23474
23475         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23476
23477 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23478
23479         * expression.cs: Fix bug I introduced lsat night that broke
23480         Delegates. 
23481
23482         (Expression.Resolve): Report a 246 error (can not resolve name)
23483         if we find a SimpleName in the stream.
23484
23485         (Expression.ResolveLValue): Ditto.
23486
23487         (Expression.ResolveWithSimpleName): This function is a variant of
23488         ResolveName, this one allows SimpleNames to be returned without a
23489         warning.  The only consumer of SimpleNames is MemberAccess
23490
23491 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23492
23493         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23494         might arrive here.  I have my doubts that this is correct.
23495
23496         * statement.cs (Lock): Implement lock statement.
23497
23498         * cs-parser.jay: Small fixes to support `lock' and `using'
23499
23500         * cs-tokenizer.cs: Remove extra space
23501
23502         * driver.cs: New flag --checked, allows to turn on integer math
23503         checking. 
23504
23505         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23506         Threading.Monitor.Exit 
23507
23508 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23509
23510         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23511         Expression Class to be IndexerAccess.
23512
23513         Notice that Indexer::DoResolve sets the eclass to Value.
23514
23515 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23516
23517         * class.cs (TypeContainer::Emit): Emit code for indexers.
23518
23519         * assign.cs (IAssignMethod): New interface implemented by Indexers
23520         and Properties for handling assignment.
23521
23522         (Assign::Emit): Simplify and reuse code. 
23523
23524         * expression.cs (IndexerAccess, PropertyExpr): Implement
23525         IAssignMethod, clean up old code. 
23526
23527 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23528
23529         * typemanager.cs (ImplementsInterface): New method to determine if a type
23530         implements a given interface. Provides a nice cache too.
23531
23532         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23533         method.
23534
23535         (ConvertReferenceExplicit): Ditto.
23536
23537         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23538         various methods, with correct names etc.
23539
23540         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23541         Operator.UnaryNegation.
23542
23543         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23544         we have a unary plus or minus operator.
23545
23546         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23547         UnaryMinus.
23548
23549         * everywhere : update accordingly.
23550
23551         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23552         respectively.
23553
23554         * class.cs (Method::Define): For the case where we are implementing a method
23555         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23556         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23557
23558 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23559
23560         * interface.cs (FindMembers): Implement to work around S.R.E
23561         lameness.
23562
23563         * typemanager.cs (IsInterfaceType): Implement.
23564
23565         (FindMembers): Update to handle interface types too.
23566
23567         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23568         use IsAssignableFrom as that is not correct - it doesn't work.
23569
23570         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23571         and accordingly override EmitStatement.
23572
23573         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23574         using the correct logic :-)
23575
23576 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23577
23578         * ../errors/cs-11.cs : Add to demonstrate error -11 
23579
23580 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23581
23582         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23583         then pass this as a hint to ResolveLValue.
23584
23585         * expression.cs (FieldExpr): Add Location information
23586
23587         (FieldExpr::LValueResolve): Report assignment to readonly
23588         variable. 
23589
23590         (Expression::ExprClassFromMemberInfo): Pass location information.
23591
23592         (Expression::ResolveLValue): Add new method that resolves an
23593         LValue. 
23594
23595         (Expression::DoResolveLValue): Default invocation calls
23596         DoResolve. 
23597
23598         (Indexers): New class used to keep track of indexers in a given
23599         Type. 
23600
23601         (IStackStore): Renamed from LValue, as it did not really describe
23602         what this did.  Also ResolveLValue is gone from this interface and
23603         now is part of Expression.
23604
23605         (ElementAccess): Depending on the element access type
23606
23607         * typemanager.cs: Add `indexer_name_type' as a Core type
23608         (System.Runtime.CompilerServices.IndexerNameAttribute)
23609
23610         * statement.cs (Goto): Take a location.
23611
23612 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23613
23614         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23615         if two delegates are compatible.
23616
23617         (NewDelegate::DoResolve): Update to take care of the case when
23618         we instantiate a delegate from another delegate.
23619
23620         * typemanager.cs (FindMembers): Don't even try to look up members
23621         of Delegate types for now.
23622
23623 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23624
23625         * delegate.cs (NewDelegate): New class to take care of delegate
23626         instantiation.
23627
23628         * expression.cs (New): Split the delegate related code out into 
23629         the NewDelegate class.
23630
23631         * delegate.cs (DelegateInvocation): New class to handle delegate 
23632         invocation.
23633
23634         * expression.cs (Invocation): Split out delegate related code into
23635         the DelegateInvocation class.
23636
23637 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23638
23639         * expression.cs (New::DoResolve): Implement delegate creation fully
23640         and according to the spec.
23641
23642         (New::DoEmit): Update to handle delegates differently.
23643
23644         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23645         because of which we were printing out arguments in reverse order !
23646
23647         * delegate.cs (VerifyMethod): Implement to check if the given method
23648         matches the delegate.
23649
23650         (FullDelegateDesc): Implement.
23651
23652         (VerifyApplicability): Implement.
23653
23654         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23655         delegate invocations too.
23656
23657         (Invocation::Emit): Ditto.
23658
23659         * ../errors/cs1593.cs : Added.
23660
23661         * ../errors/cs1594.cs : Added.
23662
23663         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23664
23665 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23666
23667         * typemanager.cs (intptr_type): Core type for System.IntPtr
23668
23669         (InitCoreTypes): Update for the same.
23670
23671         (iasyncresult_type, asynccallback_type): Ditto.
23672
23673         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23674         correct.
23675
23676         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23677         too.
23678
23679         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23680         the builders for the 4 members of a delegate type :-)
23681
23682         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23683         type.
23684
23685         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23686
23687         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23688
23689 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23690
23691         * statement.cs (Break::Emit): Implement.   
23692         (Continue::Emit): Implement.
23693
23694         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23695         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23696         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23697         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23698         end loop
23699
23700         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23701         properties that track the label for the current loop (begin of the
23702         loop and end of the loop).
23703
23704 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23705
23706         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23707         use of emitting anything at all.
23708
23709         * class.cs, rootcontext.cs : Get rid of calls to the same.
23710
23711         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23712
23713         (Populate): Define the constructor correctly and set the implementation
23714         attributes.
23715
23716         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23717         have been defined.
23718
23719         (AddDelegateType): Implement.
23720
23721         (IsDelegateType): Implement helper method.
23722
23723         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23724
23725         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23726         and accordingly handle it.
23727
23728         * delegate.cs (Populate): Take TypeContainer argument.
23729         Implement bits to define the Invoke method. However, I still haven't figured out
23730         how to take care of the native int bit :-(
23731
23732         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23733         Qualify the name of the delegate, not its return type !
23734
23735         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23736         conversion.
23737
23738         (StandardConversionExists): Checking for array types turns out to be recursive.
23739
23740         (ConvertReferenceExplicit): Implement array conversion.
23741
23742         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23743
23744 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23745
23746         * cs-parser.jay (delegate_declaration): Store the fully qualified
23747         name as it is a type declaration.
23748
23749         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23750         readonly.
23751
23752         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23753         as TypeContainer::DefineType.
23754
23755         (Populate): Method in which all the definition of the various methods (Invoke)
23756         etc is done.
23757
23758         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23759         see.
23760
23761         (CloseDelegate): Finally creates the delegate.
23762
23763         * class.cs (TypeContainer::DefineType): Update to define delegates.
23764         (Populate, Emit and CloseType): Do the same thing here too.
23765
23766         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23767         delegates in all these operations.
23768
23769 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23770
23771         * expression.cs: LocalTemporary: a new expression used to
23772         reference a temporary that has been created.
23773
23774         * assign.cs: Handle PropertyAccess back here, so that we can
23775         provide the proper semantic access to properties.
23776
23777         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23778         a few more explicit conversions. 
23779
23780         * modifiers.cs: `NEW' modifier maps to HideBySig.
23781
23782         * expression.cs (PropertyExpr): Make this into an
23783         ExpressionStatement, and support the EmitStatement code path. 
23784
23785         Perform get/set error checking, clean up the interface.
23786
23787         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23788         them into toplevel access objects.
23789
23790 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23791
23792         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23793         SRE.
23794
23795         * typemanager.cs: Keep track here of our PropertyBuilders again to
23796         work around lameness in SRE.
23797
23798 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23799
23800         * expression.cs (LValue::LValueResolve): New method in the
23801         interface, used to perform a second resolution pass for LValues. 
23802
23803         (This::DoResolve): Catch the use of this in static methods.
23804
23805         (This::LValueResolve): Implement.
23806
23807         (This::Store): Remove warning, assigning to `this' in structures
23808         is 
23809
23810         (Invocation::Emit): Deal with invocation of
23811         methods on value types.  We need to pass the address to structure
23812         methods rather than the object itself.  (The equivalent code to
23813         emit "this" for structures leaves the entire structure on the
23814         stack instead of a pointer to it). 
23815
23816         (ParameterReference::DoResolve): Compute the real index for the
23817         argument based on whether the method takes or not a `this' pointer
23818         (ie, the method is static).
23819
23820         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23821         value types returned from functions when we need to invoke a
23822         method on the sturcture.
23823
23824
23825 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23826
23827         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23828         defining the type in the Modulebuilder or Typebuilder. This is to take
23829         care of nested types which need to be defined on the TypeBuilder using
23830         DefineNestedMethod.
23831
23832         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23833         methods in RootContext, only ported to be part of TypeContainer.
23834
23835         (TypeContainer::GetInterfaceOrClass): Ditto.
23836
23837         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23838
23839         * interface.cs (Interface::DefineInterface): New method. Does exactly
23840         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23841         too.
23842
23843         (Interface::GetInterfaces): Move from RootContext here and port.
23844
23845         (Interface::GetInterfaceByName): Same here.
23846
23847         * rootcontext.cs (ResolveTree): Re-write.
23848
23849         (PopulateTypes): Re-write.
23850
23851         * class.cs (TypeContainer::Populate): Populate nested types too.
23852         (TypeContainer::Emit): Emit nested members too.
23853
23854         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23855         instead just use the name argument passed in as it is already fully
23856         qualified.
23857
23858         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23859         to TypeContainer mapping to see if a type is user-defined.
23860
23861         * class.cs (TypeContainer::CloseType): Implement. 
23862
23863         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23864         the default constructor.
23865
23866         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23867         twice.
23868
23869         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23870
23871         * interface.cs (CloseType): Create the type here.
23872
23873         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23874         the hierarchy.
23875
23876         Remove all the methods which are now in TypeContainer.
23877
23878 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23879
23880         * delegate.cs (Define): Re-write bits to define the delegate
23881         correctly.
23882
23883 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23884
23885         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23886
23887         * expression.cs (ImplicitReferenceConversion): handle null as well
23888         as a source to convert to any reference type.
23889
23890         * statement.cs (Return): Perform any implicit conversions to
23891         expected return type.  
23892
23893         Validate use of return statement.  
23894
23895         * codegen.cs (EmitContext): Pass the expected return type here.
23896
23897         * class.cs (Method, Constructor, Property): Pass expected return
23898         type to EmitContext.
23899
23900 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23901
23902         * expression.cs: Make DoResolve take an EmitContext instead of a
23903         TypeContainer.
23904
23905         Replaced `l' and `location' for `loc', for consistency.
23906
23907         (Error, Warning): Remove unneeded Tc argument.
23908
23909         * assign.cs, literal.cs, constant.cs: Update to new calling
23910         convention. 
23911
23912         * codegen.cs: EmitContext now contains a flag indicating whether
23913         code is being generated in a static method or not.
23914
23915         * cs-parser.jay: DecomposeQI, new function that replaces the old
23916         QualifiedIdentifier.  Now we always decompose the assembled
23917         strings from qualified_identifier productions into a group of
23918         memberaccesses.
23919
23920 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23921
23922         * rootcontext.cs: Deal with field-less struct types correctly now
23923         by passing the size option to Define Type.
23924
23925         * class.cs: Removed hack that created one static field. 
23926
23927 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23928
23929         * statement.cs: Moved most of the code generation here. 
23930
23931 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23932
23933         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23934         seem very right.
23935
23936         (ElementAccess): Remove useless bits for now - keep checks as the spec
23937         says.
23938
23939 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23940
23941         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23942         and start performing checks according to the spec.
23943
23944 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23945
23946         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23947         rank_specifiers instead.
23948
23949         (rank_specifiers): Change the order in which the rank specifiers are stored
23950
23951         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23952
23953         * expression.cs (ElementAccess): Implement the LValue interface too.
23954
23955 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23956
23957         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23958         except that user defined conversions are not included.
23959
23960         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23961         perform the conversion of the return type, if necessary.
23962
23963         (New::DoResolve): Check whether we are creating an array or an object
23964         and accordingly do the needful.
23965
23966         (New::Emit): Same here.
23967
23968         (New::DoResolve): Implement guts of array creation.
23969
23970         (New::FormLookupType): Helper function.
23971
23972 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23973
23974         * codegen.cs: Removed most of the code generation here, and move the
23975         corresponding code generation bits to the statement classes. 
23976
23977         Added support for try/catch/finalize and throw.
23978
23979         * cs-parser.jay: Added support for try/catch/finalize.
23980
23981         * class.cs: Catch static methods having the flags override,
23982         virtual or abstract.
23983
23984         * expression.cs (UserCast): This user cast was not really doing
23985         what it was supposed to do.  Which is to be born in fully resolved
23986         state.  Parts of the resolution were being performed at Emit time! 
23987
23988         Fixed this code.
23989
23990 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23991
23992         * expression.cs: Implicity convert the result from UserCast.
23993
23994 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23995
23996         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23997         prevented it from working correctly. 
23998
23999         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24000         merely ConvertImplicit.
24001
24002 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24003
24004         * typemanager.cs: Make the LookupTypeContainer function static,
24005         and not per-instance.  
24006
24007         * class.cs: Make static FindMembers (the one that takes a Type
24008         argument). 
24009
24010         * codegen.cs: Add EmitForeach here.
24011
24012         * cs-parser.jay: Make foreach a toplevel object instead of the
24013         inline expansion, as we need to perform semantic analysis on it. 
24014
24015 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24016
24017         * expression.cs (Expression::ImplicitUserConversion): Rename to
24018         UserDefinedConversion.
24019
24020         (Expression::UserDefinedConversion): Take an extra argument specifying 
24021         whether we look for explicit user conversions too.
24022
24023         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24024
24025         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24026
24027         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24028         with the appropriate arguments.
24029
24030         * cs-parser.jay (cast_expression): Record location too.
24031
24032         * expression.cs (Cast): Record location info.
24033
24034         (Expression::ConvertExplicit): Take location argument.
24035
24036         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24037         to determine if we are doing explicit conversions.
24038
24039         (UserCast::Emit): Update accordingly.
24040
24041         (Expression::ConvertExplicit): Report an error if everything fails.
24042
24043         * ../errors/cs0030.cs : Add.
24044
24045 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24046
24047         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24048         virtual and newslot bits. 
24049
24050         * class.cs (TypeContainer::RegisterRequiredImplementations):
24051         Record methods we need.
24052
24053         (TypeContainer::MakeKey): Helper function to make keys for
24054         MethodBases, since the Methodbase key is useless.
24055
24056         (TypeContainer::Populate): Call RegisterRequiredImplementations
24057         before defining the methods.   
24058
24059         Create a mapping for method_builders_to_methods ahead of time
24060         instead of inside a tight loop.
24061
24062         (::RequireMethods):  Accept an object as the data to set into the
24063         hashtable so we can report interface vs abstract method mismatch.
24064
24065 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24066
24067         * report.cs: Make all of it static.
24068
24069         * rootcontext.cs: Drop object_type and value_type computations, as
24070         we have those in the TypeManager anyways.
24071
24072         Drop report instance variable too, now it is a global.
24073
24074         * driver.cs: Use try/catch on command line handling.
24075
24076         Add --probe option to debug the error reporting system with a test
24077         suite. 
24078
24079         * report.cs: Add support for exiting program when a probe
24080         condition is reached.
24081
24082 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24083
24084         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24085         we do a forcible conversion regardless of type, to check if 
24086         ForceConversion returns a null.
24087
24088         (Binary::error19): Use location to report error.
24089
24090         (Unary::error23): Use location here too.
24091
24092         * ../errors/cs0019.cs : Check in.
24093
24094         * ../errors/cs0023.cs : Check in.
24095
24096         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24097         case of a non-null MethodInfo object with a length of 0 !
24098
24099         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24100         an applicable member - according to the spec :-)
24101         Also fix logic to find members in base types.
24102
24103         (Unary::ResolveOperator): Same here.
24104
24105         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24106         as I was getting thoroughly confused between this and error19 :-)
24107
24108         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24109         (::FindMostEncompassedType): Implement.
24110         (::FindMostEncompassingType): Implement.
24111         (::StandardConversionExists): Implement.
24112
24113         (UserImplicitCast): Re-vamp. We now need info about most specific
24114         source and target types so that we can do the necessary conversions.
24115
24116         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24117         mathematical union with no duplicates.
24118
24119 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24120
24121         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24122         in order from base classes to child classes, so that we can in
24123         child classes look up in our parent for method names and
24124         attributes (required for handling abstract, virtual, new, override
24125         constructs: we need to instrospect our base class, and if we dont
24126         populate the classes in order, the introspection might be
24127         incorrect.  For example, a method could query its parent before
24128         the parent has any methods and would determine that the parent has
24129         no abstract methods (while it could have had them)).
24130
24131         (RootContext::CreateType): Record the order in which we define the
24132         classes.
24133
24134 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24135
24136         * class.cs (TypeContainer::Populate): Also method definitions can
24137         fail now, keep track of this.
24138
24139         (TypeContainer::FindMembers): Implement support for
24140         DeclaredOnly/noDeclaredOnly flag.
24141
24142         (Constructor::Emit) Return the ConstructorBuilder.
24143
24144         (Method::Emit) Return the MethodBuilder. 
24145         Check for abstract or virtual methods to be public.
24146
24147         * rootcontext.cs (RootContext::CreateType): Register all the
24148         abstract methods required for the class to be complete and the
24149         interface methods that must be implemented. 
24150
24151         * cs-parser.jay: Report error 501 (method requires body if it is
24152         not marked abstract or extern).
24153
24154         * expression.cs (TypeOf::Emit): Implement.
24155
24156         * typemanager.cs: runtime_handle_type, new global type.
24157
24158         * class.cs (Property::Emit): Generate code for properties.
24159
24160 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24161
24162         * expression.cs (Unary::ResolveOperator): Find operators on base type
24163         too - we now conform exactly to the spec.
24164
24165         (Binary::ResolveOperator): Same here.
24166
24167         * class.cs (Operator::Define): Fix minor quirk in the tests.
24168
24169         * ../errors/cs0215.cs : Added.
24170
24171         * ../errors/cs0556.cs : Added.
24172
24173         * ../errors/cs0555.cs : Added.
24174
24175 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24176
24177         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24178         single integer which is really efficient
24179
24180 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24181
24182         *  expression.cs (Expression::ImplicitUserConversion): Use location
24183         even in the case when we are examining True operators.
24184  
24185         * class.cs (Operator::Define): Perform extensive checks to conform
24186         with the rules for operator overloading in the spec.
24187
24188         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24189         some of the other conversions mentioned in the spec.
24190
24191         * typemanager.cs (array_type): New static member for the System.Array built-in
24192         type.
24193
24194         (cloneable_interface): For System.ICloneable interface.
24195
24196         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24197         we start resolving the tree and populating types.
24198
24199         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24200  
24201 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24202
24203         * expression.cs (Expression::ExprClassFromMemberInfo,
24204         Expression::Literalize): Create literal expressions from
24205         FieldInfos which are literals.
24206
24207         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24208         type casts, because they were wrong.  The test suite in tests
24209         caught these ones.
24210
24211         (ImplicitNumericConversion): ushort to ulong requires a widening
24212         cast. 
24213
24214         Int32 constant to long requires widening cast as well.
24215
24216         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24217         for integers because the type on the stack is not i4.
24218
24219 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24220
24221         * expression.cs (report118): require location argument. 
24222
24223         * parameter.cs: Do not dereference potential null value.
24224
24225         * class.cs: Catch methods that lack the `new' keyword when
24226         overriding a name.  Report warnings when `new' is used without
24227         anything being there to override.
24228
24229         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24230
24231         * class.cs: Only add constructor to hashtable if it is non-null
24232         (as now constructors can fail on define).
24233
24234         (TypeManager, Class, Struct): Take location arguments.
24235
24236         Catch field instance initialization in structs as errors.
24237
24238         accepting_filter: a new filter for FindMembers that is static so
24239         that we dont create an instance per invocation.
24240
24241         (Constructor::Define): Catch errors where a struct constructor is
24242         parameterless 
24243
24244         * cs-parser.jay: Pass location information for various new
24245         constructs. 
24246
24247         * delegate.cs (Delegate): take a location argument.
24248
24249         * driver.cs: Do not call EmitCode if there were problesm in the
24250         Definition of the types, as many Builders wont be there. 
24251
24252         * decl.cs (Decl::Decl): Require a location argument.
24253
24254         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24255         into integers, and find the most appropiate integer for it.
24256
24257         * literal.cs: Implement ULongLiteral.
24258
24259         * rootcontext.cs: Provide better information about the location of
24260         failure when CreateType fails.
24261
24262 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24263
24264         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24265         as well.
24266
24267         * expression.cs (Binary::CheckShiftArguments): Add missing type
24268         computation.
24269         (Binary::ResolveOperator): Add type to the logical and and logical
24270         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24271         before.
24272
24273         (Binary::DoNumericPromotions): In the case where either argument
24274         is ulong (and most signed types combined with ulong cause an
24275         error) perform implicit integer constant conversions as well.
24276
24277 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24278
24279         * expression.cs (UserImplicitCast): Method should always be
24280         non-null. 
24281         (Invocation::BetterConversion): Simplified test for IntLiteral.
24282
24283         (Expression::ImplicitNumericConversion): Split this routine out.
24284         Put the code that performs implicit constant integer conversions
24285         here. 
24286
24287         (Expression::Resolve): Become a wrapper around DoResolve so we can
24288         check eclass and type being set after resolve.
24289
24290         (Invocation::Badness): Remove this dead function
24291
24292         (Binary::ResolveOperator): Do not compute the expensive argumnets
24293         unless we have a union for it.
24294
24295         (Probe::Emit): Is needs to do an isinst and then
24296         compare against null.
24297
24298         (::CanConvert): Added Location argument.  If the Location argument
24299         is null (Location.Null), then we do not report errors.  This is
24300         used by the `probe' mechanism of the Explicit conversion.  We do
24301         not want to generate an error for something that the user
24302         explicitly requested to be casted.  But the pipeline for an
24303         explicit cast first tests for potential implicit casts.
24304
24305         So for now, if the Location is null, it means `Probe only' to
24306         avoid adding another argument.   Might have to revise this
24307         strategy later.
24308
24309         (ClassCast): New class used to type cast objects into arbitrary
24310         classes (used in Explicit Reference Conversions).
24311
24312         Implement `as' as well.
24313
24314         Reverted all the patches from Ravi below: they were broken:
24315
24316                 * The use of `level' as a mechanism to stop recursive
24317                   invocations is wrong.  That was there just to catch the
24318                   bug with a strack trace but not as a way of addressing
24319                   the problem.
24320
24321                   To fix the problem we have to *understand* what is going
24322                   on and the interactions and come up with a plan, not
24323                   just get things going.
24324
24325                 * The use of the type conversion cache that I proposed
24326                   last night had an open topic: How does this work across
24327                   protection domains.  A user defined conversion might not
24328                   be public in the location where we are applying the
24329                   conversion, a different conversion might be selected
24330                   (ie, private A->B (better) but public B->A (worse),
24331                   inside A, A->B applies, but outside it, B->A will
24332                   apply).
24333
24334                 * On top of that (ie, even if the above is solved),
24335                   conversions in a cache need to be abstract.  Ie, `To
24336                   convert from an Int to a Short use an OpcodeCast', not
24337                   `To convert from an Int to a Short use the OpcodeCast on
24338                   the variable 5' (which is what this patch was doing).
24339
24340 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24341
24342         * expression.cs (Invocation::ConversionExists): Re-write to use
24343         the conversion cache
24344
24345         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24346         cache all conversions done, not just user-defined ones.
24347
24348         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24349         to determine if a conversion exists instead of acutually trying to 
24350         perform the conversion. It's faster too.
24351
24352         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24353         and only then attempt the implicit conversion.
24354
24355 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24356
24357         * expression.cs (ConvertImplicit): Use a cache for conversions
24358         already found. Check level of recursion and bail out if necessary.
24359
24360 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24361
24362         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24363         Export standard methods that we expect for string operations.
24364
24365         * statement.cs (Block::UsageWarning): Track usage of variables and
24366         report the errors for not used variables.
24367
24368         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24369         operator. 
24370
24371 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24372
24373         * codegen.cs: remove unnneded code 
24374
24375         * expression.cs: Removed BuiltinTypeAccess class
24376
24377         Fix the order in which implicit conversions are
24378         done.  
24379
24380         The previous fixed dropped support for boxed conversions (adding a
24381         test to the test suite now)
24382
24383         (UserImplicitCast::CanConvert): Remove test for source being null,
24384         that code is broken.  We should not feed a null to begin with, if
24385         we do, then we should track the bug where the problem originates
24386         and not try to cover it up here.
24387
24388         Return a resolved expression of type UserImplicitCast on success
24389         rather than true/false.  Ravi: this is what I was talking about,
24390         the pattern is to use a static method as a "constructor" for
24391         objects. 
24392
24393         Also, do not create arguments until the very last minute,
24394         otherwise we always create the arguments even for lookups that
24395         will never be performed. 
24396
24397         (UserImplicitCast::Resolve): Eliminate, objects of type
24398         UserImplicitCast are born in a fully resolved state. 
24399
24400         * typemanager.cs (InitCoreTypes): Init also value_type
24401         (System.ValueType). 
24402
24403         * expression.cs (Cast::Resolve): First resolve the child expression.
24404
24405         (LValue): Add new method AddressOf to be used by
24406         the `&' operator.  
24407
24408         Change the argument of Store to take an EmitContext instead of an
24409         ILGenerator, because things like FieldExpr need to be able to call
24410         their children expression to generate the instance code. 
24411
24412         (Expression::Error, Expression::Warning): Sugar functions for
24413         reporting errors.
24414
24415         (Expression::MemberLookup): Accept a TypeContainer instead of a
24416         Report as the first argument.
24417
24418         (Expression::ResolvePrimary): Killed.  I still want to improve
24419         this as currently the code is just not right.
24420
24421         (Expression::ResolveMemberAccess): Simplify, but it is still
24422         wrong. 
24423
24424         (Unary::Resolve): Catch errors in AddressOf operators.
24425
24426         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24427         index to a byte for the short-version, or the compiler will choose
24428         the wrong Emit call, which generates the wrong data.
24429
24430         (ParameterReference::Emit, ::Store): same.
24431
24432         (FieldExpr::AddressOf): Implement.
24433
24434         * typemanager.cs: TypeManager: made public variable instead of
24435         property.
24436
24437         * driver.cs: document --fatal.
24438
24439         * report.cs (ErrorMessage, WarningMessage): new names for the old
24440         Error and Warning classes.
24441
24442         * cs-parser.jay (member_access): Turn built-in access to types
24443         into a normal simplename
24444
24445 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24446
24447         * expression.cs (Invocation::BetterConversion): Fix to cope
24448         with q being null, since this was introducing a bug.
24449
24450         * expression.cs (ConvertImplicit): Do built-in conversions first.
24451
24452 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24453
24454         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24455
24456 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24457
24458         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24459         I had introduced long ago (what's new ?).
24460
24461         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24462         the work of all the checking. 
24463         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24464         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24465
24466         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24467         that is the right way. 
24468
24469         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24470         overloading resolution. Use everywhere instead of cutting and pasting code.
24471
24472         (Binary::ResolveOperator): Use MakeUnionSet.
24473
24474         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24475         we have to convert to bool types. Not complete yet.
24476
24477 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24478
24479         * typemanager.cs (TypeManager::CSharpName): support ushort.
24480
24481         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24482         to provide an expression that performsn an implicit constant int
24483         conversion (section 6.1.6).
24484         (Expression::ConvertImplicitRequired): Reworked to include
24485         implicit constant expression conversions.
24486
24487         (Expression::ConvertNumericExplicit): Finished.
24488
24489         (Invocation::Emit): If InstanceExpression is null, then it means
24490         that we perform a call on this.
24491
24492 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24493
24494         * expression.cs (Unary::Emit): Remove some dead code.
24495         (Probe): Implement Resolve and Emit for `is'.
24496         (Expression::ConvertImplicitRequired): Attempt to do constant
24497         expression conversions here.  Maybe should be moved to
24498         ConvertImplicit, but I am not sure.
24499         (Expression::ImplicitLongConstantConversionPossible,
24500         Expression::ImplicitIntConstantConversionPossible): New functions
24501         that tell whether is it possible to apply an implicit constant
24502         expression conversion.
24503
24504         (ConvertNumericExplicit): Started work on explicit numeric
24505         conversions.
24506
24507         * cs-parser.jay: Update operator constants.
24508
24509         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24510         (Parameters::GetSignature): Hook up VerifyArgs here.
24511         (Parameters::VerifyArgs): Verifies that no two arguments have the
24512         same name. 
24513
24514         * class.cs (Operator): Update the operator names to reflect the
24515         ones that the spec expects (as we are just stringizing the
24516         operator names).
24517
24518         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24519         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24520         previous usage did only work for our methods.
24521         (Expression::ConvertImplicit): Handle decimal implicit numeric
24522         conversions as well.
24523         (Expression::InternalTypeConstructor): Used to invoke constructors
24524         on internal types for default promotions.
24525
24526         (Unary::Emit): Implement special handling for the pre/post
24527         increment/decrement for overloaded operators, as they need to have
24528         the same semantics as the other operators.
24529
24530         (Binary::ResolveOperator): ditto.
24531         (Invocation::ConversionExists): ditto.
24532         (UserImplicitCast::Resolve): ditto.
24533
24534 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24535
24536         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24537         operator, return after emitting body. Regression tests pass again !
24538
24539         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24540         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24541         (Invocation::OverloadResolve): Ditto.
24542         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24543
24544         * everywhere : update calls to the above methods accordingly.
24545
24546 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24547
24548         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24549
24550         * expression.cs (ExpressionStatement): New base class used for
24551         expressions that can appear in statements, so that we can provide
24552         an alternate path to generate expression that do not leave a value
24553         on the stack.
24554
24555         (Expression::Emit, and all the derivatives): We no longer return
24556         whether a value is left on the stack or not.  Every expression
24557         after being emitted leaves a single value on the stack.
24558
24559         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24560         facilties of ExpressionStatement if possible.
24561
24562         * cs-parser.jay: Update statement_expression.
24563
24564 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24565
24566         * driver.cs: Change the wording of message
24567
24568 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24569
24570         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24571         the type of the expression to the return type of the method if
24572         we have an overloaded operator match ! The regression tests pass again !
24573         (Unary::ResolveOperator): Ditto.
24574
24575         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24576         to find "op_Implicit", not "implicit" ;-)
24577         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24578         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24579
24580         * everywhere : Correct calls to the above accordingly.
24581
24582         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24583         (ConvertImplicit): Do user-defined conversion if it exists.
24584
24585 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24586
24587         * assign.cs: track location.
24588         (Resolve): Use implicit conversions on assignment.
24589
24590         * literal.cs: Oops.  Not good, Emit of short access values should
24591         pass (Bytes) or the wrong argument will be selected.
24592
24593         * expression.cs (Unary::Emit): Emit code for -expr.
24594
24595         (Unary::ResolveOperator): Handle `Substract' for non-constants
24596         (substract from zero from the non-constants).
24597         Deal with Doubles as well. 
24598
24599         (Expression::ConvertImplicitRequired): New routine that reports an
24600         error if no implicit conversion exists. 
24601
24602         (Invocation::OverloadResolve): Store the converted implicit
24603         expressions if we make them
24604
24605 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24606
24607         * class.cs (ConstructorInitializer): Take a Location argument.
24608         (ConstructorBaseInitializer): Same here.
24609         (ConstructorThisInitializer): Same here.
24610
24611         * cs-parser.jay : Update all calls accordingly.
24612
24613         * expression.cs (Unary, Binary, New): Take location argument.
24614         Update accordingly everywhere.
24615
24616         * cs-parser.jay : Update all calls to the above to take a location
24617         argument.
24618
24619         * class.cs : Ditto.
24620
24621 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24622
24623         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24624         (Invocation::BetterConversion): Same here
24625         (Invocation::ConversionExists): Ditto.
24626
24627         (Invocation::ConversionExists): Implement.
24628
24629 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24630
24631         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24632         Also take an additional TypeContainer argument.
24633
24634         * All over : Pass in TypeContainer as argument to OverloadResolve.
24635
24636         * typemanager.cs (CSharpName): Update to check for the string type and return
24637         that too.
24638
24639         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24640         a given method.
24641
24642 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24643
24644         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24645         (Invocation::BetterFunction): Implement.
24646         (Invocation::BetterConversion): Implement.
24647         (Invocation::ConversionExists): Skeleton, no implementation yet.
24648
24649         Okay, things work fine !
24650
24651 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24652
24653         * typemanager.cs: declare and load enum_type, delegate_type and
24654         void_type. 
24655
24656         * expression.cs (Expression::Emit): Now emit returns a value that
24657         tells whether a value is left on the stack or not.  This strategy
24658         might be reveted tomorrow with a mechanism that would address
24659         multiple assignments.
24660         (Expression::report118): Utility routine to report mismatches on
24661         the ExprClass.
24662
24663         (Unary::Report23): Report impossible type/operator combination
24664         utility function.
24665
24666         (Unary::IsIncrementableNumber): Whether the type can be
24667         incremented or decremented with add.
24668         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24669         complemented. 
24670         (Unary::ResolveOperator): Implement ++, !, ~,
24671
24672         (Invocation::Emit): Deal with new Emit convetion.
24673
24674         * All Expression derivatives: Updated their Emit method to return
24675         whether they leave values on the stack or not.
24676
24677         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24678         stack for expressions that are statements. 
24679
24680 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24681
24682         * expression.cs (LValue): New interface.  Must be implemented by
24683         LValue objects.
24684         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24685         LValue interface.
24686
24687         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24688         interface for generating code, simplifies the code.
24689
24690 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24691
24692         * expression.cs (everywhere): Comment out return statements in ::Resolve
24693         methods to avoid the warnings.
24694
24695 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24696
24697         * driver.cs (parse): Report error 2001 if we can not open the
24698         source file.
24699
24700         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24701         not resolve it.
24702
24703         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24704         object. 
24705
24706         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24707         otherwise nested blocks end up with the same index.
24708
24709         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24710
24711         * expression.cs:  Instead of having FIXMEs in the Resolve
24712         functions, throw exceptions so it is obvious that we are facing a
24713         bug. 
24714
24715         * cs-parser.jay (invocation_expression): Pass Location information.
24716
24717         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24718         Use a basename for those routines because .NET does not like paths
24719         on them. 
24720
24721         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24722         already defined.
24723
24724 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24725
24726         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24727         are loading the correct data types (throws an exception if not).
24728         (TypeManager::InitCoreTypes): Use CoreLookupType
24729
24730         * expression.cs (Unary::ResolveOperator): return the child
24731         expression for expressions which are just +expr.
24732         (Unary::ResolveOperator): Return negative literals for -LITERAL
24733         expressions (otherwise they are Unary {Literal}).
24734         (Invocation::Badness): Take into account `Implicit constant
24735         expression conversions'.
24736
24737         * literal.cs (LongLiteral): Implement long literal class.
24738         (IntLiteral): export the `Value' of the intliteral. 
24739
24740 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24741
24742         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24743
24744         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24745         instead of 'Operator'
24746
24747         * expression.cs (Binary::ResolveOperator): Update accordingly.
24748         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24749         and 'Minus'
24750
24751         * cs-parser.jay (unary_expression): Update to use the new names.
24752
24753         * gen-treedump.cs (GetUnary): Same here.
24754
24755         * expression.cs (Unary::Resolve): Implement.
24756         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24757         operators are found instead of making noise ;-)
24758         (Unary::ResolveOperator): New method to do precisely the same thing which
24759         Binary::ResolveOperator does for Binary expressions.
24760         (Unary.method, .Arguments): Add.
24761         (Unary::OperName): Implement.   
24762         (Unary::ForceConversion): Copy and Paste !
24763
24764         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24765         a unary operator.
24766
24767         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24768         for the inbuilt operators. Only overloading works for now ;-)
24769
24770 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24771
24772         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24773         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24774
24775         * expression.cs (This::Emit): Implement. 
24776         (This::Resolve): Implement.
24777         (TypeOf:Resolve): Implement.
24778         (Expression::ResolveSimpleName): Add an implicit this to instance
24779         field references. 
24780         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24781         Bind instance variable to Field expressions.
24782         (FieldExpr::Instance): New field used to track the expression that
24783         represents the object instance.
24784         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24785         binding 
24786         (FieldExpr::Emit): Implement.
24787
24788         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24789         the last instruction contains a return opcode to avoid generating
24790         the last `ret' instruction (this generates correct code, and it is
24791         nice to pass the peverify output).
24792
24793         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24794         initializer for static and instance variables.
24795         (Constructor::Emit): Allow initializer to be null in the case of
24796         static constructors.  Only emit initializer for instance
24797         constructors. 
24798
24799         (TypeContainer::FindMembers): Return a null array if there are no
24800         matches.
24801
24802         Also fix the code for the MemberTypes.Method branch, as it was not
24803         scanning that for operators (or tried to access null variables before).
24804
24805         * assign.cs (Assign::Emit): Handle instance and static fields. 
24806
24807         * TODO: Updated.
24808
24809         * driver.cs: Stop compilation if there are parse errors.
24810
24811         * cs-parser.jay (constructor_declaration): Provide default base
24812         initializer for non-static constructors.
24813         (constructor_declarator): Do not provide a default base
24814         initializers if none was specified.
24815         Catch the fact that constructors should not have parameters.
24816
24817         * class.cs: Do not emit parent class initializers for static
24818         constructors, that should be flagged as an error.
24819
24820 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24821
24822         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24823         Move back code into TypeContainer::Populate.
24824
24825 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24826
24827         * class.cs (TypeContainer::AddConstructor): Fix the check to
24828         compare against Name, not Basename. 
24829         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24830
24831         * cs-parser.jay : Update accordingly.
24832
24833         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24834         for methods, don't forget to look into the operators too.
24835         (RegisterMethodBuilder): Helper method to take care of this for
24836         methods, constructors and operators.
24837         (Operator::Define): Completely revamp.
24838         (Operator.OperatorMethod, MethodName): New fields.
24839         (TypeContainer::Populate): Move the registering of builders into
24840         RegisterMethodBuilder.
24841         (Operator::Emit): Re-write.
24842
24843         * expression.cs (Binary::Emit): Comment out code path to emit method
24844         invocation stuff for the case when we have a user defined operator. I am
24845         just not able to get it right !
24846
24847 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24848
24849         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24850         argument. 
24851
24852         (Expression::MemberLookup): Provide a version that allows to
24853         specify the MemberTypes and BindingFlags. 
24854
24855         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24856         so it was not fetching variable information from outer blocks.
24857
24858         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24859         Beforefieldinit as it was buggy.
24860
24861         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24862         that Ravi put here.  
24863
24864         * class.cs (Constructor::Emit): Only emit if block is not null.
24865         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24866         deal with this by semantically definining it as if the user had
24867         done it.
24868
24869         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24870         constructors as we now "emit" them at a higher level.
24871
24872         (TypeContainer::DefineDefaultConstructor): Used to define the
24873         default constructors if none was provided.
24874
24875         (ConstructorInitializer): Add methods Resolve and Emit. 
24876
24877         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24878
24879 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24880
24881         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24882         the default constructor builder with our hashtable for methodbuilders
24883         to methodcores.
24884
24885         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24886         and argument_count is 0 in which case we have a match.
24887         (Binary::ResolveOperator): More null checking and miscellaneous coding
24888         style cleanup.
24889
24890 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24891
24892         * rootcontext.cs (IsNameSpace): Compare against null.
24893
24894         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24895
24896         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24897         and Unary::Operator.
24898
24899         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24900         accordingly.
24901
24902         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24903         we have overloaded operators.
24904         (Binary::ResolveOperator): Implement the part which does the operator overload
24905         resolution.
24906
24907         * class.cs (Operator::Emit): Implement.
24908         (TypeContainer::Emit): Emit the operators we have too.
24909
24910         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24911         the case when we have a user-defined operator.
24912
24913 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24914
24915         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24916
24917 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24918
24919         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24920         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24921         (Constructor::Emit): Implement.
24922         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24923         if we have no work to do. 
24924         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24925         Emit method.
24926
24927         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24928         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24929
24930         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24931         of parent.parent.
24932
24933 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24934
24935         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24936         in the source.
24937         (Tree::RecordNamespace): Method to do what the name says ;-)
24938         (Tree::Namespaces): Property to get at the namespaces hashtable.
24939
24940         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24941         keep track.
24942
24943         * rootcontext.cs (IsNamespace): Fixed it :-)
24944
24945 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24946
24947         * class.cs (TypeContainer::FindMembers): Add support for
24948         constructors. 
24949         (MethodCore): New class that encapsulates both the shared aspects
24950         of a Constructor and a Method.  
24951         (Method, Constructor): Factored pieces into MethodCore.
24952
24953         * driver.cs: Added --fatal which makes errors throw exceptions.
24954         Load System assembly as well as part of the standard library.
24955
24956         * report.cs: Allow throwing exceptions on errors for debugging.
24957
24958         * modifiers.cs: Do not use `parent', instead use the real type
24959         container to evaluate permission settings.
24960
24961         * class.cs: Put Ravi's patch back in.  He is right, and we will
24962         have to cope with the
24963
24964 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24965
24966         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24967         FamORAssem, not FamANDAssem.
24968
24969 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24970
24971         * driver.cs: Added --parse option that only parses its input files
24972         and terminates.
24973
24974         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24975         incorrect.  IsTopLevel is not used to tell whether an object is
24976         root_types or not (that can be achieved by testing this ==
24977         root_types).  But to see if this is a top-level *class* (not
24978         necessarly our "toplevel" container). 
24979
24980 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24981
24982         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24983         parent instead of a direct call to GetType.
24984
24985 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24986
24987         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24988         Modifiers.TypeAttr. This should just be a call to that method.
24989
24990         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24991         object so that we can determine if we are top-level or not.
24992
24993         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24994         TypeContainer too.
24995
24996         * enum.cs (Enum::Define): Ditto.
24997
24998         * modifiers.cs (FieldAttr): Re-write.
24999
25000         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25001         (TypeContainer::HaveStaticConstructor): New property to provide access
25002         to precisely that info.
25003
25004         * modifiers.cs (MethodAttr): Re-write.
25005         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25006
25007         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25008         of top-level types as claimed.
25009
25010 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25011
25012         * expression.cs (MemberLookup): Fruitless attempt to lookup
25013         constructors.  Maybe I need to emit default constructors?  That
25014         might be it (currently .NET emits this for me automatically).
25015         (Invocation::OverloadResolve): Cope with Arguments == null.
25016         (Invocation::EmitArguments): new function, shared by the new
25017         constructor and us.
25018         (Invocation::Emit): Handle static and instance methods.  Emit
25019         proper call instruction for virtual or non-virtual invocations.
25020         (New::Emit): Implement.
25021         (New::Resolve): Implement.
25022         (MemberAccess:Resolve): Implement.
25023         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25024         to track instances.
25025         (FieldExpr::Resolve): Set type.
25026
25027         * support.cs: Handle empty arguments.
25028                 
25029         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25030         SimpleLookup): Auxiliary routines to help parse a qualifier
25031         identifier.  
25032
25033         Update qualifier_identifier rule.
25034
25035         * codegen.cs: Removed debugging messages.
25036
25037         * class.cs: Make this a global thing, this acts just as a "key" to
25038         objects that we might have around.
25039
25040         (Populate): Only initialize method_builders_to_methods once.
25041
25042         * expression.cs (PropertyExpr): Initialize type from the
25043         PropertyType. 
25044
25045         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25046         Resolve pattern.  Attempt to implicitly convert value to boolean.
25047         Emit code.
25048
25049         * expression.cs: Set the type for the int32/int32 argument case.
25050         (Binary::ResolveOperator): Set the return type to boolean for
25051         comparission operators
25052
25053         * typemanager.cs: Remove debugging print code.
25054
25055         (Invocation::Resolve): resolve type.
25056
25057         * class.cs: Allocate a MemberInfo of the correct size, as the code
25058         elsewhere depends on the test to reflect the correct contents.
25059
25060         (Method::) Keep track of parameters, due to System.Reflection holes
25061
25062         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25063         mapping here.
25064
25065         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25066         of the exact size and return that.
25067
25068         (Class::LookupMethodByBuilder): New function that maps
25069         MethodBuilders to its methods.  Required to locate the information
25070         on methods because System.Reflection bit us again.
25071
25072         * support.cs: New file, contains an interface ParameterData and
25073         two implementations: ReflectionParameters and InternalParameters
25074         used to access Parameter information.  We will need to grow this
25075         as required.
25076
25077         * expression.cs (Invocation::GetParameterData): implement a cache
25078         and a wrapper around the ParameterData creation for methods. 
25079         (Invocation::OverloadResolve): Use new code.
25080
25081 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25082
25083         * class.cs (TypeContainer::EmitField): Remove and move into 
25084         (Field::Define): here and modify accordingly.
25085         (Field.FieldBuilder): New member.
25086         (TypeContainer::Populate): Update accordingly.
25087         (TypeContainer::FindMembers): Implement.
25088
25089 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25090
25091         * statement.cs: (VariableInfo::VariableType): New field to be
25092         initialized with the full type once it is resolved. 
25093
25094 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25095
25096         * parameter.cs (GetParameterInfo): Use a type cache to compute
25097         things only once, and to reuse this information
25098
25099         * expression.cs (LocalVariableReference::Emit): Implement.
25100         (OpcodeCast::Emit): fix.
25101
25102         (ParameterReference::Resolve): Implement.
25103         (ParameterReference::Emit): Implement.
25104
25105         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25106         that are expressions need to stay as Expressions.
25107
25108         * typemanager.cs (CSharpName): Returns the C# name of a type if
25109         possible. 
25110
25111         * expression.cs (Expression::ConvertImplicit): New function that
25112         implements implicit type conversions.
25113
25114         (Expression::ImplicitReferenceConversion): Implements implicit
25115         reference conversions.
25116
25117         (EmptyCast): New type for transparent casts.
25118
25119         (OpcodeCast): New type for casts of types that are performed with
25120         a sequence of bytecodes.
25121
25122         (BoxedCast): New type used for casting value types into reference
25123         types.  Emits a box opcode.
25124
25125         (Binary::DoNumericPromotions): Implements numeric promotions of
25126         and computation of the Binary::Type.
25127
25128         (Binary::EmitBranchable): Optimization.
25129
25130         (Binary::Emit): Implement code emission for expressions.
25131
25132         * typemanager.cs (TypeManager): Added two new core types: sbyte
25133         and byte.
25134
25135 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25136
25137         * class.cs (TypeContainer::FindMembers): Method which does exactly
25138         what Type.FindMembers does, only we don't have to use reflection. No
25139         implementation yet.
25140
25141         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25142         typecontainer objects as we need to get at them.
25143         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25144
25145         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25146         typecontainer object.
25147
25148         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25149         of just a Report object.
25150
25151 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25152
25153         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25154         "remove_"
25155         (TypeContainer::Populate): Now define the delegates of the type too.
25156         (TypeContainer.Delegates): Property to access the list of delegates defined
25157         in the type.
25158
25159         * delegates.cs (Delegate::Define): Implement partially.
25160
25161         * modifiers.cs (TypeAttr): Handle more flags.
25162
25163 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25164
25165         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25166         and not <=
25167         (Operator::Define): Re-write logic to get types by using the LookupType method
25168         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25169         (Indexer::Define): Ditto.
25170         (Event::Define): Ditto.
25171         (Property::Define): Ditto.
25172
25173 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25174
25175         * class.cs (TypeContainer::Populate): Now define operators too. 
25176         (TypeContainer.Operators): New property to access the list of operators
25177         in a type.
25178         (Operator.OperatorMethodBuilder): New member to hold the method builder
25179         for the operator we are defining.
25180         (Operator::Define): Implement.
25181
25182 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25183
25184         * class.cs (Event::Define): Make the prefixes of the accessor methods
25185         addOn_ and removeOn_ 
25186
25187         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25188         of the location being passed in too. Ideally, this should go later since all
25189         error reporting should be done through the Report object.
25190
25191         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25192         (Populate): Iterate thru the indexers we have and define them too.
25193         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25194         for the get and set accessors.
25195         (Indexer::Define): Implement.
25196
25197 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25198
25199         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25200         my previous implementation, did not work.
25201
25202         * typemanager.cs: Add a couple of missing types (the longs).
25203
25204         * literal.cs: Use TypeManager.bool_type instead of getting it.
25205
25206         * expression.cs (EventExpr): New kind of expressions.
25207         (Expressio::ExprClassFromMemberInfo): finish
25208
25209 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25210
25211         * assign.cs: Emit stores to static fields differently.
25212
25213 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25214
25215         * Merge in changes and adjust code to tackle conflicts. Backed out my
25216         code in Assign::Resolve ;-) 
25217
25218 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25219
25220         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25221         instead Report.Error and also pass in the location.
25222         (CSharpParser::Lexer): New readonly property to return the reference
25223         to the Tokenizer object.
25224         (declare_local_variables): Use Report.Error with location instead of plain 
25225         old error.
25226         (CheckDef): Ditto.
25227
25228         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25229         (Operator.CheckBinaryOperator): Ditto.
25230
25231         * cs-parser.jay (operator_declarator): Update accordingly.
25232
25233         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25234         (CheckBinaryOperator): Same here.
25235
25236         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25237         on the name without any prefixes of namespace names etc. This is because we
25238         already might have something already fully qualified like 
25239         'System.Console.WriteLine'
25240
25241         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25242
25243 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25244
25245         * cs-tokenizer.cs (location): Return a string which also contains
25246         the file name.
25247
25248         * expression.cs (ElementAccess): New class for expressions of the
25249         type 'element access.'
25250         (BaseAccess): New class for expressions of the type 'base access.'
25251         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25252         respectively.
25253
25254         * cs-parser.jay (element_access): Implement action.
25255         (base_access): Implement actions.
25256         (checked_expression, unchecked_expression): Implement.
25257
25258         * cs-parser.jay (local_variable_type): Correct and implement.
25259         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25260
25261         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25262
25263         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25264         name and the specifiers.
25265
25266         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25267
25268         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25269         making them all public ;-)
25270
25271         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25272         class anyways.
25273
25274 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25275
25276         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25277         PropertyExprs.
25278         (FieldExpr, PropertyExprs): New resolved expressions.
25279         (SimpleName::MemberStaticCheck): Perform static checks for access
25280         to non-static fields on static methods. Maybe this should be
25281         generalized for MemberAccesses. 
25282         (SimpleName::ResolveSimpleName): More work on simple name
25283         resolution. 
25284
25285         * cs-parser.jay (primary_expression/qualified_identifier): track
25286         the parameter index.
25287
25288         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25289         (EmitContext::EmitBoolExpression): Chain to expression generation
25290         instead of temporary hack.
25291         (::EmitStatementExpression): Put generic expression code generation.
25292
25293         * assign.cs (Assign::Emit): Implement variable assignments to
25294         local variables, parameters and fields.
25295
25296 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25297
25298         * statement.cs (Block::GetVariableInfo): New method, returns the
25299         VariableInfo for a variable name in a block.
25300         (Block::GetVariableType): Implement in terms of GetVariableInfo
25301
25302         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25303         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25304
25305 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25306
25307         * cs-parser.jay (operator_declaration): Continue on my quest : update
25308         to take attributes argument.
25309         (event_declaration): Ditto.
25310         (enum_declaration): Ditto.
25311         (indexer_declaration): Ditto.
25312
25313         * class.cs (Operator::Operator): Update constructor accordingly.
25314         (Event::Event): Ditto.
25315
25316         * delegate.cs (Delegate::Delegate): Same here.
25317
25318         * enum.cs (Enum::Enum): Same here.
25319
25320 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25321
25322         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25323
25324         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25325
25326         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25327         being passed around as an arraylist.
25328         (Attributes::AddAttribute): Method to add attribute sections.
25329
25330         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25331         (struct_declaration): Update accordingly.
25332         (constant_declaration): Update.
25333         (field_declaration): Update.
25334         (method_header): Update.
25335         (fixed_parameter): Update.
25336         (parameter_array): Ditto.
25337         (property_declaration): Ditto.
25338         (destructor_declaration): Ditto.
25339
25340         * class.cs (Struct::Struct): Update constructors accordingly.
25341         (Class::Class): Ditto.
25342         (Field::Field): Ditto.
25343         (Method::Method): Ditto.
25344         (Property::Property): Ditto.
25345         (TypeContainer::OptAttribute): update property's return type.
25346
25347         * interface.cs (Interface.opt_attributes): New member.
25348         (Interface::Interface): Update to take the extra Attributes argument.
25349
25350         * parameter.cs (Parameter::Parameter): Ditto.
25351
25352         * constant.cs (Constant::Constant): Ditto.
25353
25354         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25355         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25356         the attributes as a parameter.
25357         (InterfaceProperty): Update constructor call.
25358         (InterfaceEvent): Ditto.
25359         (InterfaceMethod): Ditto.
25360         (InterfaceIndexer): Ditto.
25361
25362         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25363         pass the attributes too.
25364         (interface_event_declaration): Ditto.
25365         (interface_property_declaration): Ditto.
25366         (interface_method_declaration): Ditto.
25367         (interface_declaration): Ditto.
25368
25369 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25370
25371         * class.cs (Method::Define): Track the "static Main" definition to
25372         create an entry point. 
25373
25374         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25375         EntryPoint if we find it. 
25376
25377         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25378         (EmitContext::ig): Make this variable public.
25379
25380         * driver.cs: Make the default output file be the first file name
25381         with the .exe extension.  
25382
25383         Detect empty compilations
25384
25385         Handle various kinds of output targets.  Handle --target and
25386         rename -t to --dumper.
25387
25388         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25389         methods inherited from Expression return now an Expression.  This
25390         will is used during the tree rewriting as we resolve them during
25391         semantic analysis.
25392
25393         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25394         the spec.  Missing entirely is the information about
25395         accessability of elements of it.
25396
25397         (Expression::ExprClassFromMemberInfo): New constructor for
25398         Expressions that creates a fully initialized Expression based on
25399         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25400         a Type.
25401
25402         (Invocation::Resolve): Begin implementing resolution of invocations.
25403
25404         * literal.cs (StringLiteral):  Implement Emit.
25405
25406 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25407
25408         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25409         member.
25410
25411 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25412
25413         * cs-parser.jay (attribute_arguments): Implement actions.
25414         (attribute): Fix bug in production. Implement action.
25415         (attribute_list): Implement.
25416         (attribute_target): Implement.
25417         (attribute_target_specifier, opt_target_specifier): Implement
25418         (CheckAttributeTarget): New method to check if the attribute target
25419         is valid.
25420         (attribute_section): Implement.
25421         (opt_attributes): Implement.
25422
25423         * attribute.cs : New file to handle attributes.
25424         (Attribute): Class to hold attribute info.
25425
25426         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25427         (attribute_section): Modify production to use 2 different rules to 
25428         achieve the same thing. 1 s/r conflict down !
25429         Clean out commented, useless, non-reducing dimension_separator rules.
25430
25431         * class.cs (TypeContainer.attributes): New member to hold list
25432         of attributes for a type.
25433         (Struct::Struct): Modify to take one more argument, the attribute list.
25434         (Class::Class): Ditto.
25435         (Field::Field): Ditto.
25436         (Method::Method): Ditto.
25437         (Property::Property): Ditto.
25438
25439         * cs-parser.jay (struct_declaration): Update constructor call to
25440         pass in the attributes too.
25441         (class_declaration): Ditto.
25442         (constant_declaration): Ditto.
25443         (field_declaration): Ditto.
25444         (method_header): Ditto.
25445         (fixed_parameter): Ditto.
25446         (parameter_array): Ditto.
25447         (property_declaration): Ditto.
25448
25449         * constant.cs (Constant::Constant): Update constructor similarly.
25450         Use System.Collections.
25451
25452         * parameter.cs (Parameter::Parameter): Update as above.
25453
25454 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25455
25456         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25457         (TypeContainer.delegates): New member to hold list of delegates.
25458
25459         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25460         this time as I seem to be on crack ;-)
25461
25462 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25463
25464         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25465         tell whether an identifier represents a namespace.
25466
25467         * expression.cs (NamespaceExpr): A namespace expression, used only
25468         temporarly during expression resolution.
25469         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25470         utility functions to resolve names on expressions.
25471
25472 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25473
25474         * codegen.cs: Add hook for StatementExpressions. 
25475
25476         * class.cs: Fix inverted test for static flag in methods.
25477
25478 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25479
25480         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25481         to make it coincide with MS' number.
25482         (Operator::CheckBinaryOperator): Ditto.
25483
25484         * ../errors/errors.txt : Remove error numbers added earlier.
25485
25486         * ../errors/cs1019.cs : Test case for error # 1019
25487
25488         * ../errros/cs1020.cs : Test case for error # 1020
25489
25490         * cs-parser.jay : Clean out commented cruft.
25491         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25492         used anywhere - non-reducing rule.
25493         (namespace_declarations): Non-reducing rule - comment out.
25494
25495         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25496         with TypeContainer::AddEnum.
25497
25498         * delegate.cs : New file for delegate handling classes.
25499         (Delegate): Class for declaring delegates.
25500
25501         * makefile : Update.
25502
25503         * cs-parser.jay (delegate_declaration): Implement.
25504
25505 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25506
25507         * class.cs (Event::Define): Implement.
25508         (Event.EventBuilder): New member.
25509
25510         * class.cs (TypeContainer::Populate): Update to define all enums and events
25511         we have.
25512         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25513         readonly fields for all these cases ?
25514
25515 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25516
25517         * class.cs (Property): Revamp to use the convention of making fields readonly.
25518         Accordingly modify code elsewhere.
25519
25520         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25521         the Define method of the Property class.
25522
25523         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25524         trivial bug.
25525         (TypeContainer::Populate): Update to define all the properties we have. Also
25526         define all enumerations.
25527
25528         * enum.cs (Define): Implement.
25529
25530 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25531
25532         * cs-parser.jay (overloadable_operator): The semantic value is an
25533         enum of the Operator class.
25534         (operator_declarator): Implement actions.
25535         (operator_declaration): Implement.
25536
25537         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25538         validity of definitions.
25539         (Operator::CheckBinaryOperator): Static method to check for binary operators
25540         (TypeContainer::AddOperator): New method to add an operator to a type.
25541
25542         * cs-parser.jay (indexer_declaration): Added line to actually call the
25543         AddIndexer method so it gets added ;-)
25544
25545         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25546         already taken care of by the MS compiler ?  
25547
25548 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25549
25550         * class.cs (Operator): New class for operator declarations.
25551         (Operator::OpType): Enum for the various operators.
25552
25553 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25554
25555         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25556         ostensibly handle this in semantic analysis.
25557
25558         * cs-parser.jay (general_catch_clause): Comment out
25559         (specific_catch_clauses, specific_catch_clause): Ditto.
25560         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25561         (catch_args, opt_catch_args): New productions.
25562         (catch_clause): Rewrite to use the new productions above
25563         (catch_clauses): Modify accordingly.
25564         (opt_catch_clauses): New production to use in try_statement
25565         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25566         and re-write the code in the actions to extract the specific and
25567         general catch clauses by being a little smart ;-)
25568
25569         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25570         Hooray, try and catch statements parse fine !
25571
25572 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25573
25574         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25575         string from the hashtable of variables.
25576
25577         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25578         I end up making that mistake ;-)
25579         (catch_clauses): Fixed gross error which made Key and Value of the 
25580         DictionaryEntry the same : $1 !!
25581
25582 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25583
25584         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25585
25586         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25587         when the add and remove accessors are specified. 
25588
25589 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25590
25591         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25592         information about indexer_declarator.
25593         (indexer_declarator): Implement actions.
25594         (parsing_indexer): New local boolean used to keep track of whether
25595         we are parsing indexers or properties. This is necessary because 
25596         implicit_parameters come into picture even for the get accessor in the 
25597         case of an indexer.
25598         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25599
25600         * class.cs (Indexer): New class for indexer declarations.
25601         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25602         (TypeContainer::indexers): New member to hold list of indexers for the
25603         type.
25604
25605 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25606
25607         * cs-parser.jay (add_accessor_declaration): Implement action.
25608         (remove_accessor_declaration): Implement action.
25609         (event_accessors_declaration): Implement
25610         (variable_declarators): swap statements for first rule - trivial.
25611
25612         * class.cs (Event): New class to hold information about event
25613         declarations.
25614         (TypeContainer::AddEvent): New method to add an event to a type
25615         (TypeContainer::events): New member to hold list of events.
25616
25617         * cs-parser.jay (event_declaration): Implement actions.
25618
25619 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25620
25621         * cs-parser.jay (dim_separators): Implement. Make it a string
25622         concatenating all the commas together, just as they appear.
25623         (opt_dim_separators): Modify accordingly
25624         (rank_specifiers): Update accordingly. Basically do the same
25625         thing - instead, collect the brackets here.
25626         (opt_rank_sepcifiers): Modify accordingly.
25627         (array_type): Modify to actually return the complete type string
25628         instead of ignoring the rank_specifiers.
25629         (expression_list): Implement to collect the expressions
25630         (variable_initializer): Implement. We make it a list of expressions
25631         essentially so that we can handle the array_initializer case neatly too.
25632         (variable_initializer_list): Implement.
25633         (array_initializer): Make it a list of variable_initializers
25634         (opt_array_initializer): Modify accordingly.
25635
25636         * expression.cs (New::NType): Add enumeration to help us
25637         keep track of whether we have an object/delegate creation
25638         or an array creation.
25639         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25640         members to hold data about array creation.
25641         (New:New): Modify to update NewType
25642         (New:New): New Overloaded contructor for the array creation
25643         case.
25644
25645         * cs-parser.jay (array_creation_expression): Implement to call
25646         the overloaded New constructor.
25647
25648 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25649
25650         * class.cs (TypeContainer::Constructors): Return member
25651         constructors instead of returning null.
25652
25653 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25654
25655         * typemanager.cs (InitCoreTypes): Initialize the various core
25656         types after we have populated the type manager with the user
25657         defined types (this distinction will be important later while
25658         compiling corlib.dll)
25659
25660         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25661         on Expression Classification.  Now all expressions have a method
25662         `Resolve' and a method `Emit'.
25663
25664         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25665         generation from working.     Also add some temporary debugging
25666         code. 
25667
25668 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25669
25670         * codegen.cs: Lots of code generation pieces.  This is only the
25671         beginning, will continue tomorrow with more touches of polish.  We
25672         handle the fundamentals of if, while, do, for, return.  Others are
25673         trickier and I need to start working on invocations soon.
25674
25675         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25676         s.InitStatement. 
25677
25678         * codegen.cs (EmitContext): New struct, used during code
25679         emission to keep a context.   Most of the code generation will be
25680         here. 
25681
25682         * cs-parser.jay: Add embedded blocks to the list of statements of
25683         this block.  So code generation proceeds in a top down fashion.
25684
25685 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25686
25687         * statement.cs: Add support for multiple child blocks.
25688
25689 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25690
25691         * codegen.cs (EmitCode): New function, will emit the code for a
25692         Block of code given a TypeContainer and its ILGenerator. 
25693
25694         * statement.cs (Block): Standard public readonly optimization.
25695         (Block::Block constructors): Link children. 
25696         (Block::Child): Child Linker.
25697         (Block::EmitVariables): Emits IL variable declarations.
25698
25699         * class.cs: Drop support for MethodGroups here, delay until
25700         Semantic Analysis.
25701         (Method::): Applied the same simplification that I did before, and
25702         move from Properties to public readonly fields.
25703         (Method::ParameterTypes): Returns the parameter types for the
25704         function, and implements a cache that will be useful later when I
25705         do error checking and the semantic analysis on the methods is
25706         performed.
25707         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25708         and made a method, optional argument tells whether this is a class
25709         or a structure to apply the `has-this' bit.
25710         (Method::GetCallingConvention): Implement, returns the calling
25711         convention. 
25712         (Method::Define): Defines the type, a second pass is performed
25713         later to populate the methods.
25714
25715         (Constructor::ParameterTypes): implement a cache similar to the
25716         one on Method::ParameterTypes, useful later when we do semantic
25717         analysis. 
25718
25719         (TypeContainer::EmitMethod):  New method.  Emits methods.
25720
25721         * expression.cs: Removed MethodGroup class from here.
25722
25723         * parameter.cs (Parameters::GetCallingConvention): new method.
25724
25725 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25726
25727         * class.cs (TypeContainer::Populate): Drop RootContext from the
25728         argument. 
25729
25730         (Constructor::CallingConvention): Returns the calling convention.
25731         (Constructor::ParameterTypes): Returns the constructor parameter
25732         types. 
25733
25734         (TypeContainer::AddConstructor): Keep track of default constructor
25735         and the default static constructor.
25736
25737         (Constructor::) Another class that starts using `public readonly'
25738         instead of properties. 
25739
25740         (Constructor::IsDefault): Whether this is a default constructor. 
25741
25742         (Field::) use readonly public fields instead of properties also.
25743
25744         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25745         track of static constructors;  If none is used, turn on
25746         BeforeFieldInit in the TypeAttributes. 
25747
25748         * cs-parser.jay (opt_argument_list): now the return can be null
25749         for the cases where there are no arguments. 
25750
25751         (constructor_declarator): If there is no implicit `base' or
25752         `this', then invoke the default parent constructor. 
25753
25754         * modifiers.cs (MethodAttr): New static function maps a set of
25755         modifiers flags into a MethodAttributes enum
25756         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25757         MethodAttr, TypeAttr to represent the various mappings where the
25758         modifiers are used.
25759         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25760
25761 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25762
25763         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25764         method arguments.
25765
25766         * interface.cs (PopulateIndexer): Implemented the code generator
25767         for interface indexers.
25768
25769 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25770
25771         * interface.cs (InterfaceMemberBase): Now we track the new status
25772         here.  
25773
25774         (PopulateProperty): Implement property population.  Woohoo!  Got
25775         Methods and Properties going today. 
25776
25777         Removed all the properties for interfaces, and replaced them with
25778         `public readonly' fields. 
25779
25780 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25781
25782         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25783         initialize their hashtables/arraylists only when they are needed
25784         instead of doing this always.
25785
25786         * parameter.cs: Handle refs and out parameters.
25787
25788         * cs-parser.jay: Use an ArrayList to construct the arguments
25789         instead of the ParameterCollection, and then cast that to a
25790         Parameter[] array.
25791
25792         * parameter.cs: Drop the use of ParameterCollection and use
25793         instead arrays of Parameters.
25794
25795         (GetParameterInfo): Use the Type, not the Name when resolving
25796         types. 
25797
25798 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25799
25800         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25801         and instead use public readonly fields.
25802
25803         * class.cs: Put back walking code for type containers.
25804
25805 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25806
25807         * class.cs (MakeConstant): Code to define constants.
25808
25809         * rootcontext.cs (LookupType): New function.  Used to locate types 
25810
25811
25812 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25813
25814         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25815         this System.Reflection code is.  Kudos to Microsoft
25816
25817         * typemanager.cs: Implement a type cache and avoid loading all
25818         types at boot time.  Wrap in LookupType the internals.  This made
25819         the compiler so much faster.  Wow.  I rule!
25820
25821         * driver.cs: Make sure we always load mscorlib first (for
25822         debugging purposes, nothing really important).
25823
25824         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25825         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25826
25827         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25828         on namespaces that have been imported using the `using' keyword.
25829
25830         * class.cs (TypeContainer::TypeAttr): Virtualize.
25831         (Class::TypeAttr): Return attributes suitable for this bad boy.
25832         (Struct::TypeAttr): ditto.
25833         Handle nested classes.
25834         (TypeContainer::) Remove all the type visiting code, it is now
25835         replaced with the rootcontext.cs code
25836
25837         * rootcontext.cs (GetClassBases): Added support for structs. 
25838
25839 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25840
25841         * interface.cs, statement.cs, class.cs, parameter.cs,
25842         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25843         Drop use of TypeRefs, and use strings instead.
25844
25845 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25846
25847         * rootcontext.cs: 
25848
25849         * class.cs (Struct::Struct): set the SEALED flags after
25850         checking the modifiers.
25851         (TypeContainer::TypeAttr): new property, returns the
25852         TypeAttributes for a class.  
25853
25854         * cs-parser.jay (type_list): Oops, list production was creating a
25855         new list of base types.
25856
25857         * rootcontext.cs (StdLib): New property.
25858         (GetInterfaceTypeByName): returns an interface by type name, and
25859         encapsulates error handling here.
25860         (GetInterfaces): simplified.
25861         (ResolveTree): Encapsulated all the tree resolution here.
25862         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25863         types. 
25864
25865         * driver.cs: Add support for --nostdlib, to avoid loading the
25866         default assemblies.
25867         (Main): Do not put tree resolution here. 
25868
25869         * rootcontext.cs: Beginning of the class resolution.
25870
25871 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25872
25873         * rootcontext.cs: Provide better error reporting. 
25874
25875         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25876
25877         * rootcontext.cs (CreateInterface): Handle the case where there
25878         are no parent interfaces.
25879
25880         (CloseTypes): Routine to flush types at the end.
25881         (CreateInterface): Track types.
25882         (GetInterfaces): Returns an array of Types from the list of
25883         defined interfaces.
25884
25885         * typemanager.c (AddUserType): Mechanism to track user types (puts
25886         the type on the global type hash, and allows us to close it at the
25887         end). 
25888
25889 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25890
25891         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25892         RecordInterface instead.
25893
25894         * cs-parser.jay: Updated to reflect changes above.
25895
25896         * decl.cs (Definition): Keep track of the TypeBuilder type that
25897         represents this type here.  Not sure we will use it in the long
25898         run, but wont hurt for now.
25899
25900         * driver.cs: Smaller changes to accomodate the new code.
25901
25902         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25903         when done. 
25904
25905         * rootcontext.cs (CreateInterface):  New method, used to create
25906         the System.TypeBuilder type for interfaces.
25907         (ResolveInterfaces): new entry point to resolve the interface
25908         hierarchy. 
25909         (CodeGen): Property, used to keep track of the code generator.
25910
25911 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25912
25913         * cs-parser.jay: Add a second production for delegate_declaration
25914         with `VOID'.
25915
25916         (enum_body): Put an opt_comma here instead of putting it on
25917         enum_body or enum_member_declarations so we can handle trailing
25918         commas on enumeration members.  Gets rid of a shift/reduce.
25919
25920         (type_list): Need a COMMA in the middle.
25921
25922         (indexer_declaration): Tell tokenizer to recognize get/set
25923
25924         * Remove old targets.
25925
25926         * Re-add the parser target.
25927
25928 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25929
25930         * cs-parser.jay: Add precendence rules for a number of operators
25931         ot reduce the number of shift/reduce conflicts in the grammar.
25932
25933 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25934
25935         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25936         and put it here.
25937
25938         Get rid of old crufty code.
25939
25940         * rootcontext.cs: Use this to keep track of the parsed
25941         representation and the defined types available to the program. 
25942
25943         * gen-treedump.cs: adjust for new convention.
25944
25945         * type.cs: Split out the type manager, and the assembly builder
25946         from here. 
25947
25948         * typemanager.cs: the type manager will live here now.
25949
25950         * cil-codegen.cs: And the code generator here. 
25951
25952 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25953
25954         * makefile: Fixed up for easy making.
25955
25956 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25957
25958         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25959         the 
25960
25961         (unary_expression): Expand pre_increment_expression and
25962         post_decrement_expression to reduce a shift/reduce.
25963
25964 2001-07-11  Simon Cozens
25965
25966         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25967
25968         Improve allow_keyword_as_indent name.
25969
25970 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25971
25972         * Adjustments for Beta2. 
25973
25974 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25975
25976         * decl.cs: Added `Define' abstract method.
25977         (InTransit): new property, used to catch recursive definitions. 
25978
25979         * interface.cs: Implement `Define'. 
25980
25981         * modifiers.cs: Map Modifiers.constants to
25982         System.Reflection.TypeAttribute flags.
25983
25984         * class.cs: Keep track of types and user-defined types.
25985         (BuilderInit): New method for creating an assembly
25986         (ResolveType): New function to launch the resolution process, only
25987         used by interfaces for now.
25988
25989         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25990         that are inserted into the name space. 
25991
25992 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25993
25994         * ARGH.  I have screwed up my tree so many times due to the use of
25995         rsync rather than using CVS.  Going to fix this at once. 
25996
25997         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25998         load types.
25999
26000 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26001
26002         * Experiment successful: Use System.Type rather that our own
26003         version of Type.  
26004
26005 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26006
26007         * cs-parser.jay: Removed nsAliases from here.
26008
26009         Use new namespaces, handle `using XXX;' 
26010
26011         * namespace.cs: Reimplemented namespace handling, use a recursive
26012         definition of the class.  Now we can keep track of using clauses
26013         and catch invalid using clauses.
26014
26015 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26016
26017         * gen-treedump.cs: Adapted for all the renaming.
26018
26019         * expression.cs (Expression): this class now has a Type property
26020         which returns an expression Type.
26021
26022         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26023         `Type', as this has a different meaning now in the base
26024
26025 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26026
26027         * interface.cs, class.cs: Removed from all the sources the
26028         references to signature computation, as we can not do method
26029         signature computation during the parsing time, as we are not
26030         trying to solve at that point distinguishing:
26031
26032         class X {
26033                 void a (Blah x) {}
26034                 void a (NS.Blah x) {}
26035         }
26036
26037         Which depending on the context might be valid or not, as we do not
26038         know if Blah is the same thing as NS.Blah at that point.
26039
26040         * Redid everything so the code uses TypeRefs now instead of
26041         Types.  TypeRefs are just temporary type placeholders, that need
26042         to be resolved.  They initially have a pointer to a string and the
26043         current scope in which they are used.  This is used later by the
26044         compiler to resolve the reference to an actual Type. 
26045
26046         * DeclSpace is no longer a CIR.Type, and neither are
26047         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26048         are all DeclSpaces, but no Types. 
26049
26050         * type.cs (TypeRefManager): This implements the TypeRef manager,
26051         which keeps track of all the types that need to be resolved after
26052         the parsing has finished. 
26053
26054 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26055
26056         * ARGH.  We are going to have to store `foreach' as a class rather
26057         than resolving it, as we need to verify error 1579 after name
26058         resolution.   *OR* we could keep a flag that says `This request to
26059         IEnumerator comes from a foreach statement' which we can then use
26060         to generate the error.
26061
26062 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26063
26064         * class.cs (TypeContainer.AddMethod): we now add methods to the
26065         MethodGroup instead of the method hashtable.  
26066
26067         * expression.cs: Add MethodGroup abstraction, which gets us one
26068         step closer to the specification in the way we handle method
26069         declarations.  
26070
26071         * cs-parser.jay (primary_expression): qualified_identifier now
26072         tried to match up an identifier to a local variable reference or
26073         to a parameter reference.
26074
26075         current_local_parameters is now a parser global variable that
26076         points to the current parameters for the block, used during name
26077         lookup.
26078
26079         (property_declaration): Now creates an implicit `value' argument to
26080         the set accessor.
26081
26082 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26083
26084         * parameter.cs: Do not use `param' arguments as part of the
26085         signature, per the spec.
26086
26087 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26088
26089         * decl.cs: Base class for classes, structs and interfaces.  This
26090         is the "Declaration Space" 
26091
26092         * cs-parser.jay: Use CheckDef for checking declaration errors
26093         instead of having one on each function.
26094
26095         * class.cs: Factor out some code for handling error handling in
26096         accordance to the "Declarations" section in the "Basic Concepts"
26097         chapter in the ECMA C# spec.
26098
26099         * interface.cs: Make all interface member classes derive from
26100         InterfaceMemberBase.
26101
26102 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26103
26104         * Many things: all interfaces are parsed and generated in
26105         gen-treedump.  Support for member variables, constructors,
26106         destructors, properties, constants is there.
26107
26108         Beginning of the IL backend, but very little done, just there for
26109         testing purposes. 
26110
26111 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26112
26113         * cs-parser.jay: Fix labeled statement.
26114
26115         * cs-tokenizer.cs (escape): Escape " and ' always.
26116         ref_line, ref_name: keep track of the line/filename as instructed
26117         by #line by the compiler.
26118         Parse #line.
26119
26120 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26121
26122         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26123         to match the values in System.CodeDOM.
26124
26125         Divid renamed to Divide.
26126
26127         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26128         statements. 
26129         (Statements.set): remove.
26130
26131         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26132         statements. 
26133
26134         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26135         falseStatements always have valid values. 
26136
26137         * cs-parser.jay: Use System.CodeDOM now.
26138