* mcs/flowanalysis.cs (UsageVector.IsDirty): Remove.
[mono.git] / mcs / gmcs / ChangeLog
1 2006-05-11  Raja R Harinath  <rharinath@novell.com>
2
3         * flowanalysis.cs (UsageVector.IsDirty): Remove.
4         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
5         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6         (UsageVector.ToString): Simplify.
7         (UsageVector.MergeSiblings): Move here from ...
8         (FlowBranching.Merge): ... here.
9         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
10         not a MyBitVector.
11
12 2006-05-10  Raja R Harinath  <rharinath@novell.com>
13
14         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
15         null bitvector is treated as all-true.
16
17         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
18         (MyBitVector): Rationalize invariants.  'vector != null' implies
19         that we have our own copy of the bitvector.  Otherwise,
20         'InheritsFrom == null' implies all inherited bits are true.
21
22 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
23
24         * statement.cs (LocalInfo): Add IsConstant.
25         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
26         local variable for constants.
27
28 2006-05-09  Raja R Harinath  <rharinath@novell.com>
29
30         * flowanalysis.cs (MyBitVector.Empty): New.
31         (MyBitVector): Don't allow InheritedFrom to be null.
32         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
33         (UsageVector, FlowBranching): Update to changes.
34
35         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
36         recursion.  The 'Parent == null' condition isn't sufficient for
37         anonymous methods.
38         (FlowBranching.AddBreakOrigin): Likewise.
39         (FlowBranching.AddContinueOrigin): Likewise.
40         (FlowBranching.AddReturnOrigin): Likewise.
41         (FlowBranching.StealFinallyClauses): Likewise.
42         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
43         (FlowBranching.CheckOutParameters): Likewise.
44         (FlowBranchingToplevel): Terminate all the above recursions here.
45         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
46         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
47
48         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
49         toplevel block.
50         (FlowBranchingToplevel): New.  Empty for now.
51         (FlowBranching.MergeTopBlock): Update.
52         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
53         branching for the anonymous delegate.
54         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
55
56         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
57         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
58         information at the start of the merge.  Reorganize.
59
60 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
61
62         * class.cs (MethodData.Define): Method cannot implement interface accessor.
63
64 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
65
66         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
67         to newly introduced ctor.
68
69         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
70         message to one place.
71         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
72         global namespace.
73
74 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
75
76         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
77
78         * ecore.cs (Expression.ResolveAsConstant): Updated.
79
80         * statement.cs (ResolveMeta): Updated.
81
82 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
83
84         * cs-parser.jay: __arglist cannot be used in initializer.
85
86 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
87
88         A fix for #77879
89         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
90         private types.
91
92 2006-05-05  Raja R Harinath  <rharinath@novell.com>
93
94         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
95         (LabeledStatement): Add 'name' parameter.
96         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
97         (Block.AddLabel): Update to changes.
98         * cs-parser.jay (labeled_statement): Likewise.
99
100         * flowanalysis.cs (BranchingType.Labeled): New.
101         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
102         (FlowBranchingLabeled): New.  Does nothing for now, but will
103         eventually handle 'goto' flows.
104         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
105         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
106         that's terminated ...
107         (Block.Resolve): ... here.
108
109         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
110         (UsageVector.MergeFinallyOrigins): Likewise.
111         (FlowBranching.InTryOrCatch): Likewise.
112         (FlowBranching.AddFinallyVector): Likewise.
113         (FlowBranchingException): Update to changes.
114
115         Fix #78290
116         * statement.cs (Return.Resolve): Move error checking to ...
117         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
118         (FlowBranchingException): Handle return origins like break and
119         continue origins.
120         (FlowBranching.UsageVector.CheckOutParameters): Remove.
121
122 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
123
124         A fix for #76122
125         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
126         filter.
127
128 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
129
130         A fix for #77543
131         * class.cs (MethodData.Define): Do public accessor check only when method
132         implements an interface.
133
134 2006-05-04  Raja R Harinath  <rharinath@novell.com>
135
136         Remove special handling of 'break'
137         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
138         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
139         (UsageVector.Break): Remove.
140         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
141         reachability.
142         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
143
144         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
145         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
146
147 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
148
149         A fix for #75726
150         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
151         be the interface member.
152
153 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
154
155         A fix for #60069
156         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
157         for emitting small (int) values.
158
159 2006-05-03  Raja R Harinath  <rharinath@novell.com>
160
161         Fix #59427
162         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
163         control-flow passes through the 'finally' after merging-in all the
164         control-flows from 'try' and the 'catch' clauses.
165
166         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
167         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
168         always true at the only non-recursive entry point.
169         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
170         FlowBranchingBreakable.
171         (FlowBranchingLoop): Remove.
172         * statement.cs (Return.DoResolve): Update to changes.
173
174         Fix #76471, #76665
175         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
176         (FlowBranching.CreateBranching): Handle it: create a
177         FlowBranchingContinuable.
178         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
179         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
180         except that it handles the 'continue' command.
181         (FlowBranching.UsageVector.MergeOrigins): Rename from
182         MergeBreakOrigins.
183         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
184         except that it overrides AddContinueOrigin.
185         (FlowBranchingException): Override AddContinueOrigin, similar to
186         AddBreakOrigin.
187         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
188         Create a new branching around the embedded statement.
189         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
190         control flow after the embedded statement.
191         (Continue.Resolve): Move all error checking to AddContinueOrigin.
192
193         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
194         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
195         FlowBranchingBreakable.
196         (FlowBranchingSwitch): Remove.
197
198         Fix test-503.cs
199         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
200         error reporting to ...
201         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
202         Rename from 'AddBreakVector'.  Add new location argument.  Return
203         a bool indicating whether the 'break' crosses an unwind-protect.
204         (FlowBranchingException.AddBreakOrigin): Add.
205         (FlowBranchingException.Merge): Propagate 'break's to surrounding
206         flowbranching after updating with the effects of the 'finally'
207         clause.
208         (FlowBranchingBreakable): New common base class for
209         FlowBranchingLoop and FlowBranchingSwitch.
210
211         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
212         embedded statement.
213         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
214
215 2006-05-02  Raja R Harinath  <rharinath@novell.com>
216
217         * statement.cs (Do.Resolve): If the loop is infinite, set the
218         barrier.
219         (While.Resolve, For.Resolve): Set a barrier after the embedded
220         statement.  There's no direct control flow that goes from the end
221         of the embedded statement to the end of the loop.
222         * flowanalysis.cs (FlowBranching.Infinite): Remove.
223         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
224         above ensure that the reachability is correctly computed.
225
226         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
227         (UsageVector.MergeBreakOrigins): If the current path is
228         unreachable, treat it as if all parameters/locals are initialized.
229         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
230         infinite loops before merging-in break origins.
231
232         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
233         (Reachability.Reachable): Split part into ...
234         (Reachability.Unreachable): ... this.  Simplify.
235         (Reachability.IsUnreachable): Use 'Unreachable' instead.
236
237         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
238         (Reachability.SetThrowsSometimes): Likewise.
239         (FlowBranchingBlock.MergeTopBlock): Don't compare against
240         TriState.Always, use corresponding property.
241         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
242         (Block.Resolve): Likewise.  Remove some redundant checks.
243
244 2006-05-02  Raja R Harinath  <harinath@gmail.com>
245
246         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
247         (Reachability.Meet): Don't bother checking AlwaysThrows --
248         barrier is always set.
249         (FlowBranchingBlock.Merge): Likewise.
250
251 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
252
253         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
254         defined, so it's references should also compile only for NET_2_0
255         (as occurs in mcs version)
256
257 2006-05-01  Raja R Harinath  <harinath@gmail.com>
258
259         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
260         checks for unreachable.
261
262 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
263
264         A fix for #77980
265         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
266
267         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
268         whether field is really assigned.
269
270 2006-04-30  Raja R Harinath  <harinath@gmail.com>
271
272         * flowanalysis.cs (Reachability): Make 4-argument constructor
273         private.
274         (Reachability.Meet): Rename from 'And'.  Remove static variant.
275         (Reachability.Always): Rename from the highly misleading
276         'Reachability.Never'.
277         (FlowBranching.Merge): Update to changes.  Mark an impossible
278         situation with a 'throw'.
279         (*): Update to changes.
280
281 2006-04-29  Raja R Harinath  <harinath@gmail.com>
282
283         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
284         Remove 'Undefined'.
285         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
286         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
287         (*): Update to changes.
288         * statement.cs: Update to changes.
289
290 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
291
292         A fix for #78049
293         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
294
295 2006-04-28  Raja R Harinath  <harinath@gmail.com>
296
297         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
298         dummy UsageVector.
299
300         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
301         argument to two arguments: an usage-vector and a bool.  Move call
302         to FlowBranching.Merge () ...
303         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
304
305         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
306         handling of loop and switch reachability to ...
307         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
308
309 2006-04-27  Raja R Harinath  <harinath@gmail.com>
310
311         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
312         handling to FlowBranchingLoop.InLoop.
313         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
314
315 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
316
317         A fix for #78115
318         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
319         anonymous method is allowed from AnonymousContainer here.
320
321         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
322
323 2006-04-24  Raja R Harinath  <rharinath@novell.com>
324
325         Fix #78156
326         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
327
328 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
329
330         A fix for #49011.
331         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
332         (DoubleConstant.Reduce): Ditto.
333
334 2006-04-23  Raja R Harinath  <rharinath@novell.com>
335
336         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
337         Remove 'lvalue_right_side' argument.  Move parts to ...
338         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
339         (LocalVariable.DoResolveLValue): ... these.
340
341 2006-04-21  Raja R Harinath  <rharinath@novell.com>
342
343         Fix cs1655.cs
344         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
345         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
346         (LocalVariableReference.DoResolveBase): Use it to implement new
347         CS1655 check.
348         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
349         (Argument.Resolve): Simplify.  Move CS1510 check ...
350         * ecore.cs (Expression.ResolveLValue): ... here.
351         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
352         (PropertyExpr.DoResolveLValue): Likewise.
353         (FieldExpr.Report_AssignToReadonly): Likewise.
354         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
355         LValueMemberAccess or LValueMemberOutAccess on instance depending
356         on it.
357         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
358         DoResolve as appropriate.
359
360 2006-04-20  Raja R Harinath  <rharinath@novell.com>
361
362         Fix #75800
363         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
364         implicit conversions on 'out' and 'ref' arguments.
365
366         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
367         improve clarity.  Remove dead code.
368
369         Fix #66031
370         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
371         (Catch.Resolve): Resolve VarBlock if it exists.
372
373 2006-04-19  Miguel de Icaza  <miguel@novell.com>
374
375         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
376         twice, this was some residual code, the enumerator was emitted
377         properly in the two branche of if later.
378
379         Fixes #78031
380         
381         Thanks to Martin for finding the source of the problem
382         
383 2006-04-19  Raja R Harinath  <rharinath@novell.com>
384
385         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
386         cast is never an lvalue.
387         (Cast.DoResolve, Cast.ResolveRest): Combine.
388         (Argument.Emit): Simplify slightly.  Move 'Expr is
389         IMemoryLocation' check ...
390         (Argument.Resolve): ... here.
391         (Argument.Error_LValueRequired): Remove.  Inline into only user.
392
393         Simplifications.  Fix cs0191-2.cs
394         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
395         CS1649 and CS1651 to ...
396         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
397         the actual selection of the error code and message to a lookup
398         table.  Add a dummy return value to simplify callsites.
399         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
400         readonly fields of other instances of the same type.  Move CS0197
401         warning from ...
402         * expression.cs (Argument.Resolve): ... here.  Simplify code.
403         Ensure that ec.InRefOutArgumentResolving is only set during LValue
404         resolution of an out or ref argument.  The code simplification
405         above uses this invariant.
406
407 2006-04-18  Raja R Harinath  <rharinath@novell.com>
408
409         Possibly fix #77752.  Fix cs1690-[4-7].cs.
410         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
411         CheckMarshallByRefAccess.  Drop parameter.
412         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
413         warning.
414         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
415         InstanceExpression.
416         * report.cs (AllWarnings): Add CS1690.
417         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
418         for ref access too.
419         (LocalVariableReference.DoResolveBase): Update.
420
421 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
422
423         * class.cs (MethodOrOperator): Moved common parts from method class.
424         detect obsolete attributes.
425         (Method.Define): Simplified as it reuses code from base.
426         (Constructor.ValidAttributeTargets): Fixed issue found during
427         refactoring.
428         (Destructor.ValidAttributeTargets): Fixed issue found during
429         refactoring.
430         (Operator): Finished refactoring set off by #78020. Operator class is now
431         ordinary method class.
432
433         * anonymous.cs: Updated.
434
435 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
436
437         * class.cs (Constructor.Emit): Don't emit the attributes twice.
438
439 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
440
441         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
442         detect obsolete attributes.
443         (Method.CreateEmitContext): Moved to MethodOrOperator.
444
445 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
446
447         A fix for #78048.
448         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
449         customized exception to make crash detection easier.
450         (MethodOrOperator): Started to work on new base class for methods and
451         operators.
452         (Method): Derives from MethodOrOperator.
453         (Constructor.Emit): Emits its own attributes.
454         (AbstractPropertyEventMethod.Emit): Ditto.
455         (Operator): Derives from MethodOrOperator, will refactor fully in extra
456         patch.
457         (Operator.Emit): It's temporary more tricky than should be.
458         
459         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
460
461         * report.cs (InternalErrorException): Add ctor with inner exception.
462
463 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
464
465         A fix for #76744.
466         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
467         only not visible.
468
469 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
470
471         A fix for #77916.
472         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
473         array.
474
475 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
476
477         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
478         attribute is present and Guid not.
479         (Interface.ApplyAttributeBuilder): Ditto.
480
481         * attribute.cs: Add error message.
482
483 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
484
485         A fix for #78020.
486
487         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
488         sources (it's composite) so hold them in extra array as they are used in
489         Emit phase only. It worked in the previous versions by mistake.
490         (Attribute.Emit): Emit attribute for more owners when exist.
491
492         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
493         it has now different behaviour.
494
495 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
496
497         * constant.cs (Constant.IsDefaultInitializer): New method.
498
499         * class.cs: Updated.
500
501         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
502         re-initialize default values. It saves KBs almost for every assembly.
503         Thanks Zoltan for the idea.
504         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
505         (ArrayCreation.DoResolve): Resolve only once.
506         (ArrayCreation.Emit): Emit static initializer only when it is faster.
507         (ArrayCreation.GetAttributableValue): Cope with optimized values.
508
509 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
510
511         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
512         From #77961.
513
514 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
515
516         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
517         in an embedded statement too.
518
519 2006-04-01  Raja R Harinath  <rharinath@novell.com>
520
521         Fix #77929
522         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
523         testing.
524
525         Fix #77958
526         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
527
528         Fix #77962
529         * report.cs (SymbolRelatedToPreviousError): Drop generic type
530         arguments before checking whether a type is reflected or not.
531
532         Fix #77954
533         * expression.cs (Invocation.IsApplicable): Ensure a generic method
534         definition doesn't take part in overload resolution.
535         (Invocation.IsParamsMethodApplicable): Likewise.
536         (Invocation.OverloadResolve): When replacing a reflected override
537         method with its base definition, ensure that type arguments are
538         applied.
539
540 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
541
542         A fix for #77966.
543
544         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
545         was not specified.
546
547         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
548
549 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
550
551         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
552         phase.
553
554         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
555         LocalTemporary change.
556
557         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
558         TypeContainer.
559         (ClassOrStruct.DefineFieldInitializers): Implemented static field
560         initializers optimization.
561         (ClassOrStruct.TypeAttr): Moved from modifiers.
562         (Constructor.CheckBase): Don't crash when static ctor has parameters.
563         (FieldBase.ResolveInitializer): Resolves initializer.
564         (FieldBase.HasDefaultInitializer): New property.
565
566         * cs-parser.jay: Removed message.
567
568         * expression.cs (CompilerGeneratedThis): New specialization.
569
570         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
571
572 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
573
574         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
575
576 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
577
578         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
579         be now EnumConstants only.
580
581 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
582
583         * attribute.cs, driver.cs: Reset more caches.
584
585 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
586
587         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
588
589 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
590
591         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
592         for easier reuse. Updated all overrides.
593         (IntegralConstant): New base class for all integral constants.
594         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
595         of the constant range, report custom error.
596         (UIntConstant.Reduce): Fixed uint conversion.
597
598         * ecore.cs, literal.cs: Reduce updates.
599
600 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
601
602         A fix for #75813.
603
604         * class.cs (Constructor.Define): Removed extra if for default ctors.
605         A patch from Atsushi Enomoto.
606
607 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
608
609         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
610         GetAttributableValue.
611
612         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
613         when required.
614
615         * convert.cs (ImplicitConversionRequired): Error message moved to
616         DoubleLiteral.
617
618         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
619         automatic implicit conversion of an output value.
620         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
621
622         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
623         conversion.
624         (TypeOf.GetAttributableValue): Add extra handling for object type.
625
626         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
627         special error message.
628
629 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
630
631         * class.cs (Constructor.Emit): Don't crash when struct ctor is
632         InternalCall.
633         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
634         compatible with MS runtime.
635
636 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
637
638         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
639         attribute arguments here.
640
641         * class.cs (Indexer.Define): The check was moved to attribute class.
642
643 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
644
645         * expression.cs (StringConcat.Append): Reverted back to no warning state.
646
647 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
648
649         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
650
651         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
652         the blocks too.
653
654 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
655
656         * doc-bootstrap.cs : fix build.
657
658 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
659
660         * expression.cs (StringConcat.Append): Issue a warning when empty string
661         is going to append.
662
663 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
664
665         * assign.cs (CompoundAssign.ResolveSource): Removed.
666
667         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
668         clean up.
669
670         * class.cs (TypeContainer.FindMethods): Removed.
671         (TypeContainer.CheckMemberUsage): Made static.
672
673         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
674
675         * constant.cs (CheckRange): Removed unused type argument.
676         (CheckUnsigned): Removed unused type argument.
677
678         * cs-parser.jay: Updated after MemberAccess clean up.
679         Uses Length for empty string test.
680
681         * cs-tokenizer.cs: Uses Length for empty string test.
682         (IsCastToken): Made static.
683         (is_hex): Made static.
684         (real_type_suffix): Made static.
685
686         * decl.cs (SetupCache): Made static.
687         (OnGenerateDocComment): Removed unused ds argument.
688
689         * delegate.cs (VerifyDelegate): Removed unused argument.
690
691         * doc.cs: Uses Length for empty string test.
692
693         * driver.cs: Uses Length for empty string test.
694
695         * enum.cs (IsValidEnumType): Made static
696
697         * expression.cs (EnumLiftUp): Removed unused argument.
698         (ResolveMethodGroup): Ditto.
699         (BetterConversion): Ditto.
700         (GetVarargsTypes): Ditto.
701         (UpdateIndices): Ditto.
702         (ValidateInitializers): Ditto.
703         (MemberAccess.ctor): Ditto.
704         (GetIndexersForType): Ditto.
705
706         * flowanalysis.cs: (MergeFinally): Removed unused argument.
707
708         * iterators.cs: Updated after MemberAccess clean up.
709
710         * location.cs: Uses Length for empty string test.
711
712         * namespace.cs: Uses Length for empty string test.
713
714          * report.cs (CheckWarningCode): Made static.
715
716         * statement.cs (LabeledStatement): Removed unused argument.
717
718         * typemanager.cs (FilterNone): Removed.
719
720 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
721
722         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
723         obsolete.
724
725         * class.cs: Updated.
726
727 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
728
729         * cs-parser.jay.cs: __arglist is not allowed for delegates.
730
731 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
732
733         A fix for #77816.
734
735         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
736         host container.
737         (AnonymousMethod.ImplicitStandardConversionExists): New method.
738         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
739         Add more error reporting; Fixed issue with params.
740
741         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
742
743         * cs-parser.jay: AnonymousMethod requires host container.
744
745         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
746
747 2006-03-18  Raja R Harinath  <harinath@gmail.com>
748
749         * class.cs: Change 'TypeContainer ds' constructor argument to
750         'DeclSpace parent'.  Some classes were missed below due to
751         different naming convention.
752
753         * class.cs (MemberCore.Parent): Delete.  This makes the
754         ParentContainer changes below enforceable by the compiler.
755
756         Treat pointers to enclosing declaration space as 'DeclSpace', not
757         'TypeContainer'.
758         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
759         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
760
761         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
762         of TypeContainer.
763         (Block.AddThisVariable): Likewise.
764         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
765         (AbstractPropertyEventMethod.Emit): Likewise.
766         (AbstractPropertyEventMethod.EmitMethod): Likewise.
767         (GetMethod.Define, SetMethod.Define): Likewise.
768         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
769         (DelegateMethod.EmitMethod): Likewise.
770
771         Fix regression test-partial-13.cs.
772         Rationalize use of PartialContainer.  Ensure that the partial
773         class semantics can be tied to type-correctness, i.e., any
774         violation will cause a compile error.
775         * class.cs, const.cs: Access all fields that belong to class
776         TypeContainer via ParentContainer.  Arguments of EmitContexts and
777         Resolve()-like functions still use 'Parent'.
778
779         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
780         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
781         (PropertyMethod.CheckModifiers): Remove unused argument.
782         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
783         DeclSpace.
784
785 2006-03-28  Raja R Harinath  <rharinath@novell.com>
786
787         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
788
789 2006-03-17  Raja R Harinath  <harinath@gmail.com>
790
791         Make semantics of PartialContainer simpler.
792         * decl.cs (DeclSpace.IsPartial): Remove.
793         * class.cs (TypeContainer.IsPartial): Likewise.
794         (TypeContainer..ctor): Set PartialContainer to point to self.
795         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
796         (TypeContainer.FindNestedType): Likewise.
797         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
798
799 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
800
801         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
802
803 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
804
805         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
806         classes.
807
808 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
809
810         * class.cs (Operator.Define): An error for base conversion was not
811         reported correctly.
812
813 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
814
815         A fix for #77593, #77574.
816
817         * class.cs (MethodCore.CheckBase): Another if for operator.
818
819 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
820
821         A fix for #77822.
822
823         * expression.cs (VerifyArgumentsCompat): Reverted to double error
824         reporting, it's more tricky than I thought.
825
826 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
827
828         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
829         were not resolved
830
831         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
832         (DelegateCreation.ImplicitStandardConversionExists): New method for just
833         conversion test.
834         
835         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
836         not needed.
837
838 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
839
840         A fix for #77353.
841
842         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
843         (Event.Define): ditto
844         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
845
846         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
847         Removed redundant code and set NewSlot for Invoke method too.
848
849         * parameter.cs (Parameters.ctor): Add custom, type ctor.
850         (Parameters.MergeGenerated): New method. Use this method when you merge
851         compiler generated argument with user arguments.
852
853 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
854
855         * attribute.cs (ResolveAsTypeTerminal): Removed.
856
857         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
858         specialization for predefined types; 30% speed up.
859         Finally placed obsolete check to right place.
860         (Expression.ResolveType): Removed.
861
862         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
863         Updated after ResolveType was removed.
864
865         * expression.cs (Cast.ctor): Check void cast.
866         (Binary.ResolveAsTypeTerminal): Is never type.
867         (Conditional.ResolveAsTypeTerminal): Is never type.
868
869         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
870
871 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
872
873         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
874
875 2006-03-23  Martin Baulig  <martin@ximian.com>
876
877         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
878         type check if either of the types is an open generic type.
879
880 2006-03-23  Martin Baulig  <martin@ximian.com>
881
882         * convert.cs
883         (Convert.ExplicitTypeParameterConversion): New method; implement
884         explicit type parameter conversions.
885
886 2006-03-23  Martin Baulig  <martin@ximian.com>
887
888         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
889         blindly allow all conversions if we do not have any constraints.
890
891 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
892
893         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
894         these two separated members to simplify the code.
895         (Attribute.Resolve): Refactored to use new fields and methods.
896         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
897         implemented obsolete attribute checking.
898         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
899         implemented obsolete checking again. It look line never ending quest ;-)
900         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
901
902         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
903
904         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
905
906         *class.cs (Property.Define): Add RegisterProperty call.
907
908         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
909         argument groups (only 2).
910
911         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
912         encoding expression to arguments.
913         (Expression.ExprClassToResolveFlags): Just turned to property.
914
915         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
916         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
917         optimized as well as implemented support for zero-length attributes.
918
919         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
920         Add caching of PropertyInfo's.
921
922 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
923
924         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
925         error multiple times.
926
927 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
928
929         New partial class implementation.
930         A fix for #77027, #77029, #77403
931
932         * attribute.cs (Attributable): Made attributes protected.
933
934         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
935         the replacements of ClassPart and PartialContainer.
936         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
937         (TypeContainer.AddInterface): Ditto.
938         (TypeContainer.AddPartial): The main method for partial classes. It checks
939         for errors and merges ModFlags and attributes. At the end class is added to
940         partial_parts list.
941         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
942         required here.
943         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
944         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
945         from the rest of partial classes.
946         (TypeContainer.GetClassBases): Simplified.
947         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
948         DefineType.
949         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
950         (TypeContainer.HasExplicitLayout): Uses Flags now.
951         (PartialContainer): Removed.
952         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
953         (StaticClass): Was merged with Class.
954         (Class.GetClassBases): class and static class bases are verified here.
955         (Class.TypeAttr): Added static attributes when class is static.
956         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
957         (MemberBase): In some cases we need to call parent container for partial
958         class. It should be eliminated but it's not easy now.
959
960         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
961
962         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
963         partial classed to accumulate class comments.
964         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
965
966         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
967
968         * driver.cs (MainDriver): Tree.GetDecl was removed.
969
970         * modifiers.cs (Modifiers): Add partial modifier.
971
972         * tree.cs (Tree.decl): Removed.
973         (RootTypes): Started to use this class more often for root types
974         specializations.
975
976 2006-03-23  Raja R Harinath  <rharinath@novell.com>
977
978         * generic.cs (TypeParameter.UpdateConstraints): Update
979         'constraints' if null.
980
981 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
982
983         A fix for #77615
984
985         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
986         external interface does not have an attribute.
987
988 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
989
990         Another prerequisites for new partial classs implementation.
991         
992         * attribute.cs (Attribute.Equal): Implemented.
993         (Attribute.Emit): Changed as attributes can be applied more than twice.
994         (Attributes.Emit): Check for duplicate attributes here.
995
996         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
997         as a parameter, clean-up.
998
999 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1000
1001         A fix for #77485
1002
1003         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1004         contains obsolete attribute check which can in some cases look for base
1005         type of current class which is not initialized yet.
1006         (TypeContainer.BaseType): Replacement of ptype.
1007
1008         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1009
1010 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1011
1012         First of prerequisites for new partial classs implemention.
1013         
1014         * attribute.cs (Attributable): Extended by ResolveContext;
1015         Attributes finally have correct context for resolving in all cases.
1016         (AttachTo): Attribute owner is assigned here.
1017
1018         * codegen.cs (IResolveContext): Introduce new interface to hold
1019         all information needed in resolving phase.
1020         (EmitContext): Implements IResolveContext; more clean-up needed here.
1021         
1022         * decl.cs (MemberCore): Implemented IResolveContext.
1023
1024         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1025         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1026         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1027         Refactored to use new IResolveContext instead of EmitContext; cleanup
1028
1029 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1030
1031         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1032         mcs to keep code differences small.
1033         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1034         * typemanager.cs (parameter_default_value_attribute_type): New.
1035         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1036         CS1908 check.
1037
1038 2006-03-22  Martin Baulig  <martin@ximian.com>
1039
1040         * generic.cs
1041         (Nullable.NullableLiteral): Derive from `NullLiteral'.
1042
1043         * convert.cs
1044         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1045         instead of the normal `NullLiteral'.
1046
1047 2006-03-21  Martin Baulig  <martin@ximian.com>
1048
1049         Fix #77583.
1050         * generic.cs (TypeManager.InferType): If `pt' is a generic
1051         parameter, don't check whether `pt == at'.
1052
1053 2006-03-20  Raja R Harinath  <rharinath@novell.com>
1054
1055         Fix #77852
1056         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1057         (TypeParameter.Resolve): Update to change.
1058         (ConstraintChecker.CheckConstraints): Resolve type-argument
1059         constraints before use.
1060
1061 2006-03-16  Martin Baulig  <martin@ximian.com>
1062
1063         * generic.cs
1064         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1065         and don't have any instance constructors, also lookup in the base class.
1066         (TypeManager.IsNullableValueType): New public method.
1067
1068         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1069         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1070         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1071
1072         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1073         instead of just TypeManager.IsNullableType() to determine whether
1074         a lifted operator exists.
1075         (UnaryMutator.DoResolve): Likewise.
1076         (Conditional.DoResolve): Likewise.
1077         (Binary.DoResolve): A lifted operator only exists if both operands
1078         are valuetypes and at least one of them is a nullable type.
1079
1080 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1081
1082         * iterator.cs : yield break is allowed in try statement which has
1083           catch clauses. Fixed bug #77767.
1084
1085 2006-03-12  Martin Baulig  <martin@ximian.com>
1086
1087         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1088         private IsSignatureEqual() to compare types; see the comment in
1089         that method; fixes #77674.
1090
1091 2006-03-10  Raja R Harinath  <rharinath@novell.com>
1092
1093         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1094         (Expression.ResolveAsTypeTerminal): Likewise.
1095         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1096         * expression.cs, generic.cs, iterators.cs: Likewise.
1097         * parameter.cs, statement.cs, typemanager.cs: Likewise.
1098
1099 2006-03-09  Martin Baulig  <martin@ximian.com>
1100
1101         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1102         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1103
1104 2006-03-09  Martin Baulig  <martin@ximian.com>
1105
1106         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1107         `prepared' flag is set.
1108
1109         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1110         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1111         issues; see gtest-254.cs.
1112
1113 2006-03-07  Martin Baulig  <martin@ximian.com>
1114
1115         * generic.cs (TypeManager.InferType): Allow infering
1116         `IEnumerable<T>' with an array of T; see gtest-251.cs.
1117
1118 2006-03-06  Martin Baulig  <martin@ximian.com>
1119
1120         * generic.cs
1121         (TypeManager.InferType): Fix gtest-250.cs.
1122
1123         * typemanager.cs
1124         (TypeManager.IsSubclassOf): Also check the base class.
1125
1126         * expression.cs
1127         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1128         fixes gtest-249.cs.
1129
1130 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1131
1132         Fix #77679.
1133         * expression.cs (ParameterReference.DoResolveBase): Change return
1134         type to bool.
1135         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1136         Update.
1137
1138         Fix #77628.
1139         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1140
1141         Fix #77642.
1142         * typemanager.cs (GetFullNameSignature): Don't nullref on
1143         protected accessors.
1144
1145 2006-02-16  Martin Baulig  <martin@ximian.com>
1146
1147         * generic.cs
1148         (TypeManager.GetGenericFieldDefinition): New public method; use it
1149         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1150
1151 2006-02-14  Martin Baulig  <martin@ximian.com>
1152
1153         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1154
1155 2006-02-14  Martin Baulig  <martin@ximian.com>
1156
1157         * generic.cs
1158         (TypeManager.DropGenericMethodArguments): New public method; don't
1159         use GetGenericMethodDefinition() on something which is not a
1160         generic method.
1161
1162 2006-02-14  Martin Baulig  <martin@ximian.com>
1163
1164         * generic.cs
1165         (ConstraintChecker.CheckConstraints): If a type parameter has the
1166         `struct' constraint, the type must be a non-nullable valuetype.
1167
1168 2006-02-10  Martin Baulig  <martin@ximian.com>
1169
1170         * typemanager.cs
1171         (TypeManager.IsOverride): Make this work for instantiated methods
1172         in a generic class; fixes #77509.
1173         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1174         rather than calling it directly; fixes #77488.  
1175
1176 2006-02-08  Martin Baulig  <martin@ximian.com>
1177
1178         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1179         reporting into CheckConstraint() so we can use the correctly
1180         instantiated type.
1181
1182 2006-02-08  Martin Baulig  <martin@ximian.com>
1183
1184         * expression.cs (BaseAccess): Add support for generic methods.
1185
1186         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1187         the new MethodGroupExpr.
1188
1189 2006-02-07  Martin Baulig  <martin@ximian.com>
1190
1191         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1192         also reference types; fixes #77483.
1193
1194 2006-02-07  Martin Baulig  <martin@ximian.com>
1195
1196         * generic.cs
1197         (TypeManager.IsGenericMethod): We now return whether something is
1198         an instantiated generic method (and not a generic method def).
1199         (TypeManager.IsGenericMethodDefinition): New public method.
1200
1201         * typemanager.cs
1202         (TypeManager.CSharpSignature): Only include type arguments for
1203         "real" generic methods, not for any instantiated method.
1204         (TypeManager.GetMethodName): Likewise, but also allow generic
1205         method definitions here.
1206
1207 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1208
1209         * codegen.cs (EmitScopeInitFromBlock): check here the
1210         capture_context, there is no need to make two calls to the
1211         EmitContext. 
1212
1213         * anonymous.cs: Add some debugging messages that might help me
1214         track other instances of this problem in the future (the
1215         regression of test 467).
1216
1217         * cs-parser.jay: track the variable block, as we need to initalize
1218         any captured variables declared in this block for the "catch"
1219         portion of the "Try" statement.
1220
1221         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1222         scope initialization for captured variables. 
1223
1224         Also, move the emit for the variables after the block location has
1225         been marked.
1226
1227 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1228
1229        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1230         
1231 2006-02-06  Martin Baulig  <martin@ximian.com>
1232
1233         * class.cs (TypeContainer.DefineType): If we're a struct, pass
1234         `TypeManager.value_type' as parent type to
1235         ModuleBuilder.DefineType().  Fixes #77358.      
1236
1237 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1238
1239         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1240         commit yesterday, the initialization for the roots is necessary.
1241         What is not necessary is the scope activation.
1242
1243 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1244
1245         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1246         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1247         CS0206 checks.
1248         (Argument.Resolve): Remove CS0206 checks.
1249
1250 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1251
1252         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1253         scopes for all the roots, the scopes will now be emitted when the
1254         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1255
1256         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1257         code.  This reduces a lot of existing cruft.
1258         
1259         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1260         that the ScopeInfo is generated as we enter the scope, not at the
1261         time of use, which is what we used to do before.
1262
1263         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1264         every time a Block is about to be emitted if we have a
1265         CaptureContext. 
1266
1267 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1268
1269         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1270         attribute for mscorlib too.
1271
1272         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1273         (Reset): Update.
1274         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1275
1276         * typemanager.cs (cons_param_array_attribute): Make private.
1277         (Reset): Set it to null.
1278         (InitCoreHelpers): Don't initialize it.
1279         (ConsParamArrayAttribute): New.  Initialize it as needed.
1280         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1281
1282 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1283
1284         * expression.cs: There might be errors reported during the
1285         selection of applicable methods.  If there are errors, do not
1286         continue execution as it will lead the compiler to crash.
1287
1288 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1289
1290         * expression.cs: Member access is not allowed on anonymous
1291         methods.  Fixes #77402.
1292
1293 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1294
1295         Fix #77401
1296         * cs-parser.jay (VariableDeclaration): Don't set
1297         current_array_type to null.
1298         (field_declaration, event_declaration, declaration_statement):
1299         Set it to null here.
1300
1301 2006-01-29  Raja R Harinath  <harinath@gmail.com>
1302
1303         Fix part of #77397
1304         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1305
1306 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1307
1308         * typemanager.cs (GenericParameterPosition): New.
1309         * doc.cs: Use it.
1310
1311 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1312
1313         * doc.cs : To process "include" elements, first we should create
1314           another list than XmlNodeList, because it could result in node
1315           removal, which could result in that the XmlNodeList gives up
1316           yielding next node.
1317
1318 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1319
1320         * expression.cs: Introduce an error report that we were not
1321         catching before.   Gonzalo ran into it.
1322
1323 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1324
1325         A fix for bug: #76957
1326         
1327         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1328         ComputeMethodHost before creating the method, this is a new
1329         requirement. 
1330
1331         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1332         that this method references (RegisterScope).  The actual scope
1333         where the method is hosted is computed with the ComputeMethodHost
1334         before we create the method.
1335
1336         Moved the Deepest routine here.
1337
1338         (AnonymousContainer.ComputeMethodHost): New routine used to
1339         compute the proper ScopeInfo that will host the anonymous method.
1340
1341         (ScopeInfo): Deal with multiple roots.  The problem was that we
1342         did not have a unique root where all ScopeInfos could be hanged
1343         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1344         of roots.  
1345
1346         Remove AdjustMethodScope which is now computed at the end.  Remove
1347         LinkScope which did a partial link, instead link all ScopeInfos
1348         before code generation from the new "LinkScopes" routine. 
1349
1350         Simplify all the Add* routines as they no longer need to maintain
1351         the tree, they just need to record that they are using variables
1352         from a ScopeInfo.
1353
1354         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1355         routines to produce the forest of ScopeInfo trees.
1356
1357         * class.cs (TypeContainer.AppendMethod): This is just like
1358         AddMethod, but ensures that an interface implementation method
1359         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1360         methods, but at the end.
1361
1362         We use this functionality to ensure that the generated MoveNext
1363         method in the iterator class is resolved/emitted before the
1364         enumerator methods created.   
1365
1366         This is required because the MoveNext method computes the right
1367         ScopeInfo for the method.  And the other methods will eventually
1368         need to resolve and fetch information computed from the anonymous
1369         method. 
1370
1371         
1372 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1373
1374         Improve implementation of section 14.4.2.2 (Better function member).
1375         * expression.cs (Invocation.MoreSpecific): Compare all type
1376         arguments before deciding if one type is more specific than
1377         another.  Handle array types too.  Return the more specific type.
1378         (Invocation.BetterFunction): Add more tie-breaking rules from
1379         section 14.4.2.2.  Perform "more specific" check after
1380         other tie-breaking rules.  Compare all parameter types before
1381         choosing the "more specific" method.
1382
1383 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1384             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1385
1386         Fix rest of #76995.
1387         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1388         the 'aliases' hash.
1389         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1390         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1391
1392 2006-01-18  Martin Baulig  <martin@ximian.com>
1393
1394         * class.cs (TypeContainer.AddToMemberContainer): Use
1395         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1396         fixes #77124.
1397
1398 2006-01-18  Martin Baulig  <martin@ximian.com>
1399
1400         Fix #76417: a generic class may now have methods which may unify
1401         for some type parameter substitutions.
1402
1403         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1404         for methods which may unify anymore.
1405
1406         * expression.cs (Invocation.MoreSpecific): New private static
1407         method; checks whether one method is more specific than another
1408         according to 14.4.2.2 of the spec.
1409         (Invocation.BetterFunction): Implement the tie-breaking rules from
1410         14.4.2.2 of the spec: if two methods unify for some type parameter
1411         substitution, we need to pick the more specific one.
1412
1413 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1414
1415         Fix #76656, cs0231-2.cs.
1416         * cs-parser.jay (formal_parameter_list): Make error case catch
1417         more issues.
1418         (parenthesized_expression_0): Add CS1026 check.
1419         (invocation_expression): Remove unused { $$ = lexer.Location }.
1420
1421 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1422
1423         Fix #76824.
1424         * cs-parser.jay (statement_expression): Don't list out the
1425         individual statement-expressions.  Convert syntax error into
1426         CS0201 check.
1427
1428 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1429
1430         Fix #76874.
1431         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1432         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1433         CheckIntermediateModification.
1434         (FieldExpr.DoResolve): Add new two-argument version that
1435         allows us to resolve the InstanceExpression as an lvalue.
1436         The one-argument variant is now just a wrapper.
1437         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1438         Resolve the lhs as an lvalue if the it has a value type.
1439         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1440         from Assign.DoResolve.
1441         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1442         resolved as an lvalue.
1443         (PropertyExpr.DoResolve): Update.
1444         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1445         has a value type.  Move CS1612 check here from
1446         CheckIntermediateModification.
1447         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1448         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1449         'right_side' of a ResolveLValue on an 'out' argument.
1450         (EmptyExpression.LValueMemberAccess): New.  Used as the
1451         'right_side' of a propagated ResolveLValue on a value type.
1452         (LocalVariableReference.DoResolveBase): Recognize
1453         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1454         Add CS1654 check.
1455         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1456         EmptyExpression.Null.
1457
1458 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1459
1460         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1461           Type.IsGenericParameter(). Fixed bug #77183.
1462         * doc.cs : it is now identical to doc.cs in mcs.
1463
1464 2006-01-16  Martin Baulig  <martin@ximian.com>
1465
1466         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1467
1468 2006-01-16  Martin Baulig  <martin@ximian.com>
1469
1470         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1471         ctors; fixes #77250.
1472
1473 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1474
1475         This fixes the problem where we used ldfld instead of ldflda to
1476         load the "THIS" pointer on captured parameters, when THIS is a
1477         value type.  See bug #77205.
1478         
1479         * iterators.cs (CapturedThisReference.Emit): Pass false to
1480         EmitThis (we do not need the address).
1481
1482         * codegen.cs (EmitThis): it needs to know whether we need the
1483         address of `this' or not.  This is used by value types.  
1484
1485         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1486         every other call passes false.
1487
1488 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1489
1490         Fix #77221.
1491         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1492         GetOverride.
1493         * expression.cs (Invocation.OverloadResolve): Update.
1494         (Invocation.DoResolve): Avoid double resolution of invocation.
1495
1496 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1497
1498         Fix #77180.
1499         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1500         unary negation of floating point types as 0-expr; negation cannot
1501         overflow in floating point types.
1502
1503         Fix #77204.
1504         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1505         on operands of 'void' type.
1506
1507         Fix #77200.
1508         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1509         and ExclusiveOr for boolean constants too.
1510
1511 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1512
1513         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1514
1515 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1516
1517         * cs-tokenizer.cs (Position): New class used to save and restore
1518         the position state in the tokenizer.  Before this patch the save
1519         and restore was not complete enough so the line and columns would
1520         start to drift and the debugger and stack traces will get the
1521         wrong data.
1522
1523 2006-01-10  Martin Baulig  <martin@ximian.com>
1524
1525         * generic.cs
1526         (TypeParameter.InflateConstraints): New public method.
1527
1528         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1529         constraints; fixes #77042.
1530
1531 2006-01-10  Martin Baulig  <martin@ximian.com>
1532
1533         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1534         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1535         #77061. 
1536
1537 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1538
1539         Fix #75636.
1540         * expression.cs (Invocation.OverloadResolve): Replace reflected
1541         override methods with their base virtual methods, rather than
1542         skipping over them.
1543         * typemanager.cs (TypeManager.GetOverride): New.
1544
1545 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1546
1547         * driver.cs: Report the case of no source files and no -out:
1548         argument provided.
1549
1550 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1551
1552         Fix #77035.
1553         * expression.cs (ComposedCast.GetSignatureForError): Define.
1554
1555 2006-01-05  Jb Evain  <jbevain@gmail.com>
1556
1557         * class.cs (Property.Define, Indexer.Define): do not tag the
1558         properties as SpecialName | RTSpecialName.
1559
1560 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1561
1562         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1563         doing a low-level comparission of parameter types.  It was lacking
1564         a check for __argslist. 
1565
1566 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1567
1568         * expression.cs (ParameterReference.DoResolveBase): Allow
1569         reference parameters if they are local to this block. 
1570
1571         This allows the ref and out parameters of a delegate to be used in
1572         an anonymous method, for example:
1573
1574         delegate void set (out int x);
1575
1576         set s = delegate (out int x){
1577                 x = 0;
1578         };
1579
1580         This is used by functionality introduced late in the C# language.
1581         
1582         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1583         method that take ref and out parameters. 
1584
1585         Fixes #77119 which was a late change in the spec.
1586
1587 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1588
1589         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1590         parent if its the same scope.  Fixes #77060.
1591
1592 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1593
1594         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1595
1596 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1597
1598         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1599         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1600         that doesn't contain the full public key. This is a update of the
1601         friend assemblies in .Net 2.0 release.
1602         
1603 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1604
1605         Fix #76995
1606
1607         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1608         ListDictionary, to contain the ExternAliasEntry entries (in
1609         addition to the NamespaceEntry.aliases hashtable). This field is
1610         shared between the original entry and its doppelganger (bodyless 
1611         copy of it).
1612         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1613         extern_aliases field.
1614         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1615         lookup in extern_aliases.
1616
1617 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1618
1619         Fix #77006.
1620         * class.cs (TypeContainer.Mark_HasEquals): New.
1621         (TypeContainer.Mark_HasGetHashCode): New.
1622         (ClassPart): Override them.
1623         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1624
1625         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1626         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1627         DeclSpace.
1628
1629         Fix #77008.
1630         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1631         'parent' argument to the base constructor.
1632
1633         Remove all mention of TypeContainer from decl.cs.
1634         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1635         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1636         (DeclSpace.DeclSpace): Likewise.
1637         (DeclSpace.DefineMembers): Remove unused argument.
1638         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1639         debugging check -- we don't care if the debug code throws an
1640         InvalidCastException instead of an InternalErrorException.
1641         * class.cs (TypeContainer.DefineMembers): Update to changes.
1642         (TypeContainer.DoDefineMembers): Likewise.
1643         (TypeContainer.GetMethods): Likewise.
1644         (PropertyMember.Define): Likewise.
1645         (MemberBase.Parent): New property that forwards to
1646         MemberCore.Parent, but ensures that we get a TypeContainer.
1647         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1648         (RootContext.PopulateTypes): Likewise.  Remove special case code
1649         for !RootContext.StdLib: DefineMembers is idempotent.
1650
1651 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1652
1653         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1654
1655 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1656
1657         * doc.cs : The search for referenced namespace was insufficient to
1658           get global one as it used to do. Fixed bug #76965.
1659
1660 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1661
1662         * doc.cs : check name in cref in the last phase that whether it is
1663           namespace or not.
1664
1665 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1666
1667         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1668           Mono.C5.
1669
1670 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1671
1672         * doc.cs : so it turned out that we cannot skip override check for 
1673           interface members. Fixed bug #76954.
1674
1675 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1676
1677         * cs-tokenizer.cs : fixed bug #75984:
1678           - #warning and #error should not be handled when the source line
1679             is disabled.
1680           - #line is not checked strictly when the source line is disabled.
1681           - #define and #undef is on the other hand checked strictly at any
1682             state.
1683
1684 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1685
1686         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1687           CS1027 report.
1688
1689 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1690
1691         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1692
1693         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1694         nested types.
1695
1696 2005-12-14  Martin Baulig  <martin@ximian.com>
1697
1698         * typemanager.cs (TypeManager.GetFullName): Make this public;
1699         `Type.Fullname' now never returns null.
1700
1701         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1702         explicit interface implementations; we're now using the same
1703         naming convention than csc does.
1704
1705 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1706
1707         * convert.cs (ExplicitConversionCore): Check the return value from
1708         ExplicitConversionCore which can return null on failure.  Fixes #76914
1709
1710 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1711
1712         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1713         instead of IsGenericInstance.
1714         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1715         code that's now covered by the more general test.
1716         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1717
1718         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1719         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1720         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1721         * generic.cs, report.cs, typemanager.cs: Likewise.
1722
1723 2005-12-08  Martin Baulig  <martin@ximian.com>
1724
1725         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1726
1727         * typemanager.cs (TypeManager.CSharpSignature): Include type
1728         arguments in the signature of a generic method.
1729
1730 2005-12-07  Martin Baulig  <martin@ximian.com>
1731
1732         Add support for custom attributes on type parameters.
1733
1734         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1735
1736         * generic.cs (TypeParameterName): New public class; we use this
1737         instead of a `string' to store the name of a type parameter, so we
1738         can also have `Attributes'.
1739         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1740         array instead of a `string[]' array.
1741         (TypeParameter.ctor): We now also take an `Attributes' argument.
1742         (TypeParameter.EmitAttributes): New public method; emit our
1743         `OptAttributes' here.
1744         (GenericMethod.EmitAttributes): New public method; emit the custom
1745         attributes on all our type parameters.
1746
1747         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1748         our type parameters.
1749         (MethodData.Define): If we're a generic method, call
1750         EmitAttributes() on it.
1751
1752 2005-12-07  Martin Baulig  <martin@ximian.com>
1753
1754         * generic.cs
1755         (ConstraintChecker): New public abstract class; move the
1756         constraint checking here from `ConstructedType' and also do
1757         constraint checking for generic methods here.
1758
1759         * expression.cs (Invocation.OverloadResolve): Use
1760         ConstraintChecker.CheckConstraints() if we resolved to a generic
1761         method.  Fix #76806.
1762
1763 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1764
1765         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1766
1767         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1768         event initializers.
1769         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1770         (FieldBase.Initializer): Initializer is now optional.
1771         (EventField.Define): Only event field can have initializer.
1772
1773         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1774
1775         * const.cs (Const): Reuse initializer.
1776
1777         * cs-parser.jay: Updated after FieldBase changes.
1778         Added current_array_type to simplify array initializers.
1779
1780         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1781
1782         * expression.cs, iterators.cs: Updated.
1783
1784         * namespace.cs (NamespaceEntry): Made UsingFound private.
1785
1786 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1787
1788         * parameterCollection.cs: Obsolete, removed.
1789         * parser.cs: Obsolete, removed.
1790
1791 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1792
1793         Fix #76849.
1794         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1795
1796         * enum.cs (Enum.Define): Set obsolete context here.
1797
1798 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1799
1800         * doc.cs :
1801           - FindDocumentedMember() now expects 1) paramList as null
1802             when "we don't have to check the number of parameters" and
1803             2) Type.EmptyTypes when "there is no arguments".
1804           - Introduced FoundMember struct to hold the exact type which was
1805             used to find the documented member (the above change broke
1806             test-xml-044; it might be better just to use DeclaringType than
1807             what MS does, like this change does, but it depends on usage.)
1808
1809 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1810
1811         * doc.cs : documented member might be from DeclaringType for nested
1812           types. Fixed bug #76782.
1813
1814 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1815
1816         * anonymous.cs: Have the param code handle leaving copies on the
1817         stack etc. Allows anonymous params to take part in the assignment
1818         code (++, +=, etc). Fixes bug #76550
1819
1820         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1821         it down to the anon code.
1822
1823         * iterators.cs: Use dummy var here
1824
1825         * codegen.cs: Handle new vars
1826
1827 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1828
1829         Fix #76849.
1830         * class.cs (MethodData.Define): Set proper Obsolete context.
1831
1832         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1833         obsolete context.
1834         (FieldExpr.DoResolve): Ditto.
1835
1836 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1837
1838         Fix #76849.
1839         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1840         parent is not obsolete.
1841
1842 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1843
1844         * doc.cs : (FindDocumentedMember) find parameterless members first
1845           and get CS0419 in the early stage. Fixed first case of bug #76727.
1846
1847 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1848
1849         Fix #76859.
1850         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1851         no error was reported.
1852
1853         *expression.cs (Binary.DoResolve): left can be null.
1854
1855 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1856
1857         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1858         abstract method and all overrides.
1859         * support.cs (ParameterData.GenericConstraints): Delete.
1860         (ReflectionParameters.type_params): Delete.
1861         (ReflectionParameters.ReflectionParameters): Make private.
1862         (ReflectionParameters.GetConstaints): New factory method.
1863         * generic.cs (TypeParameterDefineType): Use it.
1864         (TypeManager.GetTypeParameterConstraints): Likewise.
1865
1866 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1867
1868         Fix #76783.
1869         * class.cs (MethodData.Emit): Parameters should be labeled first.
1870
1871 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1872
1873         Fix #76761.
1874         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1875
1876 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1877
1878         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1879
1880         * class.cs (MethodCore): Parameter clean up.
1881         (IMethodData): Added ParameterInfo.
1882         (MethodData): Parameter clean up.
1883         (Indexer.Define): Parameter clean up.
1884
1885         * anonymous.cs,
1886         * codegen.cs,
1887         * cs-parser.jay,
1888         * decl.cs,
1889         * doc.cs,
1890         * ecore.cs,
1891         * flowanalysis.cs,
1892         * iterators.cs,
1893         * pending.cs,
1894         * statement.cs,
1895         * typemanager.cs: Parameter clean up.
1896
1897         * delegate.cs (Define): Get rid of duplicated code.
1898
1899         * expression.cs (ParameterReference): Removed useless parameters
1900         and simplified.
1901         (Invocation): Ditto.
1902
1903         * parameter.cs (ParamsParameter): New class, params specialization.
1904         (ArglistParameter): Attemp to separate arglist.
1905         (Parameter): Refactored to be reusable and faster.
1906         (Parameter.Modifier): Made understandable.
1907         (Parameters): Changed to be used as a class for `this' assembly
1908         parameters. Refactored to use new specialized classes.
1909
1910         * support.cs (ParameterData): Added Types property.
1911         (InternalParameters): Deleted.
1912
1913 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1914
1915         * doc.cs : the previous patch does not actually fix the bug.
1916           PropertyInfo override check is now implemented and really fixed it.
1917         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1918
1919 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1920
1921         * doc.cs : apply "override filter" also to properties.
1922           Fixed bug #76730.
1923
1924 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1925
1926         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1927           no need to check overrides. For classes, omit those results from 
1928           interfaces since they must exist in the class. Fixed bug #76726.
1929
1930 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1931
1932         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1933           with different parameters. Fixed the second problem in #76685.
1934
1935 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1936
1937         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1938           get expected 'protected' access in CheckValidFamilyAccess()).
1939           Fixed bug #76692.
1940
1941 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1942
1943         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1944           Fixed bug #76705.  CS1569 was incorrectly commented out.
1945
1946 2005-11-23  Martin Baulig  <martin@ximian.com>
1947
1948         * generic.cs (Constraints.Define): Removed.
1949         (TypeParameter.DefineConstraints): Removed.
1950         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1951         on the GenericTypeParameterBuilder here.
1952
1953 2005-11-23  Martin Baulig  <martin@ximian.com>
1954
1955         * typemanager.cs (TypeManager.GetProperty): Make this public.
1956
1957         * generic.cs (Nullable.NullableInfo.ctor): Use
1958         TypeManager.GetProperty() rather than using reflection directly.
1959
1960 2005-11-17  Martin Baulig  <martin@ximian.com>
1961
1962         * expression.cs (Indexers.GetIndexersForType): Added support for
1963         generic parameters; fixes #76587.
1964
1965 2005-11-17  Martin Baulig  <martin@ximian.com>
1966
1967         * anonymous.cs
1968         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1969         inherit the scope from our parent.  Fixes #76653.
1970
1971 2005-11-15  Martin Baulig  <martin@ximian.com>
1972
1973         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1974         instead of `ScopeTypeBuilder' to refer to the "current" type.
1975         (AnonymousMethod.CreateScopeType): Correctly create the helper
1976         class if we're inside a generic type definition.
1977
1978 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1979
1980         * doc.cs : use Invocation.IsOverride() to do real override check.
1981         * expression.cs : made Invocation.IsOverride() internal.
1982
1983 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1984
1985         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1986           TypeBuilder.FindMembers() and filter overriden base members out.
1987           Fixed bug #76990.
1988
1989 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1990
1991         * doc.cs : ref/out parameters are represented as '@' (instead of
1992           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1993
1994 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1995
1996         * doc.cs : when there was no '.' in cref to methods in doc comment,
1997           then parameters were missing in the output. Fixed bug #76691.
1998
1999 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2000
2001         * driver.cs : don't output docs when there is an error.
2002           Fixed bug #76693.
2003
2004 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2005
2006         * doc.cs :
2007           Now it should detect indexers. Fixed primary concern in bug #76685.
2008           Fixed CS0419 message to not show the identical member signature in
2009           the message.
2010
2011 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2012
2013         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2014           instead of Type.FindMembers() since it does not handle events.
2015           Fixed bug #71604.
2016
2017 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2018
2019         * codegen.cs: Fixed typo (speficied -> specified).
2020
2021 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2022
2023         Fix #76369.
2024         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2025
2026 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2027
2028         * attribute.cs: Changed error message.
2029
2030         * cs-tokenizer.cs: One more check.
2031
2032 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2033
2034         * statement.cs (Block.Resolve): Ignore empty statement.
2035
2036 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2037
2038         * report.cs: Made error/warning methods more strict to avoid
2039         their misuse.
2040
2041         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2042         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2043         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2044         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2045
2046 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2047
2048         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
2049         Use the more explicit AssemblyName.FullName instead of 
2050         AssemblyName.Name to report errors.
2051         
2052 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2053
2054         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2055         with mcs.
2056
2057 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2058
2059         * class.cs,
2060         * convert.cs,
2061         * cs-parser.jay,
2062         * decl.cs,
2063         * enum.cs,
2064         * expression.cs,
2065         * generic.cs,
2066         * pending.cs,
2067         * report.cs: Fixed error reporting and typos.
2068
2069         * generic.cs (TypeParameter.GetSignatureForError): New method.
2070         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2071
2072         * typemanager.cs (GetFullName): Refactored.
2073
2074 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2075
2076         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2077         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2078
2079         * class.cs (TypeContainer.IsComImport): New property.
2080         (Constructor.Define): Create proper ctor for ComImport types.
2081
2082         * expression.cs (New.CheckComImport): Fixed.
2083
2084 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2085
2086         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2087         that a parameter has been captured does not mean that we do not
2088         have to do the rest of the processing.  This fixes the second part
2089         of #76592.  If there was another anonymous method capturing
2090         values in the past, the Scope would never be set for the second
2091         method that captured the same parameter.
2092
2093         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2094         properly manipulate the stack.   Second part of fix for #76592.
2095
2096         * expression.cs (New): Add support for invoking "new" on
2097         interfaces that have been flagged with the ComImport attribute and
2098         the CoClass.  Fixes #76637 
2099
2100         * statement.cs (Try.DoEmit): When a variable is captured, do not
2101         try to emit the vi.LocalBuilder variable as it has been captured.
2102         Create a temporary variable and store the results on the
2103         FieldBuilder.  Fixes #76642
2104
2105 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2106
2107         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2108
2109         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2110
2111         * expression.cs (Binary.DoResolve): Added && optimalization.
2112     
2113         * typemanager.cs (AddUserType): Removed useless argument.
2114
2115 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2116
2117         * statement.cs (Block.variables): Uses ListDictionary.
2118
2119 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2120
2121         Fix #75969.
2122         * class.cs (PartialContainer.EmitType): Customized to emit
2123         security attributes.
2124         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2125         for partial classes.
2126
2127 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2128
2129         Fix #76599.
2130         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2131         access has to be fixed.
2132         
2133         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2134
2135 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2136
2137         Fix #76590.
2138         * ecore.cs (NullCast.Reduce): Implemented.
2139
2140         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2141         constant type.
2142         
2143         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2144         properly.
2145         (Foreach.Resolve): Catch null properly.
2146
2147 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2148  
2149         * cs-tokenizer.cs: Warning text fix.
2150
2151         * driver.cs: AllWarningNumbers exposed on public interface.
2152
2153         * report.cs (): Reviewed warning numbers.
2154         (IsValidWarning): Use binary search.
2155
2156 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2157  
2158         * driver.cs: Implemeted resource visibility.
2159         (Resources): New class for code sharing between /res: and
2160         /linkres:
2161  
2162 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2163
2164         decl.cs (CurrentTypeParameters): Fixed to be public.
2165
2166 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2167
2168         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2169
2170 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2171
2172         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2173
2174 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
2175
2176         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2177
2178 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2179
2180         Add friend assembly access support.
2181         * typemanager.cs: assembly_internals_vis_attrs
2182         cache for friend assembly access. 
2183         (TypeManager.IsFriendAssembly): New method for
2184         checking friend assembly access.
2185         (TypeManager.Error_FriendAccessNameNotMatching): New
2186         helper method.
2187         (TypeManager.CompareKeyTokens): Likewise.
2188         (TypeManager.Filter): Handle friend accessible
2189         members.
2190
2191         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2192         friend accessible types.
2193
2194         * ecore.cs (Expression.IsAccessorAccessible): Handle
2195         friend accessible properties.
2196
2197         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2198         accessible types.
2199         
2200 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2201
2202         Fix #76568.
2203         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2204         folding.
2205         
2206         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2207         contants only.
2208         
2209         * ecore.cs (NullCast): Child is contant only.
2210         
2211         * literal.cs (NullLiteral.Reduce): null can be converted to any
2212         reference type.
2213
2214 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2215
2216         * driver.cs: Use Encoding.Default as default code page instead
2217           of ISO-28591.
2218
2219 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2220
2221         Fix #76085.
2222         * expression.cs (Invocation.Error_InvalidArguments): Handle
2223         __arglist parameters.
2224         (Invocation.VerifyArgumentsCompat): Likewise.
2225         * support.cs (ReflectionParameters.GetSignatureForError): Print
2226         __arglist parameters.
2227         (InternalParamters.GetSignatureForError): Likewise.
2228         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2229
2230 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2231
2232         * attribute.cs (GetPropertyValue): Made public.
2233
2234         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2235         Resolve.
2236         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2237         attribute.
2238         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2239         is not defined.
2240         
2241         * driver.cs: Reflect method name change.
2242         
2243         * statement.cs (Try.Resolve): Warn when try has both general
2244         exception handlers.
2245         
2246         * typemanager.cs: runtime_compatibility_attr_type new predefined
2247         type.
2248
2249 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2250
2251         Fix #76419.
2252         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2253         treat it as an empty parameter list.
2254
2255 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2256
2257         Fix #76271.     
2258         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2259         ResolveAsTypeStep silent.
2260         * statement.cs (Block.AddConstant): Mark block as used.
2261         (Block.ResolveMeta): Avoid piling on error messages
2262         if a constant initializer resolution fails.
2263
2264 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2265
2266         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2267         Remove.
2268         (NamespaceEntry.VerifyAllUsing): New.
2269         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2270         behaviour.  Delegates actual resolution of alias to ...
2271         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2272         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2273         Update.
2274         * driver.cs (Driver.MainDriver): Update.
2275         
2276         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2277         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2278         property.
2279         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2280         Remove.
2281         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2282         RootNamespace.DefineNamespacesForAll.
2283
2284 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2285
2286         * typemanager.cs (assemblies, external_aliases, modules)
2287         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2288         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2289         overhead.  Move resposibility ...
2290         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2291         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2292
2293 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2294
2295         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2296         cached_namespaces.  Improve usage.
2297         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2298         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2299         Move from GlobalRootNamespace and simplify.
2300         (RootNamespace.Global): Make instance variable.
2301         (RootNamespace.RootNamespace): Add "alias name" parameter.
2302         (GlobalRootNamespace): Simplify drastically.
2303         (Namespace.Lookup): Don't use GetNamespace.
2304         * typemanager.cs (GetRootNamespace): Rename from
2305         ComputeNamespaceForAlias.
2306         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2307
2308 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2309
2310         * anonymous.cs (AnonymousContainer): Don't crash when container
2311         doesn't exist.
2312
2313 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2314
2315         * expression.cs (Binary.DoResolve): Warn when comparing same
2316         values.
2317
2318 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2319
2320         Fix #76486.
2321         * expression.cs (Binary.DoResolve): It looks like there are no
2322         convetsion rules in enum context.
2323
2324 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2325
2326         Add support for extern alias qualifiers.
2327         * typemanager.cs: Move some LookupTypeReflection code
2328         to namespace.cs, to have cleaner code. Added some methods
2329         to help us keep track of the extern aliased references.
2330         * driver.cs: Add suport for extern alias assemblies on command
2331         line and check for their warnings/errors. Also keep track of the
2332         extern aliased assemblies.
2333         * namespace.cs: Move the global functionality of Namespace
2334         to GlobalRootNamespace/RootNamespace. Now the global namespace
2335         is GlobalRootNamespace.Globa. Also the code moved from 
2336         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2337         Finally added LocalAliasEntry (AliasEntry before) and
2338         ExternAliasEntry, to handle alias statements.
2339         * cs-parser.jay: Add support in the grammar for extern alias
2340         statement.
2341         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2342         Update callings to Namespace (now in GlobalRootNamespace).
2343
2344 2005-10-25  Martin Baulig  <martin@ximian.com>
2345
2346         * convert.cs (ImplicitTypeParameterConversion): Make base
2347         interfaces actually work; fixes #76557.
2348
2349 2005-10-25  Martin Baulig  <martin@ximian.com>
2350
2351         * generic.cs
2352         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2353         all the type parameters; fixes #76551.
2354
2355 2005-10-25  Martin Baulig  <martin@ximian.com>
2356
2357         Fix #76472.
2358
2359         * generic.cs
2360         (GenericMethod.ctor): Added `Expression return_type' and
2361         `Parameters parameters' arguments.
2362         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2363         parameter and return types to check their constraints if they're
2364         generic types.
2365
2366         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2367         boolean field.
2368
2369         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2370         constraints of a generic type if `ec.ResolvingGenericMethod'.
2371
2372         * class.cs (MethodCore.DoDefineParameters): Set
2373         `ec.ResolvingGenericMethod' if we're a generic method.
2374         (MemberBase.MemberType): Likewise.
2375
2376 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2377
2378         * typemanager.cs (TypeManager): Added 
2379         TypeManager.internals_visible_attr_type to cache
2380         S.R.CompilerServices.InternalsVisibleToAttribute.
2381
2382         * codegen.cs (AssemblyClass): Added checks for 
2383         InternalsVisibleToAttribute in new method 
2384         CheckInternalsVisibleAttribute () and also cache the
2385         AssemblyName in AssemblyClass.Name.
2386         
2387 2005-10-24  Martin Baulig  <martin@ximian.com>
2388
2389         * typemanager.cs
2390         (TypeManager.ExpandInterfaces): Added overloaded version which
2391         just takes a `Type[]' array.
2392
2393         * generic.cs
2394         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2395         just use the interfaces which were explicitly specified and not
2396         the interfaces they inherit.  Fixes #76482.
2397         (TypeParameter.FindMembers): Expand the interfaces here.
2398
2399 2005-10-21  Martin Baulig  <martin@ximian.com>
2400
2401         * generic.cs
2402         (Constraints.Resolve): Also resolve the actual types here.
2403         (Constraints.ResolveTypes): Just check the constraints here.
2404         Fixes #76363; see gtest-218.cs.
2405
2406 2005-10-21  Martin Baulig  <martin@ximian.com>
2407
2408         * convert.cs
2409         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2410         instead of a `BoxedCast'; fixes gtest-217.cs.
2411
2412 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2413
2414         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2415           1) "new()" is specified as generic parameter constraint and 2) the
2416           type is TypeBuilder and 3) the type is abstract even if it has a
2417           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2418
2419 2005-10-20  Martin Baulig  <martin@ximian.com>
2420
2421         * generic.cs
2422         (GenericConstraints.TypeParameter): New public property.
2423         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2424         (TypeParameter.DeclSpace): New public property.
2425         (TypeParameter.DefineType): Inflate the constraints if our
2426         `DeclSpace' is an `Iterator'.   
2427
2428 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2429
2430         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2431           GenericMethod argument to compare methods' generic type arguments.
2432           Fixed bug #76382.
2433
2434 2005-10-19  Martin Baulig  <martin@ximian.com>
2435
2436         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2437         not ResolveType() when resolving the base type, so we're not
2438         checking the constraints here.
2439         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2440         if we have any.
2441
2442 2005-10-19  Martin Baulig  <martin@ximian.com>
2443
2444         * generic.cs (ConstructedType.CheckConstraints): Committing
2445         untested fix for #76441.
2446
2447 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2448
2449         Fix #76371.
2450         * class.cs (TypeContainer.DefineType): Move updating of
2451         topological sort earlier in the code.
2452         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2453
2454 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2455
2456         Fix #76273.
2457         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2458         
2459         * constant.cs (Constant.TryReduce): Moved from Cast class.
2460         (Reduce): Made little bit more OO and fixed missing conversions.
2461         
2462         * ecore.cs (Reduce): Implemented.
2463         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2464         
2465         * literal.cs (Reduce): Implemented.
2466         
2467         * class.cs: Reverted Miguel's wrong commit.
2468
2469 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2470
2471         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2472
2473 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2474
2475         * cs-parser.jay, expression.cs : CS0214 was missing error location
2476           for constants. Fixed bug #76404.
2477
2478 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2479
2480         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2481         InstanceExpression.
2482         (PropertyExpr.EmitCall): Likewise.
2483         * expression.cs (Invocation.EmitArguments): Handle case where
2484         arguments == null.
2485         (Invocation.EmitCall): Avoid allocating temporary variable if
2486         there are no arguments.
2487
2488 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2489
2490         Fix #76370.
2491         * convert.cs (ExplicitConversionCore): Fixed object->enum
2492         conversion.
2493
2494 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2495
2496         Fix #76323.
2497         * convert.cs (ImplicitConversionStandard): Move conversion of
2498         void* to arbitrary pointer types ...
2499         (ExplicitConversionStandard): .. here.
2500         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2501         error to always print typenames.
2502
2503 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2504
2505         * convert.cs (GetConversionOperator): Rename from
2506         GetConversionOperators.  Move operator selection code from ...
2507         (UserDefinedConversion): ... here.
2508
2509 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2510
2511         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2512         conversion.
2513
2514 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2515
2516         * assign.cs (Assign.DoResolve): Error method changed.
2517
2518         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2519         
2520         * const.cs (ResolveValue): Reset in_transit immediately.
2521         
2522         * constant.cs: Error method changed.
2523         
2524         * convert.cs: Removed useless location parameter.
2525         (ExplicitNumericConversion): Don't do double enum check.
2526         (ExplicitConversionCore): Renamed from ExplicitConversion.
2527         (ExplicitUnsafe): Extracted from ExplicitConversion.
2528         (ExplicitConversion): Uses for error reporting.
2529         
2530         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2531         error messages.
2532         (ResolveBoolean): Uses common error method.
2533         (CastToDecimal): Get rid of ec.
2534         (CastFromDecimal): Optimized.
2535         (ConvCast): Get rid of ec.
2536         
2537         * enum.cs (ResolveValue): Reset in_transit immediately.
2538         (Emit): Return after first error.
2539         
2540         * expression.cs: Convert changes.
2541         
2542         * literal.cs: Error method changed.
2543         
2544         * statement.cs: Error method changed.
2545
2546 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2547
2548         Fix gtest-131.cs and gtest-211.cs.
2549         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2550         Only emit code for a label if it is used.  Unreachable code can
2551         violate ECMA evaluation stack invariants.
2552
2553 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2554
2555         * anonymous.cs: Implemented ExprClassName.
2556         
2557         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2558         delegate.
2559         
2560         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2561         check.
2562         
2563         * class.cs (StaticClass.DefineContainerMembers): Report protected
2564         members as error.
2565         
2566         * codegen.cs: if(ed) PRODUCTION.
2567         
2568         * convert.cs (Error_CannotImplicitConversion): Better error
2569         distinction.
2570         
2571         * cs-parser.jay: More error checks.
2572         
2573         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2574         
2575         * driver.cs (CSCParseOption): Enabled wrong option check.
2576         
2577         * ecore.cs (Expression.ExprClassName): Turned to property.
2578         (MemberExpr.CheckIntermediateModification): For checking boxed
2579         value types     modification.
2580         
2581         * statement.cs (Fixed.Resolve): Expression type must be
2582         convertible to fixed type.
2583         (CollectionForeach.GetEnumeratorFilter,TryType):
2584         Small refactoring for easier error checking.
2585
2586 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2587
2588         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2589         attributes.
2590         
2591         * class.cs (GeneratedBaseInitializer): New class for customization
2592         compiler generated initializers.
2593         (MemberBase.DoDefine): Check Obsolete attribute here.
2594         (FieldMember.DoDefine): Ditto.
2595         
2596         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2597         constants.
2598         
2599         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2600         (MemberCore.GetObsoleteAttribute): Removed argument.
2601         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2602         (MemberCore.CheckObsoleteType): New helper.
2603         
2604         * delegate.cs,
2605         * enum.cs,
2606         * statement.cs: Updates after MemberCore changes.
2607         
2608         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2609         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2610         
2611         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2612         obsolete attribute for compiler construct.
2613         (As.DoResolve): Cache result.
2614         
2615         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2616
2617 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2618
2619         * expression.cs (Probe): instead of having a "Type probe_type"
2620         keep the extra information as a TypeExpr probe_type_expr since the
2621         "As" operator needs to perform some type checks.
2622
2623         * (As.DoResolve): If the type is a type parameter, ensure that it
2624         is constrained by a class.
2625
2626 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2627
2628         * statement.cs (Lock): Use the TemporaryVariable class instead of
2629         manually using local variables as those do not work when variables
2630         are captured.
2631
2632         * ecore.cs: Moved the TemporaryVariable class from being a nested
2633         class inside Foreach to be a public class that can be employed in
2634         other places. 
2635
2636 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2637
2638         * cs-parser.jay: interface_accessors replaced by
2639         accessor_declarations.
2640
2641         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2642         location.
2643         
2644         * statement.cs (GotoCase.Resolve): Convert null constant to
2645         null case.
2646         (SwitchLabel.ResolveAndReduce): Ditto.
2647         (SwitchLabel.NullStringCase): Custom null stamp.
2648         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2649         
2650         typemanager.cs (CSharpSignature): Don't skip first argument
2651         for full names.
2652
2653 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2654
2655         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2656         expression.cs, iterators.cs, literal.cs: Store constants and
2657         literals location.
2658         
2659         * class.cs (MemberBase.ShortName): Pass location.
2660         
2661         * cs-parser.jay: Some location fixes.
2662         
2663         * ecore.cs (Expression.Location): Made virtual.
2664
2665 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2666
2667         Fix #72930.
2668         * const.cs (Const.ResolveValue): Check for assigning non-null
2669         value to reference type.
2670
2671 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2672
2673         Fix #76133.
2674         * expression.cs (This.VerifyFixed): In a value type T, the type of
2675         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2676         value type R, 'this' is treated as a value parameter.
2677
2678 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2679
2680         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2681         if the underlying types are the same, otherwise we need to produce
2682         code that will do the proper cast.
2683
2684         This was exposed by Marek's constant rewrite which produced
2685         invalid code for the call site:
2686
2687         enum X : long { a }
2688         void Method (X v) {}
2689
2690         Method ((X) 5)
2691
2692         This fixes test-49.cs
2693
2694 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2695
2696         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2697           Type/Object should be allowed as well. Fixed bug #75968.
2698
2699 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2700
2701         * expression.cs : (Binary.DoResolve): when one is enum constant and
2702           another is constant 0, then return enum one *as enum type*.
2703           Fixed bug 74846.
2704
2705 2005-10-04  Martin Baulig  <martin@ximian.com>
2706
2707         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2708         `SetMemberIsUsed()' work for generics, too.
2709
2710 2005-10-04  Martin Baulig  <martin@ximian.com>
2711
2712         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2713         for corlib.  Fixes #75691.
2714
2715 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2716
2717         Fix #76255.
2718         * driver.cs: Fix compilation files with full root path.
2719
2720 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2721
2722         * report.cs (SymbolRelatedToPreviousError): Format the output so
2723         it does not use an open parenthesis that is never closed. 
2724
2725         * driver.cs: Follow coding guidelines
2726
2727 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2728
2729         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2730
2731         * location.cs (InEmacs): in this mode, do not report column
2732         location as it confuses Emacs.
2733
2734 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2735
2736         * support.cs (SeekableStreamReader.Position): Don't error out when
2737         the requested position is just beyond the end of the current
2738         buffered data.
2739
2740 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2741
2742         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2743         try to keep in sync with the byte count of the underlying Stream.
2744         However, this limits us to a window size of 2048 characters: i.e.,
2745         the maximum lookahead of our lexer/parser can be 2048 characters.
2746
2747 2005-09-22  Martin Baulig  <martin@ximian.com>
2748
2749         * driver.cs: Removed a debugging FIXME.
2750
2751 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2752
2753         * cs-parser.jay (type_arguments): Add CS1644 check.
2754         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2755
2756 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2757
2758         * Makefile (PROGRAM): Make profile specific.
2759         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2760         the current directory.
2761
2762         Fix test-455.cs.
2763         * expression.cs (Invocation.EmitCall): Remove optimization on
2764         this_call since it doesn't handle 'this' being a value type.
2765
2766 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2767
2768         * driver.cs: Ensure file handles are closed after parsing
2769
2770 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2771
2772         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2773         if the underlying types are the same, otherwise we need to produce
2774         code that will do the proper cast.
2775
2776         This was exposed by Marek's constant rewrite which produced
2777         invalid code for the call site:
2778
2779         enum X : long { a }
2780         void Method (X v) {}
2781
2782         Method ((X) 5)
2783
2784         This fixes test-49.cs
2785
2786 2005-09-05  Martin Baulig  <martin@ximian.com>
2787
2788         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2789         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2790
2791         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2792
2793 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2794
2795         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2796           to be a pointer type due to the spec 25.2, so check if declaring
2797           type is generic type definition. Fixed bug #75772.
2798
2799 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2800
2801         Fixed bug #75957.
2802         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2803           both types are not defined by methods.
2804         * expression.cs : (Invocation.IsApplicable): it should work when
2805           the argument type is equal to the parameter type, not only when
2806           ImplicitConversionExists() returns true.
2807
2808 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2809
2810         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2811         internal.
2812
2813         Fix #75941.
2814         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2815         flow-branching for LocalVariableReferences in case we were invoked
2816         from a MemberAccess.
2817         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2818         Carved out of ...
2819         (LocalVariableReference.DoResolveBase): ... this.
2820         (MemberAccess.Resolve): Do the check that was disabled during
2821         SimpleNameResolve.
2822
2823 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2824
2825         * class.cs :
2826           (PartialContainer.Create): check abstract/sealed/static strictly
2827           but abstract/sealed can exist only at one side. Fixed bug #75883.
2828
2829 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2830
2831         Fix #75945.
2832         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2833         specified, don't default to UnmanagedType.I4.
2834
2835 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2836
2837         * expression.cs : conditional operator should check possibly
2838           incorrect assign expression. Fixed bug #75946.
2839
2840 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2841
2842         Fix #75934.
2843         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2844         (ScopeInfo.EmitScopeType): Use it to construct field names from
2845         names of captured locals.
2846
2847         Fix #75929.
2848         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2849         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2850         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2851         (ExplicitConversion): Remove enum cases already handled by
2852         implicit conversion.  Move implicit conversion check to the beginning.
2853         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2854         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2855         Don't treat System.Enum as a struct.
2856
2857 2005-08-30  Jb Evain  <jbevain@gmail.com>
2858
2859         * attribute.cs: handles as expression in parameters.
2860
2861 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2862
2863         Fix #75802.
2864         * class.cs (TypeContainer.VerifyClsName): Don't use a
2865         PartialContainer when verifying CLS compliance.
2866         (AbstractPropertyEventMethod): Set Parent here, ...
2867         (PropertyMethod): ... not here.
2868
2869 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2870
2871         * attribute.cs : escaped attribute name should not be allowed to be
2872           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2873
2874 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2875
2876         Fix #75927.
2877         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2878         when converting a long constant to unsigned long.
2879         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2880         detect where IsApplicable and VerifyArgumentsCompat disagree.
2881
2882 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2883         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2884
2885         Fix #75848.
2886         * class.cs (TypeContainer.CanElideInitializer): New helper.
2887         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2888         can safely emitting the initializer of a field.
2889
2890 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2891
2892         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2893           allowed inside a switch (without loop). Fixed bug #75433.
2894
2895 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2896
2897         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2898         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2899
2900 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2901
2902         * driver.cs : kinda reverting the default encoding changes (not exact 
2903           revert since I noticed that "codepage:reset" might not work fine).
2904
2905 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2906
2907         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2908           Location. Now getter and setter store location correctly.
2909           (errors/cs0111-12.cs now reports the expected location.)
2910
2911 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2912
2913         * driver.cs : Use default encoding on the environment.
2914           Removed (now that) extra parameter for SeekableStreamReader.
2915         * support.cs : (SeekableStreamReader) third .ctor() argument for
2916           StreamReader is not required (always true). preamble size could
2917           be acquired in simpler and safe way.
2918
2919 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2920
2921         * cs-parser.jay: report CS0642 at warning level 3
2922           and report CS0642 for an if else statement also
2923           fixes bug #74745. Patch by John Luke (and a bit
2924           modified by me).
2925           Removed extra CS0642 warning check for "while",
2926           "for" and "fixed".
2927         * statement.cs: In Block.Resolve(), CS0642 check
2928           is reimplemented to check a sequence of an empty
2929           statement and a block.
2930
2931           Both fix bug #66777.
2932
2933 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2934
2935         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2936         detection until I fix it.
2937         
2938         * cs-tokenizer.cs: Changed error message.
2939         
2940         * cs-parser.jay: Fixed 2 error locations.
2941         
2942         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2943         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2944         properties.
2945         
2946         * enum.cs (GetSignatureForError): Fixed.
2947         
2948         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2949         method detection.
2950         
2951         * class.cs,
2952         * typemanager.cs (RegisterProperty): Removed.
2953         
2954         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2955
2956 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2957
2958         Fix #75874.
2959         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2960         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2961
2962 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2963
2964         * expression.cs : tiny fix is required for not warning positive ulong.
2965           See test-441.cs.
2966
2967 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2968
2969         * expression.cs : add CS0652 check for constant and integral
2970           expression. Fixed bug #53974.
2971
2972 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2973
2974         * expression.cs : in DoNumericPromotions(), check if there is implicit
2975           conversion overload for string (to check CS0034). Fixed bug #52492.
2976
2977 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2978
2979         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2980
2981 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2982
2983         * ecore.cs : report location when it is *not* Null.
2984
2985 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2986
2987         * codegen.cs,
2988           ecore.cs,
2989           flowanalysis.cs,
2990           expression.cs:
2991           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2992           correctly. Fixed bug #75721.
2993
2994 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2995
2996         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2997         loop that performs 'min (pos, char_count)'.
2998
2999         Fix #75862.
3000         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3001         converted value in Operator.OnesComplement.
3002
3003 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3004
3005         * anonymous.cs: If the anon method is pulled into a helper class,
3006         it needs to be `internal' not `private'. Fixes runtime behavior on
3007         msft. bug #75704
3008
3009 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3010
3011         Fix #75803
3012         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3013         is a partial class.
3014
3015 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3016
3017         The big constants rewrite
3018         Fix #75746, #75685 and more
3019         As a side effect saved 1MB for MWF ;-)
3020         
3021         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3022         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3023         enum based for corlib compilation.
3024         
3025         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3026         subtractions.
3027         
3028         * class.cs (FixedField.Define): Use ResolveAsConstant.
3029         
3030         * const.cs (IConstant): Interface constants and enums.
3031         (Const.ResolveValue): New method for constant resolvning.
3032         (ExternalConstant): Constants from imported assemblies.
3033         
3034         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3035         conversion; like enums.
3036         (Constant.ToType): Converts this constant to different type.
3037         (Constant.Increment): Adds 1.
3038         
3039         * convert.cs (ImplicitConversionRequired): Simplified.
3040         
3041         * cs-parser.jay: Create EnumMember directly.
3042         
3043         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3044         
3045         * doc.cs (GenerateEnumDocComment): Removed.
3046         
3047         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3048         (ConvertIntLiteral): Removed.
3049         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3050         
3051         * enum.cs (EnumMember): Implement IConstant.
3052         (Enum.IsValidEnumConstant): Removed.
3053         (Enum.GetNextDefaultValue): Removed.
3054         (Enum.FindMembers): Updated.
3055         (Enum.GenerateDocComment): Iterate enum members.
3056         
3057         * expression.cs (Cast.TryReduce): Handle enums correctly.
3058         (New.Constantify): Made public.
3059         (MemberAccess.DoResolve): Removed contant specific if(s).
3060         
3061         * literal.cs (NullLiteral): Implement new abstract methods.
3062         
3063         * statement.cs (GotoCase.Resolve): Use new constant methods.
3064         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3065         
3066         * typemanager.cs (LookupEnum): Removed.
3067         (IsEnumType): Fixed to work with corlib.
3068         (RegisterConstant): Removed.
3069         (LookupConstant): Removed.
3070         (GetConstant): Changed to work with IConstant.
3071
3072 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3073
3074         * location.cs : Fixed overflown (>255) column number.
3075
3076 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3077
3078         First cut of the qualified-alias-member feature.
3079         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3080         token.
3081         * cs-parser.jay (DOUBLE_COLON): New token.
3082         (namespace_or_type_name): Add rule for recognizing
3083         qualified-alias-members.
3084         (primary_expression): Likewise.
3085         (element_access): Allow QualifiedAliasMember as a possible
3086         type-bearing expression.
3087         (local_variable_type, local_variable_pointer_type): Likewise.
3088         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3089         aliases in the current and enclosing namespace declarations.
3090         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3091         * decl.cs (MemberName.is_double_colon): New.
3092         (MemberName.MemberName): Add new constructor for alias-member.
3093         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3094         * expression.cs (QualifiedAliasMember): New expression type.
3095
3096 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3097
3098         * location.cs : it borked when no argument was specified.
3099
3100 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3101
3102         * location.cs : tiny ToString() format fix.
3103
3104 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3105
3106         * statement.cs : oops, it was missing.
3107
3108 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3109
3110         A set of fixes for precise line/column location.
3111
3112         * location.cs :
3113           "token" field now holds a file/line "delta", a line number offset 
3114           from the segment, and a column number. See also:
3115           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3116           December/009508.html
3117           Removed static IsNull. Use instance IsNull property instead.
3118         * cs-tokenizer.cs :
3119           For some tokens it stores Location. For Identifier it stores
3120           LocatedToken which is a pair of string name and location.
3121           Column numbers are adjusted only at getChar().
3122         * report.cs :
3123           Use Location.ToString() for reporting (it now contains column).
3124         * cs-parser.jay :
3125           Largely modified to use LocatedToken instead of
3126           string (IDENTIFIER), and to acquire Location from some tokens.
3127         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3128           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3129           codegen.cs :
3130           Now MemberName holds Location. DeclSpace.ctor() receives Location
3131           as a parameter. Removed extra parameters to all derived classes.
3132           Replaced Location.IsNull() with instance property.
3133         * assign.cs, expression.cs :
3134           Added .ctor() overload that omits Location.
3135         * attribute.cs :
3136           Added "nameEscaped" flag that indicates the identifier was escaped
3137           in the source file. This fixes bug #57047.
3138
3139 2005-09-02  Martin Baulig  <martin@ximian.com>
3140
3141         * class.cs: Make CS3005 a warning, not an error.
3142
3143 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3144
3145         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3146         New method, looking for lo-case imported cls type.
3147
3148         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3149         here.
3150
3151         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3152
3153         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3154
3155         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3156         all_imported_types.
3157         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3158
3159         Optimized to save 3.5 MB for SWF compilation.
3160
3161 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3162
3163         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3164         (PartialContainer.Create): Moved logic AddToContainer.
3165         (PartialContainer.MarkForDuplicationCheck): Shares name.
3166         
3167         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3168         place.
3169         
3170         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3171         initialization.
3172         (Namespace.GetSignatureForError): New method.
3173         
3174         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3175         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3176
3177 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3178
3179         Fix #75669.
3180         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3181         member lookup rather than qualifier_type, since qualifier_type can
3182         be null.
3183
3184 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3185
3186         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3187         enum member.
3188
3189 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3190
3191         * statement.cs: Copy the local exception into the exception
3192         captured local.  Fixes 75674
3193
3194 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3195
3196         Fix #75658.
3197         * expression.cs (Invocation.OverloadResolve): Don't report error
3198         CS1501 if error CS1502 has been reported.
3199         (New.DoResolve): Delegate CS1501 reporting to
3200         Invocation.OverloadResolve.
3201
3202         Fix #75656.
3203         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3204         invariant-meaning-in-block property in an enclosing block if
3205         necessary.
3206
3207 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3208
3209         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3210         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3211         (Switch.CheckSwitch): Just save 50kb for SWF.
3212
3213 2005-07-27  Martin Baulig  <martin@ximian.com>
3214
3215         * anonymous.cs (CaptureContext.AddField): Added
3216         `AnonymousContainer am' argument; compute its toplevel scope if
3217         it's not already computed.  Fixes #75649.
3218
3219 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3220
3221         Fix #75628.
3222         * class.cs (Constructor.Emit): Reset block to null if the block
3223         resolve fails.
3224
3225 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3226
3227         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3228
3229 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3230
3231         * class.cs (MethodData.Define): Check whether accessor implementing
3232         interface is public.
3233
3234         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3235
3236 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3237
3238         Fix #57245
3239         * namespace.cs (LookupType): Moved same type check to...
3240         
3241         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3242         with the same name.
3243
3244 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3245
3246         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3247         already found a typebuilder.
3248         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3249         MemberNames, not strings.
3250
3251         * const.cs (Error_ExpressionMustBeConst): 
3252         Rename from Error_EpressionMustBeConst.
3253         * const.cs, class.cs, statement.cd: Update.
3254
3255 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3256
3257         Fix #65573
3258
3259         * const.cs (Const.LookupConstantValue): Report missing contant expression
3260         everytime.
3261         (Error_EpressionMustBeConstant): Only one error method.
3262
3263         * class.cs, statement.c: Updated.
3264
3265 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3266
3267         * statement.cs (Block.Flags): Add back HasVarargs.
3268         (Block.flags): Make protected.
3269         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3270
3271         * typemanager.cs (types, typecontainers, user_types): Remove.
3272         (UserTypes, TypeContainers): Likewise.
3273         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3274         (CleanUp, Reset): Update.
3275         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3276         (GetNestedType): Use Type.GetNestedType.
3277         (CoreLookupType): Take two arguments, the namespace and the
3278         basename of the type.  Update to use the Namespace.Lookup
3279         mechanism.
3280         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3281         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3282         string concatenation and substring matches.
3283         * class.cs, enum.cs, delegate.cs: Update to changes.
3284
3285 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3286
3287         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3288         Expression and made virtual.
3289
3290         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3291         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3292
3293         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3294
3295         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3296         error message.
3297
3298         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3299         change.
3300
3301 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3302
3303         Fix #57707
3304         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3305         AssemblyCultureAttribute is not used on executable.
3306
3307         * rootcontext.cs,
3308         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3309
3310 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3311
3312         Fix #60638.
3313         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3314         New.  Reports CS0252/CS0253.
3315         Mostly taken from preliminary patch by Duncak Mak.
3316         (Binary.DoResolveOperator): Store results of operator lookup.
3317         Use them to detect if we need to warn about unintended reference
3318         comparisons.
3319
3320 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3321
3322         Fix #72969.
3323         * namespace.cs (Namespace.Lookup): Add back location parameter.
3324         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3325         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3326
3327         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3328         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3329         (Namespace.LookupType): ... this.
3330         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3331         of namespaces.
3332         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3333         purported to handle pointers.
3334         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3335         CoreLookupType.
3336
3337 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3338
3339         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3340         type as namespace.
3341
3342 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3343
3344         * namespace.cs (Namespace.Lookup): Drop location parameter.
3345         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3346         (NamespaceEntry.Lookup): ... this.
3347         (NamespaceEntry.Error_AmbiguousTypeReference):
3348         Move here from DeclSpace.
3349         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3350         names ...
3351         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3352         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3353         Move to NamespaceEntry.
3354         * delegate.cs, expression.cs: Update to changes.
3355
3356 2005-08-31  Martin Baulig  <martin@ximian.com>
3357
3358         Committing a patch from Atsushi Enomoto for #75850.
3359
3360         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3361         Prefer a generic enumerator over a non-generic one.
3362
3363 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3364
3365         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3366         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3367
3368 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3369
3370         * driver.cs : reverting default encoding change as well as mcs.
3371
3372 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3373
3374         * driver.cs, support.cs : merged r48826.
3375           Marek Safer wrote:
3376           > could you integrate your mcs changes to gmcs otherwise
3377           > gmcs cannot compile some files.
3378
3379 2005-08-20  Martin Baulig  <martin@ximian.com>
3380
3381         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3382         scope if we don't already have it.
3383
3384         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3385         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3386         fixes #75867.
3387
3388 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3389
3390         * statement.cs: Copy the local exception into the exception
3391         captured local.  Fixes 75674
3392
3393 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3394
3395         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3396         type as namespace.
3397
3398 2005-08-12  Martin Baulig  <martin@ximian.com>
3399
3400         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3401         for nested types here to avoid hitting the cache too early.
3402
3403 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3404
3405         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3406         an error. 
3407
3408 2005-08-03  Martin Baulig  <martin@ximian.com>
3409
3410         Make iterators in generic methods work; see gtest-191.cs.
3411
3412         * generic.cs
3413         (Constraints.Resolve): Protect against being called twice.
3414
3415         * class.cs
3416         (TypeContainer.GetClassBases): Make this `protected virtual'.
3417
3418         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3419         (Iterator.GetClassBases): Override this and compute the base
3420         classes here.
3421         (Iterator.DefineNestedTypes): If we're a generic method, all our
3422         method type parameters become class type parameters on the proxy
3423         class.
3424
3425         * statement.cs
3426         (ToplevelBlock.Parameters): Make this a property, not a field.
3427         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3428
3429 2005-08-03  Martin Baulig  <martin@ximian.com>
3430
3431         * typemanager.cs (TypeManager.IsSubclassOf): Use
3432         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3433         (TypeManager.GetFullName_recursed): Improved.
3434
3435 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3436
3437         Fix #75417
3438         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3439         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3440         invocation_type == mi.DeclaringType, since the first one also checks
3441         other condition used by generic instances.
3442         
3443 2005-07-27  Martin Baulig  <martin@ximian.com>
3444
3445         * anonymous.cs (CaptureContext.AddField): Added
3446         `AnonymousContainer am' argument; compute its toplevel scope if
3447         it's not already computed.  Fixes #75649.
3448
3449 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3450
3451         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3452         CheckAttributeType and refactored.
3453         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3454         ResolveAsTypeTerminal error handling.
3455         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3456         handling.
3457         (GetSignatureForError): Print errors in same way.
3458
3459         * class.cs,
3460         * codegen.cs: Reflect attribute GetSignatureForError change.
3461
3462         * ecore.cs,
3463         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3464
3465         * namespace.cs (UsingEntry): Refactored to make fields private.
3466
3467         * assign.cs,
3468         statement.cs: Error_UnexpectedKind has extra parameter.
3469
3470 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3471
3472         * ecore.cs (IAlias): Remove.
3473         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3474         that implement the interface.
3475         * namespace.cs (Namespace): Likewise.
3476         (Namespace.declspaces): Renamed from 'defined_names'.
3477         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3478         DeclSpace instead of an IAlias.
3479         * tree.cs (Tree.AddDecl): Update.
3480
3481 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3482
3483         * statement.cs (Block.Flags); Remove HasVarargs.
3484         (Block.HasVarargs): Move to ToplevelBlock.
3485         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3486         (Block.Variables): Make protected.  Initialize variable hashtable
3487         if necessary.
3488         (Block.AddVariable): Update.
3489         (Block.Resolve): Update to changes.
3490         (ToplevelBlock.HasVarargs): New boolean.
3491         (ToplevelBlock.ThisVariable): Move here from Block.
3492         (ToplevelBlock.AddThisVariable): Likewise.
3493         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3494         * expression.cs (This.ResolveBase): Update to changes.
3495         (ArglistAccess.DoResolve): Likewise.
3496
3497 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3498
3499         Fix #75321
3500         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3501
3502         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3503         not used and not used & assigned.
3504         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3505
3506 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3507
3508         Fix #75053
3509         * expression.cs (Is.DoResolve): null is never provided type.
3510
3511 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3512
3513         Fix #52496
3514         * cs-parser.jay: Less strict event error rule to catch more errors.
3515
3516 2005-07-11  Martin Baulig  <martin@ximian.com>
3517
3518         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3519         for the constructor constraint: we do not only have to check
3520         whether the class has a public constructor, but also ensure that
3521         it's parameterless.  Fixes #75492.
3522
3523 2005-07-11  Martin Baulig  <martin@ximian.com>
3524
3525         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3526         between type parameters if they either have the reference type
3527         constraint or the class constraint.
3528
3529 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3530
3531         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3532
3533 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3534
3535         Fix #74975
3536         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3537         (ExtractSecurityPermissionSet): Cope with self referencing security
3538         attributes properly.
3539
3540         * driver.cs (SetOutputFile): Made public property OutputFile.
3541
3542 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3543
3544         Fix #75486.
3545         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3546         has_nonstatic_fields.  Make into a FieldBase pointer.
3547         (TypeContainer.AddField): Add CS0282 check.
3548         (TypeContainer.EmitType): Update.
3549
3550 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3551
3552         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3553         compare if they start with __.
3554
3555 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3556
3557         * statement.cs (Switch.SwitchGoverningType): Only look at
3558         UserCasts that don't need implicit standard conversions to one of
3559         the allowed switch types (Fixes test-322.cs).
3560         (LocalInfo.Resolve): Re-enable sanity-test.
3561
3562 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3563
3564         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3565         
3566         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3567         
3568         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3569
3570 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3571
3572         Fix #75472.
3573         * ecore.cs (SimpleName.GetSignatureForError): Add.
3574         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3575         (MemberAccess.GetSignatureForError): Add.
3576
3577 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3578  
3579         The big error and warning messages review.
3580         
3581         * anonymous.cs,
3582         * assign.cs,
3583         * attribute.cs,
3584         * class.cs,
3585         * codegen.cs,
3586         * convert.cs,
3587         * cs-parser.jay,
3588         * cs-tokenizer.cs,
3589         * decl.cs,
3590         * delegate.cs,
3591         * doc.cs,
3592         * driver.cs,
3593         * ecore.cs,
3594         * enum.cs,
3595         * expression.cs,
3596         * flowanalysis.cs,
3597         * iterators.cs,
3598         * literal.cs,
3599         * location.cs,
3600         * modifiers.cs,
3601         * namespace.cs,
3602         * parameter.cs,
3603         * pending.cs,
3604         * report.cs,
3605         * rootcontext.cs,
3606         * statement.cs,
3607         * support.cs,
3608         * tree.cs,
3609         * typemanager.cs: Updated.
3610         
3611         * class.cs: (MethodCore.SetYields): Moved here to share.
3612         (PropertyMethod.Define): Moved iterator setup here.
3613         
3614         * iterators.cs: Add orig_method to have full access to parent
3615         container.
3616
3617 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3618
3619         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3620         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3621         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3622         variable of struct type.
3623         * expression.cs (Unary.ResolveOperator): Update to change.
3624         (Indirection.VerifyFixed): Likewise.
3625         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3626         (ParameterReference.VerifyFixed): Value parameters are fixed.
3627         (This.VerifyFixed): Treat 'this' as a value parameter.
3628         * statement.cs (LocalInfo.IsFixed): Remove.
3629
3630 2005-07-01  Martin Baulig  <martin@ximian.com>
3631
3632         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3633         `ec.EmitThis ()' to get the correct scope.
3634
3635 2005-07-01  Martin Baulig  <martin@ximian.com>
3636
3637         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3638         instance is a ParameterReference; fixes #75299.
3639
3640 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3641
3642         Fix #75412.
3643         * expression.cs (Indexers.map): Remove.
3644         (Indexers.Append): Filter out inaccessible setters and getters.
3645         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3646
3647         Fix #75283.
3648         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3649         Refactored from ...
3650         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3651         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3652         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3653         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3654
3655 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3656
3657         Fix #75322
3658         * class.cs (FieldBase.GetInitializerExpression): One more field
3659         for backup.
3660
3661 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3662
3663         * pending.cs: Do not define a proxy if the base method is virtual,
3664         it will be picked up by the runtime (bug 75270).
3665
3666 2005-07-08  Martin Baulig  <martin@ximian.com>
3667
3668         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3669         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3670
3671 2005-07-07  Martin Baulig  <martin@ximian.com>
3672
3673         * generic.cs (ConstructedType.CheckConstraint): Use
3674         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3675         called recursively; fixes #75329.
3676
3677 2005-07-06  Martin Baulig  <martin@ximian.com>
3678
3679         * generic.cs (TypeManager.InferTypeArguments): Added support for
3680         anonymous methods; fixes #75461.
3681
3682 2005-07-01  Martin Baulig  <martin@ximian.com>
3683
3684         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3685         `ec.EmitThis ()' to get the correct scope.
3686
3687 2005-07-01  Martin Baulig  <martin@ximian.com>
3688
3689         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3690         instance is `This'; fixes #75299.
3691
3692 2005-06-30  Martin Baulig  <martin@ximian.com>
3693
3694         * class.cs (Indexer): Implement IIteratorContainer; added support
3695         for iterators in indexers.
3696
3697         * codegen.cs
3698         (EmitContext.CurrentIterator): Make this a property, not a field.
3699
3700         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3701
3702 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3703
3704         * pending.cs: Do not define a proxy if the base method is virtual,
3705         it will be picked up by the runtime (bug 75270).
3706
3707 2005-06-28  Martin Baulig  <martin@ximian.com>
3708
3709         * cs-parser.jay (interface_method_declaration): Avoid a
3710         reduce/reduce conflict by moving some of the code into a separate
3711         `interface_method_declaration_body' rule; fixes #75368.
3712
3713 2005-06-28  Martin Baulig  <martin@ximian.com>
3714
3715         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3716         array check after the check for TypeBuilder's.
3717
3718 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3719
3720         * convert.cs (FindMostEncompassedType): Add two trivial special
3721         cases (number_of_types == 0 || number_of_types == 1).
3722         (FindMostEncompasingType): Likewise.
3723
3724 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3725
3726         Some cleanups preparing for the fix of #75283.
3727         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3728         error testing.
3729         (EventExpr.InstanceResolve): Likewise.
3730         (EventExpr.DoResolve): Remove redundant checks.
3731
3732 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3733
3734         * class.cs: Small fix.
3735
3736 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3737
3738         Fix #75160.
3739         * class.cs (GetPartialBases): Fix return value check of
3740         part.GetClassBases.
3741
3742 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3743
3744         Ensure that partial classes are registered in their enclosing
3745         namespace.  Initial part of fix of #75160.
3746         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3747         Register declspace with namespace here, not in
3748         DeclSpace.RecordDecl.
3749         * cs-parser.jay: Pass namespace to RecordDecl.
3750         * class.cs (PartialContainer.Create): Likewise.
3751         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3752         called.
3753         * decl.cs (Declspace.RecordDecl): Remove.
3754         * namespace.cs (NamespaceEntry.DefineName): Remove.
3755
3756 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3757
3758         * rootcontext.cs: Reset TargetExt as well.
3759
3760 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3761
3762         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3763         -langversion:ISO-1.
3764
3765 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3766
3767         Fix #75080, cs0119.cs.
3768         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3769         of ...
3770         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3771         allowing ExprClass.Type and ExprClass.Namespace for
3772         ResolveFlags.VariableOrValue.
3773         (Expression.Resolve) [1-argument variant]: Change default resolve
3774         flags based on language version.
3775         (Expression.Error_UnexpectedKind): Use a simple string array
3776         rather than an ArrayList.
3777         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3778         not ExprClass.Type.
3779         (TypeOfVoid.DoResolve): Likewise.
3780         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3781         flags argument -- it always has the same value.
3782
3783 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3784
3785         Fix #75081.
3786         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3787         Use it in the error message.
3788         * assign.cs, expression.cs, statement.cs: Update.
3789
3790 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3791
3792         Fix #75088.
3793         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3794         the "almostMatchedMember" case too.
3795         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3796         that failed the accessibility checks to 'almost_match'.
3797
3798 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3799
3800         * attribute.cs: Use internal MethodBuilder methods to set
3801         ExactSpelling and SetLastError on PInvoke methods, instead
3802         of passing them via charset.  Fixes #75060.
3803
3804 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3805
3806         * parameter.cs (Parameter): Remove TODO comment.
3807         (Parameter.DefineParameter): Remove Location parameter.
3808         (Parameters.LabelParameters): Likewise.
3809         * class.cs (Constructor.Emit): Update to change.
3810         (MethodData.Emit): Likewise.
3811         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3812         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3813
3814 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3815
3816         * parameter.cs,
3817           Removed Parameters.Location and added Parameter.Location instead.
3818           Removed Location parameter from Emit() and GetSignature().
3819         * anonymous.cs,
3820           class.cs,
3821           cs-parser.jay,
3822           delegate.cs,
3823           iterators.cs,
3824           statement.cs :
3825           Modified all related calls.
3826
3827 2005-06-21  Martin Baulig  <martin@ximian.com>
3828
3829         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3830         left-hand side is not a nullable type; fixes #75328.
3831
3832 2005-06-21  Martin Baulig  <martin@ximian.com>
3833
3834         * typemanager.cs
3835         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3836         (TypeManager.GetFullNameSignature): Likewise.
3837
3838         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3839         `source.FullName' and `target.FullName' to check whether there are
3840         two conflicting definitions.
3841
3842 2005-06-21  Martin Baulig  <martin@ximian.com>
3843
3844         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3845         a BoxedCast - also for reference types - to be compatible with csc.
3846
3847 2005-06-21  Martin Baulig  <martin@ximian.com>
3848
3849         * expression.cs (MemberAccess.DoResolve): Add support for nested
3850         types in a generic instance; fixes #75320.
3851
3852 2005-06-20  Martin Baulig  <martin@ximian.com>
3853
3854         * generic.cs (TypeManager.InferType): Also walk the class
3855         hierarchy for generic instances; fixes #75261.
3856
3857 2005-06-17  Martin Baulig  <martin@ximian.com>
3858
3859         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3860         to make things work for corlib.
3861
3862 2005-06-15  Martin Baulig  <martin@ximian.com>
3863
3864         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3865         obsolete `SecurityAction' values.
3866
3867 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3868
3869         * rootcontext.cs: Reset TargetExt as well.
3870         
3871 2005-06-09  Martin Baulig  <martin@ximian.com>
3872
3873         * delegate.cs (Delegate.VerifyMethod): Added
3874         `MethodGroupExpr old_mg' argument; inherit its
3875         `HasTypeParameters'; fix #75085.
3876
3877 2005-06-09  Martin Baulig  <martin@ximian.com>
3878
3879         * expression.cs (Invocation.OverloadResolve): Correctly handle
3880         generic methods for the SetMemberIsUsed(); fix #75064.
3881
3882 2005-06-09  Martin Baulig  <martin@ximian.com>
3883
3884         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3885         fixes #75062.
3886
3887 2005-06-08  Martin Baulig  <martin@ximian.com>
3888
3889         * cs-parser.jay (nullable_type_or_conditional): If we put the
3890         nullable back and our `type' is a `ComposedCast', remove the
3891         nullable from it.  Fixes #75156.
3892
3893         * expression.cs (ComposedCast.RemoveNullable): New public method.
3894
3895 2005-06-08  Martin Baulig  <martin@ximian.com>
3896
3897         The big Iterators rewrite :-)
3898
3899         * iterators.cs: Rewrite this to use the anonymous methods framework.
3900
3901         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3902         before the TypeContainers; see 2test-21.cs.
3903
3904         * class.cs
3905         (TypeContainer.DefineType): Don't create a new EmitContext if we
3906         already have one (this only happens if we're an Iterator).
3907         (TypeContainer.Define): Also call Define() on all our iterators.
3908         (Method.CreateEmitContext): Added support for iterators.
3909
3910         * anonymous.cs
3911         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3912         (AnonymousContainer.CreateMethodHost): Moved here from
3913         AnonymousMethod and made abstract.
3914         (AnonymousContainer.CreateScopeType): New abstract method.
3915         (AnonymousContainer.IsIterator): New public property.
3916         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3917         get the ScopeTypeBuilder rather than manually defining it here. 
3918         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3919         iterators here.
3920
3921         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3922         before RootContext.DefineTypes().
3923
3924         * codegen.cs (EmitContext.RemapToProxy): Removed.
3925         (EmitContext.CurrentAnonymousMethod): Changed type from
3926         AnonymousMethod -> AnonymousContainer.
3927         (EmitContext.ResolveTopBlock): Protect from being called twice.
3928         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3929         (EmitContext.EmitThis): Removed the iterators hacks; use the
3930         anonymous methods framework for that.
3931
3932         * statement.cs
3933         (ToplevelBlock.Container): Make this a property, not a field.
3934         (ToplevelBlock.ReParent): New public method; move the
3935         ToplevelBlock into a new container.
3936         (Foreach.TemporaryVariable): Simplify.
3937
3938 2005-06-05  Martin Baulig  <martin@ximian.com>
3939
3940         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3941         (Block.AddTemporaryVariable): New public method; creates a new
3942         `LocalInfo' for a temporary variable.
3943         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3944         variables here.
3945         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3946         non-iterator variables.
3947
3948 2005-06-05  Martin Baulig  <martin@ximian.com>
3949
3950         * statement.cs (Foreach.TemporaryVariable): Create the
3951         LocalBuilder in the Emit phase and not in Resolve since in some
3952         situations, we don't have an ILGenerator during Resolve; see
3953         2test-19.cs for an example.
3954
3955 2005-06-04  Martin Baulig  <martin@ximian.com>
3956
3957         The big Foreach rewrite - Part II.
3958
3959         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3960         with `PropertyInfo ienumerator_getcurrent'.
3961
3962         * codegen.cs (VariableStorage): Removed.
3963
3964         * statement.cs
3965         (Foreach): Derive from Statement, not ExceptionStatement.
3966         (Foreach.CollectionForeach): New nested class.  Moved all the code
3967         dealing with collection foreach here.
3968         (Foreach.ForeachHelperMethods): Removed.
3969         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3970
3971 2005-05-23  Martin Baulig  <martin@ximian.com>
3972
3973         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3974         don't need to.  Fix #75014.
3975
3976 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3977
3978         Improve user-defined conversion handling.
3979         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3980         applicable operators.
3981         (AddConversionOperators): New.  Helper for GetConversionOperators.
3982         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3983         there is only one most encompassed/encompassing type.
3984         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3985         "applicable operator" handling.
3986         (UserConversion): Move cache here from GetConversionOperators.
3987         Directly cache the chosen operator, rather than the whole
3988         MethodGroup.
3989         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3990         case.  Allow conversion of decimal to sbyte and byte too.
3991         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3992         New static methods.  Used to avoid allocating EmptyExpressions in
3993         convert.cs.
3994
3995 2005-05-24  Duncan Mak  <duncan@novell.com>
3996
3997         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3998         another class, used in Convert.ExplicitNumericConversion.
3999         (CastToDecimal): New class, similar to above, but casts to
4000         System.Decimal, used in Convert.ImplicitNumericConversion and also
4001         in explicit convesion from double/float to decimal.
4002
4003         * convert.cs (ImplicitNumericConversion): Handle implicit
4004         conversions to System.Decimal.
4005         (ExplicitNumericConversion): handle explicit conversions to
4006         System.Decimal.
4007
4008         This fixes #68711.
4009         
4010 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4011
4012         * typemanager.cs: Do not throw an exception in the TypeBuilder
4013         case, we take care of it on the TypeCode.
4014
4015 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4016         
4017         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4018         is back.
4019         
4020         * cs-parser.jay: Catch more lexical errors.
4021         
4022         * report.cs: Add one more Error method.
4023         
4024         * rootcontext.cs,
4025         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4026
4027 2005-05-20  Martin Baulig  <martin@ximian.com>
4028
4029         * class.cs (TypeContainer.CircularDepException): Removed.
4030         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4031         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4032         (CS0146) and interface (CS0529) dependencies here.
4033
4034 2005-05-20  Martin Baulig  <martin@ximian.com>
4035
4036         * expression.cs (New.DoResolve): Move the CS0712 check above the
4037         CS0144 check; otherwise it can never be reached.
4038
4039 2005-05-20  Martin Baulig  <martin@ximian.com>
4040
4041         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4042
4043 2005-05-20  Martin Baulig  <martin@ximian.com>
4044
4045         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4046
4047         * typemanager.cs (TypeManager.IsAttributeType): New public method.
4048
4049 2005-05-19  Martin Baulig  <martin@ximian.com>
4050
4051         * delegate.cs
4052         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4053         to disable error reporting.
4054
4055         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4056         here since we don't want to report an error; see the new test-336.cs.
4057
4058 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4059
4060         * statement.cs (ToplevelBlock.GetParameterReference)
4061         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4062         Move here from class Block.
4063         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4064         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4065
4066 2005-05-18  Martin Baulig  <martin@ximian.com>
4067
4068         Fix #74978.
4069
4070         * flowanalysis.cs
4071         (FlowBranching.Reachability): Add non-static public And() and Or()
4072         methods.
4073         (FlowBranchingSwitch): New class; do the `break_origins' thing
4074         like in FlowBranchingLoop.
4075         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4076         reachability, not just locals and parameters.
4077         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4078         switch; MergeBreakOrigins() now takes care of that.
4079
4080 2005-05-18  Martin Baulig  <martin@ximian.com>
4081
4082         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4083         a loop and may leave it, reset the barrier; fixes #74974.
4084
4085 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4086
4087         Fix test-382.cs.  Emit values of decimal constants.
4088         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4089         Carved out of ...
4090         (TypeContainer.AddField): ... this.
4091         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4092         with initializers to include 'Const's.
4093         (ClassPart.RegisterFieldForInitialization): Forward to
4094         PartialContainer.
4095         * const.cs (Const.Const): Pass initializer to base class.
4096         (Const.Define): In case of decimal constants, register them for
4097         initialization in a static constructor.
4098
4099 2005-05-14  Martin Baulig  <martin@ximian.com>
4100
4101         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4102         do not call ResolveUnreachable() on unreachable statements in
4103         here, see the comment in the source code.
4104
4105 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4106
4107         Fix #74934.
4108         * expression.cs (BinaryResolveOperator): If one of the operands of
4109         an equality comparison is 'null' and the other is a pointer type,
4110         convert the null to a NullPointer.
4111         * convert.cs (ImplicitReferenceConversion): If the expression is a
4112         NullLiteral and the target type is a pointer type, return a
4113         NullPointer instead.
4114         (ImplicitConversionStandard): Likewise.
4115
4116 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4117         
4118         * cs-parser.jay: Set readonly context based on special constructs.
4119         
4120         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4121         readonly variable error handling.
4122         
4123         * rootcontext.cs (EmitCode): Don't verify members when error
4124         occurred.
4125         
4126         * statement.cs (LocalInfo): Add reaodnly context information.
4127         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4128
4129 2005-05-17  Martin Baulig  <martin@ximian.com>
4130
4131         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4132         #70970. 
4133
4134 2005-05-13  Martin Baulig  <martin@ximian.com>
4135
4136         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4137         handle unreachable blocks.
4138
4139 2005-05-13  Martin Baulig  <martin@ximian.com>
4140
4141         * class.cs
4142         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4143         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4144         #74905. 
4145
4146 2005-05-13  Martin Baulig  <martin@ximian.com>
4147
4148         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4149         instance variable, not a local.  Fix #74873.
4150         (Block.ResolveUnreachable): Set it to true here.
4151
4152 2005-05-12  Martin Baulig  <martin@ximian.com>
4153
4154         * cs-parser.jay (property_declaration): Pass the `current_class',
4155         not the `current_container' to Property's .ctor.  Fixes #74912.
4156
4157 2005-05-11  Martin Baulig  <martin@ximian.com>
4158
4159         * typemanager.cs (Closure): Copy this from MCS and merge all the
4160         GMCS-specific changes into it.
4161
4162 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4163
4164         Fix #74920.
4165         * typemanager.cs (unmanaged_enclosing_types): New.
4166         (IsUnmanagedType): Avoid infloops by using
4167         'unmanaged_enclosing_types' to talk with recursive invocations.
4168
4169 2005-05-11  Duncan Mak  <duncan@novell.com>
4170
4171         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4172         continuing to process for 'arg'.
4173         (handle_preprocessing_directive): Check the argument of the #endif
4174         directive and report error CS1025 if there are any trailing
4175         characters.
4176
4177         According to the C# spec, having even whitespace after the #endif
4178         directive is illegal; however, because we call arg.TrimEnd ()
4179         beforehand, we have the same behavior as csc, allowing whitespace
4180         after the directive.
4181
4182         Fixes #74892.
4183
4184 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4185
4186         Fix #74863.
4187         
4188         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4189         (Constructor.GetObsoleteAttribute): Implemented correctly.
4190
4191 2005-05-10  Martin Baulig  <martin@ximian.com>
4192
4193         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4194         resolve the type; fixes #74864.
4195         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4196         in DoResolve(); fixes #74862.
4197
4198 2005-05-10  Martin Baulig  <martin@ximian.com>
4199
4200         * support.cs (ReflectionParameters.ParameterModifier): Use
4201         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4202         and `ParameterAttributes.In'.  Fixes #74884.
4203
4204 2005-05-10  Martin Baulig  <martin@ximian.com>
4205
4206         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4207         the cache if we're just looking for `MemberTypes.NestedType' in a
4208         generic instance.
4209
4210         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4211         constraints if we're still resolving the type tree.
4212         (Expression.MemberLookup): If we're resolving the type tree, only
4213         look for `MemberTypes.NestedType' since we're only interested in
4214         getting types.
4215
4216         * class.cs (TypeContainer.DefineType): Don't resolve the type
4217         parameters here; do this later in ResolveType() after the type
4218         tree has been resolved.
4219         (TypeContainer.ResolveType): New public method; this is called
4220         after the type tree is resolved and before the types are being
4221         populated.  We resolve the generic constraints here.
4222         (TypeContainer.DoDefineMember): Check the constraints on our base
4223         class and interfaces.
4224
4225         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4226         set the `ResolvingTypeTree' flag on the EmitContext.
4227
4228         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4229
4230 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4231
4232         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4233         
4234         * expression.cs (Argument.GetParameterModifier): Turned to property.
4235         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4236         
4237         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4238         its C# equivalent.
4239         
4240 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4241
4242         Fix #74852.
4243         * decl.cs (MemberCache.AddMethods): Register override methods,
4244         rather than non-override methods.
4245         * typemanager.cs (RegisterOverride): New.
4246         (IsOverride): Update.
4247
4248 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4249
4250         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4251
4252 2005-05-06  Martin Baulig  <martin@ximian.com>
4253
4254         * attribute.cs
4255         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4256         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4257
4258 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4259
4260         Fix #73105.
4261         
4262         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4263         recursive declaration.
4264         
4265         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4266         
4267 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4268
4269         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4270         
4271         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4272
4273 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4274
4275         Fix #74797.
4276         * decl.cs (DeclSpace.FamilyAccessible): 
4277         Use TypeManager.IsNestedFamilyAccessible.
4278
4279         Fix reopened #64812.
4280         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4281         internal'.
4282
4283 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4284             Abin Thomas  <projectmonokochi@rediffmail.com>
4285             Anoob V E  <projectmonokochi@rediffmail.com>
4286             Harilal P R  <projectmonokochi@rediffmail.com>
4287
4288         Fix #64812.
4289         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4290         allow access to all static members.
4291
4292 2005-05-04  Martin Baulig  <martin@ximian.com>
4293
4294         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4295
4296 2005-05-04  Martin Baulig  <martin@ximian.com>
4297
4298         Fix #74655.
4299
4300         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4301         section at the end; make things work if `default' is not the last
4302         section.        
4303
4304 2005-05-04  Martin Baulig  <martin@ximian.com>
4305
4306         Fix #70400.
4307
4308         * statement.cs (Switch): Replaced the `got_default' field with a
4309         `default_section' one.
4310         (Switch.CheckSwitch): Set `default_section' here.
4311         (Switch.Resolve): If we're a constant switch and the constant is
4312         not found, use the default section.
4313
4314 2005-05-03  Martin Baulig  <martin@ximian.com>
4315
4316         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4317
4318         * statement.cs (Foreach.ArrayForeach): New nested class.
4319         (Foreach.TemporaryVariable): New nested class.
4320         (Foreach.EmitArrayForeach): Removed; this is now in the new
4321         ArrayForeach class.
4322
4323 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4324
4325         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4326         more conservative.
4327         (VerifyPendingMethods): Revert change below.
4328
4329         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4330         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4331         that used to trigger warning -28.  Remove warning -28.
4332         * expression.cs (Invocation.OverloadResolve): Use
4333         TypeManager.IsOverride to distinguish override methods.
4334
4335         Fix #74773.
4336         * pending.cs (VerifyPendingMethods): If a base type implements the
4337         requested interface, don't bother checking individual methods of
4338         the base type.  As a side-effect, this prevents the creation of
4339         unnecessary proxies.
4340
4341 2005-05-02  Martin Baulig  <martin@ximian.com>
4342
4343         Fix #70182.
4344
4345         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4346         Also `And' the locals if the old vector is null.
4347         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4348         null; in this case we basically reset all the variables.        
4349
4350 2005-05-02  Martin Baulig  <martin@ximian.com>
4351
4352         Fix #74529.
4353
4354         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4355         Added `FlowBranching branching' argument; always `and' the
4356         variables instead of `or'ing them unless we're an infinite loop.
4357
4358         * statement.cs (While.Resolve): Create a new sibling unless we're
4359         infinite.       
4360
4361 2005-05-02  Martin Baulig  <martin@ximian.com>
4362
4363         Fix #70140.
4364
4365         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4366         arguments; use it instead of creating a new TopLevelBlock.
4367         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4368         our ConstructorInitializer.
4369
4370         * statement.cs
4371         (TopLevelBlock.TopLevelBranching): New public property.
4372         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4373         and create our `TopLevelBranching'.
4374
4375         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4376         anonymous method host, use `block.TopLevelBranching' rather than
4377         creating a new branching.
4378
4379 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4380
4381         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4382         a ScopeInfo, if any of the current children is a child of the new
4383         entry, move those children there.
4384
4385 2005-04-30  Martin Baulig  <martin@ximian.com>
4386
4387         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4388         at the beginning of a SwitchSection.  Fix #73335.
4389
4390 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4391
4392         Fix #74378
4393         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4394         
4395         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4396         (FieldExpr.DoResolve): Obsolete members are ignored for field
4397         initializers.
4398         
4399 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4400
4401         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4402         of arrays detection.
4403
4404         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4405         verification.
4406         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4407
4408         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4409         arrays report.
4410
4411 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4412
4413         * cs-parser.jay: Use the prefered version of -unsafe in error
4414         message.
4415
4416 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4417
4418         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4419         circumstances.
4420
4421 2005-04-20  John Luke  <john.luke@gmail.com>
4422
4423         * driver.cs: fix typo in error message, --outout to --output
4424
4425 2005-04-30  Martin Baulig  <martin@ximian.com>
4426
4427         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4428         handle the .NET 2.x security attributes.
4429
4430 2005-04-30  Martin Baulig  <martin@ximian.com>
4431
4432         * typemanager.cs
4433         (TypeManager.ExpandInterfaces): Don't add things twice.
4434
4435         * class.cs
4436         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4437
4438 2005-04-29  Martin Baulig  <martin@ximian.com>
4439
4440         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4441
4442         * anonymous.cs: Added support for anonymous generic methods.
4443
4444 2005-04-29  Martin Baulig  <martin@ximian.com>
4445
4446         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4447         generic instances.
4448
4449 2005-04-29  Martin Baulig  <martin@ximian.com>
4450
4451         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4452
4453         * expression.cs (New.DoResolve): Fix the CS0304 check.
4454
4455 2005-04-29  Martin Baulig  <martin@ximian.com>
4456
4457         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4458         naming schema.
4459
4460         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4461         explicit interface implementation, compare the interface types.
4462         (MethodData.Define): Use the new naming scheme from the latest
4463         .NET 2.x beta2.
4464         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4465
4466         * decl.cs (MemberName.GetMemberName): Removed.
4467         (MemberName.MethodName, FullName): New properties.
4468
4469 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4470
4471         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4472
4473 2005-04-22  Martin Baulig  <martin@ximian.com>
4474
4475         * generic.cs (GenericMethod): Create the EmitContext in the
4476         `Define()'; in `Define(MethodBuilder)', create the type parameters
4477         before calling `Define()'.  Fixes #73933.
4478
4479 2005-04-22  Martin Baulig  <martin@ximian.com>
4480
4481         * generic.cs
4482         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4483         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4484
4485         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4486         ConstructedType, check its constraints.
4487
4488 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4489
4490         * codegen.cs (InRefOutArgumentResolving): New field.
4491         
4492         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4493         fields outside contructor.
4494         
4495         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4496         
4497 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4498
4499         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4500         parameter code was not completed ever, so it was not as up-to-date
4501         as local variables.  Must finish it.
4502
4503         The bug fix was to compare the Toplevel of the block, not the
4504         current block.  Thanks for Ben for pointing this out. 
4505
4506 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4507
4508         * decl.cs (AddMethods): Use the declaring type of the problem
4509         method to determine if we want to squash a warning.
4510
4511 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4512
4513         * attribute.cs: Removed debug output.
4514
4515         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4516         
4517         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4518         Report.Stderr.
4519         
4520 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4521
4522         Fix #74481.
4523         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4524         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4525         all null comparisons against reference types.
4526
4527 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4528
4529         Fix# 74565
4530         * class.cs (TypeContainer.CircularDepException) New nested
4531         exception class.
4532         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4533         (TypeContainer.DefineType): Removed error, reset InTransit before
4534         exit.
4535         (Class.DefineType): Throw exception when is in Transit.
4536         Catch exception and report error.
4537         (Struct.DefineType): Throw exception when is in Transit.
4538         Catch exception and report error.
4539         (Interface.DefineType): Throw exception when is in Transit.
4540         Catch exception and report error.
4541
4542         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4543         handle nested exception handlers.
4544
4545         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4546         a catch.
4547
4548         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4549         InFinally and InCatch storage.
4550
4551         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4552         (Catch.Resolve): Set and Restore ec.InCatch.
4553         (Try.Resolve): Set and Restore ec.InFinally.
4554         (Try.HasCatch): True when try has catch.
4555
4556 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4557
4558         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4559           for the same event member, so exclude such cases from warning 419.
4560           Fixed bug #74633.
4561
4562 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4563
4564         * expression.cs (Binary.ResolveOperator): Apply patch from John
4565         Luke to fix bug 59864: operators &, | and ^ on enumerations
4566         require that the same enum type on both sides.
4567
4568         * driver.cs: Add warnings to old flag usage, this is to assist
4569         people who produce Makefiles and hope that the Makefiles will be
4570         used on Windows.
4571
4572         * class.cs (TypeContainer.EmitType): Moved the definition of the
4573         special $PRIVATE$ field from the resolve phase to the Emit phase.
4574         During resolve we do not know if we are a struct with
4575         HasExplicitLayout, we know this only after the attributes for the
4576         type are emitted.
4577
4578         Set the FieldOffset to zero on the dummy field that we create for
4579         the class.   Fixes 74590.
4580
4581 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4582
4583         Fix #73834.
4584         * ecore.cs (PropertyExpr.resolved): New.
4585         (DoResolve): Use it to handle a case of double resolution here.
4586         Handle a case of identical-name-and-type-name.
4587         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4588         resolution by storing the results of expression resolution back
4589         into the "probes" array.
4590
4591 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4592
4593         Fix cs0208-7.cs and cs0208-8.cs.
4594         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4595         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4596         error reporting to point out the reason a struct is not unmanaged.
4597
4598 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4599
4600         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4601           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4602
4603 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4604
4605         Fix #74528.
4606         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4607         IdenticalNameAndTypeName here.
4608         (EventExpr.InstanceResolve): Likewise.
4609
4610 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4611
4612         C# 2.0 DefaultCharSetAttribute implementation
4613         
4614         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4615         which allows us to set GlobalNamespace for every resolve.
4616         (Attribute.ResolveArguments): Cut from Resolve.
4617         (Attribute.GetCharSetValue): Returns CharSet named argument.
4618         (Attribute.DefinePInvokeMethod): Gets default charset from
4619         module settings.
4620         (GlobalAttribute.ResolveAsTypeStep): Override.
4621         (GlobalAttribute.ResolveArguments): Override.
4622         
4623         * class.cs (TypeAttr): Is protected.
4624         
4625         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4626         (ModuleClass.DefaultCharSetType): New memeber.
4627         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4628         
4629         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4630         charset from module.
4631         
4632         * delegate.cs (TypeAttr): Override.
4633         (Delegate.DefineType): Use this TypeAttr.
4634         
4635         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4636         at very early stage (before types are defined) to resolve model
4637         module attributes. It will probably not work with corlib but it
4638         should be ok.
4639         
4640         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4641         charset from module.
4642         
4643         * typemanager.cs (default_charset_type): New type.
4644
4645 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4646
4647         * decl.cs (MemberCache.AddMethods): Don't warn if
4648         System.Object.Finalize has buggy MethodAttributes.
4649
4650         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4651         removed below.
4652
4653 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4654
4655         * doc.cs : detect ambiguous reference to overloaded members.
4656           Fixed bug #71603. MS 1.1 csc does not detect it.
4657
4658 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4659
4660         * doc.cs : delegates must not be referenced with parameters.
4661           Fixed bug #71605.
4662
4663 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4664
4665         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4666
4667 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4668
4669         * driver.cs (MainDriver): Stop processing if the CLS stage found
4670         errors. 
4671
4672         (CompilerCallableEntryPoint.InvokeCompiler): Always
4673         reset after execution;   Take a TextWriter argument for the
4674         output.
4675
4676         * report.cs: Use the error stream instead of hardcoding stderr. 
4677
4678 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4679
4680         * class.cs: Reduce code paths to test, too small of an
4681         optimization to make it worth the extra testing.  Always perform
4682         it. 
4683
4684 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4685
4686         Fix #74510.
4687         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4688         operators that had errors reported on them.
4689
4690 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4691
4692         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4693         argument types.
4694         (Attribute.Resolve): Add named argument type checking.
4695         
4696         * class.cs (FixedField.Define): Use IsPrimitiveType
4697         
4698         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4699         
4700         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4701         unsafe parameter types.
4702         
4703         * statement.cs (Using.ResolveExpression): Add better error description.
4704         
4705         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4706         
4707 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4708
4709         Fix #74484.
4710         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4711         AttributeUsageAttribute in the emitcontext of the attribute class,
4712         not in the emitcontext of the attributable entity it was attached to.
4713         * cs-parser.jay: Use 'current_class', not 'current_container',
4714         when creating a GlobalAttribute.
4715
4716 2005-04-08  Alp Toker  <alp@atoker.com>
4717
4718         * pending.cs: The fix to #58413 failed to compile methods implementing
4719         interfaces with/without params modifiers and vice versa, even though
4720         params modifiers aren't part of the signature. Make the modifier check
4721         less strict as in csc.
4722
4723 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4724             Anoob V E  <projectmonokochi@rediffmail.com>
4725             Harilal P R  <projectmonokochi@rediffmail.com>
4726
4727         Fix #58413.
4728         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4729         modifiers of pending methods.
4730         (PendingImplementation.PendingImplementation): Initialize it.
4731         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4732         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4733         with ParameterData.  Add check for modifiers.
4734         * class.cs (MethodData.Define): Update to changes.
4735
4736 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4737
4738         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4739
4740 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4741
4742         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4743         property.
4744         
4745         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4746         
4747         * rootcontext.cs,
4748         * typemanager.cs: Registered RequiredAttributeAttribute.
4749         
4750 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4751
4752         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4753         Warning CS0169 is back at level 3.
4754         (IMethodData.SetMemberIsUsed): New method.
4755         
4756         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4757         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4758         
4759         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4760
4761         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4762         contants.
4763         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4764         is used.
4765         
4766         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4767         is used.
4768         
4769         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4770         to avoid the problems with nested types.
4771
4772 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4773             Anoob V.E  <projectmonokochi@rediffmail.com>
4774             Harilal P.R  <projectmonokochi@rediffmail.com>
4775             Raja R Harinath  <rharinath@novell.com>
4776
4777         Fix #73820.
4778         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4779         attribute.
4780         * typemanager (GetConstructor): Make public.
4781
4782 2005-04-05  John Luke  <john.luke@gmail.com>
4783             Raja R Harinath  <rharinath@novell.com>
4784
4785         Fix #62232.
4786         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4787         struct too.  Return false quicker in a few cases.
4788         (VerifyUnManaged): Use it.
4789
4790 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4791
4792         Fix #74041.
4793         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4794         not 'unreachable_seen'.
4795
4796 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4797
4798         * attribute.cs (Attribute.GetValue): Removed unused.
4799         
4800         * codegen.cs (CodeGen.TrimExt): Removed unused.
4801         
4802         * cs-parser.jay (output): Removed unused.
4803         
4804         * cs-tokenizer.cs (hex_digits): Removed unused.
4805         
4806         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4807         
4808         * expression.cs (Indirection.LoadExprValue): Removed unused.
4809         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4810         
4811         * iterators.cs (Iterator.param_types): Removed unused.
4812         
4813         * statement.cs (Goto.block): Removed unused.
4814         (ToplevelBlock.did): Removed unused.
4815         (Switch.ResolveConstantSwitch): Removed unused.
4816
4817 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4818
4819         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4820         resetting thingy.
4821
4822 2005-04-19  Martin Baulig  <martin@ximian.com>
4823
4824         Merged r42462 from MCS and made it work for GMCS.
4825
4826         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4827
4828         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4829
4830 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4831
4832         Fix #74232 and cs0208-3.cs.
4833         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4834         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4835         unmanaged type.  Don't use FieldBuilders when 't' is a
4836         TypeBuilder.  Use ModFlags and MemberType fields.
4837         * class.cs (MemberBase.member_type): Rename from MemberType.
4838         (MemberBase.MemberType): New property.  Determines member_type on
4839         demand.
4840         (MemberBase.DoDefine): Don't initialize MemberType here.
4841         (FieldMember.Define): Likewise.
4842
4843 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4844
4845         Fix #74241
4846         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4847         Attributes are emitted there.
4848         
4849 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4850
4851         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4852         keyword in 'partial enum' too.
4853         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4854         is not allowed).
4855         Report from Kamil Skalski <nazgul@omega.pl>.
4856
4857         Fix #74309.
4858         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4859         have partial containers too.
4860
4861         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4862         in block' checks to Block.CheckInvariantMeaningInBlock.
4863         * statement.cs (Block.GetKnownVariableInfo): Make private.
4864         (Block.IsVariableUsedInChildBlock): Remove.
4865         (Block.IsVariableUsedInBlock): Likewise.
4866         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4867         conflicting declaration.
4868         (Block.AddVariable): Make error messages less long-winded and more
4869         specific.  Show location of conflicting declaration.
4870         * parameter.cs (Parameters.Location): New readonly property.
4871
4872 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4873
4874         Clean up semantics of invoking ResolveMemberAccess.
4875         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4876         can have an instance, ensure that we pass in a non-TypeExpression
4877         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4878         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4879         argument.  Update to changes and simplify.
4880         (FieldExpr.Emitinstance): Remove CS0120 check.
4881         (PropertyExpr.EmitInstance): Likewise.
4882         * expression.cs (Argument.Resolve): Likewise.
4883         (Invocation.DoResolve): Update to changes in semantics of
4884         InstanceExpression.
4885
4886 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4887
4888         Fix #74241
4889         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4890         customization.
4891         
4892         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4893
4894 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4895
4896         Fix difference in behaviour with commandline invocation.
4897         * driver.cs (Driver.Reset): New.
4898         (CompilerCallableEntryPoint): Call it.
4899
4900         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4901         variable" warnings if the boolean expression failed to resolve.
4902
4903 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4904
4905         * attribute.cs: Fix the union of several permissions when some of them
4906         are unrestricted (so the result isn't an unrestricted permission set).
4907         Fix #74036.
4908
4909 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4910
4911         * ecore.cs (MemberExpr): New class.  Convert from interface
4912         IMemberExpr.
4913         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4914         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4915         error checks.
4916         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4917         (MethodGroupExpr.IsExplicitImpl): Remove.
4918         (Expression.GetFieldFromEvent): Remove.
4919         (SimpleName.MemberStaticCheck): Remove.
4920         (SimpleName.DoSimpleNameResolve): Update to changes.
4921         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4922         (MemberAccess.IdenticalNameAndTypeName): Remove.
4923         (MemberAccess.error176): Move to MemberExpr.
4924         (MemberAccess.DoResolve): Update to changes.
4925         (BaseAccess.DoResolve): Likewise.
4926
4927 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4928
4929         C# 2.0 Conditional attribute class implementation
4930         
4931         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4932         Analyzes class whether it has attribute which has ConditionalAttribute
4933         and its condition is not defined.
4934         
4935         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4936         (Class.IsExcluded): New method. Search for at least one defined
4937         condition in ConditionalAttribute of attribute class.
4938
4939 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4940
4941         * ecore.cs (PropertyExpr): Derive from Expression, not
4942         ExpressionStatement.
4943         (PropertyExpr.EmitStatement): Remove.
4944
4945 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4946
4947         Fix #74060.
4948         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4949         internal field "value__" of an enum be private.  The examples for
4950         "value__" that I found on MSDN all used FieldAttributes.Private.
4951
4952         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4953         Don't mention IL method attribute names.
4954
4955         Fix #47991.  Remove a TODO.
4956         * statement.cs (Block.Toplevel): Make into a field.
4957         (Block.Parameters): Move into ToplevelBlock.
4958         (Block.known_variables): Rename from child_variable_names.
4959         (Block.Block): Remove variants that take Parameters.  Initialize
4960         'Toplevel' with the immediately surrounding toplevel block.
4961         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4962         LocalInfo parameter.
4963         (Block.GetKnownVariableInfo): New.
4964         (Block.IsVariableNameUsedInChildBlock): Update.
4965         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4966         the block, even though it may not be in scope.
4967         (Block.AddVariable): Remove Parameters parameter.  Use
4968         Toplevel.Parameters instead.
4969         (Block.AddConstant): Remove Parameters parameter.
4970         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4971         (Block.IsParamaterReference): Likewise.
4972         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4973         (ToplevelBlock.Parameters): New.  Moved from Block.
4974         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4975         initialize Parameters to a non-null value.
4976         * cs-parser.jay: Update to changes.
4977         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4978         simple names that mean different things in the same block.  Use
4979         Block.IsVariableNameUsedInBlock.
4980
4981 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4982
4983         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4984
4985 2005-03-26  Raja R Harinath  <harinath@acm.org>
4986
4987         Fix #73038.
4988         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4989         fails to resolve, ensure that the LHS is still resolved as an
4990         lvalue.
4991
4992 2005-03-25  Raja R Harinath  <harinath@acm.org>
4993
4994         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4995         ec.ContainerType.
4996         (Enum.current_ec): Remove.
4997         (Enum.LookupEnumValue): Remove EmitContext argument.
4998         Just uses the one created during DefineType.
4999         (Enum.FindMembers): Update.
5000         * expression.cs (MemberAccess.DoResolve): Update.
5001
5002 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5003
5004         * assign.cs (Assign.DoResolve): Check for CS1717 when
5005         source and target are same (uses Equals).
5006
5007         * expression.cs (LocalVariableReference, ParameterReference,
5008         This): Implemented Equals, GetHashCode.
5009
5010         * statement.cs (Block.GetParameterReference): Removed useless
5011         local variable.
5012
5013 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5014
5015         Fix cs0128.cs
5016         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5017         blocks before deciding whether the error is cs0136 or cs0128.
5018
5019         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5020         (using_alias_directive, using_namespace_directive): Pass
5021         MemberName, not an expression to Namespace.UsingAlias and
5022         Namespace.Using.
5023         (MakeName): Use the MemberName of the namespace.
5024         * namespace.cs (Namespace.MemberName): New.
5025         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5026         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5027         Likewise.
5028         * decl.cs (MemberName.Name): Make readonly.
5029         (MemberName.FromDotted): New "constructor".
5030         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5031         (MemberCore.Name): Compute from MemberName on demand.
5032         (MemberCore.SetMemberName): Provide a way to change the
5033         MemberName.
5034         (MemberCore.AddToContainer): Don't take a fullname parameter.
5035         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5036         fully qualified name of the container to the member name.
5037         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5038         only if the type is a member of the root container.
5039         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5040         MemberName.Left rather than searching for an embedded ".".
5041         (PartialContainer.CreatePart): Update to changes in RootContext.
5042         (MemberBase.ShortName): Turn into a property.  Use
5043         MemberCore.SetMemberName.
5044         (MemberBase.ExplicitInterfaceName): Remove.
5045         (MemberBase.UpdateMemberName): Remove.
5046         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5047         (PropertyBase.SetMemberName): New override.
5048         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5049         (Tree.GetDecl): New.
5050         (Tree.AllDecls): Rename from Decls.
5051         * attribute.cs, enum.cs, report.cs: Update to changes.
5052         * driver.cs (MainDriver): Use MemberName.FromDotted on
5053         RootContext.MainClass.
5054
5055 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5056
5057         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5058         checks.
5059
5060         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5061
5062 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5063
5064         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5065         property accessor modifiers.
5066
5067         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5068         fixed buffer attribute (CS1716).
5069         (PropertyMethod.HasCustomAccessModifier): When property accessor
5070         has custom modifier.
5071
5072         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5073         modifiers.
5074         (PropertyExpr.DoResolveLValue): Add CS0272.
5075
5076 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5077
5078         * convert.cs: When converting to a pointer, use the proper Conv.U
5079         or Conv.I depending on the source data type.
5080
5081         * cs-tokenizer.cs: Make the size for large decimal constants,
5082         fixes #72957.
5083
5084 2005-03-17  Martin Baulig  <martin@ximian.com>
5085
5086         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5087         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5088
5089 2005-03-17  Martin Baulig  <martin@ximian.com>
5090
5091         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5092         to bool so we can return an error condition.
5093         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5094         returned an error.
5095
5096 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5097
5098         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5099         attributes.
5100
5101 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5102
5103         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5104         Refactor to avoid traversing the list of assemblies, and to avoid
5105         string concatenation.
5106         * typemanager.cs (guid_attr_type): Remove.
5107         (negative_hits, pointers, references): Remove hashes.
5108         (type_hash): New.
5109         (GetConstructedType): New.  Uses type_hash to handle constructed
5110         types (arrays, references, pointers).
5111         (GetReferenceType, GetPointerType): Use it.
5112         (GetNestedType): New.  Uses type_hash to handle nested types of
5113         reflected types.
5114         (LookupType, LookupTypeDirect): Remove.
5115         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5116         'types' hash and LookupTypeReflection directly.
5117         (params_string, params_object): Use GetConstructedType.
5118         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5119         top-level types.
5120         (Namespace.Lookup): Use cached_types.
5121         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5122         provided by old TypeManager.LookupType.
5123         * rootcontext.cs (MakeFQN): Remove.
5124         * decl.cs (DeclSpace.MakeFQN): Likewise.
5125         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5126         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5127         TypeManager.GetConstructedType.
5128         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5129
5130 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
5131
5132         * cs-parser.jay: Fix build.
5133
5134 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5135
5136         * class.cs (TypeContainer.CircularDepException) New nested
5137         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5138
5139         * cs-parser.jay: Reports CS1527 for any namespace element.
5140
5141         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5142         Added CS0407.
5143
5144         * expression.cs (ParameterReference.IsAssigned): Changed error to
5145         CS0269.
5146         (Error_WrongNumArguments): Moved CS0245 detection here.
5147
5148         * statement.cs (Return.Resolve): Add CS1622 report.
5149
5150 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5151
5152         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5153
5154 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5155
5156         * attribute.cs expression.cs: Get rid of some allocations.
5157
5158 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5159
5160         * doc.cs : just eliminate the latest change.
5161
5162 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5163
5164         * doc.cs : commented out the latest change. It breaks xml-030.cs
5165
5166 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5167
5168         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5169           fail. So invoke CreateType() in FindDocumentedType().
5170
5171 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5172
5173         * cs-tokenizer.cs : added IsKeyword().
5174         * doc.cs : Detect keyword incorrectly used as identifier.
5175           Allow identifiers prefixed by @.
5176
5177 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5178
5179         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5180         It caused exception in namespace resolving (again!).
5181         
5182         * class.cs (Class.ctor): Removed exit.
5183         (PropertyMethod.ctor): ditto.
5184         
5185         * codegen.cs (Codegen.Reset): Reset static data.
5186         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5187         
5188         * cs-tokenizer.cs (Cleanup): Removed.
5189         
5190         * driver.cs (GetSystemDir): Rewrote to one line command.
5191         It caused problem with unloaded dynamic modules.
5192         (UnixParseOption): Removed Exit.
5193         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5194         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5195         Now can be mcs used as library.
5196         
5197         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5198         empty location.
5199         
5200         * location.cs (Reset): Reset static data.
5201         
5202         * namespace.cs (Reset): Reset static data.
5203         
5204         * report.cs (Report.Reset): Reset static data.
5205         
5206         * rootcontext.cs (RootContext.Reset): Reset static data.
5207         
5208         * tree.cs (RootTypes.ctor): Use Location.Null
5209         
5210         * typemanager.cs (TypeManager.Reset): Reset static data.
5211         (CoreLookupType): Removed Exit.
5212         (TypeHandle.Reset): Reset static data.
5213         
5214 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5215
5216         Fix #73516.
5217         * typemanager.cs (ComputeNamespaces): Import namespaces from
5218         referenced modules too.
5219
5220 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5221
5222         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5223         than '.'.
5224
5225 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5226
5227         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5228         enclosing DeclSpace.  This ensures that a name-lookup populates
5229         more caches and there are fewer 'TypeExpression's.  Carve out
5230         nested type lookup into ...
5231         (LookupNestedTypeInHierarchy): ... this.
5232
5233 2005-04-15  Martin Baulig  <martin@ximian.com>
5234
5235         Merged r41590 from MCS and make it work in the generics land.
5236
5237         * generic.cs (TypeParameter.UpdateConstraints): Removed the
5238         `check' argument.
5239
5240         * class.cs (PartialContainer.UpdateConstraints): Removed.
5241         (PartialContainer.CheckConstraints): Removed.
5242         (PartialContainer.SetParameterInfo): Store the constraints here.
5243         (PartialContainer.DefineTypeParameters): New public method;
5244         resolve the type parameter's constraints here.  Note that the
5245         PartialContainer doesn't have an EmitContext anymore, so we must
5246         do this in the ClassPart.
5247
5248 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5249
5250         Clean up a few partial-class semantics.  
5251         Fixes test-357.cs and cs1618-2.cs.
5252         * cs-parser.jay (struct_declaration): Use 'current_class' as
5253         parent of newly-created struct.  Remove call to Register ().
5254         Use 'pop_current_class' to complete handing the current struct.
5255         (interface_declaration): Likewise.
5256         (class_declaration): Likewise.
5257         (enum_declaration): Use 'current_class' as parent of newly created
5258         enum.
5259         (delegate_declaration): Likewise.
5260         (pop_current_class): New function.  This is used to handle closing
5261         up the 'current_class' and 'current_container', and pointing them
5262         to the enclosing class/container.
5263         (CSharpParser): Initialize 'current_class' too.
5264         * decl.cs (MemberCore): Add check for invariant: a partial
5265         container is not a parsed entity, and thus does not enclose any
5266         parsed members.
5267         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5268         (DeclSpace.BaseTypeExpr): Use it.
5269         (DeclSpace.LookupType): Add check for invariant.
5270         * class.cs (TypeContainer): Add check for invariant: a nested
5271         class should have the same NamespaceEntry as its enclosing class.
5272         (TypeContainer.EmitFieldInitializers): Make virtual.
5273         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5274         MemberCore.
5275         (TypeContainer.Register): Remove.
5276         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5277         null.  Use TypeResolveEmitContext for resolving base types and
5278         interfaces.  Move initialization of Parts.TypeBuilder here from
5279         ...
5280         (TypeContainer.DefineNestedTypes): ... here.
5281         (PartialContainer): Take a Namespace not a NamespaceEntry.
5282         (PartialContainer.Create): Don't use Register.  Call the
5283         appropriate Add... function directly.
5284         (ClassPart): Take both the PartialContainer and the enclosing
5285         class as constructor arguments.
5286         (ClassPart.EmitFieldInitializers): Override.
5287         (ClassPart.PartFindNestedTypes): Remove.
5288         (FieldBase.GetInitializerExpression): Resolve the initializer
5289         expression in the emit context of the enclosing class.
5290         * tree.cs (RootTypes): Remove Register ().
5291         
5292 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5293
5294         * cs-parser.jay: Removed CS0134.
5295         
5296         * driver.cs: Removed CS1901.
5297         
5298         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5299         for predefined types.
5300
5301 2005-03-07  Duncan Mak  <duncan@novell.com>
5302
5303         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5304         well. Fixes bug #73454.
5305
5306 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5307
5308         * cs-tokenizer.cs (xtoken): Add CS1035.
5309         
5310         * class.cs (MethodData.Define): Add CS0683.
5311         (FieldMember.ctor): Add CS0681.
5312
5313 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5314
5315         * ecore.cs (SimpleName.DoResolve): Rename from
5316         SimpleName.DoResolveAllowStatic.
5317         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5318         Pass 'intermediate' flag to MemberStaticCheck.
5319         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5320         of "intermediate" lookups via MemberAccess.
5321         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5322         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5323
5324 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5325
5326         Fix #73394.
5327         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5328         slipped in because of variable names that are identical to a
5329         builtin type's BCL equivalent ('string String;', 'int Int32;').
5330         (PropertyExpr.EmitInstance): Likewise.
5331
5332 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5333
5334         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5335         
5336         * report.cs (warning_ignore_table): Made public.
5337
5338 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5339
5340         Fix #73282.
5341         * class.cs (MethodData.Emit): Pass 'container' to
5342         container.GetObsoleteAttribute instead of 'container.Parent'.
5343
5344 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5345
5346         * cs-parser.jay: Add 1534 error test.
5347
5348         * iterators.cs (Yield.CheckContext): Add error 1629.
5349         (Iterator.ctor): Save unsafe modifier.
5350         (MoveNextMethod.DoEmit): Restore unsafe context.
5351
5352         * namespace.cs (UsingAlias): Better error message.
5353
5354 2005-03-03  Dan Winship  <danw@novell.com>
5355
5356         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5357         the warning message [#73219]
5358
5359 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5360
5361         Fix compile with MCS 1.0.0.0.
5362         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5363         w_restore to not depend on string constant folding.
5364
5365 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5366
5367         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5368         CS0246 check to users who passed 'silent = false'.
5369         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5370         check.
5371         (SimpleName.SimpleNameResolve): Update.
5372         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5373         (MemberAccess.IdenticalNameAndTypeName): Update.
5374         * doc.cs (FindDocumentedTypeNonArray): Update.
5375
5376 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5377
5378         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5379         * parameters.cs (ComputeAndDefineParameters): Remove.
5380         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5381         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5382         Use GetParameterInfo.
5383
5384 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5385
5386         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5387
5388 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5389
5390         Unify DeclSpace.LookupType and DeclSpace.FindType.
5391         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5392         is in charge of defining nested types on demand.
5393         (DeclSpace.LookupType): Use it when the current_type is a
5394         TypeBuilder.  Use LookupTypeDirect for reflected types.
5395         (DeclSpace.FindType): Remove.
5396         (DeclSpace.LookupInterfaceOrClass): Likewise.
5397         (DeclSpace.DefineTypeAndParents): Likewise.
5398         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5399         DeclSpace.LookupType.
5400         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5401         * typemanager.cs (LookupType): Simplify.
5402         (AddUserType): Remove type from negative_hits.
5403         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5404         * class.cs (TypeContainer.FindMembers): Move handling of nested
5405         types ...
5406         (TypeContainer.FindMembers_NestedTypes): ... here.
5407         (TypeContainer.FindNestedType): Implement override.
5408         (ClassPart.FindNestedType): Delegate to PartialContainer.
5409         (ClassPart.PartFindNestedType): Looks up the nested types of the
5410         part alone.
5411
5412 2005-04-14  Martin Baulig  <martin@ximian.com>
5413
5414         * generic.cs (ConstructedType): Moved all the type lookup and
5415         nested class logic into SimpleName.
5416         (ConstructedType.ResolveConstructedType): Our underlying type is
5417         already fully resolved; all the type lookup stuff is in
5418         SimpleName.
5419
5420         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5421         constructed types here instead of in ConstructedType.
5422
5423         * decl.cs (MemberName.GetTypeExpression): Always create a
5424         SimpleName, not a ConstructedType.
5425         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5426
5427 2005-03-02  Martin Baulig  <martin@ximian.com>
5428
5429         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5430         static constructor in static classes.
5431
5432 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5433
5434         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5435         sizeParamIndex is not specified.
5436
5437 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5438
5439         Fix #73117
5440         * report.cs (WarningMessage.IsEnabled): Missing null check.
5441
5442 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5443
5444         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5445         in the fields and not in the properties.
5446
5447 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5448
5449         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5450         fields as well.
5451
5452 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5453
5454         * attribute.cs: Small refactoring (improved robustness).
5455         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5456         (ValidateGuid): Removed.
5457         (Resolve): Removed referenced to above mentioned.
5458         (GetAttributeUsage): Made private and changed to work without
5459         class assistance.
5460         (GetIndexerAttributeValue): Don't crash.
5461         (GetConditionalAttributeValue): Ditto.
5462         (GetClsCompliantAttributeValue): Ditto.
5463         (ExtractSecurityPermissionSet): All attributes exceptions are
5464         error 648.
5465         (GetPropertyValue): New helper.
5466         (GetMethodImplOptions): New method.
5467         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5468         some missing properties.
5469         
5470         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5471         (Method.ApplyAttributeBuilder): Updated.
5472         
5473         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5474         exception.
5475
5476 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5477
5478         Fix #73052.
5479         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5480         non-simple types (array, pointer, reference).
5481
5482 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5483
5484         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5485
5486         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5487         for operators.
5488         (Method.CheckBase): Catch wrong destructor here.
5489         (MethodData.Define): Add errors 550, 668.
5490
5491         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5492
5493         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5494
5495         * pending.cs (VerifyPendingMethods): Add error 551.
5496
5497         * typemanager.cs (CSharpName): Next error report helper.
5498
5499 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5500
5501         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5502         attributes. Removed useless attribute double check.
5503         It saves almost 2MBs for corlib.
5504
5505 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5506
5507         Fix #72924.
5508         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5509         called twice in case of error.
5510
5511 2005-02-23  Chris Toshok  <toshok@ximian.com>
5512
5513         Fix compiler portions of #72827.
5514         * statement.cs (Block.Emit): call Begin/EndScope on the
5515         EmitContext instead of the ILGenerator.
5516
5517         * codegen.cs (EmitContext.BeginScope): new method, call
5518         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5519         we have one.)
5520         (EmitContext.BeginScope): same, but EndScope and CloseScope
5521
5522         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5523         offset and call the superclass's OpenScope(int) with it.
5524         (SymbolWriter.CloseScope): get the current il
5525         offset and call superclass's CloseScope(int) with it.
5526
5527 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5528
5529         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5530         CS1677 for out and ref as well.
5531
5532         * class.cs (Method.Define): Add error CS1599 detection.
5533         
5534         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5535         
5536         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5537         
5538         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5539         
5540         * support.cs.cs (ModifierDesc): New helper method.
5541
5542 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5543             Abin Thomas  <projectmonokochi@rediffmail.com>
5544             Anoob V E  <projectmonokochi@rediffmail.com>
5545             Harilal P R  <projectmonokochi@rediffmail.com>
5546
5547         Fix #57851, #72718.
5548         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5549         MemberLookup (used for error reporting) actually returns a result.
5550         Fix error report number (122, not 112).
5551
5552 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5553             Anoob V E  <projectmonokochi@rediffmail.com>
5554             Harilal P R  <projectmonokochi@rediffmail.com>
5555
5556         Fix #71134.
5557         * pending.cs (PendingImplementation.GetAbstractMethods):
5558         Find NonPublic members too.
5559
5560 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5561
5562         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5563         Fixed error 217.
5564         
5565         * class.cs (MethodCore.CheckMethodAgainstBase):
5566         Add error 239 report.
5567
5568 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5569
5570         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5571         
5572         * class.cs (Operator.Define): Add error 217 report.
5573         
5574 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5575
5576         Fix #68955.
5577         * expression.cs (Invocation.IsApplicable): Make public.
5578         (Invocation.IsParamsMethodApplicable): Likewise.
5579         * delegate.cs (Delegate.VerifyApplicability): Don't use
5580         Invocation.VerifyArgumentCompat for parameter applicability
5581         testing.  Use Invocation.IsApplicable and
5582         Invocation.IsParamsMethodApplicable.
5583
5584 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5585
5586         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5587         
5588         * class.cs (Operator.Define): Add error 217 report.
5589         
5590 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5591
5592         * namespace.cs (UsingEntry.Resolve): Undo change below.
5593
5594 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5595
5596         Fix #72756.
5597         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5598         disable the error message when the extended MemberLookup also
5599         fails.
5600         (Expression.MemberLookupFinal): Update.
5601         (SimpleName.DoSimpleNameResolve): Update.
5602         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5603         Don't use MemberLookupFinal.
5604         (New.DoResolve): Update.
5605         (BaseAccess.CommonResolve): Update.
5606
5607 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5608
5609         Fix #72732.
5610         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5611         occured previously, don't resolve again.
5612
5613 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5614
5615         Fix #69949
5616         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5617         argument. Call ResolveAttributeUsage for unresolved.
5618         when types doesn't match ctor arguments.
5619         
5620         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5621         for nested attribute classes.
5622         (Class.attribute_usage): Removed.
5623         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5624         for attribute class.
5625         
5626         * ecore.cs (IsAttribute): Removed.
5627         
5628         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5629         
5630         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5631         now normal types.
5632         (attribute_types): Removed.
5633         (EmitCode): Global attributes are emited as the latest.
5634
5635 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5636
5637         * class.cs (EmitFieldInitializers): Don't emit field initializer
5638         for default values when optimilization is on.
5639         
5640         * constant.cs (Constant.IsDefaultValue): New property.
5641         
5642         * driver.cs: Add /optimize handling.
5643         
5644         * constant.cs,
5645         * ecore.cs,
5646         * literal.cs: Implement new IsDefaultValue property.
5647         
5648         * rootcontext.cs (Optimize): New field, holds /optimize option.
5649
5650 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5651
5652         Fix crasher in re-opened #72347.
5653         * namespace.cs (Namespace.Lookup): Return null if
5654         DeclSpace.DefineType returns null.
5655
5656         Fix #72678.
5657         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5658
5659 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5660
5661         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5662         now returns null if it cannot resolve to an lvalue.
5663         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5664         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5665         returned null.  Remove check for SimpleName.
5666         (EventExpr.DoResolveLValue): New.
5667         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5668         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5669         error from ...
5670         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5671         avoid CS0131 error.
5672         (Unary.ResolveOperator): Move CS0211 check ...
5673         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5674         CS0131 error.
5675         (Unary.DoResolveLValue): Simplify.
5676         (AddressOf.DoResolveLValue): New.
5677         (ArrayAccess.DoResolveLValue): New.
5678
5679 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5680
5681         * attribute.cs (Attribute.Resolve): Add arguments casting for
5682         when types doesn't match ctor arguments.
5683
5684 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5685
5686         Fix parts of #63202.
5687         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5688         lookup of operator in base type.  Ensure that all checks happen
5689         when the operator resolves to an "op_..." method.
5690
5691 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5692
5693         Fix #71992.
5694         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5695         'ignore_cs0104' parameter.  Pass it to ...
5696         (NamespaceEntry.Lookup): ... this.
5697         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5698         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5699         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5700         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5701         Update.  Request that cs0104 errors be ignored.
5702         (ComposedCast.ResolveAsTypeStep): Update.
5703
5704 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5705
5706         Fix #59209.
5707         * expression.cs (Invocation.BetterFunction): Remove support for
5708         comparing virtual functions and their overrides.
5709         (Invocation.IsOverride): New.
5710         (Invocation.OverloadResolve): Don't consider 'override' functions
5711         during candidate selection.  Store them in a lookaside list.
5712         If the selected method is a 'virtual' function, use the list to
5713         find any overrides that are closer to the LHS type.
5714
5715 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5716
5717         * expression.cs (New.DoResolve): Add complex core type reduction.
5718         (New.Constantify): Converts complex core type syntax like 'new int ()'
5719         to simple constant.
5720         
5721 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5722
5723         * decl.cs (EntryType.EntryType): New constructor to create an
5724         updated copy of a cache entry.
5725         (MemberCache.AddMethods): Use it.
5726         (MemberCache.ClearDeclaredOnly): Remove.
5727         (MemberCache.MemberCache): Update.
5728
5729 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5730
5731         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5732         variable.  This one is represents the actual low-level declaration
5733         of the method, as opposed to the semantic level `IsStatic'.   
5734
5735         An anonymous method which is hosted into a static method might be
5736         actually an instance method.  IsStatic would reflect the
5737         container, while MethodIsStatic represents the actual code
5738         generated.
5739
5740         * expression.cs (ParameterReference): Use the new MethodIsStatic
5741         instead of IsStatic.
5742
5743         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5744         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5745         set on the current EmitContext. 
5746
5747         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5748         resolve our casted expression as an LValue.  This triggers the
5749         proper LValue processing that is later required by Assign.
5750
5751         This fixes 72347.
5752
5753         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5754
5755 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5756
5757         C# 2.0 Fixed buffer implementation
5758
5759         * anonymous.cs: Update after RegisterHelperClass renaming.
5760
5761         * attribute.cs (AttributeTester.fixed_buffer_cache):
5762         Cache of external fixed buffers.
5763         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5764         implementation if field is fixed buffer else null.
5765
5766         * class.cs
5767         (TypeContainer.AddField): Accept FieldMember instead of Field.
5768         (FieldBase.IsFieldClsCompliant): Extracted code from
5769         VerifyClsCompliance descendant customization.
5770         (FixedField): New class handles fixed buffer fields.
5771         (FixedFieldExternal): Keeps information about imported fixed
5772         buffer.
5773         (IFixedField): Make access to internal or external fixed buffer
5774         same.
5775
5776         * cs-parser.jay: Add fixed buffer parsing.
5777
5778         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5779         buffer.
5780
5781         * expression.cs (Indirection): Extended implementation to accept
5782         fixed buffer field.
5783         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5784         (ElementAccess.MakePointerAccess): Get type as parameter.
5785         (DoResolve): Add fixed buffer field expression conversion.
5786         (DoResolveLValue): Ditto.
5787         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5788         (ArrayPtr): Derives from FixedBufferPtr.
5789         (ArrayPtr.Emit): Add extra emit for array elements.
5790
5791         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5792
5793         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5794         for compiler generated types.
5795         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5796
5797         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5798         and consume less memory.
5799         (Fixed.Resolve): Add fixed buffer case.
5800
5801         * typemanager.cs (compiler_generated_attr_ctor,
5802         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5803         (HasElementType): Add our own implementation to work on every
5804         runtime.
5805
5806 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5807
5808         * anonymous.cs (CaptureContext): Track whether `this' has been
5809         referenced.   
5810
5811         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5812         only captured `this' if it was implicitly done (instance
5813         methods/variables were used). 
5814
5815         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5816         `this' must be captured.
5817
5818 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5819  
5820         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5821         is null it means that there has been no need to capture anything,
5822         so we just create a sibling.
5823
5824         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5825
5826         Just a partial fix.  The other half is fairly elusive.
5827         
5828 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5829
5830         Fix #52586, cs0121-4.cs.
5831         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5832         and return a hashtable.
5833         (MemberCache.ClearDeclaredOnly): New.
5834         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5835         the method_hash of a base type too.
5836         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5837         type methods.  Overwrite entries with the same MethodHandle so
5838         that the ReflectedType is correct.  The process leaves in base
5839         virtual functions and their overrides as distinct entries.
5840         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5841         matters since it was boxed in a ArrayList before.
5842         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5843         modifier.
5844         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5845         case of a virtual function and its override (choose the overload
5846         as better).
5847         (Invocation.OverloadResolve): Avoid 'override' members during
5848         'applicable_type' calculation.
5849
5850 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5851
5852         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5853         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5854         GetTypeHandle.  It is possible for a reflected type to derive from
5855         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5856         System.Array during mscorlib compilation).
5857         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5858         contain a method_hash, don't create one either.  Don't create a
5859         deep copy of the base cache's method_hash.
5860         (MemberCache.SetupCache): Rename back from DeepCopy.
5861         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5862         already initialized.  If we see an override function, add its
5863         underlying base virtual function to the member_hash too.
5864
5865 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5866
5867         Combine two near-redundant caches.
5868         * typemanager.cs (method_params): Rename from method_internal_params.
5869         (TypeManager.GetParameterData): New.  Replace
5870         Invocation.GetParameterData.
5871         (TypeManager.LookupParametersByBuilder): Remove.
5872         * expression.cs (Invocation.method_parameter_cache): Remove.
5873         (Invocation.GetParameterData): Remove.
5874         Update to changes.
5875         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5876         Update to changes.
5877
5878 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5879
5880         Fix #72015.
5881         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5882         TypeManager.multicast_delegate_type is null, resolve it by looking
5883         up "System.MulticastDelegate".
5884         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5885
5886 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5887             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5888             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5889
5890         Fix cs0164.cs.
5891         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5892         (LabeledStatement.AddReference): New.  Set 'referenced'.
5893         (Goto.Resolve): Use it.
5894
5895 2005-02-05  John Luke  <john.luke@gmail.com>
5896
5897         * driver.cs: remove duplicate -doc line in Usage ()
5898
5899 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5900
5901         * location.cs (Location.AddFile): Fix CS2002 error report.
5902
5903 2005-02-02  Martin Baulig  <martin@ximian.com>
5904
5905         * delegate.cs (Delegate.DefineType): Report an internal error if
5906         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5907         details.        
5908
5909 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5910
5911         Fix a crasher in a variant of #31984.
5912         * const.cs (Constant.CheckBase): New override that defers the
5913         new-or-override check in case the base type hasn't been populated
5914         yet.
5915         (Constant.Define): Ensure the new-or-override check is performed.
5916
5917 2005-02-01  Duncan Mak  <duncan@ximian.com>
5918
5919         * const.cs (LookupConstantValue): Check that `ce' is not null
5920         before calling GetValue ().
5921
5922 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5923
5924         Fix test-334.cs (#69519).
5925         * cs-parser.jay (using_alias_directive): Pass in an expression to
5926         NamespaceEntry.UsingAlias.
5927         (using_namespace_directive): Pass in an expression to
5928         NamespaceEntry.Using.
5929         (namespace_name): Don't flatten to a string.
5930         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5931         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5932         ResolveAsTypeStep.
5933         (NamespaceEntry.UsingEntry): Likewise.
5934         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5935         changes.
5936         (NamespaceEntry.LookupForUsing): Remove.
5937         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5938         names.
5939         (NamespaceEntry.Lookup): Remove support for dotted names.
5940
5941 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5942
5943         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5944         split into two.
5945         (NamespaceEntry.ImplicitParent): Compute on demand.
5946         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5947         parallels the current.
5948         (NamespaceEntry.LookupForUsing): Use it.
5949         (NamespaceEntry.Lookup): If the current namespace-entry is
5950         implicit, don't search aliases and using tables.
5951
5952 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5953
5954         Fix #31984.
5955         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5956         BaseCache here.
5957         (TypeContainer.BaseCache): Compute on demand.
5958         (TypeContainer.FindMembers): Define constants and types if they're
5959         not already created.
5960         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5961         check.
5962         * const.cs (Constant.Define): Make idempotent.
5963
5964 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5965
5966         * pending.cs: Produce better code (no nops produced by using Ldarg
5967         + value).
5968         
5969         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5970         i - 1' it should be arg + 1.
5971
5972         Fixes bug #71819.
5973
5974 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5975
5976         * attribute.cs (Attribute.CheckAttributeType): Make private
5977         non-virtual.
5978         (Attribute.ResolveType): Make virtual.
5979         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5980         handling of RootContext.Tree.Types.
5981
5982 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5983
5984         Update attribute-handling to use the SimpleName/MemberAccess
5985         mechanisms.
5986         * cs-parser.jay (attribute): Pass in an expression to the
5987         constructors of Attribute and GlobalAttribute.
5988         * attribute.cs (Attribute): Take an expression for the name.
5989         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5990         passed in attribute name expression.
5991         (Attribute.CheckAttributeType): Use it.
5992         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5993         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5994         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5995         argument to prevent error messages if the lookup fails.
5996
5997 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5998
5999         * expression.cs (Indirection): Implemented IVariable interface
6000         to support indirection in AddressOf operator.
6001         (PointerArithmetic.Emit): Add optimalization for case where
6002         result can be precomputed.
6003
6004 2005-01-26  Martin Baulig  <martin@ximian.com>
6005
6006         * class.cs (TypeContainer.AttributeTargets): Return the correct
6007         AttributeTargets depending on our `Kind' instead of throwing an
6008         exception; fixes #71632.
6009
6010 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6011
6012         Fix #71257
6013         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6014         constant members.
6015
6016 2005-03-17  Martin Baulig  <martin@ximian.com>
6017
6018         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6019         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6020
6021 2005-03-17  Martin Baulig  <martin@ximian.com>
6022
6023         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6024         to bool so we can return an error condition.
6025         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6026         returned an error.
6027
6028 2005-03-17  Martin Baulig  <martin@ximian.com>
6029
6030         * generic.cs (TypeMananager.IsIEnumerable): New public method.
6031
6032         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6033         converting from an array-type of T to `IEnumerable<T>'.
6034
6035 2005-03-16  Martin Baulig  <martin@ximian.com>
6036
6037         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6038         (Nullable.LiftedUnaryMutator): New public class.
6039
6040         * expression.cs (UnaryMutator.DoResolve): Added support for
6041         Nullable Types.
6042
6043 2005-03-14  Martin Baulig  <martin@ximian.com>
6044
6045         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6046
6047 2005-03-14  Martin Baulig  <martin@ximian.com>
6048
6049         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6050         the comparision operators `<', `>', `<=' and `>='.
6051
6052 2005-03-13  Martin Baulig  <martin@ximian.com>
6053
6054         * generic.cs
6055         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6056         avoid confusion with the `NullLiteral'.
6057         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6058
6059 2005-03-13  Martin Baulig  <martin@ximian.com>
6060
6061         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6062         comparing arbitrary types with the null literal.
6063
6064 2005-03-13  Martin Baulig  <martin@ximian.com>
6065
6066         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6067         boolean operators '&&', '||', '&' and '|'.
6068         (Nullable.OperatorTrueOrFalse): New public class.
6069
6070         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6071         instead of a `StaticCallExpr'; added support for nullables.
6072
6073 2005-03-10  Martin Baulig  <martin@ximian.com>
6074
6075         * expression.cs
6076         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6077         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
6078
6079 2005-03-07  Martin Baulig  <martin@ximian.com>
6080
6081         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6082         it work if `expr' is not an IMemoryLocation.
6083         (Nullable.Lifted): Implement IMemoryLocation.
6084         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6085         target type.
6086
6087 2005-03-05  Martin Baulig  <martin@ximian.com>
6088
6089         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6090         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6091         (Nullable): Added support for lifted unary and binary operators.
6092
6093         * expression.cs (Unary.DoResolve): Added support for nullable types.
6094         (Binary.DoResolve): Likewise.
6095         (Conditional.DoResolve): Likewise.
6096
6097 2005-03-02  Martin Baulig  <martin@ximian.com>
6098
6099         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6100
6101         * class.cs (ClassPart.SetParameterInfo): Override this.
6102         (PartialContainer.SetParameterInfo): Override this.
6103         (TypeContainer.CheckConstraints): New protected method.
6104         (PartialContainer.CheckConstraints): Override this and check
6105         whether the same contraints were specified in all parts of a
6106         partial generic type definition.
6107         (PartialContainer.UpdateConstraints): New public method.
6108
6109         * generic.cs (TypeParameter.UpdateConstraints): New public method.
6110
6111 2005-03-02  Martin Baulig  <martin@ximian.com>
6112
6113         Committing a patch from Carlos Alberto Cortez to fix #72887.
6114
6115         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6116         casts from `T []' to `int []'.
6117
6118 2005-03-02  Martin Baulig  <martin@ximian.com>
6119
6120         * generic.cs (TypeManager.IsEqual): Make this symmetric.
6121
6122         * expression.cs (Binary.ResolveOperator): When resolving a
6123         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6124         `=='.  Fixes #71866.  See gen-127.cs.
6125
6126 2005-03-02  Martin Baulig  <martin@ximian.com>
6127
6128         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6129         static constructor in static classes.
6130
6131 2005-03-02  Martin Baulig  <martin@ximian.com>
6132
6133         * generic.cs
6134         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6135         (Nullable.LiftedConversion): Added support for user-defined
6136         conversions.
6137
6138         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6139
6140         * cs-parser.jay: Use ComposedCast everywhere instead of
6141         NullableType, so we don't need to check for NullableType
6142         everywhere.
6143         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6144         case where we'll be resolved into a `parenthesized_expression_0'
6145         afterwards.
6146
6147         * convert.cs
6148         (Convert.UserDefinedConversion): Added nullable conversions.
6149
6150 2005-02-28  Martin Baulig  <martin@ximian.com>
6151
6152         * generic.cs (TypeManager.IsNullableType): New static method.
6153         (Nullable): New abstract class.
6154         (Nullable.NullLiteral): New public class.
6155         (Nullable.LiftedConversion): New public class.
6156
6157         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6158         `builtin_types opt_nullable'.
6159
6160         * convert.cs
6161         (Convert.ImplicitConversionStandard): Added nullable conversions.
6162         (Convert.ExplicitConversionStandard): Likewise.
6163         (Convert.ExplicitConversion): Likewise.
6164
6165 2005-02-26  Martin Baulig  <martin@ximian.com>
6166
6167         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6168         begin with a "?", for instance "?[]".  Don't do a type lookup if
6169         `dim' is empty.
6170
6171 2005-02-25  Martin Baulig  <martin@ximian.com>
6172
6173         The first part of Nullable Types :-)
6174
6175         * generic.cs (NullableType): New public class.
6176         (NullCoalescingOperator): New public class.
6177         (TypeArguments.Resolve): Add a CS0306 check.
6178
6179         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6180         (opt_nullable): New rule.
6181         (type): Added `opt_nullable' to `namespace_or_type_name',
6182         `builtin_types' and `pointer_type'.
6183         (array_type): Added `opt_nullable'.
6184         (opt_rank_specifier_or_nullable): New rule; this is the
6185         combination of `opt_rank_specifier' and `opt_nullable'.
6186         (opt_error): New rule; catch errors here.
6187         (nullable_type_or_conditional): New rule; we use this to check for
6188         nullable and still detect the conditional operator.
6189         (local_variable_type): Use `opt_rank_specifier_or_nullable'
6190         instead `opt_rank_specifier'.
6191
6192         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6193         for nullables.
6194
6195 2005-02-24  Martin Baulig  <martin@ximian.com>
6196
6197         * README, README.Changes: Removed; they're old and obsolete.
6198
6199 2005-02-22  Martin Baulig  <martin@ximian.com>
6200
6201         * generic.cs (TypeParameter.Resolve): If resolving the constraints
6202         returned an error, set `constraints' to null to avoid a crash
6203         later on.
6204         (TypeParameter.ResolveType): Likewise.
6205
6206 2005-02-22  Martin Baulig  <martin@ximian.com>
6207
6208         * generic.cs
6209         (Constraints.ResolveTypes): Protect against being called twice.
6210         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6211         (TypeParameter.ResolveType): New public method; calls
6212         constraints.ResolveTypes().
6213         (TypeParameter.DefineType): Moved constraints.ResolveType() out
6214         into the new ResolveType().
6215         (GenericMethod.Define): Call ResolveType() on all our
6216         TypeParameter's.        
6217
6218 2005-02-21  Martin Baulig  <martin@ximian.com>
6219
6220         * generic.cs
6221         (TypeManager.generic_nullable_type): New static public field.
6222         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6223
6224         * rootcontext.cs
6225         (RootContext.ResolveCore): Resolve "System.Nullable`1".
6226
6227 2005-02-15  Martin Baulig  <martin@ximian.com>
6228
6229         * generic.cs (ConstructedType.Constraints): Correctly check
6230         constraints if the argument type is a type parameter; fixes
6231         #72326. 
6232
6233 2005-02-02  Martin Baulig  <martin@ximian.com>
6234
6235         * delegate.cs (Delegate.DefineType): Report an internal error if
6236         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6237         details.        
6238
6239 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6240
6241         * pending.cs: Produce better code (no nops produced by using Ldarg
6242         + value).
6243         
6244         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6245         i - 1' it should be arg + 1.
6246
6247         Fixes bug #71819.
6248         
6249 2005-01-26  Martin Baulig  <martin@ximian.com>
6250
6251         * cs-parser.jay (indexer_declarator): Don't report an error if we
6252         have type parameters since we can be an explicit interface
6253         implementation; fixes #71449.
6254
6255 2005-01-26  Martin Baulig  <martin@ximian.com>
6256
6257         * class.cs (TypeContainer.AttributeTargets): Return the correct
6258         AttributeTargets depending on our `Kind' instead of throwing an
6259         exception; fixes #71632.
6260
6261 2005-01-26  Martin Baulig  <martin@ximian.com>
6262
6263         * delegate.cs (Delegate.DefineType): Correctly define our type
6264         parameters.  Fixes #71483.
6265
6266 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6267
6268         Fix #71602.
6269         * expression.cs (MemberAccess.DoResolve): Don't complain with
6270         cs0572 when the LHS of a member access has identical name and type
6271         name.
6272
6273 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6274
6275         Fix #71651, #71675
6276         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6277         CreatePermission.
6278         Create custom PermissionSet only for PermissionSetAttribute.
6279
6280 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6281
6282         Fix #71649
6283         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6284         delegates in static class.
6285
6286 2005-01-24  Martin Baulig  <martin@ximian.com>
6287
6288         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6289         merging an implicit block, just use its reachability.
6290
6291         * statement.cs (Block.Resolve): Make the unreachable code check
6292         work wrt. implicit blocks; see test-337 from #63842.
6293
6294 2005-01-21  Alp Toker  <alp@atoker.com>
6295  
6296         * cs-parser.jay: destructor_declaration's container is PartialContainer
6297         not Class when partial types are used, so use Kind prop instead of
6298         'is'.
6299         
6300 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6301
6302         * cs-parser.jay: Improve error reporting when an interface
6303         declares new types.
6304
6305 2005-01-20  Dick Porter  <dick@ximian.com>
6306
6307         * support.cs: SeekableStreamReader fix from Sandor Dobos
6308         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6309         chars are read.  Fixes bug 70369.
6310
6311 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6312
6313         * cs-parser.jay (catch_clause): Simplify current_block handling
6314         somewhat.
6315
6316 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6317
6318         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6319         code with ImplicitStandardConversion to handle the implicit
6320         conversion of method groups into valid delegate invocations. 
6321
6322         The problem is that in parameter handling we were using this code
6323         path.  Fixes bug #64698
6324
6325 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6326
6327         * cs-parser.jay: Fix several infelicities.
6328         - Avoid assigning to the parser value stack.  Code like 
6329           '$3 = null' is unclean.  Synthesize a value for the code block
6330           instead. 
6331         - Avoid using oob_stack for storing location information.  Use ...
6332         (_mark_): ... this.  New (empty) rule.  Saves the current location
6333         in $$.
6334         (foreach_statement): Avoid using oob_stack for current_block
6335         handling.  Use technique used in for_statement and
6336         using_statement.  Synthesize a value for the code block to store
6337         additional intermediate information.
6338
6339 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6340
6341         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6342         of a different type is only allowed to private fields of a
6343         containing type, not on fields of a base class.
6344
6345         See test-174.cs and error cs0122-9.cs
6346
6347 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6348
6349         Fix test-335.cs (bug #58126).
6350         * cs-parser.jay (argument): Split out non-expression parts of the
6351         rule into 'non_simple_argument'.
6352         (invocation_expression): Support parenthesized invocations with
6353         multiple arguments, and with single non-simple arguments.
6354
6355 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6356
6357         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6358         places.
6359
6360 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6361
6362         Fix cs0038-1.cs, cs1640-6.cs.
6363         * ecore.cs (Expression.Resolve): Remove special-case for
6364         SimpleName in error-handling.
6365         (Expression.almostMatchedMembers): Relax access permission to
6366         protected.
6367         (Expression.MemberLookupFailed): Handle duplicates in
6368         almostMatchedMembers list.
6369         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6370         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6371         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6372         overload if the passed in MemberInfo is a MethodBase.
6373
6374 2005-01-25  Martin Baulig  <martin@ximian.com>
6375
6376         * doc.cs
6377         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6378
6379 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6380
6381         Fix #70749
6382         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6383         for non-CAS & merge permission sets properly.
6384
6385 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6386
6387         Improve standard-compliance of simple name and member access 
6388         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6389         * ecore.cs (FullNamedExpression): New abstract base class 
6390         for Namespaces and TypeExpressions.
6391         (ResolveFlags.SimpleName): Remove.
6392         (SimpleName): Remove support for dotted names.
6393         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6394         DeclSpace.FindType and DeclSpace.LookupType.
6395         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6396         (Expression.ExprClassName): Make member function.
6397         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6398         a namespace.  Remove creation of dotted "SimpleName"s.
6399         (MemberAccess.DoResolve): Likewise.
6400         * decl.cs (DeclSpace.Cache): Make private.
6401         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6402         (DeclSpace.FindType): Update.
6403         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6404         FullNamedExpression.
6405         * namespace.cs (Namespace): Derive from FullNamedExpression
6406         so that it can be part of expression resolution.
6407         (Namespace.Lookup): Return an FullNamedExpression.
6408         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6409         namespace.
6410         * rootcontext.cs (NamespaceLookup): Remove.
6411         (LookupType): Move to DeclSpace.
6412         * attribute.cs (CheckAttributeType): Update.
6413         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6414         (FindDocumentedTypeNonArray): Likewise.
6415
6416 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6417
6418         Fix cs0509.cs, cs1632.cs.
6419         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6420         is the same as IsInterface.
6421         (TypeContainer.GetClassBases): Likewise.
6422         * statement.cs (LabeledStatement.ig): New field.
6423         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6424         label.
6425         (LabeledStatement.DoEmit): Check that the label was created with
6426         the same ILGenerator.
6427
6428 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6429
6430         Fix #71058
6431         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6432         accessors to its properties.
6433
6434         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6435         from accessors to property.
6436         
6437 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6438
6439         Fix #70722
6440         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6441         only for overrides.
6442         
6443 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6444
6445         * attribute.cs: Check for null and empty strings.  
6446
6447         I have lost another battle to Paolo.
6448
6449 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6450
6451         Fix #70942
6452         * class.cs (PropertyMethod): Set Parent field in ctors.
6453         (SetMethod.InternalParameters): Add unsafe switch hack.
6454         Override MarkForDuplicationCheck where it is appropriate.
6455
6456         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6457         It says whether container allows members with the same name.
6458         Base default is no.
6459         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6460         Removed is_method parameter.
6461
6462 2005-01-06  Duncan Mak  <duncan@ximian.com>
6463
6464         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6465         because the previous change led to incorrect reporting of CS1032
6466         ("Cannot define/undefine preprocessor symbols after first token in
6467         file"). Instead of using `tokens_seen' as the only flag that
6468         triggers CS1040, introduce `comments_seen'. This new flag is used
6469         to signify having seen comments on the current line, so it is
6470         unset after a newline.
6471
6472 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6473
6474         * doc.cs : When searching for a type, find nested type too.
6475           This fixes bug #71040.
6476
6477 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6478
6479         * doc.cs :
6480           - Warn missing member comment on those classes which also does not
6481             have doc comments. Fixed bug #71041.
6482           - Don't warn missing doc comment on default constructor.
6483             Fixed bug #71042.
6484
6485 2005-01-06  Duncan Mak  <duncan@ximian.com>
6486
6487         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6488         comments, set `tokens_seen' to true. This allows us to detect
6489         misplaced preprocessor directives (i.e. not at the beginning of
6490         the a line, nor after whitespaces). In that case, report error
6491         CS1040. This fixes bug #56460.
6492
6493         * cs-parser.jay (interface_member_declaration): Add checks for
6494         IsExplicitImpl, and report CS0541 error if an interface member is
6495         defined as an explicit interface declaration.
6496
6497 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6498
6499         Fix #70817
6500         * class.cs (PropertyMethod): Set Parent field in ctors.
6501         (SetMethod.InternalParameters): Add unsafe switch hack.
6502         
6503         * decl.cs (MemberCore.Parent): Cannot be readonly.
6504
6505 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6506
6507         * decl.cs (DeclSpace.ResolveType): Remove.
6508         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6509         Merge in code from ...
6510         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6511         * class.cs, enum.cs: Update to changes.
6512
6513 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6514
6515         * anonymous.cs: Ensure that we init the scope of our parent if it
6516         has not been initialized yet.
6517
6518 2004-12-30  Duncan Mak  <duncan@ximian.com>
6519
6520         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6521         if field.FieldBuilder is null. Fixes #70758.
6522
6523         * convert.cs: Fixed some typos and updated some of the comments.
6524         (ImplicitStandardConversionExists):
6525         (TryImplicitIntConversion): If `target_type' is an interface and
6526         the type of `ic' implements this interface, return true or a new
6527         BoxedCast instead of null. This fixes #70468.
6528
6529 2004-12-29  Duncan Mak  <duncan@ximian.com>
6530
6531         * expression.cs (Argument.Emit): Check that Expr is
6532         IMemoryLocation before casting to it, and report CS1510 otherwise.
6533
6534         This fixes #70402.
6535
6536 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6537
6538         * statement.cs (Block.ThisVariable): remove the recursion here, to
6539         make the --profile more sane.
6540
6541 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6542
6543         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6544         assembly, by JB Evain.
6545
6546 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6547
6548         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6549           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6550         "parent" refers to enclosing type/class.  "base" refers to superclass.
6551
6552 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6553
6554         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6555         Ensure that we only have GlobalAttributes.
6556         * attribute.cs (Attribute.Emit): Make non-virtual.
6557         (GlobalAttribute.Emit): Remove.
6558         (Attribute.Resolve): Make virtual.
6559         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6560         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6561         the argument. Don't create one.
6562         (Attribute.GetObsoleteAttribute): Likewise.
6563         (Attribute.GetClsCompliantAttributeValue): Likewise.
6564         * class.cs, decl.cs: Update to changes.
6565
6566 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6567
6568         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6569         
6570         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6571         
6572         * statement.cs (Foreach.Resolve): Add error 186 report.
6573
6574 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6575
6576         * expression.cs (Conditional.DoResolve): Add warning 429.
6577         
6578         * statement.cs (If.Resolve): Add warning 665.
6579
6580 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6581
6582         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6583         except when in the parser, and in GlobalAttribute.
6584         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6585         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6586         RootContext.Tree.Types.NamespaceEntry once work is done.
6587         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6588         and resets RootContext.Tree.Types.NamespaceEntry.
6589
6590 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6591
6592         * cs-parser.jay: Don't create a block for every variable.
6593
6594 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6595
6596         * location.cs: Provide extra information.
6597
6598         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6599         variables from the captured environment, it is the ldarg_0.
6600
6601 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6602
6603         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6604         find a conclusion.
6605         
6606         * class.cs: Changed warning level for 169 to avoid developer
6607         displeasure from warning flooding. It will be changed back when they
6608         fix most of current BCL warnings.
6609         
6610         * RootContext.cs: Pushed default WarningLevel to 3.
6611         
6612         * statement.cs: Removed unused variable.
6613
6614 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6615
6616         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6617         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6618         Add error 502 report.
6619         (StaticClass.DefineType): Add error 441 report.
6620         (Class.AllowedModifiersProp): New virtual property as temporary
6621         extension to AllowedModifiers.
6622         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6623         to share implementation with StaticClass and don't call virtual
6624         methods from ctor.
6625         
6626         * driver.cs (MainDriver): Add error 1558 test.
6627
6628         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6629         report. Moved error 36 test here.
6630
6631         * statement.cs (Throw.Resolve): Add error 724 report.
6632
6633         * typemanager.cs: Add out_attribute_type core type.
6634         
6635 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6636
6637         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6638         3018 report.
6639         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6640
6641         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6642         3017 report.
6643         
6644         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6645
6646         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6647         Add error 3023 report.
6648         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6649
6650         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6651         implementation.
6652
6653 2004-12-12  John Luke  <john.luke@gmail.com>
6654
6655         * driver.cs (AddArgs): take -- into account when
6656         adding arguments, fixes bug 65710 
6657
6658 2004-12-12  Martin Baulig  <martin@ximian.com>
6659
6660         * expression.cs (Unary.TryReduceNegative): Added support for
6661         SByteConstant and ByteConstant.
6662         (Unary.Reduce): Check error values from TryReduceNegative().
6663
6664 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6665
6666         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6667         and report exception as error 182.
6668
6669 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6670
6671         * driver.cs (Main): Fix message when there are warnings.
6672
6673 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6674
6675         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6676
6677 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6678
6679         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6680         Reduced number of warnings.
6681         
6682         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6683
6684 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6685
6686         * driver.cs: Removed message.
6687
6688         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6689
6690 2004-12-08    <vargaz@freemail.hu>
6691
6692         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6693
6694 2004-12-08  Martin Baulig  <martin@ximian.com>
6695
6696         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6697         instead of a CS3002 for properties and indexer.
6698
6699 2004-12-08  Martin Baulig  <martin@ximian.com>
6700
6701         * decl.cs (MemberName.ToString): Make this work again.
6702
6703 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6704
6705         * attribute.cs (Resolve): Add error 591 detection.
6706
6707         * class.cs (FieldMember.Define): Add error 1547 detection.
6708         (Indexer.Define): Add error 620 detection.
6709         (Operator.Define): Add error 590 detection.
6710
6711         * ecore.cs: Missing argument for error 79.
6712
6713         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6714         detection.
6715
6716 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6717
6718         Fix #70106
6719         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6720         only.
6721
6722 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6723
6724         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6725           Some operator comments were suppressed.
6726         * doc.cs : Implicit/explicit operator name in doc comments are like
6727           "op_Explicit(type)~returnType", so added suffix handling.
6728
6729 2005-01-21  Alp Toker  <alp@atoker.com>
6730
6731         * cs-parser.jay: destructor_declaration's container is PartialContainer
6732         not Class when partial types are used, so use Kind prop instead of 'is'.
6733
6734 2004-12-12  Martin Baulig  <martin@ximian.com>
6735
6736         * expression.cs (Unary.TryReduceNegative): Added support for
6737         SByteConstant and ByteConstant.
6738         (Unary.Reduce): Check error values from TryReduceNegative().
6739
6740 2004-12-11  Martin Baulig  <martin@ximian.com>
6741
6742         * support.cs (ReflectionParameters.ParameterName): If we have a
6743         `gpd', call `ParameterName' on it.
6744
6745         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6746
6747         * pending.cs (PendingImplementation.DefineProxy): Call
6748         DefineParameter() for all of the MethodBuilder's arguments.
6749
6750 2004-12-09  Martin Baulig  <martin@ximian.com>
6751
6752         * doc.cs (DocUtil): Make this a static class.
6753
6754 2004-12-09  Martin Baulig  <martin@ximian.com>
6755
6756         * expression.cs (Invocation.InferType): Moved the type inference
6757         implementation into TypeManager.
6758
6759         * generics.cs (TypeManager): Moved the type inference
6760         implementation here.
6761
6762 2004-12-09  Martin Baulig  <martin@ximian.com>
6763
6764         * typemanager.cs (TypeManager): Make this a partial class.
6765
6766         * generics.cs
6767         (TypeManager): Move the generics part of `TypeManager' here.
6768
6769 2004-12-08  Martin Baulig  <martin@ximian.com>
6770
6771         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6772         instead of a CS3002 for properties and indexer.  Added CS3024
6773         check for generic interfaces.
6774
6775         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6776         instances are not CLS-compliant.
6777
6778 2004-12-08  Martin Baulig  <martin@ximian.com>
6779
6780         * cs-parser.jay
6781         (void_pointer_expression): New rule for `void*', `void**' etc.
6782         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6783
6784 2004-12-08  Martin Baulig  <martin@ximian.com>
6785
6786         * expression.cs (Invocation.InferType): Removed the hack for
6787         MethodCore.MayUnify().  
6788
6789         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6790         this actually work.
6791
6792         * class.cs (MethodCore.MayUnify): Use
6793         TypeManager.MayBecomeEqualGenericTypes().       
6794
6795 2004-12-08  Martin Baulig  <martin@ximian.com>
6796
6797         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6798         parameter, box it.  Fixes #69233.
6799
6800 2004-12-08  Martin Baulig  <martin@ximian.com>
6801
6802         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6803         have the ctor constraint.  Fixes #68326.
6804
6805 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6806
6807         * cs-parser.jay : interface comment was not consumed because of
6808           extra opt_semicolon before doc handling.
6809
6810 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6811
6812         Fix test-327.cs, test-328.cs, and put in early infrastructure
6813         for eventually fixing #52697.
6814         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6815         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6816         from other methods.
6817         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6818         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6819         (VerifyUsing, error246): Update.
6820         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6821         'NamespaceEntry.LookupNamespaceOrType'.
6822
6823 2004-12-07  Martin Baulig  <martin@ximian.com>
6824
6825         * driver.cs: Call it "BETA SOFTWARE" :-)
6826
6827 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6828
6829         Fix crash on cs0657-17.cs.
6830         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6831         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6832         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6833         the case where the NamespaceEntry gets overwritten.
6834
6835 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6836
6837         Fixed #69195, #56821
6838         * ecore.cs (ResolveBoolean): Tiny refactoring.
6839
6840         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6841         of right expression resolving when left is false constant and
6842         operator is LogicalAnd OR true constant and operator is LogicalOr.
6843
6844         * statement.cs (ResolveUnreachable): Always reports warning.
6845
6846 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6847
6848         * class.cs: Distinguish between 1721 and 1722 (just a little help
6849         for the programmer).
6850
6851 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6852
6853         * delegate.cs: Only allow this on new versions of the language. 
6854
6855 2004-12-02  Duncan Mak  <duncan@ximian.com>
6856
6857         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6858         Expression class.
6859         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6860         here as a static method. Take an additional bool out parameter
6861         `must_do_cs1540_check' for signaling to InstanceResolve.
6862         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6863         member field from PropertyExpr class and made it an argument of
6864         the method instead.
6865         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6866         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6867         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6868         and `remove_accessor' as well as InstanceResolve: report CS0122
6869         where applicable.
6870
6871         Fixes #70129.
6872
6873 2004-12-07  Martin Baulig  <martin@ximian.com>
6874
6875         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6876         and CS0692 where appropriate.
6877
6878 2004-12-06  Martin Baulig  <martin@ximian.com>
6879
6880         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6881         IsDuplicateImplementation() and improved it.
6882
6883         * expression.cs (Invocation.InferTypeArguments): Added
6884         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6885         and removed the "ref" modifier from `infered_types'.
6886
6887         * decl.cs (MemberName.ToString): Removed the exception.
6888
6889 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6890
6891         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6892           comments are allowed.
6893
6894 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6895
6896         * delegate.cs: Add checks for subtypes in paramaters and return values
6897         in VerifyMethod () to add support for Covariance/Contravariance
6898         in delegates.
6899         
6900 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6901
6902         * report.cs: Remove extra closing parenthesis.
6903
6904         * convert.cs (Error_CannotImplicitConversion): If the name of the
6905         types are the same, provide some extra information.
6906
6907 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6908
6909         Fix bug #70102
6910         * attribute.cs (Resolve): Improved implementation of params
6911         attribute arguments.
6912
6913         * support.cs (ParameterData): Add HasParams to be faster.
6914
6915 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6916
6917         all things are for /doc support:
6918
6919         * doc.cs: new file that supports XML documentation generation.
6920         * mcs.exe.sources: added doc.cs.
6921         * driver.cs:
6922           Handle /doc command line option.
6923           Report error 2006 instead of 5 for missing file name for /doc.
6924           Generate XML documentation when required, after type resolution.
6925         * cs-tokenizer.cs:
6926           Added support for picking up documentation (/// and /** ... */),
6927           including a new XmlCommentState enumeration.
6928         * cs-parser.jay:
6929           Added lines to fill Documentation element for field, constant,
6930           property, indexer, method, constructor, destructor, operator, event
6931           and class, struct, interface, delegate, enum.
6932           Added lines to warn incorrect comment.
6933         * rootcontext.cs :
6934           Added Documentation field (passed only when /doc was specified).
6935         * decl.cs:
6936           Added DocComment, DocCommentHeader, GenerateDocComment() and
6937           OnGenerateDocComment() and some supporting private members for
6938           /doc feature to MemberCore.
6939         * class.cs:
6940           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6941         * delegate.cs:
6942           Added overriden DocCommentHeader.
6943         * enum.cs:
6944           Added overriden DocCommentHeader and GenerateDocComment().
6945
6946 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6947
6948         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6949         unwrapping the enumeration values, chain to
6950         DoConstantNumericPromotions again, so we can promote things to the
6951         fundamental types (takes care of enums that are bytes, sbytes).
6952
6953         Fixes bug #62054.
6954
6955 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6956
6957         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6958         Fix long-standing bug in type-lookup.  Use FindType instead of
6959         LookupType when ec.ResolvingTypeTree.
6960         (Attribute.ResolveType, Attribute.Resolve)
6961         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6962         Update to changes.
6963         (Attributes.Search): Remove internal version.  Update.
6964         (Attributes.SearchMulti): Update.
6965         (Attributes.GetClsCompliantAttribute): Remove.
6966         (Attributes.GetIndexerNameAttribute): Remove.
6967         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6968         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6969         * class.cs (Indexer.Define): Likewise.
6970
6971 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6972
6973         Fix bug #68790
6974         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6975         MarshallByReference members access.
6976
6977         * expression.cs: Use CheckMarshallByRefAccess;
6978         Better error CS0197 message.
6979
6980         * report.cs: Print whole related error message.
6981
6982 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6983
6984         * class (GetClassBases): Better error 60 report.
6985         (EventProperty): Disabled warning 67 detection.
6986
6987 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6988
6989         Fix bug #60324
6990         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6991
6992         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6993         precise values.
6994
6995 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6996
6997         Fix bug #49488
6998         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6999
7000         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7001
7002 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7003
7004         * attribute.cs (Attribute.Resolve): Refine error reporting and
7005         report a cs0117 if the identifier does not exist, to distinguish
7006         from 0617 which is a miss-use of the actual identifier.
7007
7008         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7009         between cs0070 and cs0079.
7010
7011         * class.cs (MemberBase.DoDefine): When reporting a wrong
7012         accessibility level, we use MethodCore to compare instead of
7013         Method (this was a regression in some refactoring effort).
7014
7015         So now we correctly report cs0056 again.
7016
7017         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7018         testing the target_type (which was known to be object_type) and
7019         not the source type (which is anonymous_method).
7020
7021         Fixed reporting of error cs1660.
7022
7023         * expression.cs (UserCast.Source): Expose the underlying cast.
7024
7025         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7026         allowed types to find a match to int32 first (most common).
7027
7028         In addition, it ignores any ImplicitUserConversions that did an
7029         internal implicit conversion (as the switch statement allows only
7030         one integral conversion to exist).
7031
7032         * class.cs (PartialContainer.Create): rename `name' to
7033         `member_name' for clarity.  Then replace the string calls with a
7034         call to MemberName.GetPartialName, as now using
7035         MemberName.ToString is an error (this is due to the side effects
7036         it had, that were fixed in the past).
7037
7038         This will restore the error reporting on a number of partial class
7039         errors that were missusing this (and getting an exception as a
7040         results, which is now just a plain textual warning, because
7041         yyparse debug output would crash otherwise).
7042
7043 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7044
7045         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7046
7047 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7048
7049         * rootcontext.cs (LookupType): Make sure to cache lookups that
7050         don't give us a negative result. This saves about 5% of corlib
7051         compilation time.
7052
7053 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7054
7055         * report.cs (AbstractMessage.Print): messages are sent to stderr
7056
7057         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7058         non-interface in the list of interfaces (at this point, either
7059         parent was properly set, or a base class is being listed in the
7060         interfaces section).
7061
7062         This flags error 1722, and resolves the crash from bug 69259.
7063
7064 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7065
7066         * statement.cs (Using.EmitExpressionFinally): make this work right
7067         for valuetypes. Fixes 69926.
7068
7069 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7070
7071         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7072         converted to an enum" here, before we try to change the underlying
7073         type.  This code exists, but it is a different code path than the
7074         one used while encoding constants.
7075
7076         (ImplicitReferenceConversionExists): In addition, resynchronized
7077         the code here, so it matches the same code in
7078         ImplicitReferenceConversionExists for the `from any class-type S
7079         to any interface-type T'.       
7080
7081 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7082
7083         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7084
7085 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7086
7087         * cs-parser.jay: Use verbosity accordingly. 
7088
7089 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7090
7091         * expression.cs (Unary.ResolveOperator): Do not report warning;
7092         AddressOf reads from variable.
7093         
7094         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7095
7096 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7097
7098         Fix bug #69462
7099
7100         * attribute.cs (Attributable): Removed CheckTargets.
7101         (Attributes.Emit): Explicit attribute targets are tested here.
7102
7103         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7104         not enabled for interfaces.
7105
7106         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7107         (GetAssemblyName): Ouch next bug there.
7108
7109 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7110
7111         * expression.cs: Error 275 added.
7112         
7113 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7114
7115         Fix bug #69177 (Implemented decimal constant support)
7116
7117         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7118         (BinaryFold): Add DecimalConstant.
7119
7120         * const.cs (Define): Decimal constant 
7121         (is not constant.
7122         (ChangeType): Add decimal type handling.
7123         (LookupConstantValue): Don't set value for decimal type but
7124         emit DecimalConstantAttribute. Needed for constant optimization.
7125
7126         * constant.cs (ToDecimal): New method.
7127         (ConvertToDecimal): New method.
7128         (IntConstant): Implemented ConvertToDecimal.
7129         (DecimalConstant.Emit): Emit optimized version for decimals in
7130         int range.
7131
7132         * expression.cs (ResolveOperator): Changed order of constant
7133         reduction to work correctly with native types which have
7134         overloaded operators.
7135         (ResolveMemberAccess): Extract constant value from attribute
7136         for decimal type.
7137
7138         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7139
7140         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7141         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7142         (ChangeType): Decimal is special.
7143         (TypeToCoreType): Add decimal type.
7144
7145 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7146
7147         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7148         decimal types.
7149
7150 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7151
7152         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7153         test cs1667-5.cs.
7154
7155 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7156
7157         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7158
7159         * pending.cs (PendingImplementation): Grab only interfaces.
7160
7161 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7162
7163         * statement.cs (ForeachHelperMethods): Add location member and
7164         error 202 detection.
7165
7166 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7167
7168         * expression.cs (DoResolveBase): Fixed wrong warning for out
7169         variables.
7170
7171 2004-12-04  Martin Baulig  <martin@ximian.com>
7172
7173         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7174         to check whether the conversion is ok.
7175
7176         * typemanager.cs (TypeManager.GetTypeArguments): Just return
7177         `Type.EmptyTypes' if we're not a generic TypeContainer.
7178
7179 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7180
7181         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7182         old bug: when converting from the null literal to a pointer,
7183         return an EmptyCast, not the NullLiteral.
7184
7185         This fixes #69921, the recent null_type changes probably made this
7186         bug more prominent.
7187
7188 2004-12-03  Martin Baulig  <martin@ximian.com>
7189
7190         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7191         method as our child, call AnonymousMethod.Compatible() on it.
7192
7193 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7194
7195         * class.cs (FieldBase): Use an unused bit field from the field to
7196         encode the `has_offset' property from the FieldMember.  This saves
7197         a couple of Ks on bootstrap compilation.
7198
7199         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7200         method as our child, return the AnonymousMethod resolved
7201         expression.
7202
7203         * expression.cs (New.DoResolve): Allow return values from
7204         NewDelegate to also include AnonymousMethods.
7205
7206         Fixes #70150.
7207
7208 2004-11-29  Raja R Harinath  <rharinath@novell.com>
7209
7210         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7211         cs1648 report.
7212         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7213         System.Runtime.InteropServices._Exception, since it's a base
7214         interface of the core type System.Exception in the net_2_0 profile.
7215
7216 2004-11-27  Martin Baulig  <martin@ximian.com>
7217
7218         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7219
7220 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7221
7222         * Makefile: Convert to use executable.make.
7223         * gmcs.exe.sources: New.
7224
7225 2004-11-25  Martin Baulig  <martin@ximian.com>
7226
7227         * expression.cs (Invocation.InferType): Added support for byref types.
7228
7229 2004-11-25  Martin Baulig  <martin@ximian.com>
7230
7231         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7232         in TypeManager.TypeToCoreType().
7233
7234 2004-11-25  Martin Baulig  <martin@ximian.com>
7235
7236         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7237         "Dispose" method from the `current_type'.
7238         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7239         DoDefineMembers() instead of using the MethodBuilder; this is
7240         required for generic iterators.
7241
7242         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7243
7244 2004-11-24  Martin Baulig  <martin@ximian.com>
7245
7246         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7247
7248 2004-11-20  Martin Baulig  <martin@ximian.com>
7249
7250         * expression.cs (Invocation.InferType): Correctly infer generic
7251         instances; see gen-103.cs.
7252         (Invocation.InferTypeArguments): If a generic method doesn't have
7253         any unbound type parameters, we don't need to infer anything.
7254
7255 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7256
7257         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7258
7259 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7260
7261         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7262         (TypeHandle.GetMemberCache): New.
7263         (TypeHandle.TypeHandle): Update.
7264         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7265         (TypeManager.LookupParentInterfacesCache):
7266         Rename from LookupInterfaceCache.  Optimize slightly.
7267         (TypeManager.MemberLookup_FindMembers): Update.
7268         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7269         multi-type variant.
7270         (AddCacheContents): Rename from AddHashtable.
7271         * class.cs (TypeContainer.parent_container): Remove.
7272         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7273         (TypeContainer.DoDefineMembers): Don't initialize it.
7274         Update to name changes.
7275         
7276 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7277
7278         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7279         that factors the code to check access modifiers on override.  
7280
7281         (PropertyBase): Use the code here.
7282
7283         Patch from Lluis S'anchez, fixes bug #69361.
7284
7285 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7286
7287         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7288         routine that is used to report the use of a captured variable
7289         whose address has been taken.
7290
7291         There are two checks: one when variables are being captured and
7292         the other check is when the address of a variable is taken. 
7293         
7294         (because an anonymous methods might be resolved before *or* after
7295         the address has been taken) and 
7296
7297         * expression.cs (Conditional.DoResolve): Remove the special
7298         casing that Martin added to trueExpr and falseExpr being both
7299         NullLiteral.  We get the right behavior now just by introducing
7300         the null_type into the compiler. 
7301
7302         * convert.cs (ExplicitConversion): Change the code to use
7303         null_type instead of testing `expr is NullLiteral'.
7304         (ImplicitConversionStandard): use null_type too.
7305         (ImplicitReferenceConversionExists): use null_type too.
7306         (ImplicitReferenceConversion): use null_type too.
7307
7308         * literal.cs: The type of `NullLiteral' is now null_type instead
7309         of object_type. 
7310         (Resolve): Set the type here.
7311
7312         * typemanager.cs: Introduce null_type.
7313
7314 2004-11-18  Martin Baulig  <martin@ximian.com>
7315
7316         * rootcontext.cs
7317         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7318
7319 2004-11-18  Martin Baulig  <martin@ximian.com>
7320
7321         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7322
7323 2004-11-18  Martin Baulig  <martin@ximian.com>
7324
7325         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7326         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7327         call ResolveConstructedType() on it to resolve it without checking
7328         constraints.
7329         (Constraints.ResolveTypes): Check them here.
7330         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7331         but don't check constraints.
7332         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7333         check constraints here.
7334         (ConstructedType.ResolveConstructedType): New public method.  This
7335         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7336         resolve ourselves without checking constraints.
7337
7338         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7339
7340 2004-11-18  Martin Baulig  <martin@ximian.com>
7341
7342         * decl.cs
7343         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7344
7345         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7346
7347 2004-11-18  Martin Baulig  <martin@ximian.com>
7348
7349         * ecore.cs (TypeExpr.ResolveType): Removed.
7350         (Expression.ResolveAsTypeTerminal): We always return a fully
7351         resolved `TypeExpr', so we can just access its `Type'.
7352
7353         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7354
7355 2004-11-17  Martin Baulig  <martin@ximian.com>
7356
7357         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7358         sure we don't return any unresolved TypeExpr's.
7359         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7360         a `TypeExpr'.
7361         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7362
7363         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7364         unresolved `ConstructedType's.
7365
7366 2004-11-17  Martin Baulig  <martin@ximian.com>
7367
7368         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7369
7370 2004-11-17  Martin Baulig  <martin@ximian.com>
7371
7372         * ecore.cs
7373         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7374
7375         * decl.cs (DeclSpace.ResolveType): Removed.
7376         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7377
7378 2004-11-17  Martin Baulig  <martin@ximian.com>
7379
7380         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7381         direction, like FindMembers() does.  Fixes #69546, testcase is in
7382         test-315.cs.    
7383
7384 2004-11-16  Martin Baulig  <martin@ximian.com>
7385
7386         This is based on a patch from Marek Safar, see bug #69082.
7387         Fixes bugs #63705 and #67130.
7388
7389         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7390         method; create a MemberCache for an interface type and cache the
7391         result.
7392
7393         * decl.cs (IMemberContainer.ParentContainer): Removed.
7394         (IMemberContainer.ParentCache): New property.
7395         (MemberCache.SetupCacheForInterface): Removed.
7396         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7397         to create a cache for an interface's "parent".
7398
7399         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7400         interfaces too.
7401
7402 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7403
7404         * statement.cs: Avoid adding bools to a hashtable.
7405
7406 2004-11-15  Martin Baulig  <martin@ximian.com>
7407
7408         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7409
7410 2004-11-11  Martin Baulig  <martin@ximian.com>
7411
7412         * typemanager.cs (TypeManager.GetMethodName): New method.
7413
7414         * class.cs (MethodData.Define): Include the generic arity in the
7415         name of an explicit interface; also add it to the method name.
7416
7417         * pending.cs (PendingImplementation.InterfaceMethod): The method
7418         name now includes the generic arity.
7419
7420 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7421
7422         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7423         calling an unsafe method from a safe location.
7424
7425 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7426
7427         Fix #69167
7428         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7429
7430 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7431
7432         * namespace.cs (VerifyUsing): use GetPartialName instead of
7433         ToString. 
7434
7435 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7436
7437         * statement.cs (Return.Resolve): Fix regression in typo: if
7438         `in_exc', we have to request a NeedReturnLabel, this was a typo
7439         introduced in the anonymous method check-in.  Fixes #69131.
7440
7441         * Indexers were using the ShortName when defining themselves,
7442         causing a regression in the compiler bootstrap when applying the
7443         patch from 2004-11-02 (first part), now they use their full name
7444         and the bug is gone.
7445
7446 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7447
7448         * driver.cs: Strip the path from the names of embedded resources. Fixes
7449         #68519.
7450
7451 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7452
7453         Fix error message regression: cs0104-2.cs.
7454         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7455         (AliasEntry.Resolve): Update.
7456         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7457         'silent' flag.
7458         (RootContext.LookupType): Update.
7459
7460 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7461
7462         * cs-parser.jay: Add support for handling accessor modifiers
7463         * class: Add support port accessor modifiers and error checking,
7464         define PropertyMethod.Define as virtual (not abstract anymore)
7465         * ecore.cs: Add checking for proeprties access with access modifiers
7466         * iterators.cs: Modify Accessor constructor call based in the modified
7467         constructor
7468 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7469
7470         * expression.cs (StringConcat): Handle being called twice,
7471         as when we have a concat in a field init with more than two
7472         ctors in the class
7473
7474 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7475
7476         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7477         special case explicit implementations, we should always produce
7478         the .property or .event declaration.
7479         
7480         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7481         since it will not return correct data if people use this
7482         unresolved in the presence of using statements (see test-313).
7483
7484         * class.cs (MethodData.Define): If we are an explicit interface
7485         implementation, set the method name to the full name of the
7486         interface plus the name of the method.  
7487
7488         Notice that using the method.MethodName.GetFullName() does not
7489         work, as it will only contain the name as declared on the source
7490         file (it can be a shorthand in the presence of using statements)
7491         and not the fully qualifed type name, for example:
7492
7493         using System;
7494
7495         class D : ICloneable {
7496                 object ICloneable.Clone ()  {
7497                 }
7498         }
7499
7500         Would produce a method called `ICloneable.Clone' instead of
7501         `System.ICloneable.Clone'.
7502
7503         * namespace.cs (Alias.Resolve): Use GetPartialName.
7504         
7505 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7506
7507         * cs-parser.jay: Add error 1055 report.
7508
7509 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7510
7511         * assign.cs (Assign.DoResolve): Only do the transform of
7512         assignment into a New if the types are compatible, if not, fall
7513         through and let the implicit code deal with the errors and with
7514         the necessary conversions. 
7515
7516 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7517
7518         * cs-parser.jay: Add error 1031 report.
7519
7520         * cs-tokenizer.cs: Add location for error 1038.
7521
7522 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7523
7524         * cs-parser.jay: Add error 1016 report.
7525
7526 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7527
7528         * cs-parser.jay: Add errors 1575,1611 report.
7529
7530 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7531
7532         * cs-parser.jay: Add error 1001 report.
7533
7534 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7535
7536         Fix #68850
7537         * attribute.cs (GetMarshal): Add method argument for
7538         caller identification.
7539
7540         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7541         agument for GetMarshal and RuntimeMissingSupport.
7542
7543 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7544
7545         * attribute.cs (ExtractSecurityPermissionSet): Removed
7546         TypeManager.code_access_permission_type.
7547
7548         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7549
7550 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7551
7552         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7553         for obsolete use of a variable here.   Fixes regression on errors
7554         cs0619-25 and cs0619-26.
7555
7556 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7557
7558         Fix #62358, implemented security attribute encoding.
7559
7560         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7561         Tests permitted SecurityAction for assembly or other types.
7562         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7563         data from SecurityPermissionAttribute to PermisionSet class.
7564
7565         * class.cs (ApplyAttributeBuilder): Added special handling
7566         for System.Security.Permissions.SecurityAttribute based types.
7567
7568         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7569         special handling for System.Security.Permissions.SecurityAttribute
7570         based types.
7571
7572         * enum.cs (ApplyAttributeBuilder): Added special handling
7573         for System.Security.Permissions.SecurityAttribute based types.
7574
7575         * parameter.cs (ApplyAttributeBuilder): Added special handling
7576         for System.Security.Permissions.SecurityAttribute based types.
7577
7578         * rootcontext.cs: Next 2 core types.
7579
7580         * typemanager.cs (TypeManager.security_permission_attr_type):
7581         Built in type for the SecurityPermission Attribute.
7582         (code_access_permission_type): Build in type.
7583
7584 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7585
7586         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7587         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7588         all of this information into
7589         EmitContext.EmitCapturedVariableInstance.
7590         
7591         * codegen.cs (EmitCapturedVariableInstance): move here the
7592         funcionality of emitting an ldarg.0 in the presence of a
7593         remapping.   This centralizes the instance emit code.
7594
7595         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7596         then emit a load of this: it means that we have reached the
7597         topmost ScopeInfo: the one that contains the pointer to the
7598         instance of the class hosting the anonymous method.
7599
7600         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7601         captures to the topmost CaptureContext.
7602
7603 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7604
7605         * expression.cs (LocalVariableReference): Move the knowledge about
7606         the iterators into codegen's EmitCapturedVariableInstance.
7607
7608 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7609
7610         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7611         all code paths return a value from an anonymous method (it is the
7612         same as the 161 error, but for anonymous methods).
7613
7614 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7615
7616         The introduction of anonymous methods in the compiler changed
7617         various ways of doing things in the compiler.  The most
7618         significant one is the hard split between the resolution phase
7619         and the emission phases of the compiler.
7620
7621         For instance, routines that referenced local variables no
7622         longer can safely create temporary variables during the
7623         resolution phase: they must do so from the emission phase,
7624         since the variable might have been "captured", hence access to
7625         it can not be done with the local-variable operations from the runtime.
7626         
7627         * statement.cs 
7628
7629         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7630         is a toplevel block.
7631
7632         (ToplevelBlock): A new kind of Block, these are the blocks that
7633         are created by the parser for all toplevel method bodies.  These
7634         include methods, accessors and anonymous methods.
7635
7636         These contain some extra information not found in regular blocks:
7637         A pointer to an optional CaptureContext (for tracking captured
7638         local variables and parameters).  A pointer to the parent
7639         ToplevelBlock.
7640         
7641         (Return.Resolve): Catch missmatches when returning a value from an
7642         anonymous method (error 1662).
7643         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7644         phase.
7645
7646         (Break.Resolve): ditto.
7647
7648         (SwitchLabel): instead of defining the labels during the
7649         resolution phase, we now turned the public ILLabel and ILLabelCode
7650         labels into methods called GetILLabelCode() and GetILLabel() that
7651         only define the label during the Emit phase.
7652
7653         (GotoCase): Track the SwitchLabel instead of the computed label
7654         (its contained therein).  Emit the code by using
7655         SwitchLabel.GetILLabelCode ().
7656
7657         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7658         whether the Local has been captured or not.
7659
7660         (LocalInfo.IsCaptured): New property, used to tell whether the
7661         local has been captured.
7662         
7663         * anonymous.cs: Vastly updated to contain the anonymous method
7664         support.
7665
7666         The main classes here are: CaptureContext which tracks any
7667         captured information for a toplevel block and ScopeInfo used to
7668         track the activation frames for various local variables.   
7669
7670         Each toplevel block has an optional capture context associated
7671         with it.  When a method contains an anonymous method both the
7672         toplevel method and the anonymous method will create a capture
7673         context.   When variables or parameters are captured, they are
7674         recorded on the CaptureContext that owns them, for example:
7675
7676         void Demo () {
7677              int a;
7678              MyDelegate d = delegate {
7679                  a = 1;
7680              }
7681         }
7682
7683         Here `a' will be recorded as captured on the toplevel
7684         CapturedContext, the inner captured context will not have anything
7685         (it will only have data if local variables or parameters from it
7686         are captured in a nested anonymous method.
7687
7688         The ScopeInfo is used to track the activation frames for local
7689         variables, for example:
7690
7691         for (int i = 0; i < 10; i++)
7692                 for (int j = 0; j < 10; j++){
7693                    MyDelegate d = delegate {
7694                         call (i, j);
7695                    }
7696                 }
7697
7698         At runtime this captures a single captured variable `i', but it
7699         captures 10 different versions of the variable `j'.  The variable
7700         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7701         recorded on a child.  
7702
7703         The toplevel ScopeInfo will also track information like the `this'
7704         pointer if instance variables were referenced (this is necessary
7705         as the anonymous method lives inside a nested class in the host
7706         type of the method). 
7707
7708         (AnonymousMethod): Expanded to track the Toplevel, implement
7709         `AnonymousMethod.Compatible' to tell whether an anonymous method
7710         can be converted to a target delegate type. 
7711
7712         The routine now also produces the anonymous method content
7713
7714         (AnonymousDelegate): A helper class that derives from
7715         DelegateCreation, this is used to generate the code necessary to
7716         produce the delegate for the anonymous method that was created. 
7717
7718         * assign.cs: API adjustments for new changes in
7719         Convert.ImplicitStandardConversionExists.
7720
7721         * class.cs: Adjustments to cope with the fact that now toplevel
7722         blocks are of type `ToplevelBlock'. 
7723
7724         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7725         insteda of standard blocks.
7726
7727         Flag errors if params arguments are passed to anonymous methods.
7728
7729         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7730         `CurrentAnonymousMethod' which points to the current Anonymous
7731         Method.  The variable points to the AnonymousMethod class that
7732         holds the code being compiled.  It is set in the new EmitContext
7733         created for the anonymous method.
7734
7735         (EmitContext.Phase): Introduce a variable and an enumeration to
7736         assist in enforcing some rules about when and where we are allowed
7737         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7738         only one that enfonces this right now).
7739
7740         (EmitContext.HaveCaptureInfo): new helper method that returns
7741         whether we have a CapturedContext initialized.
7742
7743         (EmitContext.CaptureVariable): New method used to register that a
7744         LocalInfo must be flagged for capturing. 
7745
7746         (EmitContext.CapturedParameter): New method used to register that a
7747         parameters must be flagged for capturing. 
7748         
7749         (EmitContext.CapturedField): New method used to register that a
7750         field must be flagged for capturing. 
7751
7752         (EmitContext.HaveCapturedVariables,
7753         EmitContext.HaveCapturedFields): Return whether there are captured
7754         variables or fields. 
7755
7756         (EmitContext.EmitMethodHostInstance): This is used to emit the
7757         instance for the anonymous method.  The instance might be null
7758         (static methods), this (for anonymous methods that capture nothing
7759         and happen to live side-by-side with the current method body) or a
7760         more complicated expression if the method has a CaptureContext.
7761
7762         (EmitContext.EmitTopBlock): Routine that drives the emission of
7763         code: it will first resolve the top block, then emit any metadata
7764         and then emit the code.  The split is done so that we can extract
7765         any anonymous methods and flag any captured variables/parameters.
7766         
7767         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7768         during this phase, the ILGenerator should not be used as labels
7769         and local variables declared here might not be accessible to any
7770         code that is part of an anonymous method.  
7771
7772         Exceptions to this include the temporary variables that are
7773         created by some statements internally for holding temporary
7774         variables. 
7775         
7776         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7777         metadata for a cb
7778
7779         (EmitContext.TemporaryReturn): This method is typically called
7780         from the Emit phase, and its the only place where we allow the
7781         ReturnLabel to be defined other than the EmitMeta.  The reason is
7782         that otherwise we would have to duplicate a lot of logic in the
7783         Resolve phases of various methods that today is on the Emit
7784         phase. 
7785
7786         (EmitContext.NeedReturnLabel): This no longer creates the label,
7787         as the ILGenerator is not valid during the resolve phase.
7788
7789         (EmitContext.EmitThis): Extended the knowledge in this class to
7790         work in anonymous methods in addition to iterators. 
7791
7792         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7793         code is necessary on the stack to access the instance to a local
7794         variable (the variable will be accessed as a field).
7795
7796         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7797         EmitContext.EmitAddressOfParameter): Routines to support
7798         parameters (not completed at this point). 
7799         
7800         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7801         will also remove the parameters.
7802
7803         * convert.cs (Convert): Define a `ConstantEC' which points to a
7804         null.  This is just to prefity some code that uses
7805         ImplicitStandardConversion code and do not have an EmitContext
7806         handy.
7807
7808         The idea is to flag explicitly that at that point in time, it is
7809         known that the conversion will not trigger the delegate checking
7810         code in implicit conversions (which requires a valid
7811         EmitContext). 
7812
7813         Everywhere: pass new EmitContext parameter since
7814         ImplicitStandardConversionExists now requires it to check for
7815         anonymous method conversions. 
7816
7817         (Convert.ImplicitStandardConversionExists): If the type of an
7818         expression is the anonymous_method_type, and the type is a
7819         delegate, we invoke the AnonymousMethod.Compatible method to check
7820         whether an implicit conversion is possible. 
7821
7822         (Convert.ImplicitConversionStandard): Only do implicit method
7823         group conversions if the language level is not ISO_1.
7824
7825         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7826         MethodInfo for the Invoke method.  used by Delegate and
7827         AnonymousDelegate.
7828
7829         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7830         method conversions if the target type is a delegate.
7831
7832         Removed extra debugging nops.
7833
7834         (LocalVariableReference): Turn the `local_info' into a public
7835         field. 
7836
7837         Add `prepared' field, the same hack used for FieldExprs to cope
7838         with composed assignments, as Local variables do not necessarily
7839         operate purely on the stack as they used to: they can be captured
7840         fields. 
7841
7842         Add `temp' for a temporary result, like fields.
7843
7844         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7845
7846         It now copes with Local variables that are captured and emits the
7847         proper instance variable to load it from a field in the captured
7848         case. 
7849
7850         (ParameterReference.DoResolveBase): During the resolve phase,
7851         capture parameters if we are in an anonymous method.
7852
7853         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7854         anonymous method, use the EmitContext helper routines to emit the
7855         parameter reference.
7856
7857         * iterators.cs: Set RemapToProxy to true/false during the
7858         EmitDispose class.
7859
7860         * parameters.cs (GetParameterByName): New helper method. 
7861
7862         * typemanager.cs (anonymous_method_type) a new type that
7863         represents an anonyous method.  This is always an internal type,
7864         used as a fencepost to test against the anonymous-methodness of an
7865         expression. 
7866         
7867 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7868
7869         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7870         561 report.
7871         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7872
7873 2004-11-10  Martin Baulig  <martin@ximian.com>
7874
7875         * expression.cs (Invocation.BetterFunction): If two methods have
7876         equal parameter types, but only one of them is generic, the
7877         non-generic one wins.
7878         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7879         instance; just use `Type.IsValueType' to determine whether
7880         something is a struct or not.
7881         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7882         so we can be called multiple times.
7883
7884 2004-11-10  Martin Baulig  <martin@ximian.com>
7885
7886         * generic.cs (TypeParameter.DefineConstraints): New public method.
7887         (TypeParameter.CheckAccessLevel): Override this and return true.
7888         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7889         override ResolveType() anymore.
7890         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7891
7892 2004-11-10  Martin Baulig  <martin@ximian.com>
7893
7894         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7895         call DeclSpace.ResolveNestedType() on it.
7896
7897 2004-11-10  Martin Baulig  <martin@ximian.com>
7898
7899         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7900         non-null, call ParameterModifier() on it.
7901
7902 2004-11-10  Martin Baulig  <martin@ximian.com>
7903
7904         * iterators.cs
7905         (Iterators): Added `current_type' and `this_type' fields.
7906         (Iterators.DefineIterator): Create a new EmitContext and store it
7907         in `ec'; compute `this_type'.
7908
7909 2004-11-10  Martin Baulig  <martin@ximian.com>
7910
7911         * typemanager.cs
7912         (TypeManager.IsPrivateAccessible): New public method.
7913         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7914
7915 2004-11-10  Martin Baulig  <martin@ximian.com>
7916
7917         * class.cs (TypeContainer.DefineType): Call
7918         TypeBuilder.DefineGenericParameters() before resolving the type
7919         parameters.
7920         (MethodData.parent_method): New protected field.
7921         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7922         (MethodData.Define): Compute `parent_method'.
7923
7924         * decl.cs
7925         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7926         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7927         (DeclSpace.ec): New protected field; store the EmitContext here.
7928         (DeclSpace.EmitContext): New public property.
7929         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7930         (DeclSpace.ResolveNestedType): New public method.
7931         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7932         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7933         (DeclSpace.FamilyAccessible): Likewise.
7934         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7935         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7936         EmitContext.
7937
7938         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7939         field.
7940
7941         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7942         (Enum.Emit): Don't create a new EmitContext.
7943
7944 2004-10-18  Martin Baulig  <martin@ximian.com>
7945
7946         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7947         `Type' directly, but call ResolveType() on it.
7948         (Catch.Resolve): Likewise.
7949         (Foreach.Resolve): Likewise.
7950
7951 2004-10-18  Martin Baulig  <martin@ximian.com>
7952
7953         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7954         `Type' directly, but call ResolveType() on it.
7955         (Probe.DoResolve): Likewise.
7956         (ArrayCreation.LookupType): Likewise.
7957         (TypeOf.DoResolve): Likewise.
7958         (SizeOf.DoResolve): Likewise.
7959
7960 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7961
7962         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7963         the ResolveType.
7964
7965 2004-10-17  John Luke  <john.luke@gmail.com>
7966
7967         * class.cs (Operator.GetSignatureForError): use CSharpName
7968
7969         * parameter.cs (Parameter.GetSignatureForError): Returns
7970         correct name even if was not defined.
7971
7972 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7973
7974         Fix #65816.
7975         * class.cs (TypeContainer.EmitContext): New property.
7976         (DefineNestedTypes): Create an emitcontext for each part.
7977         (MethodCore.DoDefineParameters): Use container's emitcontext.
7978         Pass type array to InternalParameters.
7979         (MemberBase.DoDefine): Use container's emitcontext.
7980         (FieldMember.Define): Likewise.
7981         (Event.Define): Likewise.
7982         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7983         Pass type array to InternalParameters.
7984         (SetIndexerMethod.GetParameterInfo): Likewise.
7985         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7986         * delegate.cs (Define): Pass emitcontext to
7987         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7988         array to InternalParameters.
7989         * expression.cs (ParameterReference.DoResolveBase): Pass
7990         emitcontext to GetParameterInfo.
7991         (ComposedCast.DoResolveAsTypeStep): Remove check on
7992         ec.ResolvingTypeTree.
7993         * parameter.cs (Parameter.Resolve): Change argument to
7994         EmitContext.  Use ResolveAsTypeTerminal.
7995         (Parameter.GetSignature): Change argument to EmitContext.
7996         (Parameters.ComputeSignature): Likewise.
7997         (Parameters.ComputeParameterTypes): Likewise.
7998         (Parameters.GetParameterInfo): Likewise.
7999         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8000         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8001         * support.cs (InternalParameters..ctor): Remove variant that takes
8002         a DeclSpace.
8003         * typemanager.cs (system_intptr_expr): New.
8004         (InitExpressionTypes): Initialize it.
8005
8006 2004-10-12  Chris Toshok  <toshok@ximian.com>
8007
8008         * cs-parser.jay: fix location for try_statement and catch_clause.
8009
8010 2004-10-18  Martin Baulig  <martin@ximian.com>
8011
8012         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8013         `Type' directly, but call ResolveType() on it.
8014         (MemberBase.DoDefine): Likewise.
8015
8016         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8017         `Type' directly, but call ResolveType() on it.
8018         (ComposedCast.DoResolveAsTypeStep): Likewise.
8019
8020         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8021         `Type' directly, but call ResolveType() on it.
8022
8023 2004-10-17  John Luke  <john.luke@gmail.com>
8024
8025         * class.cs (Operator.GetSignatureForError): use CSharpName
8026
8027         * parameter.cs (Parameter.GetSignatureForError): Returns
8028         correct name even if was not defined.
8029
8030 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8031
8032         Fix #65816.
8033         * class.cs (TypeContainer.EmitContext): New property.
8034         (DefineNestedTypes): Create an emitcontext for each part.
8035         (MethodCore.DoDefineParameters): Use container's emitcontext.
8036         Pass type array to InternalParameters.
8037         (MemberBase.DoDefine): Use container's emitcontext.
8038         (FieldMember.Define): Likewise.
8039         (Event.Define): Likewise.
8040         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8041         Pass type array to InternalParameters.
8042         (SetIndexerMethod.GetParameterInfo): Likewise.
8043         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8044         * delegate.cs (Define): Pass emitcontext to
8045         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8046         array to InternalParameters.
8047         * expression.cs (ParameterReference.DoResolveBase): Pass
8048         emitcontext to GetParameterInfo.
8049         (ComposedCast.DoResolveAsTypeStep): Remove check on
8050         ec.ResolvingTypeTree.
8051         * parameter.cs (Parameter.Resolve): Change argument to
8052         EmitContext.  Use ResolveAsTypeTerminal.
8053         (Parameter.GetSignature): Change argument to EmitContext.
8054         (Parameters.ComputeSignature): Likewise.
8055         (Parameters.ComputeParameterTypes): Likewise.
8056         (Parameters.GetParameterInfo): Likewise.
8057         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8058         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8059         * support.cs (InternalParameters..ctor): Remove variant that takes
8060         a DeclSpace.
8061         * typemanager.cs (system_intptr_expr): New.
8062         (InitExpressionTypes): Initialize it.
8063
8064 2004-10-12  Chris Toshok  <toshok@ximian.com>
8065
8066         * cs-parser.jay: fix location for try_statement and catch_clause.
8067
8068 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8069
8070         More DeclSpace.ResolveType avoidance.
8071         * decl.cs (MemberCore.InUnsafe): New property.
8072         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8073         with newly created EmitContext.
8074         (FieldMember.Define): Likewise.
8075         * delegate.cs (Delegate.Define): Likewise.
8076         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8077         only if normal name-lookup fails.
8078         (TypeExpr.DoResolve): Enable error-checking.
8079         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8080         (SizeOf.DoResolve): Likewise.
8081         (ComposedCast.DoResolveAsTypeStep): Likewise.
8082         (StackAlloc.DoResolve): Likewise.
8083         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8084         (Block.Unsafe): New property.
8085         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8086         (Unsafe): Set 'unsafe' flag of contained block.
8087         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8088         (Fixed.Resolve): Likewise.
8089         (Catch.Resolve): Likewise.
8090         (Using.ResolveLocalVariableDecls): Likewise.
8091         (Foreach.Resolve): Likewise.
8092
8093 2004-10-05  John Luke <john.luke@gmail.com>
8094
8095         * cs-parser.jay: add location to error CS0175
8096
8097 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8098
8099         * ecore.cs (Expression.Constantity): Add support for turning null
8100         into a constant.
8101
8102         * const.cs (Const.Define): Allow constants to be reference types
8103         as long as the value is Null.
8104
8105 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8106
8107         * namespace.cs (NamespaceEntry.Using): No matter which warning
8108         level is set, check if this namespace name has already been added.
8109
8110 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8111
8112         * expression.cs: reftype [!=]= null should always use br[true,false].
8113         # 67410
8114
8115 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8116
8117         Fix #67108
8118         * attribute.cs: Enum conversion moved to 
8119         GetAttributeArgumentExpression to be applied to the all
8120         expressions.
8121
8122 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8123
8124         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8125         * class.c (TypeContainer.DefineType): Flag error if
8126         base types aren't accessible due to access permissions.
8127         * decl.cs (DeclSpace.ResolveType): Move logic to
8128         Expression.ResolveAsTypeTerminal.
8129         (DeclSpace.ResolveTypeExpr): Thin layer over
8130         Expression.ResolveAsTypeTerminal.
8131         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8132         Refactor code into NestedAccess.  Use it.
8133         (DeclSpace.NestedAccess): New.
8134         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8135         argument to silence errors.  Check access permissions.
8136         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8137         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8138         (Cast.DoResolve): Likewise.
8139         (New.DoResolve): Likewise.
8140         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8141         (TypeOf.DoResolve): Likewise.
8142
8143         * expression.cs (Invocation.BetterConversion): Return the Type of
8144         the better conversion.  Implement section 14.4.2.3 more faithfully.
8145         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8146         section 14.4.2.2 explicit.
8147         (Invocation.OverloadResolve): Update.
8148         (Invocation): Remove is_base field.
8149         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8150         (Invocation.Emit): Likewise.
8151
8152 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8153
8154         * cs-parser.jay: Reverted 642 warning fix.
8155
8156 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8157
8158         Fix bug #66615
8159         * decl.cs (FindMemberWithSameName): Indexer can have more than
8160         1 argument.
8161
8162 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8163
8164         * expression.cs (LocalVariableReference.DoResolveLValue):
8165         Do not report warning 219 for out values.
8166         (EmptyExpression.Null): New member to avoid extra allocations.
8167
8168 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8169
8170         * cs-parser.jay: Fix wrong warning 642 report.
8171
8172         * cs-tokenizer.cs (CheckNextToken): New helper;
8173         Inspect next character if is same as expected.
8174
8175 2004-09-23  Martin Baulig  <martin@ximian.com>
8176
8177         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8178         (Convert.ImplicitReferenceConversionExists): Likewise.
8179
8180 2004-11-09  Raja R Harinath  <rharinath@novell.com>
8181
8182         * Makefile (DISTFILES): Comment out a few missing files.
8183
8184 2004-10-29  Raja R Harinath  <rharinath@novell.com>
8185
8186         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8187         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
8188         (gmcs.exe): Invoke bootstrap-libs.
8189         (clean-local): Clean the net_2_0_bootstrap profile too.
8190         (PROGRAM_INSTALL_DIR): New.
8191         (install-local): Use it.
8192
8193 2004-10-13  Martin Baulig  <martin@ximian.com>
8194
8195         * generic.cs (TypeManager.InflatedConstraints): New nested class.
8196         (TypeParameter.DefineType): If we're a method type parameter and
8197         that method is overriding something, "inflate" its constraints.
8198
8199 2004-10-12  Martin Baulig  <martin@ximian.com>
8200
8201         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8202         and have type arguments, create and resolve a ConstructedType.
8203
8204 2004-10-12  Martin Baulig  <martin@ximian.com>
8205
8206         * decl.cs (MemberCache.FindMemberToOverride): Use
8207         TypeManager.IsEqual() to compare the parameters and Type.Equals()
8208         to compare the invocationType.
8209
8210         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8211         When comparing two type parameters, only do the signature-only
8212         comparision for method type parameters.
8213
8214 2004-10-11  Martin Baulig  <martin@ximian.com>
8215
8216         * report.cs: Don't make --fatal abort on warnings, we have
8217         -warnaserror for that.
8218
8219 2004-10-11  Martin Baulig  <martin@ximian.com>
8220
8221         * typemanager.cs
8222         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8223         (TypeManager.IsEqual): Call ourself recursively instead of using
8224         Type.IsEqual(). 
8225
8226 2004-10-11  Martin Baulig  <martin@ximian.com>
8227
8228         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8229         on our own type parameters, not on the ones we inherit from a containing
8230         class.
8231
8232         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8233         the comparision.
8234
8235         * generic.cs (TypeParameter.Define): We may only be called once.
8236
8237         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8238         instead of TypeManager.IsEqual().
8239
8240 2004-09-28  Martin Baulig  <martin@ximian.com>
8241
8242         * generic.cs
8243         (GenericConstraints.EffectiveBaseClass): New public property.
8244         (TypeParameter.GenericConstraints): New public property.
8245         (ConstructedType.CheckConstraints): Improved.
8246
8247         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8248         (Convert.TypeParameterConversion): New private method; use this in
8249         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8250         for all conversions related to type parameters.
8251
8252 2004-09-24  Martin Baulig  <martin@ximian.com>
8253
8254         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8255         type parameter conversions for type parameters which are known to
8256         be reference types.
8257
8258 2004-09-24  Martin Baulig  <martin@ximian.com>
8259
8260         * generic.cs (GenericConstraints): Added `IsReferenceType' and
8261         `IsValueType' properties.
8262
8263         * support.cs (ReflectionConstraints): Use
8264         Type.GetGenericParameterConstraints() instead of the old hack.
8265
8266 2004-09-24  Martin Baulig  <martin@ximian.com>
8267
8268         * generic.cs (GenericConstraints): Moved here and made it an
8269         abstract class.
8270
8271         * support.cs (GenericConstraints): Moved to generic.cs.
8272
8273 2004-09-24  Martin Baulig  <martin@ximian.com>
8274
8275         * support.cs
8276         (ReflectionConstraints): Un-nested this class and made it public.
8277
8278         * typemanager.cs
8279         (TypeManager.GetTypeParameterConstraints): New public method.
8280         (TypeManager.HasConstructorConstraint): Use the attributes.
8281
8282 2004-09-24  Martin Baulig  <martin@ximian.com>
8283
8284         * support.cs (GenericConstraints): Replaced `HasConstructor',
8285         `IsReferenceType' and `IsValueType' with `Attributes'.
8286         (ReflectionParameters.ReflectionConstraints): Removed the Create()
8287         method and made the .ctor public.
8288
8289         * generic.cs (Constraints.Attributes): New public property.
8290         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8291         `IsReferenceType' -> `HasReferenceTypeConstraint' and
8292         `IsValueType' -> `HasValueTypeConstraint'.
8293
8294 2004-09-23  Martin Baulig  <martin@ximian.com>
8295
8296         * generic.cs (Constraints): Reflect latest runtime changes.
8297
8298 2004-09-23  Martin Baulig  <martin@ximian.com>
8299
8300         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8301         (Convert.ImplicitReferenceConversionExists): Likewise.
8302
8303 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8304
8305         * class.cs (Operator.Define): Add error 448 and 559 report.
8306         
8307 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8308
8309         * class.cs (MemberBase.IsTypePermitted): New protected
8310         method for checking error CS0610.
8311
8312 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8313
8314         * class.cs (TypeContainer.HasExplicitLayout): New property
8315         Returns whether container has StructLayout attribute set Explicit.
8316         (FieldMember): New abstract class for consts and fields.
8317         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8318         (Field): Reuse FieldMember.
8319
8320         * const.cs (Const): Reuse FieldMember.
8321
8322         * rootcontext.cs: EmitConstants call moved to class.
8323
8324 2004-09-22  Martin Baulig  <martin@ximian.com>
8325
8326         Marek and me just fixed one of our oldest bugs: #28562 :-)
8327
8328         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8329
8330         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8331         we're an EnumConstant, just return that.
8332         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8333         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8334         to get the value which'll actually be written into the attribute.
8335         However, we have to use GetValue() to access the attribute's value
8336         in the compiler.        
8337
8338 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8339
8340         * constant.cs (Constant.IsNegative): New abstract property
8341         IsNegative.
8342
8343         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8344         (StackAlloc.DoResolve): Reused IsNegative.
8345
8346 2004-09-22  Martin Baulig  <martin@ximian.com>
8347
8348         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8349         public method; like LookupTypeContainer, but also works for
8350         generic instances.
8351
8352         * report.cs (Report.SymbolRelatedToPreviousError): Use
8353         TypeManager.LookupGenericTypeContainer().       
8354
8355 2004-09-22  Martin Baulig  <martin@ximian.com>
8356
8357         Thanks to Peter Sestoft for this bug report.
8358
8359         * expression.cs (Conditional): If both the `trueExpr' and the
8360         `falseExpr' is a NullLiteral, return a NullLiteral.
8361
8362 2004-09-22  Martin Baulig  <martin@ximian.com>
8363
8364         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8365         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8366         for the "get_Current" call.
8367
8368 2004-09-21  Martin Baulig  <martin@ximian.com>
8369
8370         * convert.cs (Convert.ImplicitReferenceConversion): When
8371         converting to an interface type, first check whether we're
8372         converting from a reference type.
8373
8374 2004-09-14  Martin Baulig  <martin@ximian.com>
8375
8376         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8377
8378 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8379
8380         Fixed bug #61902
8381         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8382         called and is obsolete then this member suppress message
8383         when call is inside next [Obsolete] method or type.
8384
8385         * expression.cs: Use TestObsoleteMethodUsage member.
8386
8387 2004-09-14  Martin Baulig  <martin@ximian.com>
8388
8389         * genericparser.cs: Removed.
8390
8391 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8392
8393         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8394
8395 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8396
8397         * attribute.cs (Attribute.Resolve): Add error 653 report.
8398
8399         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8400         report.
8401         (Method.ApplyAttributeBuilder): Add error 685 report.
8402         (Operator.Define): Add error 564 report.
8403
8404         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8405
8406         * expression.cs (Invocation.DoResolve): Add error
8407         245 and 250 report.
8408
8409         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8410         error 674 report.
8411
8412 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8413
8414         * class.cs (ConstructorInitializer.Resolve):
8415         Wrong error number (515->516).
8416
8417 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8418
8419         * class.cs (Indexer.Define): Add error 631 report.
8420
8421 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8422
8423         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8424
8425 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8426
8427         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8428
8429 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8430
8431         * cs-parser.jay: Added error CS0241 report.
8432
8433 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8434
8435         * cs-parser.jay (fixed_statement): Introduce a scope for the
8436         declaration in the 'fixed' statement.
8437
8438 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8439
8440         * cs-parser.jay: Added CS0230 error report.
8441
8442 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8443
8444         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8445
8446 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8447
8448         * expression.cs (Argument.Resolve): Added error CS0192 and
8449         CS0199 report.
8450
8451 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8452
8453         C# 2.0 #pragma warning feature
8454
8455         * cs-tokenizer.cs (PreProcessPragma): New method; 
8456         Handles #pragma directive.
8457
8458         * report.cs (WarningRegions): New class; Support
8459         class for #pragma warning directive. It tests whether
8460         warning is enabled for a given line.
8461
8462 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8463
8464         * const.cs: Add more descriptive error report, tahnks to
8465         Sebastien. 
8466
8467 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8468
8469         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8470
8471 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8472
8473         * expression.cs: Apply patch from Ben: Remove dead code from
8474         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8475         as that code just threw an exception anwyays.
8476
8477         * const.cs: Remove the call to the turnintoconstant, for details
8478         see bug: #63144
8479         
8480         * literal.cs: The type of the null-literal is the null type;  So
8481         we use a placeholder type (literal.cs:System.Null, defined here)
8482         for it.
8483
8484         * expression.cs (Conditional.DoResolve): Remove some old code that
8485         is no longer needed, conversions have been fixed.
8486
8487         (ArrayCreationExpression.DoResolve): Return false if we fail to
8488         resolve the inner expression.
8489
8490 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8491
8492         Fix test-290.cs.
8493         * cs-parser.jay (delegate_declaration): Record a delegate
8494         declaration as a type declaration.
8495         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8496
8497 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8498
8499         * parameter.cs: Do not crash if the type can not be resolved. 
8500
8501         * expression.cs: Report errors with unsafe pointers, fixes #64896
8502
8503 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8504
8505         * expression.cs: Pointer arith always needs to do a conv.i
8506         if the operand is a long. fix 65320
8507
8508 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8509
8510         Fixed cs0619-37.cs, cs0619-38.cs
8511
8512         * enum.cs (GetObsoleteAttribute): Removed.
8513
8514         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8515         on Enum member is double staged. The first is tested member
8516         and then enum.
8517
8518 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8519
8520         Fixed #56986, #63631, #65231
8521
8522         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8523         adds member to name container.
8524         (TypeContainer.AddToTypeContainer): New method, adds type to
8525         name container.
8526         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8527         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8528         AddOperator): Simplified by reusing AddToMemberContainer.
8529         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8530         instead of field.
8531         (Method.CheckForDuplications): Fixed implementation to test all
8532         possibilities.
8533         (MemberBase): Detection whether member is explicit interface
8534         implementation is now in constructor.
8535         (MemberBase.UpdateMemberName): Handles IndexerName.
8536         (Accessor): Changed to keep also location information.
8537         (AbstractPropertyEventMethod): Is derived from MemberCore.
8538         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8539         will be emited or not.
8540         (PropertyBase.AreAccessorsDuplicateImplementation):
8541         Tests whether accessors are not in collision with some method.
8542         (Operator): Is derived from MethodCore to simplify common
8543         operations.
8544
8545         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8546         must be performed.
8547         (DeclSpace.AddToContainer): Adds the member to defined_names
8548         table. It tests for duplications and enclosing name conflicts.
8549
8550         * enum.cs (EnumMember): Clean up to reuse the base structures
8551
8552 2004-09-03  Martin Baulig  <martin@ximian.com>
8553
8554         Merged latest changes into gmcs.  Please keep this comment in
8555         here, it makes it easier for me to see what changed in MCS since
8556         the last time I merged.
8557
8558 2004-09-03  Martin Baulig  <martin@ximian.com>
8559
8560         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8561         into TypeContainer, to make partial classes work again.
8562
8563 2004-09-03  Martin Baulig  <martin@ximian.com>
8564
8565         * rootcontext.cs (RootContext.V2): Removed.
8566
8567 2004-03-23  Martin Baulig  <martin@ximian.com>
8568
8569         * expression.cs (Invocation.OverloadResolve): Added `bool
8570         may_fail' argument and use it instead of the Location.IsNull() hack.
8571
8572 2004-09-09  Martin Baulig  <martin@ximian.com>
8573
8574         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8575
8576 2004-09-09  Martin Baulig  <martin@ximian.com>
8577
8578         * generic.cs (TypeParameter.DefineType): Added support for
8579         explicit interface methods.
8580
8581 2004-09-09  Martin Baulig  <martin@ximian.com>
8582
8583         * README.Changes: New document.  Started to list important changes
8584         between MCS and GMCS here.
8585
8586 2004-09-08  Martin Baulig  <martin@ximian.com>
8587
8588         * class.cs
8589         (TypeContainer.CheckRecursiveDefinition): New protected method.
8590         (TypeContainer.DefineType): Move the CS0146 check into
8591         CheckRecursiveDefinition().     
8592
8593 2004-09-06  Martin Baulig  <martin@ximian.com>
8594
8595         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8596         types for the constructor constraint.
8597
8598 2004-09-03  Martin Baulig  <martin@ximian.com>
8599
8600         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8601         into TypeContainer, to make partial classes work again.
8602
8603 2004-09-03  Martin Baulig  <martin@ximian.com>
8604
8605         * rootcontext.cs (RootContext.V2): Removed.
8606
8607 2004-03-23  Martin Baulig  <martin@ximian.com>
8608
8609         * expression.cs (Invocation.OverloadResolve): Added `bool
8610         may_fail' argument and use it instead of the Location.IsNull() hack.
8611
8612 2004-09-03  Martin Baulig  <martin@ximian.com>
8613
8614         Merged latest changes into gmcs.  Please keep this comment in
8615         here, it makes it easier for me to see what changed in MCS since
8616         the last time I merged.
8617
8618 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8619
8620         Fix #61128.
8621         * expression.cs (BetterConversion): Don't allow either conversion 
8622         to be null.  Remove redundant implicit conversion test when 'q ==
8623         null' -- when this function is invoked, we already know that the
8624         implicit conversion exists.
8625         (BetterFunction): Assume that 'best' is non-null.  Remove
8626         redundant reimplementation of IsApplicable when 'best' is null.
8627         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8628         number of arguments.
8629         (IsAncestralType): Extract from OverloadResolve.
8630         (OverloadResolve): Make robust to the MethodGroupExpr being
8631         unsorted.  Implement all the logic of Section 14.5.5.1, and
8632         support overloading of methods from multiple applicable types.
8633         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8634
8635         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8636         (RealError, Warning): Append type of report to related symbol.
8637
8638 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8639
8640         * enum.cs: Fixed CLS-Compliance checks for enum members.
8641         Error tests cs3008-8.cs, cs3014-8.cs
8642
8643 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8644
8645         Fixed bug #62342, #63102
8646         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8647         like ImplementMethod.
8648
8649 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8650
8651         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8652         Fixed bug #65170.
8653
8654 2004-09-02  Martin Baulig  <martin@ximian.com>
8655
8656         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8657         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8658         on the MethodBase.
8659
8660 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8661
8662         C# 2.0 Static classes implemented
8663
8664         * class.cs (TypeContainer): instance_constructors,
8665         initialized_fields, initialized_static_fields,
8666         default_constructor, base_inteface_types are protected to be
8667         accessible from StaticClass.
8668         (TypeContainer.DefineDefaultConstructor): New virtual method
8669         for custom default constructor generating
8670         (StaticClass): New class to handle "Static classes" feature.
8671
8672         * cs-parser.jay: Handle static keyword on class like instance
8673         of StaticClass.
8674
8675         * driver.cs: Added "/langversion" command line switch with two
8676         options (iso-1, default).
8677
8678 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8679
8680         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8681
8682 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8683
8684         * delegate.cs: Style.
8685
8686 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8687
8688         * delegate.cs: Add seperate instance expr field for miguel.
8689
8690 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8691
8692         * PointerArithmetic (Resolve): make sure we are not doing
8693         pointer arith on void*. Also, make sure we are resolved
8694         by not setting eclass until resolve.
8695
8696         All callers: Make sure that PointerArithmetic gets resolved.
8697
8698 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8699
8700         * ArrayCreation (LookupType): If the type does not resolve 
8701         to an array, give an error.
8702
8703 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8704
8705         * statement.cs (Try.Resolve): Fixed bug #64222
8706
8707 2004-08-27  Martin Baulig  <martin@ximian.com>
8708
8709         * class.cs
8710         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8711         crash here.     
8712
8713 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8714
8715         * ecore.cs (Constantify): Get underlying type via
8716         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8717         Windows in special cases.
8718
8719 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8720
8721         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8722         for obtaining also private methods.
8723         (GetRemoveMethod): Used GetRemoveMethod (true)
8724         for obtaining also private methods.
8725
8726 2004-09-02  Martin Baulig  <martin@ximian.com>
8727
8728         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8729         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8730         on the MethodBase.
8731
8732 2004-08-27  Martin Baulig  <martin@ximian.com>
8733
8734         * class.cs
8735         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8736         crash here.     
8737
8738 2004-08-25  Martin Baulig  <martin@ximian.com>
8739
8740         * support.cs (ReflectionParameters..ctor): If this is a generic
8741         method, retrieve and store its type parameters.
8742         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8743         (ReflectionParameters.GenericConstraints): The argument specifies
8744         the type parameter, not the method parameter.
8745         (InternalParameters.GenericConstraints): Likewise.
8746
8747         * generic.cs (TypeParameter.DefineType): Correctly handle
8748         constraints wrt. generic methods in interfaces and their
8749         implementations.        
8750
8751 2004-08-24  Martin Baulig  <martin@ximian.com>
8752
8753         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8754         (Constraints.IsSubclassOf): New internal method.
8755
8756         * typemanager.cs (TypeManager.FindMembers): Added special support
8757         for GenericTypeParameterBuilder's.      
8758         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8759         type parameters.
8760
8761 2004-08-24  Martin Baulig  <martin@ximian.com>
8762
8763         * typemanager.cs
8764         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8765         this for accessibility checks.
8766         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8767         IsNestedFamilyAccessible.
8768         (TypeManager.IsSubclassOf): New method, do what the name actually
8769         says.   
8770
8771 2004-08-24  Martin Baulig  <martin@ximian.com>
8772
8773         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8774         as a SimpleName, include the generic arity.
8775
8776 2004-08-24  Martin Baulig  <martin@ximian.com>
8777
8778         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8779         MethodAttributes.HideBySig for operators.
8780
8781 2004-08-23  Martin Baulig  <martin@ximian.com>
8782
8783         Back to the old error reporting system :-)
8784
8785         * report.cs (Message): Removed.
8786         (Report.MessageData, ErrorData, WarningData): Removed.
8787         (Report.Error, Warning): Back to the old system.
8788
8789 2004-08-23  Martin Baulig  <martin@ximian.com>
8790
8791         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8792
8793         * class.cs (TypeContainer.ParentContainer): New public virtual
8794         method; replaces the explicit interface implementation.
8795         (ClassPart.ParentContainer): Override.
8796
8797 2004-08-23  Martin Baulig  <martin@ximian.com>
8798
8799         * statement.cs (Switch): Added support for constant switches; see
8800         #59428 or test-285.cs.
8801
8802 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8803
8804         Fixed bug #62740.
8805         * statement.cs (GetEnumeratorFilter): Removed useless
8806         logic because C# specs is strict. GetEnumerator must be
8807         public.
8808
8809 2004-08-22  Martin Baulig  <martin@ximian.com>
8810
8811         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8812         a switch and may break, reset the barrier.  Fixes #59867.
8813
8814 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8815
8816         CLS-Compliance speed up (~5% for corlib)
8817
8818         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8819         New method. Tests container for CLS-Compliant names
8820
8821         * class.cs (TypeContainer.VerifyClsName): New method.
8822         Checks whether container name is CLS Compliant.
8823         (Constructor): Implements IMethodData.
8824
8825         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8826         low-case table for CLS Compliance test.
8827         (MemberCache.VerifyClsParameterConflict): New method.
8828         Checks method parameters for CS3006 error.
8829
8830         * enum.cs (EnumMember): Is derived from MemberCore.
8831         (Enum.VerifyClsName): Optimized for better performance.
8832
8833 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8834
8835         * report.cs: Renamed Error_T to Error and changed all
8836         references.
8837
8838 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8839
8840         * class.cs (TypeContainer.IndexerArrayList): New inner class
8841         container for indexers.
8842         (TypeContainer.DefaultIndexerName): New constant for default
8843         indexer name. Replaced all "Item" with this constant.
8844         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8845
8846         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8847         DefaultMemberAttribute constructor.
8848
8849 2004-08-05  Martin Baulig  <martin@ximian.com>
8850
8851         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8852         Fix bug #59429.
8853
8854 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8855
8856         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8857         multi platforms problem.
8858
8859         * compiler.csproj: Included shared files.
8860
8861 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8862
8863         Fix bug 60333, 55971 in the more general way
8864         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8865         Added arg_type argument for constant conversion.
8866         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8867
8868 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8869
8870         Fix bug #59760
8871         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8872         OperatorArrayList, MethodCoreArrayList for typecontainer
8873         containers. Changed class member types to these new types.
8874         (MethodArrayList.DefineMembers): Added test for CS0659.
8875
8876 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8877
8878         * cfold.cs: Synchronize the folding with the code in expression.cs
8879         Binary.DoNumericPromotions for uint operands.
8880
8881         * attribute.cs: Revert patch from Raja, it introduced a regression
8882         while building Blam-1.2.1 (hard to isolate a test case).
8883
8884 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8885
8886         Fix for #55382
8887         * class.cs:
8888         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8889         name collision.
8890         (MethodCore.parent_method): New member. The method we're overriding
8891         if this is an override method.
8892         (MethodCore.CheckBase): Moved from Method class and made common.
8893         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8894         private.
8895         (MethodCore.CheckForDuplications): New abstract method. For custom
8896         member duplication search in a container
8897         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8898         method and its return type.
8899         (Event.conflict_symbol): New member. Symbol with same name in the
8900         parent class.
8901
8902         * decl.cs:
8903         (MemberCache.FindMemberWithSameName): New method. The method
8904         is looking for conflict with inherited symbols.
8905
8906 2004-08-04  Martin Baulig  <martin@ximian.com>
8907
8908         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8909
8910         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8911
8912 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8913
8914         * report.cs (Message): New enum for better error, warning reference in
8915         the code.
8916         (MessageData): New inner abstract class. It generally handles printing of
8917         error and warning messages.
8918         Removed unused Error, Warning, Message methods.
8919
8920 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8921
8922         Fix for cs0592-8.cs test
8923         * attribute.cs
8924         (Attributable.ValidAttributeTargets): Made public.
8925         (Attribute.ExplicitTarget): New member for explicit target value.
8926         (Attribute.CheckTargets): Now we translate explicit attribute
8927         target to Target here.
8928
8929 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8930
8931         * ecore.cs (MethodGroupExpr): new IsBase property.
8932
8933         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8934
8935         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8936         rather than an instance expr.
8937
8938         (DelegateCreation.Emit): Use the method group rather than
8939         the instance expression. Also, if you have base.Foo as the
8940         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8941
8942         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8943
8944         (NewDelegate.DoResolve): Only check for the existance of Invoke
8945         if the method is going to be needed. Use MethodGroupExpr.
8946
8947         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8948
8949         * expression.cs: For pointer arith., make sure to use
8950         the size of the type, not the size of the pointer to
8951         the type.
8952
8953 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8954
8955         Fix for #60722
8956         * class.cs (Class): Added error CS0502 test.
8957
8958 2004-08-03  John Luke  <jluke@cfl.rr.com>
8959             Raja R Harinath  <rharinath@novell.com>
8960
8961         Fix for #60997.
8962         * attribute.cs (Attribute.complained_before): New flag.
8963         (Attribute.ResolveType, Attribute.Resolve),
8964         (Attribute.DefinePInvokeMethod): Set it.
8965         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8966         
8967 2004-08-03  Martin Baulig  <martin@ximian.com>
8968
8969         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8970         use a user-defined operator; we still need to do numeric
8971         promotions in case one argument is a builtin type and the other
8972         one has an implicit conversion to that type.  Fixes #62322.
8973
8974 2004-08-18  Martin Baulig  <martin@ximian.com>
8975
8976         * class.cs (Method.Define): Use the correct method name when
8977         creating the MethodBuilder for a generic method.
8978
8979 2004-08-17  Martin Baulig  <martin@ximian.com>
8980
8981         * generic.cs (Constraints): Support type parameter constraints.
8982
8983 2004-08-16  Martin Baulig  <martin@ximian.com>
8984
8985         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8986         (Token.GENERIC_DIMENSION): New token; this is returned if we
8987         encounter an unbound generic type in a typeof() expression.
8988
8989         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8990         this token is only generated while parsing a typeof() expression.
8991         (typeof_expression): Removed the old unbound_type hack.
8992
8993         * generic.cs (TypeArguments.IsUnbound): New public property.
8994
8995         * decl.cs (MemberName): Added support for unbound types.
8996
8997 2004-08-14  Martin Baulig  <martin@ximian.com>
8998
8999         * typemanager.cs
9000         (TypeManager.IsEqualGenericInstance): New static method.
9001         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9002         just used to check accessibility, so follow the rules of 26.1.6.        
9003
9004         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9005         ConstructedType instead of a TypeExpression if we have type arguments.
9006
9007         * cs-parser.jay (typeof_expression): Support unbound generic types.
9008
9009         * ecore.cs (UnboundTypeExpression): New public class.
9010
9011 2004-08-12  Martin Baulig  <martin@ximian.com>
9012
9013         * typemanager.cs (TypeManager.IsNestedChildOf): Use
9014         TypeManager.IsEqual() rather than `=='.
9015
9016         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9017         generic instances as well.
9018
9019 2004-08-12  Martin Baulig  <martin@ximian.com>
9020
9021         * expression.cs (Invocation.InferType): We can only infer method
9022         type parameters.  Fixes #62647.
9023
9024 2004-08-11  Martin Baulig  <martin@ximian.com>
9025
9026         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9027         before resolving the base classes.
9028
9029 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9030
9031         * Makefile: install .mdb file too.
9032
9033 2004-08-05  Martin Baulig  <martin@ximian.com>
9034
9035         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9036         initializer, the current type is just the TypeBuilder, not the
9037         instantiated generic type.
9038         (FieldExpr.IsFieldInitializer): New public property.
9039
9040 2004-08-04  Martin Baulig  <martin@ximian.com>
9041
9042         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9043
9044         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9045
9046 2004-08-03  Martin Baulig  <martin@ximian.com>
9047
9048         * class.cs (MethodData.Define): If we're an explicit
9049         implementation, remove the generic arity from the type name.
9050
9051 2004-08-03  Martin Baulig  <martin@ximian.com>
9052
9053         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9054         use a user-defined operator; we still need to do numeric
9055         promotions in case one argument is a builtin type and the other
9056         one has an implicit conversion to that type.  Fixes #62322.
9057
9058 2004-08-02  Martin Baulig  <martin@ximian.com>
9059
9060         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9061         `TypeExpr[]' array.
9062         (TypeContainer.GetClassBases): Return the unexpanded list of
9063         interfaces; we expand them later.
9064         (TypeContainer.DefineType): After creating the TypeBuilder, call
9065         TypeManager.ExpandInterfaces() to get an expanded and resolved
9066         list of interfaces.
9067
9068         * ecore.cs (TypeExpr.GetInterfaces): Removed
9069
9070         * generics.cs (Constraints.InterfaceConstraints): Remove.
9071         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9072         register the interface constraints.
9073
9074         * typemanager.cs
9075         (TypeManager.AddUserType): Removed the `ifaces' argument.
9076         (TypeManager.AddTypeParameter): Likewise.
9077         (TypeManager.AddUserInterface): Removed, was unused.
9078         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9079         `TypeExpr[]' array for the interfaces.
9080         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9081         has been defined, returns a list of the resolved interfaces types.
9082         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9083         (TypeManager.GetExplicitInterfaces): Likewise.  
9084
9085 2004-08-02  Martin Baulig  <martin@ximian.com>
9086
9087         * expression.cs (Invocation.EmitCall): If we're invoking a method
9088         on a type parameter, use the new `Constrained' prefix opcode.
9089
9090 2004-08-02  Martin Baulig  <martin@ximian.com>
9091
9092         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9093         (LocalInfo.IsThis): New public property.
9094         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9095
9096 2004-08-01  Martin Baulig  <martin@ximian.com>
9097
9098         * class.cs (TypeContainer.GetClassBases): Don't set the default
9099         here since we may get called from GetPartialBases().
9100         (TypeContainer.DefineType): If GetClassBases() didn't return a
9101         parent, use the default one.
9102
9103 2004-07-30  Martin Baulig  <martin@ximian.com>
9104
9105         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9106
9107         * class.cs (SourceMethod): New public class, derive from the
9108         symbol writer's ISourceMethod.
9109         (Method): Use the new symbol writer API.
9110
9111         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9112         as argument and use the new symbol writer.
9113
9114         * location.cs
9115         (SourceFile): Implement the symbol writer's ISourceFile.
9116         (Location.SymbolDocument): Removed.
9117         (Location.SourceFile): New public property.
9118
9119         * symbolwriter.cs: Use the new symbol writer API.
9120
9121 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9122
9123         * Makefile (install-local): Remove.  Functionality moved to
9124         executable.make.
9125
9126 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9127
9128         * Makefile: Install mcs.exe.config file together with mcs.exe.
9129         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9130         correct runtime version.
9131         
9132 2004-07-25  Martin Baulig  <martin@ximian.com>
9133
9134         * class.cs
9135         (TypeContainer.RegisterOrder): Removed, this was unused.
9136         (TypeContainer, interface_order): Removed.
9137         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9138         TypeContainer as argument since we can also be called with a
9139         `PartialContainer' for a partial class/struct/interface.
9140         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9141         of checking whether we're an `Interface' - we could be a
9142         `PartialContainer'.
9143         (PartialContainer.Register): Override; call
9144         AddClass()/AddStruct()/AddInterface() on our parent.
9145
9146         * cs-parser.jay (interface_member_declaration): Add things to the
9147         `current_container', not the `current_class'.
9148
9149         * rootcontext.cs (RegisterOrder): The overloaded version which
9150         takes an `Interface' was unused, removed.
9151
9152         * typemanager.cs (TypeManager.LookupInterface): Return a
9153         `TypeContainer', not an `Interface'.
9154         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9155         contain a `PartialContainer' for an interface, so check it's
9156         `Kind' to figure out what it is.
9157
9158 2004-07-25  Martin Baulig  <martin@ximian.com>
9159
9160         * class.cs (Class.DefaultTypeAttributes): New public constant.
9161         (Struct.DefaultTypeAttributes): Likewise.
9162         (Interface.DefaultTypeAttributes): Likewise.
9163         (PartialContainer.TypeAttr): Override this and add the
9164         DefaultTypeAttributes.
9165
9166 2004-07-25  Martin Baulig  <martin@ximian.com>
9167
9168         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9169         we can just use the `Parent' field instead.
9170
9171 2004-07-25  Martin Baulig  <martin@ximian.com>
9172
9173         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9174
9175 2004-07-25  Martin Baulig  <martin@ximian.com>
9176
9177         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9178         our parts before defining any methods.
9179         (TypeContainer.VerifyImplements): Make this virtual.
9180         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9181         on our PartialContainer.
9182
9183 2004-07-25  Martin Baulig  <martin@ximian.com>
9184
9185         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9186
9187         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9188         argument, we can just use the `Parent' field instead.
9189
9190         * class.cs
9191         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9192         (MemberBase.DoDefine): Likewise.
9193
9194 2004-07-24  Martin Baulig  <martin@ximian.com>
9195
9196         * decl.cs (MemberCore.Parent): New public field.
9197         (DeclSpace.Parent): Moved to MemberCore.
9198
9199         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9200         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9201         parent's .ctor.
9202         (FieldBase, Field, Operator): Likewise.
9203         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9204         (EventField, Event): Likewise.
9205
9206 2004-07-23  Martin Baulig  <martin@ximian.com>
9207
9208         * class.cs (PartialContainer): New public class.
9209         (ClassPart): New public class.
9210         (TypeContainer): Added support for partial classes.
9211         (TypeContainer.GetClassBases): Splitted some of the functionality
9212         out into GetNormalBases() and GetPartialBases().
9213
9214         * cs-tokenizer.cs (Token.PARTIAL): New token.
9215         (Tokenizer.consume_identifier): Added some hacks to recognize
9216         `partial', but only if it's immediately followed by `class',
9217         `struct' or `interface'.
9218
9219         * cs-parser.jay: Added support for partial clases.
9220
9221 2004-07-23  Martin Baulig  <martin@ximian.com>
9222
9223         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9224         a `DeclSpace' and also made it readonly.
9225         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9226         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9227         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9228
9229         * cs-parser.jay: Pass the `current_class', not the
9230         `current_container' (at the moment, this is still the same thing)
9231         to a new Method, Property, Event, Indexer or Constructor.
9232
9233 2004-07-23  Martin Baulig  <martin@ximian.com>
9234
9235         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9236         and removed the `current_interface' one.
9237         (struct_declaration, class_declaration, interface_declaration):
9238         Set `current_class' to the newly created class/struct/interface;
9239         set their `Bases' and call Register() before parsing their body.
9240
9241 2004-07-23  Martin Baulig  <martin@ximian.com>
9242
9243         * class.cs (Kind): New public enum.
9244         (TypeContainer): Made this class abstract.
9245         (TypeContainer.Kind): New public readonly field.
9246         (TypeContainer.CheckDef): New public method; moved here from
9247         cs-parser.jay.
9248         (TypeContainer.Register): New public abstract method.
9249         (TypeContainer.GetPendingImplementations): New public abstract
9250         method.
9251         (TypeContainer.GetClassBases): Removed the `is_class' and
9252         `is_iface' parameters.
9253         (TypeContainer.DefineNestedTypes): Formerly known as
9254         DoDefineType().
9255         (ClassOrStruct): Made this class abstract.
9256
9257         * tree.cs (RootTypes): New public type. 
9258
9259 2004-07-20  Martin Baulig  <martin@ximian.com>
9260
9261         * tree.cs (Tree.RecordNamespace): Removed.
9262         (Tree.Namespaces): Removed.
9263
9264         * rootcontext.cs (RootContext.IsNamespace): Removed.
9265
9266         * cs-parser.jay (namespace_declaration): Just create a new
9267         NamespaceEntry here.
9268
9269 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
9270
9271         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9272         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9273         entry to make sure it runs in the correct runtime version.
9274         
9275 2004-07-18  Martin Baulig  <martin@ximian.com>
9276
9277         * generic.cs (ConstructedType.CheckConstraints): Improved
9278         constraints checking.
9279
9280 2004-07-18  Martin Baulig  <martin@ximian.com>
9281
9282         * expression.cs (Invocation.BetterMethod): Call
9283         TypeManager.TypeToCoreType() on all types and removed my previous
9284         hack; we're already doig the right thing here.
9285
9286 2004-07-17  Martin Baulig  <martin@ximian.com>
9287
9288         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9289
9290 2004-07-16  Martin Baulig  <martin@ximian.com>
9291
9292         * iterators.cs: Added generics support.
9293
9294 2004-07-16  Martin Baulig  <martin@ximian.com>
9295
9296         * iterators.cs: Rewrote this.  We're now using one single Proxy
9297         class for both the IEnumerable and the IEnumerator interface and
9298         `Iterator' derives from Class so we can use the high-level API.
9299
9300         * class.cs (TypeContainer.AddIterator): New method.
9301         (TypeContainer.DoDefineType): New protected virtual method, which
9302         is called from DefineType().
9303         (TypeContainer.DoDefineMembers): Call DefineType() and
9304         DefineMembers() on all our iterators.
9305         (TypeContainer.Emit): Call Emit() on all our iterators.
9306         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9307
9308         * codegen.cs (EmitContext.CurrentIterator): New public field.
9309
9310 2004-07-15  Martin Baulig  <martin@ximian.com>
9311
9312         * typemanager.cs
9313         (TypeManager.not_supported_exception_type): New type.   
9314
9315 2004-07-14  Martin Baulig  <martin@ximian.com>
9316
9317         * typemanager.cs
9318         (TypeManager.generic_ienumerable_type): New type.
9319         (TypeManager.generic_ienumerator_type): New type.
9320
9321         * rootcontext.cs
9322         (RootContext.interfaces_first_stage): Added
9323         "System.Collections.Generic.IEnumerator`1" and
9324         "System.Collections.Generic.IEnumerable`1".     
9325
9326 2004-07-14  Martin Baulig  <martin@ximian.com>
9327
9328         * iterators.cs: Use real error numbers.
9329
9330 2004-07-14  Martin Baulig  <martin@ximian.com>
9331
9332         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9333         requires this to be a System.Collection.IEnumerable and not a
9334         class implementing that interface.
9335         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9336
9337 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9338
9339         * class.cs: Fixed previous fix, it broke some error tests.
9340
9341 2004-07-12  Martin Baulig  <martin@ximian.com>
9342
9343         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9344         Fixes #61293.
9345
9346 2004-07-14  Martin Baulig  <martin@ximian.com>
9347
9348         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9349         an exclamation mark (!) for the generic arity to reflect the
9350         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9351
9352 2004-07-13  Martin Baulig  <martin@ximian.com>
9353
9354         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9355         specifiers being part of a type argument.
9356
9357 2004-07-13  Martin Baulig  <martin@ximian.com>
9358
9359         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9360         name for generic types.
9361
9362 2004-07-13  Martin Baulig  <martin@ximian.com>
9363
9364         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9365         bit to fix #60119.
9366
9367 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9368
9369         * assign.cs (LocalTemporary): Add new argument: is_address,If
9370         `is_address' is true, then the value that we store is the address
9371         to the real value, and not the value itself.
9372         
9373         * ecore.cs (PropertyExpr): use the new local temporary
9374         stuff to allow us to handle X.Y += z (where X is a struct)
9375
9376 2004-07-08  Martin Baulig  <martin@ximian.com>
9377
9378         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9379         not always return, just like we're doing in Using.Resolve().
9380
9381 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9382
9383         * cs-parser.jay (fixed_statement): flag this as Pinned.
9384
9385 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9386
9387         * typemanager.cs (TypeManager): Removed MakePinned method, this
9388         mechanism is replaced with the .NET 2.x compatible mechanism of
9389         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9390
9391         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9392         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9393         `IsFixed' property which has a different meaning.
9394
9395 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9396
9397         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9398         visible from inside a nested class, not just the names of the
9399         immediately enclosing class.
9400         Fix for bug #60730.
9401
9402 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9403
9404         * expression.cs (BetterConversion): Remove buggy special-case
9405         handling of "implicit constant expression conversions".  At this
9406         point, we already know that the conversion is possible -- we're
9407         only checking to see which is better.
9408
9409 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9410
9411         * cs-parser.jay: Added error CS0210 test.
9412
9413 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9414
9415         * cs-parser.jay: Added error CS0134 test.
9416
9417 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9418
9419         Fix bug #52507
9420         * cs-parser.jay: Added error CS0145 test.
9421
9422 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9423
9424         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9425
9426 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9427         
9428         * expression.cs (StackAlloc.Resolve): The argument may not
9429         be a constant; deal with this case.
9430         
9431 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9432
9433         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9434         GetIndexerAttributeValue.
9435         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9436
9437         * class.cs (Indexer.Define): Added error tests for CS0415,
9438         CS0609.
9439
9440 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9441
9442         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9443         property code.
9444
9445 2004-06-23  Martin Baulig  <martin@ximian.com>
9446
9447         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9448         neither return nor throw, reset the barrier as well.  Fixes #60457.
9449
9450 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9451
9452         * class.cs : EventAttributes is now set to None by default.
9453           This fixes bug #60459.
9454
9455 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9456
9457         Fix bug #60219
9458         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9459         Don't throw exception but return null (it's sufficient now).
9460
9461 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9462
9463         * typemanager.cs (GetArgumentTypes): Faster implementation.
9464
9465 2004-06-18  Martin Baulig  <martin@ximian.com>
9466
9467         * attribute.cs (Attribute.Resolve): Check whether we're an
9468         EmptyCast which a Constant child.  Fixes #60333.
9469
9470 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9471
9472         * statement.cs (EmitCollectionForeach): Account for the fact that
9473         not all valuetypes are in areas which we can take the address of.
9474         For these variables, we store to a temporary variable. Also, make
9475         sure that we dont emit a `callvirt' on a valuetype method.
9476
9477 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9478
9479         * expression.cs (StackAlloc.DoReSolve): Added test for
9480         negative parameter (CS0247).
9481
9482 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9483
9484         Fix bug #59792
9485         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9486
9487 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9488
9489         Fix bug #59781
9490         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9491         ulong.
9492
9493 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9494
9495         Fix bug #58254 & cs1555.cs, cs1556.cs
9496         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9497
9498 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9499
9500         * cs-parser.jay: Added error CS1669 test for indexers.
9501
9502 2004-06-18  Martin Baulig  <martin@ximian.com>
9503
9504         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9505         argument.  Fixes #60441.
9506
9507 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9508         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9509         The name needs to have the actual name of the method in order
9510         for other tests (such as the one in OverloadResolve for Invoke
9511         on a delegate) to work. As well, it does not really help
9512         error reporting because the method group had multiple methods.
9513         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9514         Make profiling work.
9515         
9516 2004-06-13  Martin Baulig  <martin@ximian.com>
9517
9518         * cs-parser.jay: Don't allow generic attributes.
9519
9520 2004-06-13  Martin Baulig  <martin@ximian.com>
9521
9522         * class.cs (MemberBase.DoDefineBase): New protected method.
9523         (MemberBase.DoDefine): Compute the `flags' in the new
9524         DoDefineBase() which must be called first.
9525         (Method.Define): Call DoDefineBase() first so we have the flags
9526         when defining the generic method.
9527
9528         * cs-parser.jay (interface_method_declaration): Support generic methods.
9529
9530 2004-06-13  Martin Baulig  <martin@ximian.com>
9531
9532         * decl.cs (TypeName): Removed.
9533         (MemberName): Removed TypeName and MemberNow; now we just have
9534         MemberName.
9535
9536         * cs-parser.jay: Don't distinguish between type arguments and type
9537         parameters in the grammar and simplified the rules a bit.  The
9538         reduce/reduce conflicts are now gone (except the one we inherited
9539         from mcs).
9540
9541 2004-06-11  Martin Baulig  <martin@ximian.com>
9542
9543         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9544         call this twice: for params and varargs methods.
9545
9546 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9547
9548         * class.cs:
9549         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9550
9551 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9552
9553         * attribute.cs (Attribute.GetValidTargets): Made public.
9554
9555         * class.cs: 
9556         (AbstractPropertyEventMethod): New class for better code sharing.
9557         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9558         CS1667 report.
9559         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9560
9561 2004-06-09  Martin Baulig  <martin@ximian.com>
9562
9563         * cs-parser.jay: Removed a reduce/reduce conflict.
9564
9565 2004-06-03  Martin Baulig  <martin@ximian.com>
9566
9567         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9568         GetSimpleName() and return a SimpleName.
9569
9570         * ecore.cs (SimpleName.Arguments): New public field.
9571         (SimpleName): Added overloaded ctor which takes an additional
9572         TypeArguments argument.
9573         (SimpleName.SimpleNameResolve): Added support for generic methods.
9574         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9575         formerly in MemberAccess.DoResolve(), but we also need it in
9576         SimpleNameResolve().
9577
9578         * expression.cs (MemberAccess.DoResolve): Use the new
9579         MethodGroupExpr.ResolveGeneric().       
9580
9581 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9582
9583         * decl.cs: If possible, use lookuptypedirect here. We can only do
9584         this if there is no `.' after the namespace. Avoids using
9585         LookupType, which does lots of slow processing.
9586         (FindNestedType) New method, does what it says :-).
9587         * namespace.cs: use LookupTypeDirect.
9588         * rootcontext.cs: use membercache, if possible.
9589         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9590
9591 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9592
9593         * expression.cs:
9594         According to the spec, 
9595
9596         In a member access of the form E.I, if E is a single identifier,
9597         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9598         field, property, localvariable, or parameter with the same type as
9599         the meaning of E as a type-name (§3.8), then both possible
9600         meanings of E are permitted.
9601
9602         We did not check that E as a simple-name had the same type as E as
9603         a type name.
9604
9605         This trivial check gives us 5-7% on bootstrap time.
9606
9607 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9608
9609         * expression.cs (Invocation.OverloadResolve): Avoid the
9610         use of hashtables and boxing here by allocating on demand.
9611
9612 2004-05-30  Martin Baulig  <martin@ximian.com>
9613
9614         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9615         we're doing a silent lookup.  Don't try to lookup nested types in
9616         TypeManager.object_type (thanks to Ben Maurer).
9617
9618 2004-05-30  Martin Baulig  <martin@ximian.com>
9619
9620         Committing a patch from Ben Maurer.
9621
9622         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9623
9624 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9625
9626         * convert.cs: add a trivial cache for overload operator resolution.
9627
9628 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9629
9630         * attribute.cs
9631         (AttributeTester.GetObsoleteAttribute): Returns instance of
9632         ObsoleteAttribute when type is obsolete.
9633
9634         * class.cs
9635         (TypeContainer.VerifyObsoleteAttribute): Override.
9636         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9637         (MethodCode.VerifyObsoleteAttribute): Override.
9638         (MemberBase.VerifyObsoleteAttribute): Override.
9639
9640         * decl.cs
9641         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9642         and report proper error.
9643
9644         *delegate.cs
9645         (Delegate.VerifyObsoleteAttribute): Override.
9646
9647         * ecore.cs
9648         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9649         and report proper error.
9650         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9651
9652         * enum.cs
9653         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9654         and enum member.
9655
9656         * expression.cs
9657         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9658         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9659         Added test for ObsoleteAttribute.
9660
9661         * statement.cs
9662         (Catch): Derived from Statement.
9663
9664 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9665
9666         * decl.cs: If possible, use lookuptypedirect here. We can only do
9667         this if there is no `.' after the namespace. Avoids using
9668         LookupType, which does lots of slow processing.
9669         (FindNestedType) New method, does what it says :-).
9670         * namespace.cs: use LookupTypeDirect.
9671         * rootcontext.cs: use membercache, if possible.
9672         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9673
9674 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9675
9676         * expression.cs:
9677         According to the spec, 
9678
9679         In a member access of the form E.I, if E is a single identifier,
9680         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9681         field, property, localvariable, or parameter with the same type as
9682         the meaning of E as a type-name (§3.8), then both possible
9683         meanings of E are permitted.
9684
9685         We did not check that E as a simple-name had the same type as E as
9686         a type name.
9687
9688         This trivial check gives us 5-7% on bootstrap time.
9689
9690 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9691
9692         Fixed bug #59071 & cs0160.cs
9693         * statement.cs (Try.Resolve): Check here whether order of catch
9694         clauses matches their dependencies.
9695
9696 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9697
9698         Fixed bug #58624
9699         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9700         unsafe type.
9701
9702 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9703
9704         * expression.cs (Invocation.OverloadResolve): Avoid the
9705         use of hashtables and boxing here by allocating on demand.
9706
9707 2004-05-30  Martin Baulig  <martin@ximian.com>
9708
9709         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9710         we're doing a silent lookup.  Don't try to lookup nested types in
9711         TypeManager.object_type (thanks to Ben Maurer).
9712
9713 2004-05-30  Martin Baulig  <martin@ximian.com>
9714
9715         Committing a patch from Ben Maurer.
9716
9717         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9718
9719 2004-05-29  Martin Baulig  <martin@ximian.com>
9720
9721         * class.cs (IMethodData.ShouldIgnore): New method.
9722
9723         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9724         `Location' argument, we don't need it anywhere.  Use
9725         `IMethodData.ShouldIgnore ()' instead of
9726         `MethodData.GetMethodFlags ()'.
9727         (TypeManager.AddMethod): Removed.
9728         (TypeManager.AddMethod2): Renamed to AddMethod.
9729
9730 2004-05-29  Martin Baulig  <martin@ximian.com>
9731
9732         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9733
9734         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9735         converting from a class type S to an interface type and we already
9736         have an object on the stack, don't box it again.  Fixes #52578.
9737
9738 2004-05-29  Martin Baulig  <martin@ximian.com>
9739
9740         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9741         Added support for `params' parameters.  Fixes #59267.
9742
9743 2004-05-29  Martin Baulig  <martin@ximian.com>
9744
9745         * literal.cs (NullPointer): Provide a private .ctor which sets
9746         `type' to TypeManager.object_type.  Fixes #59048.
9747
9748 2004-05-29  Martin Baulig  <martin@ximian.com>
9749
9750         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9751         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9752
9753         * ecore.cs (EventExpr.instance_expr): Make the field private.
9754
9755 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9756
9757         Fixed bug #50080 & cs0214-2.cs
9758         * expression.cs (Cast.DoResolve): Check unsafe context here.
9759         
9760         * statement.cs (Resolve.DoResolve): Likewise.
9761
9762 2004-05-26  Martin Baulig  <martin@ximian.com>
9763
9764         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9765
9766         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9767         (RootContext.LookupType): Pass down the `silent' flag.
9768
9769 2004-05-25  Martin Baulig  <martin@ximian.com>
9770
9771         * expression.cs
9772         (MethodGroupExpr.IdenticalTypeName): New public property.
9773         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9774         expression actually refers to a type.
9775
9776 2004-05-25  Martin Baulig  <martin@ximian.com>
9777
9778         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9779         for #56176 and made it actually work.
9780
9781 2004-05-25  Martin Baulig  <martin@ximian.com>
9782
9783         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9784         (FieldExpr, PropertyExpr): Override and implement
9785         CacheTemporaries.  Fixes #52279.
9786
9787 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9788
9789         * location.cs: In the new compiler listing a file twice is a
9790         warning, not an error.
9791
9792 2004-05-24  Martin Baulig  <martin@ximian.com>
9793
9794         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9795         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9796
9797 2004-05-24  Martin Baulig  <martin@ximian.com>
9798
9799         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9800         walking the `using' list.  Fixes #53921.
9801
9802 2004-05-24  Martin Baulig  <martin@ximian.com>
9803
9804         * const.cs (Const.LookupConstantValue): Added support for
9805         EmptyCast's; fixes #55251.
9806
9807 2004-05-24  Martin Baulig  <martin@ximian.com>
9808
9809         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9810         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9811         which does the CS0135 check.  The reason is that we first need to
9812         check whether the variable actually exists.
9813
9814 2004-05-24  Martin Baulig  <martin@ximian.com>
9815
9816         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9817         than RootContext.LookupType() to find the explicit interface
9818         type.  Fixes #58584.
9819
9820 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9821
9822         * Makefile: Simplify.  Use executable.make.
9823         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9824
9825 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9826
9827         * decl.cs:
9828         * enum.cs:
9829         Use the invariant culture when doing String.Compare for CLS case
9830         sensitivity.
9831         
9832 2004-05-23  Martin Baulig  <martin@ximian.com>
9833
9834         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9835         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9836
9837         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9838
9839 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9840
9841         * class.cs (MemberBase.Define): Reuse MemberType member for 
9842         resolved type. Other methods can use it too.
9843
9844 2004-05-23  Martin Baulig  <martin@ximian.com>
9845
9846         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9847         the variable also exists in the current block (otherwise, we need
9848         to report a CS0103).  Fixes #58670.
9849
9850 2004-05-23  Martin Baulig  <martin@ximian.com>
9851
9852         * flowanalysis.cs (Reachability.Reachable): Compute this
9853         on-the-fly rather than storing it as a field.
9854
9855 2004-05-23  Martin Baulig  <martin@ximian.com>
9856
9857         * flowanalysis.cs (Reachability.And): Manually compute the
9858         resulting `barrier' from the reachability.      
9859        
9860 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9861
9862         Fix bug #57835
9863         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9864         instance of ObsoleteAttribute when symbol is obsolete.
9865
9866         * class.cs
9867         (IMethodData): Extended interface for ObsoleteAttribute support.
9868
9869 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9870
9871         * attribute.cs: Fix bug #55970
9872
9873 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9874
9875         Fix bug #52705
9876         * attribute.cs
9877         (GetObsoleteAttribute): New method. Creates the instance of
9878         ObsoleteAttribute.
9879         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9880         ObsoleteAttribute when member is obsolete.
9881         (AttributeTester.Report_ObsoleteMessage): Common method for
9882         Obsolete error/warning reporting.
9883
9884         * class.cs
9885         (TypeContainer.base_classs_type): New member for storing parent type.
9886
9887         * decl.cs
9888         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9889         for this MemberCore.
9890
9891 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9892
9893         * attribute.cs, const.cs: Fix bug #58590
9894
9895 2004-05-21  Martin Baulig  <martin@ximian.com>
9896
9897         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9898         out parameters if the end of the method is unreachable.  Fixes
9899         #58098. 
9900
9901 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9902
9903         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9904         Hari was right, why extra method.
9905
9906 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9907
9908         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9909
9910 2004-05-20  Martin Baulig  <martin@ximian.com>
9911
9912         * delegate.cs: Convert this file to Unix mode - like the original
9913         version in mcs is.
9914
9915 2004-05-20  Martin Baulig  <martin@ximian.com>
9916
9917         * attribute.cs: Convert this file to Unix mode - like the original
9918         version in mcs is.
9919
9920 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9921
9922        Fix bug #58688 (MCS does not report error when the same attribute
9923        is assigned twice)
9924
9925        * attribute.cs (Attribute.Emit): Distinction between null and default.
9926
9927 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9928
9929        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9930        of a top-level attribute without an attribute target.
9931        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9932        Make non-static.
9933        (Attribute.Conditional_GetConditionName), 
9934        (Attribute.Obsolete_GetObsoleteMessage): Update.
9935        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9936        part of ScanForIndexerName.
9937        (Attribute.CanIgnoreInvalidAttribute): New function.
9938        (Attribute.ScanForIndexerName): Move to ...
9939        (Attributes.ScanForIndexerName): ... here.
9940        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9941        (Attributes.Search): New internal variant that can choose not to
9942        complain if types aren't resolved.  The original signature now
9943        complains.
9944        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9945        complaints suppressed.
9946        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9947        only if it not useful.
9948        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9949        top-level for attributes that are shared between the assembly
9950        and a top-level class.
9951        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9952        * class.cs: Update to reflect changes.
9953        (DefineIndexers): Fuse loops.
9954        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9955        a couple more variants of attribute names.
9956
9957 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9958
9959         Fix bug #52585 (Implemented explicit attribute declaration)
9960
9961         * attribute.cs:
9962         (Attributable.ValidAttributeTargets): New abstract method. It gets
9963         list of valid attribute targets for explicit target declaration.
9964         (Attribute.Target): It holds target itself.
9965         (AttributeSection): Removed.
9966         (Attribute.CheckTargets): New method. It checks whether attribute
9967         target is valid for the current element.
9968
9969         * class.cs:
9970         (EventProperty): New class. For events that are declared like
9971         property (with add and remove accessors).
9972         (EventField): New class. For events that are declared like field.
9973         class.cs
9974
9975         * cs-parser.jay: Implemented explicit attribute target declaration.
9976
9977         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9978         Override ValidAttributeTargets.
9979
9980         * parameter.cs:
9981         (ReturnParameter): Class for applying custom attributes on 
9982         the return type.
9983         (ParameterAtribute): New class. Class for applying custom
9984         attributes on the parameter type.
9985
9986 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9987
9988         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9989         definitions. 
9990
9991         (Method): Allow UNSAFE here.
9992
9993         * modifiers.cs: Support unsafe reporting.
9994
9995 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9996
9997         * decl.cs: Fix bug #58478.
9998
9999 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10000
10001         * statement.cs: When checking for unreachable code on an EmptyStatement,
10002         set the location. Fixes bug #58488.
10003
10004 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10005
10006         * driver.cs: Add -pkg handling.
10007
10008         From Gonzalo: UseShelLExecute=false
10009
10010 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10011
10012         * attribute.cs:
10013         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10014         for attribute.
10015         (Attribute.IsClsCompliaceRequired): Moved to base for better
10016         accesibility.
10017         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10018         when attribute is AttributeUsageAttribute.
10019         (Attribute.GetValidTargets): Simplified.
10020         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10021         attribute for this type.
10022         (Attribute.ApplyAttributes): Method renamed to Emit and make
10023         non-static.
10024         (GlobalAttributeSection): New class for special handling of global
10025         attributes (assembly, module).
10026         (AttributeSection.Emit): New method.
10027
10028         * class.cs: Implemented Attributable abstract methods.
10029         (MethodCore.LabelParameters): Moved to Parameter class.
10030         (Accessor): Is back simple class.
10031         (PropertyMethod): Implemented Attributable abstract class.
10032         (DelegateMethod): Implemented Attributable abstract class.
10033         (Event): New constructor for disctintion between normal Event
10034         and Event with accessors.
10035
10036         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10037
10038         * codegen.cs, const.cs, decl.cs, delegate.cs:
10039         (CommonAssemblyModulClass): Implemented Attributable abstract class
10040         and simplified.
10041
10042         * enum.cs: Implement IAttributeSupport interface.
10043         (EnumMember): New class for emum members. Implemented Attributable
10044         abstract class
10045
10046         * parameter.cs:
10047         (ParameterBase): Is abstract.
10048         (ReturnParameter): New class for easier [return:] attribute handling.
10049
10050         * typemanager.cs: Removed builder_to_attr.
10051
10052 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10053
10054         Fix bug #57151.
10055         * attribute.cs (Attribute.GetPositionalValue): New function.
10056         * class.cs (TypeContainer.VerifyMembers): New function.
10057         (TypeContainer.Emit): Use it.
10058         (ClassOrStruct): New base class for Class and Struct.
10059         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10060         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10061         class.
10062         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10063         then each non-static field should have a FieldOffset attribute.
10064         Otherwise, none of the fields should have a FieldOffset attribute.
10065         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10066         and FieldOffset attributes.
10067         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10068         (TypeManager.field_offset_attribute_type): New core types.
10069         (TypeManager.InitCoreTypes): Initialize them.
10070
10071 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10072
10073         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10074         Return correct type.
10075         From bug #58270.
10076
10077 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10078
10079         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10080         be implicitly converted to ulong.
10081         
10082         * expression.cs: The logic for allowing operator &, | and ^ worked
10083         was wrong, it worked before because we did not report an error in
10084         an else branch.  Fixes 57895.
10085
10086         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10087         allow volatile fields to be reference types.
10088
10089 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10090
10091         * driver.cs: Add support for /debug-
10092
10093 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10094
10095         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10096         Add a 'complain' parameter to silence errors.
10097         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10098         silently overlooked type-resolutions.
10099         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10100         to reflect changes.
10101         (Attributes.Search): New function.
10102         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10103         (Attributes.GetAttributeFullName): Remove hack.
10104         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10105         Update to reflect changes.
10106         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10107         Use Attributes.Search instead of nested loops.
10108
10109 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10110
10111         * decl.cs:
10112         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10113         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10114         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10115
10116         * report.cs: (Report.Warning): Renamed to Warning_T because of
10117         parameter collision.
10118
10119 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10120
10121         * expression.cs (MemberAccess.ResolveMemberAccess):
10122         Exit with non-zero status after Report.Error.
10123         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10124         Likewise.
10125         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10126
10127 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10128
10129         * support.cs: Don't hang when the file is empty.
10130
10131 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10132
10133         * support.cs: In SeekableStreamReader, compute the preamble size of the
10134           underlying stream. Position changes should take into account that initial
10135           count of bytes.
10136
10137 2004-05-03  Todd Berman  <tberman@sevenl.net>
10138
10139         * driver.cs: remove unused GetSysVersion function.
10140
10141 2004-05-03  Todd Berman  <tberman@sevenl.net>
10142
10143         * driver.cs: Remove the hack from saturday, as well as the hack
10144         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10145         link_paths to get that bit proper.
10146
10147 2004-05-01  Todd Berman  <tberman@sevenl.net>
10148
10149         * driver.cs: Try a LoadFrom before a Load, this checks the current
10150         path. This is currently a bug in mono that is be fixed, however, this
10151         provides a workaround for now. This will be removed when the bug
10152         is fixed.
10153
10154 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10155
10156         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10157         incomplete key pairs (#57941).
10158
10159 2004-05-01  Todd Berman  <tberman@sevenl.net>
10160
10161         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10162         from the GAC
10163
10164 2004-04-30  Jackson Harper  <jackson@ximian.com>
10165
10166         * codegen.cs: Open keys readonly.
10167         
10168 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10169
10170         * typemanager.cs: don't report cyclic struct layout when a struct
10171         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10172         which has 2 Pango.Rectangle fields.
10173
10174 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10175
10176         * expression.cs: Handle IntPtr comparisons with IL code
10177         rather than a method call.
10178
10179 2004-04-29  Martin Baulig  <martin@ximian.com>
10180
10181         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10182         the list of PropertyInfo's in class hierarchy and find the
10183         accessor.  Fixes #56013.
10184
10185 2004-04-29  Martin Baulig  <martin@ximian.com>
10186
10187         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10188
10189 2004-04-29  Martin Baulig  <martin@ximian.com>
10190
10191         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10192
10193         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10194
10195 2004-04-29  Martin Baulig  <martin@ximian.com>
10196
10197         * class.cs (ConstructorInitializer.Resolve): Check whether the
10198         parent .ctor is accessible.  Fixes #52146.
10199
10200 2004-04-29  Martin Baulig  <martin@ximian.com>
10201
10202         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10203
10204         * statement.cs (Using.EmitLocalVariableDecls): Use
10205         TypeManager.idisposable_type, not typeof (IDisposable).
10206         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10207
10208 2004-04-29  Martin Baulig  <martin@ximian.com>
10209
10210         * class.cs (Event.Define): Don't emit the field and don't set
10211         RTSpecialName and SpecialName for events on interfaces.  Fixes
10212         #57703. 
10213
10214 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10215
10216         Refactor Attribute.ApplyAttributes.
10217         * attribute.cs (Attributable): New base class for objects that can
10218         have Attributes applied on them.
10219         (Attribute): Make AttributeUsage fields public.
10220         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10221         (Attribute.IsInternalCall): New property.
10222         (Attribute.UsageAttr): Convert to a public read-only property.
10223         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10224         (Attribute.ResolveType, Attribute.Resolve)
10225         (Attribute.ScanForIndexerName): Update to reflect changes.
10226         (Attribute.CheckAttributeTarget): Re-format.
10227         (Attribute.ApplyAttributes): Refactor, to various
10228         Attributable.ApplyAttributeBuilder methods.
10229         * decl.cs (MemberCore): Make Attributable.
10230         * class.cs (Accessor): Make Attributable.
10231         (MethodData.ApplyAttributes): Use proper attribute types, not
10232         attribute names.
10233         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10234         (TypeContainer.ApplyAttributeBuilder)
10235         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10236         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10237         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10238         (Operator.ApplyAttributeBuilder): New factored-out methods.
10239         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10240         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10241         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10242         * parameter.cs (ParameterBase): New Attributable base class
10243         that can also represent Return types.
10244         (Parameter): Update to the changes.
10245
10246 2004-04-29  Jackson Harper  <jackson@ximian.com>
10247
10248         * driver.cs: Prefer the corlib system version when looking for
10249         assemblies in the GAC. This is still a hack, but its a better hack
10250         now.
10251         
10252 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10253
10254         * decl.cs, enum.cs: Improved error 3005 reporting.
10255   
10256         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10257         (related_symbols): New private member for list of symbols
10258         related to reported error/warning.
10259         
10260         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10261
10262 2004-04-29  Martin Baulig  <martin@ximian.com>
10263
10264         * ecore.cs (Expression.Constantify): If we're an enum and
10265         TypeManager.TypeToCoreType() doesn't give us another type, use
10266         t.UnderlyingSystemType.  Fixes #56178.  
10267
10268 2004-04-29  Martin Baulig  <martin@ximian.com>
10269
10270         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10271         interfaces and for each interface, only add members directly
10272         declared in that interface.  Fixes #53255.
10273
10274 2004-04-28  Martin Baulig  <martin@ximian.com>
10275
10276         * expression.cs (ConditionalLogicalOperator): Use a temporary
10277         variable for `left' to avoid that we evaluate it more than once;
10278         bug #52588.
10279
10280 2004-04-28  Martin Baulig  <martin@ximian.com>
10281
10282         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10283         `void[]' (CS1547).
10284
10285 2004-04-28  Martin Baulig  <martin@ximian.com>
10286
10287         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10288         void (CS1547).
10289
10290         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10291         whether the type is not void (CS1547).
10292
10293 2004-04-28  Martin Baulig  <martin@ximian.com>
10294
10295         * expression.cs (Unary.DoResolveLValue): Override this and report
10296         CS0131 for anything but Operator.Indirection.
10297
10298 2004-04-28  Martin Baulig  <martin@ximian.com>
10299
10300         Committing a patch from Ben Maurer; see bug #50820.
10301
10302         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10303         check for classes.
10304
10305         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10306         classes.        
10307
10308 2004-04-28  Martin Baulig  <martin@ximian.com>
10309
10310         Committing a patch from Ben Maurer; see bug #50820.
10311
10312         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10313         check for classes.
10314
10315         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10316         classes.        
10317
10318 2004-04-28  Martin Baulig  <martin@ximian.com>
10319
10320         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10321         (Block.AddLabel): Call DoLookupLabel() to only search in the
10322         current block.
10323
10324 2004-04-28  Martin Baulig  <martin@ximian.com>
10325
10326         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10327         comparing StringConstants and NullLiterals in Equality and Inequality.
10328
10329 2004-04-28  Jackson Harper  <jackson@ximian.com>
10330
10331         * driver.cs: Attempt to load referenced assemblies from the
10332         GAC. This is the quick and dirty version of this method that
10333         doesnt take into account versions and just takes the first
10334         canidate found. Will be good enough for now as we will not have more
10335         then one version installed into the GAC until I update this method.
10336
10337 2004-04-28  Martin Baulig  <martin@ximian.com>
10338
10339         * typemanager.cs (TypeManager.CheckStructCycles): New public
10340         static method to check for cycles in the struct layout.
10341
10342         * rootcontext.cs (RootContext.PopulateTypes): Call
10343         TypeManager.CheckStructCycles() for each TypeContainer.
10344         [Note: We only need to visit each type once.]
10345
10346 2004-04-28  Martin Baulig  <martin@ximian.com>
10347
10348         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10349
10350         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10351         success and added `out object value'.  Use a `bool resolved' field
10352         to check whether we've already been called rather than
10353         `ConstantValue != null' since this breaks for NullLiterals.
10354
10355 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10356
10357         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10358         setting of this flag, since the 'set' method may be non-public.
10359
10360 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10361
10362         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10363         check on current_vector.Block.
10364
10365 2004-04-27  Martin Baulig  <martin@ximian.com>
10366
10367         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10368         a field initializer.  Fixes #56459.
10369
10370 2004-04-27  Martin Baulig  <martin@ximian.com>
10371
10372         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10373         we're not attempting to use an indexer.  Fixes #52154.
10374
10375 2004-04-27  Martin Baulig  <martin@ximian.com>
10376
10377         * statement.cs (Return): Don't create a return label if we don't
10378         need it; reverts my change from January 20th.  Thanks to Ben
10379         Maurer for this.
10380
10381 2004-04-27  Martin Baulig  <martin@ximian.com>
10382
10383         According to the spec, `goto' can only leave a nested scope, but
10384         never enter it.
10385
10386         * statement.cs (Block.LookupLabel): Only lookup in the current
10387         block, don't recurse into parent or child blocks.
10388         (Block.AddLabel): Check in parent and child blocks, report
10389         CS0140/CS0158 if we find a duplicate.
10390         (Block): Removed this indexer for label lookups.
10391         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10392         this already does the error reporting for us.
10393
10394         * flowanalysis.cs
10395         (FlowBranching.UsageVector.Block): New public variable; may be null.
10396         (FlowBranching.CreateSibling): Added `Block' argument.
10397         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10398         label for the target of a `goto' and check whether we're not
10399         leaving a `finally'.
10400
10401 2004-04-27  Martin Baulig  <martin@ximian.com>
10402
10403         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10404         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10405         just for returns).
10406
10407 2004-04-27  Martin Baulig  <martin@ximian.com>
10408
10409         * statement.cs (Block.AddLabel): Also check for implicit blocks
10410         and added a CS0158 check.
10411
10412 2004-04-27  Martin Baulig  <martin@ximian.com>
10413
10414         * flowanalysis.cs (FlowBranchingLoop): New class.
10415         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10416         UsageVector's instead of an ArrayList.
10417         (FlowBranching.Label): Likewise.
10418         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10419         (FlowBranching.AddBreakVector): New method.
10420
10421 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10422
10423         * attribute.cs: Small regression fix: only convert the type if we
10424         the type is different, fixes System.Drawing build.
10425
10426 2004-04-27  Martin Baulig  <martin@ximian.com>
10427
10428         * attribute.cs (Attribute.Resolve): If we have a constant value
10429         for a named field or property, implicity convert it to the correct
10430         type.
10431
10432 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10433
10434         * statement.cs (Block.Block): Implicit blocks share
10435         'child_variable_names' fields with parent blocks.
10436         (Block.AddChildVariableNames): Remove.
10437         (Block.AddVariable): Mark variable as "used by a child block" in
10438         every surrounding block.
10439         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10440         been used in a child block, complain about violation of "Invariant
10441         meaning in blocks" rule.
10442         * cs-parser.jay (declare_local_variables): Don't use
10443         AddChildVariableNames.
10444         (foreach_statement): Don't create an implicit block: 'foreach'
10445         introduces a scope.
10446
10447 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10448
10449         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10450         converting from 0L to ulong.  Fixes 57522.
10451
10452 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10453
10454         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10455         derived class hides via 'new' keyword field from base class (test-242.cs).
10456         TODO: Handle this in the more general way.
10457         
10458         * class.cs (CheckBase): Ditto.
10459
10460 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10461
10462         * decl.cs (caching_flags): New member for storing cached values
10463         as bit flags.
10464         (MemberCore.Flags): New enum where bit flags for caching_flags
10465         are defined.
10466         (MemberCore.cls_compliance): Moved to caching_flags.
10467         (DeclSpace.Created): Moved to caching_flags.
10468
10469         * class.cs: Use caching_flags instead of DeclSpace.Created
10470         
10471 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10472
10473         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10474         if we are only a derived class, not a nested class.
10475
10476         * typemanager.cs: Same as above, but do this at the MemberLookup
10477         level (used by field and methods, properties are handled in
10478         PropertyExpr).   Allow for the qualified access if we are a nested
10479         method. 
10480
10481 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10482
10483         * class.cs: Refactoring.
10484         (IMethodData): New inteface; Holds links to parent members
10485         to avoid member duplication (reduced memory allocation).
10486         (Method): Implemented IMethodData interface.
10487         (PropertyBase): New inner classes for get/set methods.
10488         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10489         (Event): New inner classes for add/remove methods.
10490         (Event.DelegateMethod): Implemented IMethodData interface.
10491
10492         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10493         EmitContext (related to class.cs refactoring).
10494
10495 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10496
10497         * delegate.cs (Delegate.VerifyApplicability): If the number of
10498         arguments are the same as the number of parameters, first try to
10499         verify applicability ignoring  any 'params' modifier on the last
10500         parameter.
10501         Fixes #56442.
10502
10503 2004-04-08  Martin Baulig  <martin@ximian.com>
10504
10505         Merged latest changes into gmcs.  Please keep this comment in
10506         here, it makes it easier for me to see what changed in MCS since
10507         the last time I merged.
10508
10509 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10510
10511         * class.cs (TypeContainer.AddIndexer): Use
10512         'ExplicitInterfaceName' to determine if interface name was
10513         explicitly specified.  'InterfaceType' is not initialized at this time.
10514         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10515         Indexers array is already in the required order.  Initialize
10516         'IndexerName' only if there are normal indexers.
10517         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10518         (TypeContainer.Emit): Emit DefaultMember attribute only if
10519         IndexerName is initialized.
10520         Fixes #56300.
10521
10522 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10523
10524         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10525         Fixes #57007
10526
10527 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10528
10529         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10530         attributes.
10531         Fix for #56456.
10532
10533         * attribute.cs (Attribute.Resolve): Check for duplicate named
10534         attributes.
10535         Fix for #56463.
10536
10537 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10538
10539         * iterators.cs (MarkYield): track whether we are in an exception,
10540         and generate code accordingly.  Use a temporary value to store the
10541         result for our state.
10542
10543         I had ignored a bit the interaction of try/catch with iterators
10544         since their behavior was not entirely obvious, but now it is
10545         possible to verify that our behavior is the same as MS .NET 2.0
10546
10547         Fixes 54814
10548
10549 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10550
10551         * iterators.cs: Avoid creating temporaries if there is no work to
10552         do. 
10553
10554         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10555         Enumerations, use TypeManager.EnumToUnderlying and call
10556         recursively. 
10557
10558         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10559         bug #57013
10560
10561         (This.Emit): Use EmitContext.EmitThis to emit our
10562         instance variable.
10563
10564         (This.EmitAssign): Ditto.
10565
10566         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10567         codepaths, we will move all the functionality into
10568         Mono.CSharp.This 
10569
10570         (FieldExpr.EmitAssign): Ditto.
10571
10572         This fixes several hidden bugs that I uncovered while doing a code
10573         review of this today.
10574
10575         * codegen.cs (EmitThis): reworked so the semantics are more clear
10576         and also support value types "this" instances.
10577
10578         * iterators.cs: Changed so that for iterators in value types, we
10579         do not pass the value type as a parameter.  
10580
10581         Initialization of the enumerator helpers is now done in the caller
10582         instead of passing the parameters to the constructors and having
10583         the constructor set the fields.
10584
10585         The fields have now `assembly' visibility instead of private.
10586
10587 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10588
10589         * expression.cs (Argument.Resolve): Check if fields passed as ref
10590         or out are contained in a MarshalByRefObject.
10591
10592         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10593         another compiler type.
10594
10595 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10596
10597         * class.cs (Indexer.Define): use the new name checking method.
10598         Also, return false on an error.
10599         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10600         (is_identifier_[start/part]_character): make static.
10601
10602 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10603
10604         * expression.cs (Binary.ResolveOperator): Do no append strings
10605         twice: since we can be invoked more than once (array evaluation)
10606         on the same concatenation, take care of this here.  Based on a fix
10607         from Ben (bug #56454)
10608
10609 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10610
10611         * codegen.cs: Fix another case where CS1548 must be reported (when 
10612         delay-sign isn't specified and no private is available #56564). Fix
10613         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10614         error when MCS is used on the MS runtime and we need to delay-sign 
10615         (which seems unsupported by AssemblyBuilder - see #56621).
10616
10617 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10618
10619         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10620         (TypeManager.ComputeNamespaces): Faster implementation for
10621         Microsoft runtime.
10622
10623         * compiler.csproj: Updated AssemblyName to mcs.
10624
10625 2004-05-11  Jackson Harper  <jackson@ximian.com>
10626
10627         * Makefile: Preserve MONO_PATH
10628         
10629 2004-05-11  Jackson Harper  <jackson@ximian.com>
10630
10631         * Makefile: Use mono and mcs to build gmcs
10632         
10633 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10634
10635         * codegen.cs: Add patch from Robert Shade
10636         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10637         sync with mcs.
10638
10639 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10640
10641         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10642         incomplete key pairs (#57941).
10643
10644 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10645
10646         * codegen.cs: Fix another case where CS1548 must be reported (when 
10647         delay-sign isn't specified and no private is available #56564). Fix
10648         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10649         error when MCS is used on the MS runtime and we need to delay-sign 
10650         (which seems unsupported by AssemblyBuilder - see #56621).
10651
10652 2004-04-29  Jackson Harper  <jackson@ximian.com>
10653
10654         * Makefile: Set MONO_PATH to use the bootstrap corlib
10655         * driver.cs: Check the GAC for referenced assemblies.
10656                 
10657 2004-04-29  Martin Baulig  <martin@ximian.com>
10658
10659         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10660
10661 2004-04-07  Martin Baulig  <martin@ximian.com>
10662
10663         * expression.cs (Binary.ResolveOperator): Added special case for
10664         Equality/Inequality between a type parameter and a null literal.
10665
10666 2004-04-07  Martin Baulig  <martin@ximian.com>
10667
10668         * convert.cs: Check null literal -> type parameter conversions.
10669
10670 2004-04-07  Martin Baulig  <martin@ximian.com>
10671
10672         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10673         `class' and `struct' constraints.
10674
10675 2004-04-07  Martin Baulig  <martin@ximian.com>
10676
10677         * generic.cs (SpecialConstraint): New public enum.
10678         (Constraints.Resolve): Added support for the `class' and `struct'
10679         constraints.
10680
10681         * cs-parser.jay (type_parameter_constraint): Added support for the
10682         `class' and `struct' constraints.
10683
10684 2004-04-07  Martin Baulig  <martin@ximian.com>
10685
10686         * support.cs (GenericConstraints): Replaced `Types' by
10687         `ClassConstraint' and `InterfaceConstraints'; added
10688         `HasClassConstraint'.   
10689
10690 2004-04-07  Martin Baulig  <martin@ximian.com>
10691
10692         * generic.cs
10693         (Constraints.InterfaceConstraints): New public property.
10694         (Constraints.Types): Make this property public
10695         (TypeParameter): Implement IMemberContainer.
10696         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10697         instead of a TypeBuilder/MethodBuilder; pass the interface
10698         constraints to TypeManager.AddTypeParameter().
10699         (TypeParameter.DefineType): Just take an EmitContext and no
10700         TypeBuilder/MethodBuilder.  Use the new public API.
10701
10702         * typemanager.cs (TypeManager.AddTypeParameter): Added
10703         `TypeExpr[]' argument; add the interfaces to the
10704         `builder_to_ifaces' hash.
10705         (TypeManager.LookupMemberContainer): For
10706         GenericTypeParameterBuilders, get the TypeParameter from the
10707         `builder_to_type_param'.
10708         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10709         the TypeParameter and call FindMembers on it.
10710
10711 2004-04-07  Martin Baulig  <martin@ximian.com>
10712
10713         * class.cs
10714         (MethodCore.GenericMethod): Moved this field here from Method.
10715         (MethodCore.IsDuplicateImplementation): Take the number of type
10716         parameters into account if we're a generic method.
10717
10718         * expression.cs (Invocation.InferTypeArguments): Don't return true
10719         if `arguments' is null; we still need to check whether we actually
10720         don't need to infer anything in this case.
10721         (MemberAccess): Merged the functionality from GenericMemberAccess
10722         into this class.
10723
10724         * generic.cs (GenericMemberAccess): Removed.
10725
10726 2004-04-05  Martin Baulig  <martin@ximian.com>
10727
10728         * decl.cs (MemberCore): For generic classes, interfaces and
10729         structs, `Name' now includes the number of type parameters
10730         ("Stack!1.Node!1").
10731         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10732         encode the number of type arguments in the type name.
10733
10734         * expression.cs (Expression.MemberLookup): Removed the
10735         `num_type_args' argument; we now encode the number of type
10736         arguments in the type name.
10737
10738         * ecore.cs (SimpleName): Encode the number of type arguments in
10739         the type name itself.
10740
10741         * generic.cs (ConstructedType): Likewise.
10742
10743         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10744         `MemberName'; we now include the number of type parameters in the
10745         type name.
10746
10747         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10748         (TypeManager.MemberLookup): Removed the
10749         `num_type_args' argument; we now encode the number of type
10750         arguments in the type name.     
10751
10752 2004-04-03  Martin Baulig  <martin@ximian.com>
10753
10754         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10755         (MemberCore.MemberName): Moved here from MemberBase.
10756         (DeclSpace.SetParameterInfo): Just take the constraints as an
10757         ArrayList; we already have the type parameters in our
10758         `MemberName'; also do the CS0080 reporting here.
10759
10760         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10761         `IDENTIFIER opt_type_parameter_list'; when constructing our
10762         `MemberName', it'll already include our type parameters.
10763         (class_declaration, interface_declaration): Likewise.
10764         (delegate_declaration): Likewise.
10765         (MakeName): Take a MemberName and return a MemberName.
10766         The following two changes are required to avoid shift/reduce conflicts:
10767         (member_name): Don't include a TypeName anymore; ie. this is now
10768         just 'IDENTIFIER opt_type_parameter_list'.
10769         (property_declaration, event_declaration): Use a
10770         `namespace_or_type_name' instead of a `member_name'.            
10771
10772 2004-04-03  Martin Baulig  <martin@ximian.com>
10773
10774         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10775         `MemberName' class.
10776         (TypeName): Formerly known as MemberName.
10777
10778         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10779         instead of a `MemberName'.
10780
10781         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10782         (member_name): New rule; create a MemberName.
10783
10784 2004-04-02  Martin Baulig  <martin@ximian.com>
10785
10786         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10787         (CS0305 and CS0308).
10788
10789 2004-04-02  Martin Baulig  <martin@ximian.com>
10790
10791         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10792         support for nested types.
10793
10794 2004-04-02  Martin Baulig  <martin@ximian.com>
10795
10796         * ecore.cs (IAlias): New public interface.
10797         (TypeExpr, TypeExpression): Implement IAlias.
10798         (TypeAliasExpression): New public class.
10799
10800         * namespace.cs (Namespace): Implement IAlias.
10801         (Namespace.Lookup): Return an IAlias instead on an object.
10802         (Namespace.DefineName): Take an IAlias instead of an object.
10803         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10804         an object.
10805         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10806         Expression.
10807         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10808         object.
10809         (NamespaceEntry.Lookup): Likewise.
10810
10811         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10812         instead of a Type.      
10813
10814         * decl.cs (DeclSpace): Implement IAlias.
10815         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10816
10817         * generic.cs (ConstructedType): Improved error checking.
10818
10819 2004-04-02  Martin Baulig  <martin@ximian.com>
10820
10821         * convert.cs: Added type parameter conversions.
10822
10823         * ecore.cs
10824         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10825         (ClassCast.Emit): If the source type is a type parameter, box it.
10826         If the target type is a type parameter, emit an `unbox.any'
10827         instead of a `classcast'.1      
10828
10829 2004-04-01  Martin Baulig  <martin@ximian.com>
10830
10831         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10832
10833 2004-04-01  Martin Baulig  <martin@ximian.com>
10834
10835         * generic.cs (ConstructedType.CheckConstraints): Use
10836         Convert.ImplicitStandardConversionExists(); user-defined implicit
10837         conversions are not allowed according to the spec.
10838
10839 2004-03-30  Martin Baulig  <martin@ximian.com>
10840
10841         * expression.cs (New): Added support for type parameters.
10842
10843         * typemanager.cs
10844         (TypeManager.activator_type): New public static field.
10845         (TypeManager.activator_create_instance): Likewise.
10846
10847 2004-03-30  Martin Baulig  <martin@ximian.com>
10848
10849         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10850         public method.
10851
10852 2004-03-30  Martin Baulig  <martin@ximian.com>
10853
10854         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10855         the spec here: the argument type must be convertible to the
10856         constraints.
10857
10858 2004-03-30  Martin Baulig  <martin@ximian.com>
10859
10860         * generic.cs
10861         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10862         TypeManager.AddTypeParameter().
10863         (ConstructedType.CheckConstraints): Re-enable this and actually
10864         check whether we have a constructor constraint.
10865
10866         * typemanager.cs
10867         (TypeManager.builder_to_type_param): New static field.
10868         (TypeManager.AddTypeParameter): New static method.
10869         (TypeManager.LookupTypeParameter): New public method.
10870
10871 2004-03-30  Martin Baulig  <martin@ximian.com>
10872
10873         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10874         the new API to actually define the constructor constraint.
10875
10876         * typemanager.cs
10877         (TypeManager.new_constraint_attr_type): New static field.
10878         (TypeManager.InitCoreTypes): Initialize it.
10879
10880 2004-03-30  Martin Baulig  <martin@ximian.com>
10881
10882         * generic.cs (Constraints): Completed error checking, use correct
10883         error numbers.
10884
10885 2004-03-29  Martin Baulig  <martin@ximian.com>
10886
10887         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10888
10889         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10890         public version which takes a `ParameterData pd' instead of an
10891         `ArrayList args'.
10892
10893 2004-03-29  Martin Baulig  <martin@ximian.com>
10894
10895         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10896         not a MethodInfo.       
10897
10898 2004-03-29  Martin Baulig  <martin@ximian.com>
10899
10900         * expression.cs (Argument.ResolveMethodGroup): If we're a
10901         ConstructedType, call GetMemberAccess() on it.  
10902
10903 2004-03-29  Martin Baulig  <martin@ximian.com>
10904
10905         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10906         (MethodCore.CheckGenericOverride): When overriding a generic
10907         method, check whether the constraints match.
10908
10909         * support.cs (GenericConstraints): New public interface.
10910         (ParameterData.GenericConstraints): New public method.
10911
10912         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10913         method parameter and compute our constraints if appropriate.
10914         (Parameter.GenericConstraints): New public property.
10915
10916         * generic.cs (Constraints): Implement GenericConstraints.
10917
10918 2004-03-29  Martin Baulig  <martin@ximian.com>
10919
10920         * decl.cs (MemberCache.FindMemberToOverride): Use
10921         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10922
10923 2004-03-29  Martin Baulig  <martin@ximian.com>
10924
10925         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10926
10927 2004-03-29  Martin Baulig  <martin@ximian.com>
10928
10929         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10930         not allowed on non-generic declarations").
10931
10932 2004-03-29  Martin Baulig  <martin@ximian.com>
10933
10934         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10935         public version of this method.
10936
10937         * class.cs (MethodCore.IsDuplicateImplementation): Use
10938         Invocation.InferTypeArguments() to check this.
10939
10940 2004-03-29  Martin Baulig  <martin@ximian.com>
10941
10942         * convert.cs: Use TypeManager.IsDelegateType() instead of
10943         comparing types correctly.
10944
10945 2004-03-29  Martin Baulig  <martin@ximian.com>
10946
10947         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10948         types directly to make it work for generic instances.
10949
10950         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10951
10952 2004-03-29  Martin Baulig  <martin@ximian.com>
10953
10954         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10955         support for arrays.     
10956
10957 2004-03-24  Martin Baulig  <martin@ximian.com>
10958
10959         * decl.cs (DeclSpace.FindType): Also use
10960         TypeManager.CheckGeneric() for types from the using clauses.
10961
10962 2004-03-23  Martin Baulig  <martin@ximian.com>
10963
10964         * expression.cs (Invocation.OverloadResolve): Added `bool
10965         may_fail' argument and use it instead of the Location.IsNull() hack.
10966
10967 2004-03-23  Martin Baulig  <martin@ximian.com>
10968
10969         * expression.cs (Invocation.InferType): Use correct type inference
10970         rules here.     
10971
10972 2004-03-23  Martin Baulig  <martin@ximian.com>
10973
10974         * ecore.cs (MethodGroupExpr.Name): Use
10975         TypeManager.CSharpSignature() instead of just the name.
10976
10977         * expression.cs (Invocation.OverloadResolve): Provide better error
10978         reporting.
10979         (Invocation.DoResolve): OverloadResolve() never returns null
10980         without reporting an error, so removed the error -6 reporting here.
10981
10982 2004-03-23  Martin Baulig  <martin@ximian.com>
10983
10984         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10985         generic methods.
10986
10987         * cs-parser.jay (delegate_declaration): Support generic delegates.
10988
10989         * delegate.cs: Support generic delegates.
10990
10991 2004-03-22  Martin Baulig  <martin@ximian.com>
10992
10993         * expression.cs (Invocation.InferParamsTypeArguments): New static
10994         method; does type inference for params arguments.
10995
10996 2004-03-21  Martin Baulig  <martin@ximian.com>
10997
10998         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10999         method; checks whether a method is a generic method.    
11000
11001         * expression.cs (Invocation.InferTypeArguments): New static method;
11002         infer type arguments for generic method invocation.
11003
11004         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11005         property; we set this to true if we're resolving a generic method
11006         invocation and the user specified type arguments, ie. we're not
11007         doing type inference.
11008
11009 2004-03-20  Martin Baulig  <martin@ximian.com>
11010
11011         * class.cs (MethodData.DeclaringType): New public property.
11012         (MethodData.Define): Set DeclaringType here.
11013         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11014         instead of OperatorMethodBuilder.DeclaringType.
11015
11016 2004-03-20  Martin Baulig  <martin@ximian.com>
11017
11018         * cs-tokenizer.cs (xtoken): Return a special
11019         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11020
11021         * cs-parser.jay (default_value_expression): Switch to the new
11022         syntax (14.5.13).
11023
11024 2004-03-19  Martin Baulig  <martin@ximian.com>
11025
11026         * decl.cs (MemberName): New class.  We use this to "construct"
11027         namespace_or_type_name's.
11028
11029         * generics.cs (TypeArguments.GetDeclarations): New public method;
11030         returns the type arguments as a string[] and reports a CS0081 if
11031         one of them is not an identifier.
11032
11033         * class.cs (MemberBase): The .ctor now takes the name as a
11034         MemberName instead of a string.
11035         (MemberBase.ExplicitInterfaceName): Changed type from string to
11036         Expression.
11037         (MemberBase.DoDefine): If we're an explicit implementation, the
11038         InterfaceType may be a generic instance.
11039
11040         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11041         (namespace_name): Call MemberName.GetName () to transform the
11042         MemberName into a string and ensure we don't have any type
11043         arguments.
11044         (type_name): Call MemberName.GetTypeExpression() to transfrom the
11045         MemberName into an expression.
11046         (method_header): Use namespace_or_type_name instead of member_name.     
11047
11048 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11049
11050         * rootcontext.cs: Add new types to the boot resolution.
11051
11052         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11053         MulticastDelegate is not allowed.
11054
11055         * typemanager.cs: Add new types to lookup: System.TypedReference
11056         and ArgIterator.
11057
11058         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11059         check for TypedReference or ArgIterator, they are not allowed. 
11060
11061         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11062         makes us properly catch 1510 in some conditions (see bug 56016 for
11063         details). 
11064
11065 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11066
11067         * CryptoConvert.cs: update from corlib version
11068         with endian fixes.
11069
11070 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11071
11072         * class.cs (Indexer.Define): Check indexername declaration
11073
11074 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11075
11076         * attribute.cs (IsClsCompliant): Fixed problem with handling
11077         all three states (compliant, not-compliant, undetected).
11078
11079 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11080
11081         * attribute.cs (Attribute): Location is now public.
11082         (Resolve): Store resolved arguments (pos_values) in attribute class.
11083         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11084         (GetClsCompliantAttributeValue): New method that gets
11085         CLSCompliantAttribute value.
11086         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11087         if exists else null.
11088         (AttributeTester): New class for CLS-Compliant verification routines.
11089
11090         * class.cs (Emit): Add CLS-Compliant verification.
11091         (Method.GetSignatureForError): Implemented.
11092         (Constructor.GetSignatureForError): Implemented
11093         (Constructor.HasCompliantArgs): Returns if constructor has
11094         CLS-Compliant arguments.
11095         (Constructor.Emit): Override.
11096         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11097         is needed to test only parameters.
11098         (FieldBase.GetSignatureForError): Implemented.
11099         (TypeContainer): New member for storing base interfaces.
11100         (TypeContainer.FindMembers): Search in base interfaces too.
11101
11102         * codegen.cs (GetClsComplianceAttribute): New method that gets
11103         assembly or module CLSCompliantAttribute value.
11104         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11105         for assembly.
11106         (ModuleClass.Emit): Add error 3012 test.
11107
11108         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11109
11110         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11111         state for all decl types.
11112         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11113         if CLS-Compliant tests are required.
11114         (IsClsCompliaceRequired): New method. Analyze whether code
11115         must be CLS-Compliant.
11116         (IsExposedFromAssembly): New method. Returns true when MemberCore
11117         is exposed from assembly.
11118         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11119         value or gets cached value.
11120         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11121         is explicitly marked with CLSCompliantAttribute.
11122         (IsIdentifierClsCompliant): New abstract method. This method is
11123         used to testing error 3005.
11124         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11125         for identifier and parameters CLS-Compliant testing.
11126         (VerifyClsCompliance): New method. The main virtual method for
11127         CLS-Compliant verifications.
11128         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11129         null. I don't know why is null (too many public members !).
11130         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11131         and get value of first CLSCompliantAttribute that found.
11132
11133         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11134         (VerifyClsCompliance): Override and add extra tests.
11135
11136         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11137         clscheck- disable CLS-Compliant verification event if assembly is has
11138         CLSCompliantAttribute(true).
11139
11140         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11141         ApllyAttribute is now called in emit section as in the other cases.
11142         Possible future Emit integration.
11143         (IsIdentifierClsCompliant): New override.
11144         (VerifyClsCompliance): New override.
11145         (GetEnumeratorName): Returns full enum name.
11146
11147         * parameter.cs (GetSignatureForError): Implemented.
11148
11149         * report.cs (WarningData): New struct for Warning message information.
11150         (LocationOfPreviousError): New method.
11151         (Warning): New method. Reports warning based on the warning table.
11152         (Error_T): New method. Reports error based on the error table.
11153
11154         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11155         verifications are done here.
11156
11157         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11158
11159         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11160         CLSCompliantAttribute.
11161         (all_imported_types): New member holds all imported types from other
11162         assemblies.
11163         (LoadAllImportedTypes): New method fills static table with exported types
11164         from all referenced assemblies.
11165         (Modules): New property returns all assembly modules.
11166
11167 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11168
11169         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11170         throwing a parser error.
11171
11172         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11173         which removes the hardcoded get_/set_ prefixes for properties, as
11174         IL allows for the properties to be named something else.  
11175
11176         Bug #56013
11177
11178         * expression.cs: Do not override operand before we know if it is
11179         non-null.  Fix 56207
11180
11181 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11182
11183         * typemanager.cs: support for pinned variables.
11184
11185 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11186
11187         * decl.cs, typemanager.cs: Avoid using an arraylist
11188         as a buffer if there is only one result set.
11189
11190 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11191
11192         * expression.cs: Make sure you cant call a static method
11193         with an instance expression, bug #56174.
11194
11195 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11196
11197         * class.cs (IsDuplicateImplementation): Improve error reporting to
11198         flag 663 (method only differs in parameter modifier).
11199
11200         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11201         in preprocessor directives.
11202
11203         * location.cs (LookupFile): Allow for the empty path.
11204
11205         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11206         better approach for some of that patch, but its failing with the
11207         CharSet enumeration.  For now try/catch will do.
11208
11209         * typemanager.cs: Do not crash if a struct does not have fields.
11210         Fixes 56150.
11211
11212 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11213
11214         * expression.cs: cs0213, cant fix a fixed expression.
11215         fixes 50231.
11216
11217 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11218
11219         * cs-parser.jay: detect invalid embeded statements gracefully.
11220         bug #51113.
11221
11222 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11223
11224         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11225         As a regex:
11226         s/
11227         the invocation type may not be a subclass of the tye of the item/
11228         The type of the item must be a subclass of the invocation item.
11229         /g
11230
11231         Fixes bug #50820.
11232
11233 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11234
11235         * attribute.cs: Added methods to get a string and a bool from an
11236         attribute. Required to information from AssemblyKeyFileAttribute,
11237         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11238         * codegen.cs: Modified AssemblyName creation to include support for
11239         strongnames. Catch additional exceptions to report them as CS1548.
11240         * compiler.csproj: Updated include CryptoConvert.cs.
11241         * compiler.csproj.user: Removed file - user specific configuration.
11242         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11243         Mono.Security assembly. The original class is maintained and tested in
11244         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11245         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11246         like CSC 8.0 (C# v2) supports.
11247         * Makefile: Added CryptoConvert.cs to mcs sources.
11248         * rootcontext.cs: Added new options for strongnames.
11249
11250 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11251
11252         * driver.cs: For --expect-error, report error code `2'
11253         if the program compiled with no errors, error code `1' if
11254         it compiled with an error other than the one expected.
11255
11256 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11257
11258         * compiler.csproj: Updated for Visual Studio .NET 2003.
11259         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11260         * compiler.sln: Updated for Visual Studio .NET 2003.
11261
11262 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11263
11264         * expression.cs: Fix bug #47234. We basically need to apply the
11265         rule that we prefer the conversion of null to a reference type
11266         when faced with a conversion to 'object' (csc behaviour).
11267
11268 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11269
11270         * statement.cs: Shorter form for foreach, eliminates
11271         a local variable. r=Martin.
11272
11273 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11274
11275         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11276         checks if we can use brtrue/brfalse to test for 0.
11277         * expression.cs: use the above in the test for using brtrue/brfalse.
11278         cleanup code a bit.
11279
11280 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11281
11282         * expression.cs: Rewrite string concat stuff. Benefits:
11283
11284         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11285         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11286         rather than a concat chain.
11287
11288         * typemanager.cs: Add lookups for more concat overloads.
11289
11290 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11291
11292         * expression.cs: Emit shorter il code for array init.
11293
11294         newarr
11295         dup
11296         // set 1
11297
11298         // set 2
11299
11300         newarr
11301         stloc.x
11302
11303         ldloc.x
11304         // set 1
11305
11306         ldloc.x
11307         // set 2
11308
11309 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11310
11311         * statement.cs: Before, two switch blocks would be merged if the
11312         total size of the blocks (end_item - begin_item + 1) was less than
11313         two times the combined sizes of the blocks.
11314
11315         Now, it will only merge if after the merge at least half of the
11316         slots are filled.
11317
11318         fixes 55885.
11319
11320 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11321
11322         * class.cs : csc build fix for GetMethods(). See bug #52503.
11323
11324 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11325
11326         * expression.cs: Make sure fp comparisons work with NaN.
11327         This fixes bug #54303. Mig approved this patch a long
11328         time ago, but we were not able to test b/c the runtime
11329         had a related bug.
11330
11331 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11332
11333         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11334
11335 2004-03-19  Martin Baulig  <martin@ximian.com>
11336
11337         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11338         two overloads may unify for some type parameter substitutions and
11339         report a CS0408 if appropriate.
11340
11341 2004-03-19  Martin Baulig  <martin@ximian.com>
11342
11343         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11344         error here and not in our caller.
11345
11346 2004-03-19  Martin Baulig  <martin@ximian.com>
11347
11348         * interface.cs: Completely killed this file.
11349         (Interface): We're now a TypeContainer and live in class.cs.
11350
11351         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11352         argument; we're now also called for interfaces.
11353         (TypeContainer.DefineMembers): Allow this method being called
11354         multiple times.
11355         (TypeContainer.GetMethods): New public method; formerly known as
11356         Interface.GetMethod().  This is used by PendingImplementation.
11357         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11358         it's now private and non-static.
11359         (Interface): Moved this here; it's now implemented similar to
11360         Class and Struct.
11361         (Method, Property, Event, Indexer): Added `bool is_interface'
11362         argument to their .ctor's.
11363         (MemberBase.IsInterface): New public field.
11364
11365         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11366         instances instead of InterfaceMethod, InterfaceProperty, etc.
11367         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11368         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11369
11370 2004-03-19  Martin Baulig  <martin@ximian.com>
11371
11372         * class.cs (MethodCore.IsDuplicateImplementation): New private
11373         method which does the CS0111 checking.
11374         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11375         Use IsDuplicateImplementation().
11376
11377 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11378
11379         * decl.cs (FindMemberToOverride): New method to find the correct
11380         method or property to override in the base class.
11381         * class.cs
11382             - Make Method/Property use the above method to find the
11383               version in the base class.
11384             - Remove the InheritableMemberSignatureCompare as it is now
11385               dead code.
11386
11387         This patch makes large code bases much faster to compile, as it is
11388         O(n) rather than O(n^2) to do this validation.
11389
11390         Also, it fixes bug 52458 which is that nested classes are not
11391         taken into account when finding the base class member.
11392
11393         Reviewed/Approved by Martin.
11394
11395 2004-03-17  Martin Baulig  <martin@ximian.com>
11396
11397         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11398         of type arguments into account; use the `real_num_type_args'
11399         approach like in DoResolveAsTypeStep().
11400
11401         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11402         nested types.
11403
11404 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11405
11406         * interface.cs: In all interface classes removed redundant
11407         member initialization.
11408
11409 2004-03-16  Martin Baulig  <martin@ximian.com>
11410
11411         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11412
11413 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11414
11415         * decl.cs (DefineTypeAndParents): New helper method to define a
11416         type's containers before the type itself is defined;  This is a
11417         bug exposed by the recent changes to Windows.Forms when an
11418         implemented interface was defined inside a class that had not been
11419         built yet.   
11420
11421         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11422
11423         (Check): Loop correctly to report errors modifiers
11424         (UNSAFE was not in the loop, since it was the same as TOP).
11425
11426         * interface.cs: Every interface member now takes a ModFlags,
11427         instead of a "is_new" bool, which we set on the base MemberCore. 
11428
11429         Every place where we called "UnsafeOk" in the interface, now we
11430         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11431         the unsafe settings from the member declaration instead of the
11432         container interface. 
11433
11434         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11435
11436         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11437         `set_indexer_name' to the pending bits (one per type).
11438
11439         We fixed a bug today that was picking the wrong method to
11440         override, since for properties the existing InterfaceMethod code
11441         basically ignored the method name.  Now we make sure that the
11442         method name is one of the valid indexer names.
11443
11444 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11445  
11446         * support.cs (SeekableStreamReader): Keep track of stream byte
11447         positions and don't mix them with character offsets to the buffer.
11448
11449         Patch from Gustavo Giráldez
11450
11451 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11452
11453         * interface.cs (InterfaceSetGetBase): Removed double member
11454         initialization, base class does it as well.
11455
11456 2004-03-13  Martin Baulig  <martin@ximian.com>
11457
11458         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11459         when compiling corlib.
11460
11461 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11462
11463         * convert.cs (ExplicitConversion): We were reporting an error on
11464         certain conversions (object_type source to a value type, when the
11465         expression was `null') before we had a chance to pass it through
11466         the user defined conversions.
11467
11468         * driver.cs: Replace / and \ in resource specifications to dots.
11469         Fixes 50752
11470
11471         * class.cs: Add check for duplicate operators.  Fixes 52477
11472
11473 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11474
11475         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11476         that are in the middle of the statements, not only at the end.
11477         Fixes #54987
11478
11479         * class.cs (TypeContainer.AddField): No longer set the
11480         `HaveStaticConstructor' flag, now we call it
11481         `UserDefineStaticConstructor' to diferentiate the slightly
11482         semantic difference.
11483
11484         The situation is that we were not adding BeforeFieldInit (from
11485         Modifiers.TypeAttr) to classes that could have it.
11486         BeforeFieldInit should be set to classes that have no static
11487         constructor. 
11488
11489         See:
11490
11491         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11492
11493         And most importantly Zoltan's comment:
11494
11495         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11496
11497         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11498          before its static fields are used', i.e. initialization does not need
11499          to be triggered by the first access to the type. Setting this flag
11500          helps the JIT to compile better code, since it can run the static
11501          constructor at JIT time, and does not need to generate code to call it
11502          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11503          this flag for lots of classes like String. 
11504          
11505          csc sets this flag if the type does not have an explicit static 
11506          constructor. The reasoning seems to be that if there are only static
11507          initalizers for a type, and no static constructor, then the programmer
11508          does not care when this initialization happens, so beforefieldinit
11509          can be used.
11510          
11511          This bug prevents the AOT compiler from being usable, since it 
11512          generates so many calls to mono_runtime_class_init that the AOT code
11513          is much slower than the JITted code. The JITted code is faster, 
11514          because it does not generate these calls if the vtable is type is
11515          already initialized, which is true in the majority of cases. But the
11516          AOT compiler can't do this."
11517
11518 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11519
11520         * class.cs (MethodData.Emit): Refactor the code so symbolic
11521         information is generated for destructors;  For some reasons we
11522         were taking a code path that did not generate symbolic information
11523         before. 
11524
11525 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11526
11527         * class.cs: Create a Constructor.CheckBase method that
11528         takes care of all validation type code. The method
11529         contains some code that was moved from Define.
11530
11531         It also includes new code that checks for duplicate ctors.
11532         This fixes bug #55148.
11533
11534 2004-03-09  Joshua Tauberer <tauberer@for.net>
11535
11536         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11537         a { ... }-style array creation invokes EmitStaticInitializers
11538         which is not good for reference-type arrays.  String, decimal
11539         and now null constants (NullCast) are not counted toward
11540         static initializers.
11541
11542 2004-03-05  Martin Baulig  <martin@ximian.com>
11543
11544         * location.cs (SourceFile.HasLineDirective): New public field;
11545         specifies whether the file contains or is referenced by a "#line"
11546         directive.
11547         (Location.DefineSymbolDocuments): Ignore source files which
11548         either contain or are referenced by a "#line" directive.        
11549
11550 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11551
11552         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11553         direct access to our parent, so check the method inline there.
11554
11555 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11556
11557         * expression.cs (Invocation.EmitCall): Miguel's last commit
11558         caused a regression. If you had:
11559
11560             T t = null;
11561             t.Foo ();
11562
11563         In Foo the implict this would be null.
11564
11565 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11566
11567         * expression.cs (Invocation.EmitCall): If the method is not
11568         virtual, do not emit a CallVirt to it, use Call.
11569
11570         * typemanager.cs (GetFullNameSignature): Improve the method to
11571         cope with ".ctor" and replace it with the type name.
11572
11573         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11574         as an argument the ConstructorBuilder where it is being defined,
11575         to catch the recursive constructor invocations.
11576
11577 2004-03-16  Martin Baulig  <martin@ximian.com>
11578
11579         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11580         ConstructedType, call ResolveType() on it to get the type rather
11581         than just using `expr.Type'.
11582
11583 2004-03-16  Martin Baulig  <martin@ximian.com>
11584
11585         * generics.cs (ConstructedType.GetMemberAccess): Take the
11586         EmitContext instead on the TypeExpr and use
11587         ec.TypeContainer.CurrentType/ec.ContainerType.
11588
11589 2004-03-16  Martin Baulig  <martin@ximian.com>
11590
11591         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11592         parameters before aliases.
11593
11594 2004-03-16  Martin Baulig  <martin@ximian.com>
11595
11596         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11597         New oublic function; checks whether two generic instances may become
11598         equal under some instantiations (26.3.1).
11599
11600         * class.cs (TypeContainer.Define): Call
11601         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11602         error.
11603
11604 2004-03-16  Martin Baulig  <martin@ximian.com>
11605
11606         * class.cs (TypeContainer.GetClassBases): Moved
11607         Error_TypeParameterAsBase() here and also check whether the base
11608         class is not an attribute.
11609
11610 2004-03-16  Martin Baulig  <martin@ximian.com>
11611
11612         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11613
11614 2004-03-16  Martin Baulig  <martin@ximian.com>
11615
11616         * class.cs (Error_TypeParameterAsBase): Use correct error number
11617         here (CS0689).  
11618
11619 2004-03-16  Martin Baulig  <martin@ximian.com>
11620
11621         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11622         for generics.
11623
11624         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11625         error reporting.
11626
11627 2004-03-15  Martin Baulig  <martin@ximian.com>
11628
11629         * typemanager.cs (TypeManager.GetFullName): New public method.
11630         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11631         argument; only return members with the correct number of type
11632         arguments.
11633         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11634         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11635         whether the number of type arguments matches.
11636
11637         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11638         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11639
11640         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11641         field; it's set by the protected .ctor when we're actually a
11642         GenericMemberAccess.
11643         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11644         arguments and pass it to MemberLookupFinal ().
11645
11646         * ecore.cs (Expression.MemberLookup): Added `int
11647         num_type_arguments' argument; only return members with the correct
11648         number of type arguments.
11649         (Expression.MemberLookupFailed): Check whether the MemberLookup
11650         failed because we did not have the correct number of type
11651         arguments; report CS0305 in this case.
11652
11653         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11654         `e.ResolveAsTypeTerminal()' already did so.
11655
11656 2004-03-15  Martin Baulig  <martin@ximian.com>
11657
11658         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11659         we're a ConstructedType; in this case, the caller must report an
11660         error (for instance CS0131).
11661
11662         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11663         (TypeArguments.Resolve): Actually report errors here.
11664
11665 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11666
11667         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11668         `set_indexer_name' to the pending bits (one per type).
11669
11670         We fixed a bug today that was picking the wrong method to
11671         override, since for properties the existing InterfaceMethod code
11672         basically ignored the method name.  Now we make sure that the
11673         method name is one of the valid indexer names.
11674
11675 2004-03-15  Martin Baulig  <martin@ximian.com>
11676
11677         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11678         for generic instances.
11679
11680 2004-03-13  Martin Baulig  <martin@ximian.com>
11681
11682         * class.cs (TypeContainer.DefineType): Call
11683         TypeManager.AddUserType() immediately after creating the
11684         TypeBuilder; pass all type parameters when creating the
11685         CurrentType.
11686
11687         * decl.cs (DeclSpace.FindNestedType): New public method.
11688         (DeclSpace.FindType): Added `int num_type_args' argument; only
11689         return types with the correct number of type parameters.
11690         (DeclSpace.CountTypeParams): New public property.
11691
11692         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11693         the number of type parameters; defaults to zero.
11694
11695         * generic.cs (TypeArguments.Count): New public property.
11696         (ConstructedType.DoResolveAsTypeStep): First call
11697         ds.FindNestedType() to find out whether we're nested in the
11698         current generic type; in this case, we inherit all type parameters
11699         from the current class.
11700
11701         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11702         num_type_args' argument.
11703         (RootContext.LookupType): Added overloaded version which takes the
11704         number of type arguments; only return types with the correct
11705         number of type arguments.
11706
11707         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11708         checks whether `Type t' has `int num_type_args'.
11709
11710 2004-03-13  Martin Baulig  <martin@ximian.com>
11711
11712         * generic.cs (GenericMethod.DefineType): New method; calls
11713         DefineType() on all the type parameters.
11714
11715         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11716         (MethodData.Define): If we're a generic method, call
11717         GenericMethod.DefineType() to define the type parameters.       
11718
11719 2004-03-10  Martin Baulig  <martin@ximian.com>
11720
11721         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11722         instead of IsAssignableFrom.    
11723
11724 2004-03-10  Martin Baulig  <martin@ximian.com>
11725
11726         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11727
11728         * support.cs (ParameterData.HasArrayParameter): New property.
11729         (ReflectionParameters.ctor): Take a MethodBase instead of a
11730         ParameterInfo[].  If we have any type parameters, get the generic
11731         method definition and ask it whether we have variable arguments.
11732
11733 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11734
11735         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11736         routines to check if a type is an enumerable/enumerator allow
11737         classes that implement the IEnumerable or IEnumerator interfaces.
11738
11739         * class.cs (Property, Operator): Implement IIteratorContainer, and
11740         implement SetYields.
11741
11742         (Property.Define): Do the block swapping for get_methods in the
11743         context of iterators.   We need to check if Properties also
11744         include indexers or not.
11745
11746         (Operator): Assign the Block before invoking the
11747         OperatorMethod.Define, so we can trigger the Iterator code
11748         replacement. 
11749
11750         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11751         Property and Operator classes are not created when we parse the
11752         declarator but until we have the block completed, so we use a
11753         singleton SimpleIteratorContainer.Simple to flag whether the
11754         SetYields has been invoked.
11755
11756         We propagate this setting then to the Property or the Operator to
11757         allow the `yield' to function.
11758
11759 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11760
11761         * codegen.cs: Implemented attribute support for modules.
11762         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11763         Assembly/Module functionality.
11764
11765         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11766         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11767         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11768
11769 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11770
11771         * interface.cs (FindMembers): The operation is performed on all base
11772         interfaces and not only on the first. It is required for future CLS Compliance patch.
11773
11774 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11775
11776         * statement.cs, codegen.cs:
11777         This patch deals with patterns such as:
11778
11779         public class List : IEnumerable {
11780
11781                 public MyEnumerator GetEnumerator () {
11782                         return new MyEnumerator(this);
11783                 }
11784
11785                 IEnumerator IEnumerable.GetEnumerator () {
11786                         ...
11787                 }
11788                 
11789                 public struct MyEnumerator : IEnumerator {
11790                         ...
11791                 }
11792         }
11793
11794         Before, there were a few things we did wrong:
11795         1) we would emit callvirt on a struct, which is illegal
11796         2) we emited ldarg when we needed to emit ldarga
11797         3) we would mistakenly call the interface methods on an enumerator
11798         type that derived from IEnumerator and was in another assembly. For example:
11799
11800         public class MyEnumerator : IEnumerator
11801
11802         Would have the interface methods called, even if there were public impls of the
11803         method. In a struct, this lead to invalid IL code.
11804
11805 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11806
11807         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11808           renamed to Emit.
11809
11810         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11811
11812 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11813
11814         * cs-parser.jay: Fix small regression: we were not testing V2
11815         compiler features correctly.
11816
11817         * interface.cs: If the emit context is null, then create one
11818
11819 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11820
11821         * decl.cs (GetSignatureForError): New virtual method to get full name
11822           for error messages.
11823
11824         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11825           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11826
11827         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11828           Duplicated members and code in these classes has been removed.
11829           Better encapsulation in these classes.
11830
11831 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11832
11833         * assign.cs (Assign.DoResolve): When dealing with compound
11834         assignments, there is a new rule in ECMA C# 2.4 (might have been
11835         there before, but it is documented here) that states that in:
11836
11837         a op= b;
11838
11839         If b is of type int, and the `op' is a shift-operator, then the
11840         above is evaluated as:
11841
11842         a = (int) a op b 
11843
11844         * expression.cs (Binary.ResolveOperator): Instead of testing for
11845         int/uint/long/ulong, try to implicitly convert to any of those
11846         types and use that in pointer arithmetic.
11847
11848         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11849         method to print information for from the type, not from the
11850         null-method we were given.
11851
11852 2004-02-01  Duncan Mak  <duncan@ximian.com>
11853
11854         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11855         parsing for cmd, fixes bug #53694.
11856
11857 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11858
11859         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11860         in the member name duplication tests. Property and operator name duplication
11861         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11862
11863 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11864
11865         * interface.cs (PopulateMethod): Fixed crash when interface method
11866         returns not existing type (error test cs0246-3.cs).
11867
11868 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11869
11870         * cs-parser.jay (interface_accessors): Re-write actions to also
11871         store attributes attached to get and set methods. Fix spelling
11872         while at it.
11873
11874         (inteface_property_declaration): Modify accordingly.
11875
11876         (InterfaceAccessorInfo): New helper class to store information to pass
11877         around between rules that use interface_accessors.
11878
11879         * interface.cs (Emit): Apply attributes on the get and set
11880         accessors of properties and indexers too.
11881
11882         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11883         right MethodBuilder when applying attributes to the get and set accessors.
11884
11885 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11886
11887         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11888
11889 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11892
11893 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11894
11895         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11896         changes that treat `yield' specially when present before `break'
11897         or `return' tokens.
11898
11899         * cs-tokenizer.cs: yield is no longer a keyword.
11900
11901 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11902
11903         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11904         setting for default constructors.
11905         For default constructors are almost every time set wrong Modifier. The
11906         generated IL code has been alright. But inside mcs this values was
11907         wrong and this was reason why several of my CLS Compliance tests
11908         failed.
11909
11910 2004-02-27  Martin Baulig  <martin@ximian.com>
11911
11912         * generics.cs (ConstructedType.ResolveType): Make the nested type
11913         stuff actually work.
11914
11915 2004-02-25  Martin Baulig  <martin@ximian.com>
11916
11917         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11918         property; returns the type parameters just from the current type,
11919         ie. with the ones from outer classes.
11920         (DeclSpace.LookupGeneric): First search in the current class, then
11921         in outer classes.
11922         (DeclSpace.initialize_type_params): When hiding a type parameter
11923         from an outer class, put it into the `type_param_list' anyways.
11924
11925         * expression.cs (MemberAccess.expr): Made this field protected.
11926
11927         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11928         the type parameters from the current class.
11929
11930         * generic.cs (ConstructedType.ResolveType): Support nested generic
11931         types by taking the type parameters which we inherit from outer
11932         classes into account.
11933         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11934         support for nested generic types.
11935
11936 2004-02-23  Martin Baulig  <martin@ximian.com>
11937
11938         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11939         field and check whether we're nested inside a generic type.
11940         (DeclSpace.ResolveType): If we're resolving to a generic type
11941         definition, create a ConstructedType and return its resolved type.
11942         (DeclSpace.initialize_type_params): New private method;
11943         initializes the `type_param_list' field from the type parameters
11944         from this and all enclosing classes.
11945         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11946         we're already initialized.
11947
11948 2004-02-23  Martin Baulig  <martin@ximian.com>
11949
11950         * class.cs (Method.Define): Create the generic method before
11951         calling DoDefine().
11952         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11953         the TypeContainer one); we use this for generic methods.
11954
11955         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11956         parent's TypeBuilder.
11957
11958 2004-02-18  Martin Baulig  <martin@ximian.com>
11959
11960         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11961         to check for equality.
11962
11963 2004-02-05  Martin Baulig  <martin@ximian.com>
11964
11965         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11966         `ec.TypeContainer.CurrentType', use it instead of
11967         `ec.ContainerType' to check whether we're in the type's ctor.
11968
11969 2004-01-29  Martin Baulig  <martin@ximian.com>
11970
11971         * expression.cs (Invocation.DoResolve): If we're a
11972         `ConstructedType', then we're actually a generic method, so
11973         rewrite the expr as a GenericMemberAccess.
11974
11975         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11976         here; manually parse it into a string.
11977
11978 2004-01-28  Martin Baulig  <martin@ximian.com>
11979
11980         * typemanager.cs (TypeManager.IsEqual): New static method.
11981         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11982         check for equality instead of using `=='.
11983
11984 2004-01-26  Martin Baulig  <martin@ximian.com>
11985
11986         * decl.cs (DeclSpace.CurrentType): New public field.
11987
11988         * expression.cs (This.ResolveBase): If we have an
11989         `ec.TypeContainer.CurrentType', use it instead of
11990         `ec.ContainerType'.
11991
11992         * class.cs (TypeContainer.DefineType): If we're a generic type,
11993         create the `CurrentType' (unresolved).
11994         (TypeContainer.GenericType): New private field.
11995         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11996         it and store it in `GenericType' before creating the MemberCache.
11997         (TypeContainer.GetMembers): If we have a `GenericType', call
11998         TypeManager.FindMembers() on it.
11999
12000         * interface.cs (Interface.GenericType): New private field.
12001         (Interface.DefineType): If we're a generic type, create the
12002         `CurrentType' (unresolved).
12003         (Interface.DefineMembers): If we have a `CurrentType', resolve it
12004         and store it in `GenericType' before creating the MemberCache.
12005         (Interface.GetMembers): If we have a `GenericType', call
12006         TypeManager.FindMembers() on it.
12007
12008 2004-01-22  Martin Baulig  <martin@ximian.com>
12009
12010         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12011         not a QualifiedIdentifier.  This is what `type_name_expression'
12012         was previously doing.
12013         (type_name_expression): Removed; the code is now in
12014         `namespace_or_type_name'.
12015         (qualified_identifier): Removed, use `namespace_or_type_name'
12016         instead.
12017         (QualifiedIdentifier): Removed this class.      
12018
12019 2004-01-22  Martin Baulig  <martin@ximian.com>
12020
12021         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12022         not a string as alias name.
12023
12024 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12025
12026         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12027         #52730 bug, and instead compute correctly the need to use a
12028         temporary variable when requesting an address based on the
12029         static/instace modified of the field and the constructor.
12030  
12031 2004-01-21  Martin Baulig  <martin@ximian.com>
12032
12033         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12034         class and namespace before looking up aliases.  Fixes #52517.
12035
12036 2004-01-21  Martin Baulig  <martin@ximian.com>
12037
12038         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12039         assinged in a 'try'; fixes exception4.cs.
12040
12041 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12042         * class.cs : Implemented parameter-less constructor for TypeContainer
12043
12044         * decl.cs: Attributes are now stored here. New property OptAttributes
12045
12046         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12047
12048         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12049
12050 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12051
12052         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12053           (CSharpSignature): New method for indexer and property signature.
12054
12055 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12056
12057         * pending.cs (IsVirtualFilter): Faster implementation.
12058
12059 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12060
12061         * typemanager.cs: Avoid inclusion of same assembly more than once.
12062
12063 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12064
12065         * cs-parser.jay: Fixed problem where the last assembly attribute
12066           has been applied also to following declaration (class, struct, etc.)
12067           
12068 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12069
12070         * class.cs: Added error CS0538, CS0539 reporting.
12071         Fixed crash on Microsoft runtime when field type is void.
12072
12073         * cs-parser.jay: Added error CS0537 reporting.
12074
12075         * pending.cs: Added error CS0535 reporting.
12076         Improved error report for errors CS0536, CS0534.
12077
12078 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12079
12080         Merge a few bits from the Anonymous Method MCS tree.
12081
12082         * statement.cs (ToplevelBlock): New class for toplevel methods,
12083         will hold anonymous methods, lifted variables.
12084
12085         * cs-parser.jay: Create toplevel blocks for delegates and for
12086         regular blocks of code. 
12087
12088 2004-01-20  Martin Baulig  <martin@ximian.com>
12089
12090         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12091         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12092         and `NeedExplicitReturn'; added `IsLastStatement'.
12093         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12094         have a `ReturnLabel' or we're not unreachable.
12095
12096         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12097         child's reachability; don't just override ours with it.  Fixes
12098         #58058 (lluis's example).
12099         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12100         InFinally(), InLoop(), InSwitch() and
12101         BreakCrossesTryCatchBoundary() methods.
12102
12103         * statement.cs (Return): Do all error checking in Resolve().
12104         Unless we are the last statement in a top-level block, always
12105         create a return label and jump to it.
12106         (Break, Continue): Do all error checking in Resolve(); also make
12107         sure we aren't leaving a `finally'.
12108         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12109         statement in a top-level block.
12110         (Block.Flags): Added `IsDestructor'.
12111         (Block.IsDestructor): New public property.
12112
12113 2004-01-20  Martin Baulig  <martin@ximian.com>
12114
12115         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12116
12117 2004-01-20  Martin Baulig  <martin@ximian.com>
12118
12119         * statement.cs (Statement.ResolveUnreachable): New public method.
12120         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12121         (Block.Resolve): Resolve unreachable statements.
12122
12123 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12124
12125         * expression.cs: We need to fix the case where we do
12126         not have a temp variable here.
12127
12128         * assign.cs: Only expression compound assignments need
12129         temporary variables.
12130
12131 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12132
12133         * flowanalysis.cs: Reduce memory allocation in a few ways:
12134           - A block with no variables should not allocate a bit
12135             vector for itself.
12136           - A method with no out parameters does not need any tracking
12137             for assignment of the parameters, so we need not allocate
12138             any data for it.
12139           - The arrays:
12140                 public readonly Type[] VariableTypes;
12141                 public readonly string[] VariableNames;
12142             Are redundant. The data is already stored in the variable
12143             map, so we need not allocate another array for it.
12144           - We need to add alot of checks for if (params | locals) == null
12145             due to the first two changes.
12146
12147 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12148
12149         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12150         implement IMemoryLocation, we store a copy on a local variable and
12151         take the address of it.  Patch from Benjamin Jemlich
12152
12153         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12154         to use a special "type_name_expression" rule which reduces the
12155         number of "QualifiedIdentifier" classes created, and instead
12156         directly creates MemberAccess expressions.
12157
12158 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12159
12160         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12161         that fixes #52853.  Null literal assignment to ValueType
12162
12163         * class.cs (MethodData.Emit): Instead of checking the name of the
12164         method to determine if its a destructor, create a new derived
12165         class from Method called Destructor, and test for that.  
12166
12167         * cs-parser.jay: Create a Destructor object instead of a Method.  
12168
12169         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12170
12171         Fixes: 52933
12172
12173 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12174
12175         * expression.cs (Binary.ResolveOperator): Perform an implicit
12176         conversion from MethodGroups to their delegate types on the
12177         Addition operation.
12178
12179         * delegate.cs: Introduce a new class DelegateCreation that is the
12180         base class for `NewDelegate' and `ImplicitDelegateCreation',
12181         factor some code in here.
12182
12183         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12184         conversion from MethodGroups to compatible delegate types. 
12185
12186         * ecore.cs (Expression.Resolve): Do not flag error 654
12187         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12188         we allow conversions from MethodGroups to delegate types now.
12189
12190         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12191         assignments in v2 either.
12192
12193 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12194
12195         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12196         static read-only fields in ctors.
12197
12198         Applied patch from Benjamin Jemlich 
12199
12200         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12201
12202 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12203
12204         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12205         here to return true, as they can be used like this:
12206
12207                 (XXX) int.MEMBER ()
12208
12209         Fixed 49836 and all the other dups
12210
12211 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12212
12213         * driver.cs: Implement /win32res and /win32icon.
12214
12215 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12216
12217         * cs-parser.jay: Add a rule to improve error handling for the
12218         common mistake of placing modifiers after the type.
12219
12220 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12221
12222         * cs-parser.jay (interface_event_declaration): Catch
12223         initialization of events on interfaces, and report cs0068
12224
12225         * cs-parser.jay (interface_event_declaration): Catch
12226         initialization of events. 
12227
12228         * ecore.cs: Better report missing constructors.
12229
12230         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12231         the error reporting done in the wrong place.  Fix.
12232
12233         * expression.cs (Binary.ResolveOperator): Catch the 
12234         operator + (E x, E y) error earlier, and later allow for implicit
12235         conversions in operator +/- (E e, U x) from U to the underlying
12236         type of E.
12237
12238         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12239         52596, if the container class is abstract, the default constructor
12240         is protected otherwise its public (before, we were always public).
12241
12242         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12243         fixed statement.
12244
12245         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12246         Jemlich that fixes bug #52597, MCS was generating invalid code for
12247         idisposable structs.   Thanks to Ben for following up with this
12248         bug as well.
12249
12250 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12251
12252         * driver.cs: Allow assemblies without code to be generated, fixes
12253         52230.
12254
12255 2004-01-07  Nick Drochak <ndrochak@gol.com>
12256
12257         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12258
12259 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12260
12261         * cs-parser.jay: Add rules to improve error reporting if fields or
12262         methods are declared at the namespace level (error 116)
12263
12264         * Add rules to catch event add/remove
12265
12266 2004-01-04  David Sheldon <dave-mono@earth.li>
12267
12268   * expression.cs: Added matching ")" to error message for 
12269   CS0077
12270
12271 2004-01-03 Todd Berman <tberman@gentoo.org>
12272
12273         * ecore.cs, attribute.cs:
12274         Applying fix from #52429.
12275
12276 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12277
12278         * ecore.cs, expression.cs, statement.cs:
12279         Total rewrite of how we handle branching. We
12280         now handle complex boolean expressions with fewer
12281         jumps. As well if (x == 0) no longer emits a ceq.
12282
12283         if (x is Foo) is much faster now, because we generate
12284         better code.
12285
12286         Overall, we get a pretty big improvement on our benchmark
12287         tests. The code we generate is smaller and more readable.
12288
12289         I did a full two-stage bootstrap. The patch was reviewed
12290         by Martin and Miguel.
12291
12292 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12293
12294         * cs-parser.jay: Make primary_expression not take a QI.
12295         we dont need this because the member_access rule covers
12296         us here. So we replace the rule with just IDENTIFIER.
12297
12298         This has two good effects. First, we remove a s/r conflict.
12299         Second, we allocate many fewer QualifiedIdentifier objects.
12300
12301 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12302
12303         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12304         set the correct information via SRE. This prevents
12305         hanging on the MS runtime. Fixes #29374.
12306
12307 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12308
12309         * convert.cs: correctly handle conversions to value types
12310         from Enum and ValueType as unboxing conversions.
12311
12312         Fixes bug #52569. Patch by Benjamin Jemlich.
12313
12314 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12315
12316         * expression.cs (BetterConversion): Prefer int -> uint
12317         over int -> ulong (csc's behaviour). This fixed bug #52046.
12318
12319 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12320
12321         * decl.cs (MemberCache.FindMembers): now returns a
12322         MemberInfo [].
12323
12324         * typemanager.cs: In general, go with with ^^.
12325         (CopyNewMethods): take an IList.
12326         (RealMemberLookup): Only allocate an arraylist
12327         if we copy from two sets of methods.
12328
12329         This change basically does two things:
12330         1) Fewer array lists allocated due to CopyNewMethods.
12331         2) the explicit cast in MemberList costed ALOT.
12332
12333 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12334
12335         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12336         a hashtable to avoid needless string allocations when an identifier is
12337         used more than once (the common case).
12338
12339 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12340
12341         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12342         is broken, it will not return anything. So, we
12343         have to use the information we have in mcs to
12344         do the task.
12345
12346         * typemanager.cs: Add a cache for GetInterfaces,
12347         since this will now be used more often (due to ^^)
12348
12349         (GetExplicitInterfaces) New method that gets the
12350         declared, not effective, interfaces on a type
12351         builder (eg, if you have interface IFoo, interface
12352         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12353         { IBar }.
12354
12355         This patch makes MCS able to bootstrap itself on
12356         Windows again.
12357
12358 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12359
12360         * expression.cs: Remove the Nop's that Miguel put
12361         in by mistake.
12362
12363 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12364
12365         * report.cs, codegen.cs: Give the real stack trace to
12366         the error when an exception is thrown.
12367
12368 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12369
12370         * decl.cs: only allocate hashtables for ifaces if 
12371         it is an iface!
12372
12373 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12374
12375         * expression.cs: fix the error from cs0121-2.cs
12376         (a parent interface has two child interfaces that
12377         have a function with the same name and 0 params
12378         and the function is called through the parent).
12379
12380 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12381
12382         * class.cs, rootcontext.cs, typmanager.cs: do not
12383         leak pointers.
12384
12385 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12386
12387         * codegen.cs: remove stack for the ec flow branching.
12388         It is already a linked list, so no need.
12389
12390 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12391
12392         * Makefile: Allow custom profiler here.
12393
12394 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12395
12396         * typemanager.cs (LookupType):
12397           - Use a static char [], because split takes
12398             a param array for args, so it was allocating
12399             every time.
12400           - Do not store true in a hashtable, it boxes.
12401
12402 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12403
12404         * flowanalysis.cs: bytify common enums.
12405
12406 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12407
12408         * modifiers.cs: Add a new set of flags for the
12409         flags allowed on explicit interface impls.
12410         * cs-parser.jay: catch the use of modifiers in
12411         interfaces correctly.
12412         * class.cs: catch private void IFoo.Blah ().
12413
12414         All related to bug #50572.
12415
12416 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12417
12418         * decl.cs: Rewrite the consistant accessability checking.
12419         Accessability is not linear, it must be implemented in
12420         a tableish way. Fixes #49704.
12421
12422 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12423
12424         * expression.cs: Handle negation in a checked context.
12425         We must use subtraction from zero. Fixes #38674.
12426
12427 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12428
12429         * class.cs: Ignore static void main in DLLs.
12430         * rootcontext.cs: Handle the target type here,
12431         since we are have to access it from class.cs
12432         * driver.cs: account for the above.
12433
12434 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12435
12436         * report.cs: Give line numbers and files if available.
12437
12438 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12439
12440         * driver.cs: Implement /addmodule.
12441
12442         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12443         ModuleBuilders.
12444
12445 2003-12-20  Martin Baulig  <martin@ximian.com>
12446
12447         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12448         (FieldBase.IsAssigned): Removed this field.
12449         (FieldBase.SetAssigned): New public method.
12450         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12451
12452 2003-12-20  Martin Baulig  <martin@ximian.com>
12453
12454         * expression.cs (LocalVariableReference.DoResolve): Don't set
12455         `vi.Used' if we're called from DoResolveLValue().
12456
12457         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12458         returns the usage vector it just merged into the current one -
12459         pass this one to UsageWarning().
12460         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12461         of the `EmitContext', don't call this recursively on our children.
12462
12463 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12464
12465         * driver.cs: Implement /target:module.
12466
12467 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12468
12469         * support.cs (CharArrayHashtable): New helper class.
12470
12471         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12472         char arrays, not strings, so we can avoid creating a string in
12473         consume_identifier if the identifier is a keyword.
12474
12475 2003-12-16  Martin Baulig  <martin@ximian.com>
12476
12477         * statement.cs (LocalInfo.Assigned): Removed this property.
12478         (LocalInfo.Flags): Removed `Assigned'.
12479         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12480         and uses flow analysis.
12481         (Block.UsageWarning): Made this method private.
12482         (Block.Resolve): Call UsageWarning() if appropriate.
12483
12484         * expression.cs (LocalVariableReference.DoResolve): Always set
12485         LocalInfo.Used here.
12486
12487 2003-12-13  Martin Baulig  <martin@ximian.com>
12488
12489         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12490         any value here; we're now using flow analysis to figure out
12491         whether a statement/block returns a value.
12492
12493 2003-12-13  Martin Baulig  <martin@ximian.com>
12494
12495         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12496         working again.
12497         (FlowBranching.MergeFinally): Don't call
12498         `branching.CheckOutParameters()' here, this is called in
12499         MergeTopBlock().
12500         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12501         when adding the `finally' vector.       
12502
12503 2003-12-13  Martin Baulig  <martin@ximian.com>
12504
12505         * flowanalysis.cs
12506         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12507         actually work and also fix #48962.
12508
12509 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12510
12511         * decl.cs: Do not check System.Object for nested types,
12512         since we know it does not have any. Big bang for buck:
12513
12514         BEFORE:
12515            Run 1:   8.35 seconds
12516            Run 2:   8.32 seconds
12517            corlib:  17.99 seconds
12518         AFTER:
12519            Run 1:   8.17 seconds
12520            Run 2:   8.17 seconds
12521            corlib:  17.39 seconds
12522
12523 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12524
12525         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12526         time we are returning 0 members, so we save alot here.
12527
12528 2003-12-11  Martin Baulig  <martin@ximian.com>
12529
12530         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12531         `MergeChild()', also just take the `FlowBranching' as argument;
12532         call Merge() on it and return the result.
12533         (FlowBranching.Merge): We don't need to do anything if we just
12534         have one sibling.
12535
12536 2003-12-11  Martin Baulig  <martin@ximian.com>
12537
12538         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12539         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12540         Maurer for this idea.
12541
12542 2003-12-11  Martin Baulig  <martin@ximian.com>
12543
12544         * flowanalysis.cs (MergeResult): This class is now gone; we now
12545         use the `UsageVector' for this.  The reason for this is that if a
12546         branching just has one sibling, we don't need to "merge" them at
12547         all - that's the next step to do.
12548         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12549         `MergeResult'.
12550
12551 2003-12-11  Martin Baulig  <martin@ximian.com>
12552
12553         Reworked flow analyis and made it more precise and bug-free.  The
12554         most important change is that we're now using a special `Reachability'
12555         class instead of having "magic" meanings of `FlowReturns'.  I'll
12556         do some more cleanups and optimizations and also add some more
12557         documentation this week.
12558
12559         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12560         largely reworked this class.
12561         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12562         the new `Reachability' class instead of having "magic" values here.
12563         (FlowBranching): We're now using an instance of `Reachability'
12564         instead of having separate `Returns', `Breaks' etc. fields.
12565
12566         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12567         based on flow analysis; ignore the return value of block.Emit ().
12568
12569 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12570
12571         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12572         if they are private.
12573
12574 2003-12-09  Martin Baulig  <martin@ximian.com>
12575
12576         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12577         call them directly on the UsageVector.
12578
12579 2003-12-09  Martin Baulig  <martin@ximian.com>
12580
12581         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12582         Changed return type from `FlowReturns' to `Reachability'.
12583
12584 2003-12-09  Martin Baulig  <martin@ximian.com>
12585
12586         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12587         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12588         `Reachable' fields with a single `Reachability' one.
12589
12590 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12591
12592         * class.cs (FindMembers): Remove foreach's.
12593
12594         Bootstrap times:
12595
12596         BEFORE
12597                 Run 1:   8.74 seconds
12598                 Run 2:   8.71 seconds
12599
12600         AFTER
12601                 Run 1:   8.64 seconds
12602                 Run 2:   8.58 seconds
12603
12604
12605 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12606
12607         * cs-parser.jay:
12608         * gen-treedump.cs:
12609         * statement.cs:
12610         This patch does a few things:
12611                 1. EmptyStatement is now a singleton, so it is never reallocated.
12612                 2. All blah is EmptyStatement constructs have been changed to
12613                    blah == EmptyStatement.Value, which is much faster and valid
12614                    now that EmptyStatement is a singleton.
12615                 3. When resolving a block, rather than allocating a new array for
12616                    the non-empty statements, empty statements are replaced with
12617                    EmptyStatement.Value
12618                 4. Some recursive functions have been made non-recursive.
12619         Mainly the performance impact is from (3), however (1) and (2) are needed for
12620         this to work. (4) does not make a big difference in normal situations, however
12621         it makes the profile look saner.
12622
12623         Bootstrap times:
12624
12625         BEFORE
12626         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12627         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12628         Total memory allocated: 56397 KB
12629
12630         AFTER
12631         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12632         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12633         Total memory allocated: 55666 KB
12634
12635 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12636
12637         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12638         than the hashtable in a hashtable version
12639
12640         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12641         we always end up concating a string. This results in a huge perf
12642         loss, because many strings have to be tracked by the GC. In this
12643         patch, we first use a hashtable that works with two keys, so that
12644         the strings do not need to be concat'ed.
12645
12646         Bootstrap times:
12647         BEFORE
12648                 Run 1:   8.74 seconds
12649                 Run 2:   8.71 seconds
12650
12651         AFTER
12652                 Run 1:   8.65 seconds
12653                 Run 2:   8.56 seconds
12654
12655 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12656
12657         * Makefile: Add a new target `do-time' that does a quick and simple
12658         profile, leaving easy to parse output.
12659
12660 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12661
12662         * codegen.cs (Init): Create the dynamic assembly with 
12663         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12664
12665 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12666
12667         * support.cs: Make the PtrHashtable use only one
12668         instance of its comparer.
12669
12670 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12671
12672         * typemanager.cs: Fix lookup of GetNamespaces.
12673
12674 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12675
12676         * expression.cs: Removed redundant line.
12677
12678         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12679         ArrayLists, use for loops with bounds.  
12680
12681         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12682         arraylist.
12683
12684         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12685         arraylists, use for loop with bounds.
12686
12687         The above three changes give us a 0.071 second performance
12688         improvement out of 3.294 seconds down to 3.223.  On my machine
12689         the above changes reduced the memory usage by 1,387 KB during
12690         compiler bootstrap.
12691
12692         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12693         QualifiedIdentifiers.  Before we created a new string through
12694         concatenation, and mostly later on, the result would be
12695         manipulated by DecomposeQI through string manipulation.
12696
12697         This reduced the compiler memory usage for bootstrapping from
12698         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12699         compile times in 0.05 seconds.
12700
12701 2003-11-28  Dick Porter  <dick@ximian.com>
12702
12703         * support.cs: Do string compares with the Invariant culture.
12704
12705         * rootcontext.cs: 
12706         * gen-treedump.cs: 
12707         * expression.cs: 
12708         * driver.cs: 
12709         * decl.cs: 
12710         * codegen.cs: 
12711         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12712         the comparison is done with the Invariant culture.
12713
12714 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12715
12716         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12717         GetEnumerator method.
12718
12719         (ProbeCollectionType): Iterate starting at the most specific type
12720         upwards looking for a GetEnumerator
12721
12722         * expression.cs: Shift count can be up to 31 for int/uint and 63
12723         for long/ulong.
12724
12725 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12726
12727         * statement.cs (Block.LookupLabel): Also look for the label on the
12728         children blocks.  Use a hash table to keep track of visited
12729         nodes. 
12730
12731         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12732         we actually did transform the other operand, otherwise fall back
12733         to the common codepath that casts to long.
12734
12735         * cs-tokenizer.cs: Use the same code pattern as the int case.
12736         Maybe I should do the parsing myself, and avoid depending on the
12737         Parse routines to get this done.
12738
12739 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12740
12741         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12742         which fixes bug 51347.  This time test it.
12743
12744         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12745         attributes for example can not tell the difference between these.
12746         The difference was only a syntax feature of the language. 
12747
12748         * attribute.cs: Apply attributes to delegates.
12749
12750         * delegate.cs: Call the apply attributes method.
12751
12752 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12753
12754         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12755         comparing 0 vs Byte.MinValue, not the value
12756
12757         (ImplicitConversionRequired): When reporting a conversion error,
12758         use error 31 to print out the constant error instead of the
12759         simpler 29.
12760
12761         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12762         which fixes bug 51347.
12763
12764 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12765
12766         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12767         which fixes the -warnaserror command line option.
12768
12769 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12770
12771         * cfold.cs (DoNumericPromotions): During constant folding of
12772         additions on UIntConstant, special case intconstants with
12773         IntConstants like we do on the expression binary operator. 
12774
12775 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12776
12777         * convert.cs (ImplicitReferenceConversion): We were missing a case
12778         (System.Enum are not value types or class types, so we need to
12779         classify them separatedly).
12780
12781         * driver.cs: We do not support error 2007.
12782
12783 2003-11-12 Jackson Harper <jackson@ximian.com>
12784
12785         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12786         system directory. Also use the full file name so users can
12787         libraries names mscorlib-o-tron.dll in a non system dir.
12788         
12789 2004-01-04  David Sheldon <dave-mono@earth.li>
12790
12791         * expression.cs: Added matching ")" to error message for CS0077.
12792
12793 2003-12-19  Martin Baulig  <martin@ximian.com>
12794
12795         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12796         static method; see documentation in the method.
12797         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12798
12799         * convert.cs (Convert.ImplicitReferenceConversion,
12800         Convert.ImplicitReferenceConversionExists): Add support for
12801         generic type declarations; see gen-36.cs.
12802
12803 2003-12-19  Martin Baulig  <martin@ximian.com>
12804
12805         * pending.cs (Pending.InterfaceMethod): Use
12806         `Type.IsAssignableFrom()' instead of `=='.
12807
12808 2003-12-18  Martin Baulig  <martin@ximian.com>
12809
12810         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12811         byref types first.
12812
12813         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12814         `expr_type.Equals (target_type)' instead of `=='.
12815
12816 2003-12-08  Martin Baulig  <martin@ximian.com>
12817
12818         * generics.cs (Constraints.Types): Removed.
12819         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12820         to Type's.
12821         (Constraints.ResolveTypes): New public method; resolves the
12822         TypeExpr's to Type's.
12823         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12824         longer takes the constraints.
12825         (TypeParameter.DefineMethod): Likewise.
12826         (TypeParameter.DefineType): New public method.  Calls
12827         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12828         the constraints.
12829
12830 2003-12-08  Martin Baulig  <martin@ximian.com>
12831
12832         * convert.cs (Convert.ImplicitConversionStandard): Use
12833         `expr_type.Equals (target_type)' instead of `=='.
12834
12835 2003-12-08  Martin Baulig  <martin@ximian.com>
12836
12837         * typemanager.cs (TypeManager.GetReferenceType): Call
12838         `Type.MakeByRefType ()'.
12839
12840 2003-12-08  Martin Baulig  <martin@ximian.com>
12841
12842         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12843         just has some special meaning in some situations.  For instance,
12844         it is allowed to use `where' as the name of a variable etc.
12845
12846 2003-12-04  Martin Baulig  <martin@ximian.com>
12847
12848         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12849         `Type.MakeArrayType()' for array types.
12850
12851 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12852
12853         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12854         debugging message.
12855
12856         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12857         corlib to compile.
12858
12859 2003-11-16  Martin Baulig  <martin@ximian.com>
12860
12861         * codegen.cs (EmitContext.IsGeneric): Removed.
12862
12863         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12864         ResolveGeneric() on the DeclSpace.
12865
12866 2003-11-16  Martin Baulig  <martin@ximian.com>
12867
12868         * generic.cs (TypeArguments.Resolve):
12869         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12870         `ResolveType()' on it to get the Type.
12871
12872 2003-11-15  Martin Baulig  <martin@ximian.com>
12873
12874         * generic.cs (ConstructedType.GetInterfaces): Override this.
12875
12876 2003-11-14  Martin Baulig  <martin@ximian.com>
12877
12878         * interface.cs (Interface.DefineType): Define all type parameters
12879         before adding the interfaces we inherit.
12880
12881 2003-11-11  Martin Baulig  <martin@ximian.com>
12882
12883         * generic.cs (ConstructedType.ResolveType): Always call
12884         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12885
12886 2003-11-10  Martin Baulig  <martin@ximian.com>
12887
12888         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12889         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12890         calling `ResolveType()' on them, directly assign their `Type'.
12891
12892 2003-11-08  Martin Baulig  <martin@ximian.com>
12893
12894         * generic.cs (ConstructedType): Override `IsClass' etc.
12895
12896 2003-11-08  Martin Baulig  <martin@ximian.com>
12897
12898         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12899         return value and the `out parent' parameter.
12900         (TypeContainer.DefineType): Moved the CS0644 check into
12901         GetClassBases().  Don't pass the interface types to the
12902         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12903         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12904
12905         * ecore.cs (TypeExpr.IsAttribute): New property.
12906         (TypeExpr.GetInterfaces): New method.
12907
12908         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12909         TypeExpr instead of a Type.
12910         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12911         (Interface.DefineType): Don't pass the interface types to the
12912         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12913         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12914
12915         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12916         instead of a `Type[]'.
12917         (TypeManager.RegisterBuilder): Likewise.
12918         (TypeManager.AddUserInterface): Likewise.
12919         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12920         `Type[]' and also return a `TypeExpr[]'.
12921         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12922
12923 2003-11-08  Martin Baulig  <martin@ximian.com>
12924
12925         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12926         Expression.     
12927
12928 2003-11-08  Martin Baulig  <martin@ximian.com>
12929
12930         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12931         TypeManager.ResolveExpressionTypes().
12932
12933         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12934         instead of an Expression.
12935         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12936         (TypeExpression): New public class; formerly known as `TypeExpr'.
12937
12938         * expression.cs (ComposedCast): Derive from TypeExpr.
12939
12940         * typemanager.cs (TypeManager.system_*_expr): These are now
12941         TypExpr's instead of Expression's.
12942         (TypeManager.ResolveExpressionTypes): New public static function;
12943         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12944         of them.        
12945
12946 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12947
12948         * expression.cs (New.DoResolve): Do not dereference value that
12949         might be a null return.
12950
12951         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12952         sure that the constant value has the right type.  Fixes an
12953         unreported bug, similar to 50425.
12954
12955         * const.cs (Const.LookupConstantValue): Call
12956         ImplicitStandardConversionExists before doing a conversion to
12957         avoid havng the TypeManager.ChangeType do conversions.
12958
12959         Reduced the number of casts used
12960
12961         (Const.ChangeType): New routine to enable reuse of the constant
12962         type changing code from statement.
12963
12964         * typemanager.cs (ChangeType): Move common initialization to
12965         static global variables.
12966
12967         Fixes #50425.
12968
12969         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12970         every value type to go through, even if it was void.  Fix that. 
12971
12972         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12973         character of the define, and the is_identifier_part_character for
12974         the rest of the string.
12975
12976 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12977
12978         * expression.cs (UnaryMutator.EmitCode): When I updated
12979         LocalVariableReference.DoResolve, I overdid it, and dropped an
12980         optimization done on local variable references.
12981
12982 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12983
12984         * ecore.cs: Convert the return from Ldlen into an int.
12985
12986 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12987
12988         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12989         the accessibility, this is a special case for toplevel non-public
12990         classes (internal for instance).
12991
12992 2003-10-20  Nick Drochak <ndrochak@gol.com>
12993
12994         * ecore.cs: Fix typo and build.  Needed another right paren.
12995
12996 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12997
12998         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12999         `internal' case regular and protected, but not allowing protected
13000         to be evaluated later.  Bug 49840
13001
13002 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13003
13004         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13005         to kb.Nlast, and not the kb.nFirst to isolate the switch
13006         statement.
13007
13008         Extract the underlying type, so enumerations of long/ulong are
13009         treated like long/ulong.
13010
13011 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13012
13013         * expression.cs (New): Overload the meaning of RequestedType to
13014         track the possible creation of the NewDelegate type, since
13015         DoResolve is invoked more than once for new constructors on field
13016         initialization.
13017
13018         See bugs: #48800 and #37014
13019
13020         * cs-parser.jay (declare_local_constants): Take an arraylist
13021         instead of a single constant.
13022
13023         (local_constant_declaration): It should take a
13024         constant_declarators, not a constant_declarator.  Fixes 49487
13025
13026         * convert.cs: Fix error report.
13027
13028 2003-10-13 Jackson Harper <jackson@ximian.com>
13029
13030         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13031         bug #49611
13032         
13033 2003-11-03  Martin Baulig  <martin@ximian.com>
13034
13035         * expression.cs (ArrayAccess.GetStoreOpcode): Added
13036         `out bool has_type_arg'; if set, we need to pass the type to
13037         ig.Emit().
13038         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13039         Stelem_Any/Ldelem_Any for generic parameters.   
13040
13041 2003-11-02  Martin Baulig  <martin@ximian.com>
13042
13043         * expression.cs (Invocation.EmitCall): Use
13044         `TypeManager.IsValueType()' to check whether it's a value type.
13045         Don't set `struct_call' when calling a method on a type parameter.
13046
13047 2003-11-02  Martin Baulig  <martin@ximian.com>
13048
13049         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13050         and removed the TypeBuilder argument.
13051
13052         * typemanager.cs (TypeManager.IsValueType): Return
13053         `t.IsGenericParameter || t.IsValueType'.
13054
13055 2003-10-25  Martin Baulig  <martin@ximian.com>
13056
13057         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13058         call ConstructedType.Resolve() on it.
13059
13060         * generic.cs (ConstructedType.Resolve): Set `type' on success.
13061
13062 2003-10-25  Martin Baulig  <martin@ximian.com>
13063
13064         * class.cs (TypeContainer.GetClassBases): Changed
13065         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
13066         CS8214 reporting here.
13067         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13068         instead of a `Type' for our parent.  In case of a recursive
13069         declaration (see tests/gen-23.cs for an example), our parent is a
13070         ConstructedType and it doesn't have its type set.  So, first
13071         create our own TypeBuilder, then call constructed.Resolve() to get
13072         the parent's type and finally TypeBuilder.SetParent() it.
13073
13074         * ecore.cs (TypeExpr.Name): New public virtual property.
13075
13076         * generic.cs
13077         (ConstructedType): We're now a TypeExpr and not just an Expression.
13078         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13079         arguments here; this is done later.
13080         (ConstructedType.Resolve): New public method to resolve the type
13081         arguments and bind them.
13082
13083 2003-10-21  Martin Baulig  <martin@ximian.com>
13084
13085         * convert.cs: Use `TypeManager.IsValueType' instead of
13086         'type.IsValueType' everywhere.
13087
13088         * typemanager.cs (TypeManager.IsValueType): Return true for type
13089         parameters.  The reason for this is that we need to box a type
13090         parameter when converting it to a reference type.
13091
13092         * cs-parser.jay: Added support for default value expressions.
13093
13094         * generics.cs (DefaultValueExpression): New public class.       
13095
13096 2003-10-17  Martin Baulig  <martin@ximian.com>
13097
13098         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13099         TypeContainer so we can also use this for Interfaces.
13100         (TypeParameter.Resolve): Likewise.
13101
13102         * interface.cs (Interface.DefineType): Added support for generic
13103         interfaces.
13104
13105         * cs-parser.jay: Added support for generic structs and interfaces.
13106
13107 2003-10-17  Martin Baulig  <martin@ximian.com>
13108
13109         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13110         call generic methods :-)
13111
13112 2003-10-16  Martin Baulig  <martin@ximian.com>
13113
13114         * cs-parser.jay (namespace_or_type_name): Only create a
13115         GenericMemberAccess if we actually have type arguments.
13116
13117 2003-10-13  Martin Baulig  <martin@ximian.com>
13118
13119         * class.cs (Method.Define): If we're a generic method, call
13120         TypeBuilder.DefineGenericMethod () before resolving
13121         the parameters.
13122         (MethodData): Added .ctor which takes an additional MethodBuilder
13123         argument; this is used for generic methods.
13124         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13125         we already have a MethodBuilder.
13126
13127 2003-10-10  Martin Baulig  <martin@ximian.com>
13128
13129         * class.cs (Method): Added .ctor which takes a `GenericMethod'
13130         instead of a `DeclSpace'.  This is used for generic methods.
13131
13132         * cs-parser.jay (method_header): Added support for generic
13133         methods; create a `GenericMethod' instance and pass it to the
13134         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13135         parameters and locals.
13136
13137         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13138         since we already have the location.  Check whether we're a generic
13139         type declaration or a generic method and create the correct type
13140         parameter.
13141
13142         * generic.cs (TypeParameter.DefineMethod): New public method.
13143         (GenericMethod): New public class; derives from DeclSpace and is
13144         used for generic methods.       
13145
13146 2003-10-09  Martin Baulig  <martin@ximian.com>
13147
13148         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13149         to the .ctor.
13150         (MethodCore.DoDefineParameters): Removed the TypeContainer
13151         argument; use the DeclSpace which was passed to the .ctor instead.
13152         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13153         TypeContainer; we only need a DeclSpace here.
13154
13155 2003-10-09  Martin Baulig  <martin@ximian.com>
13156
13157         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13158         to the .ctor.
13159         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13160         EmitContext's .ctor.    
13161
13162 2003-10-09  Martin Baulig  <martin@ximian.com>
13163
13164         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13165         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13166         AsAccessible(), moved them as well.
13167
13168         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13169
13170 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13171
13172         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13173         generation for >=, as spotted by Paolo, bug 48679.  
13174         Patch from David Waite.
13175
13176         * cs-tokenizer.cs: Add handling for #pragma.
13177
13178         * cs-parser.jay: Allow for both yield and yield return in the
13179         syntax.  The anti-cobolization of C# fight will go on!
13180
13181         * class.cs (TypeBuilder.DefineType): Catch error condition here
13182         (Parent.DefineType erroring out and returning null).
13183
13184         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13185         coping with enumerations variables, we were mistakenly processing
13186         them as a regular value type instead of built-in types.  Fixes the
13187         bug #48063
13188
13189         * typemanager.cs (IsBuiltinOrEnum): New method.
13190
13191 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13192
13193         * cs-parser.jay: Upgrade: yield now needs the return clause.
13194
13195 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13196
13197         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13198
13199 2003-09-29  Martin Baulig  <martin@ximian.com>
13200
13201         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13202         inflated generic methods.
13203
13204         * generics.cs (ConstructedType): Distinguish between open and
13205         closed constructed types; correctly resolve the arguments.
13206
13207 2003-09-22  Martin Baulig  <martin@ximian.com>
13208
13209         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13210         all type arguments meet their constraints.
13211
13212 2003-09-19  Martin Baulig  <martin@ximian.com>
13213
13214         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13215         `MemberCache parent' argument.  Normally, an interface doesn't
13216         have a parent type except System.Object, but we use this in gmcs
13217         for generic type parameters.
13218
13219 2003-09-18  Martin Baulig  <martin@ximian.com>
13220
13221         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13222         on `type.IsInterface'; don't check whether the type has a parent
13223         to determine whether it's an interface.
13224
13225 2003-09-17  Martin Baulig  <martin@ximian.com>
13226
13227         * generic.cs (ConstructedType.ToString): Always use `name' as the
13228         type name.
13229
13230 2003-09-15  Martin Baulig  <martin@ximian.com>
13231
13232         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13233
13234         * generic.cs (Constraints.Resolve): New public method; this is
13235         called to resolve the constraint types and to check whether all
13236         the constraints are correct.
13237         (Constraints.Types): New public property.
13238         (TypeParameter.Resolve): New public method; resolves all the
13239         type's constraints.
13240
13241         * class.cs (TypeContainer.DefineType): Call
13242         TypeParameter.Resolve() before actually defining the type.
13243
13244 2003-09-15  Martin Baulig  <martin@ximian.com>
13245
13246         * class.cs (TypeContainer.DefineType): Added an error flag to
13247         avoid reporting duplicate CS0146's ("class definition is
13248         circular.").
13249
13250         * driver.cs (Driver.MainDriver): Abort if
13251         RootContext.ResolveTree() reported any errors.
13252
13253 2003-09-07  Martin Baulig  <martin@ximian.com>
13254
13255         * report.cs (Error, Warning): Added overloaded versions which take
13256         a `params object[] args' and call String.Format().
13257
13258 2003-09-07  Martin Baulig  <martin@ximian.com>
13259
13260         * decl.cs (DeclSpace..ctor): Don't call
13261         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13262         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13263         (DeclSpace.RecordDecl): New method.
13264
13265         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13266
13267 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13268
13269         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13270         value attributes to be applied to ParameterBuilders.
13271
13272         * class.cs (MethodCore.LabelParameters): Make static and more
13273         generic so that it can be used from other places - like interface
13274         methods, for instance.
13275
13276         * interface.cs (Interface.Emit): Call LabelParameters before
13277         emitting attributes on the InterfaceMethod.
13278
13279 2003-09-07  Martin Baulig  <martin@ximian.com>
13280
13281         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13282         if the number of type parameters doesn't match.
13283
13284 2003-09-04  Martin Baulig  <martin@ximian.com>
13285
13286         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13287         for arrays of generic type params (ie. `!0[]').
13288
13289 2003-09-04  Martin Baulig  <martin@ximian.com>
13290
13291         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13292         for the moment.
13293
13294 2003-09-04  Martin Baulig  <martin@ximian.com>
13295
13296         * decl.cs (DeclSpace.LookupGeneric): New method.
13297         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13298         moment.
13299
13300         * generic.cs (TypeParameterExpr): Take a TypeParameter as
13301         argument, not just a string.
13302         (TypeParameter.Define): New public method; this is called to
13303         actually define the generic parameter; after this, you can use the
13304         new `Type' property to get the type.
13305
13306 2003-09-04  Martin Baulig  <martin@ximian.com>
13307
13308         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13309         is now an ArrayList; initialize the result of the `TypeParameters'
13310         property here.
13311         (DeclSpace.GetGenericData): Removed.
13312         (DeclSpace.LookupGeneric): Temporarily removed; we need to
13313         implement this in a different way.
13314         (DeclSpace.GetTypeParameters): Removed; there's now a
13315         `TypeParameters' property.
13316         (DeclSpace.TypeParameters): New public property.
13317
13318         * generic.cs (Constraints): Make this class public.
13319         (TypeParameter): New public class.
13320
13321 2003-09-04  Martin Baulig  <martin@ximian.com>
13322
13323         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13324         generic parameters.
13325
13326         * class.cs (TypeContainer.DefineType): Call
13327         TypeBuilder.DefineGenericParameter () on all generic parameters if
13328         this is a generic type.
13329
13330 2003-08-28  Martin Baulig  <martin@ximian.com>
13331
13332         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13333         sample-stack.il".
13334
13335         * sample-hello.cs: Compile this with gmcs: "gmcs
13336         /r:sample-stack.dll sample-hello.cs".
13337
13338 2003-08-28  Martin Baulig  <martin@ximian.com>
13339
13340         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13341         the parameters to the generic type.
13342
13343 2003-08-28  Martin Baulig  <martin@ximian.com>
13344
13345         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13346
13347 2003-08-28  Martin Baulig  <martin@ximian.com>
13348
13349         * cs-parser.jay (opt_type_argument_list): Use
13350         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13351         (primary_expression): Replace `qualified_identifier' with `type_name'.
13352         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13353
13354         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13355         parser to check whether it is syntactically a type parameter list;
13356         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13357         this case.
13358
13359 2003-08-26  Martin Baulig  <martin@ximian.com>
13360
13361         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13362         resolving aliases; fixes #47927.
13363
13364 2003-08-26  Martin Baulig  <martin@ximian.com>
13365
13366         * statement.cs (Using.DoResolve): This is internally emitting a
13367         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13368         do not always return.  Fixes #47681.
13369
13370 2003-08-26  Martin Baulig  <martin@ximian.com>
13371
13372         * decl.cs (MemberCore): Moved WarningNotHiding(),
13373         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13374         into MemberBase.
13375         (AdditionResult): Make this nested in DeclSpace.
13376         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13377         argument; call NamespaceEntry.Define() unless we're nested in a
13378         class or struct.
13379
13380         * namespace.cs (Namespace.DefineName): New public function.  This
13381         is called from DeclSpace's .ctor to add 
13382         (Namespace.Lookup): Include DeclSpaces in the lookup.
13383
13384         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13385
13386         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13387
13388 2003-08-25  Martin Baulig  <martin@ximian.com>
13389
13390         * convert.cs (Convert.ExplicitReferenceConversion): When
13391         converting from an interface type to a class, unbox if the target
13392         type is a struct type.  Fixes #47822.
13393
13394 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13395
13396         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13397         #47854.
13398
13399 2003-08-22  Martin Baulig  <martin@ximian.com>
13400
13401         * class.cs (TypeManager.DefineType): When defining a nested type,
13402         call DefineType() on our parent; fixes #47801.
13403
13404 2003-08-22  Martin Baulig  <martin@ximian.com>
13405
13406         * class.cs (MethodData.Define): While checking if a method is an
13407         interface implementation, improve the test a bit more to fix #47654.
13408
13409 2003-08-22  Martin Baulig  <martin@ximian.com>
13410
13411         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13412         correctly; fixes #47722.
13413
13414 2003-08-22  Martin Baulig  <martin@ximian.com>
13415
13416         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13417         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13418
13419         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13420
13421 2003-08-22  Martin Baulig  <martin@ximian.com>
13422
13423         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13424         can only be assigned in static constructors.  Fixes #47161.
13425
13426 2003-08-22  Martin Baulig  <martin@ximian.com>
13427
13428         Rewrote and improved the flow analysis code.
13429
13430         * flowbranching.cs (FlowBranching): Make this class abstract.
13431         (FlowBranching.CreateBranching): New static function to create a
13432         new flow branching.
13433         (FlowBranchingBlock, FlowBranchingException): New classes.
13434         (FlowBranching.UsageVector.Type): New public readonly field.
13435         (FlowBranching.UsageVector.Breaks): Removed the setter.
13436         (FlowBranching.UsageVector.Returns): Removed the setter.
13437         (FlowBranching.UsageVector): Added Break(), Return(),
13438         NeverReachable() and Throw() methods to modify the reachability.
13439         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13440         done by FlowBranching.Merge().
13441         (FlowBranching.UsageVector.MergeChild): New method; merges the
13442         merge result into the current vector.
13443         (FlowBranching.Merge): New abstract method to merge a branching.
13444
13445 2003-08-12  Martin Baulig  <martin@ximian.com>
13446
13447         * expression.cs (Indirection.CacheTemporaries): Create the
13448         LocalTemporary with the pointer type, not its element type.
13449
13450 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13451
13452         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13453         token was a keyword or not.
13454
13455         Add `error' options where an IDENTIFIER was expected;  Provide
13456         CheckToken and CheckIdentifierToken convenience error reporting
13457         functions. 
13458
13459         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13460
13461         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13462         NameSpaceEntry NameSpaceEntry.
13463
13464         (LookupInterfaceOrClass): Avoid creating a full qualified name
13465         from namespace and name: avoid doing lookups when we know the
13466         namespace is non-existant.   Use new Tree.LookupByNamespace which
13467         looks up DeclSpaces based on their namespace, name pair.
13468
13469         * driver.cs: Provide a new `parser verbose' to display the
13470         exception thrown during parsing.  This is turned off by default
13471         now, so the output of a failure from mcs is more graceful.
13472
13473         * namespace.cs: Track all the namespaces defined in a hashtable
13474         for quick lookup.
13475
13476         (IsNamespace): New method
13477
13478 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13479
13480         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13481         we know that we need to concatenate (full typename can never be
13482         null). 
13483
13484         * class.cs: ditto.
13485
13486         * statement.cs: Use a bitfield;  Do not initialize to null things
13487         which are done by the constructor by default.
13488
13489         * cs-parser.jay: bug fix, parameter was 4, not 3.
13490
13491         * expression.cs: Just use the property;
13492
13493         * statement.cs: No need for GetVariableInfo method.
13494
13495 2003-08-08  Martin Baulig  <martin@ximian.com>
13496
13497         * flowanalysis.cs (FlowReturns): This is now nested in the
13498         `FlowBranching' class.
13499         (MyBitVector): Moved this here from statement.cs.
13500         (FlowBranching.SiblingType): New enum type.
13501         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13502
13503 2003-08-07  Martin Baulig  <martin@ximian.com>
13504
13505         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13506         `FlowBranching' class and called `BranchingType'.
13507
13508 2003-08-07  Martin Baulig  <martin@ximian.com>
13509
13510         * flowanalysis.cs: Moved all the control flow analysis code into
13511         its own file.
13512
13513 2003-08-07  Martin Baulig  <martin@ximian.com>
13514
13515         * assign.cs (Assign.DoResolve): `target' must either be an
13516         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13517         #37319.
13518
13519 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13520
13521         * expression.cs (BinaryMethod): This kind of expression is created by the
13522         Binary class if it determines that the operator has to be handled
13523         by a method.
13524
13525         (BinaryDelegate): This kind of expression is created if we are
13526         dealing with a + or - operator on delegates.
13527
13528         (Binary): remove method, argumetns, and DelegateOperator: when
13529         dealing with methods, 
13530
13531         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13532
13533         * statement.cs (Block): use bitfields for the three extra booleans
13534         we had in use.   Remove unused topblock parameter.
13535
13536         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13537
13538         * assign.cs: Drop extra unneeded tests.
13539
13540 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13541
13542         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13543
13544         * statement.cs (Foreach): Use VariableStorage instead of
13545         LocalBuilders.   
13546
13547         * codegen.cs (VariableStorage): New class used by clients that
13548         require a variable stored: locals or fields for variables that
13549         need to live across yield.
13550
13551         Maybe provide a convenience api for EmitThis+EmitLoad?
13552
13553         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13554         these bad boys.
13555
13556 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13557
13558         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13559         RemapParameterLValue): New methods that are used to turn a
13560         precomputed FieldInfo into an expression like this:
13561
13562                 instance.FieldInfo
13563
13564         The idea is to use this instead of making LocalVariableReference
13565         have more than one meaning.
13566
13567         * cs-parser.jay: Add error production to BASE.
13568
13569         * ecore.cs: Deal with TypeManager.GetField returning null, which
13570         is now a valid return value.
13571
13572         (FieldExprNoAddress): New expression for Fields whose address can
13573         not be taken.
13574
13575         * expression.cs (LocalVariableReference): During the resolve
13576         phases, create new expressions if we are in a remapping context.
13577         Remove code that dealt with remapping here.
13578
13579         (ParameterReference): same.
13580
13581         (ProxyInstance): New expression, like the `This' expression, but
13582         it is born fully resolved.  We know what we are doing, so remove
13583         the errors that are targeted to user-provided uses of `this'.
13584
13585         * statement.cs (Foreach): our variable is now stored as an
13586         Expression;  During resolution, follow the protocol, dont just
13587         assume it will return this.
13588
13589 2003-08-06  Martin Baulig  <martin@ximian.com>
13590
13591         * support.cs (SeekableStreamReader.cs): New public class.
13592
13593         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13594         SeekableStreamReader instead of the normal StreamReader.
13595
13596 2003-08-04  Martin Baulig  <martin@ximian.com>
13597
13598         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13599         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13600         deambiguate casts and delegate invocations.
13601         (parenthesized_expression): Use the new tokens to ensure this is
13602         not a cast of method invocation.
13603
13604         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13605         when reading a `)' and Deambiguate_CloseParens () was previously
13606         called.
13607
13608         * expression.cs (ParenthesizedExpression): New class.  This is
13609         just used for the CS0075 test.
13610         (Binary.DoResolve): Check for CS0075.   
13611
13612 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13613
13614         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13615         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13616         reference comparison.
13617
13618         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13619         examine the ReturnType for equality - this is necessary in the
13620         cases of implicit and explicit operators whose signature also
13621         includes the return type.
13622
13623 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13624
13625         * namespace.cs: Cache the result of the namespace computation,
13626         instead of computing it every time.
13627
13628 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13629
13630         * decl.cs: Use a global arraylist that we reuse over invocations
13631         to avoid excesive memory consumption.  Reduces memory usage on an
13632         mcs compile by one meg (45 average).
13633
13634         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13635         private, work around that.
13636
13637 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13638
13639         * literal.cs (IntLiteral): Define Zero and One static literals. 
13640
13641         * cs-parser.jay (integer_literal): use static literals to reduce
13642         memory usage for the most used literals (0, 1 and -1).  211kb
13643         reduced in memory usage.
13644
13645         Replace all calls to `new ArrayList' with `new
13646         ArrayList(4)' which is a good average number for most allocations,
13647         and also requires only 16 bytes of memory for its buffer by
13648         default. 
13649
13650         This reduced MCS memory usage in seven megabytes for the RSS after
13651         bootstrapping.
13652
13653 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13654
13655         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13656         handle params methods the correct way by forming only one
13657         applicable set with params and normal methods in them. Earlier we
13658         were looking at params methods only if we found no normal methods
13659         which was not the correct thing to do.
13660
13661         (Invocation.BetterFunction): Take separate arguments indicating
13662         when candidate and the best method are params methods in their
13663         expanded form.
13664
13665         This fixes bugs #43367 and #46199.
13666
13667         * attribute.cs: Documentation updates.
13668
13669         (CheckAttribute): Rename to CheckAttributeTarget.
13670         (GetValidPlaces): Rename to GetValidTargets.
13671
13672         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13673         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13674
13675         Fixes bug #44468.
13676
13677 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * codegen.cs: Compute IsGeneric correctly.
13680
13681         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13682         resolution. 
13683
13684         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13685         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13686         regressions, and I was chasing more bugs than I required.
13687
13688         * interface.cs: Use expressions for base type names (like classes
13689         and structs have been doing for a while now), and resolve that.
13690         This patch should probably go into head as well.
13691
13692         This makes it one less user of FindType.
13693
13694 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13695
13696         This compiler can not self host currently.  Need to fix that.
13697         
13698         * Makefile: compile to `gmcs.exe'
13699
13700         * driver.cs: Turn on v2 by default on gmcs.
13701
13702         * generic.cs (ConstructedType): Does no longer take a container
13703         type argument;  That will be taken care of later.
13704
13705         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13706         Use SimpleName to resolve for now, so we can continue the work on
13707         the parser, until we get Type.GetType that understands generics.
13708
13709         (ConstructedType.ToString): Implement
13710
13711         (TypeArguments.Resolve): Resolve the child expressions as types. 
13712         
13713         * cs-parser.jay: Rename interface_constraints to
13714         type_parameter_constraints
13715
13716         (namespace_or_type_name): Only use constructed types for the basic
13717         construction, we will deal with identifier<...> later.
13718
13719         (type/type_name): No longer call DecomposeQI, as
13720         namespace_or_type_name is always decoded now.
13721         
13722 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13723
13724         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13725         closely: we eliminate methods in base types when we have an
13726         applicable method in a top-level type.
13727
13728         Please see section 14.5.5.1 for an exact description of what goes
13729         on. 
13730
13731         This fixes bug #45127 and a host of other related to corlib compilation.
13732
13733         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13734         array is the method corresponding to the top-level type (this is
13735         because of the changes made to icall.c) so we change this
13736         accordingly.
13737
13738         (MethodGroupExpr.Name): This too.
13739
13740         * typemanager.cs (GetElementType): New method which does the right
13741         thing when compiling corlib. 
13742
13743         * everywhere: Make use of the above in the relevant places.
13744
13745 2003-07-22  Martin Baulig  <martin@ximian.com>
13746
13747         * cs-parser.jay (invocation_expression): Moved
13748         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13749         `cast_expression', but create a InvocationOrCast which later
13750         resolves to either an Invocation or a Cast.
13751
13752         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13753         method; call this before EmitStatement() to make sure that this
13754         expression can be used as a statement.
13755
13756         * expression.cs (InvocationOrCast): New class; resolves to either
13757         an Invocation or a Cast.
13758
13759         * statement.cs (StatementExpression): Call ResolveStatement() on
13760         the ExpressionStatement before emitting it.
13761
13762 2003-07-21  Martin Baulig  <martin@ximian.com>
13763
13764         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13765         `ref' and `out' attributes match; fixes #46220.
13766         (MemberAccess.ResolveMemberAccess): You can't reference a type
13767         through an expression; fixes #33180.
13768         (Indexers.GetIndexersForType): Don't return the indexers from
13769         interfaces the class implements; fixes #46502.
13770
13771 2003-07-21  Martin Baulig  <martin@ximian.com>
13772
13773         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13774         CS0661 checks; fixes bug #30442.
13775
13776 2003-07-21  Martin Baulig  <martin@ximian.com>
13777
13778         * decl.cs (AdditionResult): Added `Error'.
13779
13780         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13781
13782         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13783         cs0031.cs actually work.
13784
13785  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13786  
13787         * cs-parser.jay (namespace_name): do not use
13788         namespace_or_type_name, use qualified_identifier, because
13789         namespace_or_type_name will soon return a composed expression
13790         instead of a string.
13791  
13792         (namespace_or_type_name): Instead of returning a string, now this
13793         production returns an expression.
13794  
13795         * codegen.cs (EmitContext): Setup IsGeneric property based on
13796         whether our DeclSpace is generic, our the method is generic.
13797  
13798         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13799         the method is generic.
13800  
13801         * cs-parser.jay (type_arguments, opt_type_argument_list,
13802         type_parameters, type_parameter_list, opt_type_parameter_list,
13803         type_parameter,, opt_type_parameter_constraints_clauses,
13804         type_parameter_constraints_clauses,
13805         type_parameter_constraint_clause, type_parameter_constraint,
13806         interface_constraints): Add new production
13807  
13808         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13809         DeclSpace is generic or not.
13810  
13811         (DeclSpace.SetParameterInfo): New routine, used to set the
13812         parameter info for a type.
13813  
13814         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13815         returns a GenericTypeExpr
13816  
13817         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13818         generic, lookup the generic argument.
13819  
13820         * attribute.cs: Do not allow TypeParameterExpressions in
13821         Attributes.
13822  
13823         * class.cs: Do not allow the Main method to be defined in a
13824         Generic container.
13825  
13826         * expression.cs (SizeOf): Do not allow generic types to be used as
13827         arguments to sizeof.
13828  
13829         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13830         it: whether a type is generic or not.  Only works for types we are
13831         currently building for now.
13832         
13833 2003-07-20  Martin Baulig  <martin@ximian.com>
13834
13835         * namespace.cs: Fixed that bug which caused a crash when compiling
13836         the debugger's GUI.
13837
13838 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13839
13840         * typemanager.cs (LookupTypeReflection): Never expose types which
13841         are NotPublic, NestedPrivate, NestedAssembly, or
13842         NestedFamANDAssem.  We used to return these, and later do a check
13843         that would report a meaningful error, but the problem is that we
13844         would not get the real match, if there was a name override.
13845
13846 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13847
13848         * namespace.cs (Namespace, Name): Do not compute the namespace
13849         name dynamically, compute it in the constructor.  This reduced
13850         memory usage by 1697 KB.
13851
13852         * driver.cs: Use --pause to pause at the end.
13853
13854 2003-07-17  Peter Williams  <peter@newton.cx>
13855
13856         * Makefile: Change the name of the test target so that it doesn't
13857         conflict with the recursive test target.
13858
13859 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13860
13861         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13862         AddressOf): Do not use EmitThis, that was wrong, use the actual
13863         this pointer.
13864
13865 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13866
13867         * class.cs (MethodData.Define): While checking if a method is an
13868         interface implementation, improve the test: If we are not public
13869         (use new test here: use the computed MethodAttributes directly,
13870         instead of the parsed modifier flags) check if the `implementing'
13871         method comes from an interface or not.
13872
13873         * pending.cs (VerifyPendingMethods): Slightly better error
13874         message.
13875
13876         * makefile: add test target that does the mcs bootstrap.
13877
13878 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13879
13880         * interface.cs (Define): Do nothing here since there are no
13881         members to populate etc. Move the attribute emission out of here
13882         since this was just totally the wrong place to put it. Attribute
13883         application happens during the 'Emit' phase, not in the 'Define'
13884         phase.
13885
13886         (Emit): Add this method and move the attribute emission here
13887
13888         * rootcontext.cs (EmitCode): Call the Emit method on interface
13889         types too.
13890
13891 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13892
13893         * expression.cs (OverloadResolve): Report error only if Location
13894         is not 'Null' which means that there was a probe going on.
13895
13896 2003-07-14  Martin Baulig  <martin@ximian.com>
13897
13898         * expression.cs (ConditionalLogicalOperator): New public class to
13899         implement user defined conditional logical operators.
13900         This is section 14.11.2 in the spec and bug #40505.
13901
13902 2003-07-14  Martin Baulig  <martin@ximian.com>
13903
13904         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13905
13906 2003-07-14  Martin Baulig  <martin@ximian.com>
13907
13908         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13909
13910         * ecore.cs (IVariable.VerifyFixed): New interface method.
13911
13912         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13913         operator, check whether the variable is actually fixed.  Fixes bug
13914         #36055.  Set a variable definitely assigned when taking its
13915         address as required by the spec.
13916
13917         * statement.cs (LocalInfo.IsFixed): New field.
13918         (LocalInfo.MakePinned): Set `IsFixed' to true.
13919
13920 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13921
13922         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13923         for .ctors, ensure that we only ask for members declared in the
13924         attribute type (BindingFlags.DeclaredOnly).
13925
13926         Fixes bug #43632.
13927
13928         * expression.cs (Error_WrongNumArguments): Report error 1501
13929         correctly the way CSC does.
13930
13931 2003-07-13  Martin Baulig  <martin@ximian.com>
13932
13933         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13934         lookup on the fully qualified name, to make things like "X.X" work
13935         where "X.X" is a fully qualified type name, but we also have a
13936         namespace "X" in the using list.  Fixes #41975.
13937
13938 2003-07-13  Martin Baulig  <martin@ximian.com>
13939
13940         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13941         function. If we're a CompoundAssign, we need to create an embedded
13942         CompoundAssign, not an embedded Assign.
13943         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13944         Fixes #45854.
13945
13946 2003-07-13  Martin Baulig  <martin@ximian.com>
13947
13948         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13949         work to fix bug #46088.
13950
13951 2003-07-13  Ravi Pratap <ravi@ximian.com>
13952
13953         * class.cs (Operator.Emit): Do not emit attributes here - it is
13954         taken care of by the Method class that we delegate too. This takes
13955         care of bug #45876.
13956
13957 2003-07-10  Martin Baulig  <martin@ximian.com>
13958
13959         * expression.cs (TypeOfVoid): New class.
13960         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13961
13962 2003-07-10  Martin Baulig  <martin@ximian.com>
13963
13964         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13965         bug #35957.
13966
13967 2003-07-10  Martin Baulig  <martin@ximian.com>
13968
13969         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13970         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13971
13972         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13973
13974         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13975
13976 2003-07-10  Martin Baulig  <martin@ximian.com>
13977
13978         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13979         of decimal.  Fixes #42850.
13980
13981         NOTE: I also fixed the created byte blob, but this doesn't work on
13982         the MS runtime and csc never produces any byte blobs for decimal
13983         arrays.
13984
13985 2003-07-10  Martin Baulig  <martin@ximian.com>
13986
13987         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13988         structs; fixes #32068.
13989         (Block.AddChildVariableNames): Fixed #44302.
13990
13991 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13992
13993         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13994
13995 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13996
13997         * attribute.cs: And this test is onger needed.
13998
13999 2003-07-08  Martin Baulig  <martin@ximian.com>
14000
14001         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14002         inaccessible types.  Fixes #36313.
14003
14004         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14005
14006         * namespace.cs (NamespaceEntry): Create implicit entries for all
14007         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14008         implicit entries for N1.N2 and N1.
14009
14010 2003-07-08  Martin Baulig  <martin@ximian.com>
14011
14012         Rewrote the handling of namespaces to fix a lot of the issues
14013         wrt. `using' aliases etc.
14014
14015         * namespace.cs (Namespace): Splitted this class into a
14016         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14017
14018         * typemanager.cs (TypeManager.IsNamespace): Removed.
14019         (TypeManager.ComputeNamespaces): Only compute namespaces from
14020         loaded assemblies here, not the namespaces from the assembly we're
14021         currently compiling.
14022
14023 2003-07-08  Martin Baulig  <martin@ximian.com>
14024
14025         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14026
14027 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14028
14029         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14030         already fixed it.  
14031
14032         I thought about the memory savings here, but LookupTypeReflection
14033         is used under already very constrained scenarios.  Compiling
14034         corlib or mcs only exposes one hit, so it would not really reduce
14035         any memory consumption.
14036
14037 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14038
14039         * typemanager.cs: fixes bug #45889 by only adding public types from
14040         other assemblies to the list of known types.
14041
14042 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14043
14044         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14045         on the type we resolved.
14046
14047 2003-07-05  Martin Baulig  <martin@ximian.com>
14048
14049         * pending.cs (PendingImplementation.ParentImplements): Don't
14050         create the proxy if the parent is abstract.
14051
14052         * class.cs (TypeContainer.DefineIndexers): Process explicit
14053         interface implementations first.  Fixes #37714.
14054
14055 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14056
14057         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14058         defined recursively;  but since we modify the input parameters
14059         (left is set to `this' temporarily), we reset this value if the
14060         left_is_explicit is false, which gives the original semantics to
14061         the code.  
14062
14063         * literal.cs (NullPointer): new class used to represent a null
14064         literal in a pointer context.
14065
14066         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14067         type is a pointer, use a NullPointer object instead of a
14068         NullLiteral.   Closes 43687
14069
14070         (ExplicitConversion): Convert pointer values using
14071         the conv opcode to the proper type.
14072
14073         * ecore.cs (New): change ValueTypeVariable property into a method,
14074         that returns whether the valuetype is suitable for being used.
14075
14076         * expression.cs (Binary.DoNumericPromotions): Only return if we
14077         the int constant was a valid uint, and we can return both left and
14078         right as uints.  If not, we continue processing, to trigger the
14079         type conversion.  This fixes 39018.
14080
14081         * statement.cs (Block.EmitMeta): During constant resolution, set
14082         the CurrentBlock property on the emitcontext, so that we resolve
14083         constants propertly.
14084
14085 2003-07-02  Martin Baulig  <martin@ximian.com>
14086
14087         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14088         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14089
14090         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14091         than emitting it here.
14092
14093         * statement.cs: Fixed some more flow analysis bugs.
14094
14095 2003-07-02  Martin Baulig  <martin@ximian.com>
14096
14097         * class.cs (MethodData.Define): When implementing interface
14098         methods, set Final unless we're Virtual.
14099
14100         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14101         check work for interface methods.
14102
14103 2003-07-01  Martin Baulig  <martin@ximian.com>
14104
14105         * ecore.cs (EmitContext.This): Replaced this property with a
14106         GetThis() method which takes a Location argument.  This ensures
14107         that we get the correct error location for a CS0188.
14108
14109 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14110
14111         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14112         ImplicitStandardConversion.
14113
14114         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14115
14116 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14117
14118         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14119         optimization.
14120
14121 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14124         constructors.
14125
14126         (MethodData.Define): Turn off initlocals for unsafe methods.
14127
14128 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14129
14130         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14131         complete;  Fixes #37521.
14132
14133         * delegate.cs: Use Modifiers.TypeAttr to compute the
14134         TypeAttributes, instead of rolling our own.  This makes the flags
14135         correct for the delegates.
14136
14137 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14138
14139         * class.cs (Constructor.Define): Set the private flag for static
14140         constructors as well.
14141
14142         * cs-parser.jay (statement_expression): Set the return value to
14143         null, to avoid a crash when we catch an error.
14144
14145 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14146
14147         * cs-parser.jay: Applied patch from Jackson that adds support for
14148         extern and unsafe modifiers to destructor declarations.
14149
14150         * expression.cs: Report error 21 if the user is trying to index a
14151         System.Array.
14152
14153         * driver.cs: Add an error message, suggested by the bug report.
14154
14155         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14156         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14157
14158 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14159
14160         * namespace.cs: Add some information to reduce FAQs.
14161
14162 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14163
14164         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14165         underlying enumeration types.  Fixes #43915.
14166
14167         * expression.cs: Treat ushort/short as legal values to be used in
14168         bitwise operations.
14169
14170 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14171
14172         * delegate.cs: transfer custom attributes for paramenters from
14173         the delegate declaration to Invoke and BeginInvoke.
14174
14175 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14176
14177         * attribute.cs: handle custom marshalers and emit marshal info
14178         for fields, too.
14179
14180 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14181
14182         * makefile.gnu: Added anonymous.cs to the compiler sources.
14183
14184 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14185
14186         * iterators.cs: Change the name of the proxy class to include two
14187         underscores.
14188
14189         * cs-parser.jay: Update grammar to include anonymous methods.
14190
14191         * anonymous.cs: new file.
14192
14193 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14194
14195         * class.cs (Field.Define): Add missing test for pointers and
14196         safety. 
14197
14198 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14199
14200         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14201         we use the stobj opcode.
14202
14203         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14204         since it wasn't the correct fix. 
14205
14206         It still is puzzling that we are required to use stobj for IntPtr
14207         which seems to be a ValueType.
14208
14209 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14210
14211         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14212         during regular simple name resolution.   Now, the trick is that
14213         instead of returning for processing the simplename, we do a
14214         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14215         contextual lookup type).   If a match is found, return that, if
14216         not, return for further composition.
14217
14218         This fixes long-standing 30485.
14219
14220         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14221         using the address to initialize an object, do an Stobj instead of
14222         using the regular Stelem.
14223
14224         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14225         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14226         Because if we are a BaseIndexerAccess that value will be true.
14227         Fixes 43643.
14228
14229         * statement.cs (GotoCase.Resolve): Return after reporting an
14230         error, do not attempt to continue. 
14231
14232         * expression.cs (PointerArithmetic.Emit): If our operand is a
14233         long, convert our constants to match the operand before
14234         multiplying.  Convert to I type before adding.   Fixes 43670.
14235
14236 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14237
14238         * enum.cs (ImplicitConversionExists) : Rename to
14239         ImplicitEnumConversionExists to remove ambiguity. 
14240
14241         * ecore.cs (NullCast): New type of cast expression class which
14242         basically is very similar to EmptyCast with the difference being
14243         it still is a constant since it is used only to cast a null to
14244         something else
14245         (eg. (string) null)
14246
14247         * convert.cs (ImplicitReferenceConversion): When casting a null
14248         literal, we return a NullCast.
14249
14250         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14251         should be around anymore.
14252
14253         The renaming (reported was slightly wrong). Corrections:
14254
14255         ConvertImplicitStandard -> ImplicitConversionStandard
14256         ConvertExplicitStandard -> ExplicitConversionStandard
14257
14258         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14259         before passing them in !
14260
14261         * convert.cs (ImplicitConversionStandard): When comparing for
14262         equal expr and target types, ensure that expr is not a
14263         NullLiteral.
14264
14265         In general, we must not be checking (expr_type ==
14266         target_type) in the top level conversion methods
14267         (ImplicitConversion, ExplicitConversion etc). This checking is
14268         done in the methods that they delegate to.
14269
14270 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14271
14272         * convert.cs: Move Error_CannotConvertType,
14273         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14274         ImplicitNumericConversion, ImplicitConversionExists,
14275         ImplicitUserConversionExists, StandardConversionExists,
14276         FindMostEncompassedType, FindMostSpecificSource,
14277         FindMostSpecificTarget, ImplicitUserConversion,
14278         ExplicitUserConversion, GetConversionOperators,
14279         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14280         TryImplicitIntConversion, Error_CannotConvertImplicit,
14281         ConvertImplicitRequired, ConvertNumericExplicit,
14282         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14283         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14284         its own file.
14285
14286         Perform the following renames:
14287
14288         StandardConversionExists -> ImplicitStandardConversionExists
14289         ConvertImplicit -> ImplicitConversion
14290         ConvertImplicitStandard -> ImplicitStandardConversion
14291         TryImplicitIntConversion -> ImplicitIntConversion
14292         ConvertImplicitRequired -> ImplicitConversionRequired
14293         ConvertNumericExplicit -> ExplicitNumericConversion
14294         ConvertReferenceExplicit -> ExplicitReferenceConversion
14295         ConvertExplicit -> ExplicitConversion
14296         ConvertExplicitStandard -> ExplicitStandardConversion
14297
14298 2003-05-19  Martin Baulig  <martin@ximian.com>
14299
14300         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14301         (TypeInfo): Added support for structs having structs as fields.
14302
14303         * ecore.cs (FieldExpr): Implement IVariable.
14304         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14305         VariableInfo for the field.
14306
14307 2003-05-18  Martin Baulig  <martin@ximian.com>
14308
14309         * expression.cs (This.DoResolve): Report a CS0027 if we're
14310         emitting a field initializer.
14311
14312 2003-05-18  Martin Baulig  <martin@ximian.com>
14313
14314         * expression.cs (This.ResolveBase): New public function.
14315         (This.DoResolve): Check for CS0188.
14316
14317         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14318         This.Resolve().
14319
14320         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14321         `instance_expression' to null if we don't have any non-static
14322         methods.
14323
14324 2003-05-18  Martin Baulig  <martin@ximian.com>
14325
14326         Reworked the way how local variables and parameters are handled by
14327         the flow analysis code.
14328
14329         * statement.cs (TypeInfo, VariableMap): New public classes.
14330         (VariableInfo): New public class.  This is now responsible for
14331         checking whether a variable has been assigned.  It is used for
14332         parameters and local variables.
14333         (Block.EmitMeta): Take the InternalParameters as argument; compute
14334         the layout of the flow vectors here.
14335         (Block.LocalMap, Block.ParameterMap): New public properties.
14336         (FlowBranching): The .ctor doesn't get the InternalParameters
14337         anymore since Block.EmitMeta() now computes the layout of the flow
14338         vector.
14339         (MyStructInfo): This class is now known as `StructInfo' and nested
14340         in `TypeInfo'; we don't access this directly anymore.
14341
14342         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14343         property and removed IsAssigned(), IsFieldAssigned(),
14344         SetAssigned() and SetFieldAssigned(); we now call them on the
14345         VariableInfo so we don't need to duplicate this code everywhere.
14346
14347         * expression.cs (ParameterReference): Added `Block block' argument
14348         to the .ctor.
14349         (LocalVariableReference, ParameterReference, This): The new
14350         VariableInfo class is now responsible for all the definite
14351         assignment stuff.
14352
14353         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14354         IsParameterAssigned, SetParameterAssigned): Removed.
14355
14356 2003-05-18  Martin Baulig  <martin@ximian.com>
14357
14358         * typemanager.cs (InitCoreTypes): Try calling
14359         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14360         the 3-args-version.  Corlib now also needs our `void_type'.
14361         (GetMethod): Added overloaded version which takes an optional
14362         `bool report_errors' to allow lookups of optional methods.
14363
14364 2003-05-12  Martin Baulig  <martin@ximian.com>
14365
14366         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14367         only used for locals and not for parameters.
14368
14369 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * support.cs (InternalParameters.ParameterType): Return the
14372         ExternalType of the parameter.
14373
14374         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14375         they were unused.
14376
14377 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14378
14379         * class.cs (MethodData.Define): Do not set the `newslot' on
14380         interface members, if they are also flagged as "override".
14381
14382         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14383         better code for ++i and i++.  This only works for static fields
14384         and local variables.
14385
14386         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14387         want to pull the DeclSpace out of the builder_to_declspace instead
14388         of the TypeBuilder (like in TypeContainer.FindMembers).
14389
14390         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14391         instead of LookupTypeContainer.  Fixes the crash on .NET for
14392         looking up interface members.
14393
14394         * const.cs: Create our own emit context during the Definition
14395         stage, so that constants are evaluated in the proper context, when
14396         a recursive definition happens.
14397
14398 2003-05-11  Martin Baulig  <martin@ximian.com>
14399
14400         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14401         new block for a switch section.
14402         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14403         the adding/lookup in the switch block.  Fixes #39828.
14404
14405 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14406
14407         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14408         functionality: I needed to convert the data after I had performed
14409         the add/sub operation into the operands type size.
14410
14411         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14412         pass the type for the box operation, otherwise the resulting
14413         object would have been of type object.
14414
14415         (BoxedCast): Add constructor to specify the type to box as.
14416
14417 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14418
14419         * iterators.cs: I was reusing the `count' variable inadvertently,
14420         take steps to not allow this to happen.
14421
14422 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14423
14424         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14425         by creating an array at the point where the params starts and
14426         putting all those arguments there, then adjusting the size of the
14427         array.
14428
14429 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14430
14431         * expression.cs (New.AddressOf): Implement interface
14432         IMemoryLocation.  This is used when the `new' operator is used in
14433         the context of an invocation to a method on a value type.
14434
14435         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14436         example. 
14437
14438         * namespace.cs: Also check the using aliases here.
14439
14440         * driver.cs: Move the test for using validity after the types have
14441         been entered, so we do a single pass that also includes the using
14442         aliases. 
14443
14444         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14445         in the regular case.   CreateSiblingForFinally is doing extra
14446         error checking.
14447
14448         * attribute.cs (GetAttributeArgumentExpression): Store the result
14449         on an out value, and use the return value to indicate failure
14450         instead of using null (which is a valid return for Constant.GetValue).
14451
14452         * statement.cs: Perform the analysis flow for the increment
14453         portion after the statement, because this will be the real flow of
14454         execution.  Fixes #42385
14455
14456         * codegen.cs (EmitContext.EmitArgument,
14457         EmitContext.EmitStoreArgument): New helper functions when the
14458         RemapToProxy flag is set.
14459
14460         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14461         function.
14462
14463         Add support for remapping parameters. 
14464
14465         * iterators.cs: Propagate parameter values;  Store parameter
14466         values in the proxy classes.
14467
14468 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14469
14470         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14471         need a proxy reference;  I do not know what I was thinking
14472
14473         * cs-parser.jay (constructor_initializer): catch another error,
14474         and display nice message.
14475
14476         (field_declaration): catch void field declaration
14477         to flag a better error. 
14478
14479         * class.cs (MemberBase.CheckBase): Report an error instead of a
14480         warning if a new protected member is declared in a struct. 
14481         (Field.Define): catch the error of readonly/volatile.
14482
14483         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14484
14485         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14486         volatile variable is taken
14487
14488 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14489
14490         * statement.cs (Fixed.Resolve): Report an error if we are not in
14491         an unsafe context.
14492
14493 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14494
14495         * typemanager.cs: reuse the code that handles type clashes for
14496         delegates and enumerations.
14497
14498         * class.cs (Report28): Always report.
14499
14500         * expression.cs (EncodeAsAttribute): Allow nulls here.
14501
14502 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14503
14504         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14505         the functionality for testing whether an expression is valid for
14506         an attribute here.  Also handle the case of arrays of elements
14507         being stored. 
14508
14509         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14510         encoding a linear array into an array of objects that are suitable
14511         to be passed to an CustomAttributeBuilder.
14512
14513         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14514
14515         * ecore.cs: (FieldExpr): Handle field remapping here.
14516
14517         * iteratators.cs: Pass the instance variable (if the method is an
14518         instance method) to the constructors, so we can access the field
14519         variables on the class.
14520
14521         TODO: Test this with structs.  I think the THIS variable on
14522         structs might have to be a pointer, and not a refenrece
14523
14524 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14525
14526         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14527         local variables to fields in a proxy class.
14528
14529         * iterators.cs (PopulateProxy): Rename our internal fields to
14530         <XXX>.  
14531         Create a <THIS> field if we are an instance method, so we can
14532         reference our parent container variables.
14533         (MapVariable): Called back from the EmitContext code to enter a
14534         new variable to field mapping into the proxy class (we just create
14535         a FieldBuilder).
14536
14537         * expression.cs
14538         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14539         for using the remapped locals to fields.
14540
14541         I placed the code here, because that gives the same semantics to
14542         local variables, and only changes the Emit code.
14543
14544         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14545         statements inside iterators.
14546         (VariableInfo): Add a FieldBuilder for the cases when we are
14547         remapping local variables to fields in a proxy class
14548
14549         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14550         current_block != null.
14551
14552         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14553         not cope with strings, as it has been moved to the
14554         TableSwitchEmit.  Fixed bug in switch generation.
14555
14556         * expression.cs (New.DoResolve): Provide more context for the user
14557         when reporting an error.
14558
14559         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14560         pointers. 
14561
14562         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14563         check the permissions for it.  Note than in a type-resolution
14564         context the check was already present in DeclSpace.ResolveType,
14565         but was missing from the MemberAccess.
14566
14567         (ArrayCreation.CheckIndices): warn if the user has
14568         more nested levels of expressions, but there are no more
14569         dimensions specified.  Avoids crash on bug 41906.
14570
14571 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14572
14573         * statement.cs (Block): replace Implicit bool, for a generic
14574         flags.   
14575         New flag: `Unchecked'.  This is used during the EmitMeta phase
14576         (which is out-of-line with the regular Resolve/Emit process for a
14577         statement, as this is done ahead of time, but still gets a chance
14578         to call constant resolve).
14579
14580         (Block.Flags): new enum for adding a new flag.
14581
14582         (Block.EmitMeta): track the state of unchecked.
14583
14584         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14585         to enable constant resolution to work there as well.
14586
14587 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14588
14589         * typemanager.cs (ienumerable_type): Also look up
14590         System.Collections.IEnumerable. 
14591
14592 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14593
14594         TODO: Test more than one conditional per method.
14595
14596         * class.cs (Indexer.Define): Report the location where the user is
14597         referencing the unsupported feature.
14598
14599         (MethodData): Overload the use of `conditionals' to
14600         minimize the creation of needless ArrayLists.   This saves roughly
14601         212kb on my machine.
14602
14603         (Method): Implement the new IIteratorContainer interface.
14604         (Method.SetYields): Implement the method by setting the ModFlags
14605         to contain METHOD_YIELDS.
14606
14607         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14608         which just got set to null.
14609
14610         * iterators.cs: New file.
14611
14612         (Yield, YieldBreak): New statements.
14613
14614         * statement.cs (Return.Resolve): Flag an error if we are used in
14615         an iterator method.
14616
14617         * codegen.cs (InIterator): New flag set if the code is being
14618         compiled in an iterator method.
14619
14620         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14621         internal modifier, and we just use it to avoid adding extra
14622         fields, as this is seldom used.  
14623
14624         * cs-parser.jay: Add yield_statement (yield and yield break).
14625
14626         * driver.cs: New flag -v2 to turn on version 2 features. 
14627
14628         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14629         hashtable when v2 is enabled.
14630
14631 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14632
14633         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14634         there is already a namespace defined with this name.
14635
14636         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14637         people upgraded their corlibs.
14638
14639         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14640         always use fully qualified types, no need to use the compiler
14641         front end.
14642
14643         (TypeManager.IsNamespace): Use binarysearch.
14644
14645         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14646         AddDelegate): I did not quite use the new IsValid API properly: I
14647         have to pass the short-name and the fullname.  I was passing only
14648         the basename instead of the fullname sometimes. 
14649
14650         (TypeContainer.DefineType): call NamespaceClash.
14651
14652         * interface.cs (Interface.DefineType): use NamespaceClash before
14653         defining the type.
14654
14655         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14656         defining the type.
14657
14658         * enum.cs: (Enum.DefineType): use NamespaceClash before
14659         defining the type.
14660
14661         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14662         speed increase.  First, use the negative_hits cache when we get a
14663         negative.  Second, add the type with its full original name
14664         instead of the new . and + encoded name (reflection uses + to
14665         separate type from a nested type).  Use LookupTypeReflection
14666         directly which bypasses the type->name hashtable (that we already
14667         know does not contain the type.
14668
14669         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14670         location/container type. 
14671
14672         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14673
14674 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14675
14676         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14677
14678         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14679         method is being referenced in the method group from a static
14680         context, and report error 120 if so.
14681
14682         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14683         Error118. 
14684
14685         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14686         is created, we create the A namespace).
14687
14688         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14689         Fixes #41591
14690
14691 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14692
14693         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14694         invocation to ModuleBuilder.GetType with the same values will
14695         return a new type instance, so we need to cache its return
14696         values. 
14697
14698         * expression.cs (Binary.ResolveOperator): Only allow the compare
14699         operators on enums if they are of the same type.
14700
14701         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14702         types of ValueType on their own case.  Before we were giving them
14703         the same treatment as objects.
14704
14705         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14706         fullname.  Short name is used to compare against container name.
14707         Fullname is used to check against defined namespace names.
14708
14709         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14710         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14711
14712         (Method.CheckBase): Call parent.
14713         (MemberBase.CheckBase): Check for protected members on sealed
14714         classes.
14715         (PropertyBase.CheckBase): Call parent.
14716         (Field.Define): Call parent.
14717
14718         * report.cs: Negative error codes are now mapped to 8000 - code,
14719         so that the display is render more nicely.
14720
14721         * typemanager.cs: Do not use try/catch, instead report a regular
14722         error. 
14723
14724         (GetPointerType, GetReferenceType): These methods provide
14725         mechanisms to obtain the T* and T& from a T.  We had the code
14726         previously scattered around the code base, and it also used
14727         TypeManager.LookupType that would go through plenty of caches.
14728         This one goes directly to the type source.
14729
14730         In some places we did the Type.GetType followed by
14731         ModuleBuilder.GetType, but not in others, so this unifies the
14732         processing as well.
14733
14734         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14735         statements now that we have namespace information.
14736
14737         * typemanager.cs (IsNamespace): New method, returns whether the
14738         string presented is a namespace or not.
14739
14740         (ComputeNamespaces): New public entry point, computes the list of
14741         available namespaces, using the GetNamespaces API call in Mono, or
14742         the slower version in MS.NET.   
14743
14744         Now before we start the semantic analysis phase, we have a
14745         complete list of namespaces including everything that the user has
14746         provided.
14747
14748         Deleted old code to cache namespaces in .nsc files.
14749
14750 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14751
14752         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14753         class/struct location definition Location for the implicit
14754         constructor location.
14755
14756         (Operator.Define): Use the location of the operator for the
14757         implicit Method definition.
14758
14759         (Constructor.Emit): use the constructor location for the implicit
14760         base initializer constructor.
14761
14762         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14763         and the Expression class now contains two new methods:
14764
14765         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14766         isolate type lookup from the rest of the resolution process.
14767
14768         Since we use Expressions to hold type definitions due to the way
14769         we parse the input we have historically overloaded Resolve to
14770         perform the Type lookups if a special flag is passed.  Now this is
14771         eliminated and two methods take their place. 
14772
14773         The differences in the two methods between xStep and xTerminal is
14774         that xStep is involved in our current lookup system that uses
14775         SimpleNames to compose a name, while xTerminal is used just to
14776         catch the case where the simplename lookup failed.
14777
14778 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14779
14780         * expression.cs (ResolveMemberAccess): Remove redundant code.
14781         TypeExpr expressions are always born fully resolved.
14782
14783         * interface.cs (PopulateMethod): Do not lookup the types twice.
14784         We were doing it once during SemanticAnalysis and once during
14785         PopulateMethod.
14786
14787         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14788         in local variable type definitions, were being returned as a
14789         SimpleName (we decomposed everything into a string), that is
14790         because primary_expression was being used instead of a type in the
14791         grammar (reduce/reduce conflicts).
14792
14793         The part that was wrong is that we converted the expression into a
14794         string (an oversimplification in one hand, compounded with primary
14795         expressions doing string concatenation).
14796
14797         So things like:
14798
14799         A.B.C [] x;
14800
14801         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14802         using clauses from working on this particular context.  And a type
14803         was being matched directly against "A.B.C[]".
14804
14805         We now use the correct approach, and allow for ComposedCast to be
14806         part of the unary expression.  So the "A.B.C []" become a composed
14807         cast of "A.B.C" (as a nested group of MemberAccess with a
14808         SimpleName at the end) plus the rank composition "[]". 
14809
14810         Also fixes 35567
14811
14812 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14813
14814         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14815         for the access level checking.
14816
14817         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14818         `TypeContainer container', because I kept getting confused when I
14819         was debugging this code.
14820
14821         * expression.cs (Indexers): Instead of tracking getters/setters,
14822         we now track them in parallel.  We create one arraylist less, but
14823         most importantly it is possible now for the LValue code to find a
14824         matching get for a set.
14825
14826         (IndexerAccess.DoResolveLValue): Update the code.
14827         GetIndexersForType has been modified already to extract all the
14828         indexers from a type.  The code assumed it did not.
14829
14830         Also make the code set the correct return type for the indexer.
14831         This was fixed a long time ago for properties, but was missing for
14832         indexers.  It used to be void_type.
14833
14834         (Binary.Emit): Test first for doubles instead of
14835         floats, as they are more common.
14836
14837         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14838         when dealing with floats and the <=, >= operators.  This fixes bug
14839         #39314 
14840
14841         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14842         to load the array value by emitting a load on the foreach variable
14843         type.  This was incorrect.  
14844
14845         We now emit the code to load an element using the the array
14846         variable type, and then we emit the conversion operator.
14847
14848         Fixed #40176
14849
14850 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14851
14852         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14853
14854 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14855
14856         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14857         test for protection before we test for signatures. 
14858
14859         (MethodSignature.ToString): implement.
14860
14861         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14862         to the case where we reduced into a LongConstant.
14863
14864         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14865         depend on whether the information is acurrate, because the
14866         Microsoft runtime will always claim that the array type is public,
14867         regardless of the real state.
14868
14869         If the type is a pointer, another problem happens: the type is
14870         reported as non-public in Microsoft.  
14871
14872         In both cases we have to call CheckAccessLevel recursively with
14873         the underlying type as the argument to be tested.
14874
14875 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14876
14877         * assign.cs (Assign.Emit): If we are dealing with a compound
14878         assignment expression, we should use the code path that stores the
14879         intermediate result in a temporary value.  This fixes #40903.
14880
14881         *expression.cs (Indirection.ToString): Provide ToString method for
14882         debugging. 
14883
14884 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14885
14886         * class.cs: Null out fields holding references to Block objects so
14887         they can be garbage collected.
14888
14889         * expression.cs (OverloadResolve): Remove unused local.
14890
14891 2003-04-07  Martin Baulig  <martin@ximian.com>
14892
14893         * codegen.cs (EmitContext.CurrentFile): New public field.
14894         (EmitContext.Mark): Use the CurrentFile to check whether the
14895         location is in the correct file.
14896         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14897
14898 2003-04-07  Martin Baulig  <martin@ximian.com>
14899
14900         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14901
14902         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14903         location.  [FIXME: The location argument which gets passed to this
14904         method is sometimes wrong!]
14905
14906 2003-04-07  Nick Drochak <ndrochak@gol.com>
14907
14908         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14909
14910 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14911
14912         * expression.cs (Indirection.EmitAssign): We were using the
14913         temporary, but returning immediately instead of continuing the
14914         EmitAssing flow.
14915
14916 2003-04-06  Martin Baulig  <martin@ximian.com>
14917
14918         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14919         if it's a nested child, but also deriving from the outer class.
14920         See test 190.cs.
14921
14922         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14923         nested child, but also deriving from the outer class.  See
14924         test-190.cs.
14925         (FilterWithClosure): We may access private members of the outer
14926         class if we're a nested child and deriving from the outer class.
14927         (RealMemberLookup): Only set `closure_private_ok' if the
14928         `original_bf' contained BindingFlags.NonPublic.
14929
14930 2003-04-05  Martin Baulig  <martin@ximian.com>
14931
14932         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14933         probe if its a type parameter, and if so, flag an error.
14934
14935         * decl.cs: Move here the SetParameterInfo code from class.cs.
14936         Handle IsGeneric here.
14937
14938         Handle a variety of errors in the parameter info definition.
14939
14940         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14941         type parameters here.
14942
14943         * cs-parser.jay (class_declaration): report errors for parameters
14944         here as well.
14945
14946 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14947
14948         * generic.cs: New file, contains support code for generics.
14949
14950         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14951         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14952
14953         Update parser for the above removals.
14954
14955         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14956         now taken care of in the parser.
14957
14958 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14959
14960         * class.cs (Event.Define): Do not allow abstract events to have
14961         initializers. 
14962
14963 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14964
14965         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14966         block in event declarations.
14967
14968         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14969         value type, get its address.
14970
14971         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14972         leaving a class on the stack instead of a boolean value (int
14973         0/1).  Change the code so we compare against null, and then the
14974         result against zero.
14975
14976         * class.cs (TypeContainer.GetClassBases): We were checking for the
14977         parent class being sealed too late.
14978
14979         * expression.cs (Binary.Emit): For <= and >= when dealing with
14980         floating point values, use cgt.un and clt.un instead of cgt and
14981         clt alone.
14982
14983 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14984
14985         * statement.cs: Apply the same optimization as MS: skip the 
14986         GetEnumerator returning an IEnumerator, and use the one returning a 
14987         CharEnumerator instead. This allows us to avoid the try-finally block 
14988         and the boxing.
14989
14990 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14991
14992         * cs-parser.jay: Attributes cannot be applied to
14993                          namespaces. Fixes #40473
14994
14995 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14996
14997         * class.cs:
14998         (Add*): check if the name is valid using the full name for constants,
14999         fields, properties and events.
15000
15001 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15002
15003         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15004         char constants to be part of the enumeration.
15005
15006         * expression.cs (Conditional.DoResolve): Add support for operator
15007         true. Implements the missing functionality from 14.12
15008
15009         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15010         operator true/false as required by the spec.
15011
15012         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15013         implicit conversion to boolean.
15014
15015         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15016         also one where the type implements `operator true'. 
15017
15018         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15019         get an expression that will invoke operator true based on an
15020         expression.  
15021
15022         (GetConversionOperators): Removed the hack that called op_True
15023         here.  
15024
15025         (Expression.ResolveBoolean): Move this from Statement.
15026
15027 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15028
15029         * ecore.cs (FieldExpr): do not allow initialization of initonly
15030         fields on derived classes
15031
15032 2003-03-13  Martin Baulig  <martin@ximian.com>
15033
15034         * statement.cs (Block.Emit): Call ig.BeginScope() and
15035         ig.EndScope() when compiling with debugging info; call
15036         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15037
15038 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15039
15040         * expression.cs (Indexers): Do not construct immediately, allow
15041         for new members to be appended as we go.  Fixes 38143
15042
15043 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15044
15045         * expression.cs: save/restore context when resolving an unchecked
15046         expression.
15047
15048 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15049
15050         * cfold.cs: Catch division by zero in modulus operator during
15051         constant folding.
15052
15053 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * interface.cs (Interface.DefineMembers): Avoid defining members
15056         twice. 
15057
15058 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15059
15060         * driver.cs: handle the +/- options for -noconfig
15061
15062         * statement.cs (Unckeched.Resolve): Also track the state of
15063         unchecked in the Resolve phase.
15064
15065 2003-02-27  Martin Baulig  <martin@ximian.com>
15066
15067         * ecore.cs (Expression.MemberLookup): Don't create a
15068         MethodGroupExpr for something which is not a method.  Fixes #38291.
15069
15070 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15071
15072         * class.cs (MemberBase.CheckParameters): Also check that the type
15073         is unmanaged if it is a pointer.
15074
15075         * expression.cs (SizeOf.Resolve): Add location information.
15076
15077         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15078         a managed type is declared.
15079
15080         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15081         parameter modifiers as well.  Fixes bug 38606
15082
15083         * class.cs: Very sad.  Am backing out the speed up changes
15084         introduced by the ArrayList -> Array in the TypeContainer, as they
15085         were not actually that much faster, and introduced a bug (no error
15086         reports on duplicated methods).
15087
15088         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15089         source first, this will guarantee that we have a valid expression
15090         before calling in lower levels functions that will require a
15091         resolved object.  Then use this original_source in the
15092         target.ResolveLValue instead of the original source that was
15093         passed to us.
15094
15095         Another change.  Use target.Resolve instead of LValueResolve.
15096         Although we are resolving for LValues, we will let the Assign code
15097         take care of that (it will be called again from Resolve).  This
15098         basically allows code like this:
15099
15100         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15101         class Y { void A (X x) { x [0] += o; }
15102
15103         The problem was that the indexer was trying to resolve for
15104         set_Item (idx, object o) and never finding one.  The real set_Item
15105         was set_Item (idx, X).  By delaying the process we get the right
15106         semantics. 
15107
15108         Fixes bug 36505
15109
15110 2003-02-23  Martin Baulig  <martin@ximian.com>
15111
15112         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15113         while calling DoEmit ().
15114
15115         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15116         source files; if you use the #line directive inside a method, the
15117         compiler stops emitting line numbers for the debugger until it
15118         reaches the end of the method or another #line directive which
15119         restores the original file.
15120
15121 2003-02-23  Martin Baulig  <martin@ximian.com>
15122
15123         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15124
15125 2003-02-23  Martin Baulig  <martin@ximian.com>
15126
15127         * statement.cs (Block.AddChildVariableNames): We need to call this
15128         recursively, not just for our immediate children.
15129
15130 2003-02-23  Martin Baulig  <martin@ximian.com>
15131
15132         * class.cs (Event.Define): Always make the field private, like csc does.
15133
15134         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15135         actually work, fixes bug #37521.
15136
15137 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15138
15139         * delegate.cs: When creating the various temporary "Parameters"
15140         classes, make sure that we call the ComputeAndDefineParameterTypes
15141         on those new parameters (just like we do with the formal ones), to
15142         allow them to be resolved in the context of the DeclSpace.
15143
15144         This fixes the bug that Dick observed in Bugzilla #38530.
15145
15146 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * expression.cs (ResolveMemberAccess): When resolving a constant,
15149         do not attempt to pull a constant if the value was not able to
15150         generate a valid constant.
15151
15152         * const.cs (LookupConstantValue): Do not report more errors than required.
15153
15154 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15155
15156         * expression.cs: fixes bug #38328.
15157
15158 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15159
15160         * class.cs: Changed all the various members that can be part of a
15161         class from being an ArrayList to be an Array of the right type.
15162         During the DefineType type_list, interface_list, delegate_list and
15163         enum_list are turned into types, interfaces, delegates and enums
15164         arrays.  
15165
15166         And during the member population, indexer_list, event_list,
15167         constant_list, field_list, instance_constructor_list, method_list,
15168         operator_list and property_list are turned into their real arrays.
15169
15170         Although we could probably perform this operation earlier, for
15171         good error reporting we need to keep the lists and remove the
15172         lists for longer than required.
15173
15174         This optimization was triggered by Paolo profiling the compiler
15175         speed on the output of `gen-sample-program.pl' perl script. 
15176
15177         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15178         not crash in methods like MemberLookupFailed that use this field.  
15179
15180         This problem arises when the compiler fails to resolve a type
15181         during interface type definition for example.
15182
15183 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15184
15185         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15186         inherit from System.Object, so we have to stop at null, not only
15187         when reaching System.Object.
15188
15189 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15190
15191         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15192         DeclaredOnly because the parent indexer might have had a different
15193         name, but did not loop until the top of the hierarchy was reached.
15194
15195         The problem this one fixes is 35492: when a class implemented an
15196         indexer from an interface, we were getting the interface method
15197         (which was abstract) and we were flagging an error (can not invoke
15198         abstract method).
15199
15200         This also keeps bug 33089 functioning, and test-148 functioning.
15201
15202         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15203         out if a method is special is to see if it is declared in a
15204         property or event, or whether it is one of the predefined operator
15205         names.   This should fix correctly #36804.
15206
15207 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15208
15209         The goal here is to remove the dependency on EmptyCast.Peel ().
15210         Killing it completely.
15211
15212         The problem is that currently in a number of places where
15213         constants are expected, we have to "probe" for an EmptyCast, and
15214         Peel, which is not the correct thing to do, as this will be
15215         repetitive and will likely lead to errors. 
15216
15217         The idea is to remove any EmptyCasts that are used in casts that
15218         can be reduced to constants, so we only have to cope with
15219         constants. 
15220
15221         This bug hunt was triggered by Bug 37363 and the desire to remove
15222         the duplicate pattern where we were "peeling" emptycasts to check
15223         whether they were constants.  Now constants will always be
15224         constants.
15225
15226         * ecore.cs: Use an enumconstant here instead of wrapping with
15227         EmptyCast.  
15228
15229         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15230         throwing me off.  By handling this we can get rid of a few hacks.
15231
15232         * statement.cs (Switch): Removed Peel() code.
15233
15234 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15235
15236         * class.cs: Location information for error 508
15237
15238         * expression.cs (New.DoResolve): Add a guard against double
15239         resolution of an expression.  
15240
15241         The New DoResolve might be called twice when initializing field
15242         expressions (see EmitFieldInitializers, the call to
15243         GetInitializerExpression will perform a resolve on the expression,
15244         and later the assign will trigger another resolution
15245
15246         This leads to bugs (#37014)
15247
15248         * delegate.cs: The signature for EndInvoke should contain any ref
15249         or out parameters as well.  We were not doing this in the past. 
15250
15251         * class.cs (Field.Define): Do not overwrite the type definition
15252         inside the `volatile' group.  Turns out that volatile enumerations
15253         were changing the type here to perform a validity test, which
15254         broke conversions. 
15255
15256 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15257
15258         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15259         and structs, we do not want to load the instance variable
15260
15261         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15262         enum_type has to be handled like an object reference (implicit
15263         conversions exists from this to object), but the regular IsClass
15264         and IsValueType tests will never return true for this one.
15265
15266         Also we use TypeManager.IsValueType instead of type.IsValueType,
15267         just for consistency with the rest of the code (this is only
15268         needed if we ever use the construct exposed by test-180.cs inside
15269         corlib, which we dont today).
15270
15271 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15272
15273         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15274         just InternalCall.
15275
15276 2003-02-09  Martin Baulig  <martin@ximian.com>
15277
15278         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15279         (Namespace.DefineNamespaces): New static public method; this is
15280         called when we're compiling with debugging to add all namespaces
15281         to the symbol file.
15282
15283         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15284         pass it to the Namespace's .ctor.
15285
15286         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15287         and MethodBase arguments; pass the namespace ID to the symwriter;
15288         pass the MethodBase instead of the token to the symwriter.
15289         (SymbolWriter.DefineNamespace): New method to add a namespace to
15290         the symbol file.
15291
15292 2003-02-09  Martin Baulig  <martin@ximian.com>
15293
15294         * symbolwriter.cs: New file.  This is a wrapper around
15295         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15296         methods here in near future.
15297
15298 2003-02-09  Martin Baulig  <martin@ximian.com>
15299
15300         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15301         ILGenerator.MarkSequencePoint() which are actually used by the
15302         symbol writer.
15303
15304 2003-02-09  Martin Baulig  <martin@ximian.com>
15305
15306         * location.cs (SourceFile): New public sealed class.  This
15307         contains the name and an index which is used in the location's token.
15308         (Location): Reserve an appropriate number of bits in the token for
15309         the source file instead of walking over that list, this gives us a
15310         really huge performance improvement when compiling with debugging.
15311
15312         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15313         `SourceFile' argument instead of a string.
15314         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15315         but don't parse/tokenize here, we need to generate the list of all
15316         source files before we do that.
15317         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15318         the files.
15319
15320         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15321         instead of a string.
15322
15323         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15324         of a string.
15325
15326 2003-02-09  Martin Baulig  <martin@ximian.com>
15327
15328         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15329         filename on `#line default'.
15330
15331 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15332
15333         * statement.cs: don't clear the pinned var when the fixed statement
15334         returns from the method (fixes bug#37752).
15335
15336 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15337
15338         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15339         to IsValueType.
15340
15341 2003-02-07  Martin Baulig  <martin@ximian.com>
15342
15343         * driver.cs: Removed the `--debug-args' command line argument.
15344
15345         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15346         automatically by the AsssemblyBuilder.
15347         (CodeGen.InitializeSymbolWriter): We don't need to call any
15348         initialization function on the symbol writer anymore.  This method
15349         doesn't take any arguments.
15350
15351 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15352
15353         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15354         from referenced assemblies as well.
15355
15356 2003-02-02  Martin Baulig  <martin@ximian.com>
15357
15358         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15359
15360 2003-02-02  Martin Baulig  <martin@ximian.com>
15361
15362         * class.cs (Constructor.Emit): Open the symbol writer before
15363         emitting the constructor initializer.
15364         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15365         single-stepping through constructor initializers.
15366
15367 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15368
15369         * class.cs: Handle error 549: do not allow virtual methods in
15370         sealed classes. 
15371
15372 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15373
15374         * decl.cs: Check access levels when resolving types
15375
15376 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15377
15378         * statement.cs: Add parameters and locals set in catch blocks that might 
15379         return to set vector
15380
15381 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15382
15383         * class.cs (Operator): Set the SpecialName flags for operators.
15384
15385         * expression.cs (Invocation.DoResolve): Only block calls to
15386         accessors and operators on SpecialName methods.
15387
15388         (Cast.TryReduce): Handle conversions from char constants.
15389
15390
15391 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15392
15393         * statement.cs: small memory and time optimization in FlowBranching.
15394
15395 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15396
15397         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15398         problem that the last fix but in the other sid (Set).
15399
15400         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15401         access when there is no indexer in the hierarchy.
15402
15403 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15404
15405         * class.cs: Combine some if statements.
15406
15407 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15408
15409         * driver.cs: fixed bug #37187.
15410
15411 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15412
15413         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15414         any indexer, it's needed to build a list with all the indexers in the
15415         hierarchy (AllGetters), else we have problems. Fixes #35653.
15416
15417 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15418
15419         * class.cs (MethodData.Define): It is wrong for an interface
15420         implementation to be static in both cases: explicit and implicit.
15421         We were only handling this in one case.
15422
15423         Improve the if situation there to not have negations.
15424
15425         * class.cs (Field.Define): Turns out that we do not need to check
15426         the unsafe bit on field definition, only on usage.  Remove the test.
15427
15428 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15429
15430         * driver.cs: use assembly.Location instead of Codebase (the latest
15431         patch made mcs fail when using MS assemblies).
15432
15433 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15434
15435         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15436         get the path to *corlib.dll.
15437
15438 2003-01-21  Nick Drochak <ndrochak@gol.com>
15439
15440         * cs-tokenizer.cs:
15441         * pending.cs:
15442         * typemanager.cs: Remove compiler warnings
15443
15444 2003-01-20  Duncan Mak  <duncan@ximian.com>
15445
15446         * AssemblyInfo.cs: Bump the version number to 0.19.
15447
15448 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15449
15450         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15451
15452 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15453
15454         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15455
15456 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15457
15458         * cs-parser.jay: Small fix: we were not comparing the constructor
15459         name correctly.   Thanks to Zoltan for the initial pointer.
15460
15461 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15462
15463         * cs-tokenizer.cs: Set file name when specified with #line
15464
15465 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15466
15467         * cs-parser.jay: Only perform the constructor checks here if we
15468         are named like the class;  This will help provider a better
15469         error.  The constructor path is taken when a type definition is
15470         not found, but most likely the user forgot to add the type, so
15471         report that rather than the constructor error.
15472
15473 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15474
15475         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15476         allocations.
15477
15478 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15479
15480         * cs-parser.jay: Add cleanup call.
15481
15482 2003-01-13  Duncan Mak  <duncan@ximian.com>
15483
15484         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15485         consistent with other methods.
15486
15487 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15488
15489         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15490
15491 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15492
15493         * attribute.cs: only set GuidAttr to true when we have a
15494         GuidAttribute.
15495
15496 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15497
15498         * ecore.cs:
15499         * expression.cs:
15500         * typemanager.cs: fixes to allow mcs compile corlib with the new
15501         Type.IsSubclassOf fix.
15502
15503 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15504
15505         * expression.cs (LocalVariableReference.DoResolve): Classify a
15506         constant as a value, not as a variable.   Also, set the type for
15507         the variable.
15508
15509         * cs-parser.jay (fixed_statement): take a type instead of a
15510         pointer_type, so we can produce a better error message later.
15511
15512         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15513         as an error.  
15514
15515         (For.DoEmit): Make inifinite loops have a
15516         non-conditional branch back.
15517
15518         (Fixed.DoEmit): First populate the pinned variables, then emit the
15519         statement, then clear the variables.  Before I was emitting the
15520         code once for each fixed piece.
15521
15522
15523 2003-01-08  Martin Baulig  <martin@ximian.com>
15524
15525         * statement.cs (FlowBranching.MergeChild): A break in a
15526         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15527
15528 2003-01-08  Martin Baulig  <martin@ximian.com>
15529
15530         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15531         lives in the same number space than `param_map'.  Fixes #36154.
15532
15533 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15534
15535         * cs-parser.jay (constructor_declaration): Set the
15536         Constructor.ModFlags before probing for it.  This makes the
15537         compiler report 514, 515 and 132 (the code was there, but got
15538         broken). 
15539
15540         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15541         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15542         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15543
15544 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15545
15546         * enum.cs: create the enum static fields using the enum type.
15547
15548 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15549
15550         * class.cs: don't try to create the ParamBuilder for the return
15551         type if it's not needed (and handle it breaking for the ms runtime
15552         anyway).
15553
15554 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15555
15556         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15557
15558 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15559
15560         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15561         the command.   This showed up while compiling the JANET source
15562         code, which used \r as its only newline separator.
15563
15564 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15565
15566         * class.cs (Method.Define): If we are an operator (because it
15567         reuses our code), then set the SpecialName and HideBySig.  #36128
15568
15569 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15572         exception, report error 120 `object reference required'.
15573
15574         * driver.cs: Add --pause option, used during to measure the size
15575         of the process as it goes with --timestamp.
15576
15577         * expression.cs (Invocation.DoResolve): Do not allow methods with
15578         SpecialName to be invoked.
15579
15580 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15581
15582         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15583         number before adding it.
15584
15585 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15586
15587         * ecore.cs (StandardImplicitConversion): When in an unsafe
15588         context, we allow conversion between void * to any other pointer
15589         type. This fixes bug #35973.
15590
15591 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15592
15593         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15594         is not thrown when extensionless outputs are used 
15595
15596 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15597
15598         * rootcontext.cs: fixed compilation of corlib.
15599
15600 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15601
15602         * attribute.cs (Attributes.Contains): Add new method.
15603
15604         * class.cs (MethodCore.LabelParameters): if the parameter is an
15605         `out' parameter, check that no attribute `[In]' has been passed.
15606
15607         * enum.cs: Handle the `value__' name in an enumeration.
15608
15609 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15610
15611         * decl.cs: Added special case to allow overrides on "protected
15612         internal" methods
15613
15614 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15615
15616         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15617         since it makes much more sense.
15618
15619         (Attributes.ctor): Don't require a Location parameter.
15620
15621         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15622
15623         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15624         since we already have that information per attribute.
15625
15626         * everywhere : make appropriate changes.
15627
15628         * class.cs (LabelParameters): Write the code which actually
15629         applies attributes to the return type. We can't do this on the MS
15630         .NET runtime so we flag a warning in the case an exception is
15631         thrown.
15632
15633 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15634
15635         * const.cs: Handle implicit null conversions here too.
15636
15637 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15638
15639         * class.cs (MethodCore.LabelParameters): Remove the extra
15640         Type [] parameter since it is completely unnecessary. Instead
15641         pass in the method's attributes so that we can extract
15642         the "return" attribute.
15643
15644 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15645
15646         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15647         of ignoring it and letting the compile continue.
15648
15649         * typemanager.cs (ChangeType): use an extra argument to return an
15650         error condition instead of throwing an exception.
15651
15652 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15653
15654         * expression.cs (Unary.TryReduce): mimic the code for the regular
15655         code path.  Perform an implicit cast in the cases where we can
15656         implicitly convert to one of the integral types, and then reduce
15657         based on that constant.   This fixes bug #35483.
15658
15659 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15660
15661         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15662
15663 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15664
15665         * namespace.cs: fixed bug #35489.
15666
15667 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15668
15669         * class.cs: Remove some dead code.
15670
15671         * cs-parser.jay: Estimate the number of methods needed
15672         (RootContext.MethodCount);
15673
15674         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15675         numbers instead of StringBuilders.
15676
15677         * support.cs (PtrHashtable): Add constructor with initial size;
15678         We can now reduce reallocations of the method table.
15679
15680 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15681
15682         * attribute.cs (ApplyAttributes): Keep track of the emitted
15683         attributes on a per-target basis. This fixes bug #35413.
15684
15685 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15686
15687         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15688         default to the Windows 1252 encoding.
15689
15690         (UnixParseOption): Support version, thanks to Alp for the missing
15691         pointer. 
15692
15693         * AssemblyInfo.cs: Add nice assembly information.
15694
15695         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15696         (bug 35169).
15697
15698         * cs-parser.jay: Allow a trailing comma before the close bracked
15699         in the attribute_section production.
15700
15701         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15702         address of the instance was being taken, I will take this out,
15703         because we take the address of the object immediately here.
15704
15705 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15706
15707         * typemanager.cs (AreMultipleAllowed): Take care of the most
15708         obvious case where attribute type is not in the current assembly -
15709         stupid me ;-)
15710
15711 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15712
15713         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15714         definitions, instead of doing that afterwards.  
15715
15716         Also we use a nice little hack, depending on the constructor, we
15717         know if we are a "composed" name or a simple name.  Hence, we
15718         avoid the IndexOf test, and we avoid 
15719
15720         * codegen.cs: Add code to assist in a bug reporter to track down
15721         the source of a compiler crash. 
15722
15723 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15724
15725         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15726         types have been emitted for a given element and flag an error
15727         if something which does not have AllowMultiple set is used more
15728         than once.
15729
15730         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15731         attribute types and their corresponding AllowMultiple properties
15732
15733         (AreMultipleAllowed): Check the property for a given type.
15734
15735         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15736         property in the case we have a TypeContainer.
15737
15738         (Attributes.AddAttribute): Detect duplicates and just skip on
15739         adding them. This trivial fix catches a pretty gross error in our
15740         attribute emission - global attributes were being emitted twice!
15741
15742         Bugzilla bug #33187 is now fixed.
15743
15744 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15745
15746         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15747         instead of pp_and).
15748
15749         * expression.cs (Binary.ResolveOperator): I can only use the
15750         Concat (string, string, string) and Concat (string, string,
15751         string, string) if the child is actually a concatenation of
15752         strings. 
15753
15754 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15755
15756         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15757         context where we need a 2-character lookahead.
15758
15759         * pending.cs (PendingImplementation): Rework so we can keep track
15760         of interface types all the time, and flag those which were
15761         implemented by parents as optional.
15762
15763 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15764
15765         * expression.cs (Binary.ResolveOperator): Use
15766         String.Concat(string,string,string) or
15767         String.Concat(string,string,string,string) when possible. 
15768
15769         * typemanager: More helper methods.
15770
15771
15772 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15773
15774         * pending.cs: remove the bogus return from GetMissingInterfaces()
15775         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15776
15777 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15778
15779         * namespace.cs: avoid duplicated 'using xxx' being added to
15780         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15781         when we get more than one 'using' statement for the same namespace.
15782         Report a CS0105 warning for it.
15783
15784 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15785
15786         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15787         of calling getChar/putback, uses internal knowledge of it.    
15788
15789         (xtoken): Reorder tokenizer so most common patterns are checked
15790         first.  This reduces the compilation time in another 5% (from 8.11s
15791         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15792
15793         The parsing time is 22% of the compilation in mcs, and from that
15794         64% is spent on the tokenization process.  
15795
15796         I tried using a binary search for keywords, but this is slower
15797         than the hashtable.  Another option would be to do a couple of
15798         things:
15799
15800                 * Not use a StringBuilder, instead use an array of chars,
15801                   with a set value.  Notice that this way we could catch
15802                   the 645 error without having to do it *afterwards*.
15803
15804                 * We could write a hand-parser to avoid the hashtable
15805                   compares altogether.
15806
15807         The identifier consumption process takes 37% of the tokenization
15808         time.  Another 15% is spent on is_number.  56% of the time spent
15809         on is_number is spent on Int64.Parse:
15810
15811                 * We could probably choose based on the string length to
15812                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15813                   computations. 
15814
15815         Another 3% is spend on wrapping `xtoken' in the `token' function.
15816
15817         Handle 0xa0 as whitespace (#34752)
15818
15819 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15820
15821         * typemanager.cs (IsCLRType): New routine to tell whether a type
15822         is one of the builtin types.  
15823
15824         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15825         typecode in more places instead of doing pointer comparissions.
15826         We could leverage some knowledge about the way the typecodes are
15827         laid out.
15828
15829         New code to cache namespaces in assemblies, it is currently not
15830         invoked, to be used soon.
15831
15832         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15833
15834         * expression.cs (Binary.ResolveOperator): specially handle
15835         strings, and do not perform user-defined operator overloading for
15836         built-in types.
15837
15838 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15841         internalcall as it is a pretty simple operation;  Avoid whenever
15842         possible to call Char.IsLetter.
15843
15844         (consume_identifier): Cut by half the number of
15845         hashtable calls by merging the is_keyword and GetKeyword behavior.
15846
15847         Do not short-circuit, because if we do, we
15848         report errors (ie, #if false && true would produce an invalid
15849         directive error);
15850
15851
15852 2002-11-24  Martin Baulig  <martin@ximian.com>
15853
15854         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15855         check constant ranges and report a CS0221.  Fixes #33186.
15856
15857 2002-11-24  Martin Baulig  <martin@ximian.com>
15858
15859         * cs-parser.jay: Make this work for uninitialized variable
15860         declarations in the `for' initializer.  Fixes #32416.
15861
15862 2002-11-24  Martin Baulig  <martin@ximian.com>
15863
15864         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15865         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15866
15867 2002-11-24  Martin Baulig  <martin@ximian.com>
15868
15869         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15870         argument; if true, we also check for user-defined conversions.
15871         This is only needed if both arguments are of a user-defined type.
15872         Fixes #30443, added test-175.cs.
15873         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15874
15875         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15876
15877 2002-11-24  Martin Baulig  <martin@ximian.com>
15878
15879         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15880         function to get the store opcode.
15881         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15882         only emit the Ldelema if the store opcode is Stobj.  You must run
15883         both test-34 and test-167 to test this.  Fixes #34529.
15884
15885 2002-11-23  Martin Baulig  <martin@ximian.com>
15886
15887         * ecore.cs (Expression.MemberLookup): Added additional
15888         `qualifier_type' argument which is used when we're being called
15889         from MemberAccess.DoResolve() and null if we're called from a
15890         SimpleName lookup.
15891         (Expression.MemberLookupFailed): New method to report errors; this
15892         does the CS1540 check and reports the correct error message.
15893
15894         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15895         argument for the CS1540 check and redone the way how we're dealing
15896         with private members.  See the comment in the source code for details.
15897         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15898         `closure_start_type' to `closure_qualifier_type' and check whether
15899         it's not null.  It was not this filter being broken, it was just
15900         being called with the wrong arguments.
15901
15902         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15903         and pass it the correct `qualifier_type'; this also does the error
15904         handling for us.
15905
15906 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15907
15908         * expression.cs (Invocation.EmitParams): If the we are dealing
15909         with a non-built-in value type, load its address as well.
15910
15911         (ArrayCreation): Use a a pretty constant instead
15912         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15913         static initializers.  
15914
15915         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15916         because they are not really value types, just glorified integers. 
15917
15918         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15919
15920         * ecore.cs: Remove redundant code for enumerations, make them use
15921         the same code path as everything else, fixes the casting issue
15922         with enumerations in Windows.Forms.
15923
15924         * attribute.cs: Do only cast to string if it is a string, the
15925         validation happens later.
15926
15927         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15928         people upgrade their corlibs.
15929
15930         * ecore.cs: Oops, enumerations were not following the entire code path
15931
15932 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * typemanager.cs (FilterWithClosure): Commented out the test for
15935         1540 in typemanager.cs, as it has problems when accessing
15936         protected methods from a parent class (see test-174.cs). 
15937
15938         * attribute.cs (Attribute.ValidateGuid): new method.
15939         (Attribute.Resolve): Use above.
15940
15941 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15942
15943         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15944
15945         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15946         handling for enumerations, as we only needed the TypeContainer
15947         functionality to begin with (this is required for the fix below to
15948         work for enums that reference constants in a container class for
15949         example). 
15950
15951         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15952
15953         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15954         a valid TypeBuilder to perform lookups on.o
15955
15956         * class.cs (InheritableMemberSignatureCompare): Use true in the
15957         call to GetGetMethod and GetSetMethod, because we are comparing
15958         the signature, and we need to get the methods *even* if they are
15959         private. 
15960
15961         (PropertyBase.CheckBase): ditto.
15962
15963         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15964         GotoCase.Resolve): Use Peel on EmpytCasts.
15965
15966         * ecore.cs (EmptyCast): drop child, add Peel method.
15967
15968 2002-11-17  Martin Baulig  <martin@ximian.com>
15969
15970         * ecore.cs (EmptyCast.Child): New public property.
15971
15972         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15973         label resolved to an EmptyCast.  Fixes #34162.
15974         (GotoCase.Resolve): Likewise.
15975         (Block.EmitMeta): Likewise.
15976
15977 2002-11-17  Martin Baulig  <martin@ximian.com>
15978
15979         * expression.cs (Invocation.BetterConversion): Prefer int over
15980         uint; short over ushort; long over ulong for integer literals.
15981         Use ImplicitConversionExists instead of StandardConversionExists
15982         since we also need to check for user-defined implicit conversions.
15983         Fixes #34165.  Added test-173.cs.
15984
15985 2002-11-16  Martin Baulig  <martin@ximian.com>
15986
15987         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15988         with the `true' and `false' literals.  Fixes #33151.
15989
15990 2002-11-16  Martin Baulig  <martin@ximian.com>
15991
15992         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15993         October 22nd; don't do the cs1540 check for static members.
15994
15995         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15996         now using our own filter here and doing the cs1540 check again.
15997
15998 2002-11-16  Martin Baulig  <martin@ximian.com>
15999
16000         * support.cs (InternalParameters): Don't crash if we don't have
16001         any fixed parameters.  Fixes #33532.
16002
16003 2002-11-16  Martin Baulig  <martin@ximian.com>
16004
16005         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16006         when looking up static methods to make this work on Windows.
16007         Fixes #33773.
16008
16009 2002-11-16  Martin Baulig  <martin@ximian.com>
16010
16011         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16012         a setter rather than using PropertyInfo.CanWrite.
16013
16014 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16015
16016         * class.cs: Allow acces to block member by subclasses. Fixes build
16017         breaker.
16018
16019 2002-11-14  Martin Baulig  <martin@ximian.com>
16020
16021         * class.cs (Constructor.Emit): Added the extern/block check.
16022         Fixes bug #33678.
16023
16024 2002-11-14  Martin Baulig  <martin@ximian.com>
16025
16026         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16027         iteration while looking for indexers, this is needed because the
16028         indexer may have a different name in our base classes.  Fixed the
16029         error reporting (no indexers at all, not get accessor, no
16030         overloaded match).  Fixes bug #33089.
16031         (IndexerAccess.DoResolveLValue): Likewise.
16032
16033 2002-11-14  Martin Baulig  <martin@ximian.com>
16034
16035         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16036         indexers.  Fixes the first part of bug #33089.
16037         (MethodSignature.InheritableMemberSignatureCompare): Added support
16038         for properties.
16039
16040 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16041
16042         * attribute.cs (Attribute.Resolve): Catch the
16043         NullReferenceException and report it since it isn't supposed to
16044         happen. 
16045
16046 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16047
16048         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16049         LogicalOr and LogicalAnd that can benefit from recursively
16050         handling EmitBranchable.  The code now should be nice for Paolo.
16051
16052 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16053
16054         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16055         the Type lookups, as we perform quite a number of lookups on
16056         non-Types.  This can be removed once we can deterministically tell
16057         whether we have a type or a namespace in advance.
16058
16059         But this might require special hacks from our corlib.
16060
16061         * TODO: updated.
16062
16063         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16064         and double which avoids a conversion from an integer to a double.
16065
16066         * expression.cs: tiny optimization, avoid calling IsConstant,
16067         because it effectively performs the lookup twice.
16068
16069 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16070
16071         But a bogus return here to keep the semantics of the old code
16072         until the Mono runtime is fixed.
16073
16074         * pending.cs (GetMissingInterfaces): New method used to remove all
16075         the interfaces that are already implemented by our parent
16076         classes from the list of pending methods. 
16077
16078         * interface.cs: Add checks for calls after ResolveTypeExpr.
16079
16080 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16081
16082         * class.cs (Class.Emit): Report warning 67: event not used if the
16083         warning level is beyond 3.
16084
16085         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16086         being a NullLiteral.
16087
16088         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16089         specifiers. 
16090
16091         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16092         path that might fail if a type can not be resolved.
16093
16094         * expression.cs (Binary.Emit): Emit unsigned versions of the
16095         operators. 
16096
16097         * driver.cs: use error 5.
16098
16099 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16100
16101         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16102
16103 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16104
16105         * cs-parser.jay (switch_section): A beautiful patch from Martin
16106         Baulig that fixed 33094.
16107
16108 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16109
16110         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16111         Check whether the base is abstract and report an error if so.
16112
16113         * expression.cs (IndexerAccess.DoResolveLValue,
16114         IndexerAccess.DoResolve): ditto. 
16115
16116         (Invocation.DoResolve): ditto.
16117
16118         (Invocation.FullMethodDesc): Improve the report string.
16119
16120         * statement.cs (Block): Eliminate IsVariableDefined as it is
16121         basically just a wrapper for GetVariableInfo.
16122
16123         * ecore.cs (SimpleName): Use new 
16124
16125         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16126         type, as we return the actual parameter ref/unref state on a
16127         different call.
16128
16129 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16130
16131         * support.cs: Return proper flags REF/OUT fixing the previous
16132         commit.  
16133
16134         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16135         not used to mean `ref' but `ref or out' in ParameterReference
16136
16137         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16138         full type signature instead of calling TypeManger.CSharpName
16139         ourselves. 
16140
16141         * support.cs (InternalParameters.ParameterDesc): Do not compare
16142         directly to the modflags, because REF/OUT will actually be bitsets
16143         if set. 
16144
16145         * delegate.cs (VerifyMethod): Check also the modifiers.
16146
16147         * cs-tokenizer.cs: Fix bug where floating point values with an
16148         exponent where a sign was missing was ignored.
16149
16150         * driver.cs: Allow multiple assemblies to be specified in a single
16151         /r: argument
16152
16153 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16154
16155         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16156         because identifiers after a parenthesis would end up in this kind
16157         of production, and we needed to desamiguate it for having casts
16158         like:
16159
16160                 (UserDefinedType *) xxx
16161
16162 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16163
16164         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16165         we should set on the Bindingflags.NonPublic, but not turn on
16166         private_ok.  private_ok controls whether a Private member is
16167         returned (this is chekced on the filter routine), while the
16168         BindingFlags.NonPublic just controls whether private/protected
16169         will be allowed.   This fixes the problem part of the problem of
16170         private properties being allowed to be used in derived classes.
16171
16172         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16173         so we can call the children DoResolveLValue method (this will
16174         properly signal errors on lvalue assignments to base properties)
16175
16176         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16177         getter are null, and we have a property info, we know that this
16178         happened because the lookup failed, so we report an error 122 for
16179         protection level violation.
16180
16181         We also silently return if setter and getter are null in the
16182         resolve functions, this condition only happens if we have flagged
16183         the error before.  This is the other half of the problem. 
16184
16185         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16186         not have accessibility information, that is why we were returning
16187         true in the filter function in typemanager.cs.
16188
16189         To properly report 122 (property is inaccessible because of its
16190         protection level) correctly, we report this error in ResolveAccess
16191         by failing if both the setter and the getter are lacking (ie, the
16192         lookup failed). 
16193
16194         DoResolve and DoLResolve have been modified to check for both
16195         setter/getter being null and returning silently, the reason being
16196         that I did not want to put the knowledge about this error in upper
16197         layers, like:
16198
16199         int old = Report.Errors;
16200         x = new PropertyExpr (...);
16201         if (old != Report.Errors)
16202                 return null;
16203         else
16204                 return x;
16205
16206         So the property expr is returned, but it is invalid, so the error
16207         will be flagged during the resolve process. 
16208
16209         * class.cs: Remove InheritablePropertySignatureCompare from the
16210         class, as we no longer depend on the property signature to compute
16211         whether it is possible to implement a method or not.
16212
16213         The reason is that calling PropertyInfo.GetGetMethod will return
16214         null (in .NET, in Mono it works, and we should change this), in
16215         cases where the Get Method does not exist in that particular
16216         class.
16217
16218         So this code:
16219
16220         class X { public virtual int A { get { return 1; } } }
16221         class Y : X { }
16222         class Z : Y { public override int A { get { return 2; } } }
16223
16224         Would fail in Z because the parent (Y) would not have the property
16225         defined.  So we avoid this completely now (because the alternative
16226         fix was ugly and slow), and we now depend exclusively on the
16227         method names.
16228
16229         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16230         reference method, instead of using the property.
16231
16232         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16233         routines are gone now.
16234
16235         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16236         names, they were incorrectly named.
16237
16238         * cs-tokenizer.cs: Return are more gentle token on failure. 
16239
16240         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16241         had an out-of-sync index variable, which caused it to remove from
16242         the list of pending methods the wrong method sometimes.
16243
16244 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16245
16246         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16247         CanWrite, because those refer to this particular instance of the
16248         property, and do not take into account the fact that we can
16249         override single members of a property.
16250
16251         Constructor requires an EmitContext.  The resolution process does
16252         not happen here, but we need to compute the accessors before,
16253         because the resolution does not always happen for properties.
16254
16255         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16256         subclass, before we did not update this flag, but we did update
16257         bindingflags. 
16258
16259         (GetAccessors): Drop this routine, as it did not work in the
16260         presence of partially overwritten set/get methods. 
16261
16262         Notice that this broke the cs1540 detection, but that will require
16263         more thinking. 
16264
16265 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16266
16267         * class.cs:
16268         * codegen.cs:
16269         * driver.cs: issue a warning instead of an error if we don't support
16270         debugging for the platform. Also ignore a couple of errors that may
16271         arise when trying to write the symbols. Undo my previous patch.
16272
16273 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16274
16275         * driver.cs: ignore /debug switch except for Unix platforms.
16276
16277 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16278
16279         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16280
16281 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16282
16283         * driver.cs: Do not make mcs-debug conditional, so we do not break
16284         builds that use it.
16285
16286         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16287         review this patch.  But basically after all the children variables
16288         have been merged, the value of "Breaks" was not being set to
16289         new_breaks for Switch blocks.  I think that it should be set after
16290         it has executed.  Currently I set this to the value of new_breaks,
16291         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16292         conservative, but I do not understand this code very well.
16293
16294         I did not break anything in the build, so that is good ;-)
16295
16296         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16297
16298 2002-10-20  Mark Crichton  <crichton@gimp.org>
16299
16300         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16301
16302 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16303
16304         * cfold.cs: Fixed compile blocker.
16305
16306 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16307
16308         * driver.cs: I was chekcing the key, not the file.
16309
16310 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16311
16312         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16313         message that we were generating - we just need to silently return
16314         a null.
16315
16316 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16317
16318         * class.cs (Event.Define): Change my previous commit, as this
16319         breaks the debugger.  This is a temporary hack, as it seems like
16320         the compiler is generating events incorrectly to begin with.
16321
16322         * expression.cs (Binary.ResolveOperator): Added support for 
16323         "U operator - (E x, E y)"
16324
16325         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16326         y)".
16327
16328         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16329         init-only variables, but this path did not take into account that
16330         there might be also instance readonly variables.  Correct this
16331         problem. 
16332
16333         This fixes bug 32253
16334
16335         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16336         delegates as well.
16337
16338         * driver.cs: Change the extension for modules to `netmodule'
16339
16340         * cs-parser.jay: Improved slightly the location tracking for
16341         the debugger symbols.
16342
16343         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16344         modifiers that were specified instead of the hardcoded value
16345         (FamAndAssem).  This was basically ignoring the static modifier,
16346         and others.  Fixes 32429.
16347
16348         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16349         fixed a bug in the process (32476)
16350
16351         * expression.cs (ArrayAccess.EmitAssign): Patch from
16352         hwang_rob@yahoo.ca that fixes bug 31834.3
16353
16354 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16355
16356         * driver.cs: Make the module extension .netmodule.
16357
16358 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16359
16360         * driver.cs: Report an error if the resource file is not found
16361         instead of crashing.
16362
16363         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16364         false, like Emit does.
16365
16366 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16367
16368         * typemanager.cs: Remove unused private member.  Also reported mcs
16369         bug to report this as a warning like csc.
16370
16371 2002-10-15  Martin Baulig  <martin@gnome.org>
16372
16373         * statement.cs (Statement.Emit): Made this a virtual method; emits
16374         the line number info and calls DoEmit().
16375         (Statement.DoEmit): New protected abstract method, formerly knows
16376         as Statement.Emit().
16377
16378         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16379
16380 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16381
16382         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16383         have fixed a remaining problem: not every AddXXXX was adding a
16384         fully qualified name.  
16385
16386         Now everyone registers a fully qualified name in the DeclSpace as
16387         being defined instead of the partial name.  
16388
16389         Downsides: we are slower than we need to be due to the excess
16390         copies and the names being registered this way.  
16391
16392         The reason for this is that we currently depend (on the corlib
16393         bootstrap for instance) that types are fully qualified, because
16394         we dump all the types in the namespace, and we should really have
16395         types inserted into the proper namespace, so we can only store the
16396         basenames in the defined_names array.
16397
16398 2002-10-10  Martin Baulig  <martin@gnome.org>
16399
16400         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16401         from bug #31834, see the bug report for a testcase which is
16402         miscompiled.
16403
16404 2002-10-10  Martin Baulig  <martin@gnome.org>
16405
16406         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16407         flow analysis code for this.
16408
16409         * statement.cs (Do, While, For): Tell the flow analysis code about
16410         infinite loops.
16411         (FlowBranching.UsageVector): Added support for infinite loops.
16412         (Block.Resolve): Moved the dead code elimination here and use flow
16413         analysis to do it.
16414
16415 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16416
16417         * class.cs (Field.Define): Catch cycles on struct type
16418         definitions. 
16419
16420         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16421         fields if the fields are static.  We only need to check instance
16422         fields. 
16423
16424         * expression.cs (As.DoResolve): Test for reference type.
16425
16426         * statement.cs (Using.ResolveExpression): Use
16427         ConvertImplicitRequired, not ConvertImplicit which reports an
16428         error on failture
16429         (Using.ResolveLocalVariableDecls): ditto.
16430
16431         * expression.cs (Binary.ResolveOperator): Report errors in a few
16432         places where we had to.
16433
16434         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16435
16436 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16437
16438         * expression.cs: Use StoreFromPtr instead of extracting the type
16439         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16440
16441         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16442         an enumeration value to a System.Enum, but System.Enum is not a
16443         value type, but an class type, so we need to box.
16444
16445         (Expression.ConvertExplicit): One codepath could return
16446         errors but not flag them.  Fix this.  Fixes #31853
16447
16448         * parameter.cs (Resolve): Do not allow void as a parameter type.
16449
16450 2002-10-06  Martin Baulig  <martin@gnome.org>
16451
16452         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16453         if it's a class type and not a struct.  Fixes #31815.
16454
16455 2002-10-06  Martin Baulig  <martin@gnome.org>
16456
16457         * statement.cs: Reworked the flow analysis code a bit to make it
16458         usable for dead code elimination.
16459
16460 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16461
16462         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16463
16464 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16465
16466         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16467         to fix the test 165, will investigate deeper.
16468
16469 2002-10-04  Martin Baulig  <martin@gnome.org>
16470
16471         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16472         finally blocks actually work.
16473         (Try.Resolve): We don't need to create a sibling for `finally' if
16474         there is no finally block.
16475
16476 2002-10-04  Martin Baulig  <martin@gnome.org>
16477
16478         * class.cs (Constructor.Define): The default accessibility for a
16479         non-default constructor is private, not public.
16480
16481 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16482
16483         * class.cs (Constructor): Make AllowedModifiers public, add
16484         EXTERN.
16485
16486         * cs-parser.jay: Perform the modifiers test here, as the
16487         constructor for the Constructor class usually receives a zero
16488         because of the way we create it (first we create, later we
16489         customize, and we were never checking the modifiers).
16490
16491         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16492         is a version of LookupTypeReflection that includes the type-name
16493         cache.  This can be used as a fast path for functions that know
16494         the fully qualified name and are only calling into *.GetType() to
16495         obtain a composed type.
16496
16497         This is also used by TypeManager.LookupType during its type
16498         composition.
16499
16500         (LookupType): We now also track the real type name, as sometimes
16501         we can get a quey for the real type name from things like
16502         ComposedCast.  This fixes bug 31422.
16503
16504         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16505         complete type fullname, it does not have to go through the type
16506         resolution system to obtain the composed version of the type (for
16507         obtaining arrays or pointers).
16508
16509         (Conditional.Emit): Use the EmitBoolExpression to
16510         generate nicer code, as requested by Paolo.
16511
16512         (ArrayCreation.CheckIndices): Use the patch from
16513         hwang_rob@yahoo.ca to validate the array initializers. 
16514
16515 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16516
16517         * class.cs (ConstructorInitializer.Emit): simplify code by using
16518         Invocation.EmitCall, and at the same time, fix the bugs in calling
16519         parent constructors that took variable arguments. 
16520
16521         * ecore.cs (Expression.ConvertNumericExplicit,
16522         Expression.ImplicitNumericConversion): Remove the code that
16523         manually wrapped decimal (InternalTypeConstructor call is now gone
16524         as well).
16525
16526         * expression.cs (Cast.TryReduce): Also handle decimal types when
16527         trying to perform a constant fold on the type.
16528
16529         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16530
16531         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16532         that only turned off an error report, and did nothing else. 
16533
16534 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16535
16536         * driver.cs: Handle and ignore /fullpaths
16537
16538 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16539
16540         * expression.cs (Binary.ResolveOperator): Catch the case where
16541         DoNumericPromotions returns true, 
16542
16543         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16544
16545 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16546
16547         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16548         report error 70.
16549
16550 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16551
16552         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16553         conversion exists, but it is also required that the conversion be
16554         performed.  This manifested in "(Type64Enum) 2".  
16555
16556         * class.cs (TypeManager.AddMethod): The fix is not to change
16557         AddEnum, because that one was using a fully qualified name (every
16558         DeclSpace derivative does), but to change the AddMethod routine
16559         that was using an un-namespaced name.  This now correctly reports
16560         the duplicated name.
16561
16562         Revert patch until I can properly fix it.  The issue
16563         is that we have a shared Type space across all namespaces
16564         currently, which is wrong.
16565
16566         Options include making the Namespace a DeclSpace, and merge
16567         current_namespace/current_container in the parser.
16568
16569 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16570
16571         * cs-parser.jay: Improve error reporting when we get a different
16572         kind of expression in local_variable_type and
16573         local_variable_pointer_type. 
16574
16575         Propagate this to avoid missleading errors being reported.
16576
16577         * ecore.cs (ImplicitReferenceConversion): treat
16578         TypeManager.value_type as a target just like object_type.   As
16579         code like this:
16580
16581         ValueType v = 1;
16582
16583         Is valid, and needs to result in the int 1 being boxed before it
16584         is assigned to the value type v.
16585
16586         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16587         to validate the enumeration name.
16588
16589         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16590         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16591         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16592
16593         * ecore.cs (TryImplicitIntConversion): When doing an
16594         implicit-enumeration-conversion, check if the type is 64-bits and
16595         perform a conversion before passing to EnumConstant.
16596
16597 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16598
16599         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16600         report ambiguous type references.  Unlike the MS version, we
16601         report what the ambiguity is.   Innovation at work ;-)
16602
16603         (DeclSpace.FindType): Require a location argument to
16604         display when we display an ambiguous error.
16605
16606         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16607
16608         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16609
16610         * expression.cs (EmitDynamicInitializers): Apply patch from
16611         hwang_rob@yahoo.ca that fixes the order in which we emit our
16612         initializers. 
16613
16614 2002-09-21  Martin Baulig  <martin@gnome.org>
16615
16616         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16617         delegate takes no arguments.
16618
16619 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16620
16621         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16622         from integers.
16623
16624         * expression.cs: Extract the underlying type.
16625
16626         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16627
16628         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16629
16630 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16631
16632         * class.cs (TypeContainer.DefineType): We can not use the nice
16633         PackingSize with the size set to 1 DefineType method, because it
16634         will not allow us to define the interfaces that the struct
16635         implements.
16636
16637         This completes the fixing of bug 27287
16638
16639         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16640         means also structs.  This fixes part of the problem. 
16641         (Expresion.ImplicitReferenceConversionExists): ditto.
16642
16643         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16644         error if there were no errors reported during the type lookup
16645         process, to avoid duplicates or redundant errors.  Without this
16646         you would get an ambiguous errors plus a type not found.  We have
16647         beaten the user enough with the first error.  
16648
16649         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16650         reference. 
16651
16652         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16653         during the resolution process, stop the lookup, this avoids
16654         repeated error reports (same error twice).
16655
16656         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16657
16658         * typemanager.cs (LookupType): Redo the type lookup code to match
16659         the needs of System.Reflection.  
16660
16661         The issue is that System.Reflection requires references to nested
16662         types to begin with a "+" sign instead of a dot.  So toplevel
16663         types look like: "NameSpace.TopLevelClass", and nested ones look
16664         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16665         levels. 
16666
16667 2002-09-19  Martin Baulig  <martin@gnome.org>
16668
16669         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16670         says that a method always returns or always throws an exception,
16671         don't report the CS0161.
16672
16673         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16674         set `Returns = new_returns'.
16675
16676 2002-09-19  Martin Baulig  <martin@gnome.org>
16677
16678         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16679         to an enum constant, check for a CS0176.
16680
16681 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16682
16683         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16684         for operators that must be in pairs and report errors.
16685
16686         * ecore.cs (SimpleName.DoResolveType): During the initial type
16687         resolution process, when we define types recursively, we must
16688         check first for types in our current scope before we perform
16689         lookups in the enclosing scopes.
16690
16691         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16692
16693         (Invocation.VerifyArgumentsCompat): Call
16694         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16695         I thought we were supposed to always call this, but there are a
16696         few places in the code where we dont do it.
16697
16698 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * driver.cs: Add support in -linkres and -resource to specify the
16701         name of the identifier.
16702
16703 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16704
16705         * ecore.cs (StandardConversionExists): Sync with the conversion
16706         code: allow anything-* to void* conversions.
16707
16708         (FindMostSpecificSource): Use an Expression argument
16709         instead of a Type, because we might be handed over a Literal which
16710         gets a few more implicit conversions that plain types do not.  So
16711         this information was being lost.
16712
16713         Also, we drop the temporary type-holder expression when not
16714         required.
16715
16716 2002-09-17  Martin Baulig  <martin@gnome.org>
16717
16718         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16719         this is an explicit interface implementation.
16720
16721 2002-09-17  Martin Baulig  <martin@gnome.org>
16722
16723         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16724         different `IndexerName' attributes.
16725
16726         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16727         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16728         virtual CommonResolve().
16729
16730 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16731
16732         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16733         and convert that to the UnderlyingType.
16734
16735         * statement.cs (Foreach.Resolve): Indexers are just like variables
16736         or PropertyAccesses.
16737
16738         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16739         inside quoted strings, we were not doing this before.
16740
16741 2002-09-16  Martin Baulig  <martin@gnome.org>
16742
16743         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16744         resolve it.  This is needed for the definite assignment check of the
16745         instance expression, fixes bug #29846.
16746         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16747
16748 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16749
16750         * parameter.cs: Fix compile error.  Cannot reference static member
16751         from an instance object.  Is this an mcs bug?
16752
16753 2002-09-14  Martin Baulig  <martin@gnome.org>
16754
16755         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16756         multiple times.  Fixes bug #30295, added test-166.cs.
16757
16758 2002-09-14  Martin Baulig  <martin@gnome.org>
16759
16760         * statement.cs (Block.Emit): Don't emit unreachable code.
16761         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16762         `break' statements.
16763         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16764
16765 2002-09-14  Martin Baulig  <martin@gnome.org>
16766
16767         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16768         is set.
16769
16770 2002-09-14  Martin Baulig  <martin@gnome.org>
16771
16772         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16773         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16774         be false on the ms runtime.
16775
16776 2002-09-13  Martin Baulig  <martin@gnome.org>
16777
16778         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16779         the CS0038 error message.
16780
16781 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16782
16783         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16784         constant inside, return it.
16785
16786 2002-09-12  Martin Baulig  <martin@gnome.org>
16787
16788         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16789         implicit conversion can be done between enum types.
16790
16791         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16792         check whether an implicit conversion to the current enum's UnderlyingType
16793         exists and report an error if not.
16794
16795         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16796         without debugging support.
16797
16798         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16799         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16800
16801 2002-09-12  Martin Baulig  <martin@gnome.org>
16802
16803         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16804
16805         * ecore.cs (IMemberExpr.DeclaringType): New property.
16806         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16807         nonstatic member of an outer type (CS0038).
16808
16809 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16810
16811         * driver.cs: Activate the using-error detector at warning level
16812         4 (at least for MS-compatible APIs).
16813
16814         * namespace.cs (VerifyUsing): Small buglett fix.
16815
16816         * pending.cs (PendingImplementation): pass the container pointer. 
16817
16818         * interface.cs (GetMethods): Allow for recursive definition.  Long
16819         term, I would like to move every type to support recursive
16820         definitions, not the current ordering mechanism that we have right
16821         now.
16822
16823         The situation is this: Attributes are handled before interfaces,
16824         so we can apply attributes to interfaces.  But some attributes
16825         implement interfaces, we will now handle the simple cases
16826         (recursive definitions will just get an error).  
16827
16828         * parameter.cs: Only invalidate types at the end if we fail to
16829         lookup all types.  
16830
16831 2002-09-09  Martin Baulig  <martin@gnome.org>
16832
16833         * ecore.cs (PropertyExpr.Emit): Also check for
16834         TypeManager.system_int_array_get_length so this'll also work when
16835         compiling corlib.  Fixes #30003.
16836
16837 2002-09-09  Martin Baulig  <martin@gnome.org>
16838
16839         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16840         and throw an exception if we can't get the type's size.  Fixed #30040,
16841         added test-165.cs.
16842
16843 2002-09-09  Martin Baulig  <martin@gnome.org>
16844
16845         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16846
16847         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16848         context.  Fixes bug #30027.
16849
16850         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16851         virtual functions.  Fixes bug #30043, added test-164.cs.
16852
16853 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16854
16855         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16856
16857 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16858
16859         * driver.cs: Use an object to get the windows codepage since it's not a
16860         static property.
16861
16862 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16863
16864         * statement.cs (For.Emit): for infinite loops (test == null)
16865         return whether there is a break inside, not always "true".
16866
16867         * namespace.cs (UsingEntry): New struct to hold the name of the
16868         using definition, the location where it is defined, and whether it
16869         has been used in a successful type lookup.
16870
16871         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16872         strings.
16873
16874         * decl.cs: ditto.
16875
16876 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16877
16878         * attribute.cs : Fix incorrect code which relied on catching
16879         a NullReferenceException to detect a null being passed in
16880         where an object was expected.
16881
16882 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16883
16884         * statement.cs (Try): flag the catch variable as assigned
16885
16886         * expression.cs (Cast): Simplified by using ResolveType instead of
16887         manually resolving.
16888
16889         * statement.cs (Catch): Fix bug by using ResolveType.
16890
16891 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16892
16893         * expression.cs (BetterConversion): Special case for when we have
16894         a NullLiteral as the argument and we have to choose between string
16895         and object types - we choose string the way csc does.
16896
16897         * attribute.cs (Attribute.Resolve): Catch the
16898         NullReferenceException and report error #182 since the Mono
16899         runtime no more has the bug and having this exception raised means
16900         we tried to select a constructor which takes an object and is
16901         passed a null.
16902
16903 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16904
16905         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16906         message (1502, 1503) when we can't locate a method after overload
16907         resolution. This is much more informative and closes the bug
16908         Miguel reported.
16909
16910         * interface.cs (PopulateMethod): Return if there are no argument
16911         types. Fixes a NullReferenceException bug.
16912
16913         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16914         expressions too. Previously we were checking only in one place for
16915         positional arguments leaving out named arguments.
16916
16917         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16918         type to the enum type is not allowed. Remove code corresponding to
16919         that.
16920
16921         (ConvertNumericExplicit): Allow explicit conversions from
16922         the underlying type to enum type. This precisely follows the spec
16923         and closes a bug filed by Gonzalo.
16924
16925 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16926
16927         * compiler.csproj:
16928         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16929
16930 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16931
16932         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16933         it was important that we stored the right value after the
16934         reduction in `converted'.
16935
16936 2002-09-04  Martin Baulig  <martin@gnome.org>
16937
16938         * location.cs (Location.SymbolDocument): Use full pathnames for the
16939         source files.
16940
16941 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16942
16943         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16944         of the expression resolve mechanism, because that will catch the
16945         SimpleName error failures.
16946
16947         (Conditional): If we can not resolve the
16948         expression, return, do not crash.
16949
16950 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16951
16952         * cs-tokenizer.cs:
16953         (location): display token name instead of its number.
16954
16955 2002-08-28  Martin Baulig  <martin@gnome.org>
16956
16957         * expression.cs (Binary.ResolveOperator): Don't silently return
16958         but return an error if an operator cannot be applied between two
16959         enum types.
16960
16961 2002-08-28  Martin Baulig  <martin@gnome.org>
16962
16963         * class.cs (Constructor.Define): Set the permission attributes
16964         correctly instead of making all constructors public.
16965
16966 2002-08-28  Martin Baulig  <martin@gnome.org>
16967
16968         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16969         for private members before reporting a CS0103; if we find anything,
16970         it's a CS0122.
16971
16972 2002-08-28  Martin Baulig  <martin@gnome.org>
16973
16974         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16975         to check whether `closure_start_type == closure_invocation_type',
16976         we also need to check whether `m.DeclaringType == closure_invocation_type'
16977         before bypassing the permission checks.  We might be accessing
16978         protected/private members from the base class.
16979         (TypeManager.RealMemberLookup): Only set private_ok if private
16980         members were requested via BindingFlags.NonPublic.
16981
16982         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16983
16984         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16985         MethodGroupExpr.IsExplicitImpl if appropriate.
16986         (Invocation.DoResolve): Don't report the CS0120 for explicit
16987         interface implementations.
16988
16989 2002-08-27  Martin Baulig  <martin@gnome.org>
16990
16991         * expression.cs (Invocation.DoResolve): If this is a static
16992         method and we don't have an InstanceExpression, we must report
16993         a CS0120.
16994
16995 2002-08-25  Martin Baulig  <martin@gnome.org>
16996
16997         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16998         `==' between a valuetype and an object.
16999
17000 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17001
17002         * ecore.cs (TypeExpr): Provide a ToString method.
17003
17004 2002-08-24  Martin Baulig  <martin@gnome.org>
17005
17006         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17007         now called proggie.dbg and it's a binary file.
17008
17009 2002-08-23  Martin Baulig  <martin@gnome.org>
17010
17011         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17012
17013 2002-08-23  Martin Baulig  <martin@gnome.org>
17014
17015         * struct.cs (MyStructInfo.ctor): Make this work with empty
17016         structs; it's not allowed to use foreach() on null.
17017
17018 2002-08-23  Martin Baulig  <martin@gnome.org>
17019
17020         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17021         writer the full pathname of the generated assembly.
17022
17023 2002-08-23  Martin Baulig  <martin@gnome.org>
17024
17025         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17026         A `finally' block never returns or breaks; improved handling of
17027         unreachable code.
17028
17029 2002-08-23  Martin Baulig  <martin@gnome.org>
17030
17031         * statement.cs (Throw.Resolve): Allow `throw null'.
17032
17033 2002-08-23  Martin Baulig  <martin@gnome.org>
17034
17035         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17036         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17037         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17038         MemberLookup would return a wrong event if this is an explicit
17039         interface implementation and the class has an event with the same
17040         name.
17041
17042 2002-08-23  Martin Baulig  <martin@gnome.org>
17043
17044         * statement.cs (Block.AddChildVariableNames): New public method.
17045         (Block.AddChildVariableName): Likewise.
17046         (Block.IsVariableNameUsedInChildBlock): Likewise.
17047         (Block.AddVariable): Check whether a variable name has already
17048         been used in a child block.
17049
17050         * cs-parser.jay (declare_local_variables): Mark all variable names
17051         from the current block as being used in a child block in the
17052         implicit block.
17053
17054 2002-08-23  Martin Baulig  <martin@gnome.org>
17055
17056         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17057         find the symbol writer.
17058
17059         * driver.cs: csc also allows the arguments to /define being
17060         separated by commas, not only by semicolons.
17061
17062 2002-08-23  Martin Baulig  <martin@gnome.org>
17063
17064         * interface.cs (Interface.GetMembers): Added static check for events.
17065
17066 2002-08-15  Martin Baulig  <martin@gnome.org>
17067
17068         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17069         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17070
17071         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17072         why the MethodData.EmitDestructor() change was necessary.
17073
17074 2002-08-20  Martin Baulig  <martin@gnome.org>
17075
17076         * class.cs (TypeContainer.FindMembers): Added static check for events.
17077
17078         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17079
17080         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17081         use Type.GetEvents(), not Type.FindMembers().
17082
17083 2002-08-20  Martin Baulig  <martin@gnome.org>
17084
17085         * decl.cs (MemberCache): Added a special method cache which will
17086         be used for method-only searched.  This ensures that a method
17087         search will return a MethodInfo with the correct ReflectedType for
17088         inherited methods.      
17089
17090 2002-08-20  Martin Baulig  <martin@gnome.org>
17091
17092         * decl.cs (DeclSpace.FindMembers): Made this public.
17093
17094 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17095
17096         * delegate.cs: fixed build on windows.
17097         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17098
17099 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17100
17101         * ecore.cs (StandardConversionExists): Return a false
17102         if we are trying to convert the void type to anything else
17103         since that is not allowed.
17104
17105         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17106         we flag error 70 in the event an event is trying to be accessed
17107         directly from outside the declaring type.
17108
17109 2002-08-20  Martin Baulig  <martin@gnome.org>
17110
17111         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17112         MemberCache from typemanager.cs to decl.cs.
17113
17114 2002-08-19  Martin Baulig  <martin@gnome.org>
17115
17116         * class.cs (TypeContainer): Implement IMemberContainer.
17117         (TypeContainer.DefineMembers): Create the MemberCache.
17118         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17119         return public members if BindingFlags.Public was given, check
17120         whether members are static.
17121
17122 2002-08-16  Martin Baulig  <martin@gnome.org>
17123
17124         * decl.cs (DeclSpace.Define): Splitted this in Define and
17125         DefineMembers.  DefineMembers is called first and initializes the
17126         MemberCache.
17127
17128         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17129         DefineMembers() on all our DeclSpaces.
17130
17131         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17132         but call DefineMembers() on all nested interfaces.  We call their
17133         Define() in our new Define() function.
17134
17135         * interface.cs (Interface): Implement IMemberContainer.
17136         (Interface.Define): Moved all code except the attribute stuf to
17137         DefineMembers().
17138         (Interface.DefineMembers): Initialize the member cache.
17139
17140         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17141         need this anymore since we can use MemberCache.FindMembers directly.
17142
17143 2002-08-19  Martin Baulig  <martin@gnome.org>
17144
17145         * typemanager.cs (MemberCache): When creating the cache for an
17146         interface type, add all inherited members.
17147         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17148         to `out bool used_cache' and documented it.
17149         (TypeManager.MemberLookup): If we already used the cache in the first
17150         iteration, we don't need to do the interfaces check.
17151
17152 2002-08-19  Martin Baulig  <martin@gnome.org>
17153
17154         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17155         here from IMemberFinder and don't implement this interface anymore.
17156         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17157
17158         * typemanager.cs (IMemberFinder): This interface is now only used by
17159         classes which actually support the member cache.
17160         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17161         since we only put DeclSpaces into this Hashtable.
17162         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17163         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17164
17165 2002-08-16  Martin Baulig  <martin@gnome.org>
17166
17167         * typemanager.cs (ICachingMemberFinder): Removed.
17168         (IMemberFinder.MemberCache): New property.
17169         (TypeManager.FindMembers): Merged this with RealFindMembers().
17170         This function will never be called from TypeManager.MemberLookup()
17171         so we can't use the cache here, just the IMemberFinder.
17172         (TypeManager.MemberLookup_FindMembers): Check whether the
17173         IMemberFinder has a MemberCache and call the cache's FindMembers
17174         function.
17175         (MemberCache): Rewrote larger parts of this yet another time and
17176         cleaned it up a bit.
17177
17178 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17179
17180         * driver.cs (LoadArgs): Support quoting.
17181
17182         (Usage): Show the CSC-like command line arguments.
17183
17184         Improved a few error messages.
17185
17186 2002-08-15  Martin Baulig  <martin@gnome.org>
17187
17188         * typemanager.cs (IMemberContainer.Type): New property.
17189         (IMemberContainer.IsInterface): New property.
17190
17191         The following changes are conditional to BROKEN_RUNTIME, which is
17192         defined at the top of the file.
17193
17194         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17195         class'es members, but add all members from TypeHandle.ObjectType
17196         if we're an interface.
17197         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17198         is the current type.
17199         (MemberCache.CacheEntry.Container): Removed this field.
17200         (TypeHandle.GetMembers): Include inherited members.
17201
17202 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17203
17204         * typemanager.cs: fixed compilation and added a comment on a field that
17205         is never used.
17206
17207 2002-08-15  Martin Baulig  <martin@gnome.org>
17208
17209         * class.cs (ConstructorInitializer.Resolve): In the
17210         Expression.MemberLookup call, use the queried_type as
17211         invocation_type.
17212
17213         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17214         declared' attribute, it's always true.
17215         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17216         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17217         temporary wrapper for FindMembers which tells MemberLookup whether
17218         members from the base classes are included in the return value.
17219         This will go away soon.
17220         (TypeManager.MemberLookup): Use this temporary hack here; once the
17221         new MemberCache is completed, we don't need to do the DeclaredOnly
17222         looping here anymore since the MemberCache will take care of this.
17223         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17224         (MemberCache): When creating the MemberCache for a class, get
17225         members from the current class and all its base classes.
17226         (MemberCache.CacheEntry.Container): New field.  This is a
17227         temporary hack until the Mono runtime is fixed to distinguish
17228         between ReflectedType and DeclaringType.  It allows us to use MCS
17229         with both the MS runtime and the unfixed Mono runtime without
17230         problems and without accecting performance.
17231         (MemberCache.SearchMembers): The DeclaredOnly looping from
17232         TypeManager.MemberLookup is now done here.      
17233
17234 2002-08-14  Martin Baulig  <martin@gnome.org>
17235
17236         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17237         Type.GetFields on dynamic types but get the fields from the
17238         corresponding TypeContainer.
17239         (MyStructInfo.GetStructInfo): Added check for enum types.
17240
17241         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17242         (MemberList.SyncRoot): Implemented.
17243         (TypeManager.FilterWithClosure): No need to check permissions if
17244         closure_start_type == closure_invocation_type, don't crash if
17245         closure_invocation_type is null.
17246
17247 2002-08-13  Martin Baulig  <martin@gnome.org>
17248
17249         Rewrote TypeContainer.FindMembers to use a member cache.  This
17250         gives us a speed increase of about 35% for the self-hosting MCS
17251         build and of about 15-20% for the class libs (both on GNU/Linux).
17252
17253         * report.cs (Timer): New class to get enhanced profiling.  This
17254         whole class is "TIMER" conditional since it remarkably slows down
17255         compilation speed.
17256
17257         * class.cs (MemberList): New class.  This is an IList wrapper
17258         which we're now using instead of passing MemberInfo[]'s around to
17259         avoid copying this array unnecessarily.
17260         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17261         (ICachingMemberFinder, IMemberContainer): New interface.
17262         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17263         has already been checked, otherwise use it for the name comparision.
17264         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17265         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17266         if possible.  Returns a MemberList, not a MemberInfo [].
17267         (TypeHandle): New class, implements IMemberContainer.  We create
17268         one instance of this class per type, it contains a MemberCache
17269         which is used to do the member lookups.
17270         (MemberCache): New class.  Each instance of this class contains
17271         all members of a type and a name-based hash table.
17272         (MemberCache.FindMembers): This is our new member lookup
17273         function.  First, it looks up all members of the requested name in
17274         the hash table.  Then, it walks this list and sorts out all
17275         applicable members and returns them.
17276
17277 2002-08-13  Martin Baulig  <martin@gnome.org>
17278
17279         In addition to a nice code cleanup, this gives us a performance
17280         increase of about 1.4% on GNU/Linux - not much, but it's already
17281         half a second for the self-hosting MCS compilation.
17282
17283         * typemanager.cs (IMemberFinder): New interface.  It is used by
17284         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17285         Enum, Delegate or Interface.
17286         (TypeManager.finder_to_member_finder): New PtrHashtable.
17287         (TypeManager.finder_to_container): Removed.
17288         (TypeManager.finder_to_delegate): Removed.
17289         (TypeManager.finder_to_interface): Removed.
17290         (TypeManager.finder_to_enum): Removed.
17291
17292         * interface.cs (Interface): Implement IMemberFinder.
17293
17294         * delegate.cs (Delegate): Implement IMemberFinder.
17295
17296         * enum.cs (Enum): Implement IMemberFinder.
17297
17298         * class.cs (TypeContainer): Implement IMemberFinder.
17299
17300 2002-08-12  Martin Baulig  <martin@gnome.org>
17301
17302         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17303
17304 2002-08-12  Martin Baulig  <martin@gnome.org>
17305
17306         * ecore.cs (ITypeExpression): New interface for expressions which
17307         resolve to a type.
17308         (TypeExpression): Renamed to TypeLookupExpression.
17309         (Expression.DoResolve): If we're doing a types-only lookup, the
17310         expression must implement the ITypeExpression interface and we
17311         call DoResolveType() on it.
17312         (SimpleName): Implement the new ITypeExpression interface.
17313         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17314         hack, the situation that we're only looking up types can't happen
17315         anymore when this method is called.  Moved the type lookup code to
17316         DoResolveType() and call it.
17317         (SimpleName.DoResolveType): This ITypeExpression interface method
17318         is now doing the types-only lookup.
17319         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17320         (ResolveFlags): Added MaskExprClass.
17321
17322         * expression.cs (MemberAccess): Implement the ITypeExpression
17323         interface.
17324         (MemberAccess.DoResolve): Added support for a types-only lookup
17325         when we're called via ITypeExpression.DoResolveType().
17326         (ComposedCast): Implement the ITypeExpression interface.
17327
17328         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17329         Expression.Resolve() with ResolveFlags.Type instead.
17330
17331 2002-08-12  Martin Baulig  <martin@gnome.org>
17332
17333         * interface.cs (Interface.Define): Apply attributes.
17334
17335         * attribute.cs (Attribute.ApplyAttributes): Added support for
17336         interface attributes.
17337
17338 2002-08-11  Martin Baulig  <martin@gnome.org>
17339
17340         * statement.cs (Block.Emit): Only check the "this" variable if we
17341         do not always throw an exception.
17342
17343         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17344         whether the property has a set accessor.
17345
17346 2002-08-11  Martin Baulig  <martin@gnome.org>
17347
17348         Added control flow analysis support for structs.
17349
17350         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17351         with control flow analysis turned off.
17352         (IVariable): New interface.
17353         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17354         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17355         (FieldExpr.DoResolve): Resolve the instance expression with flow
17356         analysis turned off and do the definite assignment check after the
17357         resolving when we know what the expression will resolve to.
17358
17359         * expression.cs (LocalVariableReference, ParameterReference):
17360         Implement the new IVariable interface, only call the flow analysis
17361         code if ec.DoFlowAnalysis is true.
17362         (This): Added constructor which takes a Block argument.  Implement
17363         the new IVariable interface.
17364         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17365         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17366         This does the definite assignment checks for struct members.
17367
17368         * class.cs (Constructor.Emit): If this is a non-static `struct'
17369         constructor which doesn't have any initializer, call
17370         Block.AddThisVariable() to tell the flow analysis code that all
17371         struct elements must be initialized before control returns from
17372         the constructor.
17373
17374         * statement.cs (MyStructInfo): New public class.
17375         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17376         argument to this indexer.  If non-zero, check an individual struct
17377         member, not the whole struct.
17378         (FlowBranching.CheckOutParameters): Check struct members.
17379         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17380         overloaded versions of these methods which take an additional
17381         `int field_idx' argument to check struct members.
17382         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17383         overloaded versions of these methods which take an additional
17384         `string field_name' argument to check struct member.s
17385         (VariableInfo): Implement the IVariable interface.
17386         (VariableInfo.StructInfo): New public property.  Returns the
17387         MyStructInfo instance of the variable if it's a struct or null.
17388         (Block.AddThisVariable): New public method.  This is called from
17389         Constructor.Emit() for non-static `struct' constructor which do
17390         not have any initializer.  It creates a special variable for the
17391         "this" instance variable which will be checked by the flow
17392         analysis code to ensure that all of the struct's fields are
17393         initialized before control returns from the constructor.
17394         (UsageVector): Added support for struct members.  If a
17395         variable/parameter is a struct with N members, we reserve a slot
17396         in the usage vector for each member.  A struct is considered fully
17397         initialized if either the struct itself (slot 0) or all its
17398         members are initialized.
17399
17400 2002-08-08  Martin Baulig  <martin@gnome.org>
17401
17402         * driver.cs (Driver.MainDriver): Only report an error CS5001
17403         if there were no compilation errors.
17404
17405         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17406         `UnsafeContext' property to determine whether the parent is in
17407         unsafe context rather than checking the parent's ModFlags:
17408         classes nested in an unsafe class are unsafe as well.
17409
17410 2002-08-08  Martin Baulig  <martin@gnome.org>
17411
17412         * statement.cs (UsageVector.MergeChildren): Distinguish between
17413         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17414         we return.  Added test17() and test18() to test-154.cs.
17415
17416 2002-08-08  Martin Baulig  <martin@gnome.org>
17417
17418         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17419         Family access, make sure the invoking type isn't a subclass of the
17420         queried type (that'd be a CS1540).
17421
17422         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17423         this method which takes an additional `Type invocation_type'.
17424
17425         * expression.cs (BaseAccess.DoResolve): Use the base type as
17426         invocation and query type.
17427         (MemberAccess.DoResolve): If the lookup failed and we're about to
17428         report a CS0122, try a lookup with the ec.ContainerType - if this
17429         succeeds, we must report a CS1540.
17430
17431 2002-08-08  Martin Baulig  <martin@gnome.org>
17432
17433         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17434         (MethodGroupExpr): Implement the IMemberExpr interface.
17435
17436         * expression (MemberAccess.ResolveMemberAccess): No need to have
17437         any special code for MethodGroupExprs anymore, they're now
17438         IMemberExprs.   
17439
17440 2002-08-08  Martin Baulig  <martin@gnome.org>
17441
17442         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17443         Family, FamANDAssem and FamORAssem permissions.
17444         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17445
17446 2002-08-08  Martin Baulig  <martin@gnome.org>
17447
17448         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17449         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17450         or loop block.
17451
17452 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17453
17454         * driver.cs: implemented /resource option to embed managed resources.
17455
17456 2002-08-07  Martin Baulig  <martin@gnome.org>
17457
17458         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17459         (FieldBase.HasFieldInitializer): New public property.
17460         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17461         returns the field initializer and makes sure it is only resolved once.
17462         (TypeContainer.EmitFieldInitializers): Call
17463         FieldBase.GetInitializerExpression to get the initializer, this ensures
17464         that it isn't resolved multiple times.
17465
17466         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17467         the resolving process (SimpleName/MemberLookup) that we're currently
17468         emitting a field initializer (which must not access any instance members,
17469         this is an error CS0236).
17470
17471         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17472         argument, if the `IsFieldInitializer' flag is set, we must report and
17473         error CS0236 and not an error CS0120.   
17474
17475 2002-08-07  Martin Baulig  <martin@gnome.org>
17476
17477         * ecore.cs (IMemberExpr): New public interface.
17478         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17479         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17480         if the expression is an IMemberExpr.
17481
17482         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17483         to be null, implicitly default to `this' if we're non-static in
17484         this case.  Simplified the code a lot by using the new IMemberExpr
17485         interface.  Also fixed bug #28176 here.
17486
17487 2002-08-06  Martin Baulig  <martin@gnome.org>
17488
17489         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17490         ParameterReferences during semantic analysis so that we can do a
17491         type-only search when resolving Cast, TypeOf and SizeOf.
17492         (block): Pass the `current_local_parameters' to the Block's
17493         constructor.
17494
17495         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17496         argument to the constructor.
17497         (ConstructorInitializer.Resolve): Create a temporary implicit
17498         block with the parameters.
17499
17500         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17501         references here if we aren't doing a type-only search.
17502
17503         * statement.cs (Block): Added constructor which takes a
17504         `Parameters parameters' argument.
17505         (Block.Parameters): New public property.
17506
17507         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17508         to `Parameters' and made it public readonly.
17509
17510 2002-08-06  Martin Baulig  <martin@gnome.org>
17511
17512         * ecore.cs (Expression.Warning): Made this public as well.
17513
17514         * report.cs (Report.Debug): Print the contents of collections.
17515
17516 2002-08-06  Martin Baulig  <martin@gnome.org>
17517
17518         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17519         used to tell Resolve() which kinds of expressions it may return.
17520         (Expression.Resolve): Added overloaded version of this method which
17521         takes a `ResolveFlags flags' argument.  This can be used to tell
17522         Resolve() which kinds of expressions it may return.  Reports a
17523         CS0118 on error.
17524         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17525         ResolveFlags.SimpleName.
17526         (Expression.Error118): Added overloaded version of this method which
17527         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17528         which kinds of expressions are allowed.
17529
17530         * expression.cs (Argument.ResolveMethodGroup): New public method.
17531         Resolves an argument, but allows a MethodGroup to be returned.
17532         This is used when invoking a delegate.
17533
17534         * TODO: Updated a bit.
17535
17536 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17537
17538         Fixed compilation with csc.
17539
17540         * ecore.cs: Expression.Error made public. Is this correct? Should
17541         Warning be made public too?
17542
17543         * expression.cs: use ea.Location instead of ea.loc.
17544         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17545
17546 2002-08-06  Martin Baulig  <martin@gnome.org>
17547
17548         * ecore.cs (Expression.loc): Moved the location here instead of
17549         duplicating it in all derived classes.
17550         (Expression.Location): New public property.
17551         (Expression.Error, Expression.Warning): Made them non-static and
17552         removed the location argument.
17553         (Expression.Warning): Added overloaded version which takes an
17554         `int level' argument.
17555         (Expression.Error118): Make this non-static and removed the
17556         expression and location arguments.
17557         (TypeExpr): Added location argument to the constructor.
17558
17559         * expression.cs (StaticCallExpr): Added location argument to
17560         the constructor.
17561         (Indirection, PointerArithmetic): Likewise.
17562         (CheckedExpr, UnCheckedExpr): Likewise.
17563         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17564         (StringPtr): Likewise.
17565
17566
17567 2002-08-05  Martin Baulig  <martin@gnome.org>
17568
17569         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17570
17571         * assign.cs (Assign.DoResolve): Check whether the source
17572         expression is a value or variable.
17573
17574         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17575         while resolving the corresponding blocks.
17576
17577         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17578         an error, don't silently return null.
17579
17580         * statement.cs (Block.AddVariable): Do the error reporting here
17581         and distinguish between CS0128 and CS0136.
17582         (Block.DoResolve): Report all unused labels (warning CS0164).
17583         (LabeledStatement): Pass the location to the constructor.
17584         (LabeledStatement.HasBeenReferenced): New property.
17585         (LabeledStatement.Resolve): Set it to true here.
17586
17587         * statement.cs (Return.Emit): Return success even after reporting
17588         a type mismatch error (CS0126 or CS0127), this is what csc does and
17589         it avoids confusing the users with any consecutive errors.
17590
17591 2002-08-05  Martin Baulig  <martin@gnome.org>
17592
17593         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17594
17595         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17596
17597         * expression.cs (MemberAccess.DoResolve): Silently return if an
17598         error has already been reported.
17599
17600         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17601         error has already been reported.
17602
17603 2002-08-05  Martin Baulig  <martin@gnome.org>
17604
17605         * statement.cs (UsageVector): Only initialize the `parameters'
17606         vector if we actually have any "out" parameters.
17607
17608 2002-08-05  Martin Baulig  <martin@gnome.org>
17609
17610         * expression.cs (Binary.ResolveOperator): When combining delegates,
17611         they must have the same type.
17612
17613 2002-08-05  Martin Baulig  <martin@gnome.org>
17614
17615         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17616         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17617         work with the ms runtime and we also don't need it: if we're a
17618         PropertyBuilder and not in the `indexer_arguments' hash, then we
17619         are a property and not an indexer.
17620
17621         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17622         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17623         since the latter one doesn't work with the ms runtime.
17624
17625 2002-08-03  Martin Baulig  <martin@gnome.org>
17626
17627         Fixed bugs #27998 and #22735.
17628
17629         * class.cs (Method.IsOperator): New public field.
17630         (Method.CheckBase): Report CS0111 if there's already a method
17631         with the same parameters in the current class.  Report CS0508 when
17632         attempting to change the return type of an inherited method.
17633         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17634         and it's not marked abstract or extern.
17635         (PropertyBase): New abstract base class for Property and Indexer.
17636         (PropertyBase.CheckBase): Moved here from Property and made it work
17637         for indexers.
17638         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17639         the same so we can reuse it there.
17640         (Property, Indexer): Derive from PropertyBase.
17641         (MethodSignature.inheritable_property_signature_filter): New delegate
17642         to find properties and indexers.
17643
17644         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17645         argument and improved error reporting.
17646
17647         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17648         EmptyReadOnlyParameters and made it a property.
17649
17650         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17651         version of this method which takes a `PropertyInfo indexer'.
17652         (TypeManager.RegisterIndexer): New method.
17653
17654         * class.cs: Added myself as author of this file :-)
17655
17656 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17657
17658         * class.cs: fixed compilation on windoze.
17659
17660 2002-08-03  Martin Baulig  <martin@gnome.org>
17661
17662         * interface.cs (Interface.GetInterfaceBases): Check whether all
17663         base interfaces are at least as accessible than the current one.
17664
17665         * class.cs (TypeContainer.GetClassBases): Check whether base types
17666         are at least as accessible than the current type.
17667         (TypeContainer.AsAccessible): Implemented and made non-static.
17668         (MemberBase.CheckParameters): Report errors if the accessibility
17669         checks fail.
17670
17671         * delegate.cs (Delegate.Delegate): The default visibility is
17672         internal for top-level types and private for nested types.
17673         (Delegate.Define): Report errors if the accessibility checks fail.
17674
17675         * enum.cs (Enum.Enum): The default visibility is internal for
17676         top-level types and private for nested types.
17677         (Enum.DefineType): Compute the correct visibility.
17678
17679         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17680         function which takes a `bool is_toplevel' instead of a TypeContainer.
17681
17682         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17683         builtin type.
17684
17685 2002-08-02  Martin Baulig  <martin@gnome.org>
17686
17687         * expression.cs (LocalVariableReferenc): Added constructor which
17688         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17689         (LocalVariableReference.IsReadOnly): New property.
17690         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17691         variable is readonly, use our own readonly flag to do this; you can
17692         use the new constructor to get a writable reference to a read-only
17693         variable.
17694
17695         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17696         reference to the local variable.
17697
17698 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17699
17700         * rootcontext.cs (ResolveCore): Also include System.Exception
17701
17702         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17703         we reach an EmptyStatement.
17704
17705         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17706         is also fine.
17707
17708         * expression.cs (Binary.ResolveOperator): Check error result in
17709         two places.
17710
17711         use brtrue/brfalse directly and avoid compares to null.
17712
17713 2002-08-02  Martin Baulig  <martin@gnome.org>
17714
17715         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17716         Fixes bug #28407, added test-155.cs.
17717
17718 2002-08-01  Martin Baulig  <martin@gnome.org>
17719
17720         * class.cs (Event.EmitDefaultMethod): Make this work with static
17721         events.  Fixes #28311, added verify-3.cs.
17722
17723 2002-08-01  Martin Baulig  <martin@gnome.org>
17724
17725         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17726         `is_disposable' fields.
17727         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17728         `hm.is_disposable' if we're using the collection pattern.
17729         (Foreach.EmitCollectionForeach): Use the correct type for the
17730         enumerator's local variable, only emit the try/finally block if
17731         necessary (fixes #27713).
17732
17733 2002-08-01  Martin Baulig  <martin@gnome.org>
17734
17735         * ecore.cs (Expression.report118): Renamed to Error118 and made
17736         it public static.
17737
17738         * statement.cs (Throw.Resolve): Check whether the expression is of
17739         the correct type (CS0118) and whether the type derives from
17740         System.Exception (CS0155).
17741         (Catch.Resolve): New method.  Do the type lookup here and check
17742         whether it derives from System.Exception (CS0155).
17743         (Catch.CatchType, Catch.IsGeneral): New public properties.
17744
17745         * typemanager.cs (TypeManager.exception_type): Added.
17746
17747 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17748
17749         * driver.cs: Updated About function.
17750
17751 2002-07-31  Martin Baulig  <martin@gnome.org>
17752
17753         Implemented Control Flow Analysis.
17754
17755         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17756         (EmitContext.CurrentBranching): Added.
17757         (EmitContext.StartFlowBranching): Added.
17758         (EmitContext.EndFlowBranching): Added.
17759         (EmitContext.KillFlowBranching): Added.
17760         (EmitContext.IsVariableAssigned): Added.
17761         (EmitContext.SetVariableAssigned): Added.
17762         (EmitContext.IsParameterAssigned): Added.
17763         (EmitContext.SetParameterAssigned): Added.
17764         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17765         Added control flow analysis stuff here.
17766
17767         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17768         resolve the expression as lvalue.
17769         (LocalVariableReference.DoResolve): Check whether the variable has
17770         already been assigned.
17771         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17772         the parameter as assigned here.
17773         (ParameterReference.DoResolve): Check whether the parameter has already
17774         been assigned.
17775         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17776         expression as lvalue.
17777
17778         * statement.cs (FlowBranching): New class for the flow analysis code.
17779         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17780         (LabeledStatement.IsDefined): New public property.
17781         (LabeledStatement.AddUsageVector): New public method to tell flow
17782         analyis that the label may be reached via a forward jump.
17783         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17784         flow analysis.
17785         (VariableInfo.Number): New public field.  This is used by flow analysis
17786         to number all locals of a block.
17787         (Block.CountVariables): New public property.  This is the number of
17788         local variables in this block (including the locals from all parent
17789         blocks).
17790         (Block.EmitMeta): Number all the variables.
17791
17792         * statement.cs: Added flow analysis support to all classes.
17793
17794 2002-07-31  Martin Baulig  <martin@gnome.org>
17795
17796         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17797         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17798         then use this argument.
17799
17800         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17801
17802         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17803         use this to specify /define options.
17804
17805 2002-07-29  Martin Baulig  <martin@gnome.org>
17806
17807         * statement.cs (Fixed): Moved all code that does variable lookups
17808         and resolvings from Emit to Resolve.
17809
17810         * statement.cs (For): Moved all code that does variable lookups
17811         and resolvings from Emit to Resolve.
17812
17813         * statement.cs (Using): Moved all code that does variable lookups
17814         and resolvings from Emit to Resolve.
17815
17816 2002-07-29  Martin Baulig  <martin@gnome.org>
17817
17818         * attribute.cs (Attribute.Resolve): Explicitly catch a
17819         System.NullReferenceException when creating the
17820         CustromAttributeBuilder and report a different warning message.
17821
17822 2002-07-29  Martin Baulig  <martin@gnome.org>
17823
17824         * support.cs (ParameterData.ParameterName): Added method to
17825         get the name of a parameter.
17826
17827         * typemanager.cs (TypeManager.IsValueType): New public method.
17828
17829 2002-07-29  Martin Baulig  <martin@gnome.org>
17830
17831         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17832         is a flag which specifies that it's either ref or out.
17833         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17834         the out parameter to `out Parameter.Modifier mod', also set the
17835         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17836
17837         * support.cs (InternalParameters.ParameterModifier): Distinguish
17838         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17839         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17840
17841         * expression.cs (Argument.GetParameterModifier): Distinguish
17842         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17843         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17844
17845 2002-07-29  Martin Baulig  <martin@gnome.org>
17846
17847         * expression.cs (ParameterReference.ParameterReference): Added
17848         `Location loc' argument to the constructor.
17849
17850         * cs-parser.jay: Pass location to ParameterReference.
17851
17852 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17853
17854         * statement.cs (Try): Initialize the location.
17855
17856         * cs-parser.jay: pass location to Try.
17857
17858         * expression.cs (Unary.Reduce): Change the prototype to return
17859         whether a constant fold could be performed or not.  The result is
17860         returned in an out parameters.  In the case of Indirection and
17861         AddressOf, we want to perform the full tests.
17862
17863 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17864
17865         * statement.cs (Statement.Emit): Flag dead code.
17866
17867 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17868
17869         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17870
17871 2002-07-27  Martin Baulig  <martin@gnome.org>
17872
17873         * class.cs (MethodData.Define): Put back call to
17874         TypeManager.AddMethod(), accidentally commented this out.
17875
17876         * report.cs (Debug): New public method to print debugging information,
17877         this is `[Conditional ("DEBUG")]'.
17878
17879 2002-07-26  Martin Baulig  <martin@gnome.org>
17880
17881         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17882         (switch_statement): Push the current_block to the switch_stack and
17883         pop it again when we're done with the switch.
17884         (switch_section): The new block is a child of the current_block.
17885         Fixes bug #24007, added test-152.cs.
17886
17887 2002-07-27  Martin Baulig  <martin@gnome.org>
17888
17889         * expression.cs (Invocation.EmitArguments): When calling a varargs
17890         function with only its fixed arguments, we need to pass an empty
17891         array.
17892
17893 2002-07-27  Martin Baulig  <martin@gnome.org>
17894
17895         Mono 0.13 has been released.
17896
17897 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17898
17899         * driver.cs: Rename --resource to --linkres, because that is what
17900         we do currently, we dont support --resource yet.
17901
17902         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17903
17904 2002-07-25  Martin Baulig  <martin@gnome.org>
17905
17906         * class.cs (MethodData): New public class.  This is a `method builder'
17907         class for a method or one accessor of a Property/Indexer/Event.
17908         (MethodData.GetMethodFlags): Moved here from MemberBase.
17909         (MethodData.ApplyAttributes): Likewise.
17910         (MethodData.ApplyObsoleteAttribute): Likewise.
17911         (MethodData.ApplyConditionalAttribute): Likewise.
17912         (MethodData.ApplyDllImportAttribute): Likewise.
17913         (MethodData.CheckAbstractAndExternal): Likewise.
17914         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17915         (MethodData.Emit): Formerly known as Method.Emit().
17916         (MemberBase): Moved everything which was specific to a single
17917         accessor/method to MethodData.
17918         (Method): Create a new MethodData and call Define() and Emit() on it.
17919         (Property, Indexer, Event): Create a new MethodData objects for each
17920         accessor and call Define() and Emit() on them.
17921
17922 2002-07-25  Martin Baulig  <martin@gnome.org>
17923
17924         Made MethodCore derive from MemberBase to reuse the code from there.
17925         MemberBase now also checks for attributes.
17926
17927         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17928         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17929         as virtual.
17930         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17931         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17932         (MemberBase.ApplyAttributes): New virtual method; applies the
17933         attributes to a method or accessor.
17934         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17935         (MemberBase.ApplyConditionalAttribute): Likewise.
17936         (MemberBase.ApplyDllImportAttribute): Likewise.
17937         (MemberBase.CheckAbstractAndExternal): Likewise.
17938         (MethodCore.ParameterTypes): This is now a property instead of a
17939         method, it's initialized from DoDefineParameters().
17940         (MethodCore.ParameterInfo): Removed the set accessor.
17941         (MethodCore.DoDefineParameters): New protected virtual method to
17942         initialize ParameterTypes and ParameterInfo.
17943         (Method.GetReturnType): We can now simply return the MemberType.
17944         (Method.GetMethodFlags): Override the MemberBase version and add
17945         the conditional flags.
17946         (Method.CheckBase): Moved some code from Define() here, call
17947         DoDefineParameters() here.
17948         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17949         here to avoid some larger code duplication.
17950         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17951         ensure that abstract and external accessors don't declare a body.
17952
17953         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17954         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17955         lookup in the attribute's parent classes, so we need to abort as soon
17956         as we found the first match.
17957         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17958         the attribute has no arguments.
17959
17960         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17961         of a Method.
17962
17963 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17964
17965         * cs-parser.jay: reverted previous patch.
17966
17967 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17968
17969         * cs-parser.jay: fixed bug #22119.
17970
17971 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17972
17973         * attribute.cs: fixed compilation. The error was:
17974         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17975         be assigned to before control leaves the current method."
17976         [FIXME:  Filed as bug #28186: MCS must report this error.]
17977
17978 2002-07-25  Martin Baulig  <martin@gnome.org>
17979
17980         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17981         method to pull the condition name ouf of a Conditional attribute.
17982         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17983         the obsolete message and error flag out of an Obsolete attribute.
17984
17985         * class.cs (Method.GetMethodFlags): New public method to get the
17986         TypeManager.MethodFlags for this method.
17987         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17988         private methods.
17989         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17990         if we're overriding a virtual function, set the new private variable
17991         `parent_method'; call the new TypeManager.AddMethod().
17992
17993         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17994         the MethodBuilder and the Method in a PtrHashtable.
17995         (TypeManager.builder_to_method): Added for this purpose.
17996         (TypeManager.MethodFlags): Added IsObsoleteError.
17997         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17998         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17999         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18000         the message from the attribute.
18001
18002 2002-07-24  Martin Baulig  <martin@gnome.org>
18003
18004         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18005         preprocessor directives, ensure that the argument to #define/#undef is
18006         exactly one identifier and that it's actually an identifier.
18007
18008         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18009         did not work ....
18010
18011 2002-07-24  Martin Baulig  <martin@gnome.org>
18012
18013         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18014         initialize it to TypeManager.object_type in the constructor.
18015         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18016         of the `hm.get_current' method if we're using the collection pattern.
18017         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18018         for the explicit conversion to make it work when we're using the collection
18019         pattern and the `Current' property has a different return type than `object'.
18020         Fixes #27713.
18021
18022 2002-07-24  Martin Baulig  <martin@gnome.org>
18023
18024         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18025         does not match, but don't report any errors.  This method is called in
18026         order for all methods in a MethodGroupExpr until a matching method is
18027         found, so we don't want to bail out if the first method doesn't match.
18028         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18029         matches, report the 123.  Fixes #28070.
18030
18031 2002-07-24  Martin Baulig  <martin@gnome.org>
18032
18033         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18034         TypeManager.TypeToCoreType() to the top of the method so the
18035         following equality checks will work.  Fixes #28107.
18036
18037 2002-07-24  Martin Baulig  <martin@gnome.org>
18038
18039         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18040         operand is of type uint, and the other operand is of type sbyte,
18041         short or int, the operands are converted to type long." -
18042         Actually do what this comment already told us.  Fixes bug #28106,
18043         added test-150.cs.
18044
18045 2002-07-24  Martin Baulig  <martin@gnome.org>
18046
18047         * class.cs (MethodBase): New abstract class.  This is now a base
18048         class for Property, Indexer and Event to avoid some code duplication
18049         in their Define() and DefineMethods() methods.
18050         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18051         generic methods for Define() and DefineMethods().
18052         (FieldBase): Derive from MemberBase, not MemberCore.
18053         (Property): Derive from MemberBase, not MemberCore.
18054         (Property.DefineMethod): Moved all the code from this method to the
18055         new MethodBase.DefineAccessor(), just call it with appropriate
18056         argumetnts.
18057         (Property.Define): Call the new Property.DoDefine(), this does some
18058         sanity checks and we don't need to duplicate the code everywhere.
18059         (Event): Derive from MemberBase, not MemberCore.
18060         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18061         accessors, this will also make them work with interface events.
18062         (Indexer): Derive from MemberBase, not MemberCore.
18063         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18064         (Indexer.Define): Use the new MethodBase functions.
18065
18066         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18067         argument to the constructor.
18068         (Interface.FindMembers): Added support for interface events.
18069         (Interface.PopluateEvent): Implemented.
18070
18071         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18072
18073 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18074
18075         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18076         but this is required to check for a method name being the same as
18077         the containing class.  
18078
18079         Handle this now.
18080
18081 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18082
18083         * interface.cs: initialize variable.
18084
18085 2002-07-23  Martin Baulig  <martin@gnome.org>
18086
18087         Implemented the IndexerName attribute in interfaces.
18088
18089         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18090         name if this is an explicit interface implementation.
18091         (Indexer.InterfaceIndexerName): New public variable.  If we're
18092         implementing an interface indexer, this is the IndexerName in that
18093         interface.  Otherwise, it's the IndexerName.
18094         (Indexer.DefineMethod): If we're implementing interface indexer,
18095         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18096         and Pending.ImplementIndexer methods.
18097         (Indexer.Define): Also define the PropertyBuilder if we're
18098         implementing an interface indexer and this is neither an explicit
18099         interface implementation nor do the IndexerName match the one in
18100         the interface.
18101
18102         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18103         If a method is defined here, then we always need to create a proxy
18104         for it.  This is used when implementing interface indexers.
18105         (Pending.IsInterfaceIndexer): New public method.
18106         (Pending.ImplementIndexer): New public method.
18107         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18108         This is used when implementing interface indexers to define a proxy
18109         if necessary.
18110         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18111         define a proxy if necessary.
18112
18113         * interface.cs (Interface.IndexerName): New public variable.
18114         (Interface.PopulateIndexer): Set the IndexerName.
18115         (Interface.DefineIndexers): New private method.  Populate all the
18116         indexers and make sure their IndexerNames match.
18117
18118         * typemanager.cs (IndexerPropertyName): Added support for interface
18119         indexers.
18120
18121 2002-07-22  Martin Baulig  <martin@gnome.org>
18122
18123         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18124         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18125         ret if HasReturnLabel.
18126         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18127         variables.
18128
18129         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18130         and set the ec.LoopBeginTryCatchLevel.
18131         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18132         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18133         the current ec.TryCatchLevel, the branch goes out of an exception
18134         block.  In this case, we need to use Leave and not Br.
18135
18136 2002-07-22  Martin Baulig  <martin@gnome.org>
18137
18138         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18139         block unless the block does not always return or it is contained in
18140         another try { ... } catch { ... } block.  Fixes bug #26506.
18141         Added verify-1.cs to the test suite.
18142
18143 2002-07-22  Martin Baulig  <martin@gnome.org>
18144
18145         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18146         then we do not always return.  Fixes bug #24985.
18147
18148 2002-07-22  Martin Baulig  <martin@gnome.org>
18149
18150         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18151         lookup on a per-class level; ie. walk up the class hierarchy until we
18152         found at least one applicable method, then choose the best among them.
18153         Fixes bug #24463 and test-29.cs.
18154
18155 2002-07-22  Martin Baulig  <martin@gnome.org>
18156
18157         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18158         return types of the methods.  The return type is not part of the
18159         signature and we must not check it to make the `new' modifier work.
18160         Fixes bug #27999, also added test-147.cs.
18161         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18162
18163         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18164         on the method's return type.
18165
18166 2002-07-21  Martin Baulig  <martin@gnome.org>
18167
18168         * assign.cs: Make this work if the rightmost source is a constant and
18169         we need to do an implicit type conversion.  Also adding a few more tests
18170         to test-38.cs which should have caught this.
18171
18172         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18173         target in the makefile for this.  The makefile.gnu is primarily intended
18174         for end-users who don't want to debug the compiler.
18175
18176 2002-07-21  Martin Baulig  <martin@gnome.org>
18177
18178         * assign.cs: Improved the Assign class so it can now handle embedded
18179         assignments (X = Y = Z = something).  As a side-effect this'll now also
18180         consume less local variables.  test-38.cs now passes with MCS, added
18181         a few new test cases to that test.
18182
18183 2002-07-20  Martin Baulig  <martin@gnome.org>
18184
18185         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18186         instructions.  Fixes bug #27977, also added test-146.cs.
18187
18188 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18189
18190         * cs-tokenizer.cs: fixed getHex ().
18191
18192 2002-07-19  Martin Baulig  <martin@gnome.org>
18193
18194         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18195         not Type.GetType() to lookup the array type.  This is needed when
18196         we're constructing an array of a user-defined type.
18197         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18198         single-dimensional arrays, but also for single-dimensial arrays of
18199         type decimal.
18200
18201 2002-07-19  Martin Baulig  <martin@gnome.org>
18202
18203         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18204         this function is called, it's not allowed to share LocalBuilders
18205         among ILGenerators.
18206
18207 2002-07-19  Martin Baulig  <martin@gnome.org>
18208
18209         * expression.cs (Argument.Resolve): Report an error 118 when trying
18210         to pass a type as argument.
18211
18212 2002-07-18  Martin Baulig  <martin@gnome.org>
18213
18214         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18215         Conv_R_Un for the signed `long' type.
18216
18217 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18220         `expr' for the temporary result, as that will fail if we do
18221         multiple resolves on the same expression.
18222
18223 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18224
18225         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18226         ec.TypeContainer for looking up aliases. 
18227
18228         * class.cs (TypeContainer): Remove LookupAlias from here.
18229
18230         * decl.cs (DeclSpace); Move here.
18231
18232 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * class.cs (FindMembers): Only call filter if the constructor
18235         bulider is not null.
18236
18237         Also handle delegates in `NestedTypes' now.  Now we will perform
18238         type lookups using the standard resolution process.  This also
18239         fixes a bug.
18240
18241         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18242         This uses Expressions (the limited kind that can be parsed by the
18243         tree) instead of strings.
18244
18245         * expression.cs (ComposedCast.ToString): Implement, used to flag
18246         errors since now we have to render expressions.
18247
18248         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18249         FormArrayType. 
18250
18251         * ecore.cs (SimpleName.ToString): ditto.
18252
18253         * cs-parser.jay: Instead of using strings to assemble types, use
18254         Expressions to assemble the type (using SimpleName, ComposedCast,
18255         MemberAccess).  This should fix the type lookups in declarations,
18256         because we were using a different code path for this.
18257
18258         * statement.cs (Block.Resolve): Continue processing statements
18259         even when there is an error.
18260
18261 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18262
18263         * class.cs (Event.Define): Also remove the `remove' method from
18264         the list of pending items.
18265
18266         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18267         generate more compact code. 
18268
18269 2002-07-17  Martin Baulig  <martin@gnome.org>
18270
18271         * const.cs (Const.LookupConstantValue): Add support for constant
18272         `unchecked' and `checked' expressions.
18273         Also adding test case test-140.cs for this.
18274
18275 2002-07-17  Martin Baulig  <martin@gnome.org>
18276
18277         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18278         check whether mi.ReturnType implements the IEnumerator interface; the
18279         `==' and the IsAssignableFrom() will fail in this situation.
18280
18281 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18282
18283         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18284         here too.
18285
18286 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18287
18288         * expression.cs: fixed bug #27811.
18289
18290 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18291
18292         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18293         Molaro: when we are a ref, the value already contains a pointer
18294         value, do not take the address of it.
18295
18296 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18297         * removed mb-parser.jay and mb-tokenizer.cs
18298
18299 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18300
18301         * expression.cs: check against the building corlib void type.
18302
18303 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18304
18305         * ecore.cs: fix for valuetype static readonly fields: when 
18306         initializing them, we need their address, not the address of a copy.
18307
18308 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18309
18310         * typemanager.cs: register also enum_type in corlib.
18311
18312 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18313
18314         * class.cs: allow calling this (but not base) initializers in structs.
18315
18316 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18317
18318         * ecore.cs: make sure we compare against the building base types
18319         in GetTypeSize ().
18320
18321 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18322
18323         * typemanager.cs: fix TypeToCoreType() to handle void and object
18324         (corlib gets no more typerefs after this change).
18325
18326 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18327
18328         * expression.cs (ArrayCreation.EmitArrayArguments): use
18329         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18330
18331         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18332         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18333         array indexes, the runtime actually forbids them.
18334
18335         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18336         for array arguments here.
18337
18338         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18339         instead of the default for ValueTypes.
18340
18341         (New.DoEmit): Use IsValueType instead of
18342         IsSubclassOf (value_type)
18343         (New.DoResolve): ditto.
18344         (Invocation.EmitCall): ditto.
18345
18346         * assign.cs (Assign): ditto.
18347
18348         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18349         Statements *are* currently doing part of their resolution during
18350         Emit.  
18351
18352         Expressions do always resolve during resolve, but statements are
18353         only required to propagate resolution to their children.
18354
18355 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18358
18359         (LoadAssembly): Do not add the dll if it is already specified
18360
18361         (MainDriver): Add the System directory to the link path at the end,
18362         after all the other -L arguments. 
18363
18364         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18365         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18366         ldelem.u1) and using the opposite for sbytes.
18367
18368         This fixes Digger, and we can finally run it.
18369
18370         * driver.cs (UnixParseOption): Move the option parsing here.  
18371         (CSCParseOption): Implement CSC-like parsing of options.
18372
18373         We now support both modes of operation, the old Unix way, and the
18374         new CSC-like way.  This should help those who wanted to make cross
18375         platform makefiles.
18376
18377         The only thing broken is that /r:, /reference: and /lib: are not
18378         implemented, because I want to make those have the same semantics
18379         as the CSC compiler has, and kill once and for all the confussion
18380         around this.   Will be doing this tomorrow.
18381
18382         * statement.cs (Unsafe.Resolve): The state is checked during
18383         resolve, not emit, so we have to set the flags for IsUnsfe here.
18384
18385 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18386
18387         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18388         not catch the Error_ObjectRefRequired in SimpleName (as it is
18389         possible to have a class/instance variable name that later gets
18390         deambiguated), we have to check this here.      
18391
18392 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18393
18394         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18395         make static and put into Expression.
18396
18397         (Event.Define): Register the private field of the event with the 
18398         TypeManager so that GetFieldFromEvent can get at it.
18399
18400         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18401         keep track of the private field associated with an event which
18402         has no accessors.
18403
18404         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18405         private field.
18406
18407         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18408
18409 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18410
18411         * expression.cs (Binary.EmitBranchable): this routine emits the
18412         Binary expression in a branchable context.  This basically means:
18413         we need to branch somewhere, not just get the value on the stack.
18414
18415         This works together with Statement.EmitBoolExpression.
18416
18417         * statement.cs (Statement.EmitBoolExpression): Use
18418         EmitBranchable. 
18419
18420 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18421
18422         * statement.cs (For): Reduce the number of jumps in loops.
18423
18424         (For): Implement loop inversion for the For statement.
18425
18426         (Break): We can be breaking out of a Try/Catch controlled section
18427         (foreach might have an implicit try/catch clause), so we need to
18428         use Leave instead of Br.
18429
18430         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18431         now).  If the instace expression supports IMemoryLocation, we use
18432         the AddressOf method from the IMemoryLocation to extract the
18433         address instead of emitting the instance.
18434
18435         This showed up with `This', as we were emitting the instance
18436         always (Emit) instead of the Address of This.  Particularly
18437         interesting when This is a value type, as we dont want the Emit
18438         effect (which was to load the object).
18439
18440 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18441
18442         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18443
18444         * statement.cs (Checked): Set the CheckedState during the resolve
18445         process too, as the ConvCast operations track the checked state on
18446         the resolve process, and not emit.
18447
18448         * cs-parser.jay (namespace_member_declaration): Flag that we have
18449         found a declaration when we do.  This is used to flag error 1529
18450
18451         * driver.cs: Report ok when we display the help only.
18452
18453 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18454
18455         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18456
18457 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18458
18459         * cs-tokenizer.cs (define): We also have to track locally the
18460         defines.  AllDefines is just used for the Conditional Attribute,
18461         but we also need the local defines for the current source code. 
18462
18463 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18464
18465         * statement.cs (While, For, Do): These loops can exit through a
18466         Break statement, use this information to tell whether the
18467         statement is the last piece of code.
18468
18469         (Break): Flag that we break.
18470
18471         * codegen.cs (EmitContexts): New `Breaks' state variable.
18472
18473 2002-07-03  Martin Baulig  <martin@gnome.org>
18474
18475         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18476         modifiers in method declarations in structs.  Otherwise, you won't
18477         be able to override things like Object.Equals().
18478
18479 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18480
18481         * class.cs (Method, Property, Indexer): Do not allow the public
18482         modifier to be used in explicit interface implementations.
18483
18484         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18485         override modifiers in method declarations in structs
18486
18487 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18488
18489         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18490         integer or real overflow, report an error
18491
18492 2002-07-02  Martin Baulig  <martin@gnome.org>
18493
18494         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18495         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18496         to tell the runtime about our newly created System.Object and
18497         System.ValueType types.
18498
18499 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18500
18501         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18502         struct instead of Ldarg/Starg.
18503
18504 2002-07-02  Martin Baulig  <martin@gnome.org>
18505
18506         * expression.cs (Indirection.Indirection): Call
18507         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18508
18509 2002-07-02  Martin Baulig  <martin@gnome.org>
18510
18511         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18512         ValueType, call TypeManager.TypeToCoreType() on it.
18513         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18514         the OpCodes.Newarr argument.
18515
18516 2002-07-02  Martin Baulig  <martin@gnome.org>
18517
18518         * expression.cs (Invocation.EmitCall): When compiling corlib,
18519         replace all calls to the system's System.Array type to calls to
18520         the newly created one.
18521
18522         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18523         System.Array methods.
18524         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18525         from the system's System.Array type which must be replaced.
18526
18527 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18528
18529         * typemanager.cs: load unverifiable_code_ctor so we can build
18530         corlib using the correct type. Avoid using GetTypeCode() with
18531         TypeBuilders.
18532         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18533         TypeManager.object_type to allow building corlib.
18534
18535 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18536
18537         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18538
18539 2002-07-01  Martin Baulig  <martin@gnome.org>
18540
18541         * class.cs: Make the last change actually work, we need to check
18542         whether `ifaces != null' to avoid a crash.
18543
18544 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18545
18546         * class.cs: when we build structs without fields that implement
18547         interfaces, we need to add the interfaces separately, since there is
18548         no API to both set the size and add the interfaces at type creation
18549         time.
18550
18551 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18552
18553         * expression.cs: the dimension arguments to the array constructors
18554         need to be converted if they are a long.
18555
18556 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18557
18558         * class.cs: don't emit ldarg.0 if there is no parent constructor
18559         (fixes showstopper for corlib).
18560
18561 2002-06-29  Martin Baulig  <martin@gnome.org>
18562
18563         MCS now compiles corlib on GNU/Linux :-)
18564
18565         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18566         ie. check for MethodImplOptions.InternalCall.
18567
18568         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18569         and TypeManager.attribute_type are null, so we must explicitly check
18570         whether parent is not null to find out whether it's an attribute type.
18571         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18572         and SetBuilder, not only if the property is neither abstract nor external.
18573         This is necessary to set the MethodImplOptions on the accessor methods.
18574         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18575         SetBuilder, see Property.Emit().
18576
18577         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18578         populate "System.Object", "System.ValueType" and "System.Attribute" since
18579         they've already been populated from BootCorlib_PopulateCoreTypes().
18580
18581 2002-06-29  Martin Baulig  <martin@gnome.org>
18582
18583         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18584         is the NullLiteral, we also need to make sure that target_type is not
18585         an enum type.   
18586
18587 2002-06-29  Martin Baulig  <martin@gnome.org>
18588
18589         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18590         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18591         before calling BootstrapCorlib_ResolveDelegate ().
18592
18593 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18594
18595         * statement.cs: fixed build-breaker. All tests passed ok.
18596
18597 2002-06-27  Martin Baulig  <martin@gnome.org>
18598
18599         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18600         for System.Decimal when compiling corlib.
18601
18602 2002-06-27  Martin Baulig  <martin@gnome.org>
18603
18604         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18605         switch blocks which contain nothing but a default clause.
18606
18607 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18608
18609        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18610
18611 2002-06-27  Martin Baulig  <martin@gnome.org>
18612
18613         * ecore.cs (PropertyExpr.PropertyExpr): Call
18614         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18615
18616         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18617         is already a TypeBuilder.
18618
18619 2002-06-27  Martin Baulig  <martin@gnome.org>
18620
18621         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18622         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18623         the "from an array-type to System.Array" case.  This makes it work
18624         when compiling corlib.
18625
18626 2002-06-27  Martin Baulig  <martin@gnome.org>
18627
18628         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18629         non-static PropertyExpr, set its InstanceExpression.  This makes
18630         the `ICollection.Count' property work in System/Array.cs.
18631
18632 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18633
18634         * driver.cs: Made error handling more consistent.  Errors now
18635         tracked by Report class, so many methods which used to return int
18636         now return void.  Main() now prints success/failure and 
18637         errors/warnings message.
18638
18639         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18640         the magic number return values (123 and 124).  Now, if the
18641         expected error occurs, the compiler exits with success (exit value
18642         0).  If the compilation completes without seeing that particular
18643         error, the compiler exits with failure (exit value 1).  The
18644         makefile in mcs/errors has been changed to handle the new behaviour.
18645
18646         * report.cs: Made 'expected error' number a property and renamed
18647         it from 'Probe' to 'ExpectedError'.
18648
18649         * genericparser.cs: Removed error handling support, since it is
18650         now all done by Report class.
18651
18652         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18653         class, so parse() no longer returns an int.
18654
18655         * namespace.cs: Use Report.Error instead of GenericParser.error
18656
18657 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18658
18659         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18660         TypeContainer.AddOperator): At the front of the list put the
18661         explicit implementations, so they get resolved/defined first. 
18662
18663 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18664
18665         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18666         interface type is implemented by this TypeContainer.  Used during
18667         explicit interface implementation.
18668
18669         (Property.Define, Indexer.Define, Method.Define): Validate that
18670         the given interface in the explicit implementation is one of the
18671         base classes for the containing type.
18672
18673         Also if we are explicitly implementing an interface, but there is
18674         no match in the pending implementation table, report an error.
18675
18676         (Property.Define): Only define the property if we are
18677         not explicitly implementing a property from an interface.  Use the
18678         correct name also for those properties (the same CSC uses,
18679         although that is really not needed).
18680
18681         (Property.Emit): Do not emit attributes for explicitly implemented
18682         properties, as there is no TypeBuilder.
18683
18684         (Indexer.Emit): ditto.
18685
18686         Hiding then means that we do not really *implement* a pending
18687         implementation, which makes code fail.
18688
18689 2002-06-22  Martin Baulig  <martin@gnome.org>
18690
18691         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18692         the return value of Object.GetType().  [FIXME: we need to do this whenever
18693         we get a type back from the reflection library].
18694
18695 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18696
18697         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18698
18699 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18700
18701         * attribute.cs: Return null if we can not look up the type.
18702
18703         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18704         the interface types found.
18705
18706         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18707         interface types found.
18708
18709         * typemanager.cs (GetInterfaces): Make this routine returns alll
18710         the interfaces and work around the lame differences between
18711         System.Type and System.Reflection.Emit.TypeBuilder in the results
18712         result for GetInterfaces.
18713
18714         (ExpandInterfaces): Given an array of interface types, expand and
18715         eliminate repeated ocurrences of an interface.  This expands in
18716         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18717         be IA, IB, IC.
18718
18719 2002-06-21  Martin Baulig  <martin@gnome.org>
18720
18721         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18722         on System.Enum.
18723
18724 2002-06-21  Martin Baulig  <martin@gnome.org>
18725
18726         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18727         and called with one of the core types, return the corresponding typebuilder for
18728         that type.
18729
18730         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18731         element type.
18732
18733 2002-06-21  Martin Baulig  <martin@gnome.org>
18734
18735         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18736         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18737         (Expression.ConvertReferenceExplicit): Likewise.
18738
18739         * expression.cs (ElementAccess.DoResolve): Likewise.
18740         (ElementAccess.DoResolveLValue): Likewise.
18741
18742 2002-06-10  Martin Baulig  <martin@gnome.org>
18743
18744         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18745         add the "value" parameter to the parameter list.
18746
18747         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18748         to our caller.
18749
18750 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18751
18752         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18753         the argument to an int, uint, long or ulong, per the spec.  Also
18754         catch negative constants in array creation.
18755
18756 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18757
18758         * class.cs: do not allow the same interface to appear twice in
18759         the definition list.
18760
18761 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18762
18763         * ecore.cs: don't use ldlen with System.Array.
18764
18765 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18766
18767         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18768
18769 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18770
18771         * modifiers.cs: produce correct field attributes for protected
18772         internal. Easy fix so miguel can work on ther harder stuff:-)
18773
18774 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18775
18776         * pending.cs: New file.  Move the code from class.cs here.
18777         Support clearning the pending flag for all methods (when not doing
18778         explicit interface implementation).
18779
18780 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18781
18782         * rootcontext.cs: added a couple more types needed to bootstrap.
18783
18784 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18785
18786         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18787         constructor in the type, instead of any constructor in the type
18788         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18789         a bug in the Mono runtime when applying the params attribute). 
18790
18791 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18792         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18793
18794 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18795
18796         * expression.cs (Unary.ResolveOperator): Use TypeManager
18797         to resolve the type.
18798
18799 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18800
18801         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18802         attached.
18803
18804         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18805         with each member too.
18806
18807         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18808         field builders too - this takes care of the enum member case.
18809
18810 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18811
18812         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18813         address-of operator on both value types and pointers.
18814
18815 2002-06-10  Martin Baulig  <martin@gnome.org>
18816
18817         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18818         PropertyBuilder to the `property_builders' list.
18819
18820         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18821         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18822         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18823         find any indexers which are inherited from an interface.
18824
18825 2002-06-09  Martin Baulig  <martin@gnome.org>
18826
18827         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18828         the same type as the constant if necessary.  There's also a test-130.cs
18829         for this.
18830
18831         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18832
18833         * typemanager.cs (TypeManager.ChangeType): Previously known as
18834         Enum.ChangeEnumType().
18835
18836 2002-06-09  Martin Baulig  <martin@gnome.org>
18837
18838         * expression.cs (Cast.TryReduce): Added support for consts.
18839
18840 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18841
18842         * class.cs (Accessor): Hold attributes information so we can pass
18843         it along.
18844
18845         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18846         Modify to pass in attributes attached to the methods.
18847
18848         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18849
18850         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18851         to handle the Accessor kind :-)
18852
18853         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18854
18855 2002-06-08  Martin Baulig  <martin@gnome.org>
18856
18857         * expression.cs (Unary.TryReduceNegative): Added support for
18858         ULongConstants.
18859
18860 2002-06-08  Martin Baulig  <martin@gnome.org>
18861
18862         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18863         name can't be found in the `defined_names' - the caller will do a
18864         MemberLookup in this case and thus find methods in System.Enum
18865         such as Enum.IsDefined().
18866
18867 2002-06-08  Martin Baulig  <martin@gnome.org>
18868
18869         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18870         Convert.ChangeType() which works with TypeBuilder created types.
18871         (Enum.LookupEnumValue, Enum.Define): Use it here.
18872
18873         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18874         `TypeBuilder.BaseType != null' check.
18875         (TypeContainer.FindMembers): Only lookup parent members if we
18876         actually have a parent.
18877         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18878         (ConstructorInitializer.Resolve): Likewise.
18879
18880         * interface.cs (Interface.FindMembers): Added
18881         `TypeBuilder.BaseType != null' check.
18882
18883         * rootcontext.cs (RootContext.ResolveCore): Added
18884         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18885         classes_second_stage.
18886
18887         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18888         debug_type and trace_type when compiling with --nostdlib.       
18889
18890 2002-06-07  Martin Baulig  <martin@gnome.org>
18891
18892         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18893         (AddField): Set it to true when adding a non-static field.
18894         (DefineType): Use `have_nonstatic_fields' to find out whether we
18895         have non-static fields, not `Fields != null'.
18896
18897 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18898
18899         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18900         dereferencing a null on the static-field code path)
18901
18902 2002-05-30  Martin Baulig  <martin@gnome.org>
18903
18904         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18905         to take command line arguments.  Use reflection to call the new
18906         custom `Initialize' function on the symbol writer and pass it the
18907         command line arguments.
18908
18909         * driver.cs (--debug-args): New command line argument to pass command
18910         line arguments to the symbol writer.
18911
18912 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18913
18914         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18915         the target type for indexers and properties.  Thanks to Joe for
18916         catching this.
18917
18918 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18919
18920         * typemanager.cs (MethodFlags): returns the method flags
18921         (Obsolete/ShouldIgnore) that control warning emission and whether
18922         the invocation should be made, or ignored. 
18923
18924         * expression.cs (Invocation.Emit): Remove previous hack, we should
18925         not do this on matching a base type, we should do this based on an attribute
18926
18927         Only emit calls to System.Diagnostics.Debug and
18928         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18929         on the command line.
18930
18931         * rootcontext.cs: Global settings for tracing and debugging.
18932
18933         * cs-tokenizer.cs (define): New utility function to track
18934         defines.   Set the global settings for TRACE and DEBUG if found.
18935
18936 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18937
18938         * interface.cs (Populate*): Pass in the TypeContainer as well as
18939         the DeclSpace as parameters so that we can create EmitContexts and
18940         then use that to apply attributes etc.
18941
18942         (PopulateMethod, PopulateEvent, PopulateProperty)
18943         (PopulateIndexer): Apply attributes everywhere.
18944
18945         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18946         etc.
18947
18948         (ApplyAttributes): Update accordingly.
18949
18950         We now apply interface attributes for all members too.
18951
18952 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18953
18954         * class.cs (Indexer.Define); Correctly check if we are explicit
18955         implementation (instead of checking the Name for a ".", we
18956         directly look up if the InterfaceType was specified).
18957
18958         Delay the creation of the PropertyBuilder.
18959
18960         Only create the PropertyBuilder if we are not an explicit
18961         interface implementation.   This means that explicit interface
18962         implementation members do not participate in regular function
18963         lookups, and hence fixes another major ambiguity problem in
18964         overload resolution (that was the visible effect).
18965
18966         (DefineMethod): Return whether we are doing an interface
18967         implementation. 
18968
18969         * typemanager.cs: Temporary hack until we get attributes in
18970         interfaces (Ravi is working on that) and we get IndexerName
18971         support in interfaces.
18972
18973         * interface.cs: Register the indexers as properties.
18974
18975         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18976         warning, I have verified that this is a bug in the .NET runtime
18977         (JavaScript suffers of the same problem).
18978
18979         * typemanager.cs (MemberLookup): When looking up members for
18980         interfaces, the parent of an interface is the implicit
18981         System.Object (so we succeed in searches of Object methods in an
18982         interface method invocation.  Example:  IEnumerable x;  x.ToString
18983         ()) 
18984
18985 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18986
18987         * class.cs (Event): Events should also register if they do
18988         implement the methods that an interface requires.
18989
18990         * typemanager.cs (MemberLookup); use the new GetInterfaces
18991         method. 
18992
18993         (GetInterfaces): The code used to lookup interfaces for a type is
18994         used in more than one place, factor it here. 
18995
18996         * driver.cs: Track the errors at the bottom of the file, we kept
18997         on going.
18998
18999         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19000         instance if the method we are calling is static!
19001
19002 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19003
19004         * attribute.cs (ApplyAttributes): Make this function filter out
19005         the IndexerName attribute (as that attribute in reality is never
19006         applied) and return the string constant for the IndexerName
19007         attribute. 
19008
19009         * class.cs (TypeContainer.Emit): Validate that all the indexers
19010         have the same IndexerName attribute, and if so, set the
19011         DefaultName attribute on the class. 
19012
19013         * typemanager.cs: The return value might contain other stuff (not
19014         only methods).  For instance, consider a method with an "Item"
19015         property and an Item method.
19016
19017         * class.cs: If there is a problem with the parameter types,
19018         return. 
19019
19020 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19021
19022         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19023         looks at user defined conversion after making a call to 
19024         StandardConversionExists - we need this for overload resolution.
19025
19026         * expression.cs : Update accordingly the various method calls.
19027
19028         This fixes 2 bugs filed against implicit user defined conversions 
19029
19030 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19031
19032         * statement.cs: Track the result of the assignment.
19033
19034 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19035
19036         * expression.cs (MemberAccess): Improved error reporting for
19037         inaccessible members.
19038
19039 2002-05-22  Martin Baulig  <martin@gnome.org>
19040
19041         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19042         itself with debugging support.
19043
19044 2002-05-22  Martin Baulig  <martin@gnome.org>
19045
19046         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19047         Removed, this isn't needed anymore.
19048
19049 2002-05-20  Martin Baulig  <martin@gnome.org>
19050
19051         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19052         be underlying type for an enum.
19053
19054 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19055
19056         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19057         that splits out the loading of just the core types.
19058
19059         * rootcontext.cs (ResolveCore): Split the struct resolution in
19060         two, so we can load the enumeration underlying types before any
19061         enums are used.
19062
19063         * expression.cs (Is): Bandaid until we fix properly Switch (see
19064         bug #24985 for details).
19065
19066         * typemanager.cs (ImplementsInterface): The hashtable will contain
19067         a null if there are no interfaces implemented.
19068
19069 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19070
19071         * cs-parser.jay (indexer_declarator): It is fine to have array
19072         parameters
19073
19074 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19075
19076         * typemanager.cs: (RegisterBuilder): New function used to register
19077         TypeBuilders that implement interfaces.  Since
19078         TypeBuilder.GetInterfaces (as usual) does not work with lame
19079         Reflection.Emit. 
19080         (AddUserType): register interfaces.
19081
19082         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19083         dealing with TypeBuilder.  Also, arrays are showing up as
19084         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19085         methods can not be invoked on them!
19086
19087         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19088         (ImplicitReferenceConversionExists): Split out from
19089         StandardConversionExists. 
19090
19091         * expression.cs (As): We were only implementing one of the three
19092         cases for the as operator.  We now implement them all.
19093         (Is): Implement the various other cases for Is as well.
19094
19095         * typemanager.cs (CACHE): New define used to control if we want or
19096         not the FindMembers cache.  Seems to have a negative impact on
19097         performance currently
19098
19099         (MemberLookup): Nested types have full acess to
19100         enclosing type members
19101
19102         Remove code that coped with instance/static returns for events, we
19103         now catch this in RealFindMembers.
19104
19105         (RealFindMembers): only perform static lookup if the instance
19106         lookup did not return a type or an event.  
19107
19108 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19109
19110         * assign.cs (CompoundAssign): We pass more semantic information
19111         now to Compound Assignments than we did before: now we have all
19112         the information at hand, and now we resolve the target *before* we
19113         do the expression expansion, which allows the "CacheValue" method
19114         to have the effect we intended (before, a [x] += 1 would generate
19115         two differen ArrayAccess expressions from the ElementAccess,
19116         during the resolution process).
19117
19118         (CompoundAssign.DoResolve): Resolve target and original_source here.
19119
19120 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19121
19122         * expression.cs (ArrayAccess): dropped debugging information. 
19123
19124         * typemanager.cs: Small bug fix: I was always returning i_members,
19125         instead of one of i_members or s_members (depending on which had
19126         the content).
19127
19128         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19129         method is invoked before any code generation takes place, and it
19130         is a mechanism to inform that the expression will be invoked more
19131         than once, and that the method should use temporary values to
19132         avoid having side effects
19133
19134         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19135
19136         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19137         implementation.
19138
19139         * expression.cs (Indirection, ArrayAccess): Add support for
19140         CacheTemporaries in these two bad boys. 
19141
19142         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19143         ldobj or ldind_ref.  
19144         (StoreFromPtr): Handle stobj as well.
19145
19146         * expression.cs (UnaryMutator): Share more code.
19147
19148         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19149         down: I was not tracking the Filter function as well, which
19150         was affecting the results of the cache.
19151
19152 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19153
19154         * attribute.cs: Remove the hack to handle the CharSet property on
19155         StructLayouts. 
19156
19157 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19158
19159         * attribute.cs (DoResolve): More uglyness, we now only try to
19160         resolve the attribute partially, to extract the CharSet
19161         information (only if we are a StructLayout attribute).  Otherwise 
19162
19163         (GetExtraTypeInfo): Add some code to conditionally kill in the
19164         future this.   I am more and more convinced that the .NET
19165         framework has special code to handle the attribute setting on
19166         certain elements.
19167
19168         * expression.cs (IsParamsMethodApplicable): Revert my previous
19169         foreach change here, it was wrong.
19170
19171 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19172
19173         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19174         (pp_expr): do not abort on unknown input, just return.
19175         (eval): abort if there are pending chars.
19176
19177         * attribute.cs (Attribute.Resolve): Positional parameters are
19178         optional.  Deal with that case.
19179
19180         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19181         the Ansi/Unicode/Auto information for the type.
19182
19183         (TypeContainer.DefineType): instantiate the EmitContext here, as
19184         we will be using it during the type definition (to resolve
19185         attributes) and during the emit phase.
19186
19187         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19188         to pull type information out of the attributes
19189
19190         (Attribute.Resolve): track the constructor builder, and allow for
19191         multiple invocations (structs and classes will use this).
19192
19193         * ecore.cs (MemberLookupFinal): new version with all the
19194         parameters customizable.
19195
19196         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19197         constructors.  Return if the result value is null (as the error
19198         would have been flagged already by MemberLookupFinal)
19199
19200         Do not allow instances of abstract classes or interfaces to be
19201         created.
19202
19203         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19204         We have to compare the assembly property here when dealing with
19205         FamANDAssem and Assembly access modifiers, because we might be
19206         creating an assembly from *modules* (that means that we are not
19207         getting TypeBuilders for types defined in other modules that are
19208         part of this assembly).
19209
19210         (Method.Emit): If the method is marked abstract and has a body,
19211         emit an error. 
19212
19213         (TypeContainer.DefineMembers): If both the defined member and the
19214         parent name match are methods, then do not emit any warnings: let
19215         the Method.Define routine take care of flagging warnings.  But if
19216         there is a mismatch (method overrides something else, or method is
19217         overriwritten by something, then emit warning).
19218
19219         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19220         set to null, this means `do not check for the return type on the
19221         signature'. 
19222
19223         (Method.Define): set the return type for the method signature to
19224         null, so that we get methods with the same name and parameters and
19225         different return types.  This is used to flag warning 114 (you are
19226         hiding a method, and you probably want to use the new/override
19227         keywords instead).
19228
19229         * typemanager.cs (MemberLookup): Implemented proper access
19230         control, closing a long standing set of bug reports.  The problem
19231         was that the Framework only has two bits: Public and NonPublic,
19232         and NonPublic includes private and protected methods, but we need
19233         to enforce the FamANDAssem, FamOrAssem and Family. 
19234
19235 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19236
19237         * statement.cs (GotoCase): Return true: Ammounts to giving up
19238         knowledge on whether we return or not, and letting the other case
19239         be responsible for it.
19240
19241 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19242
19243         * driver.cs: Do not load directories for each file processed, only
19244         do it if there is a pattern.
19245
19246         * ecore.cs: Report readonly assigns here as well, as we might have
19247         been resolved only by MemberAccess.
19248
19249         (SimpleName.SimpleNameResolve): Also be useful for LValue
19250         resolution.   We need this to propagate assign to local readonly variables
19251
19252         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19253         do not want to reuse potential criteria memory.
19254
19255         * class.cs (MyEventBuilder): Set reflected_type;
19256
19257         * ecore.cs (Constantify): Added support for constifying bools.
19258
19259         (RootContext.LookupType): Added a cache for values looked up in
19260         the declaration space.
19261
19262         * typemanager.cs (FindMembers): Now is a front-end to
19263         RealFindMembers, and provides a two-level hashtable-based cache to
19264         the request.  
19265
19266         15% performance improvement: from 22.5 to 19.2 seconds.
19267
19268         * expression.cs (IsParamsMethodApplicable): use foreach.
19269         (Invocation.DoResolve): ditto.
19270         (New.DoResolve): ditto.
19271         (ArrayCreation.DoResolve): ditto.
19272
19273         * ecore.cs (FindMostEncompassingType): use foreach.
19274
19275         * delegate.cs (NewDelegate.DoResolve): Use foreach
19276
19277         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19278         (RemoveMethods): use foreach.
19279
19280         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19281         nested foreach statements instead of for, and also break out of
19282         the inner loop once a match is found.
19283
19284         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19285
19286 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19287
19288         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19289         we actually unwrap the expression to allow for extra information
19290         to be extracted. 
19291
19292         * expression.cs: Use Shr_Un on unsigned operations. 
19293
19294 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19295
19296         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19297         applicable operators was not being considered correctly. This closes
19298         the bug Miguel reported.
19299
19300 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19301
19302         * attribute.cs: check that the type derives from System.Attribute
19303         and report the correct error in that case (moved the duplicate code to
19304         its own method, too).
19305
19306 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19307
19308         * attribute.cs: lookup attribute type name as the spec says: first the
19309         bare attribute name and then name + "Attribute" (nant compiles with
19310         mcs after this fix).
19311
19312 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19313
19314         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19315         Because of the way we parse things, we should try to see if a
19316         UIntConstant can fit in an integer.
19317
19318 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19319
19320         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19321         when we are in an explicit context.
19322
19323         (ConvertReferenceExplicit): When converting from Iface type S to Class
19324         T make sure the rules are implemented as an OR.
19325
19326         * parameter.cs (ParameterType): Make it a property for now although the
19327         purpose really isn't anything immediate.
19328
19329         * expression.cs (Is*Applicable): Do better checking on the parameter type
19330         of a ref/out parameter. The ones from the system assemblies are already 
19331         marked with the correct type so we don't need to do any correction.
19332
19333         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19334         the object type is standard too so include that.
19335
19336 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19337
19338         * ecore.cs (StandardConversionExists): Augment with missing code:
19339         deal with IntConstant, LongConstants and Enumerations.
19340
19341         * assign.cs: Report the error, instead of failing silently
19342
19343         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19344         typecontainer that they are declared, because the
19345         typecontainer/namespace will have the list of using clauses that
19346         need to be applied.
19347
19348         Assembly Attributes were escaping the normal registration
19349         mechanism. 
19350
19351         (EmitCode): Apply attributes within an EmitContext that represents
19352         the container they were declared on.
19353
19354         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19355
19356 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19357
19358         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19359         Revamp completely - make much cleaner as we now operate only
19360         on a set of Types.
19361
19362         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19363         to implement the logic detailed in the spec more correctly.
19364
19365         (UserDefinedConversion): Update accordingly.
19366
19367 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19368
19369         * statement.cs: Return flow analysis information up.
19370
19371         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19372         and the default.
19373
19374         (token): Do not consume an extra character before calling
19375         decimal_digits.
19376
19377 2002-05-06  Piers Haken <piersh@friskit.com>
19378
19379         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19380
19381 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19382
19383         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19384         EmitContext during the instance constructor initializer
19385         resolution, to stop access to instance variables.
19386
19387         This is mandated by the spec, last paragraph of the `constructor
19388         initializers' section. 
19389
19390 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19391
19392         * cs-parser.jay, class.cs (Accessor): new class used to represent
19393         an accessor (get or set).  In the past we used `null' to represent
19394         a missing accessor.  But this is ambiguous because there was no
19395         way to tell in abstract indexers/properties if one of them was
19396         specified.
19397
19398         Now there is a way of addressing that.
19399
19400         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19401         instead of FindMembers.
19402
19403         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19404         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19405
19406         * attribute.cs: Treat indexers and properties as the same in terms
19407         of applying attributes
19408
19409         * ecore.cs (FindMostEncompassedType): Use statically initialized
19410         EmptyExpressions()s like we do elsewhere to avoid creating useless
19411         objects (and we take this out of the tight loop).
19412
19413         (GetConversionOperators): Move the code to extract the actual
19414         operators to a separate routine to clean things up.
19415
19416 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19417
19418         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19419         events are always registered FieldBuilders.
19420
19421         * class.cs (FieldBase): New class shared by Fields 
19422
19423         * delegate.cs: If we are a toplevel delegate, use our full name.
19424         If we are a nested delegate, then only use our tail name.
19425
19426 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19427
19428         * expression.cs (IsApplicable): Ensure that we add the "&" to
19429         ref/out types before comparing it with the type of the argument.
19430
19431         (IsParamsMethodApplicable): Ditto.
19432
19433         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19434         silly me ;-)
19435
19436         * delegate.cs : Handle the case when we have more than one applicable
19437         method. Flag an error only when we finish checking all.
19438
19439 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * expression.cs: Add support for boolean static initializers.
19442
19443 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19444
19445         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19446
19447         * parameter.cs (ComputeParameterTypes,
19448         ComputeAndDefineParameterTypes): Better error handling: now we
19449         clear the `types' cache if we fail during any of the type lookups.
19450         We also return the status code correctly to our caller
19451
19452         * delegate.cs: If we fail to define a delegate, abort the extra
19453         steps. 
19454
19455         * expression.cs (Binary.ResolveOperator): for
19456         operator==(object,object) and operator !=(object, object) we also
19457         have to verify that there is an implicit conversion from one to
19458         the other.
19459
19460         (ArrayAccess.DoResolve): Array Access can operate on
19461         non-variables. 
19462
19463 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19464
19465         * assign.cs (CompoundAssign): A new class used as a "flag" that
19466         the assignment actually is happening as part of a compound
19467         assignment operator.
19468
19469         During compound assignment, a few new rules exist to enable things
19470         like:
19471
19472         byte b |= 1 + 2
19473
19474         From the spec:
19475
19476         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19477         to the type of x) if y is implicitly convertible to the type of x,
19478         and the operator is a builtin operator and the return type of the
19479         operator is explicitly convertible to the type of x. 
19480
19481         * rootcontext.cs: Reset warning level to 2.  4 catches various
19482         "interesting" features in mcs, we must clean this up at some
19483         point, but currently am trying to kill other bugs ;-)
19484
19485         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19486         in container classes as well.  
19487
19488         * expression.cs (Binary.ResolveOperator): Handle string case
19489         before anything else (as operator overloading does emit an error
19490         before doing anything else).
19491
19492         This code could go away when we move to a table driven model, but
19493         i could not come up with a good plan last night.
19494
19495 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19496
19497         * typemanager.cs (CSharpName): reimplementation using regex.
19498         * class.cs: added null check for fields in Emit
19499         * rootcontext.cs: set warninglevel to 4
19500
19501 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19502
19503         * typemanager.cs (CSharpName): reimplemented with Lupus
19504         suggestion.
19505
19506 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19507
19508         * statement.cs (If): correclty implement Resolve, because we were
19509         not catching sem errors in there.  The same process is needed
19510         everywhere else. 
19511         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19512
19513
19514         (Statement.Warning_DeadCodeFound): Factorize code.
19515         (While): Report dead code here too.
19516
19517         (Statement): Added Resolve virtual method to allow
19518         for resolution split from the emit code.
19519
19520 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19521
19522         * statement.cs (EmitBoolExpression): No longer try to resolve the
19523         expression here.    
19524         (MakeBoolean): New utility function that resolve, implicitly
19525         converts to boolean and tags the expression. 
19526
19527
19528         (If, Do): Implement dead code elimination.
19529         (While): Implement loop inversion
19530
19531         (Do, While, For, If): Resolve the expression prior to calling our
19532         code generation.
19533
19534 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19535
19536         * class.cs:
19537           - added method Report28 (warning: program has more than one entry point)
19538           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19539           - modified method Method.Define, the part at the end of the method
19540
19541         * rootcontext.cs: added static public Location EntryPointLocation;
19542           
19543         * ../errors/cs0028.cs : Add test case for the above warning.              
19544
19545         * typemanager.cs:
19546           - modified method CSharpName to allow arrays of primitive type to
19547             be printed nicely (e.g. instead of System.Int32[][] it now prints
19548             int[][])
19549           - added method CSharpSignature: returns the signature of a method
19550             in string format to be used in reporting errors, warnings, etc.
19551
19552         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19553         with String.Empty.
19554
19555 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19556
19557         * delegate.cs (Define): Fix extremely silly bug where I was
19558         setting the type of the 'object' parameter of the BeginInvoke
19559         method to System.IAsyncResult instead of System.Object ;-)
19560
19561 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19562
19563         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19564         here. 
19565
19566         (Constructor.Emit): return if we fail to initialize the
19567         constructor.  Another door closed!  
19568
19569         * expression.cs (New.DoResolve): Improve error message (from -6 to
19570         1501).  Use DeclaredOnly lookup to find the exact constructor.
19571
19572         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19573         loop.  This is useful.
19574
19575         * cs-parser.jay: Adjust the default parameters so that destructors
19576         have the proper signature.
19577
19578 2002-04-26  Martin Baulig  <martin@gnome.org>
19579
19580         * driver.cs (LoadAssembly): If `assembly' contains any characters
19581         which are only valid in path names and not in assembly names
19582         (currently slash, backslash and point), use Assembly.LoadFrom ()
19583         instead of Assembly.Load () on the `assembly' (before iteration
19584         over the link_paths).
19585
19586 2002-04-26  Martin Baulig  <martin@gnome.org>
19587
19588         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19589
19590 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19591
19592         * class.cs (Property): use the new typemanager.MemberLookup
19593
19594         (TypeContainer.MemberLookup): Implement using the
19595         TypeManager.MemberLookup now. 
19596
19597         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19598         and return MemberInfos, so that these can be used without an
19599         EmitContext (what we had before).
19600
19601 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19602
19603         * expression.cs: Fix the case where the argument to params if the
19604         type of the params.  I omitted handling this before.   Fixed
19605
19606 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19607
19608         * driver.cs: Call BootCorlib_PopulateCoreType
19609
19610         * class.cs (Property.CheckBase): Check for properties only, not
19611         for all members. 
19612
19613         * interface.cs: Temporary hack: try/catch around the
19614         CustomAttributeBuilder, because I am getting an exception that I
19615         do not understand.
19616
19617         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19618         types whose definitions are required to be there (attributes are
19619         defined before standard types).
19620
19621         Compute definitions as we boot the various types, as they are used
19622         immediately (value_type class will need object_type, but if we do
19623         not initialize object_type, we will pass a null, which will let
19624         the runtime pick the System.Object from the existing corlib, which
19625         is not what we want).
19626
19627 2002-04-22  Patrik Torstensson <totte@labs2.com>
19628
19629         * cs-tokenizer.cs: fixed a number of trim() issues.
19630
19631 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19632
19633         * expression.cs (Argument.Type): Ensure that we return the correct
19634         type when we have out or ref parameters [in which case we 
19635         append a "&"].
19636
19637 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19638
19639         * class.cs (Property, Indexer): Allow extern modifier in there. 
19640
19641         * typemanager.cs (InitBaseTypes): Initializes object_type and
19642         value_type, since those will be used early on during the bootstrap
19643         process to compile corlib.
19644
19645         (InitCoreTypes): Move code from here to InitBaseTypes.
19646
19647 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19648
19649         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19650         single-dimension arrays as using the ldlen opcode.  
19651
19652         Daniel Lewis discovered this optimization.  
19653
19654         * typemanager.cs: Add signature for System.Array::get_Length
19655
19656 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19657
19658         * statement.cs: report the error when the foreach does not apply to an
19659         array nor a collection.
19660
19661 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19662
19663         * expression.cs: Add implicit conversions to the operator ~.
19664
19665         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19666
19667         * typemanager.cs: Locate the decimal constructor.
19668
19669 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19670
19671         * attribute.cs: use the new property of TypeOf.
19672         * expression.cs: added 'get' property around typearg.
19673
19674         These changes fix a build breaker reported by NickD. Is this the
19675         correct way to fix?  If not, please, revert my changes and make it
19676         work :-).
19677
19678 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19679
19680         * attribute.cs: Add support for typeof in attribute invocations.
19681         I am not sure that this is right though.
19682
19683 2002-04-14  Duncan Mak  <duncan@ximian.com>
19684
19685         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19686         Binary.Operator.Division case.
19687
19688 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19689
19690         * class.cs (DefineType): Ensure that we do a proper check on
19691         attribute types and also register it with the TypeManager.
19692
19693         (TypeContainer.Targets): The default for attribute types is
19694         AttributeTargets.All.
19695
19696         * attribute.cs (ApplyAttributes): Registering the attribute type
19697         is done elsewhere, not when we discover we have a Usage attribute.
19698
19699 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19700
19701         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19702         and get rid of is_delegate parameter.
19703
19704         * everywhere : update.
19705
19706 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19707
19708         * cs-parser.jay (compilation_unit): Revamp completely to use
19709         some new ideas that I got from Rhys' grammar to solve the problems
19710         with assembly level attributes.
19711
19712         (outer_declaration): New grammar production.
19713
19714         (attribute_sections): Add.
19715
19716         (opt_attributes): Base on attribute_sections
19717
19718         (namespace_declaration): Allow opt_attributes to tackle the case
19719         when we have assembly level attributes - we are clever in this
19720         regard now ;-)
19721
19722         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19723         attributes in the non-global context.
19724
19725         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19726         instead of SetGlobalAttributes.
19727
19728         * class.cs, rootcontext.cs : Ensure we define and generate 
19729         attribute types before anything else.
19730
19731         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19732         and flag the new error -20 for the case when the attribute type
19733         does not have valid targets specified. csc does not catch this.
19734
19735         * ../errors/errors.txt : update for error # -20
19736
19737 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19738
19739         * support.cs (InternalParameters.ParameterModifier): Do some null
19740         checking and return sane values.
19741
19742         * class.cs (Method.Define): If we are a PInvoke method, ensure
19743         that we are static and extern. Report error # 601
19744
19745         * ../errors/cs0601.cs : Add test case for the above error.
19746
19747 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19748
19749         * rootcontext.cs (attribute_types): We need to keep type of
19750         all attribute types separately and emit code for them first.
19751
19752         (RegisterAttribute) : Implement.
19753
19754         * class.cs (DefineType): Check if the current Type is a custom
19755         attribute type and register it accordingly.
19756
19757         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19758         adding the first attribute twice and rename to
19759
19760         (SetGlobalAttributes): this.
19761
19762         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19763         lookups.
19764
19765         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19766         if we are processing global arguments. Hmm, I am unsure of this.
19767
19768 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19769
19770         * expression.cs: added static array of strings to avoid calling
19771         Enum.ToString () for Operator in Binary. Significant recover of
19772         performance.
19773
19774 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19775
19776         * class.cs (FindMembers): Allow the Builders of the various
19777         members to be null.  If they are skip them.  This only happens
19778         during the PInvoke declaration.
19779
19780 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19781
19782         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19783         failure, so we do not keep going afterwards.
19784
19785         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19786         wanted to pass `false' as the `is_delegate' argument.  If this is
19787         the case, why not use delegate_type == null to mean `is_delegate =
19788         false' and anything else as is_delegate = true.
19789
19790 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19791
19792         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19793         code for the section, not the beginning of the tests.
19794
19795 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19796
19797         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19798
19799         * expression.cs (Binary): same.  Warn about errors where we have
19800         Enum/Enum in operator + as well.
19801
19802 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19803
19804         * statement.cs:
19805                 - added support for switch(bool)
19806                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19807                 - add TableSwitchEmit() to handle table-based switch statements
19808
19809 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19810
19811         * expression.cs (Invocation.OverloadResolve): Factor out code which
19812         does parameter compatibility checking with arguments so that we can 
19813         re-use the code even from Delegate.VerifyApplicability
19814
19815         (VerifyArgumentsCompat): Move above code here.
19816
19817         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19818         and instead make a call to the above method.
19819
19820 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19821
19822         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19823         We use it to keep track of classes which are attribute types.
19824
19825 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19826
19827         * delegate.cs (Delegate.Define): Correctly define the types in the
19828         presence of fixed and array parameters.
19829
19830         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19831         doing FindMembers.
19832
19833         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19834         include NonPublic after the first iteration.
19835
19836         * class.cs (Indexer.CheckBase): Only check if both parents are
19837         non-null. 
19838
19839         * cs-parser.jay (accessor_body): If empty, set to null.
19840
19841         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19842         same code path here to resolve constants names that we did have in
19843         MemberAccess.DoResolve.  There is too much code duplicated here.
19844
19845 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19846
19847         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19848
19849         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19850         to MakeUnionSet.
19851
19852         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19853         tokens, numbers and strings.
19854
19855         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19856         parenthesis.
19857
19858         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19859         asyncronous parameters and the regular parameters.  
19860
19861         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19862         specify the target directory.
19863
19864         * expression.cs: (This.DoResolve): Simplify
19865         (As.Emit): Optimize, do not generate IsInst if the expression is
19866         always of the given type.
19867
19868         (Is.DoResolve): Bug fix, we were reporting both always/never for
19869         the is expression.
19870
19871         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19872         creating too many unnecessary arrays.
19873
19874 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19877         fields instead of rolling our own initializer.   Takes care of all
19878         implicit conversions, and drops unnecessary static checks/argument.
19879
19880 2002-03-31  Dick Porter  <dick@ximian.com>
19881
19882         * driver.cs: use the GetDirectories() return values properly, and
19883         use "/" as path separator.
19884
19885 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19886
19887         * expression.cs (Unary): Optimize - - expr into expr.
19888         (Binary): Optimize a + (-b) into a -b.
19889
19890         * codegen.cs (CodeGen): Made all methods static.
19891
19892 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19893
19894         * rootcontext.cs: 
19895
19896         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19897         TypeBuilder property.
19898
19899         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19900         instead. 
19901
19902         * tree.cs: Removed the various RecordXXXX, and replaced with a
19903         single RecordDecl.  Removed all the accessor methods, and just
19904         left a single access point Type 
19905
19906         * enum.cs: Rename DefineEnum to DefineType.
19907
19908         * decl.cs: New abstract method `DefineType' used to unify the
19909         Defines for Enumerations, Interfaces, TypeContainers and
19910         Delegates.
19911
19912         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19913         LookupBaseClasses method that used to live in class.cs and
19914         interface.cs here, and renamed to FindType.
19915
19916         * delegate.cs: Implement DefineType.  Take advantage of the
19917         refactored pattern for locating the parent builder without taking
19918         the parent_builder argument (which we know does not work if we are
19919         nested, and triggering a toplevel definition).
19920
19921 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19922
19923         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19924         accessibility of a member has changed during override and report
19925         an error if so.
19926
19927         * class.cs (Method.Define, Property.Define): Only complain on
19928         overrides if the method is private, any other accessibility is
19929         fine (and since we just checked the permission is the same, we are
19930         good to go).
19931
19932         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19933         and elif are processed always.  The other pre-processing
19934         directives are only processed if we are "taking" the path
19935
19936 2002-03-29  Martin Baulig  <martin@gnome.org>
19937
19938         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19939         current location is not Null.
19940
19941         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19942         a separate method so we can profile it.
19943
19944         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19945         `span.Seconds' are just seconds, but no minutes or hours.
19946         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19947
19948 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19949
19950         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19951         Remove the gratuitous set of Final:
19952
19953                                 // If an interface implementation, then we can set Final.
19954                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19955                                     implementing.DeclaringType.IsInterface)
19956                                         flags |= MethodAttributes.Final;
19957
19958         I do not know what I was smoking when I used that.
19959
19960
19961         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19962         step into fixing the name resolution issues for delegates and
19963         unifying the toplevel name resolution.
19964
19965 2002-03-28  Martin Baulig  <martin@gnome.org>
19966
19967         * class.cs (Method.Emit): If we have a symbol writer, call its
19968         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19969         tell it about the current method.
19970
19971         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19972         writer that we're going to emit the first byte of IL code for a new
19973         statement (a new source line).
19974         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19975         EmitContext.Mark() before emitting any code.
19976
19977         * location.cs (SymbolDocument): Return null when we're Null.
19978
19979         * statement.cs (Statement): Moved the `Location loc' variable here.
19980         (Statement.EmitBoolExpression): If we have a symbol writer, call
19981         ec.Mark() before emitting any code to tell it that we're at the
19982         beginning of a new statement.
19983         (StatementExpression): Added `Location' argument to the constructor.
19984         (Block): Added public readonly variable `StartLocation' and public
19985         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19986         (Block): Added constructor which takes a start and end location.
19987         (Block.SetEndLocation): New method. This sets the end location.
19988         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19989         local variables we create.
19990         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19991         each statement and do also mark the begin and end of the block.
19992
19993         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19994         tell it the current lexer.Location, use Location.Null for the end of the
19995         block.
19996         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19997         current block, set its end location using SetEndLocation().
19998         (statement_expression): StatementExpression constructor now takes the
19999         lexer.Location as additional argument.
20000         (for_statement, declare_local_variables): Likewise.
20001         (declare_local_variables): When creating a new implicit block, use the
20002         new Block constructor and pass it the lexer.Location.
20003
20004 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20005
20006         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20007         members also on the parent interfaces recursively.
20008
20009 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20010
20011         * report.cs: Use new formats, since Gonzalo finished the missing
20012         bits. 
20013
20014         * expression.cs (Binary.ResolveOperator): added missing operator|
20015         operator& and operator^ for bool/bool.
20016
20017         * cs-parser.jay: CheckDef now takes a Location argument that is
20018         used to report errors more precisly (instead of reporting the end
20019         of a definition, we try to track something which is a lot closer
20020         to the source of the problem).
20021
20022         * cs-tokenizer.cs: Track global token use, so we can properly flag
20023         the use of #define/#undef after the first token has been seen.
20024
20025         Also, rename the reportXXXX to Error_DescriptiveName
20026
20027         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20028         TypeContainer, so that Enum and Interface can use this too.
20029
20030         * class.cs (TypeContainer.LookupInterfaceOrClass,
20031         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20032         `builder' argument.  Typically this was used to pass the parent
20033         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20034         the definition).  
20035
20036         The problem is that a nested class could trigger the definition of
20037         a toplevel class, and the builder would be obviously wrong in that
20038         case. 
20039
20040         So we drop this argument, and we compute dynamically the
20041         TypeBuilder/ModuleBuilder (the correct information was available
20042         to us anyways from DeclSpace.Parent)
20043
20044         * interface.cs (Interface.DefineInterface): Drop builder
20045         parameter cleanup like class.cs
20046
20047         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20048         like class.cs
20049
20050         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20051         values. 
20052
20053         (Try.Emit): Propagate the returns value from the statement.
20054
20055         (Return.Emit): Even if we are leavning 
20056
20057         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20058
20059         * modifiers.cs: Fix the computation of MethodAttributes flags.
20060
20061 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20062
20063         * driver.cs: allow compilation of files that start with '/'.
20064         Add a default case when checking the argument of --target.
20065
20066 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20067
20068         * interface.cs: Implement the same search algorithm for types in
20069         the interface code.
20070
20071         * delegate.cs: Do not allow multiple definition.
20072
20073         * Recovered ChangeLog that got accidentally amputated
20074
20075         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20076
20077         * rootcontext.cs: Load manually enum to allow core classes to
20078         contain enumerations.
20079
20080         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20081         Update to new static methods in TypeManager.
20082
20083         * typemanager.cs (GetMethod, GetConstructor): Use our
20084         implementation of FindMembers to find the members, since during
20085         corlib compilation, the types are TypeBuilders and GetMethod and
20086         GetConstructor do not work.
20087
20088         Make all methods in TypeManager static.
20089
20090         (InitCodeHelpers): Split the functionality from
20091         the InitCodeTypes function.
20092
20093         * driver.cs: Call InitCodeHelpers after we have populated the
20094         types. 
20095
20096         * cs-parser.jay (delegate_declaration): we did not used to compute
20097         the delegate name correctly for void delegates.
20098
20099 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20100
20101         * rootcontext.cs (RootContext): Init the interface_resolve_order
20102         and type_container_resolve_order always.
20103
20104         (ResolveCore, BootstrapCorlib_ResolveClass,
20105         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20106         compiler when compiling with --nostdlib
20107
20108         * class.cs (TypeContainer.DefineType): Check that our parent is
20109         not null.  This test is most important when we are bootstraping
20110         the core types.
20111
20112         * codegen.cs: Split out the symbol writing code.
20113
20114 2002-03-25  Martin Baulig  <martin@gnome.org>
20115
20116         * driver.cs (-g): Made -g an alias for --debug.
20117
20118 2002-03-24  Martin Baulig  <martin@gnome.org>
20119
20120         * codegen.cs (SymbolWriter): New public variable. Returns the
20121         current symbol writer.
20122         (CodeGen): Added `bool want_debugging_support' argument to the
20123          constructor. If true, tell the ModuleBuild that we want debugging
20124         support and ask it for the ISymbolWriter.
20125         (Save): If we have a symbol writer, call it's Close() method after
20126         saving the assembly.
20127
20128         * driver.c (--debug): New command line argument to create a
20129         debugger information file.
20130
20131         * location.cs (SymbolDocument): New public property. Returns an
20132         ISymbolDocumentWriter object for the current source file or null
20133         if we don't have a symbol writer.
20134
20135 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20136
20137         * driver.cs (LoadAssembly): Correctly return when all the paths
20138         have been tried and not before.
20139
20140         * statement.cs (Switch.Emit): return the actual coverage for this
20141         statement (returns/not-returns)
20142
20143         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20144         switch of the statement if we are the last switch section.  That
20145         kills two problems: try/catch problems (we used to emit an empty
20146         nop at the end) and switch statements where all branches would
20147         return. 
20148
20149 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20150
20151         * driver.cs: Add default assemblies (the equivalent to the
20152         Microsoft CSC.RSP file)
20153
20154         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20155         also update tokens_seen and set it to false.
20156
20157         * driver.cs: Implement --recurse for Mike.
20158
20159         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20160         correctly splitting out the paths.
20161
20162 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * interface.cs (Interface.PopulateProperty): Instead of using
20165         `parent' as the declaration space for the set parameters, use
20166         `this' 
20167
20168         * support.cs (InternalParameters): InternalParameters constructor
20169         takes a DeclSpace instead of a TypeContainer.
20170
20171         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20172         types are being initialized, load the address of it before calling
20173         the function.  
20174
20175         (New): Provide a mechanism to disable the generation of local
20176         value type temporaries when the caller will be providing us with
20177         an address to store it.
20178
20179         (ArrayCreation.EmitDynamicInitializers): Use it.
20180
20181 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20182
20183         * expression.cs (Invocation.EmitArguments): Only probe for array
20184         property if there is more than one argument.  Sorry about that.
20185
20186         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20187         empty param arrays.
20188
20189         * class.cs (Method.LabelParameters): Fix incorrect code path that
20190         prevented the `ParamArrayAttribute' from being applied to the
20191         params attribute.
20192
20193 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20194
20195         * support.cs (ReflectionParameters): Correctly compute whether the
20196         last argument is a params array.  Fixes the problem with
20197         string.Split ('a')
20198
20199         * typemanager.cs: Make the assemblies array always be non-null
20200         (empty, but non-null)
20201
20202         * tree.cs (RecordDecl): New function that abstracts the recording
20203         of names.  This reports error 101, and provides a pointer to the
20204         previous declaration.  Fixes a crash in the compiler.
20205
20206         * cs-parser.jay (constructor_declaration): Update to new grammar,
20207         and provide a constructor_body that can be empty.
20208
20209 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20210
20211         * driver.cs: Add support for --resources.
20212
20213         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20214         Make all types for the various array helper methods be integer.
20215
20216         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20217         CheckState to ConvCast.
20218
20219         (ConvCast): Now it takes a `checked' state argument, to avoid
20220         depending on the emit context for the conversion, and just using
20221         the resolve time setting.
20222
20223         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20224         instead of Invocation.EmitArguments.  We do not emit the original
20225         arguments, instead we emit those which have been converted to
20226         unsigned int expressions.
20227
20228         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20229
20230         * codegen.cs: ditto.
20231
20232         * expression.cs (LocalVariableReference): Drop the use of the
20233         Store function that depended on the variable index.
20234
20235         * statement.cs (VariableInfo): Drop the `Idx' property from this
20236         class, as this is not taking into account the indexes for
20237         temporaries tat we generate during the execution, getting the
20238         indexes wrong.
20239
20240         * class.cs: First emit class initializers, then call the parent
20241         constructor. 
20242
20243         * expression.cs (Binary): Fix opcode emision.
20244         (UnaryMutator.EmitCode): Support checked code generation
20245
20246         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20247         matches for events for both the Static and Instance scans,
20248         pointing to the same element.   Fix that.
20249
20250 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20251
20252         * rootcontext.cs (ResolveTree): Always set the
20253         interface_resolve_order, because nested interfaces will be calling
20254         into us.
20255
20256         * class.cs (GetInterfaceOrClass): Track the same resolution
20257         process used by TypeManager.LookupType.  This fixes the nested
20258         type lookups in class declarations (separate path from
20259         LookupType). 
20260
20261         (TypeContainer.DefineType): Also define nested interfaces.
20262         (TypeContainer.RegisterOrder): New public function used to
20263         register the order in which child interfaces need to be closed.
20264
20265         Nested interfaces need to be closed after their parents have been
20266         created. 
20267
20268         * interface.cs (InterfaceAttr): Put all the logic for computing
20269         the interface attribute here. 
20270
20271         (DefineInterface): Register our interface order with the
20272         RootContext or with the TypeContainer depending on the case.
20273
20274 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20275
20276         * cs-parser.jay: rework foreach statement to work with the new
20277         changes to the policy on SimpleNames.
20278
20279         * report.cs: support Stacktrace on warnings as well.
20280
20281         * makefile: drop --unsafe and /unsafe from the compile.
20282
20283 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20284
20285         * ecore.cs (StandardConversionExists): Modify to take an Expression
20286         as the first parameter. Ensure we do null -> reference type conversion
20287         checking.
20288
20289         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20290         temporary Expression objects.
20291
20292 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20293
20294         * interface.cs: workaround bug in method overloading resolution
20295         (there is already a bugzilla bug for it).
20296
20297 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20298
20299         We could also solve this problem by having a separate path for
20300         performing type lookups, instead of DoResolve, we could have a
20301         ResolveType entry point, and only participating pieces of the
20302         production (simplename, deref, array) would implement this. 
20303
20304         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20305         signal SimpleName to only resolve type names and not attempt to
20306         resolve anything else.
20307
20308         * expression.cs (Cast): Set the flag.
20309
20310         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20311
20312         * class.cs: Only report 108 if there is no `new' modifier.
20313
20314         * cs-parser.jay: rework foreach statement to work with the new
20315         changes to the policy on SimpleNames.
20316         
20317         * report.cs: support Stacktrace on warnings as well.
20318
20319         * makefile: drop --unsafe and /unsafe from the compile.
20320
20321 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20322
20323         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20324         lookups here, instead of doing that at parse time.  This means
20325         that our grammar will not introduce `LocalVariableReferences' as
20326         expressions at this point.  That solves the problem of code like
20327         this:
20328
20329         class X {
20330            static void Main ()
20331            { int X = 1;
20332             { X x = null }}}
20333
20334         This is only half the fix.  The full fix requires parameters to
20335         also be handled in this way.
20336
20337         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20338         makes the use more obvious of the DeclSpace.  The
20339         ec.TypeContainer.TypeBuilder is now only used to pull the
20340         TypeBuilder for it.
20341
20342         My theory is that I can get rid of the TypeBuilder completely from
20343         the EmitContext, and have typecasts where it is used (from
20344         DeclSpace to where it matters).  
20345
20346         The only pending problem is that the code that implements Aliases
20347         is on TypeContainer, and probably should go in DeclSpace.
20348
20349         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20350         lookups here, instead of doing that at parse time.  This means
20351         that our grammar will not introduce `LocalVariableReferences' as
20352         expressions at this point.  That solves the problem of code like
20353         this:
20354
20355         class X {
20356            static void Main ()
20357            { int X = 1;
20358             { X x = null }}}
20359
20360         This is only half the fix.  The full fix requires parameters to
20361         also be handled in this way.
20362
20363         * class.cs (Property.DefineMethod): When implementing an interface
20364         method, set newslot, when implementing an abstract method, do not
20365         set the flag (before we tried never setting it, or always setting
20366         it, which is the difference).
20367         (Indexer.DefineMethod): same.
20368         (Method.DefineMethod): same.
20369
20370         * ecore.cs: Only set the status used flag if we get back a Field.
20371
20372         * attribute.cs: Temporary hack, so Paolo can keep working.
20373
20374 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20375
20376         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20377         the unmanaged type in the case we have a MarshalAs attribute.
20378
20379         (Resolve): Handle the case when we are parsing the special MarshalAs
20380         attribute [we need to store the unmanaged type to use later]
20381
20382         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20383         MarshalAs Attribute.
20384
20385         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20386         on parameters and accordingly set the marshalling info.
20387
20388 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20389
20390         * class.cs: Optimizing slightly by removing redundant code after
20391         we switched to the `NoTypes' return value.
20392         (Property.DefineMethod): use NoTypes here too.
20393
20394         This fixes the bug I introduced in my last batch of changes.
20395
20396 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20397
20398         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20399
20400         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20401         Enums since those are types too. 
20402
20403         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20404
20405         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20406         thanks to a call during the lookup process.
20407
20408 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20409
20410         * statement.cs (Foreach): Lots of work to accomodate a particular
20411         kind of foreach statement that I had not kept in mind.  It is
20412         possible to have foreachs on classes that provide a GetEnumerator
20413         method that return objects that implement the "pattern" for using
20414         a foreach, there is no need to support GetEnumerator
20415         specifically. 
20416
20417         This is needed to compile nant.
20418
20419         * decl.cs: Only report 114 if the member is not `Finalize' and if
20420         the warning level is at least 2.
20421
20422         * class.cs: Moved the compare function from Method to
20423         MethodSignature. 
20424
20425         (MethodSignature.InheritableMemberSignatureCompare): Add new
20426         filter function that is used to extract inheritable methods from a
20427         class. 
20428
20429         (Method.Define): Use the new `inheritable_method_signature_filter'
20430         delegate
20431
20432         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20433         command. 
20434
20435 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20436
20437         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20438
20439         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20440
20441         * expression.cs: Pass location information to
20442         ConvertImplicitStandard. 
20443
20444         * class.cs: Added debugging code to track return values from
20445         interfaces. 
20446
20447 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20448
20449         * expression.cs (Is.DoResolve): If either side of the `is' is an
20450         interface, do not flag the warning.
20451
20452         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20453         for interfaces
20454
20455         * report.cs: Allow for --fatal to be used with --probe.
20456
20457         * typemanager.cs (NoTypes): Move the definition for the empty Type
20458         array here. 
20459
20460         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20461         properties. 
20462         (TypeContainer.DefineProxy): New function used to proxy to parent
20463         implementations when implementing interfaces.
20464         (TypeContainer.ParentImplements): used to lookup if our parent
20465         implements a public function that is required by an interface.
20466         (TypeContainer.VerifyPendingMethods): Hook this up.
20467
20468         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20469         `modules' and `assemblies' arraylists into arrays.  We only grow
20470         these are the very early start up of the program, so this improves
20471         the speedof LookupType (nicely measured).
20472
20473         * expression.cs (MakeByteBlob): Replaced unsafe code with
20474         BitConverter, as suggested by Paolo.
20475
20476         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20477         folding of string concatenation, but if either side is a string,
20478         and the other is not, then return null, and let the runtime use
20479         the concatenation on the string plus the object (using
20480         `Object.ToString'). 
20481
20482 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20483
20484         Constant Folding has been implemented now.
20485
20486         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20487         the error instead on types that are not supported in one's
20488         complement. 
20489
20490         * constant.cs (Constant and all children): New set of functions to
20491         perform implict and explicit conversions.
20492
20493         * ecore.cs (EnumConstant): Implement the new functions to perform
20494         conversion by proxying to the child expression.
20495
20496         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20497         own separate setting that can not be turned off from the command
20498         line using --unchecked or --checked and is only controlled using
20499         the checked/unchecked statements and expressions.  This setting is
20500         used by the constant folder to flag errors.
20501
20502         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20503         ConstantCheckState as well.   
20504
20505         During Resolve, they also have to flag the state, because the
20506         constant folder runs completely in the Resolve phase.
20507
20508         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20509         well.
20510
20511 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20512
20513         * cfold.cs: New file, this file contains the constant folder.
20514
20515         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20516         argument to track whether we are using the resulting address to
20517         load or store a value and provide better error messages. 
20518
20519         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20520         new AddressOf arguments.
20521
20522         * statement.cs (Foreach.EmitCollectionForeach): Update
20523
20524         * expression.cs (Argument.Emit): Call AddressOf with proper
20525         arguments to track usage.
20526
20527         (New.DoEmit): Call AddressOf with new arguments.
20528
20529         (Unary.Emit): Adjust AddressOf call.
20530
20531 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20532
20533         * cs-parser.jay (member_access): Change the case for pre-defined types
20534         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20535         this suggestion.
20536
20537         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20538         a method body.
20539
20540         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20541         essentially like methods and apply attributes like MethodImplOptions to them too.
20542
20543         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20544         not being null.
20545
20546         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20547         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20548         is the DeclSpace.
20549
20550         * Update code everywhere accordingly.
20551
20552         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20553
20554         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20555
20556 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20557
20558         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20559         try performing lookups against those instead of jumping straight into using
20560         the 'using' clauses.
20561
20562         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20563
20564         (LookupType): Perform lookups in implicit parents too.
20565
20566         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20567         sequence as RootContext.LookupType. 
20568
20569         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20570         the various cases of namespace lookups into this method.
20571
20572 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20573
20574         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20575         in positional arguments)
20576
20577         * class.cs (Operator): Update the AllowedModifiers to contain
20578         extern. 
20579
20580         * cs-parser.jay: Update operator declaration to allow for the
20581         operator body to be empty.
20582
20583         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20584         values. 
20585
20586 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * class.cs (Method.Emit): Label parameters.
20589
20590         * driver.cs: Return 1 or 0 as the program exit code.
20591
20592 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20593
20594         * expression.cs: Special case the `null' object when trying to
20595         auto-compute the type, as anything can be explicitly converted to
20596         that. 
20597
20598         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20599         spotting this Paolo.
20600
20601         (Expression.ImplicitNumericConversion): Perform comparissions of
20602         the type using the underlying type in the case of an enumeration
20603         rather than using the enumeration type for the compare.
20604
20605         Cope with the underlying == type case, which is not possible to
20606         catch before. 
20607
20608         (Expression.ConvertNumericExplicit): Perform comparissions of
20609         the type using the underlying type in the case of an enumeration
20610         rather than using the enumeration type for the compare.
20611
20612         * driver.cs: If the user does not supply an extension, assume .exe
20613
20614         * cs-parser.jay (if_statement): Rewrote so that we can track the
20615         location for the if statement.
20616
20617         * expression.cs (Binary.ConstantFold): Only concat strings when
20618         the operation is "+", not everything ;-)
20619
20620         * statement.cs (Statement.EmitBoolExpression): Take a location
20621         argument. 
20622         (If, While, Do): Track location.
20623
20624         * expression.cs (Binary.ResolveOperator): In the object + string
20625         case, I was missing a call to ConvertImplicit
20626
20627 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20628
20629         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20630         Location arguments. Ensure we use RootContext.LookupType to do our work
20631         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20632
20633         * interface.cs (PopulateMethod): Handle the type of the parameter being
20634         null gracefully.
20635
20636         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20637         have a params method with no fixed arguments and a call is made with no
20638         arguments.
20639
20640 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20641
20642         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20643         the verbatim-string-literal
20644
20645         * support.cs (InternalParameters.ParameterModifier): handle null
20646         fixed parameters.
20647         (InternalParameters.ParameterType): ditto.
20648
20649         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20650         duplicating the name of the variable parameter.
20651         (GetParameterByName): Fix bug where we were not looking up array
20652         paramters if they were the only present (thanks Paolo!).
20653         (GetParameterInfo): We only have an empty set of types if both
20654         fixed and array are set to null.
20655         (GetParameterInfo-idx): Handle FixedParameter == null
20656
20657         * cs-parser.jay: Handle the case where there is no catch
20658         statements (missing null test).
20659
20660 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20661
20662         * driver.cs (MainDriver): Be conservative on our command line
20663         handling.
20664
20665         Catch DirectoryNotFoundException when calling GetFiles.
20666
20667         (SplitPathAndPattern): Used to split the input specification into
20668         a path and a pattern that we can feed to Directory.GetFiles.
20669
20670 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20671
20672         * statement.cs (Fixed): Implement the last case of the Fixed
20673         statement (string handling).
20674
20675         * expression.cs (StringPtr): New class used to return a char * to
20676         a string;  Used by the Fixed statement.
20677
20678         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20679
20680         * expression.cs (Binary.ResolveOperator): Remove redundant
20681         MemberLookup pn parent type.
20682         Optimize union call, we do not need a union if the types are the same.
20683         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20684         type.
20685
20686         Specialize the use of MemberLookup everywhere, instead of using
20687         the default settings. 
20688
20689         (StackAlloc): Implement stackalloc keyword.
20690
20691         * cs-parser.jay: Add rule to parse stackalloc.
20692
20693         * driver.cs: Handle /h, /help, /?
20694
20695         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20696         before we supported unsafe code.
20697
20698         * makefile: add --unsafe to the self compilation of mcs.
20699
20700 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20701
20702         * expression.cs (PointerArithmetic): New class that is used to
20703         perform pointer arithmetic.
20704         (Binary.Resolve): Handle pointer arithmetic
20705         Handle pointer comparission.
20706         (ArrayPtr): Utility expression class that is used to take the
20707         address of an array.
20708
20709         (ElementAccess): Implement array access for pointers
20710
20711         * statement.cs (Fixed): Implement fixed statement for arrays, we
20712         are missing one more case before we are done.
20713
20714         * expression.cs (Indirection): Implement EmitAssign and set the
20715         ExprClass to Variable.  This allows pointer dereferences to be
20716         treated as variables, and to have values assigned to them.
20717
20718         * ecore.cs (Expression.StoreFromPtr): New utility function to
20719         store values dereferencing.
20720
20721 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20722
20723         * expression.cs (Binary.ResolveOperator): Ensure that we are
20724         not trying to operate on a void type - this fixes the reported
20725         bug.
20726
20727         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20728         the parent implementation is sealed.
20729
20730         * ../errors/cs0239.cs : Add.
20731
20732         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20733
20734         * typemanager.cs (unverifiable_code_type): Corresponds to 
20735         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20736         which have unsafe code in them.
20737
20738         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20739         unsafe context.
20740
20741 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20742
20743         * cs-tokenizer.cs: Add support for @"litreal strings"
20744
20745         Make tokenizer accept pre-processor directives
20746         on any column (remove the old C-like limitation). 
20747
20748         * rootcontext.cs (EmitCode): Emit any global attributes.
20749         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20750
20751         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20752
20753         * cs-parser.jay: Add support for global attributes.  
20754
20755 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20756
20757         * expression.cs (Indirection): New helper class.  Unary will
20758         create Indirection classes to be able to implement the
20759         IMemoryLocation interface on it.
20760
20761 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20762
20763         * cs-parser.jay (fixed_statement): reference the right statement.
20764
20765         * statement.cs (Fixed.Emit): Finish implementing the fixed
20766         statement for the &x case.
20767
20768 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20769
20770         * class.cs (Property.Define, Method.Define): Remove newslot when
20771         `implementing'.  
20772
20773         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20774         wrong.  NewSlot should only be used if the `new' keyword is present.
20775
20776         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20777         locating our system dir.  Sorry about this.
20778
20779 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20780
20781         * driver.cs (GetSystemDir): Compute correctly the location of our
20782         system assemblies.  I was using the compiler directory instead of
20783         the library directory.
20784
20785 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20786
20787         * expression.cs (BetterFunction): Put back in what Miguel commented out
20788         since it is the correct fix. The problem is elsewhere ;-)
20789
20790         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20791         parameters of the parms method are themselves compatible or not !
20792
20793         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20794         to check that a class implements an interface before saying that an implicit
20795         conversion was allowed. Use ImplementsInterface to do the checking.
20796
20797 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20798
20799         * class.cs (Method.Define): Track whether we are an explicit
20800         implementation or not.  And only call DefineMethodOverride if we
20801         are an explicit implementation.
20802
20803         (Property.DefineMethod): Ditto.
20804
20805 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20806
20807         * expression.cs (BetterFunction): Catch hideous bug which was
20808          preventing us from detecting ambiguous calls due to implicit casts i.e
20809         cs0121.
20810
20811 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20812
20813         * support.cs (Pair): Remove un-needed method.  I figured why I was
20814         getting the error in cs-parser.jay, the variable in a foreach loop
20815         is readonly, and the compiler does not really treat this as a variable.
20816
20817         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20818         instead of EQUALS in grammar.  
20819
20820         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20821
20822         * expression.cs (Unary.DoResolve): Check whether the argument is
20823         managed or not.
20824
20825 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20826
20827         * support.cs: Api for Pair to set a value.  Despite the fact that
20828         the variables are public the MS C# compiler refuses to compile
20829         code that accesses the field if the variable is part of a foreach
20830         statement. 
20831
20832         * statement.cs (Fixed): Begin implementation of the fixed
20833         statement.
20834
20835         (Block.AddVariable): Return the VariableInfo on success and null
20836         on failure instead of true/false. 
20837
20838         * cs-parser.jay (foreach): Catch errors on variables already
20839         defined (we were ignoring this value before) and properly unwind
20840         the block hierarchy
20841
20842         (fixed_statement): grammar for the fixed statement.
20843
20844 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20845
20846         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20847         pointer types to be incretemented.
20848
20849         (SizeOf): Implement.
20850
20851         * cs-parser.jay (pointer_member_access): Implement
20852         expr->IDENTIFIER production.
20853
20854         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20855         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20856         on safe contexts.
20857
20858         (Unary): Implement indirection.
20859
20860         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20861         use in non-unsafe context).
20862
20863         (SimpleName.DoResolve): Check for pointers in field access on safe
20864         contexts. 
20865
20866         (Expression.LoadFromPtr): Factor the load-indirect code in this
20867         function.  This was duplicated in UnboxCast and ParameterReference
20868
20869 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20870
20871         * expression.cs (ComposedCast): report an error if a pointer cast
20872         is used in a safe region.
20873
20874         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20875         pointer type casts in unsafe context.
20876
20877         * codegen.cs (EmitContext): Set up IsUnsafe.
20878
20879         * cs-parser.jay (non_expression_type): Add productions for pointer
20880         casts. 
20881
20882         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20883         code.  We should not use force into static mode if the method is
20884         not virtual.  Fixes bug in MIS
20885
20886         * statement.cs (Do.Emit, While.Emit, For.Emit,
20887         Statement.EmitBoolExpression): Add support to Do and While to
20888         propagate infinite loop as `I do return' semantics.
20889
20890         Improve the For case to also test for boolean constants.
20891
20892         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20893         to the list of attributes we can add.
20894
20895         Remove `EmitContext' argument.
20896
20897         * class.cs (Method.Define): Apply parameter attributes.
20898         (Constructor.Define): Apply parameter attributes.
20899         (MethodCore.LabelParameters): Move here the core of labeling
20900         parameters. 
20901
20902         * support.cs (ReflectionParameters.ParameterModifier,
20903         InternalParameters.ParameterModifier): Use IsByRef on the type and
20904         only return the OUT bit for these parameters instead of in/out/ref
20905         flags.
20906
20907         This is because I miss-understood things.  The ParameterInfo.IsIn
20908         and IsOut represent whether the parameter has the [In] and [Out]
20909         attributes set.  
20910
20911 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20912
20913         * ecore.cs (FieldExpr.Emit): Release temporaries.
20914
20915         * assign.cs (LocalTemporary.Release): new function.
20916
20917         * codegen.cs (EmitContext.GetTemporaryStorage,
20918         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20919         temporary storage.  Now we can "put back" localbuilders when we
20920         are done with them
20921
20922 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20923
20924         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20925         need to make a copy of the variable to generate verifiable code.
20926
20927 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20928
20929         * driver.cs: Compute dynamically the system directory.
20930
20931         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20932         Slower, but more generally useful.  Used by the abstract
20933         registering implementation. 
20934
20935         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20936         the rules for the special rule on Type/instances.  First check if
20937         we have the same name, and if so, try that special static path
20938         rather than the instance path.
20939
20940 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20941
20942         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20943         for, while and if.
20944
20945         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20946         Enum, ValueType, Delegate or Array for non-corlib compiles.
20947
20948         * cs-tokenizer.cs: Catch long identifiers (645)
20949
20950         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20951         piece of code.
20952
20953         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20954         fix, we were returning too early, so we were not registering
20955         pending methods from abstract classes.
20956
20957         Do not register pending methods if the class is abstract.
20958
20959         * expression.cs (Conditional.DoResolve): Report circular implicit
20960         conversions when we neecd to compute it for conditional
20961         expressions. 
20962
20963         (Is.DoResolve): If the expression is always of the provided type,
20964         flag warning 183.  If the expression can not ever be of the
20965         provided type flag warning 184.
20966
20967         * class.cs: Catch 169 as well.
20968
20969         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20970         read. 
20971
20972 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20973
20974         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20975
20976 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20977
20978         * interface.cs: (PopulateMethod): Check for pointers being defined
20979         only if the unsafe context is active.
20980         (PopulateProperty): ditto.
20981         (PopulateIndexer): ditto.
20982
20983         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20984         specified.  If pointers are present, make sure that they are
20985         present in an unsafe context.
20986         (Constructor, Constructor.Define): ditto.
20987         (Field, Field.Define): ditto.
20988         (Property, Property.Define): ditto.
20989         (Event, Event.Define): ditto.
20990
20991         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20992         hashtable if there are classes or structs defined.
20993
20994         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20995         code, as the constant resolution moved.
20996
20997         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20998         the metadata, so we can flag error 133. 
20999
21000         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21001         pointer is being declared in an unsafe context.
21002
21003 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21004
21005         * modifiers.cs (Modifiers.Check): Require a Location argument.
21006         Report error 227 for Unsafe use.
21007
21008         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21009
21010         * statement.cs (For.Emit): If the test is null, then report that
21011         we do `return', as we wont reach anything afterwards.
21012
21013         (Switch.SwitchGoverningType): Track the expression that matched
21014         the conversion.
21015
21016         * driver.cs: Allow negative numbers as an error code to flag.
21017
21018         * cs-parser.jay: Handle 1551.
21019
21020         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21021
21022 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21023
21024         * cs-parser.jay: Report 1518 (type declaration can only contain
21025         class, struct, interface, enum or delegate)
21026
21027         (switch_label): Report 1523 (keywords `case' or `default' must
21028         preced code)
21029
21030         (opt_switch_sections): Report 1522 (empty switch)
21031
21032         * driver.cs: Report 1515 (response file specified multiple times)
21033         Report 1516 (Source file specified multiple times).
21034
21035         * expression.cs (Argument.Resolve): Signal 1510
21036
21037         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21038         access not allowed in static code)
21039
21040 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21041
21042         * typemanager.cs (IsPointerType): Utility method which we are going
21043         to need a lot.
21044
21045         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21046         the object type, so we take care of that.
21047
21048         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21049
21050         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21051         added to non-params parameters :-)
21052
21053         * typemanager.cs (CSharpName): Include 'void' type too. 
21054
21055         (void_ptr_type): Include in the set of core types.
21056
21057         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21058         duplicating code.
21059
21060         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21061         an unsafe context.
21062
21063         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21064         completely forgotten about it.
21065
21066 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21067
21068         * cs-parser.jay (pointer_type): Add. This begins our implementation
21069         of parsing rules for unsafe code.
21070
21071         (unsafe_statement): Implement.
21072
21073         (embedded_statement): Modify to include the above.
21074
21075         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21076
21077         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21078         if the current context is an unsafe one.
21079
21080         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21081         are handled differently, we need separate rules for them.
21082
21083         (local_variable_declaration): Update to use local_variable_pointer_type
21084         to allow variable declarations of unmanaged pointer types.
21085
21086         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21087         in unsafe contexts.
21088
21089         * ../errors/cs0214.cs : Add.
21090
21091 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21092
21093         * makefile: remove 'response' file when cleaning.
21094
21095 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21096
21097         * cs-parser.jay: Report 1524.
21098
21099 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21100
21101         * typemanager.cs (RegisterMethod): drop checking if we have
21102         registered this from here
21103
21104 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21105
21106         * class.cs (Method.EmitDestructor): Implement calling our base
21107         destructor. 
21108
21109         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21110         value of InFinally.
21111
21112         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21113         this routine and will wrap the call in a try/catch block.  Deal
21114         with the case.
21115
21116 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21117
21118         * ecore.cs (Expression.MemberLookup): instead of taking a
21119         parameter `same_type' that was used to tell whether we could
21120         access private members we compute our containing type from the
21121         EmitContext.
21122
21123         (FieldExpr): Added partial support for volatile fields.  This does
21124         not work for volatile fields exposed from assemblies, as I can not
21125         figure out how to extract the modreq from it.
21126
21127         Updated all the source files to use this.
21128
21129         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21130         because it is referenced by MemberLookup very often. 
21131
21132 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21133
21134         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21135         TypeBuilder.GetCustomAttributes to retrieve what we need.
21136
21137         Get rid of redundant default_member_attr_type as this is the same as
21138         default_member_type which already exists.
21139
21140         * interface.cs, attribute.cs : Update accordingly.
21141
21142 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21143
21144         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21145         work for TYpeBuilders though.  Ravi, can you please fix this?
21146
21147         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21148
21149         * expression.cs (Argument.Emit): Handle the case of ref objects
21150         being passed to ref functions;  
21151
21152         (ParameterReference.EmitLoad): Loads the content of the pointer
21153         without dereferencing.
21154
21155 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21156
21157         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21158
21159 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21160
21161         * class.cs (Indexer.DefineMethod): Incorporate the interface
21162         type in the name of the method if we are doing explicit interface
21163         implementation.
21164
21165         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21166
21167         (BetterConversion): Fix extremely trivial bug where we were referring to
21168         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21169         again !
21170
21171         * ../errors/bug16.cs : Add although we have fixed it.
21172
21173 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21174
21175         * expression.cs (BaseIndexer): Begin implementation.
21176
21177         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21178
21179         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21180         production directly to remove a shift/reduce, and implement
21181         explicit interface implementation.
21182
21183         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21184         after a floating point suffix.
21185
21186         * expression.cs (DoNumericPromotions): Improved the conversion for
21187         uint/uint.  If we have a constant, we avoid doing a typecast to a
21188         larger type.
21189
21190         * class.cs (Indexer): Implement explicit interface implementation
21191         for indexers.
21192
21193 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21194
21195         * class.cs: make the default instance constructor public and hidebysig.
21196
21197 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21198
21199         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21200         so we can call it from elsewhere.
21201
21202         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21203         we emit it internally if the class has a defined indexer; otherwise the user
21204         emits it by decorating the class definition with the DefaultMemberAttribute.
21205
21206         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21207         attribute is not used on a type which defines an indexer.
21208
21209         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21210         character when we skip whitespace.
21211
21212         * ../errors/cs0646.cs : Add.
21213
21214 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21215
21216         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21217         again. 
21218
21219         * makefile: Add practical target `mcs3.exe' which builds the third
21220         generation compiler. 
21221
21222         * expression.cs (New): Fix structures constructor calling.
21223
21224         * class.cs (Property, Method, Indexer): Emit Final flag on the
21225         method if we are an interface implementation and we are not
21226         abstract. 
21227
21228         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21229         whether this property is referencing a `base' method.
21230
21231         * expression.cs (Invocation.EmitCall): take an extra argument:
21232         is_base, this is used to determine whether the `call' or
21233         `callvirt' opcode should be used.
21234
21235
21236         * delegate.cs: update EmitCall.
21237
21238         * class.cs (Method.Define): Set NewSlot for the cases where we are
21239         not implementing an interface method.
21240
21241         (Property.Define): ditto.
21242
21243 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21244
21245         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21246         'r'.  Allows mcs to parse itself fully.
21247
21248 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21249
21250         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21251         of the number of initializers that require the InitializeArray method.
21252
21253         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21254         update the above field where necessary.
21255
21256         (MakeByteBlob): Update accordingly.
21257
21258         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21259         greater than 2.
21260
21261         (EmitDynamicInitializers): Update in accordance with the new optimization.
21262
21263         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21264         same OpCode applies.
21265
21266         * cs-parser.jay : Fix some glaring errors I introduced.
21267
21268 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21269
21270         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21271         so that we can check for name clashes there too.
21272
21273         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21274         for interface indexers.
21275
21276         * interfaces.cs (Define): Emit the default member attribute.
21277
21278         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21279         variable was being referred to while setting the value ;-)
21280
21281 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21282
21283         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21284         byte-by-byte information when we know the data is zero.
21285
21286         Make the block always a multiple of 4, because
21287         DefineInitializedData has a bug.
21288
21289         * assign.cs: Fix, we should assign from the temporary, not from
21290         the source. 
21291
21292         * expression.cs (MakeByteBlob): Fix my incorrect code.
21293
21294 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21295
21296         * typemanager.cs (EnumToUnderlying): This function is used to get
21297         the underlying type from an enumeration, because it does not
21298         always work. 
21299
21300         * constant.cs: Use the I4_S form for values between -128 and 127.
21301
21302         * statement.cs (Block.LookupLabel): Looks up a label.
21303         (Block): Drop support for labeled blocks.
21304
21305         (LabeledStatement): New kind of statement that represents a label
21306         only.
21307
21308         (Goto): Finally implement this bad boy.
21309
21310         * cs-parser.jay: Update to reflect new mechanism to implement
21311         labels.
21312
21313 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21314
21315         * codegen.cs (EmitContext.This): a codegen property that keeps the
21316         a single instance of this instead of creating many different this
21317         instances. 
21318
21319         * delegate.cs (Delegate.DoResolve): Update to use the property;
21320
21321         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21322
21323         * expression.cs (BaseAccess.DoResolve): Ditto.
21324
21325 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21326
21327         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21328         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21329
21330         (InitCoreTypes): Update accordingly.
21331
21332         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21333         so we can quickly store the state.
21334
21335         (ApplyAttributes): Set the correct implementation flags
21336         for InternalCall methods.
21337
21338 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21339
21340         * expression.cs (EmitCall): if a method is not virtual, then do
21341         not use callvirt on it.
21342
21343         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21344         user defined stuff) requires the use of stobj, which takes an
21345         address on the stack instead of an array and an index.  So emit
21346         the Ldelema operation for it.
21347
21348         (EmitStoreOpcode): Use stobj for valuetypes.
21349
21350         (UnaryMutator.EmitCode): Use the right 1 value depending on
21351         whether we are dealing with int64/uint64, float or doubles.
21352
21353         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21354         constructors that I implemented last night.
21355
21356         (Constructor.IsDefault): Fix to work properly for static
21357         constructors.
21358
21359         * cs-parser.jay (CheckDef): report method signature errors.
21360         Update error number 103 to be 132.
21361
21362         * decl.cs: New AdditionResult enumeration value: MethodExists.
21363         Although we do this check for methods later on in the semantic
21364         analysis, catching repeated default constructors is so easy that
21365         we catch these here. 
21366
21367         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21368         promotions code.
21369
21370         (ParameterReference.EmitAssign, Emit): handle
21371         bools as bytes.
21372
21373         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21374         (ArrayAccess.EmitStoreOpcode): ditto.
21375
21376         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21377
21378         * expression.cs (MakeByteBlob): Complete all the missing types
21379         (uint, short, ushort, byte, sbyte)
21380
21381         * class.cs: Only init instance field initializers on instance
21382         constructors. 
21383
21384         Rename `constructors' to instance_constructors. 
21385
21386         (TypeContainer.AddConstructor): Only add constructors to the list
21387         if it is not static.
21388
21389         Make sure that we handle default_static_constructor independently
21390         everywhere where we handle instance_constructors
21391
21392 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21393
21394         * class.cs: Do not lookup or create a base initializer for a
21395         static constructor.
21396
21397         (ConstructorInitializer.Resolve): use the proper type to lookup
21398         for constructors.
21399
21400         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21401
21402         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21403         in DeclSpace. 
21404
21405         * decl.cs: CloseType is now an virtual method, the default
21406         implementation just closes this type.
21407
21408 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21409
21410         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21411         to PreserveSig by default. Also emit HideBySig on such methods.
21412
21413         Basically, set the defaults to standard values.
21414
21415         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21416         argument, if candidate is better, it can't be worse than the best !
21417
21418         (Invocation): Re-write bits to differentiate between methods being
21419         applicable in their expanded form and their normal form - for params
21420         methods of course.
21421
21422         Get rid of use_standard everywhere as only standard conversions are allowed
21423         in overload resolution. 
21424
21425         More spec conformance.
21426
21427 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21428
21429         * driver.cs: Add --timestamp, to see where the compiler spends
21430         most of its time.
21431
21432         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21433         `this' in static code.
21434
21435         (SimpleName.DoResolve): Implement in terms of a helper function
21436         that allows static-references to be passed upstream to
21437         MemberAccess.
21438
21439         (Expression.ResolveWithSimpleName): Resolve specially simple
21440         names when called by MemberAccess to implement the special
21441         semantics. 
21442
21443         (Expression.ImplicitReferenceConversion): Handle conversions from
21444         Null to reference types before others, as Null's type is
21445         System.Object. 
21446
21447         * expression.cs (Invocation.EmitCall): Handle the special case of
21448         calling methods declared on a reference type from a ValueType
21449         (Base classes System.Object and System.Enum)
21450
21451         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21452         the left hand side is a TypeExpr, not on every enumeration. 
21453
21454         (Binary.Resolve): If types are reference types, then do a cast to
21455         object on operators != and == of both arguments.
21456
21457         * typemanager.cs (FindMembers): Extract instance and static
21458         members if requested.
21459
21460         * interface.cs (PopulateProperty): Use void_type instead of null
21461         as the return type for the setter method.
21462
21463         (PopulateIndexer): ditto.
21464
21465 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21466
21467         * support.cs (ReflectionParameters): Fix minor bug where we
21468         were examining the wrong parameter for the ParamArray attribute.
21469
21470         Cope with requests for the type of the parameter at position
21471         greater than the params parameter's. We now return the element
21472         type of the params array as that makes more sense.
21473
21474         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21475         accordingly as we no longer have to extract the element type
21476         ourselves.
21477
21478         (Invocation.OverloadResolve): Update.
21479
21480 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21481
21482         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21483         against IEnumerator, test whether the return value is a descendant
21484         of the IEnumerator interface.
21485
21486         * class.cs (Indexer.Define): Use an auxiliary method to implement
21487         the other bits of the method definition.  Begin support for
21488         explicit interface implementation.
21489
21490         (Property.DefineMethod): Use TypeManager.void_type instead of null
21491         for an empty return value.
21492
21493 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21494
21495         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21496         dealing with a FieldExpr which is composed of a FieldBuilder, in
21497         the code path we did extract the constant, but we should have
21498         obtained the underlying value to be able to cast it (otherwise we
21499         end up in an infinite loop, this is what Ravi was running into).
21500
21501         (ArrayCreation.UpdateIndices): Arrays might be empty.
21502
21503         (MemberAccess.ResolveMemberAccess): Add support for section
21504         14.5.4.1 that deals with the special case of E.I when E is a type
21505         and something else, that I can be a reference to a static member.
21506
21507         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21508         handle a particular array type to create byte blobs, it is just
21509         something we dont generate byteblobs for.
21510
21511         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21512         arguments. 
21513
21514         * location.cs (Push): remove the key from the hashtable that we
21515         are about to add.   This happens for empty files.
21516
21517         * driver.cs: Dispose files after we have parsed them.
21518
21519         (tokenize): new function that only runs the tokenizer on its
21520         input, for speed testing.
21521
21522 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21523
21524         * class.cs (Event.Define): Define the private field only if there
21525         are no accessors defined.
21526
21527         * expression.cs (ResolveMemberAccess): If there is no associated
21528         field with the event, that means we have an event defined with its
21529         own accessors and we should flag error cs0070 since transforming
21530         ourselves into a field is not valid in that case.
21531
21532         * ecore.cs (SimpleName.DoResolve): Same as above.
21533
21534         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21535         and charset to sane values.
21536
21537 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21538
21539         * assign.cs (DoResolve): Perform check on events only if they 
21540         are being accessed outside the declaring type.
21541
21542         * cs-parser.jay (event_declarations): Update rules to correctly
21543         set the type of the implicit parameter etc.
21544
21545         (add_accessor, remove_accessor): Set current local parameters.
21546
21547         * expression.cs (Binary): For delegate addition and subtraction,
21548         cast the return value from the method into the appropriate delegate
21549         type.
21550
21551 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21552
21553         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21554         of these as the workaround is unnecessary.
21555
21556         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21557         delegate data - none of that is needed at all.
21558
21559         Re-write bits to extract the instance expression and the delegate method
21560         correctly.
21561
21562         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21563         on delegates too.
21564
21565         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21566         of attaching attributes instead of duplicating code everywhere.
21567
21568         * everywhere : Update code to do attribute emission using the above method.
21569
21570 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21571
21572         * expression.cs (IsParamsMethodApplicable): if there are not
21573         parameters, return immediately.
21574
21575         * ecore.cs: The 0 literal can be implicity converted to an enum
21576         type. 
21577
21578         (SimpleName.DoResolve): First lookup the type, then lookup the
21579         members. 
21580
21581         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21582         want to get its address.  If the InstanceExpression is not
21583         addressable, store the result in a temporary variable, then get
21584         the address of it.
21585
21586         * codegen.cs: Only display 219 errors on warning level or above. 
21587
21588         * expression.cs (ArrayAccess): Make it implement the
21589         IMemoryLocation interface.
21590
21591         (Binary.DoResolve): handle the operator == (object a, object b)
21592         and operator != (object a, object b) without incurring into a
21593         BoxedCast (because 5 != o should never be performed).
21594
21595         Handle binary enumerator operators.
21596
21597         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21598         value type, otherwise use Ldelem_ref.
21599
21600         Use precomputed names;
21601
21602         (AddressOf): Implement address of
21603
21604         * cs-parser.jay (labeled_statement): Fix recursive block
21605         addition by reworking the production.
21606
21607         * expression.cs (New.DoEmit): New has a special case:
21608                 
21609                  If we are dealing with a ValueType, we have a few
21610                  situations to deal with:
21611                 
21612                     * The target of New is a ValueType variable, that is
21613                       easy, we just pass this as the variable reference
21614                 
21615                     * The target of New is being passed as an argument,
21616                       to a boxing operation or a function that takes a
21617                       ValueType.
21618                 
21619                       In this case, we need to create a temporary variable
21620                       that is the argument of New.
21621
21622
21623 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21624
21625         * rootcontext.cs (LookupType): Check that current_type is not null before
21626         going about looking at nested types.
21627
21628         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21629         not implement the IAssignMethod interface any more.
21630
21631         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21632         where we tranform them into FieldExprs if they are being resolved from within
21633         the declaring type.
21634
21635         * ecore.cs (SimpleName.DoResolve): Do the same here.
21636
21637         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21638
21639         * ../errors/bug10.cs : Add.
21640
21641         * ../errors/cs0070.cs : Add.
21642
21643         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21644
21645         * assign.cs : Get rid of EventIsLocal everywhere.
21646
21647 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21648
21649         * ecore.cs (ConvertIntLiteral): finished the implementation.
21650
21651         * statement.cs (SwitchLabel): Convert the value we are using as a
21652         key before looking up the table.
21653
21654 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21655
21656         * codegen.cs (EmitTopBlock): Require a Location argument now.
21657
21658         * cs-parser.jay (constructor_declarator): We need to setup
21659         current_local_parameters before we parse the
21660         opt_constructor_initializer, to allow the variables to be bound
21661         to the constructor arguments.
21662
21663         * rootcontext.cs (LookupType): First lookup nested classes in our
21664         class and our parents before we go looking outside our class.
21665
21666         * expression.cs (ConstantFold): Extract/debox the values at the
21667         beginnning. 
21668
21669         * rootcontext.cs (EmitCode): Resolve the constants first before we
21670         resolve the types.  This is not really needed, but it helps debugging.
21671
21672         * statement.cs: report location.
21673
21674         * cs-parser.jay: pass location to throw statement.
21675
21676         * driver.cs: Small bug fix.
21677
21678         * report.cs: Updated format to be 4-zero filled digits.
21679
21680 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21681
21682         * expression.cs (CheckIndices): Fix minor bug where the wrong
21683         variable was being referred to ;-)
21684
21685         (DoEmit): Do not call EmitStaticInitializers when the 
21686         underlying type is System.Object.
21687
21688 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21689
21690         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21691         and do the usual workaround for SRE.
21692
21693         * class.cs (MyEventBuilder.EventType): New member to get at the type
21694         of the event, quickly.
21695
21696         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21697
21698         * assign.cs (Assign.DoResolve): Handle the case when the target
21699         is an EventExpr and perform the necessary checks.
21700
21701         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21702         interface.
21703
21704         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21705
21706         (EventExpr): Set the type in the constructor itself since we 
21707         are meant to be born fully resolved.
21708
21709         (EventExpr.Define): Revert code I wrote earlier.
21710                 
21711         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21712         instance expression is null. The instance expression is a This in that case
21713         or a null, depending on whether it is a static method or not.
21714
21715         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21716         refers to more than one method.
21717
21718         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21719         and accordingly flag errors.
21720
21721 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21722
21723         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21724
21725 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21726
21727         * location.cs (ToString): Provide useful rutine.
21728
21729 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21730
21731         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21732         objects, return the actual integral boxed.
21733
21734         * statement.cs (SwitchLabel): define an ILLabel for each
21735         SwitchLabel. 
21736
21737         (Switch.CheckSwitch): If the value is a Literal, extract
21738         the underlying literal.
21739
21740         Also in the unused hashtable we had, add the SwitchLabel so we can
21741         quickly look this value up.
21742
21743         * constant.cs: Implement a bunch of new constants.  Rewrite
21744         Literal based on this.  Made changes everywhere to adapt to this.
21745
21746         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21747         dereferencing array only once, and also copes with enumrations.
21748
21749         bytes are two bytes wide, not one.
21750
21751         (Cast): Perform constant conversions.
21752
21753         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21754         wrappers to the literals here.
21755
21756         * expression.cs (DoNumericPromotions): long literals can converted
21757         to ulong implicity (this is taken care of elsewhere, but I was
21758         missing this spot).
21759
21760         * ecore.cs (Expression.Literalize): Make the return type Literal,
21761         to improve type checking.
21762
21763         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21764
21765 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21766
21767         * literal.cs: Revert code from ravi that checked the bounds.  The
21768         bounds are sane by the definition of the type itself. 
21769
21770         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21771         need to actually look up in our parent hierarchy for interfaces
21772         implemented. 
21773
21774         * const.cs: Use the underlying type for enumerations
21775
21776         * delegate.cs: Compute the basename for the delegate creation,
21777         that should fix the delegate test case, and restore the correct
21778         Type Lookup semantics in rootcontext
21779
21780         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21781         referencing a nested type with the Reflection API is using the "+"
21782         sign. 
21783
21784         * cs-parser.jay: Do not require EOF token at the end.
21785
21786 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21787
21788         * rootcontext.cs (LookupType): Concatenate type names with
21789         a '.' instead of a '+' The test suite passes again.
21790
21791         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21792         field of the enumeration.
21793
21794         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21795         the case when the member is an EventExpr.
21796
21797         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21798         static has an associated instance expression.
21799
21800         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21801
21802         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21803
21804         * class.cs (Event.Define): Register event and perform appropriate checks
21805         for error #111.
21806
21807         We define the Add and Remove methods even if the use provides none because
21808         in that case, we provide default implementations ourselves.
21809
21810         Define a private field of the type of the event. This is done by the CSC compiler
21811         and we should be doing it too ;-)
21812
21813         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21814         More methods we use in code we generate.
21815
21816         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21817         is important.
21818
21819         (InitCoreTypes): Update accordingly for the above.
21820
21821         * class.cs (Event.Emit): Generate code for default accessors that we provide
21822
21823         (EmitDefaultMethod): Do the job in the above.
21824
21825         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21826         appropriate place.
21827
21828 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21829
21830         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21831         builders even if we were missing one.
21832
21833         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21834         pass the Basename as our class name instead of the Name.  The
21835         basename will be correctly composed for us.
21836
21837         * parameter.cs (Paramters): Now takes a Location argument.
21838
21839         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21840         make all the code call directly LookupType in RootContext and take
21841         this chance to pass the Location information everywhere.
21842
21843         * Everywhere: pass Location information.
21844
21845 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21846
21847         * class.cs (Constructor.Define): Updated way of detecting the
21848         length of the parameters.
21849
21850         (TypeContainer.DefineType): Use basename as the type name for
21851         nested types.
21852
21853         (TypeContainer.Define): Do not recursively define types here, as
21854         definition is taken care in order by the RootContext.
21855
21856         * tree.cs: Keep track of namespaces in a per-file basis.
21857
21858         * parameter.cs (Parameter.ComputeSignature): Update to use
21859         DeclSpace. 
21860
21861         (Parameters.GetSignature): ditto.
21862
21863         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21864         instead of a TypeContainer.
21865
21866         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21867         resolve names.  Because we need to be resolve in our context, not
21868         our parents.
21869
21870         * driver.cs: Implement response files.
21871
21872         * class.cs (TypeContainer.DefineType): If we are defined, do not
21873         redefine ourselves.
21874
21875         (Event.Emit): Emit the code for add/remove handlers.
21876         (Event.Define): Save the MethodBuilders for add/remove.
21877
21878         * typemanager.cs: Use pair here too.
21879
21880         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21881         DictionaryEntry requires the first argument to be non-null.  
21882
21883         (enum_declaration): Compute full name for registering the
21884         enumeration.
21885
21886         (delegate_declaration): Instead of using
21887         formal_parameter_list, use opt_formal_parameter_list as the list
21888         can be empty.
21889
21890         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21891         (EventParsing): New property that controls whether `add' and
21892         `remove' are returned as tokens or identifiers (for events);
21893
21894 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21895
21896         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21897         use MyEventBuilder only and let it wrap the real builder for us.
21898
21899         (MyEventBuilder): Revamp constructor etc.
21900
21901         Implement all operations that we perform on EventBuilder in precisely the same
21902         way here too.
21903
21904         (FindMembers): Update to use the EventBuilder member.
21905
21906         (Event.Emit): Update accordingly.
21907
21908 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21909
21910         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21911         by calling the appropriate methods.
21912
21913         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21914         useful.
21915
21916         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21917
21918 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21919
21920         * delegate.cs (Delegate.Populate): Check that the return type
21921         and various parameters types are indeed accessible.
21922
21923         * class.cs (Constructor.Define): Same here.
21924
21925         (Field.Define): Ditto.
21926
21927         (Event.Define): Ditto.
21928
21929         (Operator.Define): Check that the underlying Method defined itself
21930         correctly - so it's MethodBuilder should not be null.
21931
21932         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21933         expression happens to be null.
21934
21935         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21936         members but as of now we don't seem to be able to do anything really useful with it.
21937
21938         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21939         not the EventBuilder.
21940
21941 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21942
21943         * cs-tokenizer.cs: Add support for defines.
21944         Add support for #if, #elif, #else, #endif
21945
21946         (eval_var): evaluates a variable.
21947         (eval): stubbed for evaluating functions.
21948
21949         * cs-parser.jay: Pass the defines information
21950
21951         * driver.cs: Add --define command line option.
21952
21953         * decl.cs: Move MemberCore here.
21954
21955         Make it the base class for DeclSpace.  This allows us to catch and
21956         report 108 and 109 for everything now.
21957
21958         * class.cs (TypeContainer.Define): Extract all the members
21959         before populating and emit the warning 108 (new keyword required
21960         to override) instead of having each member implement this.
21961
21962         (MemberCore.Define): New abstract method, we will be using this in
21963         the warning reporting engine in Populate.
21964
21965         (Operator.Define): Adjust to new MemberCore protocol. 
21966
21967         * const.cs (Const): This does not derive from Expression, it is a
21968         temporary object we use to create fields, it is a MemberCore. 
21969
21970         * class.cs (Method.Define): Allow the entry point to be in a
21971         specific class.
21972
21973         * driver.cs: Rewrite the argument handler to clean it up a bit.
21974
21975         * rootcontext.cs: Made it just an auxiliary namespace feature by
21976         making everything static.
21977
21978         * driver.cs: Adapt code to use RootContext type name instead of
21979         instance variable.
21980
21981         * delegate.cs: Remove RootContext argument.
21982
21983         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21984         argument. 
21985
21986         * class.cs (Event.Define): The lookup can fail.
21987
21988         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21989
21990         * expression.cs: Resolve the this instance before invoking the code.
21991
21992 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21993
21994         * cs-parser.jay: Add a production in element_access that allows
21995         the thing to become a "type" reference.  This way we can parse
21996         things like "(string [])" as a type.
21997
21998         Note that this still does not handle the more complex rules of
21999         casts. 
22000
22001
22002         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22003
22004         * ecore.cs: (CopyNewMethods): new utility function used to
22005         assemble the list of methods from running FindMembers.
22006
22007         (MemberLookup): Rework FindMembers so that 
22008
22009 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22010
22011         * class.cs (TypeContainer): Remove Delegates who fail to be
22012         defined.
22013
22014         * delegate.cs (Populate): Verify that we dont get null return
22015         values.   TODO: Check for AsAccessible.
22016
22017         * cs-parser.jay: Use basename to emit error 574 (destructor should
22018         have the same name as container class), not the full name.
22019
22020         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22021         possible representation.  
22022
22023         Also implements integer type suffixes U and L.
22024
22025 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22026
22027         * expression.cs (ArrayCreation.DoResolve): We need to do the
22028         argument resolution *always*.
22029
22030         * decl.cs: Make this hold the namespace.  Hold the root context as
22031         well.
22032         (LookupType): Move here.
22033
22034         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22035
22036         * location.cs (Row, Name): Fixed the code, it was always returning
22037         references to the first file.
22038
22039         * interface.cs: Register properties defined through interfaces.
22040
22041         * driver.cs: Add support for globbing on the command line
22042
22043         * class.cs (Field): Make it derive from MemberCore as well.
22044         (Event): ditto.
22045
22046 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22047
22048         * class.cs (Event::Define): Check that the type of the event is a delegate
22049         type else flag error #66.
22050
22051         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22052         same.
22053
22054         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22055         values of EntryPoint, CharSet etc etc.
22056
22057         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22058
22059         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22060         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22061         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22062         which needs this to do its work.
22063
22064         * ../errors/cs0066.cs : Add.
22065
22066 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22067
22068         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22069         helper functions.
22070
22071         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22072         clears out the parameters field.
22073         (MemberSignatureCompare): Cleanup
22074
22075         (MemberCore): New base class used to share code between MethodCore
22076         and Property.
22077
22078         (RegisterRequiredImplementations) BindingFlags.Public requires
22079         either BindingFlags.Instace or Static.  Use instance here.
22080
22081         (Property): Refactored code to cope better with the full spec.
22082
22083         * parameter.cs (GetParameterInfo): Return an empty array instead
22084         of null on error.
22085
22086         * class.cs (Property): Abstract or extern properties have no bodies.
22087
22088         * parameter.cs (GetParameterInfo): return a zero-sized array.
22089
22090         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22091         method modifier validation to the typecontainer so we can reuse
22092         this on properties.
22093
22094         (MethodCore.ParameterTypes): return an empty sized array of types.
22095
22096         (Property.Define): Test property modifier validity.
22097
22098         Add tests for sealed/override too.
22099
22100         (Method.Emit): abstract or extern methods have no bodies.
22101
22102 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22103
22104         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22105         thing.
22106
22107         (Method::Define, ::Emit): Modify accordingly.
22108
22109         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22110
22111         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22112
22113         * makefile: Pass in /unsafe.
22114
22115 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22116
22117         * class.cs (MakeKey): Kill routine.
22118
22119         * class.cs (TypeContainer.Define): Correctly define explicit
22120         method implementations (they require the full interface name plus
22121         the method name).
22122
22123         * typemanager.cs: Deply the PtrHashtable here and stop using the
22124         lame keys.  Things work so much better.
22125
22126         This of course broke everyone who depended on `RegisterMethod' to
22127         do the `test for existance' test.  This has to be done elsewhere.
22128
22129         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22130         the object stupid Equals method (because, that like fails all over
22131         the place).  We still do not use it.
22132
22133         * class.cs (TypeContainer.SetRequiredInterface,
22134         TypeContainer.RequireMethods): Killed these two routines and moved
22135         all the functionality to RegisterRequiredImplementations.
22136
22137         (TypeContainer.RegisterRequiredImplementations): This routine now
22138         registers all the implementations required in an array for the
22139         interfaces and abstract methods.  We use an array of structures
22140         which can be computed ahead of time to reduce memory usage and we
22141         also assume that lookups are cheap as most classes will not
22142         implement too many interfaces.
22143
22144         We also avoid creating too many MethodSignatures.
22145
22146         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22147         clear the "pending" bit if we find that there are problems with
22148         the declaration.
22149
22150         (TypeContainer.VerifyPendingMethods): Update to report errors of
22151         methods that look like implementations but are not.
22152
22153         (TypeContainer.Define): Add support for explicit interface method
22154         implementation. 
22155
22156 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22157
22158         * typemanager.cs: Keep track of the parameters here instead of
22159         being a feature of the TypeContainer.
22160
22161         * class.cs: Drop the registration of parameters here, as
22162         InterfaceMethods are also interface declarations.
22163
22164         * delegate.cs: Register methods with the TypeManager not only with
22165         the TypeContainer.  This code was buggy.
22166
22167         * interface.cs: Full registation here.
22168
22169 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22170
22171         * expression.cs: Remove reducer for binary expressions, it can not
22172         be done this way.
22173
22174         * const.cs: Put here the code that used to go into constant.cs
22175
22176         * constant.cs: Put here the code for constants, this is a new base
22177         class for Literals.
22178
22179         * literal.cs: Make Literal derive from Constant.
22180
22181 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22182
22183         * statement.cs (Return.Emit): Report error 157 if the user
22184         attempts to return from a finally block.
22185
22186         (Return.Emit): Instead of emitting a return, jump to the end of
22187         the function.
22188
22189         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22190         LocalBuilder to store the result of the function.  ReturnLabel is
22191         the target where we jump.
22192
22193
22194 2001-12-09  Radek Doulik  <rodo@ximian.com>
22195
22196         * cs-parser.jay: remember alias in current namespace
22197
22198         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22199         namespaces
22200
22201         * class.cs (LookupAlias): lookup alias in my_namespace
22202
22203         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22204         aliases hashtable
22205         (LookupAlias): lookup alias in this and if needed in parent
22206         namespaces
22207
22208 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22209
22210         * support.cs: 
22211
22212         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22213         making things static.  I need this to avoid passing the
22214         TypeContainer when calling ParameterType.
22215
22216         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22217         that did string manipulation to compute the type and then call
22218         GetType.  Use Parameter.ParameterType instead.
22219
22220         * cs-tokenizer.cs: Consume the suffix for floating values.
22221
22222         * expression.cs (ParameterReference): figure out whether this is a
22223         reference parameter or not.  Kill an extra variable by computing
22224         the arg_idx during emission.
22225
22226         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22227         function that returns whether a parameter is an out/ref value or not.
22228
22229         (Parameter.ParameterType): The type of the parameter (base,
22230         without ref/out applied).
22231
22232         (Parameter.Resolve): Perform resolution here.
22233         (Parameter.ExternalType): The full type (with ref/out applied).
22234
22235         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22236         support for expressions on the using statement.
22237
22238 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22239
22240         * statement.cs (Using.EmitLocalVariableDecls): Split the
22241         localvariable handling of the using statement.
22242
22243         (Block.EmitMeta): Keep track of variable count across blocks.  We
22244         were reusing slots on separate branches of blocks.
22245
22246         (Try.Emit): Emit the general code block, we were not emitting it. 
22247
22248         Check the type of the declaration to be an IDisposable or
22249         something that can be implicity converted to it. 
22250
22251         Emit conversions if required.
22252
22253         * ecore.cs (EmptyExpression): New utility class.
22254         (Expression.ImplicitConversionExists): New utility function.
22255
22256 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22257
22258         * statement.cs (Using): Implement.
22259
22260         * expression.cs (LocalVariableReference): Support read only variables.
22261
22262         * statement.cs: Remove the explicit emit for the Leave opcode.
22263         (VariableInfo): Add a readonly field.
22264
22265 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22266
22267         * ecore.cs (ConvCast): new class used to encapsulate the various
22268         explicit integer conversions that works in both checked and
22269         unchecked contexts.
22270
22271         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22272         properly generate the overflow opcodes.
22273
22274 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22275
22276         * statement.cs: The correct type for the EmptyExpression is the
22277         element_type, not the variable type.  Ravi pointed this out.
22278
22279 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22280
22281         * class.cs (Method::Define): Handle PInvoke methods specially
22282         by using DefinePInvokeMethod instead of the usual one.
22283
22284         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22285         above to do the task of extracting information and defining the method.
22286
22287 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22288
22289         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22290         of the condition for string type.
22291
22292         (Emit): Move that here. 
22293
22294         (ArrayCreation::CheckIndices): Keep string literals in their expression
22295         form.
22296
22297         (EmitDynamicInitializers): Handle strings appropriately.
22298
22299 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22300
22301         * codegen.cs (EmitContext): Replace multiple variables with a
22302         single pointer to the current Switch statement.
22303
22304         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22305         EmitContext.
22306
22307 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22308
22309         * statement.cs 
22310
22311         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22312         default'.
22313
22314         (Foreach.Emit): Foreach on arrays was not setting
22315         up the loop variables (for break/continue).
22316
22317         (GotoCase): Semi-implented.
22318
22319 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22320
22321         * attribute.cs (CheckAttribute): Handle system attributes by using
22322         Attribute.GetAttributes to examine information we need.
22323
22324         (GetValidPlaces): Same here.
22325
22326         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22327
22328         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22329
22330         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22331
22332         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22333
22334         (Method::Emit): Handle the case when we are a PInvoke method.
22335
22336 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22337
22338         * expression.cs: Use ResolveWithSimpleName on compound names.
22339
22340 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22341
22342         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22343         before trying to reduce it.
22344
22345         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22346
22347         * constant.cs (LookupConstantValue): Implement.
22348
22349         (EmitConstant): Use the above in emitting the constant.
22350
22351         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22352         that are user-defined by doing a LookupConstantValue on them.
22353
22354         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22355         too, like above.
22356
22357 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22358
22359         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22360
22361         (BaseAccess.DoResolve): Implement.
22362
22363         (MemberAccess.DoResolve): Split this routine into a
22364         ResolveMemberAccess routine that can be used independently
22365
22366 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22367
22368         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22369         As that share bits of the implementation.  Is returns a boolean,
22370         while As returns the Type that is being probed.
22371
22372 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22373
22374         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22375         instead of a Literal - much easier.
22376
22377         (EnumInTransit): Remove - utterly useless :-)
22378
22379         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22380
22381         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22382
22383         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22384         chain when we have no associated expression.
22385
22386 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22387
22388         * constant.cs (Define): Use Location while reporting the errror.
22389
22390         Also emit a warning when 'new' is used and there is no inherited
22391         member to hide.
22392
22393         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22394         populated.
22395
22396         (LookupEnumValue): Implement to lookup an enum member's value and define it
22397         if necessary.
22398
22399         (Populate): Re-write accordingly to use the above routine.
22400
22401 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22402
22403         * expression.cs (This): Fix prototype for DoResolveLValue to
22404         override the base class DoResolveLValue.
22405
22406         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22407         declarations) 
22408
22409         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22410         (we need to load the address of the field here).  This fixes
22411         test-22. 
22412
22413         (FieldExpr.DoResolveLValue): Call the DoResolve
22414         function to initialize the Instance expression.
22415
22416         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22417         correctly the GetEnumerator operation on a value type.
22418
22419         * cs-parser.jay: Add more simple parsing error catches.
22420
22421         * statement.cs (Switch): Add support for string switches.
22422         Handle null specially.
22423
22424         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22425
22426 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22427
22428         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22429
22430         (declare_local_constant): New helper function.
22431
22432         * statement.cs (AddConstant): Keep a separate record of constants
22433
22434         (IsConstant): Implement to determine if a variable is a constant.
22435
22436         (GetConstantExpression): Implement.
22437
22438         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22439
22440         * statement.cs (IsVariableDefined): Re-write.
22441
22442 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22443
22444         * class.cs (TypeContainer::FindMembers): Look for constants
22445         in the case when we are looking for MemberTypes.Field
22446
22447         * expression.cs (MemberAccess::DoResolve): Check that in the
22448         case we are a FieldExpr and a Literal, we are not being accessed
22449         by an instance reference.
22450
22451         * cs-parser.jay (local_constant_declaration): Implement.
22452
22453         (declaration_statement): Implement for constant declarations.
22454
22455 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22456
22457         * statement.cs (Switch): Catch double defaults.
22458
22459         (Switch): More work on the switch() statement
22460         implementation.  It works for integral values now, need to finish
22461         string support.
22462
22463
22464 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22465
22466         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22467         integer literals into other integer literals.  To be used by
22468         switch. 
22469
22470 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22471
22472         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22473         some memory.
22474
22475         (EmitDynamicInitializers): Cope with the above since we extract data
22476         directly from ArrayData now.
22477
22478         (ExpectInitializers): Keep track of whether initializers are mandatory
22479         or not.
22480
22481         (Bounds): Make it a hashtable to prevent the same dimension being 
22482         recorded for every element in that dimension.
22483
22484         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22485         from being found.
22486
22487         Also fix bug which was causing the indices to be emitted in the reverse
22488         order.
22489
22490 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22491
22492         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22493         unfinished.  They do not work, because the underlying code is
22494         sloppy.
22495
22496 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22497
22498         * cs-parser.jay: Remove bogus fixme.
22499
22500         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22501         on Switch statement.
22502
22503 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22504
22505         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22506         the same. 
22507
22508         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22509         parameter. Apparently, any expression is allowed. 
22510
22511         (ValidateInitializers): Update accordingly.
22512
22513         (CheckIndices): Fix some tricky bugs thanks to recursion.
22514
22515         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22516         I was being completely brain-dead.
22517
22518         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22519         and re-write acordingly.
22520
22521         (DelegateInvocation): Re-write accordingly.
22522
22523         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22524
22525         (MakeByteBlob): Handle types more correctly.
22526
22527         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22528         initialization from expressions but it is incomplete because I am a complete
22529         Dodo :-|
22530
22531 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22532
22533         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22534         on If.  Basically, we have to return `true' (ie, we do return to
22535         our caller) only if both branches of the if return.
22536
22537         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22538         short-circuit operators, handle them as short circuit operators. 
22539
22540         (Cast.DoResolve): Resolve type.
22541         (Cast.Cast): Take an expression as the target type.
22542
22543         * cs-parser.jay (cast_expression): Remove old hack that only
22544         allowed a limited set of types to be handled.  Now we take a
22545         unary_expression and we resolve to a type during semantic
22546         analysis.
22547
22548         Use the grammar productions from Rhys to handle casts (this is
22549         not complete like Rhys syntax yet, we fail to handle that corner
22550         case that C# has regarding (-x), but we will get there.
22551
22552 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22553
22554         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22555         field which is an array type.
22556
22557         * cs-parser.jay (declare_local_variables): Support array initialization too.
22558
22559         * typemanager.cs (MakeKey): Implement.
22560
22561         (everywhere): Use the above appropriately.
22562
22563         * cs-parser.jay (for_statement): Update for array initialization while
22564         declaring variables.
22565
22566         * ecore.cs : The error message was correct, it's the variable's names that
22567         were misleading ;-) Make the code more readable.
22568
22569         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22570         the correct type etc.
22571
22572         (ConvertExplicit): Handle Enum types by examining the underlying type.
22573
22574 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22575
22576         * parameter.cs (GetCallingConvention): Always return
22577         CallingConventions.Standard for now.
22578
22579 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22580
22581         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22582         and `r' after calling DoNumericPromotions.
22583
22584         * ecore.cs: Fix error message (the types were in the wrong order).
22585
22586         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22587         BindingFlags.Instance as well 
22588
22589         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22590         implicit int literal conversion in an empty cast so that we
22591         propagate the right type upstream.
22592
22593         (UnboxCast): new class used to unbox value types.
22594         (Expression.ConvertExplicit): Add explicit type conversions done
22595         by unboxing.
22596
22597         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22598         the target type before applying the implicit LongLiterals to ULong
22599         literal cast.
22600
22601 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22602
22603         * cs-parser.jay (for_statement): Reworked the way For works: now
22604         we declare manually any variables that are introduced in
22605         for_initializer to solve the problem of having out-of-band code
22606         emition (that is what got for broken).
22607
22608         (declaration_statement): Perform the actual variable declaration
22609         that used to be done in local_variable_declaration here.
22610
22611         (local_variable_declaration): Do not declare anything, just pass
22612         the information on a DictionaryEntry
22613
22614 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22615
22616         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22617         re-write of the logic to now make it recursive.
22618
22619         (UpdateIndices): Re-write accordingly.
22620
22621         Store element data in a separate ArrayData list in the above methods.
22622
22623         (MakeByteBlob): Implement to dump the array data into a byte array.
22624
22625 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22626
22627         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22628         into CheckIndices.
22629
22630         * constant.cs (Define): Implement.
22631
22632         (EmitConstant): Re-write fully.
22633
22634         Pass in location info.
22635
22636         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22637         respectively.
22638
22639         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22640         DictionaryEntry since we need location info too.
22641
22642         (constant_declaration): Update accordingly.
22643
22644         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22645         code into another method : UpdateIndices.
22646
22647 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22648
22649         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22650         some type checking etc.
22651
22652 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22653
22654         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22655         bits to provide dimension info if the user skips doing that.
22656
22657         Update second constructor to store the rank correctly.
22658
22659 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22660
22661         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22662         and try to implement.
22663
22664         * ../errors/cs0150.cs : Add.
22665
22666         * ../errors/cs0178.cs : Add.
22667
22668 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22669
22670         * statement.cs: Implement foreach on multi-dimensional arrays. 
22671
22672         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22673         name of the params argument.
22674
22675         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22676         initializing the array.
22677
22678         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22679         we can use this elsewhere.
22680
22681         * statement.cs: Finish implementation of foreach for single
22682         dimension arrays.
22683
22684         * cs-parser.jay: Use an out-of-band stack to pass information
22685         around, I wonder why I need this.
22686
22687         foreach_block: Make the new foreach_block the current_block.
22688
22689         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22690         function used to return a static Parameters structure.  Used for
22691         empty parameters, as those are created very frequently.
22692
22693         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22694
22695 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22696
22697         * interface.cs : Default modifier is private, not public. The
22698         make verify test passes again.
22699
22700 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22701
22702         * support.cs (ReflectionParameters): Fix logic to determine
22703         whether the last parameter is a params one. Test 9 passes again.
22704
22705         * delegate.cs (Populate): Register the builders we define with
22706         RegisterParameterForBuilder. Test 19 passes again.
22707
22708         * cs-parser.jay (property_declaration): Reference $6 instead
22709         of $$ to get at the location.
22710
22711         (indexer_declaration): Similar stuff.
22712
22713         (attribute): Ditto.
22714
22715         * class.cs (Property): Register parameters for the Get and Set methods
22716         if they exist. Test 23 passes again.
22717
22718         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22719         call to EmitArguments as we are sure there aren't any params arguments. 
22720         Test 32 passes again.
22721
22722         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22723         IndexOutOfRangeException. 
22724
22725         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22726         Test 33 now passes again.
22727
22728 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22729
22730         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22731         broke a bunch of things.  Will have to come up with a better way
22732         of tracking locations.
22733
22734         * statement.cs: Implemented foreach for single dimension arrays.
22735
22736 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22737
22738         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22739         an error.  This removes the lookup from the critical path.
22740
22741         * cs-parser.jay: Removed use of temporary_loc, which is completely
22742         broken. 
22743
22744 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22745
22746         * support.cs (ReflectionParameters.ParameterModifier): Report
22747         whether the argument is a PARAMS argument or not.
22748
22749         * class.cs: Set the attribute `ParamArrayAttribute' on the
22750         parameter argument.
22751
22752         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22753         and cons_param_array_attribute (ConstructorInfo for
22754         ParamArrayAttribute)., 
22755
22756         * codegen.cs: Emit the return using the `Return' statement, that
22757         way we can report the error correctly for missing return values. 
22758
22759         * class.cs (Method.Emit): Clean up.
22760
22761         * expression.cs (Argument.Resolve): Take another argument: the
22762         location where this argument is used.  Notice that this is not
22763         part of the "Argument" class as to reduce the size of the
22764         structure (we know the approximate location anyways).
22765
22766         Test if the argument is a variable-reference, if not, then
22767         complain with a 206.
22768
22769         (Argument.Emit): Emit addresses of variables.
22770
22771         (Argument.FullDesc): Simplify.
22772
22773         (Invocation.DoResolve): Update for Argument.Resolve.
22774
22775         (ElementAccess.DoResolve): ditto.
22776
22777         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22778         method should be virtual, as this method is always virtual.
22779
22780         (NewDelegate.DoResolve): Update for Argument.Resolve.
22781
22782         * class.cs (ConstructorInitializer.DoResolve): ditto.
22783
22784         * attribute.cs (Attribute.Resolve): ditto.
22785
22786 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22787
22788         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22789
22790         * expression.cs (ParameterReference): Drop IStackStorage and implement
22791         IAssignMethod instead. 
22792
22793         (LocalVariableReference): ditto.
22794
22795         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22796         IAssignMethod instead. 
22797
22798 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22799
22800         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22801         enumerations that are used in heavily used structures derive from
22802         byte in a laughable and pathetic attempt to reduce memory usage.
22803         This is the kind of pre-optimzations that you should not do at
22804         home without adult supervision.
22805
22806         * expression.cs (UnaryMutator): New class, used to handle ++ and
22807         -- separatedly from the other unary operators.  Cleans up the
22808         code, and kills the ExpressionStatement dependency in Unary.
22809
22810         (Unary): Removed `method' and `Arguments' from this class, making
22811         it smaller, and moving it all to SimpleCall, so I can reuse this
22812         code in other locations and avoid creating a lot of transient data
22813         strucutres when not required.
22814
22815         * cs-parser.jay: Adjust for new changes.
22816
22817 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22818
22819         * enum.cs (Enum.Populate): If there is a failure during
22820         definition, return
22821
22822         * cs-parser.jay (opt_enum_base): we used to catch type errors
22823         here, but this is really incorrect.  The type error should be
22824         catched during semantic analysis.
22825
22826 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22827
22828         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22829         current_local_parameters as expected since I, in my stupidity, had forgotten
22830         to do this :-)
22831
22832         * attribute.cs (GetValidPlaces): Fix stupid bug.
22833
22834         * class.cs (Method::Emit): Perform check on applicability of attributes.
22835
22836         (Constructor::Emit): Ditto.
22837
22838         (Field::Emit): Ditto.
22839
22840         (Field.Location): Store location information.
22841
22842         (Property, Event, Indexer, Operator): Ditto.
22843
22844         * cs-parser.jay (field_declaration): Pass in location for each field.
22845
22846         * ../errors/cs0592.cs : Add.
22847
22848 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22849
22850         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22851
22852         (InitCoreTypes): Update accordingly.
22853
22854         (RegisterAttrType, LookupAttr): Implement.
22855
22856         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22857         info about the same.
22858
22859         (Resolve): Update to populate the above as necessary.
22860
22861         (Error592): Helper.
22862
22863         (GetValidPlaces): Helper to the above.
22864
22865         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22866
22867         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22868
22869 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22870
22871         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22872
22873         * ../errors/cs0617.cs : Add.
22874
22875 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22876
22877         * enum.cs (Emit): Rename to Populate to be more consistent with what
22878         we expect it to do and when exactly it is called.
22879
22880         * class.cs, rootcontext.cs : Update accordingly.
22881
22882         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22883         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22884
22885         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22886
22887         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22888         of a fieldinfo using the above, when dealing with a FieldBuilder.
22889
22890 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22891
22892         * ../errors/cs0031.cs : Add.
22893
22894         * ../errors/cs1008.cs : Add.
22895
22896         * ../errrors/cs0543.cs : Add.
22897
22898         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22899         enum type.
22900
22901         (FindMembers): Implement.
22902
22903         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22904         enums and delegates too.
22905
22906         (enum_types): Rename to builder_to_enum.
22907
22908         (delegate_types): Rename to builder_to_delegate.
22909
22910         * delegate.cs (FindMembers): Implement.
22911
22912 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22913
22914         * typemanager.cs (IsEnumType): Implement.
22915
22916         * enum.cs (Emit): Re-write parts to account for the underlying type
22917         better and perform checking etc.
22918
22919         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22920         of the underlying type.
22921
22922         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22923         value
22924
22925         * enum.cs (error31): Helper to report error #31.
22926
22927         * cs-parser.jay (enum_declaration): Store location of each member too.
22928
22929         * enum.cs (member_to_location): New hashtable. 
22930
22931         (AddEnumMember): Update location hashtable.
22932
22933         (Emit): Use the location of each member while reporting errors.
22934
22935 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22936
22937         * cs-parser.jay: A for_initializer if is a
22938         local_variable_declaration really ammount to have an implicit
22939         block with the variable declaration and no initializer for for.
22940
22941         * statement.cs (For.Emit): Cope with null initializers.
22942
22943         This fixes the infinite loop on for initializers.
22944
22945 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22946
22947         * enum.cs: More cleanup.
22948
22949         * ecore.cs: Remove dead code.
22950
22951         * class.cs (Property.Emit): More simplification.
22952         (Event.Emit): ditto.
22953
22954         Reworked to have less levels of indentation.
22955
22956 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22957
22958         * class.cs (Property): Emit attributes.
22959
22960         (Field): Ditto.
22961
22962         (Event): Ditto.
22963
22964         (Indexer): Ditto.
22965
22966         (Operator): Ditto.
22967
22968         * enum.cs (Emit): Ditto.
22969
22970         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22971         Enums too.
22972
22973         * class.cs (Field, Event, etc.): Move attribute generation into the
22974         Emit method everywhere.
22975
22976         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22977         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22978         as we had no way of defining nested enums !
22979
22980         * rootcontext.cs : Adjust code accordingly.
22981
22982         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22983
22984 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22985
22986         * expression.cs (EvalConstantExpression): Move into ecore.cs
22987
22988         * enum.cs (Enum): Rename some members and make them public and readonly
22989         according to our convention.
22990
22991         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22992         nothing else.
22993
22994         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22995
22996         (Enum::Emit): Write a simple version for now which doesn't try to compute
22997         expressions. I shall modify this to be more robust in just a while.
22998
22999         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23000
23001         (TypeContainer::CloseType): Create the Enum types too.
23002
23003         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23004
23005         * expression.cs (EvalConstantExpression): Get rid of completely.
23006
23007         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23008         user-defined values and other cases.
23009
23010         (IsValidEnumLiteral): Helper function.
23011
23012         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23013         out there in the case we had a literal FieldExpr.
23014
23015         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23016
23017         (Literalize): Revamp a bit to take two arguments.
23018
23019         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23020
23021 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23022
23023         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23024
23025         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23026
23027         (Resolve): Use the above to ensure we have proper initializers.
23028
23029 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23030
23031         * expression.cs (Expression::EvalConstantExpression): New method to 
23032         evaluate constant expressions.
23033
23034         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23035
23036 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23037
23038         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23039         in an array.
23040
23041         (Binary.ResolveOperator): Handle operator != (object a, object b)
23042         and operator == (object a, object b);
23043
23044         (Binary.DoNumericPromotions): Indicate whether the numeric
23045         promotion was possible.
23046
23047         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23048         Implement.  
23049
23050         Made the ArrayAccess implement interface IAssignMethod instead of
23051         IStackStore as the order in which arguments are passed reflects
23052         this.
23053
23054         * assign.cs: Instead of using expr.ExprClass to select the way of
23055         assinging, probe for the IStackStore/IAssignMethod interfaces.
23056
23057         * typemanager.cs: Load InitializeArray definition.
23058
23059         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23060         static data that can be used to initialize arrays. 
23061
23062 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23063
23064         * expression.cs: Handle operator== and operator!= for booleans.
23065
23066         (Conditioal.Reduce): Implement reducer for the ?: operator.
23067
23068         (Conditional.Resolve): Implement dead code elimination.
23069
23070         (Binary.Resolve): Catch string literals and return a new
23071         concatenated string.
23072
23073         (Unary.Reduce): Implement reduction of unary expressions.
23074
23075         * ecore.cs: Split out the expression core handling here.
23076
23077         (Expression.Reduce): New method used to perform constant folding
23078         and CSE.  This is needed to support constant-expressions. 
23079
23080         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23081         targets, and optimize for !x.
23082
23083 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23084
23085         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23086         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23087         set custom atttributes.
23088
23089         * literal.cs (Literal::GetValue): New abstract method to return the actual
23090         value of the literal, cast as an object.
23091
23092         (*Literal): Implement GetValue method.
23093
23094         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23095         expressions to the arraylist but objects of type Argument.
23096
23097         * class.cs (TypeContainer::Emit): Emit our attributes too.
23098
23099         (Method::Emit, Constructor::Emit): Ditto.
23100
23101         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23102         to be ignoring earlier.
23103
23104 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23105
23106         * attribute.cs (AttributeSection::Define): Implement to do the business
23107         of constructing a CustomAttributeBuilder.
23108
23109         (Attribute): New trivial class. Increases readability of code.  
23110
23111         * cs-parser.jay : Update accordingly.
23112
23113         (positional_argument_list, named_argument_list, named_argument): New rules
23114
23115         (attribute_arguments): Use the above so that we are more correct.
23116
23117 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23118
23119         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23120         to perform all checks for a method with a params parameter.
23121
23122         (Invocation::OverloadResolve): Update to use the above method and therefore
23123         cope correctly with params method invocations.
23124
23125         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23126         params too.
23127
23128         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23129         constructors in our parent too because we can't afford to miss out on 
23130         protected ones ;-)
23131
23132         * attribute.cs (AttributeSection): New name for the class Attribute
23133
23134         Other trivial changes to improve readability.
23135
23136         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23137         use the new class names.
23138
23139 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23140
23141         * class.cs (Method::Define): Complete definition for params types too
23142
23143         (Indexer::Define): Ditto.
23144
23145         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23146         Cope everywhere with a request for info about the array parameter.
23147
23148 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23149
23150         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23151
23152         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23153         local_variable_type to extract the string corresponding to the type.
23154
23155         (local_variable_type): Fixup the action to use the new helper method.
23156
23157         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23158         go.
23159
23160         * expression.cs : Clean out code which uses the above.
23161
23162 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23163
23164         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23165         and bale out if necessary by returning a false.
23166
23167         (RegisterProperty): Ditto.
23168
23169         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23170         and print out appropriate error messages.
23171
23172         * interface.cs (everywhere): Ditto.
23173
23174         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23175         location to constructor.
23176
23177         * class.cs (Property, Event, Indexer): Update accordingly.
23178
23179         * ../errors/cs111.cs : Added.
23180
23181         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23182         of a method, as laid down by the spec.
23183
23184         (Invocation::OverloadResolve): Use the above method.
23185
23186 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23187
23188         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23189         now take a TypeContainer and a Parameters object.
23190
23191         (ParameterData): Modify return type of ParameterModifier method to be 
23192         Parameter.Modifier and not a string.
23193
23194         (ReflectionParameters, InternalParameters): Update accordingly.
23195
23196         * expression.cs (Argument::GetParameterModifier): Same here.
23197
23198         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23199         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23200         symbol in it at all so maybe this is only for now.
23201
23202 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23203
23204         * support.cs (InternalParameters): Constructor now takes an extra argument 
23205         which is the actual Parameters class.
23206
23207         (ParameterDesc): Update to provide info on ref/out modifiers.
23208
23209         * class.cs (everywhere): Update call to InternalParameters to pass in
23210         the second argument too.
23211
23212         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23213         to return the modifier info [ref/out etc]
23214
23215         (InternalParameters, ReflectionParameters): Implement the above.
23216
23217         * expression.cs (Argument::ParameterModifier): Similar function to return
23218         info about the argument's modifiers.
23219
23220         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23221         too.
23222
23223         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23224         a new SetFormalParameters object which we pass to InternalParameters.
23225
23226 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23227
23228         * expression.cs (NewArray): Merge into the ArrayCreation class.
23229
23230 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23231
23232         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23233         NewUserdefinedArray into one as there wasn't much of a use in having
23234         two separate ones.
23235
23236         * expression.cs (Argument): Change field's name to ArgType from Type.
23237
23238         (Type): New readonly property which returns the proper type, taking into 
23239         account ref/out modifiers.
23240
23241         (everywhere): Adjust code accordingly for the above.
23242
23243         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23244         whether we are emitting for a ref or out parameter.
23245
23246         * expression.cs (Argument::Emit): Use the above field to set the state.
23247
23248         (LocalVariableReference::Emit): Update to honour the flag and emit the
23249         right stuff.
23250
23251         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23252
23253         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23254
23255         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23256
23257         (ReflectionParameters, InternalParameters): Implement the above method.
23258
23259         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23260         reporting errors.
23261
23262         (Invocation::FullMethodDesc): Ditto. 
23263
23264 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23265
23266         * cs-parser.jay: Add extra production for the second form of array
23267         creation. 
23268
23269         * expression.cs (ArrayCreation): Update to reflect the above
23270         change. 
23271
23272         * Small changes to prepare for Array initialization.
23273
23274 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23275
23276         * typemanager.cs (ImplementsInterface): interface might be null;
23277         Deal with this problem;
23278
23279         Also, we do store negative hits on the cache (null values), so use
23280         this instead of calling t.GetInterfaces on the type everytime.
23281
23282 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23283
23284         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23285
23286         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23287         split functionality out into different classes.
23288
23289         (New::FormArrayType): Move into NewBuiltinArray.
23290
23291         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23292         quite useless.
23293
23294         (NewBuiltinArray): New class to handle creation of built-in arrays.
23295
23296         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23297         account creation of one-dimensional arrays.
23298
23299         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23300
23301         (NewUserdefinedArray::DoResolve): Implement.
23302
23303         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23304
23305         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23306         we maintain inside the TypeManager. This is necessary to perform lookups on the
23307         module builder.
23308
23309         (LookupType): Update to perform GetType on the module builders too.     
23310
23311         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23312
23313         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23314
23315 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23316
23317         * expression.cs (New::DoResolve): Implement guts of array creation.
23318
23319         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23320
23321 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23322
23323         * expression.cs: Fix bug I introduced lsat night that broke
23324         Delegates. 
23325
23326         (Expression.Resolve): Report a 246 error (can not resolve name)
23327         if we find a SimpleName in the stream.
23328
23329         (Expression.ResolveLValue): Ditto.
23330
23331         (Expression.ResolveWithSimpleName): This function is a variant of
23332         ResolveName, this one allows SimpleNames to be returned without a
23333         warning.  The only consumer of SimpleNames is MemberAccess
23334
23335 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23336
23337         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23338         might arrive here.  I have my doubts that this is correct.
23339
23340         * statement.cs (Lock): Implement lock statement.
23341
23342         * cs-parser.jay: Small fixes to support `lock' and `using'
23343
23344         * cs-tokenizer.cs: Remove extra space
23345
23346         * driver.cs: New flag --checked, allows to turn on integer math
23347         checking. 
23348
23349         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23350         Threading.Monitor.Exit 
23351
23352 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23353
23354         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23355         Expression Class to be IndexerAccess.
23356
23357         Notice that Indexer::DoResolve sets the eclass to Value.
23358
23359 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23360
23361         * class.cs (TypeContainer::Emit): Emit code for indexers.
23362
23363         * assign.cs (IAssignMethod): New interface implemented by Indexers
23364         and Properties for handling assignment.
23365
23366         (Assign::Emit): Simplify and reuse code. 
23367
23368         * expression.cs (IndexerAccess, PropertyExpr): Implement
23369         IAssignMethod, clean up old code. 
23370
23371 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23372
23373         * typemanager.cs (ImplementsInterface): New method to determine if a type
23374         implements a given interface. Provides a nice cache too.
23375
23376         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23377         method.
23378
23379         (ConvertReferenceExplicit): Ditto.
23380
23381         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23382         various methods, with correct names etc.
23383
23384         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23385         Operator.UnaryNegation.
23386
23387         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23388         we have a unary plus or minus operator.
23389
23390         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23391         UnaryMinus.
23392
23393         * everywhere : update accordingly.
23394
23395         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23396         respectively.
23397
23398         * class.cs (Method::Define): For the case where we are implementing a method
23399         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23400         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23401
23402 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23403
23404         * interface.cs (FindMembers): Implement to work around S.R.E
23405         lameness.
23406
23407         * typemanager.cs (IsInterfaceType): Implement.
23408
23409         (FindMembers): Update to handle interface types too.
23410
23411         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23412         use IsAssignableFrom as that is not correct - it doesn't work.
23413
23414         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23415         and accordingly override EmitStatement.
23416
23417         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23418         using the correct logic :-)
23419
23420 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23421
23422         * ../errors/cs-11.cs : Add to demonstrate error -11 
23423
23424 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23425
23426         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23427         then pass this as a hint to ResolveLValue.
23428
23429         * expression.cs (FieldExpr): Add Location information
23430
23431         (FieldExpr::LValueResolve): Report assignment to readonly
23432         variable. 
23433
23434         (Expression::ExprClassFromMemberInfo): Pass location information.
23435
23436         (Expression::ResolveLValue): Add new method that resolves an
23437         LValue. 
23438
23439         (Expression::DoResolveLValue): Default invocation calls
23440         DoResolve. 
23441
23442         (Indexers): New class used to keep track of indexers in a given
23443         Type. 
23444
23445         (IStackStore): Renamed from LValue, as it did not really describe
23446         what this did.  Also ResolveLValue is gone from this interface and
23447         now is part of Expression.
23448
23449         (ElementAccess): Depending on the element access type
23450
23451         * typemanager.cs: Add `indexer_name_type' as a Core type
23452         (System.Runtime.CompilerServices.IndexerNameAttribute)
23453
23454         * statement.cs (Goto): Take a location.
23455
23456 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23457
23458         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23459         if two delegates are compatible.
23460
23461         (NewDelegate::DoResolve): Update to take care of the case when
23462         we instantiate a delegate from another delegate.
23463
23464         * typemanager.cs (FindMembers): Don't even try to look up members
23465         of Delegate types for now.
23466
23467 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23468
23469         * delegate.cs (NewDelegate): New class to take care of delegate
23470         instantiation.
23471
23472         * expression.cs (New): Split the delegate related code out into 
23473         the NewDelegate class.
23474
23475         * delegate.cs (DelegateInvocation): New class to handle delegate 
23476         invocation.
23477
23478         * expression.cs (Invocation): Split out delegate related code into
23479         the DelegateInvocation class.
23480
23481 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23482
23483         * expression.cs (New::DoResolve): Implement delegate creation fully
23484         and according to the spec.
23485
23486         (New::DoEmit): Update to handle delegates differently.
23487
23488         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23489         because of which we were printing out arguments in reverse order !
23490
23491         * delegate.cs (VerifyMethod): Implement to check if the given method
23492         matches the delegate.
23493
23494         (FullDelegateDesc): Implement.
23495
23496         (VerifyApplicability): Implement.
23497
23498         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23499         delegate invocations too.
23500
23501         (Invocation::Emit): Ditto.
23502
23503         * ../errors/cs1593.cs : Added.
23504
23505         * ../errors/cs1594.cs : Added.
23506
23507         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23508
23509 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23510
23511         * typemanager.cs (intptr_type): Core type for System.IntPtr
23512
23513         (InitCoreTypes): Update for the same.
23514
23515         (iasyncresult_type, asynccallback_type): Ditto.
23516
23517         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23518         correct.
23519
23520         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23521         too.
23522
23523         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23524         the builders for the 4 members of a delegate type :-)
23525
23526         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23527         type.
23528
23529         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23530
23531         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23532
23533 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23534
23535         * statement.cs (Break::Emit): Implement.   
23536         (Continue::Emit): Implement.
23537
23538         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23539         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23540         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23541         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23542         end loop
23543
23544         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23545         properties that track the label for the current loop (begin of the
23546         loop and end of the loop).
23547
23548 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23549
23550         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23551         use of emitting anything at all.
23552
23553         * class.cs, rootcontext.cs : Get rid of calls to the same.
23554
23555         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23556
23557         (Populate): Define the constructor correctly and set the implementation
23558         attributes.
23559
23560         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23561         have been defined.
23562
23563         (AddDelegateType): Implement.
23564
23565         (IsDelegateType): Implement helper method.
23566
23567         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23568
23569         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23570         and accordingly handle it.
23571
23572         * delegate.cs (Populate): Take TypeContainer argument.
23573         Implement bits to define the Invoke method. However, I still haven't figured out
23574         how to take care of the native int bit :-(
23575
23576         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23577         Qualify the name of the delegate, not its return type !
23578
23579         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23580         conversion.
23581
23582         (StandardConversionExists): Checking for array types turns out to be recursive.
23583
23584         (ConvertReferenceExplicit): Implement array conversion.
23585
23586         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23587
23588 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23589
23590         * cs-parser.jay (delegate_declaration): Store the fully qualified
23591         name as it is a type declaration.
23592
23593         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23594         readonly.
23595
23596         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23597         as TypeContainer::DefineType.
23598
23599         (Populate): Method in which all the definition of the various methods (Invoke)
23600         etc is done.
23601
23602         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23603         see.
23604
23605         (CloseDelegate): Finally creates the delegate.
23606
23607         * class.cs (TypeContainer::DefineType): Update to define delegates.
23608         (Populate, Emit and CloseType): Do the same thing here too.
23609
23610         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23611         delegates in all these operations.
23612
23613 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23614
23615         * expression.cs: LocalTemporary: a new expression used to
23616         reference a temporary that has been created.
23617
23618         * assign.cs: Handle PropertyAccess back here, so that we can
23619         provide the proper semantic access to properties.
23620
23621         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23622         a few more explicit conversions. 
23623
23624         * modifiers.cs: `NEW' modifier maps to HideBySig.
23625
23626         * expression.cs (PropertyExpr): Make this into an
23627         ExpressionStatement, and support the EmitStatement code path. 
23628
23629         Perform get/set error checking, clean up the interface.
23630
23631         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23632         them into toplevel access objects.
23633
23634 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23635
23636         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23637         SRE.
23638
23639         * typemanager.cs: Keep track here of our PropertyBuilders again to
23640         work around lameness in SRE.
23641
23642 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23643
23644         * expression.cs (LValue::LValueResolve): New method in the
23645         interface, used to perform a second resolution pass for LValues. 
23646
23647         (This::DoResolve): Catch the use of this in static methods.
23648
23649         (This::LValueResolve): Implement.
23650
23651         (This::Store): Remove warning, assigning to `this' in structures
23652         is 
23653
23654         (Invocation::Emit): Deal with invocation of
23655         methods on value types.  We need to pass the address to structure
23656         methods rather than the object itself.  (The equivalent code to
23657         emit "this" for structures leaves the entire structure on the
23658         stack instead of a pointer to it). 
23659
23660         (ParameterReference::DoResolve): Compute the real index for the
23661         argument based on whether the method takes or not a `this' pointer
23662         (ie, the method is static).
23663
23664         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23665         value types returned from functions when we need to invoke a
23666         method on the sturcture.
23667
23668
23669 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23670
23671         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23672         defining the type in the Modulebuilder or Typebuilder. This is to take
23673         care of nested types which need to be defined on the TypeBuilder using
23674         DefineNestedMethod.
23675
23676         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23677         methods in RootContext, only ported to be part of TypeContainer.
23678
23679         (TypeContainer::GetInterfaceOrClass): Ditto.
23680
23681         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23682
23683         * interface.cs (Interface::DefineInterface): New method. Does exactly
23684         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23685         too.
23686
23687         (Interface::GetInterfaces): Move from RootContext here and port.
23688
23689         (Interface::GetInterfaceByName): Same here.
23690
23691         * rootcontext.cs (ResolveTree): Re-write.
23692
23693         (PopulateTypes): Re-write.
23694
23695         * class.cs (TypeContainer::Populate): Populate nested types too.
23696         (TypeContainer::Emit): Emit nested members too.
23697
23698         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23699         instead just use the name argument passed in as it is already fully
23700         qualified.
23701
23702         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23703         to TypeContainer mapping to see if a type is user-defined.
23704
23705         * class.cs (TypeContainer::CloseType): Implement. 
23706
23707         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23708         the default constructor.
23709
23710         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23711         twice.
23712
23713         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23714
23715         * interface.cs (CloseType): Create the type here.
23716
23717         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23718         the hierarchy.
23719
23720         Remove all the methods which are now in TypeContainer.
23721
23722 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23723
23724         * delegate.cs (Define): Re-write bits to define the delegate
23725         correctly.
23726
23727 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23728
23729         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23730
23731         * expression.cs (ImplicitReferenceConversion): handle null as well
23732         as a source to convert to any reference type.
23733
23734         * statement.cs (Return): Perform any implicit conversions to
23735         expected return type.  
23736
23737         Validate use of return statement.  
23738
23739         * codegen.cs (EmitContext): Pass the expected return type here.
23740
23741         * class.cs (Method, Constructor, Property): Pass expected return
23742         type to EmitContext.
23743
23744 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23745
23746         * expression.cs: Make DoResolve take an EmitContext instead of a
23747         TypeContainer.
23748
23749         Replaced `l' and `location' for `loc', for consistency.
23750
23751         (Error, Warning): Remove unneeded Tc argument.
23752
23753         * assign.cs, literal.cs, constant.cs: Update to new calling
23754         convention. 
23755
23756         * codegen.cs: EmitContext now contains a flag indicating whether
23757         code is being generated in a static method or not.
23758
23759         * cs-parser.jay: DecomposeQI, new function that replaces the old
23760         QualifiedIdentifier.  Now we always decompose the assembled
23761         strings from qualified_identifier productions into a group of
23762         memberaccesses.
23763
23764 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23765
23766         * rootcontext.cs: Deal with field-less struct types correctly now
23767         by passing the size option to Define Type.
23768
23769         * class.cs: Removed hack that created one static field. 
23770
23771 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23772
23773         * statement.cs: Moved most of the code generation here. 
23774
23775 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23776
23777         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23778         seem very right.
23779
23780         (ElementAccess): Remove useless bits for now - keep checks as the spec
23781         says.
23782
23783 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23784
23785         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23786         and start performing checks according to the spec.
23787
23788 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23789
23790         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23791         rank_specifiers instead.
23792
23793         (rank_specifiers): Change the order in which the rank specifiers are stored
23794
23795         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23796
23797         * expression.cs (ElementAccess): Implement the LValue interface too.
23798
23799 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23800
23801         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23802         except that user defined conversions are not included.
23803
23804         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23805         perform the conversion of the return type, if necessary.
23806
23807         (New::DoResolve): Check whether we are creating an array or an object
23808         and accordingly do the needful.
23809
23810         (New::Emit): Same here.
23811
23812         (New::DoResolve): Implement guts of array creation.
23813
23814         (New::FormLookupType): Helper function.
23815
23816 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23817
23818         * codegen.cs: Removed most of the code generation here, and move the
23819         corresponding code generation bits to the statement classes. 
23820
23821         Added support for try/catch/finalize and throw.
23822
23823         * cs-parser.jay: Added support for try/catch/finalize.
23824
23825         * class.cs: Catch static methods having the flags override,
23826         virtual or abstract.
23827
23828         * expression.cs (UserCast): This user cast was not really doing
23829         what it was supposed to do.  Which is to be born in fully resolved
23830         state.  Parts of the resolution were being performed at Emit time! 
23831
23832         Fixed this code.
23833
23834 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23835
23836         * expression.cs: Implicity convert the result from UserCast.
23837
23838 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23839
23840         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23841         prevented it from working correctly. 
23842
23843         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23844         merely ConvertImplicit.
23845
23846 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23847
23848         * typemanager.cs: Make the LookupTypeContainer function static,
23849         and not per-instance.  
23850
23851         * class.cs: Make static FindMembers (the one that takes a Type
23852         argument). 
23853
23854         * codegen.cs: Add EmitForeach here.
23855
23856         * cs-parser.jay: Make foreach a toplevel object instead of the
23857         inline expansion, as we need to perform semantic analysis on it. 
23858
23859 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23860
23861         * expression.cs (Expression::ImplicitUserConversion): Rename to
23862         UserDefinedConversion.
23863
23864         (Expression::UserDefinedConversion): Take an extra argument specifying 
23865         whether we look for explicit user conversions too.
23866
23867         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23868
23869         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23870
23871         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23872         with the appropriate arguments.
23873
23874         * cs-parser.jay (cast_expression): Record location too.
23875
23876         * expression.cs (Cast): Record location info.
23877
23878         (Expression::ConvertExplicit): Take location argument.
23879
23880         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23881         to determine if we are doing explicit conversions.
23882
23883         (UserCast::Emit): Update accordingly.
23884
23885         (Expression::ConvertExplicit): Report an error if everything fails.
23886
23887         * ../errors/cs0030.cs : Add.
23888
23889 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23890
23891         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23892         virtual and newslot bits. 
23893
23894         * class.cs (TypeContainer::RegisterRequiredImplementations):
23895         Record methods we need.
23896
23897         (TypeContainer::MakeKey): Helper function to make keys for
23898         MethodBases, since the Methodbase key is useless.
23899
23900         (TypeContainer::Populate): Call RegisterRequiredImplementations
23901         before defining the methods.   
23902
23903         Create a mapping for method_builders_to_methods ahead of time
23904         instead of inside a tight loop.
23905
23906         (::RequireMethods):  Accept an object as the data to set into the
23907         hashtable so we can report interface vs abstract method mismatch.
23908
23909 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23910
23911         * report.cs: Make all of it static.
23912
23913         * rootcontext.cs: Drop object_type and value_type computations, as
23914         we have those in the TypeManager anyways.
23915
23916         Drop report instance variable too, now it is a global.
23917
23918         * driver.cs: Use try/catch on command line handling.
23919
23920         Add --probe option to debug the error reporting system with a test
23921         suite. 
23922
23923         * report.cs: Add support for exiting program when a probe
23924         condition is reached.
23925
23926 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23927
23928         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23929         we do a forcible conversion regardless of type, to check if 
23930         ForceConversion returns a null.
23931
23932         (Binary::error19): Use location to report error.
23933
23934         (Unary::error23): Use location here too.
23935
23936         * ../errors/cs0019.cs : Check in.
23937
23938         * ../errors/cs0023.cs : Check in.
23939
23940         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23941         case of a non-null MethodInfo object with a length of 0 !
23942
23943         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23944         an applicable member - according to the spec :-)
23945         Also fix logic to find members in base types.
23946
23947         (Unary::ResolveOperator): Same here.
23948
23949         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23950         as I was getting thoroughly confused between this and error19 :-)
23951
23952         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23953         (::FindMostEncompassedType): Implement.
23954         (::FindMostEncompassingType): Implement.
23955         (::StandardConversionExists): Implement.
23956
23957         (UserImplicitCast): Re-vamp. We now need info about most specific
23958         source and target types so that we can do the necessary conversions.
23959
23960         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23961         mathematical union with no duplicates.
23962
23963 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23964
23965         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23966         in order from base classes to child classes, so that we can in
23967         child classes look up in our parent for method names and
23968         attributes (required for handling abstract, virtual, new, override
23969         constructs: we need to instrospect our base class, and if we dont
23970         populate the classes in order, the introspection might be
23971         incorrect.  For example, a method could query its parent before
23972         the parent has any methods and would determine that the parent has
23973         no abstract methods (while it could have had them)).
23974
23975         (RootContext::CreateType): Record the order in which we define the
23976         classes.
23977
23978 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23979
23980         * class.cs (TypeContainer::Populate): Also method definitions can
23981         fail now, keep track of this.
23982
23983         (TypeContainer::FindMembers): Implement support for
23984         DeclaredOnly/noDeclaredOnly flag.
23985
23986         (Constructor::Emit) Return the ConstructorBuilder.
23987
23988         (Method::Emit) Return the MethodBuilder. 
23989         Check for abstract or virtual methods to be public.
23990
23991         * rootcontext.cs (RootContext::CreateType): Register all the
23992         abstract methods required for the class to be complete and the
23993         interface methods that must be implemented. 
23994
23995         * cs-parser.jay: Report error 501 (method requires body if it is
23996         not marked abstract or extern).
23997
23998         * expression.cs (TypeOf::Emit): Implement.
23999
24000         * typemanager.cs: runtime_handle_type, new global type.
24001
24002         * class.cs (Property::Emit): Generate code for properties.
24003
24004 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24005
24006         * expression.cs (Unary::ResolveOperator): Find operators on base type
24007         too - we now conform exactly to the spec.
24008
24009         (Binary::ResolveOperator): Same here.
24010
24011         * class.cs (Operator::Define): Fix minor quirk in the tests.
24012
24013         * ../errors/cs0215.cs : Added.
24014
24015         * ../errors/cs0556.cs : Added.
24016
24017         * ../errors/cs0555.cs : Added.
24018
24019 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24020
24021         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24022         single integer which is really efficient
24023
24024 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24025
24026         *  expression.cs (Expression::ImplicitUserConversion): Use location
24027         even in the case when we are examining True operators.
24028  
24029         * class.cs (Operator::Define): Perform extensive checks to conform
24030         with the rules for operator overloading in the spec.
24031
24032         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24033         some of the other conversions mentioned in the spec.
24034
24035         * typemanager.cs (array_type): New static member for the System.Array built-in
24036         type.
24037
24038         (cloneable_interface): For System.ICloneable interface.
24039
24040         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24041         we start resolving the tree and populating types.
24042
24043         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24044  
24045 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24046
24047         * expression.cs (Expression::ExprClassFromMemberInfo,
24048         Expression::Literalize): Create literal expressions from
24049         FieldInfos which are literals.
24050
24051         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24052         type casts, because they were wrong.  The test suite in tests
24053         caught these ones.
24054
24055         (ImplicitNumericConversion): ushort to ulong requires a widening
24056         cast. 
24057
24058         Int32 constant to long requires widening cast as well.
24059
24060         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24061         for integers because the type on the stack is not i4.
24062
24063 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24064
24065         * expression.cs (report118): require location argument. 
24066
24067         * parameter.cs: Do not dereference potential null value.
24068
24069         * class.cs: Catch methods that lack the `new' keyword when
24070         overriding a name.  Report warnings when `new' is used without
24071         anything being there to override.
24072
24073         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24074
24075         * class.cs: Only add constructor to hashtable if it is non-null
24076         (as now constructors can fail on define).
24077
24078         (TypeManager, Class, Struct): Take location arguments.
24079
24080         Catch field instance initialization in structs as errors.
24081
24082         accepting_filter: a new filter for FindMembers that is static so
24083         that we dont create an instance per invocation.
24084
24085         (Constructor::Define): Catch errors where a struct constructor is
24086         parameterless 
24087
24088         * cs-parser.jay: Pass location information for various new
24089         constructs. 
24090
24091         * delegate.cs (Delegate): take a location argument.
24092
24093         * driver.cs: Do not call EmitCode if there were problesm in the
24094         Definition of the types, as many Builders wont be there. 
24095
24096         * decl.cs (Decl::Decl): Require a location argument.
24097
24098         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24099         into integers, and find the most appropiate integer for it.
24100
24101         * literal.cs: Implement ULongLiteral.
24102
24103         * rootcontext.cs: Provide better information about the location of
24104         failure when CreateType fails.
24105
24106 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24107
24108         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24109         as well.
24110
24111         * expression.cs (Binary::CheckShiftArguments): Add missing type
24112         computation.
24113         (Binary::ResolveOperator): Add type to the logical and and logical
24114         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24115         before.
24116
24117         (Binary::DoNumericPromotions): In the case where either argument
24118         is ulong (and most signed types combined with ulong cause an
24119         error) perform implicit integer constant conversions as well.
24120
24121 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24122
24123         * expression.cs (UserImplicitCast): Method should always be
24124         non-null. 
24125         (Invocation::BetterConversion): Simplified test for IntLiteral.
24126
24127         (Expression::ImplicitNumericConversion): Split this routine out.
24128         Put the code that performs implicit constant integer conversions
24129         here. 
24130
24131         (Expression::Resolve): Become a wrapper around DoResolve so we can
24132         check eclass and type being set after resolve.
24133
24134         (Invocation::Badness): Remove this dead function
24135
24136         (Binary::ResolveOperator): Do not compute the expensive argumnets
24137         unless we have a union for it.
24138
24139         (Probe::Emit): Is needs to do an isinst and then
24140         compare against null.
24141
24142         (::CanConvert): Added Location argument.  If the Location argument
24143         is null (Location.Null), then we do not report errors.  This is
24144         used by the `probe' mechanism of the Explicit conversion.  We do
24145         not want to generate an error for something that the user
24146         explicitly requested to be casted.  But the pipeline for an
24147         explicit cast first tests for potential implicit casts.
24148
24149         So for now, if the Location is null, it means `Probe only' to
24150         avoid adding another argument.   Might have to revise this
24151         strategy later.
24152
24153         (ClassCast): New class used to type cast objects into arbitrary
24154         classes (used in Explicit Reference Conversions).
24155
24156         Implement `as' as well.
24157
24158         Reverted all the patches from Ravi below: they were broken:
24159
24160                 * The use of `level' as a mechanism to stop recursive
24161                   invocations is wrong.  That was there just to catch the
24162                   bug with a strack trace but not as a way of addressing
24163                   the problem.
24164
24165                   To fix the problem we have to *understand* what is going
24166                   on and the interactions and come up with a plan, not
24167                   just get things going.
24168
24169                 * The use of the type conversion cache that I proposed
24170                   last night had an open topic: How does this work across
24171                   protection domains.  A user defined conversion might not
24172                   be public in the location where we are applying the
24173                   conversion, a different conversion might be selected
24174                   (ie, private A->B (better) but public B->A (worse),
24175                   inside A, A->B applies, but outside it, B->A will
24176                   apply).
24177
24178                 * On top of that (ie, even if the above is solved),
24179                   conversions in a cache need to be abstract.  Ie, `To
24180                   convert from an Int to a Short use an OpcodeCast', not
24181                   `To convert from an Int to a Short use the OpcodeCast on
24182                   the variable 5' (which is what this patch was doing).
24183
24184 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24185
24186         * expression.cs (Invocation::ConversionExists): Re-write to use
24187         the conversion cache
24188
24189         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24190         cache all conversions done, not just user-defined ones.
24191
24192         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24193         to determine if a conversion exists instead of acutually trying to 
24194         perform the conversion. It's faster too.
24195
24196         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24197         and only then attempt the implicit conversion.
24198
24199 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24200
24201         * expression.cs (ConvertImplicit): Use a cache for conversions
24202         already found. Check level of recursion and bail out if necessary.
24203
24204 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24205
24206         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24207         Export standard methods that we expect for string operations.
24208
24209         * statement.cs (Block::UsageWarning): Track usage of variables and
24210         report the errors for not used variables.
24211
24212         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24213         operator. 
24214
24215 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24216
24217         * codegen.cs: remove unnneded code 
24218
24219         * expression.cs: Removed BuiltinTypeAccess class
24220
24221         Fix the order in which implicit conversions are
24222         done.  
24223
24224         The previous fixed dropped support for boxed conversions (adding a
24225         test to the test suite now)
24226
24227         (UserImplicitCast::CanConvert): Remove test for source being null,
24228         that code is broken.  We should not feed a null to begin with, if
24229         we do, then we should track the bug where the problem originates
24230         and not try to cover it up here.
24231
24232         Return a resolved expression of type UserImplicitCast on success
24233         rather than true/false.  Ravi: this is what I was talking about,
24234         the pattern is to use a static method as a "constructor" for
24235         objects. 
24236
24237         Also, do not create arguments until the very last minute,
24238         otherwise we always create the arguments even for lookups that
24239         will never be performed. 
24240
24241         (UserImplicitCast::Resolve): Eliminate, objects of type
24242         UserImplicitCast are born in a fully resolved state. 
24243
24244         * typemanager.cs (InitCoreTypes): Init also value_type
24245         (System.ValueType). 
24246
24247         * expression.cs (Cast::Resolve): First resolve the child expression.
24248
24249         (LValue): Add new method AddressOf to be used by
24250         the `&' operator.  
24251
24252         Change the argument of Store to take an EmitContext instead of an
24253         ILGenerator, because things like FieldExpr need to be able to call
24254         their children expression to generate the instance code. 
24255
24256         (Expression::Error, Expression::Warning): Sugar functions for
24257         reporting errors.
24258
24259         (Expression::MemberLookup): Accept a TypeContainer instead of a
24260         Report as the first argument.
24261
24262         (Expression::ResolvePrimary): Killed.  I still want to improve
24263         this as currently the code is just not right.
24264
24265         (Expression::ResolveMemberAccess): Simplify, but it is still
24266         wrong. 
24267
24268         (Unary::Resolve): Catch errors in AddressOf operators.
24269
24270         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24271         index to a byte for the short-version, or the compiler will choose
24272         the wrong Emit call, which generates the wrong data.
24273
24274         (ParameterReference::Emit, ::Store): same.
24275
24276         (FieldExpr::AddressOf): Implement.
24277
24278         * typemanager.cs: TypeManager: made public variable instead of
24279         property.
24280
24281         * driver.cs: document --fatal.
24282
24283         * report.cs (ErrorMessage, WarningMessage): new names for the old
24284         Error and Warning classes.
24285
24286         * cs-parser.jay (member_access): Turn built-in access to types
24287         into a normal simplename
24288
24289 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24290
24291         * expression.cs (Invocation::BetterConversion): Fix to cope
24292         with q being null, since this was introducing a bug.
24293
24294         * expression.cs (ConvertImplicit): Do built-in conversions first.
24295
24296 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24297
24298         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24299
24300 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24301
24302         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24303         I had introduced long ago (what's new ?).
24304
24305         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24306         the work of all the checking. 
24307         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24308         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24309
24310         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24311         that is the right way. 
24312
24313         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24314         overloading resolution. Use everywhere instead of cutting and pasting code.
24315
24316         (Binary::ResolveOperator): Use MakeUnionSet.
24317
24318         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24319         we have to convert to bool types. Not complete yet.
24320
24321 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24322
24323         * typemanager.cs (TypeManager::CSharpName): support ushort.
24324
24325         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24326         to provide an expression that performsn an implicit constant int
24327         conversion (section 6.1.6).
24328         (Expression::ConvertImplicitRequired): Reworked to include
24329         implicit constant expression conversions.
24330
24331         (Expression::ConvertNumericExplicit): Finished.
24332
24333         (Invocation::Emit): If InstanceExpression is null, then it means
24334         that we perform a call on this.
24335
24336 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24337
24338         * expression.cs (Unary::Emit): Remove some dead code.
24339         (Probe): Implement Resolve and Emit for `is'.
24340         (Expression::ConvertImplicitRequired): Attempt to do constant
24341         expression conversions here.  Maybe should be moved to
24342         ConvertImplicit, but I am not sure.
24343         (Expression::ImplicitLongConstantConversionPossible,
24344         Expression::ImplicitIntConstantConversionPossible): New functions
24345         that tell whether is it possible to apply an implicit constant
24346         expression conversion.
24347
24348         (ConvertNumericExplicit): Started work on explicit numeric
24349         conversions.
24350
24351         * cs-parser.jay: Update operator constants.
24352
24353         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24354         (Parameters::GetSignature): Hook up VerifyArgs here.
24355         (Parameters::VerifyArgs): Verifies that no two arguments have the
24356         same name. 
24357
24358         * class.cs (Operator): Update the operator names to reflect the
24359         ones that the spec expects (as we are just stringizing the
24360         operator names).
24361
24362         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24363         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24364         previous usage did only work for our methods.
24365         (Expression::ConvertImplicit): Handle decimal implicit numeric
24366         conversions as well.
24367         (Expression::InternalTypeConstructor): Used to invoke constructors
24368         on internal types for default promotions.
24369
24370         (Unary::Emit): Implement special handling for the pre/post
24371         increment/decrement for overloaded operators, as they need to have
24372         the same semantics as the other operators.
24373
24374         (Binary::ResolveOperator): ditto.
24375         (Invocation::ConversionExists): ditto.
24376         (UserImplicitCast::Resolve): ditto.
24377
24378 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24379
24380         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24381         operator, return after emitting body. Regression tests pass again !
24382
24383         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24384         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24385         (Invocation::OverloadResolve): Ditto.
24386         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24387
24388         * everywhere : update calls to the above methods accordingly.
24389
24390 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24391
24392         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24393
24394         * expression.cs (ExpressionStatement): New base class used for
24395         expressions that can appear in statements, so that we can provide
24396         an alternate path to generate expression that do not leave a value
24397         on the stack.
24398
24399         (Expression::Emit, and all the derivatives): We no longer return
24400         whether a value is left on the stack or not.  Every expression
24401         after being emitted leaves a single value on the stack.
24402
24403         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24404         facilties of ExpressionStatement if possible.
24405
24406         * cs-parser.jay: Update statement_expression.
24407
24408 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24409
24410         * driver.cs: Change the wording of message
24411
24412 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24413
24414         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24415         the type of the expression to the return type of the method if
24416         we have an overloaded operator match ! The regression tests pass again !
24417         (Unary::ResolveOperator): Ditto.
24418
24419         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24420         to find "op_Implicit", not "implicit" ;-)
24421         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24422         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24423
24424         * everywhere : Correct calls to the above accordingly.
24425
24426         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24427         (ConvertImplicit): Do user-defined conversion if it exists.
24428
24429 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24430
24431         * assign.cs: track location.
24432         (Resolve): Use implicit conversions on assignment.
24433
24434         * literal.cs: Oops.  Not good, Emit of short access values should
24435         pass (Bytes) or the wrong argument will be selected.
24436
24437         * expression.cs (Unary::Emit): Emit code for -expr.
24438
24439         (Unary::ResolveOperator): Handle `Substract' for non-constants
24440         (substract from zero from the non-constants).
24441         Deal with Doubles as well. 
24442
24443         (Expression::ConvertImplicitRequired): New routine that reports an
24444         error if no implicit conversion exists. 
24445
24446         (Invocation::OverloadResolve): Store the converted implicit
24447         expressions if we make them
24448
24449 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24450
24451         * class.cs (ConstructorInitializer): Take a Location argument.
24452         (ConstructorBaseInitializer): Same here.
24453         (ConstructorThisInitializer): Same here.
24454
24455         * cs-parser.jay : Update all calls accordingly.
24456
24457         * expression.cs (Unary, Binary, New): Take location argument.
24458         Update accordingly everywhere.
24459
24460         * cs-parser.jay : Update all calls to the above to take a location
24461         argument.
24462
24463         * class.cs : Ditto.
24464
24465 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24466
24467         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24468         (Invocation::BetterConversion): Same here
24469         (Invocation::ConversionExists): Ditto.
24470
24471         (Invocation::ConversionExists): Implement.
24472
24473 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24474
24475         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24476         Also take an additional TypeContainer argument.
24477
24478         * All over : Pass in TypeContainer as argument to OverloadResolve.
24479
24480         * typemanager.cs (CSharpName): Update to check for the string type and return
24481         that too.
24482
24483         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24484         a given method.
24485
24486 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24487
24488         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24489         (Invocation::BetterFunction): Implement.
24490         (Invocation::BetterConversion): Implement.
24491         (Invocation::ConversionExists): Skeleton, no implementation yet.
24492
24493         Okay, things work fine !
24494
24495 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24496
24497         * typemanager.cs: declare and load enum_type, delegate_type and
24498         void_type. 
24499
24500         * expression.cs (Expression::Emit): Now emit returns a value that
24501         tells whether a value is left on the stack or not.  This strategy
24502         might be reveted tomorrow with a mechanism that would address
24503         multiple assignments.
24504         (Expression::report118): Utility routine to report mismatches on
24505         the ExprClass.
24506
24507         (Unary::Report23): Report impossible type/operator combination
24508         utility function.
24509
24510         (Unary::IsIncrementableNumber): Whether the type can be
24511         incremented or decremented with add.
24512         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24513         complemented. 
24514         (Unary::ResolveOperator): Implement ++, !, ~,
24515
24516         (Invocation::Emit): Deal with new Emit convetion.
24517
24518         * All Expression derivatives: Updated their Emit method to return
24519         whether they leave values on the stack or not.
24520
24521         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24522         stack for expressions that are statements. 
24523
24524 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24525
24526         * expression.cs (LValue): New interface.  Must be implemented by
24527         LValue objects.
24528         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24529         LValue interface.
24530
24531         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24532         interface for generating code, simplifies the code.
24533
24534 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24535
24536         * expression.cs (everywhere): Comment out return statements in ::Resolve
24537         methods to avoid the warnings.
24538
24539 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24540
24541         * driver.cs (parse): Report error 2001 if we can not open the
24542         source file.
24543
24544         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24545         not resolve it.
24546
24547         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24548         object. 
24549
24550         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24551         otherwise nested blocks end up with the same index.
24552
24553         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24554
24555         * expression.cs:  Instead of having FIXMEs in the Resolve
24556         functions, throw exceptions so it is obvious that we are facing a
24557         bug. 
24558
24559         * cs-parser.jay (invocation_expression): Pass Location information.
24560
24561         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24562         Use a basename for those routines because .NET does not like paths
24563         on them. 
24564
24565         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24566         already defined.
24567
24568 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24569
24570         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24571         are loading the correct data types (throws an exception if not).
24572         (TypeManager::InitCoreTypes): Use CoreLookupType
24573
24574         * expression.cs (Unary::ResolveOperator): return the child
24575         expression for expressions which are just +expr.
24576         (Unary::ResolveOperator): Return negative literals for -LITERAL
24577         expressions (otherwise they are Unary {Literal}).
24578         (Invocation::Badness): Take into account `Implicit constant
24579         expression conversions'.
24580
24581         * literal.cs (LongLiteral): Implement long literal class.
24582         (IntLiteral): export the `Value' of the intliteral. 
24583
24584 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24585
24586         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24587
24588         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24589         instead of 'Operator'
24590
24591         * expression.cs (Binary::ResolveOperator): Update accordingly.
24592         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24593         and 'Minus'
24594
24595         * cs-parser.jay (unary_expression): Update to use the new names.
24596
24597         * gen-treedump.cs (GetUnary): Same here.
24598
24599         * expression.cs (Unary::Resolve): Implement.
24600         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24601         operators are found instead of making noise ;-)
24602         (Unary::ResolveOperator): New method to do precisely the same thing which
24603         Binary::ResolveOperator does for Binary expressions.
24604         (Unary.method, .Arguments): Add.
24605         (Unary::OperName): Implement.   
24606         (Unary::ForceConversion): Copy and Paste !
24607
24608         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24609         a unary operator.
24610
24611         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24612         for the inbuilt operators. Only overloading works for now ;-)
24613
24614 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24615
24616         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24617         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24618
24619         * expression.cs (This::Emit): Implement. 
24620         (This::Resolve): Implement.
24621         (TypeOf:Resolve): Implement.
24622         (Expression::ResolveSimpleName): Add an implicit this to instance
24623         field references. 
24624         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24625         Bind instance variable to Field expressions.
24626         (FieldExpr::Instance): New field used to track the expression that
24627         represents the object instance.
24628         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24629         binding 
24630         (FieldExpr::Emit): Implement.
24631
24632         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24633         the last instruction contains a return opcode to avoid generating
24634         the last `ret' instruction (this generates correct code, and it is
24635         nice to pass the peverify output).
24636
24637         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24638         initializer for static and instance variables.
24639         (Constructor::Emit): Allow initializer to be null in the case of
24640         static constructors.  Only emit initializer for instance
24641         constructors. 
24642
24643         (TypeContainer::FindMembers): Return a null array if there are no
24644         matches.
24645
24646         Also fix the code for the MemberTypes.Method branch, as it was not
24647         scanning that for operators (or tried to access null variables before).
24648
24649         * assign.cs (Assign::Emit): Handle instance and static fields. 
24650
24651         * TODO: Updated.
24652
24653         * driver.cs: Stop compilation if there are parse errors.
24654
24655         * cs-parser.jay (constructor_declaration): Provide default base
24656         initializer for non-static constructors.
24657         (constructor_declarator): Do not provide a default base
24658         initializers if none was specified.
24659         Catch the fact that constructors should not have parameters.
24660
24661         * class.cs: Do not emit parent class initializers for static
24662         constructors, that should be flagged as an error.
24663
24664 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24665
24666         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24667         Move back code into TypeContainer::Populate.
24668
24669 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24670
24671         * class.cs (TypeContainer::AddConstructor): Fix the check to
24672         compare against Name, not Basename. 
24673         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24674
24675         * cs-parser.jay : Update accordingly.
24676
24677         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24678         for methods, don't forget to look into the operators too.
24679         (RegisterMethodBuilder): Helper method to take care of this for
24680         methods, constructors and operators.
24681         (Operator::Define): Completely revamp.
24682         (Operator.OperatorMethod, MethodName): New fields.
24683         (TypeContainer::Populate): Move the registering of builders into
24684         RegisterMethodBuilder.
24685         (Operator::Emit): Re-write.
24686
24687         * expression.cs (Binary::Emit): Comment out code path to emit method
24688         invocation stuff for the case when we have a user defined operator. I am
24689         just not able to get it right !
24690
24691 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24692
24693         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24694         argument. 
24695
24696         (Expression::MemberLookup): Provide a version that allows to
24697         specify the MemberTypes and BindingFlags. 
24698
24699         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24700         so it was not fetching variable information from outer blocks.
24701
24702         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24703         Beforefieldinit as it was buggy.
24704
24705         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24706         that Ravi put here.  
24707
24708         * class.cs (Constructor::Emit): Only emit if block is not null.
24709         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24710         deal with this by semantically definining it as if the user had
24711         done it.
24712
24713         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24714         constructors as we now "emit" them at a higher level.
24715
24716         (TypeContainer::DefineDefaultConstructor): Used to define the
24717         default constructors if none was provided.
24718
24719         (ConstructorInitializer): Add methods Resolve and Emit. 
24720
24721         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24722
24723 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24724
24725         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24726         the default constructor builder with our hashtable for methodbuilders
24727         to methodcores.
24728
24729         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24730         and argument_count is 0 in which case we have a match.
24731         (Binary::ResolveOperator): More null checking and miscellaneous coding
24732         style cleanup.
24733
24734 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24735
24736         * rootcontext.cs (IsNameSpace): Compare against null.
24737
24738         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24739
24740         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24741         and Unary::Operator.
24742
24743         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24744         accordingly.
24745
24746         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24747         we have overloaded operators.
24748         (Binary::ResolveOperator): Implement the part which does the operator overload
24749         resolution.
24750
24751         * class.cs (Operator::Emit): Implement.
24752         (TypeContainer::Emit): Emit the operators we have too.
24753
24754         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24755         the case when we have a user-defined operator.
24756
24757 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24758
24759         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24760
24761 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24762
24763         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24764         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24765         (Constructor::Emit): Implement.
24766         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24767         if we have no work to do. 
24768         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24769         Emit method.
24770
24771         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24772         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24773
24774         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24775         of parent.parent.
24776
24777 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24778
24779         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24780         in the source.
24781         (Tree::RecordNamespace): Method to do what the name says ;-)
24782         (Tree::Namespaces): Property to get at the namespaces hashtable.
24783
24784         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24785         keep track.
24786
24787         * rootcontext.cs (IsNamespace): Fixed it :-)
24788
24789 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24790
24791         * class.cs (TypeContainer::FindMembers): Add support for
24792         constructors. 
24793         (MethodCore): New class that encapsulates both the shared aspects
24794         of a Constructor and a Method.  
24795         (Method, Constructor): Factored pieces into MethodCore.
24796
24797         * driver.cs: Added --fatal which makes errors throw exceptions.
24798         Load System assembly as well as part of the standard library.
24799
24800         * report.cs: Allow throwing exceptions on errors for debugging.
24801
24802         * modifiers.cs: Do not use `parent', instead use the real type
24803         container to evaluate permission settings.
24804
24805         * class.cs: Put Ravi's patch back in.  He is right, and we will
24806         have to cope with the
24807
24808 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24809
24810         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24811         FamORAssem, not FamANDAssem.
24812
24813 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24814
24815         * driver.cs: Added --parse option that only parses its input files
24816         and terminates.
24817
24818         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24819         incorrect.  IsTopLevel is not used to tell whether an object is
24820         root_types or not (that can be achieved by testing this ==
24821         root_types).  But to see if this is a top-level *class* (not
24822         necessarly our "toplevel" container). 
24823
24824 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24825
24826         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24827         parent instead of a direct call to GetType.
24828
24829 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24830
24831         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24832         Modifiers.TypeAttr. This should just be a call to that method.
24833
24834         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24835         object so that we can determine if we are top-level or not.
24836
24837         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24838         TypeContainer too.
24839
24840         * enum.cs (Enum::Define): Ditto.
24841
24842         * modifiers.cs (FieldAttr): Re-write.
24843
24844         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24845         (TypeContainer::HaveStaticConstructor): New property to provide access
24846         to precisely that info.
24847
24848         * modifiers.cs (MethodAttr): Re-write.
24849         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24850
24851         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24852         of top-level types as claimed.
24853
24854 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24855
24856         * expression.cs (MemberLookup): Fruitless attempt to lookup
24857         constructors.  Maybe I need to emit default constructors?  That
24858         might be it (currently .NET emits this for me automatically).
24859         (Invocation::OverloadResolve): Cope with Arguments == null.
24860         (Invocation::EmitArguments): new function, shared by the new
24861         constructor and us.
24862         (Invocation::Emit): Handle static and instance methods.  Emit
24863         proper call instruction for virtual or non-virtual invocations.
24864         (New::Emit): Implement.
24865         (New::Resolve): Implement.
24866         (MemberAccess:Resolve): Implement.
24867         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24868         to track instances.
24869         (FieldExpr::Resolve): Set type.
24870
24871         * support.cs: Handle empty arguments.
24872                 
24873         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24874         SimpleLookup): Auxiliary routines to help parse a qualifier
24875         identifier.  
24876
24877         Update qualifier_identifier rule.
24878
24879         * codegen.cs: Removed debugging messages.
24880
24881         * class.cs: Make this a global thing, this acts just as a "key" to
24882         objects that we might have around.
24883
24884         (Populate): Only initialize method_builders_to_methods once.
24885
24886         * expression.cs (PropertyExpr): Initialize type from the
24887         PropertyType. 
24888
24889         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24890         Resolve pattern.  Attempt to implicitly convert value to boolean.
24891         Emit code.
24892
24893         * expression.cs: Set the type for the int32/int32 argument case.
24894         (Binary::ResolveOperator): Set the return type to boolean for
24895         comparission operators
24896
24897         * typemanager.cs: Remove debugging print code.
24898
24899         (Invocation::Resolve): resolve type.
24900
24901         * class.cs: Allocate a MemberInfo of the correct size, as the code
24902         elsewhere depends on the test to reflect the correct contents.
24903
24904         (Method::) Keep track of parameters, due to System.Reflection holes
24905
24906         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24907         mapping here.
24908
24909         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24910         of the exact size and return that.
24911
24912         (Class::LookupMethodByBuilder): New function that maps
24913         MethodBuilders to its methods.  Required to locate the information
24914         on methods because System.Reflection bit us again.
24915
24916         * support.cs: New file, contains an interface ParameterData and
24917         two implementations: ReflectionParameters and InternalParameters
24918         used to access Parameter information.  We will need to grow this
24919         as required.
24920
24921         * expression.cs (Invocation::GetParameterData): implement a cache
24922         and a wrapper around the ParameterData creation for methods. 
24923         (Invocation::OverloadResolve): Use new code.
24924
24925 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24926
24927         * class.cs (TypeContainer::EmitField): Remove and move into 
24928         (Field::Define): here and modify accordingly.
24929         (Field.FieldBuilder): New member.
24930         (TypeContainer::Populate): Update accordingly.
24931         (TypeContainer::FindMembers): Implement.
24932
24933 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24934
24935         * statement.cs: (VariableInfo::VariableType): New field to be
24936         initialized with the full type once it is resolved. 
24937
24938 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24939
24940         * parameter.cs (GetParameterInfo): Use a type cache to compute
24941         things only once, and to reuse this information
24942
24943         * expression.cs (LocalVariableReference::Emit): Implement.
24944         (OpcodeCast::Emit): fix.
24945
24946         (ParameterReference::Resolve): Implement.
24947         (ParameterReference::Emit): Implement.
24948
24949         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24950         that are expressions need to stay as Expressions.
24951
24952         * typemanager.cs (CSharpName): Returns the C# name of a type if
24953         possible. 
24954
24955         * expression.cs (Expression::ConvertImplicit): New function that
24956         implements implicit type conversions.
24957
24958         (Expression::ImplicitReferenceConversion): Implements implicit
24959         reference conversions.
24960
24961         (EmptyCast): New type for transparent casts.
24962
24963         (OpcodeCast): New type for casts of types that are performed with
24964         a sequence of bytecodes.
24965
24966         (BoxedCast): New type used for casting value types into reference
24967         types.  Emits a box opcode.
24968
24969         (Binary::DoNumericPromotions): Implements numeric promotions of
24970         and computation of the Binary::Type.
24971
24972         (Binary::EmitBranchable): Optimization.
24973
24974         (Binary::Emit): Implement code emission for expressions.
24975
24976         * typemanager.cs (TypeManager): Added two new core types: sbyte
24977         and byte.
24978
24979 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24980
24981         * class.cs (TypeContainer::FindMembers): Method which does exactly
24982         what Type.FindMembers does, only we don't have to use reflection. No
24983         implementation yet.
24984
24985         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24986         typecontainer objects as we need to get at them.
24987         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24988
24989         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24990         typecontainer object.
24991
24992         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24993         of just a Report object.
24994
24995 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24996
24997         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24998         "remove_"
24999         (TypeContainer::Populate): Now define the delegates of the type too.
25000         (TypeContainer.Delegates): Property to access the list of delegates defined
25001         in the type.
25002
25003         * delegates.cs (Delegate::Define): Implement partially.
25004
25005         * modifiers.cs (TypeAttr): Handle more flags.
25006
25007 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25008
25009         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25010         and not <=
25011         (Operator::Define): Re-write logic to get types by using the LookupType method
25012         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25013         (Indexer::Define): Ditto.
25014         (Event::Define): Ditto.
25015         (Property::Define): Ditto.
25016
25017 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25018
25019         * class.cs (TypeContainer::Populate): Now define operators too. 
25020         (TypeContainer.Operators): New property to access the list of operators
25021         in a type.
25022         (Operator.OperatorMethodBuilder): New member to hold the method builder
25023         for the operator we are defining.
25024         (Operator::Define): Implement.
25025
25026 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25027
25028         * class.cs (Event::Define): Make the prefixes of the accessor methods
25029         addOn_ and removeOn_ 
25030
25031         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25032         of the location being passed in too. Ideally, this should go later since all
25033         error reporting should be done through the Report object.
25034
25035         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25036         (Populate): Iterate thru the indexers we have and define them too.
25037         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25038         for the get and set accessors.
25039         (Indexer::Define): Implement.
25040
25041 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25042
25043         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25044         my previous implementation, did not work.
25045
25046         * typemanager.cs: Add a couple of missing types (the longs).
25047
25048         * literal.cs: Use TypeManager.bool_type instead of getting it.
25049
25050         * expression.cs (EventExpr): New kind of expressions.
25051         (Expressio::ExprClassFromMemberInfo): finish
25052
25053 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25054
25055         * assign.cs: Emit stores to static fields differently.
25056
25057 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25058
25059         * Merge in changes and adjust code to tackle conflicts. Backed out my
25060         code in Assign::Resolve ;-) 
25061
25062 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25063
25064         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25065         instead Report.Error and also pass in the location.
25066         (CSharpParser::Lexer): New readonly property to return the reference
25067         to the Tokenizer object.
25068         (declare_local_variables): Use Report.Error with location instead of plain 
25069         old error.
25070         (CheckDef): Ditto.
25071
25072         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25073         (Operator.CheckBinaryOperator): Ditto.
25074
25075         * cs-parser.jay (operator_declarator): Update accordingly.
25076
25077         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25078         (CheckBinaryOperator): Same here.
25079
25080         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25081         on the name without any prefixes of namespace names etc. This is because we
25082         already might have something already fully qualified like 
25083         'System.Console.WriteLine'
25084
25085         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25086
25087 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25088
25089         * cs-tokenizer.cs (location): Return a string which also contains
25090         the file name.
25091
25092         * expression.cs (ElementAccess): New class for expressions of the
25093         type 'element access.'
25094         (BaseAccess): New class for expressions of the type 'base access.'
25095         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25096         respectively.
25097
25098         * cs-parser.jay (element_access): Implement action.
25099         (base_access): Implement actions.
25100         (checked_expression, unchecked_expression): Implement.
25101
25102         * cs-parser.jay (local_variable_type): Correct and implement.
25103         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25104
25105         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25106
25107         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25108         name and the specifiers.
25109
25110         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25111
25112         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25113         making them all public ;-)
25114
25115         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25116         class anyways.
25117
25118 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25119
25120         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25121         PropertyExprs.
25122         (FieldExpr, PropertyExprs): New resolved expressions.
25123         (SimpleName::MemberStaticCheck): Perform static checks for access
25124         to non-static fields on static methods. Maybe this should be
25125         generalized for MemberAccesses. 
25126         (SimpleName::ResolveSimpleName): More work on simple name
25127         resolution. 
25128
25129         * cs-parser.jay (primary_expression/qualified_identifier): track
25130         the parameter index.
25131
25132         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25133         (EmitContext::EmitBoolExpression): Chain to expression generation
25134         instead of temporary hack.
25135         (::EmitStatementExpression): Put generic expression code generation.
25136
25137         * assign.cs (Assign::Emit): Implement variable assignments to
25138         local variables, parameters and fields.
25139
25140 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25141
25142         * statement.cs (Block::GetVariableInfo): New method, returns the
25143         VariableInfo for a variable name in a block.
25144         (Block::GetVariableType): Implement in terms of GetVariableInfo
25145
25146         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25147         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25148
25149 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25150
25151         * cs-parser.jay (operator_declaration): Continue on my quest : update
25152         to take attributes argument.
25153         (event_declaration): Ditto.
25154         (enum_declaration): Ditto.
25155         (indexer_declaration): Ditto.
25156
25157         * class.cs (Operator::Operator): Update constructor accordingly.
25158         (Event::Event): Ditto.
25159
25160         * delegate.cs (Delegate::Delegate): Same here.
25161
25162         * enum.cs (Enum::Enum): Same here.
25163
25164 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25165
25166         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25167
25168         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25169
25170         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25171         being passed around as an arraylist.
25172         (Attributes::AddAttribute): Method to add attribute sections.
25173
25174         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25175         (struct_declaration): Update accordingly.
25176         (constant_declaration): Update.
25177         (field_declaration): Update.
25178         (method_header): Update.
25179         (fixed_parameter): Update.
25180         (parameter_array): Ditto.
25181         (property_declaration): Ditto.
25182         (destructor_declaration): Ditto.
25183
25184         * class.cs (Struct::Struct): Update constructors accordingly.
25185         (Class::Class): Ditto.
25186         (Field::Field): Ditto.
25187         (Method::Method): Ditto.
25188         (Property::Property): Ditto.
25189         (TypeContainer::OptAttribute): update property's return type.
25190
25191         * interface.cs (Interface.opt_attributes): New member.
25192         (Interface::Interface): Update to take the extra Attributes argument.
25193
25194         * parameter.cs (Parameter::Parameter): Ditto.
25195
25196         * constant.cs (Constant::Constant): Ditto.
25197
25198         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25199         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25200         the attributes as a parameter.
25201         (InterfaceProperty): Update constructor call.
25202         (InterfaceEvent): Ditto.
25203         (InterfaceMethod): Ditto.
25204         (InterfaceIndexer): Ditto.
25205
25206         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25207         pass the attributes too.
25208         (interface_event_declaration): Ditto.
25209         (interface_property_declaration): Ditto.
25210         (interface_method_declaration): Ditto.
25211         (interface_declaration): Ditto.
25212
25213 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25214
25215         * class.cs (Method::Define): Track the "static Main" definition to
25216         create an entry point. 
25217
25218         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25219         EntryPoint if we find it. 
25220
25221         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25222         (EmitContext::ig): Make this variable public.
25223
25224         * driver.cs: Make the default output file be the first file name
25225         with the .exe extension.  
25226
25227         Detect empty compilations
25228
25229         Handle various kinds of output targets.  Handle --target and
25230         rename -t to --dumper.
25231
25232         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25233         methods inherited from Expression return now an Expression.  This
25234         will is used during the tree rewriting as we resolve them during
25235         semantic analysis.
25236
25237         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25238         the spec.  Missing entirely is the information about
25239         accessability of elements of it.
25240
25241         (Expression::ExprClassFromMemberInfo): New constructor for
25242         Expressions that creates a fully initialized Expression based on
25243         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25244         a Type.
25245
25246         (Invocation::Resolve): Begin implementing resolution of invocations.
25247
25248         * literal.cs (StringLiteral):  Implement Emit.
25249
25250 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25251
25252         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25253         member.
25254
25255 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25256
25257         * cs-parser.jay (attribute_arguments): Implement actions.
25258         (attribute): Fix bug in production. Implement action.
25259         (attribute_list): Implement.
25260         (attribute_target): Implement.
25261         (attribute_target_specifier, opt_target_specifier): Implement
25262         (CheckAttributeTarget): New method to check if the attribute target
25263         is valid.
25264         (attribute_section): Implement.
25265         (opt_attributes): Implement.
25266
25267         * attribute.cs : New file to handle attributes.
25268         (Attribute): Class to hold attribute info.
25269
25270         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25271         (attribute_section): Modify production to use 2 different rules to 
25272         achieve the same thing. 1 s/r conflict down !
25273         Clean out commented, useless, non-reducing dimension_separator rules.
25274
25275         * class.cs (TypeContainer.attributes): New member to hold list
25276         of attributes for a type.
25277         (Struct::Struct): Modify to take one more argument, the attribute list.
25278         (Class::Class): Ditto.
25279         (Field::Field): Ditto.
25280         (Method::Method): Ditto.
25281         (Property::Property): Ditto.
25282
25283         * cs-parser.jay (struct_declaration): Update constructor call to
25284         pass in the attributes too.
25285         (class_declaration): Ditto.
25286         (constant_declaration): Ditto.
25287         (field_declaration): Ditto.
25288         (method_header): Ditto.
25289         (fixed_parameter): Ditto.
25290         (parameter_array): Ditto.
25291         (property_declaration): Ditto.
25292
25293         * constant.cs (Constant::Constant): Update constructor similarly.
25294         Use System.Collections.
25295
25296         * parameter.cs (Parameter::Parameter): Update as above.
25297
25298 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25299
25300         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25301         (TypeContainer.delegates): New member to hold list of delegates.
25302
25303         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25304         this time as I seem to be on crack ;-)
25305
25306 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25307
25308         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25309         tell whether an identifier represents a namespace.
25310
25311         * expression.cs (NamespaceExpr): A namespace expression, used only
25312         temporarly during expression resolution.
25313         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25314         utility functions to resolve names on expressions.
25315
25316 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25317
25318         * codegen.cs: Add hook for StatementExpressions. 
25319
25320         * class.cs: Fix inverted test for static flag in methods.
25321
25322 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25323
25324         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25325         to make it coincide with MS' number.
25326         (Operator::CheckBinaryOperator): Ditto.
25327
25328         * ../errors/errors.txt : Remove error numbers added earlier.
25329
25330         * ../errors/cs1019.cs : Test case for error # 1019
25331
25332         * ../errros/cs1020.cs : Test case for error # 1020
25333
25334         * cs-parser.jay : Clean out commented cruft.
25335         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25336         used anywhere - non-reducing rule.
25337         (namespace_declarations): Non-reducing rule - comment out.
25338
25339         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25340         with TypeContainer::AddEnum.
25341
25342         * delegate.cs : New file for delegate handling classes.
25343         (Delegate): Class for declaring delegates.
25344
25345         * makefile : Update.
25346
25347         * cs-parser.jay (delegate_declaration): Implement.
25348
25349 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25350
25351         * class.cs (Event::Define): Implement.
25352         (Event.EventBuilder): New member.
25353
25354         * class.cs (TypeContainer::Populate): Update to define all enums and events
25355         we have.
25356         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25357         readonly fields for all these cases ?
25358
25359 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25360
25361         * class.cs (Property): Revamp to use the convention of making fields readonly.
25362         Accordingly modify code elsewhere.
25363
25364         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25365         the Define method of the Property class.
25366
25367         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25368         trivial bug.
25369         (TypeContainer::Populate): Update to define all the properties we have. Also
25370         define all enumerations.
25371
25372         * enum.cs (Define): Implement.
25373
25374 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25375
25376         * cs-parser.jay (overloadable_operator): The semantic value is an
25377         enum of the Operator class.
25378         (operator_declarator): Implement actions.
25379         (operator_declaration): Implement.
25380
25381         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25382         validity of definitions.
25383         (Operator::CheckBinaryOperator): Static method to check for binary operators
25384         (TypeContainer::AddOperator): New method to add an operator to a type.
25385
25386         * cs-parser.jay (indexer_declaration): Added line to actually call the
25387         AddIndexer method so it gets added ;-)
25388
25389         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25390         already taken care of by the MS compiler ?  
25391
25392 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25393
25394         * class.cs (Operator): New class for operator declarations.
25395         (Operator::OpType): Enum for the various operators.
25396
25397 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25398
25399         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25400         ostensibly handle this in semantic analysis.
25401
25402         * cs-parser.jay (general_catch_clause): Comment out
25403         (specific_catch_clauses, specific_catch_clause): Ditto.
25404         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25405         (catch_args, opt_catch_args): New productions.
25406         (catch_clause): Rewrite to use the new productions above
25407         (catch_clauses): Modify accordingly.
25408         (opt_catch_clauses): New production to use in try_statement
25409         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25410         and re-write the code in the actions to extract the specific and
25411         general catch clauses by being a little smart ;-)
25412
25413         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25414         Hooray, try and catch statements parse fine !
25415
25416 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25417
25418         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25419         string from the hashtable of variables.
25420
25421         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25422         I end up making that mistake ;-)
25423         (catch_clauses): Fixed gross error which made Key and Value of the 
25424         DictionaryEntry the same : $1 !!
25425
25426 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25427
25428         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25429
25430         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25431         when the add and remove accessors are specified. 
25432
25433 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25434
25435         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25436         information about indexer_declarator.
25437         (indexer_declarator): Implement actions.
25438         (parsing_indexer): New local boolean used to keep track of whether
25439         we are parsing indexers or properties. This is necessary because 
25440         implicit_parameters come into picture even for the get accessor in the 
25441         case of an indexer.
25442         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25443
25444         * class.cs (Indexer): New class for indexer declarations.
25445         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25446         (TypeContainer::indexers): New member to hold list of indexers for the
25447         type.
25448
25449 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25450
25451         * cs-parser.jay (add_accessor_declaration): Implement action.
25452         (remove_accessor_declaration): Implement action.
25453         (event_accessors_declaration): Implement
25454         (variable_declarators): swap statements for first rule - trivial.
25455
25456         * class.cs (Event): New class to hold information about event
25457         declarations.
25458         (TypeContainer::AddEvent): New method to add an event to a type
25459         (TypeContainer::events): New member to hold list of events.
25460
25461         * cs-parser.jay (event_declaration): Implement actions.
25462
25463 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25464
25465         * cs-parser.jay (dim_separators): Implement. Make it a string
25466         concatenating all the commas together, just as they appear.
25467         (opt_dim_separators): Modify accordingly
25468         (rank_specifiers): Update accordingly. Basically do the same
25469         thing - instead, collect the brackets here.
25470         (opt_rank_sepcifiers): Modify accordingly.
25471         (array_type): Modify to actually return the complete type string
25472         instead of ignoring the rank_specifiers.
25473         (expression_list): Implement to collect the expressions
25474         (variable_initializer): Implement. We make it a list of expressions
25475         essentially so that we can handle the array_initializer case neatly too.
25476         (variable_initializer_list): Implement.
25477         (array_initializer): Make it a list of variable_initializers
25478         (opt_array_initializer): Modify accordingly.
25479
25480         * expression.cs (New::NType): Add enumeration to help us
25481         keep track of whether we have an object/delegate creation
25482         or an array creation.
25483         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25484         members to hold data about array creation.
25485         (New:New): Modify to update NewType
25486         (New:New): New Overloaded contructor for the array creation
25487         case.
25488
25489         * cs-parser.jay (array_creation_expression): Implement to call
25490         the overloaded New constructor.
25491
25492 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25493
25494         * class.cs (TypeContainer::Constructors): Return member
25495         constructors instead of returning null.
25496
25497 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25498
25499         * typemanager.cs (InitCoreTypes): Initialize the various core
25500         types after we have populated the type manager with the user
25501         defined types (this distinction will be important later while
25502         compiling corlib.dll)
25503
25504         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25505         on Expression Classification.  Now all expressions have a method
25506         `Resolve' and a method `Emit'.
25507
25508         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25509         generation from working.     Also add some temporary debugging
25510         code. 
25511
25512 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25513
25514         * codegen.cs: Lots of code generation pieces.  This is only the
25515         beginning, will continue tomorrow with more touches of polish.  We
25516         handle the fundamentals of if, while, do, for, return.  Others are
25517         trickier and I need to start working on invocations soon.
25518
25519         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25520         s.InitStatement. 
25521
25522         * codegen.cs (EmitContext): New struct, used during code
25523         emission to keep a context.   Most of the code generation will be
25524         here. 
25525
25526         * cs-parser.jay: Add embedded blocks to the list of statements of
25527         this block.  So code generation proceeds in a top down fashion.
25528
25529 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25530
25531         * statement.cs: Add support for multiple child blocks.
25532
25533 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25534
25535         * codegen.cs (EmitCode): New function, will emit the code for a
25536         Block of code given a TypeContainer and its ILGenerator. 
25537
25538         * statement.cs (Block): Standard public readonly optimization.
25539         (Block::Block constructors): Link children. 
25540         (Block::Child): Child Linker.
25541         (Block::EmitVariables): Emits IL variable declarations.
25542
25543         * class.cs: Drop support for MethodGroups here, delay until
25544         Semantic Analysis.
25545         (Method::): Applied the same simplification that I did before, and
25546         move from Properties to public readonly fields.
25547         (Method::ParameterTypes): Returns the parameter types for the
25548         function, and implements a cache that will be useful later when I
25549         do error checking and the semantic analysis on the methods is
25550         performed.
25551         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25552         and made a method, optional argument tells whether this is a class
25553         or a structure to apply the `has-this' bit.
25554         (Method::GetCallingConvention): Implement, returns the calling
25555         convention. 
25556         (Method::Define): Defines the type, a second pass is performed
25557         later to populate the methods.
25558
25559         (Constructor::ParameterTypes): implement a cache similar to the
25560         one on Method::ParameterTypes, useful later when we do semantic
25561         analysis. 
25562
25563         (TypeContainer::EmitMethod):  New method.  Emits methods.
25564
25565         * expression.cs: Removed MethodGroup class from here.
25566
25567         * parameter.cs (Parameters::GetCallingConvention): new method.
25568
25569 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25570
25571         * class.cs (TypeContainer::Populate): Drop RootContext from the
25572         argument. 
25573
25574         (Constructor::CallingConvention): Returns the calling convention.
25575         (Constructor::ParameterTypes): Returns the constructor parameter
25576         types. 
25577
25578         (TypeContainer::AddConstructor): Keep track of default constructor
25579         and the default static constructor.
25580
25581         (Constructor::) Another class that starts using `public readonly'
25582         instead of properties. 
25583
25584         (Constructor::IsDefault): Whether this is a default constructor. 
25585
25586         (Field::) use readonly public fields instead of properties also.
25587
25588         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25589         track of static constructors;  If none is used, turn on
25590         BeforeFieldInit in the TypeAttributes. 
25591
25592         * cs-parser.jay (opt_argument_list): now the return can be null
25593         for the cases where there are no arguments. 
25594
25595         (constructor_declarator): If there is no implicit `base' or
25596         `this', then invoke the default parent constructor. 
25597
25598         * modifiers.cs (MethodAttr): New static function maps a set of
25599         modifiers flags into a MethodAttributes enum
25600         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25601         MethodAttr, TypeAttr to represent the various mappings where the
25602         modifiers are used.
25603         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25604
25605 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25606
25607         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25608         method arguments.
25609
25610         * interface.cs (PopulateIndexer): Implemented the code generator
25611         for interface indexers.
25612
25613 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25614
25615         * interface.cs (InterfaceMemberBase): Now we track the new status
25616         here.  
25617
25618         (PopulateProperty): Implement property population.  Woohoo!  Got
25619         Methods and Properties going today. 
25620
25621         Removed all the properties for interfaces, and replaced them with
25622         `public readonly' fields. 
25623
25624 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25625
25626         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25627         initialize their hashtables/arraylists only when they are needed
25628         instead of doing this always.
25629
25630         * parameter.cs: Handle refs and out parameters.
25631
25632         * cs-parser.jay: Use an ArrayList to construct the arguments
25633         instead of the ParameterCollection, and then cast that to a
25634         Parameter[] array.
25635
25636         * parameter.cs: Drop the use of ParameterCollection and use
25637         instead arrays of Parameters.
25638
25639         (GetParameterInfo): Use the Type, not the Name when resolving
25640         types. 
25641
25642 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25643
25644         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25645         and instead use public readonly fields.
25646
25647         * class.cs: Put back walking code for type containers.
25648
25649 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25650
25651         * class.cs (MakeConstant): Code to define constants.
25652
25653         * rootcontext.cs (LookupType): New function.  Used to locate types 
25654
25655
25656 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25657
25658         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25659         this System.Reflection code is.  Kudos to Microsoft
25660
25661         * typemanager.cs: Implement a type cache and avoid loading all
25662         types at boot time.  Wrap in LookupType the internals.  This made
25663         the compiler so much faster.  Wow.  I rule!
25664
25665         * driver.cs: Make sure we always load mscorlib first (for
25666         debugging purposes, nothing really important).
25667
25668         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25669         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25670
25671         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25672         on namespaces that have been imported using the `using' keyword.
25673
25674         * class.cs (TypeContainer::TypeAttr): Virtualize.
25675         (Class::TypeAttr): Return attributes suitable for this bad boy.
25676         (Struct::TypeAttr): ditto.
25677         Handle nested classes.
25678         (TypeContainer::) Remove all the type visiting code, it is now
25679         replaced with the rootcontext.cs code
25680
25681         * rootcontext.cs (GetClassBases): Added support for structs. 
25682
25683 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25684
25685         * interface.cs, statement.cs, class.cs, parameter.cs,
25686         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25687         Drop use of TypeRefs, and use strings instead.
25688
25689 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25690
25691         * rootcontext.cs: 
25692
25693         * class.cs (Struct::Struct): set the SEALED flags after
25694         checking the modifiers.
25695         (TypeContainer::TypeAttr): new property, returns the
25696         TypeAttributes for a class.  
25697
25698         * cs-parser.jay (type_list): Oops, list production was creating a
25699         new list of base types.
25700
25701         * rootcontext.cs (StdLib): New property.
25702         (GetInterfaceTypeByName): returns an interface by type name, and
25703         encapsulates error handling here.
25704         (GetInterfaces): simplified.
25705         (ResolveTree): Encapsulated all the tree resolution here.
25706         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25707         types. 
25708
25709         * driver.cs: Add support for --nostdlib, to avoid loading the
25710         default assemblies.
25711         (Main): Do not put tree resolution here. 
25712
25713         * rootcontext.cs: Beginning of the class resolution.
25714
25715 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25716
25717         * rootcontext.cs: Provide better error reporting. 
25718
25719         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25720
25721         * rootcontext.cs (CreateInterface): Handle the case where there
25722         are no parent interfaces.
25723
25724         (CloseTypes): Routine to flush types at the end.
25725         (CreateInterface): Track types.
25726         (GetInterfaces): Returns an array of Types from the list of
25727         defined interfaces.
25728
25729         * typemanager.c (AddUserType): Mechanism to track user types (puts
25730         the type on the global type hash, and allows us to close it at the
25731         end). 
25732
25733 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25734
25735         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25736         RecordInterface instead.
25737
25738         * cs-parser.jay: Updated to reflect changes above.
25739
25740         * decl.cs (Definition): Keep track of the TypeBuilder type that
25741         represents this type here.  Not sure we will use it in the long
25742         run, but wont hurt for now.
25743
25744         * driver.cs: Smaller changes to accomodate the new code.
25745
25746         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25747         when done. 
25748
25749         * rootcontext.cs (CreateInterface):  New method, used to create
25750         the System.TypeBuilder type for interfaces.
25751         (ResolveInterfaces): new entry point to resolve the interface
25752         hierarchy. 
25753         (CodeGen): Property, used to keep track of the code generator.
25754
25755 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25756
25757         * cs-parser.jay: Add a second production for delegate_declaration
25758         with `VOID'.
25759
25760         (enum_body): Put an opt_comma here instead of putting it on
25761         enum_body or enum_member_declarations so we can handle trailing
25762         commas on enumeration members.  Gets rid of a shift/reduce.
25763
25764         (type_list): Need a COMMA in the middle.
25765
25766         (indexer_declaration): Tell tokenizer to recognize get/set
25767
25768         * Remove old targets.
25769
25770         * Re-add the parser target.
25771
25772 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25773
25774         * cs-parser.jay: Add precendence rules for a number of operators
25775         ot reduce the number of shift/reduce conflicts in the grammar.
25776
25777 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25778
25779         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25780         and put it here.
25781
25782         Get rid of old crufty code.
25783
25784         * rootcontext.cs: Use this to keep track of the parsed
25785         representation and the defined types available to the program. 
25786
25787         * gen-treedump.cs: adjust for new convention.
25788
25789         * type.cs: Split out the type manager, and the assembly builder
25790         from here. 
25791
25792         * typemanager.cs: the type manager will live here now.
25793
25794         * cil-codegen.cs: And the code generator here. 
25795
25796 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25797
25798         * makefile: Fixed up for easy making.
25799
25800 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25801
25802         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25803         the 
25804
25805         (unary_expression): Expand pre_increment_expression and
25806         post_decrement_expression to reduce a shift/reduce.
25807
25808 2001-07-11  Simon Cozens
25809
25810         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25811
25812         Improve allow_keyword_as_indent name.
25813
25814 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25815
25816         * Adjustments for Beta2. 
25817
25818 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25819
25820         * decl.cs: Added `Define' abstract method.
25821         (InTransit): new property, used to catch recursive definitions. 
25822
25823         * interface.cs: Implement `Define'. 
25824
25825         * modifiers.cs: Map Modifiers.constants to
25826         System.Reflection.TypeAttribute flags.
25827
25828         * class.cs: Keep track of types and user-defined types.
25829         (BuilderInit): New method for creating an assembly
25830         (ResolveType): New function to launch the resolution process, only
25831         used by interfaces for now.
25832
25833         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25834         that are inserted into the name space. 
25835
25836 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25837
25838         * ARGH.  I have screwed up my tree so many times due to the use of
25839         rsync rather than using CVS.  Going to fix this at once. 
25840
25841         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25842         load types.
25843
25844 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25845
25846         * Experiment successful: Use System.Type rather that our own
25847         version of Type.  
25848
25849 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25850
25851         * cs-parser.jay: Removed nsAliases from here.
25852
25853         Use new namespaces, handle `using XXX;' 
25854
25855         * namespace.cs: Reimplemented namespace handling, use a recursive
25856         definition of the class.  Now we can keep track of using clauses
25857         and catch invalid using clauses.
25858
25859 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25860
25861         * gen-treedump.cs: Adapted for all the renaming.
25862
25863         * expression.cs (Expression): this class now has a Type property
25864         which returns an expression Type.
25865
25866         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25867         `Type', as this has a different meaning now in the base
25868
25869 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25870
25871         * interface.cs, class.cs: Removed from all the sources the
25872         references to signature computation, as we can not do method
25873         signature computation during the parsing time, as we are not
25874         trying to solve at that point distinguishing:
25875
25876         class X {
25877                 void a (Blah x) {}
25878                 void a (NS.Blah x) {}
25879         }
25880
25881         Which depending on the context might be valid or not, as we do not
25882         know if Blah is the same thing as NS.Blah at that point.
25883
25884         * Redid everything so the code uses TypeRefs now instead of
25885         Types.  TypeRefs are just temporary type placeholders, that need
25886         to be resolved.  They initially have a pointer to a string and the
25887         current scope in which they are used.  This is used later by the
25888         compiler to resolve the reference to an actual Type. 
25889
25890         * DeclSpace is no longer a CIR.Type, and neither are
25891         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25892         are all DeclSpaces, but no Types. 
25893
25894         * type.cs (TypeRefManager): This implements the TypeRef manager,
25895         which keeps track of all the types that need to be resolved after
25896         the parsing has finished. 
25897
25898 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25899
25900         * ARGH.  We are going to have to store `foreach' as a class rather
25901         than resolving it, as we need to verify error 1579 after name
25902         resolution.   *OR* we could keep a flag that says `This request to
25903         IEnumerator comes from a foreach statement' which we can then use
25904         to generate the error.
25905
25906 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25907
25908         * class.cs (TypeContainer.AddMethod): we now add methods to the
25909         MethodGroup instead of the method hashtable.  
25910
25911         * expression.cs: Add MethodGroup abstraction, which gets us one
25912         step closer to the specification in the way we handle method
25913         declarations.  
25914
25915         * cs-parser.jay (primary_expression): qualified_identifier now
25916         tried to match up an identifier to a local variable reference or
25917         to a parameter reference.
25918
25919         current_local_parameters is now a parser global variable that
25920         points to the current parameters for the block, used during name
25921         lookup.
25922
25923         (property_declaration): Now creates an implicit `value' argument to
25924         the set accessor.
25925
25926 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25927
25928         * parameter.cs: Do not use `param' arguments as part of the
25929         signature, per the spec.
25930
25931 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25932
25933         * decl.cs: Base class for classes, structs and interfaces.  This
25934         is the "Declaration Space" 
25935
25936         * cs-parser.jay: Use CheckDef for checking declaration errors
25937         instead of having one on each function.
25938
25939         * class.cs: Factor out some code for handling error handling in
25940         accordance to the "Declarations" section in the "Basic Concepts"
25941         chapter in the ECMA C# spec.
25942
25943         * interface.cs: Make all interface member classes derive from
25944         InterfaceMemberBase.
25945
25946 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25947
25948         * Many things: all interfaces are parsed and generated in
25949         gen-treedump.  Support for member variables, constructors,
25950         destructors, properties, constants is there.
25951
25952         Beginning of the IL backend, but very little done, just there for
25953         testing purposes. 
25954
25955 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25956
25957         * cs-parser.jay: Fix labeled statement.
25958
25959         * cs-tokenizer.cs (escape): Escape " and ' always.
25960         ref_line, ref_name: keep track of the line/filename as instructed
25961         by #line by the compiler.
25962         Parse #line.
25963
25964 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25965
25966         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25967         to match the values in System.CodeDOM.
25968
25969         Divid renamed to Divide.
25970
25971         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25972         statements. 
25973         (Statements.set): remove.
25974
25975         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25976         statements. 
25977
25978         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25979         falseStatements always have valid values. 
25980
25981         * cs-parser.jay: Use System.CodeDOM now.
25982