In mcs:
[mono.git] / mcs / gmcs / ChangeLog
1 2006-05-11  Raja R Harinath  <rharinath@novell.com>
2
3         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
5         (FlowBranchingException.Label): Likewise.
6
7         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8         given value.
9         (MyBitVector.Or): Use it to avoid losing information (Count).
10         (FlowBranching.MergeOrigins): Likewise.
11
12         * flowanalysis.cs (UsageVector.IsDirty): Remove.
13         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
14         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
15         (UsageVector.ToString): Simplify.
16         (UsageVector.MergeSiblings): Move here from ...
17         (FlowBranching.Merge): ... here.
18         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
19         not a MyBitVector.
20
21 2006-05-10  Raja R Harinath  <rharinath@novell.com>
22
23         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
24         null bitvector is treated as all-true.
25
26         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
27         (MyBitVector): Rationalize invariants.  'vector != null' implies
28         that we have our own copy of the bitvector.  Otherwise,
29         'InheritsFrom == null' implies all inherited bits are true.
30
31 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
32
33         * statement.cs (LocalInfo): Add IsConstant.
34         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
35         local variable for constants.
36
37 2006-05-09  Raja R Harinath  <rharinath@novell.com>
38
39         * flowanalysis.cs (MyBitVector.Empty): New.
40         (MyBitVector): Don't allow InheritedFrom to be null.
41         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
42         (UsageVector, FlowBranching): Update to changes.
43
44         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
45         recursion.  The 'Parent == null' condition isn't sufficient for
46         anonymous methods.
47         (FlowBranching.AddBreakOrigin): Likewise.
48         (FlowBranching.AddContinueOrigin): Likewise.
49         (FlowBranching.AddReturnOrigin): Likewise.
50         (FlowBranching.StealFinallyClauses): Likewise.
51         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
52         (FlowBranching.CheckOutParameters): Likewise.
53         (FlowBranchingToplevel): Terminate all the above recursions here.
54         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
55         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
56
57         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
58         toplevel block.
59         (FlowBranchingToplevel): New.  Empty for now.
60         (FlowBranching.MergeTopBlock): Update.
61         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
62         branching for the anonymous delegate.
63         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
64
65         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
66         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
67         information at the start of the merge.  Reorganize.
68
69 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
70
71         * class.cs (MethodData.Define): Method cannot implement interface accessor.
72
73 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
74
75         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
76         to newly introduced ctor.
77
78         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
79         message to one place.
80         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
81         global namespace.
82
83 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
84
85         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
86
87         * ecore.cs (Expression.ResolveAsConstant): Updated.
88
89         * statement.cs (ResolveMeta): Updated.
90
91 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
92
93         * cs-parser.jay: __arglist cannot be used in initializer.
94
95 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
96
97         A fix for #77879
98         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
99         private types.
100
101 2006-05-05  Raja R Harinath  <rharinath@novell.com>
102
103         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
104         (LabeledStatement): Add 'name' parameter.
105         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
106         (Block.AddLabel): Update to changes.
107         * cs-parser.jay (labeled_statement): Likewise.
108
109         * flowanalysis.cs (BranchingType.Labeled): New.
110         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
111         (FlowBranchingLabeled): New.  Does nothing for now, but will
112         eventually handle 'goto' flows.
113         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
114         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
115         that's terminated ...
116         (Block.Resolve): ... here.
117
118         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
119         (UsageVector.MergeFinallyOrigins): Likewise.
120         (FlowBranching.InTryOrCatch): Likewise.
121         (FlowBranching.AddFinallyVector): Likewise.
122         (FlowBranchingException): Update to changes.
123
124         Fix #78290
125         * statement.cs (Return.Resolve): Move error checking to ...
126         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
127         (FlowBranchingException): Handle return origins like break and
128         continue origins.
129         (FlowBranching.UsageVector.CheckOutParameters): Remove.
130
131 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
132
133         A fix for #76122
134         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
135         filter.
136
137 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
138
139         A fix for #77543
140         * class.cs (MethodData.Define): Do public accessor check only when method
141         implements an interface.
142
143 2006-05-04  Raja R Harinath  <rharinath@novell.com>
144
145         Remove special handling of 'break'
146         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
147         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
148         (UsageVector.Break): Remove.
149         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
150         reachability.
151         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
152
153         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
154         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
155
156 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
157
158         A fix for #75726
159         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
160         be the interface member.
161
162 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
163
164         A fix for #60069
165         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
166         for emitting small (int) values.
167
168 2006-05-03  Raja R Harinath  <rharinath@novell.com>
169
170         Fix #59427
171         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
172         control-flow passes through the 'finally' after merging-in all the
173         control-flows from 'try' and the 'catch' clauses.
174
175         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
176         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
177         always true at the only non-recursive entry point.
178         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
179         FlowBranchingBreakable.
180         (FlowBranchingLoop): Remove.
181         * statement.cs (Return.DoResolve): Update to changes.
182
183         Fix #76471, #76665
184         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
185         (FlowBranching.CreateBranching): Handle it: create a
186         FlowBranchingContinuable.
187         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
188         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
189         except that it handles the 'continue' command.
190         (FlowBranching.UsageVector.MergeOrigins): Rename from
191         MergeBreakOrigins.
192         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
193         except that it overrides AddContinueOrigin.
194         (FlowBranchingException): Override AddContinueOrigin, similar to
195         AddBreakOrigin.
196         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
197         Create a new branching around the embedded statement.
198         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
199         control flow after the embedded statement.
200         (Continue.Resolve): Move all error checking to AddContinueOrigin.
201
202         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
203         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
204         FlowBranchingBreakable.
205         (FlowBranchingSwitch): Remove.
206
207         Fix test-503.cs
208         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
209         error reporting to ...
210         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
211         Rename from 'AddBreakVector'.  Add new location argument.  Return
212         a bool indicating whether the 'break' crosses an unwind-protect.
213         (FlowBranchingException.AddBreakOrigin): Add.
214         (FlowBranchingException.Merge): Propagate 'break's to surrounding
215         flowbranching after updating with the effects of the 'finally'
216         clause.
217         (FlowBranchingBreakable): New common base class for
218         FlowBranchingLoop and FlowBranchingSwitch.
219
220         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
221         embedded statement.
222         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
223
224 2006-05-02  Raja R Harinath  <rharinath@novell.com>
225
226         * statement.cs (Do.Resolve): If the loop is infinite, set the
227         barrier.
228         (While.Resolve, For.Resolve): Set a barrier after the embedded
229         statement.  There's no direct control flow that goes from the end
230         of the embedded statement to the end of the loop.
231         * flowanalysis.cs (FlowBranching.Infinite): Remove.
232         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
233         above ensure that the reachability is correctly computed.
234
235         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
236         (UsageVector.MergeBreakOrigins): If the current path is
237         unreachable, treat it as if all parameters/locals are initialized.
238         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
239         infinite loops before merging-in break origins.
240
241         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
242         (Reachability.Reachable): Split part into ...
243         (Reachability.Unreachable): ... this.  Simplify.
244         (Reachability.IsUnreachable): Use 'Unreachable' instead.
245
246         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
247         (Reachability.SetThrowsSometimes): Likewise.
248         (FlowBranchingBlock.MergeTopBlock): Don't compare against
249         TriState.Always, use corresponding property.
250         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
251         (Block.Resolve): Likewise.  Remove some redundant checks.
252
253 2006-05-02  Raja R Harinath  <harinath@gmail.com>
254
255         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
256         (Reachability.Meet): Don't bother checking AlwaysThrows --
257         barrier is always set.
258         (FlowBranchingBlock.Merge): Likewise.
259
260 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
261
262         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
263         defined, so it's references should also compile only for NET_2_0
264         (as occurs in mcs version)
265
266 2006-05-01  Raja R Harinath  <harinath@gmail.com>
267
268         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
269         checks for unreachable.
270
271 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
272
273         A fix for #77980
274         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
275
276         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
277         whether field is really assigned.
278
279 2006-04-30  Raja R Harinath  <harinath@gmail.com>
280
281         * flowanalysis.cs (Reachability): Make 4-argument constructor
282         private.
283         (Reachability.Meet): Rename from 'And'.  Remove static variant.
284         (Reachability.Always): Rename from the highly misleading
285         'Reachability.Never'.
286         (FlowBranching.Merge): Update to changes.  Mark an impossible
287         situation with a 'throw'.
288         (*): Update to changes.
289
290 2006-04-29  Raja R Harinath  <harinath@gmail.com>
291
292         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
293         Remove 'Undefined'.
294         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
295         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
296         (*): Update to changes.
297         * statement.cs: Update to changes.
298
299 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
300
301         A fix for #78049
302         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
303
304 2006-04-28  Raja R Harinath  <harinath@gmail.com>
305
306         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
307         dummy UsageVector.
308
309         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
310         argument to two arguments: an usage-vector and a bool.  Move call
311         to FlowBranching.Merge () ...
312         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
313
314         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
315         handling of loop and switch reachability to ...
316         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
317
318 2006-04-27  Raja R Harinath  <harinath@gmail.com>
319
320         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
321         handling to FlowBranchingLoop.InLoop.
322         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
323
324 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
325
326         A fix for #78115
327         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
328         anonymous method is allowed from AnonymousContainer here.
329
330         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
331
332 2006-04-24  Raja R Harinath  <rharinath@novell.com>
333
334         Fix #78156
335         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
336
337 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
338
339         A fix for #49011.
340         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
341         (DoubleConstant.Reduce): Ditto.
342
343 2006-04-23  Raja R Harinath  <rharinath@novell.com>
344
345         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
346         Remove 'lvalue_right_side' argument.  Move parts to ...
347         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
348         (LocalVariable.DoResolveLValue): ... these.
349
350 2006-04-21  Raja R Harinath  <rharinath@novell.com>
351
352         Fix cs1655.cs
353         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
354         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
355         (LocalVariableReference.DoResolveBase): Use it to implement new
356         CS1655 check.
357         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
358         (Argument.Resolve): Simplify.  Move CS1510 check ...
359         * ecore.cs (Expression.ResolveLValue): ... here.
360         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
361         (PropertyExpr.DoResolveLValue): Likewise.
362         (FieldExpr.Report_AssignToReadonly): Likewise.
363         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
364         LValueMemberAccess or LValueMemberOutAccess on instance depending
365         on it.
366         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
367         DoResolve as appropriate.
368
369 2006-04-20  Raja R Harinath  <rharinath@novell.com>
370
371         Fix #75800
372         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
373         implicit conversions on 'out' and 'ref' arguments.
374
375         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
376         improve clarity.  Remove dead code.
377
378         Fix #66031
379         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
380         (Catch.Resolve): Resolve VarBlock if it exists.
381
382 2006-04-19  Miguel de Icaza  <miguel@novell.com>
383
384         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
385         twice, this was some residual code, the enumerator was emitted
386         properly in the two branche of if later.
387
388         Fixes #78031
389         
390         Thanks to Martin for finding the source of the problem
391         
392 2006-04-19  Raja R Harinath  <rharinath@novell.com>
393
394         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
395         cast is never an lvalue.
396         (Cast.DoResolve, Cast.ResolveRest): Combine.
397         (Argument.Emit): Simplify slightly.  Move 'Expr is
398         IMemoryLocation' check ...
399         (Argument.Resolve): ... here.
400         (Argument.Error_LValueRequired): Remove.  Inline into only user.
401
402         Simplifications.  Fix cs0191-2.cs
403         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
404         CS1649 and CS1651 to ...
405         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
406         the actual selection of the error code and message to a lookup
407         table.  Add a dummy return value to simplify callsites.
408         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
409         readonly fields of other instances of the same type.  Move CS0197
410         warning from ...
411         * expression.cs (Argument.Resolve): ... here.  Simplify code.
412         Ensure that ec.InRefOutArgumentResolving is only set during LValue
413         resolution of an out or ref argument.  The code simplification
414         above uses this invariant.
415
416 2006-04-18  Raja R Harinath  <rharinath@novell.com>
417
418         Possibly fix #77752.  Fix cs1690-[4-7].cs.
419         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
420         CheckMarshallByRefAccess.  Drop parameter.
421         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
422         warning.
423         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
424         InstanceExpression.
425         * report.cs (AllWarnings): Add CS1690.
426         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
427         for ref access too.
428         (LocalVariableReference.DoResolveBase): Update.
429
430 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
431
432         * class.cs (MethodOrOperator): Moved common parts from method class.
433         detect obsolete attributes.
434         (Method.Define): Simplified as it reuses code from base.
435         (Constructor.ValidAttributeTargets): Fixed issue found during
436         refactoring.
437         (Destructor.ValidAttributeTargets): Fixed issue found during
438         refactoring.
439         (Operator): Finished refactoring set off by #78020. Operator class is now
440         ordinary method class.
441
442         * anonymous.cs: Updated.
443
444 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
445
446         * class.cs (Constructor.Emit): Don't emit the attributes twice.
447
448 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
449
450         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
451         detect obsolete attributes.
452         (Method.CreateEmitContext): Moved to MethodOrOperator.
453
454 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
455
456         A fix for #78048.
457         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
458         customized exception to make crash detection easier.
459         (MethodOrOperator): Started to work on new base class for methods and
460         operators.
461         (Method): Derives from MethodOrOperator.
462         (Constructor.Emit): Emits its own attributes.
463         (AbstractPropertyEventMethod.Emit): Ditto.
464         (Operator): Derives from MethodOrOperator, will refactor fully in extra
465         patch.
466         (Operator.Emit): It's temporary more tricky than should be.
467         
468         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
469
470         * report.cs (InternalErrorException): Add ctor with inner exception.
471
472 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
473
474         A fix for #76744.
475         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
476         only not visible.
477
478 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
479
480         A fix for #77916.
481         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
482         array.
483
484 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
485
486         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
487         attribute is present and Guid not.
488         (Interface.ApplyAttributeBuilder): Ditto.
489
490         * attribute.cs: Add error message.
491
492 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
493
494         A fix for #78020.
495
496         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
497         sources (it's composite) so hold them in extra array as they are used in
498         Emit phase only. It worked in the previous versions by mistake.
499         (Attribute.Emit): Emit attribute for more owners when exist.
500
501         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
502         it has now different behaviour.
503
504 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
505
506         * constant.cs (Constant.IsDefaultInitializer): New method.
507
508         * class.cs: Updated.
509
510         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
511         re-initialize default values. It saves KBs almost for every assembly.
512         Thanks Zoltan for the idea.
513         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
514         (ArrayCreation.DoResolve): Resolve only once.
515         (ArrayCreation.Emit): Emit static initializer only when it is faster.
516         (ArrayCreation.GetAttributableValue): Cope with optimized values.
517
518 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
519
520         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
521         From #77961.
522
523 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
524
525         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
526         in an embedded statement too.
527
528 2006-04-01  Raja R Harinath  <rharinath@novell.com>
529
530         Fix #77929
531         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
532         testing.
533
534         Fix #77958
535         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
536
537         Fix #77962
538         * report.cs (SymbolRelatedToPreviousError): Drop generic type
539         arguments before checking whether a type is reflected or not.
540
541         Fix #77954
542         * expression.cs (Invocation.IsApplicable): Ensure a generic method
543         definition doesn't take part in overload resolution.
544         (Invocation.IsParamsMethodApplicable): Likewise.
545         (Invocation.OverloadResolve): When replacing a reflected override
546         method with its base definition, ensure that type arguments are
547         applied.
548
549 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
550
551         A fix for #77966.
552
553         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
554         was not specified.
555
556         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
557
558 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
559
560         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
561         phase.
562
563         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
564         LocalTemporary change.
565
566         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
567         TypeContainer.
568         (ClassOrStruct.DefineFieldInitializers): Implemented static field
569         initializers optimization.
570         (ClassOrStruct.TypeAttr): Moved from modifiers.
571         (Constructor.CheckBase): Don't crash when static ctor has parameters.
572         (FieldBase.ResolveInitializer): Resolves initializer.
573         (FieldBase.HasDefaultInitializer): New property.
574
575         * cs-parser.jay: Removed message.
576
577         * expression.cs (CompilerGeneratedThis): New specialization.
578
579         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
580
581 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
582
583         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
584
585 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
586
587         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
588         be now EnumConstants only.
589
590 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
591
592         * attribute.cs, driver.cs: Reset more caches.
593
594 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
595
596         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
597
598 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
599
600         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
601         for easier reuse. Updated all overrides.
602         (IntegralConstant): New base class for all integral constants.
603         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
604         of the constant range, report custom error.
605         (UIntConstant.Reduce): Fixed uint conversion.
606
607         * ecore.cs, literal.cs: Reduce updates.
608
609 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
610
611         A fix for #75813.
612
613         * class.cs (Constructor.Define): Removed extra if for default ctors.
614         A patch from Atsushi Enomoto.
615
616 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
617
618         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
619         GetAttributableValue.
620
621         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
622         when required.
623
624         * convert.cs (ImplicitConversionRequired): Error message moved to
625         DoubleLiteral.
626
627         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
628         automatic implicit conversion of an output value.
629         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
630
631         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
632         conversion.
633         (TypeOf.GetAttributableValue): Add extra handling for object type.
634
635         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
636         special error message.
637
638 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
639
640         * class.cs (Constructor.Emit): Don't crash when struct ctor is
641         InternalCall.
642         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
643         compatible with MS runtime.
644
645 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
646
647         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
648         attribute arguments here.
649
650         * class.cs (Indexer.Define): The check was moved to attribute class.
651
652 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
653
654         * expression.cs (StringConcat.Append): Reverted back to no warning state.
655
656 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
657
658         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
659
660         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
661         the blocks too.
662
663 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
664
665         * doc-bootstrap.cs : fix build.
666
667 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
668
669         * expression.cs (StringConcat.Append): Issue a warning when empty string
670         is going to append.
671
672 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
673
674         * assign.cs (CompoundAssign.ResolveSource): Removed.
675
676         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
677         clean up.
678
679         * class.cs (TypeContainer.FindMethods): Removed.
680         (TypeContainer.CheckMemberUsage): Made static.
681
682         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
683
684         * constant.cs (CheckRange): Removed unused type argument.
685         (CheckUnsigned): Removed unused type argument.
686
687         * cs-parser.jay: Updated after MemberAccess clean up.
688         Uses Length for empty string test.
689
690         * cs-tokenizer.cs: Uses Length for empty string test.
691         (IsCastToken): Made static.
692         (is_hex): Made static.
693         (real_type_suffix): Made static.
694
695         * decl.cs (SetupCache): Made static.
696         (OnGenerateDocComment): Removed unused ds argument.
697
698         * delegate.cs (VerifyDelegate): Removed unused argument.
699
700         * doc.cs: Uses Length for empty string test.
701
702         * driver.cs: Uses Length for empty string test.
703
704         * enum.cs (IsValidEnumType): Made static
705
706         * expression.cs (EnumLiftUp): Removed unused argument.
707         (ResolveMethodGroup): Ditto.
708         (BetterConversion): Ditto.
709         (GetVarargsTypes): Ditto.
710         (UpdateIndices): Ditto.
711         (ValidateInitializers): Ditto.
712         (MemberAccess.ctor): Ditto.
713         (GetIndexersForType): Ditto.
714
715         * flowanalysis.cs: (MergeFinally): Removed unused argument.
716
717         * iterators.cs: Updated after MemberAccess clean up.
718
719         * location.cs: Uses Length for empty string test.
720
721         * namespace.cs: Uses Length for empty string test.
722
723          * report.cs (CheckWarningCode): Made static.
724
725         * statement.cs (LabeledStatement): Removed unused argument.
726
727         * typemanager.cs (FilterNone): Removed.
728
729 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
730
731         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
732         obsolete.
733
734         * class.cs: Updated.
735
736 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
737
738         * cs-parser.jay.cs: __arglist is not allowed for delegates.
739
740 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
741
742         A fix for #77816.
743
744         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
745         host container.
746         (AnonymousMethod.ImplicitStandardConversionExists): New method.
747         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
748         Add more error reporting; Fixed issue with params.
749
750         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
751
752         * cs-parser.jay: AnonymousMethod requires host container.
753
754         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
755
756 2006-03-18  Raja R Harinath  <harinath@gmail.com>
757
758         * class.cs: Change 'TypeContainer ds' constructor argument to
759         'DeclSpace parent'.  Some classes were missed below due to
760         different naming convention.
761
762         * class.cs (MemberCore.Parent): Delete.  This makes the
763         ParentContainer changes below enforceable by the compiler.
764
765         Treat pointers to enclosing declaration space as 'DeclSpace', not
766         'TypeContainer'.
767         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
768         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
769
770         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
771         of TypeContainer.
772         (Block.AddThisVariable): Likewise.
773         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
774         (AbstractPropertyEventMethod.Emit): Likewise.
775         (AbstractPropertyEventMethod.EmitMethod): Likewise.
776         (GetMethod.Define, SetMethod.Define): Likewise.
777         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
778         (DelegateMethod.EmitMethod): Likewise.
779
780         Fix regression test-partial-13.cs.
781         Rationalize use of PartialContainer.  Ensure that the partial
782         class semantics can be tied to type-correctness, i.e., any
783         violation will cause a compile error.
784         * class.cs, const.cs: Access all fields that belong to class
785         TypeContainer via ParentContainer.  Arguments of EmitContexts and
786         Resolve()-like functions still use 'Parent'.
787
788         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
789         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
790         (PropertyMethod.CheckModifiers): Remove unused argument.
791         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
792         DeclSpace.
793
794 2006-03-28  Raja R Harinath  <rharinath@novell.com>
795
796         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
797
798 2006-03-17  Raja R Harinath  <harinath@gmail.com>
799
800         Make semantics of PartialContainer simpler.
801         * decl.cs (DeclSpace.IsPartial): Remove.
802         * class.cs (TypeContainer.IsPartial): Likewise.
803         (TypeContainer..ctor): Set PartialContainer to point to self.
804         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
805         (TypeContainer.FindNestedType): Likewise.
806         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
807
808 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
809
810         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
811
812 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
813
814         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
815         classes.
816
817 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
818
819         * class.cs (Operator.Define): An error for base conversion was not
820         reported correctly.
821
822 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
823
824         A fix for #77593, #77574.
825
826         * class.cs (MethodCore.CheckBase): Another if for operator.
827
828 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
829
830         A fix for #77822.
831
832         * expression.cs (VerifyArgumentsCompat): Reverted to double error
833         reporting, it's more tricky than I thought.
834
835 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
836
837         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
838         were not resolved
839
840         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
841         (DelegateCreation.ImplicitStandardConversionExists): New method for just
842         conversion test.
843         
844         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
845         not needed.
846
847 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
848
849         A fix for #77353.
850
851         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
852         (Event.Define): ditto
853         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
854
855         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
856         Removed redundant code and set NewSlot for Invoke method too.
857
858         * parameter.cs (Parameters.ctor): Add custom, type ctor.
859         (Parameters.MergeGenerated): New method. Use this method when you merge
860         compiler generated argument with user arguments.
861
862 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
863
864         * attribute.cs (ResolveAsTypeTerminal): Removed.
865
866         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
867         specialization for predefined types; 30% speed up.
868         Finally placed obsolete check to right place.
869         (Expression.ResolveType): Removed.
870
871         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
872         Updated after ResolveType was removed.
873
874         * expression.cs (Cast.ctor): Check void cast.
875         (Binary.ResolveAsTypeTerminal): Is never type.
876         (Conditional.ResolveAsTypeTerminal): Is never type.
877
878         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
879
880 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
881
882         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
883
884 2006-03-23  Martin Baulig  <martin@ximian.com>
885
886         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
887         type check if either of the types is an open generic type.
888
889 2006-03-23  Martin Baulig  <martin@ximian.com>
890
891         * convert.cs
892         (Convert.ExplicitTypeParameterConversion): New method; implement
893         explicit type parameter conversions.
894
895 2006-03-23  Martin Baulig  <martin@ximian.com>
896
897         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
898         blindly allow all conversions if we do not have any constraints.
899
900 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
901
902         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
903         these two separated members to simplify the code.
904         (Attribute.Resolve): Refactored to use new fields and methods.
905         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
906         implemented obsolete attribute checking.
907         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
908         implemented obsolete checking again. It look line never ending quest ;-)
909         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
910
911         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
912
913         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
914
915         *class.cs (Property.Define): Add RegisterProperty call.
916
917         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
918         argument groups (only 2).
919
920         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
921         encoding expression to arguments.
922         (Expression.ExprClassToResolveFlags): Just turned to property.
923
924         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
925         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
926         optimized as well as implemented support for zero-length attributes.
927
928         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
929         Add caching of PropertyInfo's.
930
931 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
932
933         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
934         error multiple times.
935
936 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
937
938         New partial class implementation.
939         A fix for #77027, #77029, #77403
940
941         * attribute.cs (Attributable): Made attributes protected.
942
943         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
944         the replacements of ClassPart and PartialContainer.
945         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
946         (TypeContainer.AddInterface): Ditto.
947         (TypeContainer.AddPartial): The main method for partial classes. It checks
948         for errors and merges ModFlags and attributes. At the end class is added to
949         partial_parts list.
950         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
951         required here.
952         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
953         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
954         from the rest of partial classes.
955         (TypeContainer.GetClassBases): Simplified.
956         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
957         DefineType.
958         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
959         (TypeContainer.HasExplicitLayout): Uses Flags now.
960         (PartialContainer): Removed.
961         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
962         (StaticClass): Was merged with Class.
963         (Class.GetClassBases): class and static class bases are verified here.
964         (Class.TypeAttr): Added static attributes when class is static.
965         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
966         (MemberBase): In some cases we need to call parent container for partial
967         class. It should be eliminated but it's not easy now.
968
969         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
970
971         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
972         partial classed to accumulate class comments.
973         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
974
975         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
976
977         * driver.cs (MainDriver): Tree.GetDecl was removed.
978
979         * modifiers.cs (Modifiers): Add partial modifier.
980
981         * tree.cs (Tree.decl): Removed.
982         (RootTypes): Started to use this class more often for root types
983         specializations.
984
985 2006-03-23  Raja R Harinath  <rharinath@novell.com>
986
987         * generic.cs (TypeParameter.UpdateConstraints): Update
988         'constraints' if null.
989
990 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
991
992         A fix for #77615
993
994         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
995         external interface does not have an attribute.
996
997 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
998
999         Another prerequisites for new partial classs implementation.
1000         
1001         * attribute.cs (Attribute.Equal): Implemented.
1002         (Attribute.Emit): Changed as attributes can be applied more than twice.
1003         (Attributes.Emit): Check for duplicate attributes here.
1004
1005         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1006         as a parameter, clean-up.
1007
1008 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1009
1010         A fix for #77485
1011
1012         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1013         contains obsolete attribute check which can in some cases look for base
1014         type of current class which is not initialized yet.
1015         (TypeContainer.BaseType): Replacement of ptype.
1016
1017         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1018
1019 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1020
1021         First of prerequisites for new partial classs implemention.
1022         
1023         * attribute.cs (Attributable): Extended by ResolveContext;
1024         Attributes finally have correct context for resolving in all cases.
1025         (AttachTo): Attribute owner is assigned here.
1026
1027         * codegen.cs (IResolveContext): Introduce new interface to hold
1028         all information needed in resolving phase.
1029         (EmitContext): Implements IResolveContext; more clean-up needed here.
1030         
1031         * decl.cs (MemberCore): Implemented IResolveContext.
1032
1033         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1034         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1035         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1036         Refactored to use new IResolveContext instead of EmitContext; cleanup
1037
1038 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1039
1040         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1041         mcs to keep code differences small.
1042         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1043         * typemanager.cs (parameter_default_value_attribute_type): New.
1044         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1045         CS1908 check.
1046
1047 2006-03-22  Martin Baulig  <martin@ximian.com>
1048
1049         * generic.cs
1050         (Nullable.NullableLiteral): Derive from `NullLiteral'.
1051
1052         * convert.cs
1053         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1054         instead of the normal `NullLiteral'.
1055
1056 2006-03-21  Martin Baulig  <martin@ximian.com>
1057
1058         Fix #77583.
1059         * generic.cs (TypeManager.InferType): If `pt' is a generic
1060         parameter, don't check whether `pt == at'.
1061
1062 2006-03-20  Raja R Harinath  <rharinath@novell.com>
1063
1064         Fix #77852
1065         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1066         (TypeParameter.Resolve): Update to change.
1067         (ConstraintChecker.CheckConstraints): Resolve type-argument
1068         constraints before use.
1069
1070 2006-03-16  Martin Baulig  <martin@ximian.com>
1071
1072         * generic.cs
1073         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1074         and don't have any instance constructors, also lookup in the base class.
1075         (TypeManager.IsNullableValueType): New public method.
1076
1077         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1078         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1079         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1080
1081         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1082         instead of just TypeManager.IsNullableType() to determine whether
1083         a lifted operator exists.
1084         (UnaryMutator.DoResolve): Likewise.
1085         (Conditional.DoResolve): Likewise.
1086         (Binary.DoResolve): A lifted operator only exists if both operands
1087         are valuetypes and at least one of them is a nullable type.
1088
1089 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1090
1091         * iterator.cs : yield break is allowed in try statement which has
1092           catch clauses. Fixed bug #77767.
1093
1094 2006-03-12  Martin Baulig  <martin@ximian.com>
1095
1096         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1097         private IsSignatureEqual() to compare types; see the comment in
1098         that method; fixes #77674.
1099
1100 2006-03-10  Raja R Harinath  <rharinath@novell.com>
1101
1102         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1103         (Expression.ResolveAsTypeTerminal): Likewise.
1104         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1105         * expression.cs, generic.cs, iterators.cs: Likewise.
1106         * parameter.cs, statement.cs, typemanager.cs: Likewise.
1107
1108 2006-03-09  Martin Baulig  <martin@ximian.com>
1109
1110         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1111         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1112
1113 2006-03-09  Martin Baulig  <martin@ximian.com>
1114
1115         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1116         `prepared' flag is set.
1117
1118         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1119         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1120         issues; see gtest-254.cs.
1121
1122 2006-03-07  Martin Baulig  <martin@ximian.com>
1123
1124         * generic.cs (TypeManager.InferType): Allow infering
1125         `IEnumerable<T>' with an array of T; see gtest-251.cs.
1126
1127 2006-03-06  Martin Baulig  <martin@ximian.com>
1128
1129         * generic.cs
1130         (TypeManager.InferType): Fix gtest-250.cs.
1131
1132         * typemanager.cs
1133         (TypeManager.IsSubclassOf): Also check the base class.
1134
1135         * expression.cs
1136         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1137         fixes gtest-249.cs.
1138
1139 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1140
1141         Fix #77679.
1142         * expression.cs (ParameterReference.DoResolveBase): Change return
1143         type to bool.
1144         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1145         Update.
1146
1147         Fix #77628.
1148         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1149
1150         Fix #77642.
1151         * typemanager.cs (GetFullNameSignature): Don't nullref on
1152         protected accessors.
1153
1154 2006-02-16  Martin Baulig  <martin@ximian.com>
1155
1156         * generic.cs
1157         (TypeManager.GetGenericFieldDefinition): New public method; use it
1158         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1159
1160 2006-02-14  Martin Baulig  <martin@ximian.com>
1161
1162         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1163
1164 2006-02-14  Martin Baulig  <martin@ximian.com>
1165
1166         * generic.cs
1167         (TypeManager.DropGenericMethodArguments): New public method; don't
1168         use GetGenericMethodDefinition() on something which is not a
1169         generic method.
1170
1171 2006-02-14  Martin Baulig  <martin@ximian.com>
1172
1173         * generic.cs
1174         (ConstraintChecker.CheckConstraints): If a type parameter has the
1175         `struct' constraint, the type must be a non-nullable valuetype.
1176
1177 2006-02-10  Martin Baulig  <martin@ximian.com>
1178
1179         * typemanager.cs
1180         (TypeManager.IsOverride): Make this work for instantiated methods
1181         in a generic class; fixes #77509.
1182         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1183         rather than calling it directly; fixes #77488.  
1184
1185 2006-02-08  Martin Baulig  <martin@ximian.com>
1186
1187         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1188         reporting into CheckConstraint() so we can use the correctly
1189         instantiated type.
1190
1191 2006-02-08  Martin Baulig  <martin@ximian.com>
1192
1193         * expression.cs (BaseAccess): Add support for generic methods.
1194
1195         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1196         the new MethodGroupExpr.
1197
1198 2006-02-07  Martin Baulig  <martin@ximian.com>
1199
1200         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1201         also reference types; fixes #77483.
1202
1203 2006-02-07  Martin Baulig  <martin@ximian.com>
1204
1205         * generic.cs
1206         (TypeManager.IsGenericMethod): We now return whether something is
1207         an instantiated generic method (and not a generic method def).
1208         (TypeManager.IsGenericMethodDefinition): New public method.
1209
1210         * typemanager.cs
1211         (TypeManager.CSharpSignature): Only include type arguments for
1212         "real" generic methods, not for any instantiated method.
1213         (TypeManager.GetMethodName): Likewise, but also allow generic
1214         method definitions here.
1215
1216 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1217
1218         * codegen.cs (EmitScopeInitFromBlock): check here the
1219         capture_context, there is no need to make two calls to the
1220         EmitContext. 
1221
1222         * anonymous.cs: Add some debugging messages that might help me
1223         track other instances of this problem in the future (the
1224         regression of test 467).
1225
1226         * cs-parser.jay: track the variable block, as we need to initalize
1227         any captured variables declared in this block for the "catch"
1228         portion of the "Try" statement.
1229
1230         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1231         scope initialization for captured variables. 
1232
1233         Also, move the emit for the variables after the block location has
1234         been marked.
1235
1236 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1237
1238        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1239         
1240 2006-02-06  Martin Baulig  <martin@ximian.com>
1241
1242         * class.cs (TypeContainer.DefineType): If we're a struct, pass
1243         `TypeManager.value_type' as parent type to
1244         ModuleBuilder.DefineType().  Fixes #77358.      
1245
1246 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1247
1248         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1249         commit yesterday, the initialization for the roots is necessary.
1250         What is not necessary is the scope activation.
1251
1252 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1253
1254         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1255         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1256         CS0206 checks.
1257         (Argument.Resolve): Remove CS0206 checks.
1258
1259 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1260
1261         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1262         scopes for all the roots, the scopes will now be emitted when the
1263         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1264
1265         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1266         code.  This reduces a lot of existing cruft.
1267         
1268         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1269         that the ScopeInfo is generated as we enter the scope, not at the
1270         time of use, which is what we used to do before.
1271
1272         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1273         every time a Block is about to be emitted if we have a
1274         CaptureContext. 
1275
1276 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1277
1278         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1279         attribute for mscorlib too.
1280
1281         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1282         (Reset): Update.
1283         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1284
1285         * typemanager.cs (cons_param_array_attribute): Make private.
1286         (Reset): Set it to null.
1287         (InitCoreHelpers): Don't initialize it.
1288         (ConsParamArrayAttribute): New.  Initialize it as needed.
1289         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1290
1291 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1292
1293         * expression.cs: There might be errors reported during the
1294         selection of applicable methods.  If there are errors, do not
1295         continue execution as it will lead the compiler to crash.
1296
1297 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1298
1299         * expression.cs: Member access is not allowed on anonymous
1300         methods.  Fixes #77402.
1301
1302 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1303
1304         Fix #77401
1305         * cs-parser.jay (VariableDeclaration): Don't set
1306         current_array_type to null.
1307         (field_declaration, event_declaration, declaration_statement):
1308         Set it to null here.
1309
1310 2006-01-29  Raja R Harinath  <harinath@gmail.com>
1311
1312         Fix part of #77397
1313         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1314
1315 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1316
1317         * typemanager.cs (GenericParameterPosition): New.
1318         * doc.cs: Use it.
1319
1320 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1321
1322         * doc.cs : To process "include" elements, first we should create
1323           another list than XmlNodeList, because it could result in node
1324           removal, which could result in that the XmlNodeList gives up
1325           yielding next node.
1326
1327 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1328
1329         * expression.cs: Introduce an error report that we were not
1330         catching before.   Gonzalo ran into it.
1331
1332 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1333
1334         A fix for bug: #76957
1335         
1336         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1337         ComputeMethodHost before creating the method, this is a new
1338         requirement. 
1339
1340         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1341         that this method references (RegisterScope).  The actual scope
1342         where the method is hosted is computed with the ComputeMethodHost
1343         before we create the method.
1344
1345         Moved the Deepest routine here.
1346
1347         (AnonymousContainer.ComputeMethodHost): New routine used to
1348         compute the proper ScopeInfo that will host the anonymous method.
1349
1350         (ScopeInfo): Deal with multiple roots.  The problem was that we
1351         did not have a unique root where all ScopeInfos could be hanged
1352         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1353         of roots.  
1354
1355         Remove AdjustMethodScope which is now computed at the end.  Remove
1356         LinkScope which did a partial link, instead link all ScopeInfos
1357         before code generation from the new "LinkScopes" routine. 
1358
1359         Simplify all the Add* routines as they no longer need to maintain
1360         the tree, they just need to record that they are using variables
1361         from a ScopeInfo.
1362
1363         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1364         routines to produce the forest of ScopeInfo trees.
1365
1366         * class.cs (TypeContainer.AppendMethod): This is just like
1367         AddMethod, but ensures that an interface implementation method
1368         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1369         methods, but at the end.
1370
1371         We use this functionality to ensure that the generated MoveNext
1372         method in the iterator class is resolved/emitted before the
1373         enumerator methods created.   
1374
1375         This is required because the MoveNext method computes the right
1376         ScopeInfo for the method.  And the other methods will eventually
1377         need to resolve and fetch information computed from the anonymous
1378         method. 
1379
1380         
1381 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1382
1383         Improve implementation of section 14.4.2.2 (Better function member).
1384         * expression.cs (Invocation.MoreSpecific): Compare all type
1385         arguments before deciding if one type is more specific than
1386         another.  Handle array types too.  Return the more specific type.
1387         (Invocation.BetterFunction): Add more tie-breaking rules from
1388         section 14.4.2.2.  Perform "more specific" check after
1389         other tie-breaking rules.  Compare all parameter types before
1390         choosing the "more specific" method.
1391
1392 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1393             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1394
1395         Fix rest of #76995.
1396         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1397         the 'aliases' hash.
1398         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1399         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1400
1401 2006-01-18  Martin Baulig  <martin@ximian.com>
1402
1403         * class.cs (TypeContainer.AddToMemberContainer): Use
1404         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1405         fixes #77124.
1406
1407 2006-01-18  Martin Baulig  <martin@ximian.com>
1408
1409         Fix #76417: a generic class may now have methods which may unify
1410         for some type parameter substitutions.
1411
1412         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1413         for methods which may unify anymore.
1414
1415         * expression.cs (Invocation.MoreSpecific): New private static
1416         method; checks whether one method is more specific than another
1417         according to 14.4.2.2 of the spec.
1418         (Invocation.BetterFunction): Implement the tie-breaking rules from
1419         14.4.2.2 of the spec: if two methods unify for some type parameter
1420         substitution, we need to pick the more specific one.
1421
1422 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1423
1424         Fix #76656, cs0231-2.cs.
1425         * cs-parser.jay (formal_parameter_list): Make error case catch
1426         more issues.
1427         (parenthesized_expression_0): Add CS1026 check.
1428         (invocation_expression): Remove unused { $$ = lexer.Location }.
1429
1430 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1431
1432         Fix #76824.
1433         * cs-parser.jay (statement_expression): Don't list out the
1434         individual statement-expressions.  Convert syntax error into
1435         CS0201 check.
1436
1437 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1438
1439         Fix #76874.
1440         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1441         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1442         CheckIntermediateModification.
1443         (FieldExpr.DoResolve): Add new two-argument version that
1444         allows us to resolve the InstanceExpression as an lvalue.
1445         The one-argument variant is now just a wrapper.
1446         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1447         Resolve the lhs as an lvalue if the it has a value type.
1448         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1449         from Assign.DoResolve.
1450         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1451         resolved as an lvalue.
1452         (PropertyExpr.DoResolve): Update.
1453         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1454         has a value type.  Move CS1612 check here from
1455         CheckIntermediateModification.
1456         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1457         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1458         'right_side' of a ResolveLValue on an 'out' argument.
1459         (EmptyExpression.LValueMemberAccess): New.  Used as the
1460         'right_side' of a propagated ResolveLValue on a value type.
1461         (LocalVariableReference.DoResolveBase): Recognize
1462         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1463         Add CS1654 check.
1464         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1465         EmptyExpression.Null.
1466
1467 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1468
1469         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1470           Type.IsGenericParameter(). Fixed bug #77183.
1471         * doc.cs : it is now identical to doc.cs in mcs.
1472
1473 2006-01-16  Martin Baulig  <martin@ximian.com>
1474
1475         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1476
1477 2006-01-16  Martin Baulig  <martin@ximian.com>
1478
1479         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1480         ctors; fixes #77250.
1481
1482 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1483
1484         This fixes the problem where we used ldfld instead of ldflda to
1485         load the "THIS" pointer on captured parameters, when THIS is a
1486         value type.  See bug #77205.
1487         
1488         * iterators.cs (CapturedThisReference.Emit): Pass false to
1489         EmitThis (we do not need the address).
1490
1491         * codegen.cs (EmitThis): it needs to know whether we need the
1492         address of `this' or not.  This is used by value types.  
1493
1494         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1495         every other call passes false.
1496
1497 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1498
1499         Fix #77221.
1500         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1501         GetOverride.
1502         * expression.cs (Invocation.OverloadResolve): Update.
1503         (Invocation.DoResolve): Avoid double resolution of invocation.
1504
1505 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1506
1507         Fix #77180.
1508         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1509         unary negation of floating point types as 0-expr; negation cannot
1510         overflow in floating point types.
1511
1512         Fix #77204.
1513         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1514         on operands of 'void' type.
1515
1516         Fix #77200.
1517         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1518         and ExclusiveOr for boolean constants too.
1519
1520 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1521
1522         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1523
1524 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1525
1526         * cs-tokenizer.cs (Position): New class used to save and restore
1527         the position state in the tokenizer.  Before this patch the save
1528         and restore was not complete enough so the line and columns would
1529         start to drift and the debugger and stack traces will get the
1530         wrong data.
1531
1532 2006-01-10  Martin Baulig  <martin@ximian.com>
1533
1534         * generic.cs
1535         (TypeParameter.InflateConstraints): New public method.
1536
1537         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1538         constraints; fixes #77042.
1539
1540 2006-01-10  Martin Baulig  <martin@ximian.com>
1541
1542         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1543         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1544         #77061. 
1545
1546 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1547
1548         Fix #75636.
1549         * expression.cs (Invocation.OverloadResolve): Replace reflected
1550         override methods with their base virtual methods, rather than
1551         skipping over them.
1552         * typemanager.cs (TypeManager.GetOverride): New.
1553
1554 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1555
1556         * driver.cs: Report the case of no source files and no -out:
1557         argument provided.
1558
1559 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1560
1561         Fix #77035.
1562         * expression.cs (ComposedCast.GetSignatureForError): Define.
1563
1564 2006-01-05  Jb Evain  <jbevain@gmail.com>
1565
1566         * class.cs (Property.Define, Indexer.Define): do not tag the
1567         properties as SpecialName | RTSpecialName.
1568
1569 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1570
1571         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1572         doing a low-level comparission of parameter types.  It was lacking
1573         a check for __argslist. 
1574
1575 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1576
1577         * expression.cs (ParameterReference.DoResolveBase): Allow
1578         reference parameters if they are local to this block. 
1579
1580         This allows the ref and out parameters of a delegate to be used in
1581         an anonymous method, for example:
1582
1583         delegate void set (out int x);
1584
1585         set s = delegate (out int x){
1586                 x = 0;
1587         };
1588
1589         This is used by functionality introduced late in the C# language.
1590         
1591         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1592         method that take ref and out parameters. 
1593
1594         Fixes #77119 which was a late change in the spec.
1595
1596 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1597
1598         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1599         parent if its the same scope.  Fixes #77060.
1600
1601 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1602
1603         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1604
1605 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1606
1607         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1608         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1609         that doesn't contain the full public key. This is a update of the
1610         friend assemblies in .Net 2.0 release.
1611         
1612 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1613
1614         Fix #76995
1615
1616         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1617         ListDictionary, to contain the ExternAliasEntry entries (in
1618         addition to the NamespaceEntry.aliases hashtable). This field is
1619         shared between the original entry and its doppelganger (bodyless 
1620         copy of it).
1621         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1622         extern_aliases field.
1623         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1624         lookup in extern_aliases.
1625
1626 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1627
1628         Fix #77006.
1629         * class.cs (TypeContainer.Mark_HasEquals): New.
1630         (TypeContainer.Mark_HasGetHashCode): New.
1631         (ClassPart): Override them.
1632         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1633
1634         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1635         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1636         DeclSpace.
1637
1638         Fix #77008.
1639         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1640         'parent' argument to the base constructor.
1641
1642         Remove all mention of TypeContainer from decl.cs.
1643         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1644         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1645         (DeclSpace.DeclSpace): Likewise.
1646         (DeclSpace.DefineMembers): Remove unused argument.
1647         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1648         debugging check -- we don't care if the debug code throws an
1649         InvalidCastException instead of an InternalErrorException.
1650         * class.cs (TypeContainer.DefineMembers): Update to changes.
1651         (TypeContainer.DoDefineMembers): Likewise.
1652         (TypeContainer.GetMethods): Likewise.
1653         (PropertyMember.Define): Likewise.
1654         (MemberBase.Parent): New property that forwards to
1655         MemberCore.Parent, but ensures that we get a TypeContainer.
1656         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1657         (RootContext.PopulateTypes): Likewise.  Remove special case code
1658         for !RootContext.StdLib: DefineMembers is idempotent.
1659
1660 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1661
1662         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1663
1664 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1665
1666         * doc.cs : The search for referenced namespace was insufficient to
1667           get global one as it used to do. Fixed bug #76965.
1668
1669 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1670
1671         * doc.cs : check name in cref in the last phase that whether it is
1672           namespace or not.
1673
1674 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1675
1676         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1677           Mono.C5.
1678
1679 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1680
1681         * doc.cs : so it turned out that we cannot skip override check for 
1682           interface members. Fixed bug #76954.
1683
1684 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1685
1686         * cs-tokenizer.cs : fixed bug #75984:
1687           - #warning and #error should not be handled when the source line
1688             is disabled.
1689           - #line is not checked strictly when the source line is disabled.
1690           - #define and #undef is on the other hand checked strictly at any
1691             state.
1692
1693 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1694
1695         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1696           CS1027 report.
1697
1698 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1699
1700         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1701
1702         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1703         nested types.
1704
1705 2005-12-14  Martin Baulig  <martin@ximian.com>
1706
1707         * typemanager.cs (TypeManager.GetFullName): Make this public;
1708         `Type.Fullname' now never returns null.
1709
1710         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1711         explicit interface implementations; we're now using the same
1712         naming convention than csc does.
1713
1714 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1715
1716         * convert.cs (ExplicitConversionCore): Check the return value from
1717         ExplicitConversionCore which can return null on failure.  Fixes #76914
1718
1719 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1720
1721         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1722         instead of IsGenericInstance.
1723         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1724         code that's now covered by the more general test.
1725         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1726
1727         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1728         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1729         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1730         * generic.cs, report.cs, typemanager.cs: Likewise.
1731
1732 2005-12-08  Martin Baulig  <martin@ximian.com>
1733
1734         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1735
1736         * typemanager.cs (TypeManager.CSharpSignature): Include type
1737         arguments in the signature of a generic method.
1738
1739 2005-12-07  Martin Baulig  <martin@ximian.com>
1740
1741         Add support for custom attributes on type parameters.
1742
1743         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1744
1745         * generic.cs (TypeParameterName): New public class; we use this
1746         instead of a `string' to store the name of a type parameter, so we
1747         can also have `Attributes'.
1748         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1749         array instead of a `string[]' array.
1750         (TypeParameter.ctor): We now also take an `Attributes' argument.
1751         (TypeParameter.EmitAttributes): New public method; emit our
1752         `OptAttributes' here.
1753         (GenericMethod.EmitAttributes): New public method; emit the custom
1754         attributes on all our type parameters.
1755
1756         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1757         our type parameters.
1758         (MethodData.Define): If we're a generic method, call
1759         EmitAttributes() on it.
1760
1761 2005-12-07  Martin Baulig  <martin@ximian.com>
1762
1763         * generic.cs
1764         (ConstraintChecker): New public abstract class; move the
1765         constraint checking here from `ConstructedType' and also do
1766         constraint checking for generic methods here.
1767
1768         * expression.cs (Invocation.OverloadResolve): Use
1769         ConstraintChecker.CheckConstraints() if we resolved to a generic
1770         method.  Fix #76806.
1771
1772 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1773
1774         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1775
1776         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1777         event initializers.
1778         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1779         (FieldBase.Initializer): Initializer is now optional.
1780         (EventField.Define): Only event field can have initializer.
1781
1782         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1783
1784         * const.cs (Const): Reuse initializer.
1785
1786         * cs-parser.jay: Updated after FieldBase changes.
1787         Added current_array_type to simplify array initializers.
1788
1789         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1790
1791         * expression.cs, iterators.cs: Updated.
1792
1793         * namespace.cs (NamespaceEntry): Made UsingFound private.
1794
1795 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1796
1797         * parameterCollection.cs: Obsolete, removed.
1798         * parser.cs: Obsolete, removed.
1799
1800 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1801
1802         Fix #76849.
1803         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1804
1805         * enum.cs (Enum.Define): Set obsolete context here.
1806
1807 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1808
1809         * doc.cs :
1810           - FindDocumentedMember() now expects 1) paramList as null
1811             when "we don't have to check the number of parameters" and
1812             2) Type.EmptyTypes when "there is no arguments".
1813           - Introduced FoundMember struct to hold the exact type which was
1814             used to find the documented member (the above change broke
1815             test-xml-044; it might be better just to use DeclaringType than
1816             what MS does, like this change does, but it depends on usage.)
1817
1818 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1819
1820         * doc.cs : documented member might be from DeclaringType for nested
1821           types. Fixed bug #76782.
1822
1823 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1824
1825         * anonymous.cs: Have the param code handle leaving copies on the
1826         stack etc. Allows anonymous params to take part in the assignment
1827         code (++, +=, etc). Fixes bug #76550
1828
1829         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1830         it down to the anon code.
1831
1832         * iterators.cs: Use dummy var here
1833
1834         * codegen.cs: Handle new vars
1835
1836 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1837
1838         Fix #76849.
1839         * class.cs (MethodData.Define): Set proper Obsolete context.
1840
1841         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1842         obsolete context.
1843         (FieldExpr.DoResolve): Ditto.
1844
1845 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1846
1847         Fix #76849.
1848         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1849         parent is not obsolete.
1850
1851 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1852
1853         * doc.cs : (FindDocumentedMember) find parameterless members first
1854           and get CS0419 in the early stage. Fixed first case of bug #76727.
1855
1856 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1857
1858         Fix #76859.
1859         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1860         no error was reported.
1861
1862         *expression.cs (Binary.DoResolve): left can be null.
1863
1864 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1865
1866         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1867         abstract method and all overrides.
1868         * support.cs (ParameterData.GenericConstraints): Delete.
1869         (ReflectionParameters.type_params): Delete.
1870         (ReflectionParameters.ReflectionParameters): Make private.
1871         (ReflectionParameters.GetConstaints): New factory method.
1872         * generic.cs (TypeParameterDefineType): Use it.
1873         (TypeManager.GetTypeParameterConstraints): Likewise.
1874
1875 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1876
1877         Fix #76783.
1878         * class.cs (MethodData.Emit): Parameters should be labeled first.
1879
1880 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1881
1882         Fix #76761.
1883         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1884
1885 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1886
1887         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1888
1889         * class.cs (MethodCore): Parameter clean up.
1890         (IMethodData): Added ParameterInfo.
1891         (MethodData): Parameter clean up.
1892         (Indexer.Define): Parameter clean up.
1893
1894         * anonymous.cs,
1895         * codegen.cs,
1896         * cs-parser.jay,
1897         * decl.cs,
1898         * doc.cs,
1899         * ecore.cs,
1900         * flowanalysis.cs,
1901         * iterators.cs,
1902         * pending.cs,
1903         * statement.cs,
1904         * typemanager.cs: Parameter clean up.
1905
1906         * delegate.cs (Define): Get rid of duplicated code.
1907
1908         * expression.cs (ParameterReference): Removed useless parameters
1909         and simplified.
1910         (Invocation): Ditto.
1911
1912         * parameter.cs (ParamsParameter): New class, params specialization.
1913         (ArglistParameter): Attemp to separate arglist.
1914         (Parameter): Refactored to be reusable and faster.
1915         (Parameter.Modifier): Made understandable.
1916         (Parameters): Changed to be used as a class for `this' assembly
1917         parameters. Refactored to use new specialized classes.
1918
1919         * support.cs (ParameterData): Added Types property.
1920         (InternalParameters): Deleted.
1921
1922 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1923
1924         * doc.cs : the previous patch does not actually fix the bug.
1925           PropertyInfo override check is now implemented and really fixed it.
1926         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1927
1928 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1929
1930         * doc.cs : apply "override filter" also to properties.
1931           Fixed bug #76730.
1932
1933 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1934
1935         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1936           no need to check overrides. For classes, omit those results from 
1937           interfaces since they must exist in the class. Fixed bug #76726.
1938
1939 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1940
1941         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1942           with different parameters. Fixed the second problem in #76685.
1943
1944 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1945
1946         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1947           get expected 'protected' access in CheckValidFamilyAccess()).
1948           Fixed bug #76692.
1949
1950 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1951
1952         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1953           Fixed bug #76705.  CS1569 was incorrectly commented out.
1954
1955 2005-11-23  Martin Baulig  <martin@ximian.com>
1956
1957         * generic.cs (Constraints.Define): Removed.
1958         (TypeParameter.DefineConstraints): Removed.
1959         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1960         on the GenericTypeParameterBuilder here.
1961
1962 2005-11-23  Martin Baulig  <martin@ximian.com>
1963
1964         * typemanager.cs (TypeManager.GetProperty): Make this public.
1965
1966         * generic.cs (Nullable.NullableInfo.ctor): Use
1967         TypeManager.GetProperty() rather than using reflection directly.
1968
1969 2005-11-17  Martin Baulig  <martin@ximian.com>
1970
1971         * expression.cs (Indexers.GetIndexersForType): Added support for
1972         generic parameters; fixes #76587.
1973
1974 2005-11-17  Martin Baulig  <martin@ximian.com>
1975
1976         * anonymous.cs
1977         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1978         inherit the scope from our parent.  Fixes #76653.
1979
1980 2005-11-15  Martin Baulig  <martin@ximian.com>
1981
1982         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1983         instead of `ScopeTypeBuilder' to refer to the "current" type.
1984         (AnonymousMethod.CreateScopeType): Correctly create the helper
1985         class if we're inside a generic type definition.
1986
1987 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1988
1989         * doc.cs : use Invocation.IsOverride() to do real override check.
1990         * expression.cs : made Invocation.IsOverride() internal.
1991
1992 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1993
1994         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1995           TypeBuilder.FindMembers() and filter overriden base members out.
1996           Fixed bug #76990.
1997
1998 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1999
2000         * doc.cs : ref/out parameters are represented as '@' (instead of
2001           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2002
2003 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2004
2005         * doc.cs : when there was no '.' in cref to methods in doc comment,
2006           then parameters were missing in the output. Fixed bug #76691.
2007
2008 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2009
2010         * driver.cs : don't output docs when there is an error.
2011           Fixed bug #76693.
2012
2013 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2014
2015         * doc.cs :
2016           Now it should detect indexers. Fixed primary concern in bug #76685.
2017           Fixed CS0419 message to not show the identical member signature in
2018           the message.
2019
2020 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2021
2022         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2023           instead of Type.FindMembers() since it does not handle events.
2024           Fixed bug #71604.
2025
2026 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2027
2028         * codegen.cs: Fixed typo (speficied -> specified).
2029
2030 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2031
2032         Fix #76369.
2033         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2034
2035 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2036
2037         * attribute.cs: Changed error message.
2038
2039         * cs-tokenizer.cs: One more check.
2040
2041 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2042
2043         * statement.cs (Block.Resolve): Ignore empty statement.
2044
2045 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2046
2047         * report.cs: Made error/warning methods more strict to avoid
2048         their misuse.
2049
2050         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2051         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2052         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2053         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2054
2055 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2056
2057         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
2058         Use the more explicit AssemblyName.FullName instead of 
2059         AssemblyName.Name to report errors.
2060         
2061 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2062
2063         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2064         with mcs.
2065
2066 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2067
2068         * class.cs,
2069         * convert.cs,
2070         * cs-parser.jay,
2071         * decl.cs,
2072         * enum.cs,
2073         * expression.cs,
2074         * generic.cs,
2075         * pending.cs,
2076         * report.cs: Fixed error reporting and typos.
2077
2078         * generic.cs (TypeParameter.GetSignatureForError): New method.
2079         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2080
2081         * typemanager.cs (GetFullName): Refactored.
2082
2083 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2084
2085         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2086         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2087
2088         * class.cs (TypeContainer.IsComImport): New property.
2089         (Constructor.Define): Create proper ctor for ComImport types.
2090
2091         * expression.cs (New.CheckComImport): Fixed.
2092
2093 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2094
2095         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2096         that a parameter has been captured does not mean that we do not
2097         have to do the rest of the processing.  This fixes the second part
2098         of #76592.  If there was another anonymous method capturing
2099         values in the past, the Scope would never be set for the second
2100         method that captured the same parameter.
2101
2102         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2103         properly manipulate the stack.   Second part of fix for #76592.
2104
2105         * expression.cs (New): Add support for invoking "new" on
2106         interfaces that have been flagged with the ComImport attribute and
2107         the CoClass.  Fixes #76637 
2108
2109         * statement.cs (Try.DoEmit): When a variable is captured, do not
2110         try to emit the vi.LocalBuilder variable as it has been captured.
2111         Create a temporary variable and store the results on the
2112         FieldBuilder.  Fixes #76642
2113
2114 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2115
2116         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2117
2118         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2119
2120         * expression.cs (Binary.DoResolve): Added && optimalization.
2121     
2122         * typemanager.cs (AddUserType): Removed useless argument.
2123
2124 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2125
2126         * statement.cs (Block.variables): Uses ListDictionary.
2127
2128 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2129
2130         Fix #75969.
2131         * class.cs (PartialContainer.EmitType): Customized to emit
2132         security attributes.
2133         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2134         for partial classes.
2135
2136 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2137
2138         Fix #76599.
2139         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2140         access has to be fixed.
2141         
2142         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2143
2144 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2145
2146         Fix #76590.
2147         * ecore.cs (NullCast.Reduce): Implemented.
2148
2149         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2150         constant type.
2151         
2152         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2153         properly.
2154         (Foreach.Resolve): Catch null properly.
2155
2156 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2157  
2158         * cs-tokenizer.cs: Warning text fix.
2159
2160         * driver.cs: AllWarningNumbers exposed on public interface.
2161
2162         * report.cs (): Reviewed warning numbers.
2163         (IsValidWarning): Use binary search.
2164
2165 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2166  
2167         * driver.cs: Implemeted resource visibility.
2168         (Resources): New class for code sharing between /res: and
2169         /linkres:
2170  
2171 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2172
2173         decl.cs (CurrentTypeParameters): Fixed to be public.
2174
2175 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2176
2177         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2178
2179 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2180
2181         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2182
2183 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
2184
2185         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2186
2187 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2188
2189         Add friend assembly access support.
2190         * typemanager.cs: assembly_internals_vis_attrs
2191         cache for friend assembly access. 
2192         (TypeManager.IsFriendAssembly): New method for
2193         checking friend assembly access.
2194         (TypeManager.Error_FriendAccessNameNotMatching): New
2195         helper method.
2196         (TypeManager.CompareKeyTokens): Likewise.
2197         (TypeManager.Filter): Handle friend accessible
2198         members.
2199
2200         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2201         friend accessible types.
2202
2203         * ecore.cs (Expression.IsAccessorAccessible): Handle
2204         friend accessible properties.
2205
2206         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2207         accessible types.
2208         
2209 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2210
2211         Fix #76568.
2212         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2213         folding.
2214         
2215         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2216         contants only.
2217         
2218         * ecore.cs (NullCast): Child is contant only.
2219         
2220         * literal.cs (NullLiteral.Reduce): null can be converted to any
2221         reference type.
2222
2223 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2224
2225         * driver.cs: Use Encoding.Default as default code page instead
2226           of ISO-28591.
2227
2228 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2229
2230         Fix #76085.
2231         * expression.cs (Invocation.Error_InvalidArguments): Handle
2232         __arglist parameters.
2233         (Invocation.VerifyArgumentsCompat): Likewise.
2234         * support.cs (ReflectionParameters.GetSignatureForError): Print
2235         __arglist parameters.
2236         (InternalParamters.GetSignatureForError): Likewise.
2237         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2238
2239 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2240
2241         * attribute.cs (GetPropertyValue): Made public.
2242
2243         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2244         Resolve.
2245         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2246         attribute.
2247         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2248         is not defined.
2249         
2250         * driver.cs: Reflect method name change.
2251         
2252         * statement.cs (Try.Resolve): Warn when try has both general
2253         exception handlers.
2254         
2255         * typemanager.cs: runtime_compatibility_attr_type new predefined
2256         type.
2257
2258 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2259
2260         Fix #76419.
2261         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2262         treat it as an empty parameter list.
2263
2264 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2265
2266         Fix #76271.     
2267         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2268         ResolveAsTypeStep silent.
2269         * statement.cs (Block.AddConstant): Mark block as used.
2270         (Block.ResolveMeta): Avoid piling on error messages
2271         if a constant initializer resolution fails.
2272
2273 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2274
2275         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2276         Remove.
2277         (NamespaceEntry.VerifyAllUsing): New.
2278         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2279         behaviour.  Delegates actual resolution of alias to ...
2280         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2281         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2282         Update.
2283         * driver.cs (Driver.MainDriver): Update.
2284         
2285         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2286         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2287         property.
2288         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2289         Remove.
2290         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2291         RootNamespace.DefineNamespacesForAll.
2292
2293 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2294
2295         * typemanager.cs (assemblies, external_aliases, modules)
2296         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2297         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2298         overhead.  Move resposibility ...
2299         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2300         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2301
2302 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2303
2304         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2305         cached_namespaces.  Improve usage.
2306         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2307         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2308         Move from GlobalRootNamespace and simplify.
2309         (RootNamespace.Global): Make instance variable.
2310         (RootNamespace.RootNamespace): Add "alias name" parameter.
2311         (GlobalRootNamespace): Simplify drastically.
2312         (Namespace.Lookup): Don't use GetNamespace.
2313         * typemanager.cs (GetRootNamespace): Rename from
2314         ComputeNamespaceForAlias.
2315         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2316
2317 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2318
2319         * anonymous.cs (AnonymousContainer): Don't crash when container
2320         doesn't exist.
2321
2322 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2323
2324         * expression.cs (Binary.DoResolve): Warn when comparing same
2325         values.
2326
2327 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2328
2329         Fix #76486.
2330         * expression.cs (Binary.DoResolve): It looks like there are no
2331         convetsion rules in enum context.
2332
2333 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2334
2335         Add support for extern alias qualifiers.
2336         * typemanager.cs: Move some LookupTypeReflection code
2337         to namespace.cs, to have cleaner code. Added some methods
2338         to help us keep track of the extern aliased references.
2339         * driver.cs: Add suport for extern alias assemblies on command
2340         line and check for their warnings/errors. Also keep track of the
2341         extern aliased assemblies.
2342         * namespace.cs: Move the global functionality of Namespace
2343         to GlobalRootNamespace/RootNamespace. Now the global namespace
2344         is GlobalRootNamespace.Globa. Also the code moved from 
2345         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2346         Finally added LocalAliasEntry (AliasEntry before) and
2347         ExternAliasEntry, to handle alias statements.
2348         * cs-parser.jay: Add support in the grammar for extern alias
2349         statement.
2350         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2351         Update callings to Namespace (now in GlobalRootNamespace).
2352
2353 2005-10-25  Martin Baulig  <martin@ximian.com>
2354
2355         * convert.cs (ImplicitTypeParameterConversion): Make base
2356         interfaces actually work; fixes #76557.
2357
2358 2005-10-25  Martin Baulig  <martin@ximian.com>
2359
2360         * generic.cs
2361         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2362         all the type parameters; fixes #76551.
2363
2364 2005-10-25  Martin Baulig  <martin@ximian.com>
2365
2366         Fix #76472.
2367
2368         * generic.cs
2369         (GenericMethod.ctor): Added `Expression return_type' and
2370         `Parameters parameters' arguments.
2371         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2372         parameter and return types to check their constraints if they're
2373         generic types.
2374
2375         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2376         boolean field.
2377
2378         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2379         constraints of a generic type if `ec.ResolvingGenericMethod'.
2380
2381         * class.cs (MethodCore.DoDefineParameters): Set
2382         `ec.ResolvingGenericMethod' if we're a generic method.
2383         (MemberBase.MemberType): Likewise.
2384
2385 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2386
2387         * typemanager.cs (TypeManager): Added 
2388         TypeManager.internals_visible_attr_type to cache
2389         S.R.CompilerServices.InternalsVisibleToAttribute.
2390
2391         * codegen.cs (AssemblyClass): Added checks for 
2392         InternalsVisibleToAttribute in new method 
2393         CheckInternalsVisibleAttribute () and also cache the
2394         AssemblyName in AssemblyClass.Name.
2395         
2396 2005-10-24  Martin Baulig  <martin@ximian.com>
2397
2398         * typemanager.cs
2399         (TypeManager.ExpandInterfaces): Added overloaded version which
2400         just takes a `Type[]' array.
2401
2402         * generic.cs
2403         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2404         just use the interfaces which were explicitly specified and not
2405         the interfaces they inherit.  Fixes #76482.
2406         (TypeParameter.FindMembers): Expand the interfaces here.
2407
2408 2005-10-21  Martin Baulig  <martin@ximian.com>
2409
2410         * generic.cs
2411         (Constraints.Resolve): Also resolve the actual types here.
2412         (Constraints.ResolveTypes): Just check the constraints here.
2413         Fixes #76363; see gtest-218.cs.
2414
2415 2005-10-21  Martin Baulig  <martin@ximian.com>
2416
2417         * convert.cs
2418         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2419         instead of a `BoxedCast'; fixes gtest-217.cs.
2420
2421 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2422
2423         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2424           1) "new()" is specified as generic parameter constraint and 2) the
2425           type is TypeBuilder and 3) the type is abstract even if it has a
2426           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2427
2428 2005-10-20  Martin Baulig  <martin@ximian.com>
2429
2430         * generic.cs
2431         (GenericConstraints.TypeParameter): New public property.
2432         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2433         (TypeParameter.DeclSpace): New public property.
2434         (TypeParameter.DefineType): Inflate the constraints if our
2435         `DeclSpace' is an `Iterator'.   
2436
2437 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2438
2439         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2440           GenericMethod argument to compare methods' generic type arguments.
2441           Fixed bug #76382.
2442
2443 2005-10-19  Martin Baulig  <martin@ximian.com>
2444
2445         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2446         not ResolveType() when resolving the base type, so we're not
2447         checking the constraints here.
2448         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2449         if we have any.
2450
2451 2005-10-19  Martin Baulig  <martin@ximian.com>
2452
2453         * generic.cs (ConstructedType.CheckConstraints): Committing
2454         untested fix for #76441.
2455
2456 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2457
2458         Fix #76371.
2459         * class.cs (TypeContainer.DefineType): Move updating of
2460         topological sort earlier in the code.
2461         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2462
2463 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2464
2465         Fix #76273.
2466         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2467         
2468         * constant.cs (Constant.TryReduce): Moved from Cast class.
2469         (Reduce): Made little bit more OO and fixed missing conversions.
2470         
2471         * ecore.cs (Reduce): Implemented.
2472         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2473         
2474         * literal.cs (Reduce): Implemented.
2475         
2476         * class.cs: Reverted Miguel's wrong commit.
2477
2478 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2479
2480         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2481
2482 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2483
2484         * cs-parser.jay, expression.cs : CS0214 was missing error location
2485           for constants. Fixed bug #76404.
2486
2487 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2488
2489         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2490         InstanceExpression.
2491         (PropertyExpr.EmitCall): Likewise.
2492         * expression.cs (Invocation.EmitArguments): Handle case where
2493         arguments == null.
2494         (Invocation.EmitCall): Avoid allocating temporary variable if
2495         there are no arguments.
2496
2497 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2498
2499         Fix #76370.
2500         * convert.cs (ExplicitConversionCore): Fixed object->enum
2501         conversion.
2502
2503 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2504
2505         Fix #76323.
2506         * convert.cs (ImplicitConversionStandard): Move conversion of
2507         void* to arbitrary pointer types ...
2508         (ExplicitConversionStandard): .. here.
2509         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2510         error to always print typenames.
2511
2512 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2513
2514         * convert.cs (GetConversionOperator): Rename from
2515         GetConversionOperators.  Move operator selection code from ...
2516         (UserDefinedConversion): ... here.
2517
2518 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2519
2520         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2521         conversion.
2522
2523 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2524
2525         * assign.cs (Assign.DoResolve): Error method changed.
2526
2527         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2528         
2529         * const.cs (ResolveValue): Reset in_transit immediately.
2530         
2531         * constant.cs: Error method changed.
2532         
2533         * convert.cs: Removed useless location parameter.
2534         (ExplicitNumericConversion): Don't do double enum check.
2535         (ExplicitConversionCore): Renamed from ExplicitConversion.
2536         (ExplicitUnsafe): Extracted from ExplicitConversion.
2537         (ExplicitConversion): Uses for error reporting.
2538         
2539         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2540         error messages.
2541         (ResolveBoolean): Uses common error method.
2542         (CastToDecimal): Get rid of ec.
2543         (CastFromDecimal): Optimized.
2544         (ConvCast): Get rid of ec.
2545         
2546         * enum.cs (ResolveValue): Reset in_transit immediately.
2547         (Emit): Return after first error.
2548         
2549         * expression.cs: Convert changes.
2550         
2551         * literal.cs: Error method changed.
2552         
2553         * statement.cs: Error method changed.
2554
2555 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2556
2557         Fix gtest-131.cs and gtest-211.cs.
2558         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2559         Only emit code for a label if it is used.  Unreachable code can
2560         violate ECMA evaluation stack invariants.
2561
2562 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2563
2564         * anonymous.cs: Implemented ExprClassName.
2565         
2566         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2567         delegate.
2568         
2569         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2570         check.
2571         
2572         * class.cs (StaticClass.DefineContainerMembers): Report protected
2573         members as error.
2574         
2575         * codegen.cs: if(ed) PRODUCTION.
2576         
2577         * convert.cs (Error_CannotImplicitConversion): Better error
2578         distinction.
2579         
2580         * cs-parser.jay: More error checks.
2581         
2582         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2583         
2584         * driver.cs (CSCParseOption): Enabled wrong option check.
2585         
2586         * ecore.cs (Expression.ExprClassName): Turned to property.
2587         (MemberExpr.CheckIntermediateModification): For checking boxed
2588         value types     modification.
2589         
2590         * statement.cs (Fixed.Resolve): Expression type must be
2591         convertible to fixed type.
2592         (CollectionForeach.GetEnumeratorFilter,TryType):
2593         Small refactoring for easier error checking.
2594
2595 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2596
2597         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2598         attributes.
2599         
2600         * class.cs (GeneratedBaseInitializer): New class for customization
2601         compiler generated initializers.
2602         (MemberBase.DoDefine): Check Obsolete attribute here.
2603         (FieldMember.DoDefine): Ditto.
2604         
2605         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2606         constants.
2607         
2608         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2609         (MemberCore.GetObsoleteAttribute): Removed argument.
2610         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2611         (MemberCore.CheckObsoleteType): New helper.
2612         
2613         * delegate.cs,
2614         * enum.cs,
2615         * statement.cs: Updates after MemberCore changes.
2616         
2617         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2618         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2619         
2620         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2621         obsolete attribute for compiler construct.
2622         (As.DoResolve): Cache result.
2623         
2624         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2625
2626 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2627
2628         * expression.cs (Probe): instead of having a "Type probe_type"
2629         keep the extra information as a TypeExpr probe_type_expr since the
2630         "As" operator needs to perform some type checks.
2631
2632         * (As.DoResolve): If the type is a type parameter, ensure that it
2633         is constrained by a class.
2634
2635 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2636
2637         * statement.cs (Lock): Use the TemporaryVariable class instead of
2638         manually using local variables as those do not work when variables
2639         are captured.
2640
2641         * ecore.cs: Moved the TemporaryVariable class from being a nested
2642         class inside Foreach to be a public class that can be employed in
2643         other places. 
2644
2645 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2646
2647         * cs-parser.jay: interface_accessors replaced by
2648         accessor_declarations.
2649
2650         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2651         location.
2652         
2653         * statement.cs (GotoCase.Resolve): Convert null constant to
2654         null case.
2655         (SwitchLabel.ResolveAndReduce): Ditto.
2656         (SwitchLabel.NullStringCase): Custom null stamp.
2657         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2658         
2659         typemanager.cs (CSharpSignature): Don't skip first argument
2660         for full names.
2661
2662 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2663
2664         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2665         expression.cs, iterators.cs, literal.cs: Store constants and
2666         literals location.
2667         
2668         * class.cs (MemberBase.ShortName): Pass location.
2669         
2670         * cs-parser.jay: Some location fixes.
2671         
2672         * ecore.cs (Expression.Location): Made virtual.
2673
2674 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2675
2676         Fix #72930.
2677         * const.cs (Const.ResolveValue): Check for assigning non-null
2678         value to reference type.
2679
2680 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2681
2682         Fix #76133.
2683         * expression.cs (This.VerifyFixed): In a value type T, the type of
2684         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2685         value type R, 'this' is treated as a value parameter.
2686
2687 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2688
2689         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2690         if the underlying types are the same, otherwise we need to produce
2691         code that will do the proper cast.
2692
2693         This was exposed by Marek's constant rewrite which produced
2694         invalid code for the call site:
2695
2696         enum X : long { a }
2697         void Method (X v) {}
2698
2699         Method ((X) 5)
2700
2701         This fixes test-49.cs
2702
2703 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2704
2705         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2706           Type/Object should be allowed as well. Fixed bug #75968.
2707
2708 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2709
2710         * expression.cs : (Binary.DoResolve): when one is enum constant and
2711           another is constant 0, then return enum one *as enum type*.
2712           Fixed bug 74846.
2713
2714 2005-10-04  Martin Baulig  <martin@ximian.com>
2715
2716         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2717         `SetMemberIsUsed()' work for generics, too.
2718
2719 2005-10-04  Martin Baulig  <martin@ximian.com>
2720
2721         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2722         for corlib.  Fixes #75691.
2723
2724 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2725
2726         Fix #76255.
2727         * driver.cs: Fix compilation files with full root path.
2728
2729 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2730
2731         * report.cs (SymbolRelatedToPreviousError): Format the output so
2732         it does not use an open parenthesis that is never closed. 
2733
2734         * driver.cs: Follow coding guidelines
2735
2736 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2737
2738         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2739
2740         * location.cs (InEmacs): in this mode, do not report column
2741         location as it confuses Emacs.
2742
2743 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2744
2745         * support.cs (SeekableStreamReader.Position): Don't error out when
2746         the requested position is just beyond the end of the current
2747         buffered data.
2748
2749 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2750
2751         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2752         try to keep in sync with the byte count of the underlying Stream.
2753         However, this limits us to a window size of 2048 characters: i.e.,
2754         the maximum lookahead of our lexer/parser can be 2048 characters.
2755
2756 2005-09-22  Martin Baulig  <martin@ximian.com>
2757
2758         * driver.cs: Removed a debugging FIXME.
2759
2760 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2761
2762         * cs-parser.jay (type_arguments): Add CS1644 check.
2763         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2764
2765 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2766
2767         * Makefile (PROGRAM): Make profile specific.
2768         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2769         the current directory.
2770
2771         Fix test-455.cs.
2772         * expression.cs (Invocation.EmitCall): Remove optimization on
2773         this_call since it doesn't handle 'this' being a value type.
2774
2775 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2776
2777         * driver.cs: Ensure file handles are closed after parsing
2778
2779 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2780
2781         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2782         if the underlying types are the same, otherwise we need to produce
2783         code that will do the proper cast.
2784
2785         This was exposed by Marek's constant rewrite which produced
2786         invalid code for the call site:
2787
2788         enum X : long { a }
2789         void Method (X v) {}
2790
2791         Method ((X) 5)
2792
2793         This fixes test-49.cs
2794
2795 2005-09-05  Martin Baulig  <martin@ximian.com>
2796
2797         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2798         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2799
2800         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2801
2802 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2803
2804         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2805           to be a pointer type due to the spec 25.2, so check if declaring
2806           type is generic type definition. Fixed bug #75772.
2807
2808 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2809
2810         Fixed bug #75957.
2811         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2812           both types are not defined by methods.
2813         * expression.cs : (Invocation.IsApplicable): it should work when
2814           the argument type is equal to the parameter type, not only when
2815           ImplicitConversionExists() returns true.
2816
2817 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2818
2819         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2820         internal.
2821
2822         Fix #75941.
2823         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2824         flow-branching for LocalVariableReferences in case we were invoked
2825         from a MemberAccess.
2826         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2827         Carved out of ...
2828         (LocalVariableReference.DoResolveBase): ... this.
2829         (MemberAccess.Resolve): Do the check that was disabled during
2830         SimpleNameResolve.
2831
2832 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2833
2834         * class.cs :
2835           (PartialContainer.Create): check abstract/sealed/static strictly
2836           but abstract/sealed can exist only at one side. Fixed bug #75883.
2837
2838 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2839
2840         Fix #75945.
2841         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2842         specified, don't default to UnmanagedType.I4.
2843
2844 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2845
2846         * expression.cs : conditional operator should check possibly
2847           incorrect assign expression. Fixed bug #75946.
2848
2849 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2850
2851         Fix #75934.
2852         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2853         (ScopeInfo.EmitScopeType): Use it to construct field names from
2854         names of captured locals.
2855
2856         Fix #75929.
2857         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2858         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2859         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2860         (ExplicitConversion): Remove enum cases already handled by
2861         implicit conversion.  Move implicit conversion check to the beginning.
2862         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2863         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2864         Don't treat System.Enum as a struct.
2865
2866 2005-08-30  Jb Evain  <jbevain@gmail.com>
2867
2868         * attribute.cs: handles as expression in parameters.
2869
2870 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2871
2872         Fix #75802.
2873         * class.cs (TypeContainer.VerifyClsName): Don't use a
2874         PartialContainer when verifying CLS compliance.
2875         (AbstractPropertyEventMethod): Set Parent here, ...
2876         (PropertyMethod): ... not here.
2877
2878 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2879
2880         * attribute.cs : escaped attribute name should not be allowed to be
2881           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2882
2883 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2884
2885         Fix #75927.
2886         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2887         when converting a long constant to unsigned long.
2888         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2889         detect where IsApplicable and VerifyArgumentsCompat disagree.
2890
2891 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2892         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2893
2894         Fix #75848.
2895         * class.cs (TypeContainer.CanElideInitializer): New helper.
2896         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2897         can safely emitting the initializer of a field.
2898
2899 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2900
2901         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2902           allowed inside a switch (without loop). Fixed bug #75433.
2903
2904 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2905
2906         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2907         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2908
2909 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2910
2911         * driver.cs : kinda reverting the default encoding changes (not exact 
2912           revert since I noticed that "codepage:reset" might not work fine).
2913
2914 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2915
2916         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2917           Location. Now getter and setter store location correctly.
2918           (errors/cs0111-12.cs now reports the expected location.)
2919
2920 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2921
2922         * driver.cs : Use default encoding on the environment.
2923           Removed (now that) extra parameter for SeekableStreamReader.
2924         * support.cs : (SeekableStreamReader) third .ctor() argument for
2925           StreamReader is not required (always true). preamble size could
2926           be acquired in simpler and safe way.
2927
2928 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2929
2930         * cs-parser.jay: report CS0642 at warning level 3
2931           and report CS0642 for an if else statement also
2932           fixes bug #74745. Patch by John Luke (and a bit
2933           modified by me).
2934           Removed extra CS0642 warning check for "while",
2935           "for" and "fixed".
2936         * statement.cs: In Block.Resolve(), CS0642 check
2937           is reimplemented to check a sequence of an empty
2938           statement and a block.
2939
2940           Both fix bug #66777.
2941
2942 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2943
2944         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2945         detection until I fix it.
2946         
2947         * cs-tokenizer.cs: Changed error message.
2948         
2949         * cs-parser.jay: Fixed 2 error locations.
2950         
2951         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2952         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2953         properties.
2954         
2955         * enum.cs (GetSignatureForError): Fixed.
2956         
2957         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2958         method detection.
2959         
2960         * class.cs,
2961         * typemanager.cs (RegisterProperty): Removed.
2962         
2963         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2964
2965 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2966
2967         Fix #75874.
2968         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2969         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2970
2971 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2972
2973         * expression.cs : tiny fix is required for not warning positive ulong.
2974           See test-441.cs.
2975
2976 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2977
2978         * expression.cs : add CS0652 check for constant and integral
2979           expression. Fixed bug #53974.
2980
2981 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2982
2983         * expression.cs : in DoNumericPromotions(), check if there is implicit
2984           conversion overload for string (to check CS0034). Fixed bug #52492.
2985
2986 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2987
2988         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2989
2990 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2991
2992         * ecore.cs : report location when it is *not* Null.
2993
2994 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2995
2996         * codegen.cs,
2997           ecore.cs,
2998           flowanalysis.cs,
2999           expression.cs:
3000           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3001           correctly. Fixed bug #75721.
3002
3003 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3004
3005         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3006         loop that performs 'min (pos, char_count)'.
3007
3008         Fix #75862.
3009         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3010         converted value in Operator.OnesComplement.
3011
3012 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3013
3014         * anonymous.cs: If the anon method is pulled into a helper class,
3015         it needs to be `internal' not `private'. Fixes runtime behavior on
3016         msft. bug #75704
3017
3018 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3019
3020         Fix #75803
3021         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3022         is a partial class.
3023
3024 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3025
3026         The big constants rewrite
3027         Fix #75746, #75685 and more
3028         As a side effect saved 1MB for MWF ;-)
3029         
3030         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3031         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3032         enum based for corlib compilation.
3033         
3034         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3035         subtractions.
3036         
3037         * class.cs (FixedField.Define): Use ResolveAsConstant.
3038         
3039         * const.cs (IConstant): Interface constants and enums.
3040         (Const.ResolveValue): New method for constant resolvning.
3041         (ExternalConstant): Constants from imported assemblies.
3042         
3043         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3044         conversion; like enums.
3045         (Constant.ToType): Converts this constant to different type.
3046         (Constant.Increment): Adds 1.
3047         
3048         * convert.cs (ImplicitConversionRequired): Simplified.
3049         
3050         * cs-parser.jay: Create EnumMember directly.
3051         
3052         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3053         
3054         * doc.cs (GenerateEnumDocComment): Removed.
3055         
3056         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3057         (ConvertIntLiteral): Removed.
3058         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3059         
3060         * enum.cs (EnumMember): Implement IConstant.
3061         (Enum.IsValidEnumConstant): Removed.
3062         (Enum.GetNextDefaultValue): Removed.
3063         (Enum.FindMembers): Updated.
3064         (Enum.GenerateDocComment): Iterate enum members.
3065         
3066         * expression.cs (Cast.TryReduce): Handle enums correctly.
3067         (New.Constantify): Made public.
3068         (MemberAccess.DoResolve): Removed contant specific if(s).
3069         
3070         * literal.cs (NullLiteral): Implement new abstract methods.
3071         
3072         * statement.cs (GotoCase.Resolve): Use new constant methods.
3073         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3074         
3075         * typemanager.cs (LookupEnum): Removed.
3076         (IsEnumType): Fixed to work with corlib.
3077         (RegisterConstant): Removed.
3078         (LookupConstant): Removed.
3079         (GetConstant): Changed to work with IConstant.
3080
3081 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3082
3083         * location.cs : Fixed overflown (>255) column number.
3084
3085 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3086
3087         First cut of the qualified-alias-member feature.
3088         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3089         token.
3090         * cs-parser.jay (DOUBLE_COLON): New token.
3091         (namespace_or_type_name): Add rule for recognizing
3092         qualified-alias-members.
3093         (primary_expression): Likewise.
3094         (element_access): Allow QualifiedAliasMember as a possible
3095         type-bearing expression.
3096         (local_variable_type, local_variable_pointer_type): Likewise.
3097         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3098         aliases in the current and enclosing namespace declarations.
3099         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3100         * decl.cs (MemberName.is_double_colon): New.
3101         (MemberName.MemberName): Add new constructor for alias-member.
3102         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3103         * expression.cs (QualifiedAliasMember): New expression type.
3104
3105 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3106
3107         * location.cs : it borked when no argument was specified.
3108
3109 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3110
3111         * location.cs : tiny ToString() format fix.
3112
3113 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3114
3115         * statement.cs : oops, it was missing.
3116
3117 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3118
3119         A set of fixes for precise line/column location.
3120
3121         * location.cs :
3122           "token" field now holds a file/line "delta", a line number offset 
3123           from the segment, and a column number. See also:
3124           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3125           December/009508.html
3126           Removed static IsNull. Use instance IsNull property instead.
3127         * cs-tokenizer.cs :
3128           For some tokens it stores Location. For Identifier it stores
3129           LocatedToken which is a pair of string name and location.
3130           Column numbers are adjusted only at getChar().
3131         * report.cs :
3132           Use Location.ToString() for reporting (it now contains column).
3133         * cs-parser.jay :
3134           Largely modified to use LocatedToken instead of
3135           string (IDENTIFIER), and to acquire Location from some tokens.
3136         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3137           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3138           codegen.cs :
3139           Now MemberName holds Location. DeclSpace.ctor() receives Location
3140           as a parameter. Removed extra parameters to all derived classes.
3141           Replaced Location.IsNull() with instance property.
3142         * assign.cs, expression.cs :
3143           Added .ctor() overload that omits Location.
3144         * attribute.cs :
3145           Added "nameEscaped" flag that indicates the identifier was escaped
3146           in the source file. This fixes bug #57047.
3147
3148 2005-09-02  Martin Baulig  <martin@ximian.com>
3149
3150         * class.cs: Make CS3005 a warning, not an error.
3151
3152 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3153
3154         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3155         New method, looking for lo-case imported cls type.
3156
3157         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3158         here.
3159
3160         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3161
3162         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3163
3164         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3165         all_imported_types.
3166         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3167
3168         Optimized to save 3.5 MB for SWF compilation.
3169
3170 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3171
3172         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3173         (PartialContainer.Create): Moved logic AddToContainer.
3174         (PartialContainer.MarkForDuplicationCheck): Shares name.
3175         
3176         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3177         place.
3178         
3179         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3180         initialization.
3181         (Namespace.GetSignatureForError): New method.
3182         
3183         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3184         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3185
3186 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3187
3188         Fix #75669.
3189         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3190         member lookup rather than qualifier_type, since qualifier_type can
3191         be null.
3192
3193 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3194
3195         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3196         enum member.
3197
3198 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3199
3200         * statement.cs: Copy the local exception into the exception
3201         captured local.  Fixes 75674
3202
3203 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3204
3205         Fix #75658.
3206         * expression.cs (Invocation.OverloadResolve): Don't report error
3207         CS1501 if error CS1502 has been reported.
3208         (New.DoResolve): Delegate CS1501 reporting to
3209         Invocation.OverloadResolve.
3210
3211         Fix #75656.
3212         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3213         invariant-meaning-in-block property in an enclosing block if
3214         necessary.
3215
3216 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3217
3218         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3219         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3220         (Switch.CheckSwitch): Just save 50kb for SWF.
3221
3222 2005-07-27  Martin Baulig  <martin@ximian.com>
3223
3224         * anonymous.cs (CaptureContext.AddField): Added
3225         `AnonymousContainer am' argument; compute its toplevel scope if
3226         it's not already computed.  Fixes #75649.
3227
3228 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3229
3230         Fix #75628.
3231         * class.cs (Constructor.Emit): Reset block to null if the block
3232         resolve fails.
3233
3234 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3235
3236         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3237
3238 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3239
3240         * class.cs (MethodData.Define): Check whether accessor implementing
3241         interface is public.
3242
3243         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3244
3245 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3246
3247         Fix #57245
3248         * namespace.cs (LookupType): Moved same type check to...
3249         
3250         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3251         with the same name.
3252
3253 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3254
3255         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3256         already found a typebuilder.
3257         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3258         MemberNames, not strings.
3259
3260         * const.cs (Error_ExpressionMustBeConst): 
3261         Rename from Error_EpressionMustBeConst.
3262         * const.cs, class.cs, statement.cd: Update.
3263
3264 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3265
3266         Fix #65573
3267
3268         * const.cs (Const.LookupConstantValue): Report missing contant expression
3269         everytime.
3270         (Error_EpressionMustBeConstant): Only one error method.
3271
3272         * class.cs, statement.c: Updated.
3273
3274 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3275
3276         * statement.cs (Block.Flags): Add back HasVarargs.
3277         (Block.flags): Make protected.
3278         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3279
3280         * typemanager.cs (types, typecontainers, user_types): Remove.
3281         (UserTypes, TypeContainers): Likewise.
3282         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3283         (CleanUp, Reset): Update.
3284         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3285         (GetNestedType): Use Type.GetNestedType.
3286         (CoreLookupType): Take two arguments, the namespace and the
3287         basename of the type.  Update to use the Namespace.Lookup
3288         mechanism.
3289         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3290         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3291         string concatenation and substring matches.
3292         * class.cs, enum.cs, delegate.cs: Update to changes.
3293
3294 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3295
3296         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3297         Expression and made virtual.
3298
3299         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3300         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3301
3302         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3303
3304         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3305         error message.
3306
3307         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3308         change.
3309
3310 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3311
3312         Fix #57707
3313         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3314         AssemblyCultureAttribute is not used on executable.
3315
3316         * rootcontext.cs,
3317         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3318
3319 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3320
3321         Fix #60638.
3322         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3323         New.  Reports CS0252/CS0253.
3324         Mostly taken from preliminary patch by Duncak Mak.
3325         (Binary.DoResolveOperator): Store results of operator lookup.
3326         Use them to detect if we need to warn about unintended reference
3327         comparisons.
3328
3329 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3330
3331         Fix #72969.
3332         * namespace.cs (Namespace.Lookup): Add back location parameter.
3333         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3334         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3335
3336         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3337         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3338         (Namespace.LookupType): ... this.
3339         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3340         of namespaces.
3341         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3342         purported to handle pointers.
3343         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3344         CoreLookupType.
3345
3346 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3347
3348         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3349         type as namespace.
3350
3351 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3352
3353         * namespace.cs (Namespace.Lookup): Drop location parameter.
3354         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3355         (NamespaceEntry.Lookup): ... this.
3356         (NamespaceEntry.Error_AmbiguousTypeReference):
3357         Move here from DeclSpace.
3358         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3359         names ...
3360         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3361         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3362         Move to NamespaceEntry.
3363         * delegate.cs, expression.cs: Update to changes.
3364
3365 2005-08-31  Martin Baulig  <martin@ximian.com>
3366
3367         Committing a patch from Atsushi Enomoto for #75850.
3368
3369         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3370         Prefer a generic enumerator over a non-generic one.
3371
3372 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3373
3374         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3375         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3376
3377 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3378
3379         * driver.cs : reverting default encoding change as well as mcs.
3380
3381 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3382
3383         * driver.cs, support.cs : merged r48826.
3384           Marek Safer wrote:
3385           > could you integrate your mcs changes to gmcs otherwise
3386           > gmcs cannot compile some files.
3387
3388 2005-08-20  Martin Baulig  <martin@ximian.com>
3389
3390         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3391         scope if we don't already have it.
3392
3393         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3394         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3395         fixes #75867.
3396
3397 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3398
3399         * statement.cs: Copy the local exception into the exception
3400         captured local.  Fixes 75674
3401
3402 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3403
3404         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3405         type as namespace.
3406
3407 2005-08-12  Martin Baulig  <martin@ximian.com>
3408
3409         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3410         for nested types here to avoid hitting the cache too early.
3411
3412 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3413
3414         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3415         an error. 
3416
3417 2005-08-03  Martin Baulig  <martin@ximian.com>
3418
3419         Make iterators in generic methods work; see gtest-191.cs.
3420
3421         * generic.cs
3422         (Constraints.Resolve): Protect against being called twice.
3423
3424         * class.cs
3425         (TypeContainer.GetClassBases): Make this `protected virtual'.
3426
3427         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3428         (Iterator.GetClassBases): Override this and compute the base
3429         classes here.
3430         (Iterator.DefineNestedTypes): If we're a generic method, all our
3431         method type parameters become class type parameters on the proxy
3432         class.
3433
3434         * statement.cs
3435         (ToplevelBlock.Parameters): Make this a property, not a field.
3436         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3437
3438 2005-08-03  Martin Baulig  <martin@ximian.com>
3439
3440         * typemanager.cs (TypeManager.IsSubclassOf): Use
3441         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3442         (TypeManager.GetFullName_recursed): Improved.
3443
3444 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3445
3446         Fix #75417
3447         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3448         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3449         invocation_type == mi.DeclaringType, since the first one also checks
3450         other condition used by generic instances.
3451         
3452 2005-07-27  Martin Baulig  <martin@ximian.com>
3453
3454         * anonymous.cs (CaptureContext.AddField): Added
3455         `AnonymousContainer am' argument; compute its toplevel scope if
3456         it's not already computed.  Fixes #75649.
3457
3458 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3459
3460         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3461         CheckAttributeType and refactored.
3462         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3463         ResolveAsTypeTerminal error handling.
3464         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3465         handling.
3466         (GetSignatureForError): Print errors in same way.
3467
3468         * class.cs,
3469         * codegen.cs: Reflect attribute GetSignatureForError change.
3470
3471         * ecore.cs,
3472         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3473
3474         * namespace.cs (UsingEntry): Refactored to make fields private.
3475
3476         * assign.cs,
3477         statement.cs: Error_UnexpectedKind has extra parameter.
3478
3479 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3480
3481         * ecore.cs (IAlias): Remove.
3482         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3483         that implement the interface.
3484         * namespace.cs (Namespace): Likewise.
3485         (Namespace.declspaces): Renamed from 'defined_names'.
3486         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3487         DeclSpace instead of an IAlias.
3488         * tree.cs (Tree.AddDecl): Update.
3489
3490 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3491
3492         * statement.cs (Block.Flags); Remove HasVarargs.
3493         (Block.HasVarargs): Move to ToplevelBlock.
3494         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3495         (Block.Variables): Make protected.  Initialize variable hashtable
3496         if necessary.
3497         (Block.AddVariable): Update.
3498         (Block.Resolve): Update to changes.
3499         (ToplevelBlock.HasVarargs): New boolean.
3500         (ToplevelBlock.ThisVariable): Move here from Block.
3501         (ToplevelBlock.AddThisVariable): Likewise.
3502         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3503         * expression.cs (This.ResolveBase): Update to changes.
3504         (ArglistAccess.DoResolve): Likewise.
3505
3506 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3507
3508         Fix #75321
3509         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3510
3511         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3512         not used and not used & assigned.
3513         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3514
3515 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3516
3517         Fix #75053
3518         * expression.cs (Is.DoResolve): null is never provided type.
3519
3520 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3521
3522         Fix #52496
3523         * cs-parser.jay: Less strict event error rule to catch more errors.
3524
3525 2005-07-11  Martin Baulig  <martin@ximian.com>
3526
3527         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3528         for the constructor constraint: we do not only have to check
3529         whether the class has a public constructor, but also ensure that
3530         it's parameterless.  Fixes #75492.
3531
3532 2005-07-11  Martin Baulig  <martin@ximian.com>
3533
3534         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3535         between type parameters if they either have the reference type
3536         constraint or the class constraint.
3537
3538 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3539
3540         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3541
3542 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3543
3544         Fix #74975
3545         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3546         (ExtractSecurityPermissionSet): Cope with self referencing security
3547         attributes properly.
3548
3549         * driver.cs (SetOutputFile): Made public property OutputFile.
3550
3551 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3552
3553         Fix #75486.
3554         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3555         has_nonstatic_fields.  Make into a FieldBase pointer.
3556         (TypeContainer.AddField): Add CS0282 check.
3557         (TypeContainer.EmitType): Update.
3558
3559 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3560
3561         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3562         compare if they start with __.
3563
3564 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3565
3566         * statement.cs (Switch.SwitchGoverningType): Only look at
3567         UserCasts that don't need implicit standard conversions to one of
3568         the allowed switch types (Fixes test-322.cs).
3569         (LocalInfo.Resolve): Re-enable sanity-test.
3570
3571 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3572
3573         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3574         
3575         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3576         
3577         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3578
3579 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3580
3581         Fix #75472.
3582         * ecore.cs (SimpleName.GetSignatureForError): Add.
3583         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3584         (MemberAccess.GetSignatureForError): Add.
3585
3586 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3587  
3588         The big error and warning messages review.
3589         
3590         * anonymous.cs,
3591         * assign.cs,
3592         * attribute.cs,
3593         * class.cs,
3594         * codegen.cs,
3595         * convert.cs,
3596         * cs-parser.jay,
3597         * cs-tokenizer.cs,
3598         * decl.cs,
3599         * delegate.cs,
3600         * doc.cs,
3601         * driver.cs,
3602         * ecore.cs,
3603         * enum.cs,
3604         * expression.cs,
3605         * flowanalysis.cs,
3606         * iterators.cs,
3607         * literal.cs,
3608         * location.cs,
3609         * modifiers.cs,
3610         * namespace.cs,
3611         * parameter.cs,
3612         * pending.cs,
3613         * report.cs,
3614         * rootcontext.cs,
3615         * statement.cs,
3616         * support.cs,
3617         * tree.cs,
3618         * typemanager.cs: Updated.
3619         
3620         * class.cs: (MethodCore.SetYields): Moved here to share.
3621         (PropertyMethod.Define): Moved iterator setup here.
3622         
3623         * iterators.cs: Add orig_method to have full access to parent
3624         container.
3625
3626 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3627
3628         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3629         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3630         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3631         variable of struct type.
3632         * expression.cs (Unary.ResolveOperator): Update to change.
3633         (Indirection.VerifyFixed): Likewise.
3634         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3635         (ParameterReference.VerifyFixed): Value parameters are fixed.
3636         (This.VerifyFixed): Treat 'this' as a value parameter.
3637         * statement.cs (LocalInfo.IsFixed): Remove.
3638
3639 2005-07-01  Martin Baulig  <martin@ximian.com>
3640
3641         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3642         `ec.EmitThis ()' to get the correct scope.
3643
3644 2005-07-01  Martin Baulig  <martin@ximian.com>
3645
3646         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3647         instance is a ParameterReference; fixes #75299.
3648
3649 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3650
3651         Fix #75412.
3652         * expression.cs (Indexers.map): Remove.
3653         (Indexers.Append): Filter out inaccessible setters and getters.
3654         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3655
3656         Fix #75283.
3657         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3658         Refactored from ...
3659         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3660         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3661         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3662         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3663
3664 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3665
3666         Fix #75322
3667         * class.cs (FieldBase.GetInitializerExpression): One more field
3668         for backup.
3669
3670 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3671
3672         * pending.cs: Do not define a proxy if the base method is virtual,
3673         it will be picked up by the runtime (bug 75270).
3674
3675 2005-07-08  Martin Baulig  <martin@ximian.com>
3676
3677         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3678         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3679
3680 2005-07-07  Martin Baulig  <martin@ximian.com>
3681
3682         * generic.cs (ConstructedType.CheckConstraint): Use
3683         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3684         called recursively; fixes #75329.
3685
3686 2005-07-06  Martin Baulig  <martin@ximian.com>
3687
3688         * generic.cs (TypeManager.InferTypeArguments): Added support for
3689         anonymous methods; fixes #75461.
3690
3691 2005-07-01  Martin Baulig  <martin@ximian.com>
3692
3693         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3694         `ec.EmitThis ()' to get the correct scope.
3695
3696 2005-07-01  Martin Baulig  <martin@ximian.com>
3697
3698         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3699         instance is `This'; fixes #75299.
3700
3701 2005-06-30  Martin Baulig  <martin@ximian.com>
3702
3703         * class.cs (Indexer): Implement IIteratorContainer; added support
3704         for iterators in indexers.
3705
3706         * codegen.cs
3707         (EmitContext.CurrentIterator): Make this a property, not a field.
3708
3709         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3710
3711 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3712
3713         * pending.cs: Do not define a proxy if the base method is virtual,
3714         it will be picked up by the runtime (bug 75270).
3715
3716 2005-06-28  Martin Baulig  <martin@ximian.com>
3717
3718         * cs-parser.jay (interface_method_declaration): Avoid a
3719         reduce/reduce conflict by moving some of the code into a separate
3720         `interface_method_declaration_body' rule; fixes #75368.
3721
3722 2005-06-28  Martin Baulig  <martin@ximian.com>
3723
3724         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3725         array check after the check for TypeBuilder's.
3726
3727 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3728
3729         * convert.cs (FindMostEncompassedType): Add two trivial special
3730         cases (number_of_types == 0 || number_of_types == 1).
3731         (FindMostEncompasingType): Likewise.
3732
3733 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3734
3735         Some cleanups preparing for the fix of #75283.
3736         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3737         error testing.
3738         (EventExpr.InstanceResolve): Likewise.
3739         (EventExpr.DoResolve): Remove redundant checks.
3740
3741 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3742
3743         * class.cs: Small fix.
3744
3745 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3746
3747         Fix #75160.
3748         * class.cs (GetPartialBases): Fix return value check of
3749         part.GetClassBases.
3750
3751 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3752
3753         Ensure that partial classes are registered in their enclosing
3754         namespace.  Initial part of fix of #75160.
3755         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3756         Register declspace with namespace here, not in
3757         DeclSpace.RecordDecl.
3758         * cs-parser.jay: Pass namespace to RecordDecl.
3759         * class.cs (PartialContainer.Create): Likewise.
3760         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3761         called.
3762         * decl.cs (Declspace.RecordDecl): Remove.
3763         * namespace.cs (NamespaceEntry.DefineName): Remove.
3764
3765 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3766
3767         * rootcontext.cs: Reset TargetExt as well.
3768
3769 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3770
3771         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3772         -langversion:ISO-1.
3773
3774 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3775
3776         Fix #75080, cs0119.cs.
3777         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3778         of ...
3779         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3780         allowing ExprClass.Type and ExprClass.Namespace for
3781         ResolveFlags.VariableOrValue.
3782         (Expression.Resolve) [1-argument variant]: Change default resolve
3783         flags based on language version.
3784         (Expression.Error_UnexpectedKind): Use a simple string array
3785         rather than an ArrayList.
3786         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3787         not ExprClass.Type.
3788         (TypeOfVoid.DoResolve): Likewise.
3789         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3790         flags argument -- it always has the same value.
3791
3792 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3793
3794         Fix #75081.
3795         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3796         Use it in the error message.
3797         * assign.cs, expression.cs, statement.cs: Update.
3798
3799 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3800
3801         Fix #75088.
3802         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3803         the "almostMatchedMember" case too.
3804         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3805         that failed the accessibility checks to 'almost_match'.
3806
3807 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3808
3809         * attribute.cs: Use internal MethodBuilder methods to set
3810         ExactSpelling and SetLastError on PInvoke methods, instead
3811         of passing them via charset.  Fixes #75060.
3812
3813 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3814
3815         * parameter.cs (Parameter): Remove TODO comment.
3816         (Parameter.DefineParameter): Remove Location parameter.
3817         (Parameters.LabelParameters): Likewise.
3818         * class.cs (Constructor.Emit): Update to change.
3819         (MethodData.Emit): Likewise.
3820         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3821         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3822
3823 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3824
3825         * parameter.cs,
3826           Removed Parameters.Location and added Parameter.Location instead.
3827           Removed Location parameter from Emit() and GetSignature().
3828         * anonymous.cs,
3829           class.cs,
3830           cs-parser.jay,
3831           delegate.cs,
3832           iterators.cs,
3833           statement.cs :
3834           Modified all related calls.
3835
3836 2005-06-21  Martin Baulig  <martin@ximian.com>
3837
3838         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3839         left-hand side is not a nullable type; fixes #75328.
3840
3841 2005-06-21  Martin Baulig  <martin@ximian.com>
3842
3843         * typemanager.cs
3844         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3845         (TypeManager.GetFullNameSignature): Likewise.
3846
3847         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3848         `source.FullName' and `target.FullName' to check whether there are
3849         two conflicting definitions.
3850
3851 2005-06-21  Martin Baulig  <martin@ximian.com>
3852
3853         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3854         a BoxedCast - also for reference types - to be compatible with csc.
3855
3856 2005-06-21  Martin Baulig  <martin@ximian.com>
3857
3858         * expression.cs (MemberAccess.DoResolve): Add support for nested
3859         types in a generic instance; fixes #75320.
3860
3861 2005-06-20  Martin Baulig  <martin@ximian.com>
3862
3863         * generic.cs (TypeManager.InferType): Also walk the class
3864         hierarchy for generic instances; fixes #75261.
3865
3866 2005-06-17  Martin Baulig  <martin@ximian.com>
3867
3868         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3869         to make things work for corlib.
3870
3871 2005-06-15  Martin Baulig  <martin@ximian.com>
3872
3873         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3874         obsolete `SecurityAction' values.
3875
3876 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3877
3878         * rootcontext.cs: Reset TargetExt as well.
3879         
3880 2005-06-09  Martin Baulig  <martin@ximian.com>
3881
3882         * delegate.cs (Delegate.VerifyMethod): Added
3883         `MethodGroupExpr old_mg' argument; inherit its
3884         `HasTypeParameters'; fix #75085.
3885
3886 2005-06-09  Martin Baulig  <martin@ximian.com>
3887
3888         * expression.cs (Invocation.OverloadResolve): Correctly handle
3889         generic methods for the SetMemberIsUsed(); fix #75064.
3890
3891 2005-06-09  Martin Baulig  <martin@ximian.com>
3892
3893         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3894         fixes #75062.
3895
3896 2005-06-08  Martin Baulig  <martin@ximian.com>
3897
3898         * cs-parser.jay (nullable_type_or_conditional): If we put the
3899         nullable back and our `type' is a `ComposedCast', remove the
3900         nullable from it.  Fixes #75156.
3901
3902         * expression.cs (ComposedCast.RemoveNullable): New public method.
3903
3904 2005-06-08  Martin Baulig  <martin@ximian.com>
3905
3906         The big Iterators rewrite :-)
3907
3908         * iterators.cs: Rewrite this to use the anonymous methods framework.
3909
3910         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3911         before the TypeContainers; see 2test-21.cs.
3912
3913         * class.cs
3914         (TypeContainer.DefineType): Don't create a new EmitContext if we
3915         already have one (this only happens if we're an Iterator).
3916         (TypeContainer.Define): Also call Define() on all our iterators.
3917         (Method.CreateEmitContext): Added support for iterators.
3918
3919         * anonymous.cs
3920         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3921         (AnonymousContainer.CreateMethodHost): Moved here from
3922         AnonymousMethod and made abstract.
3923         (AnonymousContainer.CreateScopeType): New abstract method.
3924         (AnonymousContainer.IsIterator): New public property.
3925         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3926         get the ScopeTypeBuilder rather than manually defining it here. 
3927         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3928         iterators here.
3929
3930         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3931         before RootContext.DefineTypes().
3932
3933         * codegen.cs (EmitContext.RemapToProxy): Removed.
3934         (EmitContext.CurrentAnonymousMethod): Changed type from
3935         AnonymousMethod -> AnonymousContainer.
3936         (EmitContext.ResolveTopBlock): Protect from being called twice.
3937         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3938         (EmitContext.EmitThis): Removed the iterators hacks; use the
3939         anonymous methods framework for that.
3940
3941         * statement.cs
3942         (ToplevelBlock.Container): Make this a property, not a field.
3943         (ToplevelBlock.ReParent): New public method; move the
3944         ToplevelBlock into a new container.
3945         (Foreach.TemporaryVariable): Simplify.
3946
3947 2005-06-05  Martin Baulig  <martin@ximian.com>
3948
3949         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3950         (Block.AddTemporaryVariable): New public method; creates a new
3951         `LocalInfo' for a temporary variable.
3952         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3953         variables here.
3954         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3955         non-iterator variables.
3956
3957 2005-06-05  Martin Baulig  <martin@ximian.com>
3958
3959         * statement.cs (Foreach.TemporaryVariable): Create the
3960         LocalBuilder in the Emit phase and not in Resolve since in some
3961         situations, we don't have an ILGenerator during Resolve; see
3962         2test-19.cs for an example.
3963
3964 2005-06-04  Martin Baulig  <martin@ximian.com>
3965
3966         The big Foreach rewrite - Part II.
3967
3968         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3969         with `PropertyInfo ienumerator_getcurrent'.
3970
3971         * codegen.cs (VariableStorage): Removed.
3972
3973         * statement.cs
3974         (Foreach): Derive from Statement, not ExceptionStatement.
3975         (Foreach.CollectionForeach): New nested class.  Moved all the code
3976         dealing with collection foreach here.
3977         (Foreach.ForeachHelperMethods): Removed.
3978         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3979
3980 2005-05-23  Martin Baulig  <martin@ximian.com>
3981
3982         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3983         don't need to.  Fix #75014.
3984
3985 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3986
3987         Improve user-defined conversion handling.
3988         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3989         applicable operators.
3990         (AddConversionOperators): New.  Helper for GetConversionOperators.
3991         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3992         there is only one most encompassed/encompassing type.
3993         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3994         "applicable operator" handling.
3995         (UserConversion): Move cache here from GetConversionOperators.
3996         Directly cache the chosen operator, rather than the whole
3997         MethodGroup.
3998         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3999         case.  Allow conversion of decimal to sbyte and byte too.
4000         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4001         New static methods.  Used to avoid allocating EmptyExpressions in
4002         convert.cs.
4003
4004 2005-05-24  Duncan Mak  <duncan@novell.com>
4005
4006         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4007         another class, used in Convert.ExplicitNumericConversion.
4008         (CastToDecimal): New class, similar to above, but casts to
4009         System.Decimal, used in Convert.ImplicitNumericConversion and also
4010         in explicit convesion from double/float to decimal.
4011
4012         * convert.cs (ImplicitNumericConversion): Handle implicit
4013         conversions to System.Decimal.
4014         (ExplicitNumericConversion): handle explicit conversions to
4015         System.Decimal.
4016
4017         This fixes #68711.
4018         
4019 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4020
4021         * typemanager.cs: Do not throw an exception in the TypeBuilder
4022         case, we take care of it on the TypeCode.
4023
4024 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4025         
4026         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4027         is back.
4028         
4029         * cs-parser.jay: Catch more lexical errors.
4030         
4031         * report.cs: Add one more Error method.
4032         
4033         * rootcontext.cs,
4034         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4035
4036 2005-05-20  Martin Baulig  <martin@ximian.com>
4037
4038         * class.cs (TypeContainer.CircularDepException): Removed.
4039         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4040         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4041         (CS0146) and interface (CS0529) dependencies here.
4042
4043 2005-05-20  Martin Baulig  <martin@ximian.com>
4044
4045         * expression.cs (New.DoResolve): Move the CS0712 check above the
4046         CS0144 check; otherwise it can never be reached.
4047
4048 2005-05-20  Martin Baulig  <martin@ximian.com>
4049
4050         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4051
4052 2005-05-20  Martin Baulig  <martin@ximian.com>
4053
4054         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4055
4056         * typemanager.cs (TypeManager.IsAttributeType): New public method.
4057
4058 2005-05-19  Martin Baulig  <martin@ximian.com>
4059
4060         * delegate.cs
4061         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4062         to disable error reporting.
4063
4064         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4065         here since we don't want to report an error; see the new test-336.cs.
4066
4067 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4068
4069         * statement.cs (ToplevelBlock.GetParameterReference)
4070         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4071         Move here from class Block.
4072         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4073         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4074
4075 2005-05-18  Martin Baulig  <martin@ximian.com>
4076
4077         Fix #74978.
4078
4079         * flowanalysis.cs
4080         (FlowBranching.Reachability): Add non-static public And() and Or()
4081         methods.
4082         (FlowBranchingSwitch): New class; do the `break_origins' thing
4083         like in FlowBranchingLoop.
4084         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4085         reachability, not just locals and parameters.
4086         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4087         switch; MergeBreakOrigins() now takes care of that.
4088
4089 2005-05-18  Martin Baulig  <martin@ximian.com>
4090
4091         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4092         a loop and may leave it, reset the barrier; fixes #74974.
4093
4094 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4095
4096         Fix test-382.cs.  Emit values of decimal constants.
4097         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4098         Carved out of ...
4099         (TypeContainer.AddField): ... this.
4100         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4101         with initializers to include 'Const's.
4102         (ClassPart.RegisterFieldForInitialization): Forward to
4103         PartialContainer.
4104         * const.cs (Const.Const): Pass initializer to base class.
4105         (Const.Define): In case of decimal constants, register them for
4106         initialization in a static constructor.
4107
4108 2005-05-14  Martin Baulig  <martin@ximian.com>
4109
4110         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4111         do not call ResolveUnreachable() on unreachable statements in
4112         here, see the comment in the source code.
4113
4114 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4115
4116         Fix #74934.
4117         * expression.cs (BinaryResolveOperator): If one of the operands of
4118         an equality comparison is 'null' and the other is a pointer type,
4119         convert the null to a NullPointer.
4120         * convert.cs (ImplicitReferenceConversion): If the expression is a
4121         NullLiteral and the target type is a pointer type, return a
4122         NullPointer instead.
4123         (ImplicitConversionStandard): Likewise.
4124
4125 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4126         
4127         * cs-parser.jay: Set readonly context based on special constructs.
4128         
4129         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4130         readonly variable error handling.
4131         
4132         * rootcontext.cs (EmitCode): Don't verify members when error
4133         occurred.
4134         
4135         * statement.cs (LocalInfo): Add reaodnly context information.
4136         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4137
4138 2005-05-17  Martin Baulig  <martin@ximian.com>
4139
4140         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4141         #70970. 
4142
4143 2005-05-13  Martin Baulig  <martin@ximian.com>
4144
4145         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4146         handle unreachable blocks.
4147
4148 2005-05-13  Martin Baulig  <martin@ximian.com>
4149
4150         * class.cs
4151         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4152         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4153         #74905. 
4154
4155 2005-05-13  Martin Baulig  <martin@ximian.com>
4156
4157         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4158         instance variable, not a local.  Fix #74873.
4159         (Block.ResolveUnreachable): Set it to true here.
4160
4161 2005-05-12  Martin Baulig  <martin@ximian.com>
4162
4163         * cs-parser.jay (property_declaration): Pass the `current_class',
4164         not the `current_container' to Property's .ctor.  Fixes #74912.
4165
4166 2005-05-11  Martin Baulig  <martin@ximian.com>
4167
4168         * typemanager.cs (Closure): Copy this from MCS and merge all the
4169         GMCS-specific changes into it.
4170
4171 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4172
4173         Fix #74920.
4174         * typemanager.cs (unmanaged_enclosing_types): New.
4175         (IsUnmanagedType): Avoid infloops by using
4176         'unmanaged_enclosing_types' to talk with recursive invocations.
4177
4178 2005-05-11  Duncan Mak  <duncan@novell.com>
4179
4180         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4181         continuing to process for 'arg'.
4182         (handle_preprocessing_directive): Check the argument of the #endif
4183         directive and report error CS1025 if there are any trailing
4184         characters.
4185
4186         According to the C# spec, having even whitespace after the #endif
4187         directive is illegal; however, because we call arg.TrimEnd ()
4188         beforehand, we have the same behavior as csc, allowing whitespace
4189         after the directive.
4190
4191         Fixes #74892.
4192
4193 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4194
4195         Fix #74863.
4196         
4197         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4198         (Constructor.GetObsoleteAttribute): Implemented correctly.
4199
4200 2005-05-10  Martin Baulig  <martin@ximian.com>
4201
4202         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4203         resolve the type; fixes #74864.
4204         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4205         in DoResolve(); fixes #74862.
4206
4207 2005-05-10  Martin Baulig  <martin@ximian.com>
4208
4209         * support.cs (ReflectionParameters.ParameterModifier): Use
4210         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4211         and `ParameterAttributes.In'.  Fixes #74884.
4212
4213 2005-05-10  Martin Baulig  <martin@ximian.com>
4214
4215         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4216         the cache if we're just looking for `MemberTypes.NestedType' in a
4217         generic instance.
4218
4219         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4220         constraints if we're still resolving the type tree.
4221         (Expression.MemberLookup): If we're resolving the type tree, only
4222         look for `MemberTypes.NestedType' since we're only interested in
4223         getting types.
4224
4225         * class.cs (TypeContainer.DefineType): Don't resolve the type
4226         parameters here; do this later in ResolveType() after the type
4227         tree has been resolved.
4228         (TypeContainer.ResolveType): New public method; this is called
4229         after the type tree is resolved and before the types are being
4230         populated.  We resolve the generic constraints here.
4231         (TypeContainer.DoDefineMember): Check the constraints on our base
4232         class and interfaces.
4233
4234         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4235         set the `ResolvingTypeTree' flag on the EmitContext.
4236
4237         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4238
4239 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4240
4241         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4242         
4243         * expression.cs (Argument.GetParameterModifier): Turned to property.
4244         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4245         
4246         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4247         its C# equivalent.
4248         
4249 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4250
4251         Fix #74852.
4252         * decl.cs (MemberCache.AddMethods): Register override methods,
4253         rather than non-override methods.
4254         * typemanager.cs (RegisterOverride): New.
4255         (IsOverride): Update.
4256
4257 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4258
4259         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4260
4261 2005-05-06  Martin Baulig  <martin@ximian.com>
4262
4263         * attribute.cs
4264         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4265         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4266
4267 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4268
4269         Fix #73105.
4270         
4271         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4272         recursive declaration.
4273         
4274         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4275         
4276 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4277
4278         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4279         
4280         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4281
4282 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4283
4284         Fix #74797.
4285         * decl.cs (DeclSpace.FamilyAccessible): 
4286         Use TypeManager.IsNestedFamilyAccessible.
4287
4288         Fix reopened #64812.
4289         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4290         internal'.
4291
4292 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4293             Abin Thomas  <projectmonokochi@rediffmail.com>
4294             Anoob V E  <projectmonokochi@rediffmail.com>
4295             Harilal P R  <projectmonokochi@rediffmail.com>
4296
4297         Fix #64812.
4298         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4299         allow access to all static members.
4300
4301 2005-05-04  Martin Baulig  <martin@ximian.com>
4302
4303         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4304
4305 2005-05-04  Martin Baulig  <martin@ximian.com>
4306
4307         Fix #74655.
4308
4309         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4310         section at the end; make things work if `default' is not the last
4311         section.        
4312
4313 2005-05-04  Martin Baulig  <martin@ximian.com>
4314
4315         Fix #70400.
4316
4317         * statement.cs (Switch): Replaced the `got_default' field with a
4318         `default_section' one.
4319         (Switch.CheckSwitch): Set `default_section' here.
4320         (Switch.Resolve): If we're a constant switch and the constant is
4321         not found, use the default section.
4322
4323 2005-05-03  Martin Baulig  <martin@ximian.com>
4324
4325         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4326
4327         * statement.cs (Foreach.ArrayForeach): New nested class.
4328         (Foreach.TemporaryVariable): New nested class.
4329         (Foreach.EmitArrayForeach): Removed; this is now in the new
4330         ArrayForeach class.
4331
4332 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4333
4334         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4335         more conservative.
4336         (VerifyPendingMethods): Revert change below.
4337
4338         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4339         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4340         that used to trigger warning -28.  Remove warning -28.
4341         * expression.cs (Invocation.OverloadResolve): Use
4342         TypeManager.IsOverride to distinguish override methods.
4343
4344         Fix #74773.
4345         * pending.cs (VerifyPendingMethods): If a base type implements the
4346         requested interface, don't bother checking individual methods of
4347         the base type.  As a side-effect, this prevents the creation of
4348         unnecessary proxies.
4349
4350 2005-05-02  Martin Baulig  <martin@ximian.com>
4351
4352         Fix #70182.
4353
4354         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4355         Also `And' the locals if the old vector is null.
4356         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4357         null; in this case we basically reset all the variables.        
4358
4359 2005-05-02  Martin Baulig  <martin@ximian.com>
4360
4361         Fix #74529.
4362
4363         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4364         Added `FlowBranching branching' argument; always `and' the
4365         variables instead of `or'ing them unless we're an infinite loop.
4366
4367         * statement.cs (While.Resolve): Create a new sibling unless we're
4368         infinite.       
4369
4370 2005-05-02  Martin Baulig  <martin@ximian.com>
4371
4372         Fix #70140.
4373
4374         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4375         arguments; use it instead of creating a new TopLevelBlock.
4376         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4377         our ConstructorInitializer.
4378
4379         * statement.cs
4380         (TopLevelBlock.TopLevelBranching): New public property.
4381         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4382         and create our `TopLevelBranching'.
4383
4384         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4385         anonymous method host, use `block.TopLevelBranching' rather than
4386         creating a new branching.
4387
4388 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4389
4390         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4391         a ScopeInfo, if any of the current children is a child of the new
4392         entry, move those children there.
4393
4394 2005-04-30  Martin Baulig  <martin@ximian.com>
4395
4396         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4397         at the beginning of a SwitchSection.  Fix #73335.
4398
4399 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4400
4401         Fix #74378
4402         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4403         
4404         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4405         (FieldExpr.DoResolve): Obsolete members are ignored for field
4406         initializers.
4407         
4408 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4409
4410         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4411         of arrays detection.
4412
4413         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4414         verification.
4415         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4416
4417         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4418         arrays report.
4419
4420 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4421
4422         * cs-parser.jay: Use the prefered version of -unsafe in error
4423         message.
4424
4425 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4426
4427         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4428         circumstances.
4429
4430 2005-04-20  John Luke  <john.luke@gmail.com>
4431
4432         * driver.cs: fix typo in error message, --outout to --output
4433
4434 2005-04-30  Martin Baulig  <martin@ximian.com>
4435
4436         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4437         handle the .NET 2.x security attributes.
4438
4439 2005-04-30  Martin Baulig  <martin@ximian.com>
4440
4441         * typemanager.cs
4442         (TypeManager.ExpandInterfaces): Don't add things twice.
4443
4444         * class.cs
4445         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4446
4447 2005-04-29  Martin Baulig  <martin@ximian.com>
4448
4449         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4450
4451         * anonymous.cs: Added support for anonymous generic methods.
4452
4453 2005-04-29  Martin Baulig  <martin@ximian.com>
4454
4455         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4456         generic instances.
4457
4458 2005-04-29  Martin Baulig  <martin@ximian.com>
4459
4460         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4461
4462         * expression.cs (New.DoResolve): Fix the CS0304 check.
4463
4464 2005-04-29  Martin Baulig  <martin@ximian.com>
4465
4466         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4467         naming schema.
4468
4469         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4470         explicit interface implementation, compare the interface types.
4471         (MethodData.Define): Use the new naming scheme from the latest
4472         .NET 2.x beta2.
4473         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4474
4475         * decl.cs (MemberName.GetMemberName): Removed.
4476         (MemberName.MethodName, FullName): New properties.
4477
4478 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4479
4480         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4481
4482 2005-04-22  Martin Baulig  <martin@ximian.com>
4483
4484         * generic.cs (GenericMethod): Create the EmitContext in the
4485         `Define()'; in `Define(MethodBuilder)', create the type parameters
4486         before calling `Define()'.  Fixes #73933.
4487
4488 2005-04-22  Martin Baulig  <martin@ximian.com>
4489
4490         * generic.cs
4491         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4492         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4493
4494         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4495         ConstructedType, check its constraints.
4496
4497 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4498
4499         * codegen.cs (InRefOutArgumentResolving): New field.
4500         
4501         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4502         fields outside contructor.
4503         
4504         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4505         
4506 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4507
4508         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4509         parameter code was not completed ever, so it was not as up-to-date
4510         as local variables.  Must finish it.
4511
4512         The bug fix was to compare the Toplevel of the block, not the
4513         current block.  Thanks for Ben for pointing this out. 
4514
4515 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4516
4517         * decl.cs (AddMethods): Use the declaring type of the problem
4518         method to determine if we want to squash a warning.
4519
4520 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4521
4522         * attribute.cs: Removed debug output.
4523
4524         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4525         
4526         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4527         Report.Stderr.
4528         
4529 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4530
4531         Fix #74481.
4532         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4533         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4534         all null comparisons against reference types.
4535
4536 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4537
4538         Fix# 74565
4539         * class.cs (TypeContainer.CircularDepException) New nested
4540         exception class.
4541         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4542         (TypeContainer.DefineType): Removed error, reset InTransit before
4543         exit.
4544         (Class.DefineType): Throw exception when is in Transit.
4545         Catch exception and report error.
4546         (Struct.DefineType): Throw exception when is in Transit.
4547         Catch exception and report error.
4548         (Interface.DefineType): Throw exception when is in Transit.
4549         Catch exception and report error.
4550
4551         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4552         handle nested exception handlers.
4553
4554         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4555         a catch.
4556
4557         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4558         InFinally and InCatch storage.
4559
4560         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4561         (Catch.Resolve): Set and Restore ec.InCatch.
4562         (Try.Resolve): Set and Restore ec.InFinally.
4563         (Try.HasCatch): True when try has catch.
4564
4565 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4566
4567         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4568           for the same event member, so exclude such cases from warning 419.
4569           Fixed bug #74633.
4570
4571 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4572
4573         * expression.cs (Binary.ResolveOperator): Apply patch from John
4574         Luke to fix bug 59864: operators &, | and ^ on enumerations
4575         require that the same enum type on both sides.
4576
4577         * driver.cs: Add warnings to old flag usage, this is to assist
4578         people who produce Makefiles and hope that the Makefiles will be
4579         used on Windows.
4580
4581         * class.cs (TypeContainer.EmitType): Moved the definition of the
4582         special $PRIVATE$ field from the resolve phase to the Emit phase.
4583         During resolve we do not know if we are a struct with
4584         HasExplicitLayout, we know this only after the attributes for the
4585         type are emitted.
4586
4587         Set the FieldOffset to zero on the dummy field that we create for
4588         the class.   Fixes 74590.
4589
4590 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4591
4592         Fix #73834.
4593         * ecore.cs (PropertyExpr.resolved): New.
4594         (DoResolve): Use it to handle a case of double resolution here.
4595         Handle a case of identical-name-and-type-name.
4596         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4597         resolution by storing the results of expression resolution back
4598         into the "probes" array.
4599
4600 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4601
4602         Fix cs0208-7.cs and cs0208-8.cs.
4603         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4604         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4605         error reporting to point out the reason a struct is not unmanaged.
4606
4607 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4608
4609         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4610           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4611
4612 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4613
4614         Fix #74528.
4615         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4616         IdenticalNameAndTypeName here.
4617         (EventExpr.InstanceResolve): Likewise.
4618
4619 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4620
4621         C# 2.0 DefaultCharSetAttribute implementation
4622         
4623         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4624         which allows us to set GlobalNamespace for every resolve.
4625         (Attribute.ResolveArguments): Cut from Resolve.
4626         (Attribute.GetCharSetValue): Returns CharSet named argument.
4627         (Attribute.DefinePInvokeMethod): Gets default charset from
4628         module settings.
4629         (GlobalAttribute.ResolveAsTypeStep): Override.
4630         (GlobalAttribute.ResolveArguments): Override.
4631         
4632         * class.cs (TypeAttr): Is protected.
4633         
4634         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4635         (ModuleClass.DefaultCharSetType): New memeber.
4636         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4637         
4638         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4639         charset from module.
4640         
4641         * delegate.cs (TypeAttr): Override.
4642         (Delegate.DefineType): Use this TypeAttr.
4643         
4644         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4645         at very early stage (before types are defined) to resolve model
4646         module attributes. It will probably not work with corlib but it
4647         should be ok.
4648         
4649         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4650         charset from module.
4651         
4652         * typemanager.cs (default_charset_type): New type.
4653
4654 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4655
4656         * decl.cs (MemberCache.AddMethods): Don't warn if
4657         System.Object.Finalize has buggy MethodAttributes.
4658
4659         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4660         removed below.
4661
4662 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4663
4664         * doc.cs : detect ambiguous reference to overloaded members.
4665           Fixed bug #71603. MS 1.1 csc does not detect it.
4666
4667 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4668
4669         * doc.cs : delegates must not be referenced with parameters.
4670           Fixed bug #71605.
4671
4672 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4673
4674         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4675
4676 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4677
4678         * driver.cs (MainDriver): Stop processing if the CLS stage found
4679         errors. 
4680
4681         (CompilerCallableEntryPoint.InvokeCompiler): Always
4682         reset after execution;   Take a TextWriter argument for the
4683         output.
4684
4685         * report.cs: Use the error stream instead of hardcoding stderr. 
4686
4687 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4688
4689         * class.cs: Reduce code paths to test, too small of an
4690         optimization to make it worth the extra testing.  Always perform
4691         it. 
4692
4693 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4694
4695         Fix #74510.
4696         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4697         operators that had errors reported on them.
4698
4699 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4700
4701         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4702         argument types.
4703         (Attribute.Resolve): Add named argument type checking.
4704         
4705         * class.cs (FixedField.Define): Use IsPrimitiveType
4706         
4707         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4708         
4709         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4710         unsafe parameter types.
4711         
4712         * statement.cs (Using.ResolveExpression): Add better error description.
4713         
4714         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4715         
4716 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4717
4718         Fix #74484.
4719         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4720         AttributeUsageAttribute in the emitcontext of the attribute class,
4721         not in the emitcontext of the attributable entity it was attached to.
4722         * cs-parser.jay: Use 'current_class', not 'current_container',
4723         when creating a GlobalAttribute.
4724
4725 2005-04-08  Alp Toker  <alp@atoker.com>
4726
4727         * pending.cs: The fix to #58413 failed to compile methods implementing
4728         interfaces with/without params modifiers and vice versa, even though
4729         params modifiers aren't part of the signature. Make the modifier check
4730         less strict as in csc.
4731
4732 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4733             Anoob V E  <projectmonokochi@rediffmail.com>
4734             Harilal P R  <projectmonokochi@rediffmail.com>
4735
4736         Fix #58413.
4737         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4738         modifiers of pending methods.
4739         (PendingImplementation.PendingImplementation): Initialize it.
4740         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4741         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4742         with ParameterData.  Add check for modifiers.
4743         * class.cs (MethodData.Define): Update to changes.
4744
4745 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4746
4747         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4748
4749 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4750
4751         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4752         property.
4753         
4754         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4755         
4756         * rootcontext.cs,
4757         * typemanager.cs: Registered RequiredAttributeAttribute.
4758         
4759 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4760
4761         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4762         Warning CS0169 is back at level 3.
4763         (IMethodData.SetMemberIsUsed): New method.
4764         
4765         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4766         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4767         
4768         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4769
4770         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4771         contants.
4772         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4773         is used.
4774         
4775         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4776         is used.
4777         
4778         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4779         to avoid the problems with nested types.
4780
4781 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4782             Anoob V.E  <projectmonokochi@rediffmail.com>
4783             Harilal P.R  <projectmonokochi@rediffmail.com>
4784             Raja R Harinath  <rharinath@novell.com>
4785
4786         Fix #73820.
4787         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4788         attribute.
4789         * typemanager (GetConstructor): Make public.
4790
4791 2005-04-05  John Luke  <john.luke@gmail.com>
4792             Raja R Harinath  <rharinath@novell.com>
4793
4794         Fix #62232.
4795         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4796         struct too.  Return false quicker in a few cases.
4797         (VerifyUnManaged): Use it.
4798
4799 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4800
4801         Fix #74041.
4802         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4803         not 'unreachable_seen'.
4804
4805 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4806
4807         * attribute.cs (Attribute.GetValue): Removed unused.
4808         
4809         * codegen.cs (CodeGen.TrimExt): Removed unused.
4810         
4811         * cs-parser.jay (output): Removed unused.
4812         
4813         * cs-tokenizer.cs (hex_digits): Removed unused.
4814         
4815         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4816         
4817         * expression.cs (Indirection.LoadExprValue): Removed unused.
4818         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4819         
4820         * iterators.cs (Iterator.param_types): Removed unused.
4821         
4822         * statement.cs (Goto.block): Removed unused.
4823         (ToplevelBlock.did): Removed unused.
4824         (Switch.ResolveConstantSwitch): Removed unused.
4825
4826 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4827
4828         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4829         resetting thingy.
4830
4831 2005-04-19  Martin Baulig  <martin@ximian.com>
4832
4833         Merged r42462 from MCS and made it work for GMCS.
4834
4835         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4836
4837         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4838
4839 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4840
4841         Fix #74232 and cs0208-3.cs.
4842         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4843         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4844         unmanaged type.  Don't use FieldBuilders when 't' is a
4845         TypeBuilder.  Use ModFlags and MemberType fields.
4846         * class.cs (MemberBase.member_type): Rename from MemberType.
4847         (MemberBase.MemberType): New property.  Determines member_type on
4848         demand.
4849         (MemberBase.DoDefine): Don't initialize MemberType here.
4850         (FieldMember.Define): Likewise.
4851
4852 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4853
4854         Fix #74241
4855         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4856         Attributes are emitted there.
4857         
4858 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4859
4860         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4861         keyword in 'partial enum' too.
4862         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4863         is not allowed).
4864         Report from Kamil Skalski <nazgul@omega.pl>.
4865
4866         Fix #74309.
4867         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4868         have partial containers too.
4869
4870         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4871         in block' checks to Block.CheckInvariantMeaningInBlock.
4872         * statement.cs (Block.GetKnownVariableInfo): Make private.
4873         (Block.IsVariableUsedInChildBlock): Remove.
4874         (Block.IsVariableUsedInBlock): Likewise.
4875         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4876         conflicting declaration.
4877         (Block.AddVariable): Make error messages less long-winded and more
4878         specific.  Show location of conflicting declaration.
4879         * parameter.cs (Parameters.Location): New readonly property.
4880
4881 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4882
4883         Clean up semantics of invoking ResolveMemberAccess.
4884         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4885         can have an instance, ensure that we pass in a non-TypeExpression
4886         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4887         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4888         argument.  Update to changes and simplify.
4889         (FieldExpr.Emitinstance): Remove CS0120 check.
4890         (PropertyExpr.EmitInstance): Likewise.
4891         * expression.cs (Argument.Resolve): Likewise.
4892         (Invocation.DoResolve): Update to changes in semantics of
4893         InstanceExpression.
4894
4895 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4896
4897         Fix #74241
4898         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4899         customization.
4900         
4901         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4902
4903 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4904
4905         Fix difference in behaviour with commandline invocation.
4906         * driver.cs (Driver.Reset): New.
4907         (CompilerCallableEntryPoint): Call it.
4908
4909         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4910         variable" warnings if the boolean expression failed to resolve.
4911
4912 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4913
4914         * attribute.cs: Fix the union of several permissions when some of them
4915         are unrestricted (so the result isn't an unrestricted permission set).
4916         Fix #74036.
4917
4918 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4919
4920         * ecore.cs (MemberExpr): New class.  Convert from interface
4921         IMemberExpr.
4922         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4923         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4924         error checks.
4925         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4926         (MethodGroupExpr.IsExplicitImpl): Remove.
4927         (Expression.GetFieldFromEvent): Remove.
4928         (SimpleName.MemberStaticCheck): Remove.
4929         (SimpleName.DoSimpleNameResolve): Update to changes.
4930         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4931         (MemberAccess.IdenticalNameAndTypeName): Remove.
4932         (MemberAccess.error176): Move to MemberExpr.
4933         (MemberAccess.DoResolve): Update to changes.
4934         (BaseAccess.DoResolve): Likewise.
4935
4936 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4937
4938         C# 2.0 Conditional attribute class implementation
4939         
4940         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4941         Analyzes class whether it has attribute which has ConditionalAttribute
4942         and its condition is not defined.
4943         
4944         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4945         (Class.IsExcluded): New method. Search for at least one defined
4946         condition in ConditionalAttribute of attribute class.
4947
4948 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4949
4950         * ecore.cs (PropertyExpr): Derive from Expression, not
4951         ExpressionStatement.
4952         (PropertyExpr.EmitStatement): Remove.
4953
4954 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4955
4956         Fix #74060.
4957         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4958         internal field "value__" of an enum be private.  The examples for
4959         "value__" that I found on MSDN all used FieldAttributes.Private.
4960
4961         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4962         Don't mention IL method attribute names.
4963
4964         Fix #47991.  Remove a TODO.
4965         * statement.cs (Block.Toplevel): Make into a field.
4966         (Block.Parameters): Move into ToplevelBlock.
4967         (Block.known_variables): Rename from child_variable_names.
4968         (Block.Block): Remove variants that take Parameters.  Initialize
4969         'Toplevel' with the immediately surrounding toplevel block.
4970         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4971         LocalInfo parameter.
4972         (Block.GetKnownVariableInfo): New.
4973         (Block.IsVariableNameUsedInChildBlock): Update.
4974         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4975         the block, even though it may not be in scope.
4976         (Block.AddVariable): Remove Parameters parameter.  Use
4977         Toplevel.Parameters instead.
4978         (Block.AddConstant): Remove Parameters parameter.
4979         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4980         (Block.IsParamaterReference): Likewise.
4981         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4982         (ToplevelBlock.Parameters): New.  Moved from Block.
4983         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4984         initialize Parameters to a non-null value.
4985         * cs-parser.jay: Update to changes.
4986         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4987         simple names that mean different things in the same block.  Use
4988         Block.IsVariableNameUsedInBlock.
4989
4990 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4991
4992         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4993
4994 2005-03-26  Raja R Harinath  <harinath@acm.org>
4995
4996         Fix #73038.
4997         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4998         fails to resolve, ensure that the LHS is still resolved as an
4999         lvalue.
5000
5001 2005-03-25  Raja R Harinath  <harinath@acm.org>
5002
5003         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5004         ec.ContainerType.
5005         (Enum.current_ec): Remove.
5006         (Enum.LookupEnumValue): Remove EmitContext argument.
5007         Just uses the one created during DefineType.
5008         (Enum.FindMembers): Update.
5009         * expression.cs (MemberAccess.DoResolve): Update.
5010
5011 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5012
5013         * assign.cs (Assign.DoResolve): Check for CS1717 when
5014         source and target are same (uses Equals).
5015
5016         * expression.cs (LocalVariableReference, ParameterReference,
5017         This): Implemented Equals, GetHashCode.
5018
5019         * statement.cs (Block.GetParameterReference): Removed useless
5020         local variable.
5021
5022 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5023
5024         Fix cs0128.cs
5025         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5026         blocks before deciding whether the error is cs0136 or cs0128.
5027
5028         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5029         (using_alias_directive, using_namespace_directive): Pass
5030         MemberName, not an expression to Namespace.UsingAlias and
5031         Namespace.Using.
5032         (MakeName): Use the MemberName of the namespace.
5033         * namespace.cs (Namespace.MemberName): New.
5034         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5035         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5036         Likewise.
5037         * decl.cs (MemberName.Name): Make readonly.
5038         (MemberName.FromDotted): New "constructor".
5039         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5040         (MemberCore.Name): Compute from MemberName on demand.
5041         (MemberCore.SetMemberName): Provide a way to change the
5042         MemberName.
5043         (MemberCore.AddToContainer): Don't take a fullname parameter.
5044         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5045         fully qualified name of the container to the member name.
5046         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5047         only if the type is a member of the root container.
5048         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5049         MemberName.Left rather than searching for an embedded ".".
5050         (PartialContainer.CreatePart): Update to changes in RootContext.
5051         (MemberBase.ShortName): Turn into a property.  Use
5052         MemberCore.SetMemberName.
5053         (MemberBase.ExplicitInterfaceName): Remove.
5054         (MemberBase.UpdateMemberName): Remove.
5055         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5056         (PropertyBase.SetMemberName): New override.
5057         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5058         (Tree.GetDecl): New.
5059         (Tree.AllDecls): Rename from Decls.
5060         * attribute.cs, enum.cs, report.cs: Update to changes.
5061         * driver.cs (MainDriver): Use MemberName.FromDotted on
5062         RootContext.MainClass.
5063
5064 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5065
5066         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5067         checks.
5068
5069         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5070
5071 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5072
5073         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5074         property accessor modifiers.
5075
5076         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5077         fixed buffer attribute (CS1716).
5078         (PropertyMethod.HasCustomAccessModifier): When property accessor
5079         has custom modifier.
5080
5081         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5082         modifiers.
5083         (PropertyExpr.DoResolveLValue): Add CS0272.
5084
5085 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5086
5087         * convert.cs: When converting to a pointer, use the proper Conv.U
5088         or Conv.I depending on the source data type.
5089
5090         * cs-tokenizer.cs: Make the size for large decimal constants,
5091         fixes #72957.
5092
5093 2005-03-17  Martin Baulig  <martin@ximian.com>
5094
5095         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5096         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5097
5098 2005-03-17  Martin Baulig  <martin@ximian.com>
5099
5100         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5101         to bool so we can return an error condition.
5102         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5103         returned an error.
5104
5105 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5106
5107         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5108         attributes.
5109
5110 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5111
5112         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5113         Refactor to avoid traversing the list of assemblies, and to avoid
5114         string concatenation.
5115         * typemanager.cs (guid_attr_type): Remove.
5116         (negative_hits, pointers, references): Remove hashes.
5117         (type_hash): New.
5118         (GetConstructedType): New.  Uses type_hash to handle constructed
5119         types (arrays, references, pointers).
5120         (GetReferenceType, GetPointerType): Use it.
5121         (GetNestedType): New.  Uses type_hash to handle nested types of
5122         reflected types.
5123         (LookupType, LookupTypeDirect): Remove.
5124         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5125         'types' hash and LookupTypeReflection directly.
5126         (params_string, params_object): Use GetConstructedType.
5127         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5128         top-level types.
5129         (Namespace.Lookup): Use cached_types.
5130         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5131         provided by old TypeManager.LookupType.
5132         * rootcontext.cs (MakeFQN): Remove.
5133         * decl.cs (DeclSpace.MakeFQN): Likewise.
5134         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5135         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5136         TypeManager.GetConstructedType.
5137         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5138
5139 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
5140
5141         * cs-parser.jay: Fix build.
5142
5143 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5144
5145         * class.cs (TypeContainer.CircularDepException) New nested
5146         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5147
5148         * cs-parser.jay: Reports CS1527 for any namespace element.
5149
5150         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5151         Added CS0407.
5152
5153         * expression.cs (ParameterReference.IsAssigned): Changed error to
5154         CS0269.
5155         (Error_WrongNumArguments): Moved CS0245 detection here.
5156
5157         * statement.cs (Return.Resolve): Add CS1622 report.
5158
5159 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5160
5161         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5162
5163 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5164
5165         * attribute.cs expression.cs: Get rid of some allocations.
5166
5167 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5168
5169         * doc.cs : just eliminate the latest change.
5170
5171 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5172
5173         * doc.cs : commented out the latest change. It breaks xml-030.cs
5174
5175 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5176
5177         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5178           fail. So invoke CreateType() in FindDocumentedType().
5179
5180 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5181
5182         * cs-tokenizer.cs : added IsKeyword().
5183         * doc.cs : Detect keyword incorrectly used as identifier.
5184           Allow identifiers prefixed by @.
5185
5186 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5187
5188         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5189         It caused exception in namespace resolving (again!).
5190         
5191         * class.cs (Class.ctor): Removed exit.
5192         (PropertyMethod.ctor): ditto.
5193         
5194         * codegen.cs (Codegen.Reset): Reset static data.
5195         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5196         
5197         * cs-tokenizer.cs (Cleanup): Removed.
5198         
5199         * driver.cs (GetSystemDir): Rewrote to one line command.
5200         It caused problem with unloaded dynamic modules.
5201         (UnixParseOption): Removed Exit.
5202         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5203         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5204         Now can be mcs used as library.
5205         
5206         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5207         empty location.
5208         
5209         * location.cs (Reset): Reset static data.
5210         
5211         * namespace.cs (Reset): Reset static data.
5212         
5213         * report.cs (Report.Reset): Reset static data.
5214         
5215         * rootcontext.cs (RootContext.Reset): Reset static data.
5216         
5217         * tree.cs (RootTypes.ctor): Use Location.Null
5218         
5219         * typemanager.cs (TypeManager.Reset): Reset static data.
5220         (CoreLookupType): Removed Exit.
5221         (TypeHandle.Reset): Reset static data.
5222         
5223 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5224
5225         Fix #73516.
5226         * typemanager.cs (ComputeNamespaces): Import namespaces from
5227         referenced modules too.
5228
5229 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5230
5231         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5232         than '.'.
5233
5234 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5235
5236         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5237         enclosing DeclSpace.  This ensures that a name-lookup populates
5238         more caches and there are fewer 'TypeExpression's.  Carve out
5239         nested type lookup into ...
5240         (LookupNestedTypeInHierarchy): ... this.
5241
5242 2005-04-15  Martin Baulig  <martin@ximian.com>
5243
5244         Merged r41590 from MCS and make it work in the generics land.
5245
5246         * generic.cs (TypeParameter.UpdateConstraints): Removed the
5247         `check' argument.
5248
5249         * class.cs (PartialContainer.UpdateConstraints): Removed.
5250         (PartialContainer.CheckConstraints): Removed.
5251         (PartialContainer.SetParameterInfo): Store the constraints here.
5252         (PartialContainer.DefineTypeParameters): New public method;
5253         resolve the type parameter's constraints here.  Note that the
5254         PartialContainer doesn't have an EmitContext anymore, so we must
5255         do this in the ClassPart.
5256
5257 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5258
5259         Clean up a few partial-class semantics.  
5260         Fixes test-357.cs and cs1618-2.cs.
5261         * cs-parser.jay (struct_declaration): Use 'current_class' as
5262         parent of newly-created struct.  Remove call to Register ().
5263         Use 'pop_current_class' to complete handing the current struct.
5264         (interface_declaration): Likewise.
5265         (class_declaration): Likewise.
5266         (enum_declaration): Use 'current_class' as parent of newly created
5267         enum.
5268         (delegate_declaration): Likewise.
5269         (pop_current_class): New function.  This is used to handle closing
5270         up the 'current_class' and 'current_container', and pointing them
5271         to the enclosing class/container.
5272         (CSharpParser): Initialize 'current_class' too.
5273         * decl.cs (MemberCore): Add check for invariant: a partial
5274         container is not a parsed entity, and thus does not enclose any
5275         parsed members.
5276         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5277         (DeclSpace.BaseTypeExpr): Use it.
5278         (DeclSpace.LookupType): Add check for invariant.
5279         * class.cs (TypeContainer): Add check for invariant: a nested
5280         class should have the same NamespaceEntry as its enclosing class.
5281         (TypeContainer.EmitFieldInitializers): Make virtual.
5282         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5283         MemberCore.
5284         (TypeContainer.Register): Remove.
5285         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5286         null.  Use TypeResolveEmitContext for resolving base types and
5287         interfaces.  Move initialization of Parts.TypeBuilder here from
5288         ...
5289         (TypeContainer.DefineNestedTypes): ... here.
5290         (PartialContainer): Take a Namespace not a NamespaceEntry.
5291         (PartialContainer.Create): Don't use Register.  Call the
5292         appropriate Add... function directly.
5293         (ClassPart): Take both the PartialContainer and the enclosing
5294         class as constructor arguments.
5295         (ClassPart.EmitFieldInitializers): Override.
5296         (ClassPart.PartFindNestedTypes): Remove.
5297         (FieldBase.GetInitializerExpression): Resolve the initializer
5298         expression in the emit context of the enclosing class.
5299         * tree.cs (RootTypes): Remove Register ().
5300         
5301 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5302
5303         * cs-parser.jay: Removed CS0134.
5304         
5305         * driver.cs: Removed CS1901.
5306         
5307         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5308         for predefined types.
5309
5310 2005-03-07  Duncan Mak  <duncan@novell.com>
5311
5312         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5313         well. Fixes bug #73454.
5314
5315 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5316
5317         * cs-tokenizer.cs (xtoken): Add CS1035.
5318         
5319         * class.cs (MethodData.Define): Add CS0683.
5320         (FieldMember.ctor): Add CS0681.
5321
5322 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5323
5324         * ecore.cs (SimpleName.DoResolve): Rename from
5325         SimpleName.DoResolveAllowStatic.
5326         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5327         Pass 'intermediate' flag to MemberStaticCheck.
5328         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5329         of "intermediate" lookups via MemberAccess.
5330         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5331         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5332
5333 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5334
5335         Fix #73394.
5336         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5337         slipped in because of variable names that are identical to a
5338         builtin type's BCL equivalent ('string String;', 'int Int32;').
5339         (PropertyExpr.EmitInstance): Likewise.
5340
5341 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5342
5343         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5344         
5345         * report.cs (warning_ignore_table): Made public.
5346
5347 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5348
5349         Fix #73282.
5350         * class.cs (MethodData.Emit): Pass 'container' to
5351         container.GetObsoleteAttribute instead of 'container.Parent'.
5352
5353 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5354
5355         * cs-parser.jay: Add 1534 error test.
5356
5357         * iterators.cs (Yield.CheckContext): Add error 1629.
5358         (Iterator.ctor): Save unsafe modifier.
5359         (MoveNextMethod.DoEmit): Restore unsafe context.
5360
5361         * namespace.cs (UsingAlias): Better error message.
5362
5363 2005-03-03  Dan Winship  <danw@novell.com>
5364
5365         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5366         the warning message [#73219]
5367
5368 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5369
5370         Fix compile with MCS 1.0.0.0.
5371         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5372         w_restore to not depend on string constant folding.
5373
5374 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5375
5376         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5377         CS0246 check to users who passed 'silent = false'.
5378         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5379         check.
5380         (SimpleName.SimpleNameResolve): Update.
5381         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5382         (MemberAccess.IdenticalNameAndTypeName): Update.
5383         * doc.cs (FindDocumentedTypeNonArray): Update.
5384
5385 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5386
5387         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5388         * parameters.cs (ComputeAndDefineParameters): Remove.
5389         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5390         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5391         Use GetParameterInfo.
5392
5393 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5394
5395         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5396
5397 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5398
5399         Unify DeclSpace.LookupType and DeclSpace.FindType.
5400         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5401         is in charge of defining nested types on demand.
5402         (DeclSpace.LookupType): Use it when the current_type is a
5403         TypeBuilder.  Use LookupTypeDirect for reflected types.
5404         (DeclSpace.FindType): Remove.
5405         (DeclSpace.LookupInterfaceOrClass): Likewise.
5406         (DeclSpace.DefineTypeAndParents): Likewise.
5407         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5408         DeclSpace.LookupType.
5409         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5410         * typemanager.cs (LookupType): Simplify.
5411         (AddUserType): Remove type from negative_hits.
5412         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5413         * class.cs (TypeContainer.FindMembers): Move handling of nested
5414         types ...
5415         (TypeContainer.FindMembers_NestedTypes): ... here.
5416         (TypeContainer.FindNestedType): Implement override.
5417         (ClassPart.FindNestedType): Delegate to PartialContainer.
5418         (ClassPart.PartFindNestedType): Looks up the nested types of the
5419         part alone.
5420
5421 2005-04-14  Martin Baulig  <martin@ximian.com>
5422
5423         * generic.cs (ConstructedType): Moved all the type lookup and
5424         nested class logic into SimpleName.
5425         (ConstructedType.ResolveConstructedType): Our underlying type is
5426         already fully resolved; all the type lookup stuff is in
5427         SimpleName.
5428
5429         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5430         constructed types here instead of in ConstructedType.
5431
5432         * decl.cs (MemberName.GetTypeExpression): Always create a
5433         SimpleName, not a ConstructedType.
5434         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5435
5436 2005-03-02  Martin Baulig  <martin@ximian.com>
5437
5438         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5439         static constructor in static classes.
5440
5441 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5442
5443         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5444         sizeParamIndex is not specified.
5445
5446 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5447
5448         Fix #73117
5449         * report.cs (WarningMessage.IsEnabled): Missing null check.
5450
5451 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5452
5453         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5454         in the fields and not in the properties.
5455
5456 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5457
5458         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5459         fields as well.
5460
5461 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5462
5463         * attribute.cs: Small refactoring (improved robustness).
5464         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5465         (ValidateGuid): Removed.
5466         (Resolve): Removed referenced to above mentioned.
5467         (GetAttributeUsage): Made private and changed to work without
5468         class assistance.
5469         (GetIndexerAttributeValue): Don't crash.
5470         (GetConditionalAttributeValue): Ditto.
5471         (GetClsCompliantAttributeValue): Ditto.
5472         (ExtractSecurityPermissionSet): All attributes exceptions are
5473         error 648.
5474         (GetPropertyValue): New helper.
5475         (GetMethodImplOptions): New method.
5476         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5477         some missing properties.
5478         
5479         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5480         (Method.ApplyAttributeBuilder): Updated.
5481         
5482         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5483         exception.
5484
5485 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5486
5487         Fix #73052.
5488         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5489         non-simple types (array, pointer, reference).
5490
5491 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5492
5493         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5494
5495         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5496         for operators.
5497         (Method.CheckBase): Catch wrong destructor here.
5498         (MethodData.Define): Add errors 550, 668.
5499
5500         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5501
5502         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5503
5504         * pending.cs (VerifyPendingMethods): Add error 551.
5505
5506         * typemanager.cs (CSharpName): Next error report helper.
5507
5508 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5509
5510         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5511         attributes. Removed useless attribute double check.
5512         It saves almost 2MBs for corlib.
5513
5514 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5515
5516         Fix #72924.
5517         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5518         called twice in case of error.
5519
5520 2005-02-23  Chris Toshok  <toshok@ximian.com>
5521
5522         Fix compiler portions of #72827.
5523         * statement.cs (Block.Emit): call Begin/EndScope on the
5524         EmitContext instead of the ILGenerator.
5525
5526         * codegen.cs (EmitContext.BeginScope): new method, call
5527         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5528         we have one.)
5529         (EmitContext.BeginScope): same, but EndScope and CloseScope
5530
5531         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5532         offset and call the superclass's OpenScope(int) with it.
5533         (SymbolWriter.CloseScope): get the current il
5534         offset and call superclass's CloseScope(int) with it.
5535
5536 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5537
5538         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5539         CS1677 for out and ref as well.
5540
5541         * class.cs (Method.Define): Add error CS1599 detection.
5542         
5543         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5544         
5545         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5546         
5547         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5548         
5549         * support.cs.cs (ModifierDesc): New helper method.
5550
5551 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5552             Abin Thomas  <projectmonokochi@rediffmail.com>
5553             Anoob V E  <projectmonokochi@rediffmail.com>
5554             Harilal P R  <projectmonokochi@rediffmail.com>
5555
5556         Fix #57851, #72718.
5557         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5558         MemberLookup (used for error reporting) actually returns a result.
5559         Fix error report number (122, not 112).
5560
5561 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5562             Anoob V E  <projectmonokochi@rediffmail.com>
5563             Harilal P R  <projectmonokochi@rediffmail.com>
5564
5565         Fix #71134.
5566         * pending.cs (PendingImplementation.GetAbstractMethods):
5567         Find NonPublic members too.
5568
5569 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5570
5571         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5572         Fixed error 217.
5573         
5574         * class.cs (MethodCore.CheckMethodAgainstBase):
5575         Add error 239 report.
5576
5577 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5578
5579         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5580         
5581         * class.cs (Operator.Define): Add error 217 report.
5582         
5583 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5584
5585         Fix #68955.
5586         * expression.cs (Invocation.IsApplicable): Make public.
5587         (Invocation.IsParamsMethodApplicable): Likewise.
5588         * delegate.cs (Delegate.VerifyApplicability): Don't use
5589         Invocation.VerifyArgumentCompat for parameter applicability
5590         testing.  Use Invocation.IsApplicable and
5591         Invocation.IsParamsMethodApplicable.
5592
5593 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5594
5595         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5596         
5597         * class.cs (Operator.Define): Add error 217 report.
5598         
5599 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5600
5601         * namespace.cs (UsingEntry.Resolve): Undo change below.
5602
5603 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5604
5605         Fix #72756.
5606         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5607         disable the error message when the extended MemberLookup also
5608         fails.
5609         (Expression.MemberLookupFinal): Update.
5610         (SimpleName.DoSimpleNameResolve): Update.
5611         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5612         Don't use MemberLookupFinal.
5613         (New.DoResolve): Update.
5614         (BaseAccess.CommonResolve): Update.
5615
5616 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5617
5618         Fix #72732.
5619         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5620         occured previously, don't resolve again.
5621
5622 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5623
5624         Fix #69949
5625         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5626         argument. Call ResolveAttributeUsage for unresolved.
5627         when types doesn't match ctor arguments.
5628         
5629         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5630         for nested attribute classes.
5631         (Class.attribute_usage): Removed.
5632         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5633         for attribute class.
5634         
5635         * ecore.cs (IsAttribute): Removed.
5636         
5637         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5638         
5639         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5640         now normal types.
5641         (attribute_types): Removed.
5642         (EmitCode): Global attributes are emited as the latest.
5643
5644 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5645
5646         * class.cs (EmitFieldInitializers): Don't emit field initializer
5647         for default values when optimilization is on.
5648         
5649         * constant.cs (Constant.IsDefaultValue): New property.
5650         
5651         * driver.cs: Add /optimize handling.
5652         
5653         * constant.cs,
5654         * ecore.cs,
5655         * literal.cs: Implement new IsDefaultValue property.
5656         
5657         * rootcontext.cs (Optimize): New field, holds /optimize option.
5658
5659 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5660
5661         Fix crasher in re-opened #72347.
5662         * namespace.cs (Namespace.Lookup): Return null if
5663         DeclSpace.DefineType returns null.
5664
5665         Fix #72678.
5666         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5667
5668 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5669
5670         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5671         now returns null if it cannot resolve to an lvalue.
5672         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5673         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5674         returned null.  Remove check for SimpleName.
5675         (EventExpr.DoResolveLValue): New.
5676         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5677         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5678         error from ...
5679         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5680         avoid CS0131 error.
5681         (Unary.ResolveOperator): Move CS0211 check ...
5682         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5683         CS0131 error.
5684         (Unary.DoResolveLValue): Simplify.
5685         (AddressOf.DoResolveLValue): New.
5686         (ArrayAccess.DoResolveLValue): New.
5687
5688 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5689
5690         * attribute.cs (Attribute.Resolve): Add arguments casting for
5691         when types doesn't match ctor arguments.
5692
5693 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5694
5695         Fix parts of #63202.
5696         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5697         lookup of operator in base type.  Ensure that all checks happen
5698         when the operator resolves to an "op_..." method.
5699
5700 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5701
5702         Fix #71992.
5703         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5704         'ignore_cs0104' parameter.  Pass it to ...
5705         (NamespaceEntry.Lookup): ... this.
5706         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5707         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5708         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5709         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5710         Update.  Request that cs0104 errors be ignored.
5711         (ComposedCast.ResolveAsTypeStep): Update.
5712
5713 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5714
5715         Fix #59209.
5716         * expression.cs (Invocation.BetterFunction): Remove support for
5717         comparing virtual functions and their overrides.
5718         (Invocation.IsOverride): New.
5719         (Invocation.OverloadResolve): Don't consider 'override' functions
5720         during candidate selection.  Store them in a lookaside list.
5721         If the selected method is a 'virtual' function, use the list to
5722         find any overrides that are closer to the LHS type.
5723
5724 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5725
5726         * expression.cs (New.DoResolve): Add complex core type reduction.
5727         (New.Constantify): Converts complex core type syntax like 'new int ()'
5728         to simple constant.
5729         
5730 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5731
5732         * decl.cs (EntryType.EntryType): New constructor to create an
5733         updated copy of a cache entry.
5734         (MemberCache.AddMethods): Use it.
5735         (MemberCache.ClearDeclaredOnly): Remove.
5736         (MemberCache.MemberCache): Update.
5737
5738 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5739
5740         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5741         variable.  This one is represents the actual low-level declaration
5742         of the method, as opposed to the semantic level `IsStatic'.   
5743
5744         An anonymous method which is hosted into a static method might be
5745         actually an instance method.  IsStatic would reflect the
5746         container, while MethodIsStatic represents the actual code
5747         generated.
5748
5749         * expression.cs (ParameterReference): Use the new MethodIsStatic
5750         instead of IsStatic.
5751
5752         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5753         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5754         set on the current EmitContext. 
5755
5756         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5757         resolve our casted expression as an LValue.  This triggers the
5758         proper LValue processing that is later required by Assign.
5759
5760         This fixes 72347.
5761
5762         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5763
5764 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5765
5766         C# 2.0 Fixed buffer implementation
5767
5768         * anonymous.cs: Update after RegisterHelperClass renaming.
5769
5770         * attribute.cs (AttributeTester.fixed_buffer_cache):
5771         Cache of external fixed buffers.
5772         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5773         implementation if field is fixed buffer else null.
5774
5775         * class.cs
5776         (TypeContainer.AddField): Accept FieldMember instead of Field.
5777         (FieldBase.IsFieldClsCompliant): Extracted code from
5778         VerifyClsCompliance descendant customization.
5779         (FixedField): New class handles fixed buffer fields.
5780         (FixedFieldExternal): Keeps information about imported fixed
5781         buffer.
5782         (IFixedField): Make access to internal or external fixed buffer
5783         same.
5784
5785         * cs-parser.jay: Add fixed buffer parsing.
5786
5787         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5788         buffer.
5789
5790         * expression.cs (Indirection): Extended implementation to accept
5791         fixed buffer field.
5792         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5793         (ElementAccess.MakePointerAccess): Get type as parameter.
5794         (DoResolve): Add fixed buffer field expression conversion.
5795         (DoResolveLValue): Ditto.
5796         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5797         (ArrayPtr): Derives from FixedBufferPtr.
5798         (ArrayPtr.Emit): Add extra emit for array elements.
5799
5800         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5801
5802         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5803         for compiler generated types.
5804         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5805
5806         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5807         and consume less memory.
5808         (Fixed.Resolve): Add fixed buffer case.
5809
5810         * typemanager.cs (compiler_generated_attr_ctor,
5811         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5812         (HasElementType): Add our own implementation to work on every
5813         runtime.
5814
5815 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5816
5817         * anonymous.cs (CaptureContext): Track whether `this' has been
5818         referenced.   
5819
5820         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5821         only captured `this' if it was implicitly done (instance
5822         methods/variables were used). 
5823
5824         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5825         `this' must be captured.
5826
5827 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5828  
5829         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5830         is null it means that there has been no need to capture anything,
5831         so we just create a sibling.
5832
5833         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5834
5835         Just a partial fix.  The other half is fairly elusive.
5836         
5837 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5838
5839         Fix #52586, cs0121-4.cs.
5840         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5841         and return a hashtable.
5842         (MemberCache.ClearDeclaredOnly): New.
5843         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5844         the method_hash of a base type too.
5845         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5846         type methods.  Overwrite entries with the same MethodHandle so
5847         that the ReflectedType is correct.  The process leaves in base
5848         virtual functions and their overrides as distinct entries.
5849         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5850         matters since it was boxed in a ArrayList before.
5851         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5852         modifier.
5853         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5854         case of a virtual function and its override (choose the overload
5855         as better).
5856         (Invocation.OverloadResolve): Avoid 'override' members during
5857         'applicable_type' calculation.
5858
5859 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5860
5861         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5862         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5863         GetTypeHandle.  It is possible for a reflected type to derive from
5864         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5865         System.Array during mscorlib compilation).
5866         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5867         contain a method_hash, don't create one either.  Don't create a
5868         deep copy of the base cache's method_hash.
5869         (MemberCache.SetupCache): Rename back from DeepCopy.
5870         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5871         already initialized.  If we see an override function, add its
5872         underlying base virtual function to the member_hash too.
5873
5874 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5875
5876         Combine two near-redundant caches.
5877         * typemanager.cs (method_params): Rename from method_internal_params.
5878         (TypeManager.GetParameterData): New.  Replace
5879         Invocation.GetParameterData.
5880         (TypeManager.LookupParametersByBuilder): Remove.
5881         * expression.cs (Invocation.method_parameter_cache): Remove.
5882         (Invocation.GetParameterData): Remove.
5883         Update to changes.
5884         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5885         Update to changes.
5886
5887 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5888
5889         Fix #72015.
5890         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5891         TypeManager.multicast_delegate_type is null, resolve it by looking
5892         up "System.MulticastDelegate".
5893         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5894
5895 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5896             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5897             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5898
5899         Fix cs0164.cs.
5900         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5901         (LabeledStatement.AddReference): New.  Set 'referenced'.
5902         (Goto.Resolve): Use it.
5903
5904 2005-02-05  John Luke  <john.luke@gmail.com>
5905
5906         * driver.cs: remove duplicate -doc line in Usage ()
5907
5908 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5909
5910         * location.cs (Location.AddFile): Fix CS2002 error report.
5911
5912 2005-02-02  Martin Baulig  <martin@ximian.com>
5913
5914         * delegate.cs (Delegate.DefineType): Report an internal error if
5915         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5916         details.        
5917
5918 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5919
5920         Fix a crasher in a variant of #31984.
5921         * const.cs (Constant.CheckBase): New override that defers the
5922         new-or-override check in case the base type hasn't been populated
5923         yet.
5924         (Constant.Define): Ensure the new-or-override check is performed.
5925
5926 2005-02-01  Duncan Mak  <duncan@ximian.com>
5927
5928         * const.cs (LookupConstantValue): Check that `ce' is not null
5929         before calling GetValue ().
5930
5931 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5932
5933         Fix test-334.cs (#69519).
5934         * cs-parser.jay (using_alias_directive): Pass in an expression to
5935         NamespaceEntry.UsingAlias.
5936         (using_namespace_directive): Pass in an expression to
5937         NamespaceEntry.Using.
5938         (namespace_name): Don't flatten to a string.
5939         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5940         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5941         ResolveAsTypeStep.
5942         (NamespaceEntry.UsingEntry): Likewise.
5943         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5944         changes.
5945         (NamespaceEntry.LookupForUsing): Remove.
5946         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5947         names.
5948         (NamespaceEntry.Lookup): Remove support for dotted names.
5949
5950 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5951
5952         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5953         split into two.
5954         (NamespaceEntry.ImplicitParent): Compute on demand.
5955         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5956         parallels the current.
5957         (NamespaceEntry.LookupForUsing): Use it.
5958         (NamespaceEntry.Lookup): If the current namespace-entry is
5959         implicit, don't search aliases and using tables.
5960
5961 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5962
5963         Fix #31984.
5964         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5965         BaseCache here.
5966         (TypeContainer.BaseCache): Compute on demand.
5967         (TypeContainer.FindMembers): Define constants and types if they're
5968         not already created.
5969         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5970         check.
5971         * const.cs (Constant.Define): Make idempotent.
5972
5973 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5974
5975         * pending.cs: Produce better code (no nops produced by using Ldarg
5976         + value).
5977         
5978         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5979         i - 1' it should be arg + 1.
5980
5981         Fixes bug #71819.
5982
5983 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5984
5985         * attribute.cs (Attribute.CheckAttributeType): Make private
5986         non-virtual.
5987         (Attribute.ResolveType): Make virtual.
5988         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5989         handling of RootContext.Tree.Types.
5990
5991 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5992
5993         Update attribute-handling to use the SimpleName/MemberAccess
5994         mechanisms.
5995         * cs-parser.jay (attribute): Pass in an expression to the
5996         constructors of Attribute and GlobalAttribute.
5997         * attribute.cs (Attribute): Take an expression for the name.
5998         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5999         passed in attribute name expression.
6000         (Attribute.CheckAttributeType): Use it.
6001         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6002         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6003         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6004         argument to prevent error messages if the lookup fails.
6005
6006 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6007
6008         * expression.cs (Indirection): Implemented IVariable interface
6009         to support indirection in AddressOf operator.
6010         (PointerArithmetic.Emit): Add optimalization for case where
6011         result can be precomputed.
6012
6013 2005-01-26  Martin Baulig  <martin@ximian.com>
6014
6015         * class.cs (TypeContainer.AttributeTargets): Return the correct
6016         AttributeTargets depending on our `Kind' instead of throwing an
6017         exception; fixes #71632.
6018
6019 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6020
6021         Fix #71257
6022         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6023         constant members.
6024
6025 2005-03-17  Martin Baulig  <martin@ximian.com>
6026
6027         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6028         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6029
6030 2005-03-17  Martin Baulig  <martin@ximian.com>
6031
6032         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6033         to bool so we can return an error condition.
6034         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6035         returned an error.
6036
6037 2005-03-17  Martin Baulig  <martin@ximian.com>
6038
6039         * generic.cs (TypeMananager.IsIEnumerable): New public method.
6040
6041         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6042         converting from an array-type of T to `IEnumerable<T>'.
6043
6044 2005-03-16  Martin Baulig  <martin@ximian.com>
6045
6046         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6047         (Nullable.LiftedUnaryMutator): New public class.
6048
6049         * expression.cs (UnaryMutator.DoResolve): Added support for
6050         Nullable Types.
6051
6052 2005-03-14  Martin Baulig  <martin@ximian.com>
6053
6054         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6055
6056 2005-03-14  Martin Baulig  <martin@ximian.com>
6057
6058         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6059         the comparision operators `<', `>', `<=' and `>='.
6060
6061 2005-03-13  Martin Baulig  <martin@ximian.com>
6062
6063         * generic.cs
6064         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6065         avoid confusion with the `NullLiteral'.
6066         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6067
6068 2005-03-13  Martin Baulig  <martin@ximian.com>
6069
6070         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6071         comparing arbitrary types with the null literal.
6072
6073 2005-03-13  Martin Baulig  <martin@ximian.com>
6074
6075         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6076         boolean operators '&&', '||', '&' and '|'.
6077         (Nullable.OperatorTrueOrFalse): New public class.
6078
6079         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6080         instead of a `StaticCallExpr'; added support for nullables.
6081
6082 2005-03-10  Martin Baulig  <martin@ximian.com>
6083
6084         * expression.cs
6085         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6086         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
6087
6088 2005-03-07  Martin Baulig  <martin@ximian.com>
6089
6090         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6091         it work if `expr' is not an IMemoryLocation.
6092         (Nullable.Lifted): Implement IMemoryLocation.
6093         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6094         target type.
6095
6096 2005-03-05  Martin Baulig  <martin@ximian.com>
6097
6098         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6099         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6100         (Nullable): Added support for lifted unary and binary operators.
6101
6102         * expression.cs (Unary.DoResolve): Added support for nullable types.
6103         (Binary.DoResolve): Likewise.
6104         (Conditional.DoResolve): Likewise.
6105
6106 2005-03-02  Martin Baulig  <martin@ximian.com>
6107
6108         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6109
6110         * class.cs (ClassPart.SetParameterInfo): Override this.
6111         (PartialContainer.SetParameterInfo): Override this.
6112         (TypeContainer.CheckConstraints): New protected method.
6113         (PartialContainer.CheckConstraints): Override this and check
6114         whether the same contraints were specified in all parts of a
6115         partial generic type definition.
6116         (PartialContainer.UpdateConstraints): New public method.
6117
6118         * generic.cs (TypeParameter.UpdateConstraints): New public method.
6119
6120 2005-03-02  Martin Baulig  <martin@ximian.com>
6121
6122         Committing a patch from Carlos Alberto Cortez to fix #72887.
6123
6124         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6125         casts from `T []' to `int []'.
6126
6127 2005-03-02  Martin Baulig  <martin@ximian.com>
6128
6129         * generic.cs (TypeManager.IsEqual): Make this symmetric.
6130
6131         * expression.cs (Binary.ResolveOperator): When resolving a
6132         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6133         `=='.  Fixes #71866.  See gen-127.cs.
6134
6135 2005-03-02  Martin Baulig  <martin@ximian.com>
6136
6137         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6138         static constructor in static classes.
6139
6140 2005-03-02  Martin Baulig  <martin@ximian.com>
6141
6142         * generic.cs
6143         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6144         (Nullable.LiftedConversion): Added support for user-defined
6145         conversions.
6146
6147         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6148
6149         * cs-parser.jay: Use ComposedCast everywhere instead of
6150         NullableType, so we don't need to check for NullableType
6151         everywhere.
6152         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6153         case where we'll be resolved into a `parenthesized_expression_0'
6154         afterwards.
6155
6156         * convert.cs
6157         (Convert.UserDefinedConversion): Added nullable conversions.
6158
6159 2005-02-28  Martin Baulig  <martin@ximian.com>
6160
6161         * generic.cs (TypeManager.IsNullableType): New static method.
6162         (Nullable): New abstract class.
6163         (Nullable.NullLiteral): New public class.
6164         (Nullable.LiftedConversion): New public class.
6165
6166         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6167         `builtin_types opt_nullable'.
6168
6169         * convert.cs
6170         (Convert.ImplicitConversionStandard): Added nullable conversions.
6171         (Convert.ExplicitConversionStandard): Likewise.
6172         (Convert.ExplicitConversion): Likewise.
6173
6174 2005-02-26  Martin Baulig  <martin@ximian.com>
6175
6176         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6177         begin with a "?", for instance "?[]".  Don't do a type lookup if
6178         `dim' is empty.
6179
6180 2005-02-25  Martin Baulig  <martin@ximian.com>
6181
6182         The first part of Nullable Types :-)
6183
6184         * generic.cs (NullableType): New public class.
6185         (NullCoalescingOperator): New public class.
6186         (TypeArguments.Resolve): Add a CS0306 check.
6187
6188         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6189         (opt_nullable): New rule.
6190         (type): Added `opt_nullable' to `namespace_or_type_name',
6191         `builtin_types' and `pointer_type'.
6192         (array_type): Added `opt_nullable'.
6193         (opt_rank_specifier_or_nullable): New rule; this is the
6194         combination of `opt_rank_specifier' and `opt_nullable'.
6195         (opt_error): New rule; catch errors here.
6196         (nullable_type_or_conditional): New rule; we use this to check for
6197         nullable and still detect the conditional operator.
6198         (local_variable_type): Use `opt_rank_specifier_or_nullable'
6199         instead `opt_rank_specifier'.
6200
6201         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6202         for nullables.
6203
6204 2005-02-24  Martin Baulig  <martin@ximian.com>
6205
6206         * README, README.Changes: Removed; they're old and obsolete.
6207
6208 2005-02-22  Martin Baulig  <martin@ximian.com>
6209
6210         * generic.cs (TypeParameter.Resolve): If resolving the constraints
6211         returned an error, set `constraints' to null to avoid a crash
6212         later on.
6213         (TypeParameter.ResolveType): Likewise.
6214
6215 2005-02-22  Martin Baulig  <martin@ximian.com>
6216
6217         * generic.cs
6218         (Constraints.ResolveTypes): Protect against being called twice.
6219         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6220         (TypeParameter.ResolveType): New public method; calls
6221         constraints.ResolveTypes().
6222         (TypeParameter.DefineType): Moved constraints.ResolveType() out
6223         into the new ResolveType().
6224         (GenericMethod.Define): Call ResolveType() on all our
6225         TypeParameter's.        
6226
6227 2005-02-21  Martin Baulig  <martin@ximian.com>
6228
6229         * generic.cs
6230         (TypeManager.generic_nullable_type): New static public field.
6231         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6232
6233         * rootcontext.cs
6234         (RootContext.ResolveCore): Resolve "System.Nullable`1".
6235
6236 2005-02-15  Martin Baulig  <martin@ximian.com>
6237
6238         * generic.cs (ConstructedType.Constraints): Correctly check
6239         constraints if the argument type is a type parameter; fixes
6240         #72326. 
6241
6242 2005-02-02  Martin Baulig  <martin@ximian.com>
6243
6244         * delegate.cs (Delegate.DefineType): Report an internal error if
6245         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6246         details.        
6247
6248 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6249
6250         * pending.cs: Produce better code (no nops produced by using Ldarg
6251         + value).
6252         
6253         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6254         i - 1' it should be arg + 1.
6255
6256         Fixes bug #71819.
6257         
6258 2005-01-26  Martin Baulig  <martin@ximian.com>
6259
6260         * cs-parser.jay (indexer_declarator): Don't report an error if we
6261         have type parameters since we can be an explicit interface
6262         implementation; fixes #71449.
6263
6264 2005-01-26  Martin Baulig  <martin@ximian.com>
6265
6266         * class.cs (TypeContainer.AttributeTargets): Return the correct
6267         AttributeTargets depending on our `Kind' instead of throwing an
6268         exception; fixes #71632.
6269
6270 2005-01-26  Martin Baulig  <martin@ximian.com>
6271
6272         * delegate.cs (Delegate.DefineType): Correctly define our type
6273         parameters.  Fixes #71483.
6274
6275 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6276
6277         Fix #71602.
6278         * expression.cs (MemberAccess.DoResolve): Don't complain with
6279         cs0572 when the LHS of a member access has identical name and type
6280         name.
6281
6282 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6283
6284         Fix #71651, #71675
6285         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6286         CreatePermission.
6287         Create custom PermissionSet only for PermissionSetAttribute.
6288
6289 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6290
6291         Fix #71649
6292         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6293         delegates in static class.
6294
6295 2005-01-24  Martin Baulig  <martin@ximian.com>
6296
6297         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6298         merging an implicit block, just use its reachability.
6299
6300         * statement.cs (Block.Resolve): Make the unreachable code check
6301         work wrt. implicit blocks; see test-337 from #63842.
6302
6303 2005-01-21  Alp Toker  <alp@atoker.com>
6304  
6305         * cs-parser.jay: destructor_declaration's container is PartialContainer
6306         not Class when partial types are used, so use Kind prop instead of
6307         'is'.
6308         
6309 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6310
6311         * cs-parser.jay: Improve error reporting when an interface
6312         declares new types.
6313
6314 2005-01-20  Dick Porter  <dick@ximian.com>
6315
6316         * support.cs: SeekableStreamReader fix from Sandor Dobos
6317         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6318         chars are read.  Fixes bug 70369.
6319
6320 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6321
6322         * cs-parser.jay (catch_clause): Simplify current_block handling
6323         somewhat.
6324
6325 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6326
6327         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6328         code with ImplicitStandardConversion to handle the implicit
6329         conversion of method groups into valid delegate invocations. 
6330
6331         The problem is that in parameter handling we were using this code
6332         path.  Fixes bug #64698
6333
6334 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6335
6336         * cs-parser.jay: Fix several infelicities.
6337         - Avoid assigning to the parser value stack.  Code like 
6338           '$3 = null' is unclean.  Synthesize a value for the code block
6339           instead. 
6340         - Avoid using oob_stack for storing location information.  Use ...
6341         (_mark_): ... this.  New (empty) rule.  Saves the current location
6342         in $$.
6343         (foreach_statement): Avoid using oob_stack for current_block
6344         handling.  Use technique used in for_statement and
6345         using_statement.  Synthesize a value for the code block to store
6346         additional intermediate information.
6347
6348 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6349
6350         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6351         of a different type is only allowed to private fields of a
6352         containing type, not on fields of a base class.
6353
6354         See test-174.cs and error cs0122-9.cs
6355
6356 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6357
6358         Fix test-335.cs (bug #58126).
6359         * cs-parser.jay (argument): Split out non-expression parts of the
6360         rule into 'non_simple_argument'.
6361         (invocation_expression): Support parenthesized invocations with
6362         multiple arguments, and with single non-simple arguments.
6363
6364 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6365
6366         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6367         places.
6368
6369 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6370
6371         Fix cs0038-1.cs, cs1640-6.cs.
6372         * ecore.cs (Expression.Resolve): Remove special-case for
6373         SimpleName in error-handling.
6374         (Expression.almostMatchedMembers): Relax access permission to
6375         protected.
6376         (Expression.MemberLookupFailed): Handle duplicates in
6377         almostMatchedMembers list.
6378         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6379         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6380         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6381         overload if the passed in MemberInfo is a MethodBase.
6382
6383 2005-01-25  Martin Baulig  <martin@ximian.com>
6384
6385         * doc.cs
6386         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6387
6388 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6389
6390         Fix #70749
6391         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6392         for non-CAS & merge permission sets properly.
6393
6394 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6395
6396         Improve standard-compliance of simple name and member access 
6397         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6398         * ecore.cs (FullNamedExpression): New abstract base class 
6399         for Namespaces and TypeExpressions.
6400         (ResolveFlags.SimpleName): Remove.
6401         (SimpleName): Remove support for dotted names.
6402         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6403         DeclSpace.FindType and DeclSpace.LookupType.
6404         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6405         (Expression.ExprClassName): Make member function.
6406         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6407         a namespace.  Remove creation of dotted "SimpleName"s.
6408         (MemberAccess.DoResolve): Likewise.
6409         * decl.cs (DeclSpace.Cache): Make private.
6410         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6411         (DeclSpace.FindType): Update.
6412         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6413         FullNamedExpression.
6414         * namespace.cs (Namespace): Derive from FullNamedExpression
6415         so that it can be part of expression resolution.
6416         (Namespace.Lookup): Return an FullNamedExpression.
6417         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6418         namespace.
6419         * rootcontext.cs (NamespaceLookup): Remove.
6420         (LookupType): Move to DeclSpace.
6421         * attribute.cs (CheckAttributeType): Update.
6422         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6423         (FindDocumentedTypeNonArray): Likewise.
6424
6425 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6426
6427         Fix cs0509.cs, cs1632.cs.
6428         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6429         is the same as IsInterface.
6430         (TypeContainer.GetClassBases): Likewise.
6431         * statement.cs (LabeledStatement.ig): New field.
6432         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6433         label.
6434         (LabeledStatement.DoEmit): Check that the label was created with
6435         the same ILGenerator.
6436
6437 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6438
6439         Fix #71058
6440         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6441         accessors to its properties.
6442
6443         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6444         from accessors to property.
6445         
6446 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6447
6448         Fix #70722
6449         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6450         only for overrides.
6451         
6452 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6453
6454         * attribute.cs: Check for null and empty strings.  
6455
6456         I have lost another battle to Paolo.
6457
6458 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6459
6460         Fix #70942
6461         * class.cs (PropertyMethod): Set Parent field in ctors.
6462         (SetMethod.InternalParameters): Add unsafe switch hack.
6463         Override MarkForDuplicationCheck where it is appropriate.
6464
6465         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6466         It says whether container allows members with the same name.
6467         Base default is no.
6468         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6469         Removed is_method parameter.
6470
6471 2005-01-06  Duncan Mak  <duncan@ximian.com>
6472
6473         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6474         because the previous change led to incorrect reporting of CS1032
6475         ("Cannot define/undefine preprocessor symbols after first token in
6476         file"). Instead of using `tokens_seen' as the only flag that
6477         triggers CS1040, introduce `comments_seen'. This new flag is used
6478         to signify having seen comments on the current line, so it is
6479         unset after a newline.
6480
6481 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6482
6483         * doc.cs : When searching for a type, find nested type too.
6484           This fixes bug #71040.
6485
6486 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6487
6488         * doc.cs :
6489           - Warn missing member comment on those classes which also does not
6490             have doc comments. Fixed bug #71041.
6491           - Don't warn missing doc comment on default constructor.
6492             Fixed bug #71042.
6493
6494 2005-01-06  Duncan Mak  <duncan@ximian.com>
6495
6496         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6497         comments, set `tokens_seen' to true. This allows us to detect
6498         misplaced preprocessor directives (i.e. not at the beginning of
6499         the a line, nor after whitespaces). In that case, report error
6500         CS1040. This fixes bug #56460.
6501
6502         * cs-parser.jay (interface_member_declaration): Add checks for
6503         IsExplicitImpl, and report CS0541 error if an interface member is
6504         defined as an explicit interface declaration.
6505
6506 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6507
6508         Fix #70817
6509         * class.cs (PropertyMethod): Set Parent field in ctors.
6510         (SetMethod.InternalParameters): Add unsafe switch hack.
6511         
6512         * decl.cs (MemberCore.Parent): Cannot be readonly.
6513
6514 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6515
6516         * decl.cs (DeclSpace.ResolveType): Remove.
6517         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6518         Merge in code from ...
6519         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6520         * class.cs, enum.cs: Update to changes.
6521
6522 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6523
6524         * anonymous.cs: Ensure that we init the scope of our parent if it
6525         has not been initialized yet.
6526
6527 2004-12-30  Duncan Mak  <duncan@ximian.com>
6528
6529         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6530         if field.FieldBuilder is null. Fixes #70758.
6531
6532         * convert.cs: Fixed some typos and updated some of the comments.
6533         (ImplicitStandardConversionExists):
6534         (TryImplicitIntConversion): If `target_type' is an interface and
6535         the type of `ic' implements this interface, return true or a new
6536         BoxedCast instead of null. This fixes #70468.
6537
6538 2004-12-29  Duncan Mak  <duncan@ximian.com>
6539
6540         * expression.cs (Argument.Emit): Check that Expr is
6541         IMemoryLocation before casting to it, and report CS1510 otherwise.
6542
6543         This fixes #70402.
6544
6545 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6546
6547         * statement.cs (Block.ThisVariable): remove the recursion here, to
6548         make the --profile more sane.
6549
6550 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6551
6552         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6553         assembly, by JB Evain.
6554
6555 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6556
6557         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6558           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6559         "parent" refers to enclosing type/class.  "base" refers to superclass.
6560
6561 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6562
6563         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6564         Ensure that we only have GlobalAttributes.
6565         * attribute.cs (Attribute.Emit): Make non-virtual.
6566         (GlobalAttribute.Emit): Remove.
6567         (Attribute.Resolve): Make virtual.
6568         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6569         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6570         the argument. Don't create one.
6571         (Attribute.GetObsoleteAttribute): Likewise.
6572         (Attribute.GetClsCompliantAttributeValue): Likewise.
6573         * class.cs, decl.cs: Update to changes.
6574
6575 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6576
6577         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6578         
6579         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6580         
6581         * statement.cs (Foreach.Resolve): Add error 186 report.
6582
6583 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6584
6585         * expression.cs (Conditional.DoResolve): Add warning 429.
6586         
6587         * statement.cs (If.Resolve): Add warning 665.
6588
6589 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6590
6591         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6592         except when in the parser, and in GlobalAttribute.
6593         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6594         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6595         RootContext.Tree.Types.NamespaceEntry once work is done.
6596         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6597         and resets RootContext.Tree.Types.NamespaceEntry.
6598
6599 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6600
6601         * cs-parser.jay: Don't create a block for every variable.
6602
6603 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6604
6605         * location.cs: Provide extra information.
6606
6607         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6608         variables from the captured environment, it is the ldarg_0.
6609
6610 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6611
6612         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6613         find a conclusion.
6614         
6615         * class.cs: Changed warning level for 169 to avoid developer
6616         displeasure from warning flooding. It will be changed back when they
6617         fix most of current BCL warnings.
6618         
6619         * RootContext.cs: Pushed default WarningLevel to 3.
6620         
6621         * statement.cs: Removed unused variable.
6622
6623 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6624
6625         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6626         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6627         Add error 502 report.
6628         (StaticClass.DefineType): Add error 441 report.
6629         (Class.AllowedModifiersProp): New virtual property as temporary
6630         extension to AllowedModifiers.
6631         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6632         to share implementation with StaticClass and don't call virtual
6633         methods from ctor.
6634         
6635         * driver.cs (MainDriver): Add error 1558 test.
6636
6637         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6638         report. Moved error 36 test here.
6639
6640         * statement.cs (Throw.Resolve): Add error 724 report.
6641
6642         * typemanager.cs: Add out_attribute_type core type.
6643         
6644 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6645
6646         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6647         3018 report.
6648         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6649
6650         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6651         3017 report.
6652         
6653         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6654
6655         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6656         Add error 3023 report.
6657         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6658
6659         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6660         implementation.
6661
6662 2004-12-12  John Luke  <john.luke@gmail.com>
6663
6664         * driver.cs (AddArgs): take -- into account when
6665         adding arguments, fixes bug 65710 
6666
6667 2004-12-12  Martin Baulig  <martin@ximian.com>
6668
6669         * expression.cs (Unary.TryReduceNegative): Added support for
6670         SByteConstant and ByteConstant.
6671         (Unary.Reduce): Check error values from TryReduceNegative().
6672
6673 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6674
6675         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6676         and report exception as error 182.
6677
6678 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6679
6680         * driver.cs (Main): Fix message when there are warnings.
6681
6682 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6683
6684         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6685
6686 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6687
6688         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6689         Reduced number of warnings.
6690         
6691         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6692
6693 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6694
6695         * driver.cs: Removed message.
6696
6697         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6698
6699 2004-12-08    <vargaz@freemail.hu>
6700
6701         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6702
6703 2004-12-08  Martin Baulig  <martin@ximian.com>
6704
6705         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6706         instead of a CS3002 for properties and indexer.
6707
6708 2004-12-08  Martin Baulig  <martin@ximian.com>
6709
6710         * decl.cs (MemberName.ToString): Make this work again.
6711
6712 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6713
6714         * attribute.cs (Resolve): Add error 591 detection.
6715
6716         * class.cs (FieldMember.Define): Add error 1547 detection.
6717         (Indexer.Define): Add error 620 detection.
6718         (Operator.Define): Add error 590 detection.
6719
6720         * ecore.cs: Missing argument for error 79.
6721
6722         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6723         detection.
6724
6725 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6726
6727         Fix #70106
6728         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6729         only.
6730
6731 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6732
6733         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6734           Some operator comments were suppressed.
6735         * doc.cs : Implicit/explicit operator name in doc comments are like
6736           "op_Explicit(type)~returnType", so added suffix handling.
6737
6738 2005-01-21  Alp Toker  <alp@atoker.com>
6739
6740         * cs-parser.jay: destructor_declaration's container is PartialContainer
6741         not Class when partial types are used, so use Kind prop instead of 'is'.
6742
6743 2004-12-12  Martin Baulig  <martin@ximian.com>
6744
6745         * expression.cs (Unary.TryReduceNegative): Added support for
6746         SByteConstant and ByteConstant.
6747         (Unary.Reduce): Check error values from TryReduceNegative().
6748
6749 2004-12-11  Martin Baulig  <martin@ximian.com>
6750
6751         * support.cs (ReflectionParameters.ParameterName): If we have a
6752         `gpd', call `ParameterName' on it.
6753
6754         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6755
6756         * pending.cs (PendingImplementation.DefineProxy): Call
6757         DefineParameter() for all of the MethodBuilder's arguments.
6758
6759 2004-12-09  Martin Baulig  <martin@ximian.com>
6760
6761         * doc.cs (DocUtil): Make this a static class.
6762
6763 2004-12-09  Martin Baulig  <martin@ximian.com>
6764
6765         * expression.cs (Invocation.InferType): Moved the type inference
6766         implementation into TypeManager.
6767
6768         * generics.cs (TypeManager): Moved the type inference
6769         implementation here.
6770
6771 2004-12-09  Martin Baulig  <martin@ximian.com>
6772
6773         * typemanager.cs (TypeManager): Make this a partial class.
6774
6775         * generics.cs
6776         (TypeManager): Move the generics part of `TypeManager' here.
6777
6778 2004-12-08  Martin Baulig  <martin@ximian.com>
6779
6780         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6781         instead of a CS3002 for properties and indexer.  Added CS3024
6782         check for generic interfaces.
6783
6784         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6785         instances are not CLS-compliant.
6786
6787 2004-12-08  Martin Baulig  <martin@ximian.com>
6788
6789         * cs-parser.jay
6790         (void_pointer_expression): New rule for `void*', `void**' etc.
6791         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6792
6793 2004-12-08  Martin Baulig  <martin@ximian.com>
6794
6795         * expression.cs (Invocation.InferType): Removed the hack for
6796         MethodCore.MayUnify().  
6797
6798         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6799         this actually work.
6800
6801         * class.cs (MethodCore.MayUnify): Use
6802         TypeManager.MayBecomeEqualGenericTypes().       
6803
6804 2004-12-08  Martin Baulig  <martin@ximian.com>
6805
6806         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6807         parameter, box it.  Fixes #69233.
6808
6809 2004-12-08  Martin Baulig  <martin@ximian.com>
6810
6811         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6812         have the ctor constraint.  Fixes #68326.
6813
6814 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6815
6816         * cs-parser.jay : interface comment was not consumed because of
6817           extra opt_semicolon before doc handling.
6818
6819 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6820
6821         Fix test-327.cs, test-328.cs, and put in early infrastructure
6822         for eventually fixing #52697.
6823         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6824         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6825         from other methods.
6826         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6827         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6828         (VerifyUsing, error246): Update.
6829         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6830         'NamespaceEntry.LookupNamespaceOrType'.
6831
6832 2004-12-07  Martin Baulig  <martin@ximian.com>
6833
6834         * driver.cs: Call it "BETA SOFTWARE" :-)
6835
6836 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6837
6838         Fix crash on cs0657-17.cs.
6839         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6840         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6841         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6842         the case where the NamespaceEntry gets overwritten.
6843
6844 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6845
6846         Fixed #69195, #56821
6847         * ecore.cs (ResolveBoolean): Tiny refactoring.
6848
6849         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6850         of right expression resolving when left is false constant and
6851         operator is LogicalAnd OR true constant and operator is LogicalOr.
6852
6853         * statement.cs (ResolveUnreachable): Always reports warning.
6854
6855 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6856
6857         * class.cs: Distinguish between 1721 and 1722 (just a little help
6858         for the programmer).
6859
6860 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6861
6862         * delegate.cs: Only allow this on new versions of the language. 
6863
6864 2004-12-02  Duncan Mak  <duncan@ximian.com>
6865
6866         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6867         Expression class.
6868         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6869         here as a static method. Take an additional bool out parameter
6870         `must_do_cs1540_check' for signaling to InstanceResolve.
6871         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6872         member field from PropertyExpr class and made it an argument of
6873         the method instead.
6874         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6875         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6876         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6877         and `remove_accessor' as well as InstanceResolve: report CS0122
6878         where applicable.
6879
6880         Fixes #70129.
6881
6882 2004-12-07  Martin Baulig  <martin@ximian.com>
6883
6884         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6885         and CS0692 where appropriate.
6886
6887 2004-12-06  Martin Baulig  <martin@ximian.com>
6888
6889         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6890         IsDuplicateImplementation() and improved it.
6891
6892         * expression.cs (Invocation.InferTypeArguments): Added
6893         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6894         and removed the "ref" modifier from `infered_types'.
6895
6896         * decl.cs (MemberName.ToString): Removed the exception.
6897
6898 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6899
6900         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6901           comments are allowed.
6902
6903 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6904
6905         * delegate.cs: Add checks for subtypes in paramaters and return values
6906         in VerifyMethod () to add support for Covariance/Contravariance
6907         in delegates.
6908         
6909 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6910
6911         * report.cs: Remove extra closing parenthesis.
6912
6913         * convert.cs (Error_CannotImplicitConversion): If the name of the
6914         types are the same, provide some extra information.
6915
6916 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6917
6918         Fix bug #70102
6919         * attribute.cs (Resolve): Improved implementation of params
6920         attribute arguments.
6921
6922         * support.cs (ParameterData): Add HasParams to be faster.
6923
6924 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6925
6926         all things are for /doc support:
6927
6928         * doc.cs: new file that supports XML documentation generation.
6929         * mcs.exe.sources: added doc.cs.
6930         * driver.cs:
6931           Handle /doc command line option.
6932           Report error 2006 instead of 5 for missing file name for /doc.
6933           Generate XML documentation when required, after type resolution.
6934         * cs-tokenizer.cs:
6935           Added support for picking up documentation (/// and /** ... */),
6936           including a new XmlCommentState enumeration.
6937         * cs-parser.jay:
6938           Added lines to fill Documentation element for field, constant,
6939           property, indexer, method, constructor, destructor, operator, event
6940           and class, struct, interface, delegate, enum.
6941           Added lines to warn incorrect comment.
6942         * rootcontext.cs :
6943           Added Documentation field (passed only when /doc was specified).
6944         * decl.cs:
6945           Added DocComment, DocCommentHeader, GenerateDocComment() and
6946           OnGenerateDocComment() and some supporting private members for
6947           /doc feature to MemberCore.
6948         * class.cs:
6949           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6950         * delegate.cs:
6951           Added overriden DocCommentHeader.
6952         * enum.cs:
6953           Added overriden DocCommentHeader and GenerateDocComment().
6954
6955 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6956
6957         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6958         unwrapping the enumeration values, chain to
6959         DoConstantNumericPromotions again, so we can promote things to the
6960         fundamental types (takes care of enums that are bytes, sbytes).
6961
6962         Fixes bug #62054.
6963
6964 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6965
6966         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6967         Fix long-standing bug in type-lookup.  Use FindType instead of
6968         LookupType when ec.ResolvingTypeTree.
6969         (Attribute.ResolveType, Attribute.Resolve)
6970         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6971         Update to changes.
6972         (Attributes.Search): Remove internal version.  Update.
6973         (Attributes.SearchMulti): Update.
6974         (Attributes.GetClsCompliantAttribute): Remove.
6975         (Attributes.GetIndexerNameAttribute): Remove.
6976         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6977         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6978         * class.cs (Indexer.Define): Likewise.
6979
6980 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6981
6982         Fix bug #68790
6983         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6984         MarshallByReference members access.
6985
6986         * expression.cs: Use CheckMarshallByRefAccess;
6987         Better error CS0197 message.
6988
6989         * report.cs: Print whole related error message.
6990
6991 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6992
6993         * class (GetClassBases): Better error 60 report.
6994         (EventProperty): Disabled warning 67 detection.
6995
6996 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6997
6998         Fix bug #60324
6999         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7000
7001         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7002         precise values.
7003
7004 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7005
7006         Fix bug #49488
7007         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7008
7009         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7010
7011 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7012
7013         * attribute.cs (Attribute.Resolve): Refine error reporting and
7014         report a cs0117 if the identifier does not exist, to distinguish
7015         from 0617 which is a miss-use of the actual identifier.
7016
7017         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7018         between cs0070 and cs0079.
7019
7020         * class.cs (MemberBase.DoDefine): When reporting a wrong
7021         accessibility level, we use MethodCore to compare instead of
7022         Method (this was a regression in some refactoring effort).
7023
7024         So now we correctly report cs0056 again.
7025
7026         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7027         testing the target_type (which was known to be object_type) and
7028         not the source type (which is anonymous_method).
7029
7030         Fixed reporting of error cs1660.
7031
7032         * expression.cs (UserCast.Source): Expose the underlying cast.
7033
7034         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7035         allowed types to find a match to int32 first (most common).
7036
7037         In addition, it ignores any ImplicitUserConversions that did an
7038         internal implicit conversion (as the switch statement allows only
7039         one integral conversion to exist).
7040
7041         * class.cs (PartialContainer.Create): rename `name' to
7042         `member_name' for clarity.  Then replace the string calls with a
7043         call to MemberName.GetPartialName, as now using
7044         MemberName.ToString is an error (this is due to the side effects
7045         it had, that were fixed in the past).
7046
7047         This will restore the error reporting on a number of partial class
7048         errors that were missusing this (and getting an exception as a
7049         results, which is now just a plain textual warning, because
7050         yyparse debug output would crash otherwise).
7051
7052 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7053
7054         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7055
7056 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7057
7058         * rootcontext.cs (LookupType): Make sure to cache lookups that
7059         don't give us a negative result. This saves about 5% of corlib
7060         compilation time.
7061
7062 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7063
7064         * report.cs (AbstractMessage.Print): messages are sent to stderr
7065
7066         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7067         non-interface in the list of interfaces (at this point, either
7068         parent was properly set, or a base class is being listed in the
7069         interfaces section).
7070
7071         This flags error 1722, and resolves the crash from bug 69259.
7072
7073 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7074
7075         * statement.cs (Using.EmitExpressionFinally): make this work right
7076         for valuetypes. Fixes 69926.
7077
7078 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7079
7080         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7081         converted to an enum" here, before we try to change the underlying
7082         type.  This code exists, but it is a different code path than the
7083         one used while encoding constants.
7084
7085         (ImplicitReferenceConversionExists): In addition, resynchronized
7086         the code here, so it matches the same code in
7087         ImplicitReferenceConversionExists for the `from any class-type S
7088         to any interface-type T'.       
7089
7090 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7091
7092         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7093
7094 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7095
7096         * cs-parser.jay: Use verbosity accordingly. 
7097
7098 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7099
7100         * expression.cs (Unary.ResolveOperator): Do not report warning;
7101         AddressOf reads from variable.
7102         
7103         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7104
7105 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7106
7107         Fix bug #69462
7108
7109         * attribute.cs (Attributable): Removed CheckTargets.
7110         (Attributes.Emit): Explicit attribute targets are tested here.
7111
7112         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7113         not enabled for interfaces.
7114
7115         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7116         (GetAssemblyName): Ouch next bug there.
7117
7118 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7119
7120         * expression.cs: Error 275 added.
7121         
7122 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7123
7124         Fix bug #69177 (Implemented decimal constant support)
7125
7126         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7127         (BinaryFold): Add DecimalConstant.
7128
7129         * const.cs (Define): Decimal constant 
7130         (is not constant.
7131         (ChangeType): Add decimal type handling.
7132         (LookupConstantValue): Don't set value for decimal type but
7133         emit DecimalConstantAttribute. Needed for constant optimization.
7134
7135         * constant.cs (ToDecimal): New method.
7136         (ConvertToDecimal): New method.
7137         (IntConstant): Implemented ConvertToDecimal.
7138         (DecimalConstant.Emit): Emit optimized version for decimals in
7139         int range.
7140
7141         * expression.cs (ResolveOperator): Changed order of constant
7142         reduction to work correctly with native types which have
7143         overloaded operators.
7144         (ResolveMemberAccess): Extract constant value from attribute
7145         for decimal type.
7146
7147         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7148
7149         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7150         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7151         (ChangeType): Decimal is special.
7152         (TypeToCoreType): Add decimal type.
7153
7154 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7155
7156         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7157         decimal types.
7158
7159 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7160
7161         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7162         test cs1667-5.cs.
7163
7164 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7165
7166         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7167
7168         * pending.cs (PendingImplementation): Grab only interfaces.
7169
7170 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7171
7172         * statement.cs (ForeachHelperMethods): Add location member and
7173         error 202 detection.
7174
7175 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7176
7177         * expression.cs (DoResolveBase): Fixed wrong warning for out
7178         variables.
7179
7180 2004-12-04  Martin Baulig  <martin@ximian.com>
7181
7182         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7183         to check whether the conversion is ok.
7184
7185         * typemanager.cs (TypeManager.GetTypeArguments): Just return
7186         `Type.EmptyTypes' if we're not a generic TypeContainer.
7187
7188 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7189
7190         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7191         old bug: when converting from the null literal to a pointer,
7192         return an EmptyCast, not the NullLiteral.
7193
7194         This fixes #69921, the recent null_type changes probably made this
7195         bug more prominent.
7196
7197 2004-12-03  Martin Baulig  <martin@ximian.com>
7198
7199         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7200         method as our child, call AnonymousMethod.Compatible() on it.
7201
7202 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7203
7204         * class.cs (FieldBase): Use an unused bit field from the field to
7205         encode the `has_offset' property from the FieldMember.  This saves
7206         a couple of Ks on bootstrap compilation.
7207
7208         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7209         method as our child, return the AnonymousMethod resolved
7210         expression.
7211
7212         * expression.cs (New.DoResolve): Allow return values from
7213         NewDelegate to also include AnonymousMethods.
7214
7215         Fixes #70150.
7216
7217 2004-11-29  Raja R Harinath  <rharinath@novell.com>
7218
7219         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7220         cs1648 report.
7221         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7222         System.Runtime.InteropServices._Exception, since it's a base
7223         interface of the core type System.Exception in the net_2_0 profile.
7224
7225 2004-11-27  Martin Baulig  <martin@ximian.com>
7226
7227         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7228
7229 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7230
7231         * Makefile: Convert to use executable.make.
7232         * gmcs.exe.sources: New.
7233
7234 2004-11-25  Martin Baulig  <martin@ximian.com>
7235
7236         * expression.cs (Invocation.InferType): Added support for byref types.
7237
7238 2004-11-25  Martin Baulig  <martin@ximian.com>
7239
7240         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7241         in TypeManager.TypeToCoreType().
7242
7243 2004-11-25  Martin Baulig  <martin@ximian.com>
7244
7245         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7246         "Dispose" method from the `current_type'.
7247         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7248         DoDefineMembers() instead of using the MethodBuilder; this is
7249         required for generic iterators.
7250
7251         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7252
7253 2004-11-24  Martin Baulig  <martin@ximian.com>
7254
7255         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7256
7257 2004-11-20  Martin Baulig  <martin@ximian.com>
7258
7259         * expression.cs (Invocation.InferType): Correctly infer generic
7260         instances; see gen-103.cs.
7261         (Invocation.InferTypeArguments): If a generic method doesn't have
7262         any unbound type parameters, we don't need to infer anything.
7263
7264 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7265
7266         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7267
7268 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7269
7270         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7271         (TypeHandle.GetMemberCache): New.
7272         (TypeHandle.TypeHandle): Update.
7273         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7274         (TypeManager.LookupParentInterfacesCache):
7275         Rename from LookupInterfaceCache.  Optimize slightly.
7276         (TypeManager.MemberLookup_FindMembers): Update.
7277         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7278         multi-type variant.
7279         (AddCacheContents): Rename from AddHashtable.
7280         * class.cs (TypeContainer.parent_container): Remove.
7281         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7282         (TypeContainer.DoDefineMembers): Don't initialize it.
7283         Update to name changes.
7284         
7285 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7286
7287         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7288         that factors the code to check access modifiers on override.  
7289
7290         (PropertyBase): Use the code here.
7291
7292         Patch from Lluis S'anchez, fixes bug #69361.
7293
7294 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7295
7296         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7297         routine that is used to report the use of a captured variable
7298         whose address has been taken.
7299
7300         There are two checks: one when variables are being captured and
7301         the other check is when the address of a variable is taken. 
7302         
7303         (because an anonymous methods might be resolved before *or* after
7304         the address has been taken) and 
7305
7306         * expression.cs (Conditional.DoResolve): Remove the special
7307         casing that Martin added to trueExpr and falseExpr being both
7308         NullLiteral.  We get the right behavior now just by introducing
7309         the null_type into the compiler. 
7310
7311         * convert.cs (ExplicitConversion): Change the code to use
7312         null_type instead of testing `expr is NullLiteral'.
7313         (ImplicitConversionStandard): use null_type too.
7314         (ImplicitReferenceConversionExists): use null_type too.
7315         (ImplicitReferenceConversion): use null_type too.
7316
7317         * literal.cs: The type of `NullLiteral' is now null_type instead
7318         of object_type. 
7319         (Resolve): Set the type here.
7320
7321         * typemanager.cs: Introduce null_type.
7322
7323 2004-11-18  Martin Baulig  <martin@ximian.com>
7324
7325         * rootcontext.cs
7326         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7327
7328 2004-11-18  Martin Baulig  <martin@ximian.com>
7329
7330         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7331
7332 2004-11-18  Martin Baulig  <martin@ximian.com>
7333
7334         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7335         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7336         call ResolveConstructedType() on it to resolve it without checking
7337         constraints.
7338         (Constraints.ResolveTypes): Check them here.
7339         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7340         but don't check constraints.
7341         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7342         check constraints here.
7343         (ConstructedType.ResolveConstructedType): New public method.  This
7344         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7345         resolve ourselves without checking constraints.
7346
7347         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7348
7349 2004-11-18  Martin Baulig  <martin@ximian.com>
7350
7351         * decl.cs
7352         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7353
7354         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7355
7356 2004-11-18  Martin Baulig  <martin@ximian.com>
7357
7358         * ecore.cs (TypeExpr.ResolveType): Removed.
7359         (Expression.ResolveAsTypeTerminal): We always return a fully
7360         resolved `TypeExpr', so we can just access its `Type'.
7361
7362         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7363
7364 2004-11-17  Martin Baulig  <martin@ximian.com>
7365
7366         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7367         sure we don't return any unresolved TypeExpr's.
7368         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7369         a `TypeExpr'.
7370         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7371
7372         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7373         unresolved `ConstructedType's.
7374
7375 2004-11-17  Martin Baulig  <martin@ximian.com>
7376
7377         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7378
7379 2004-11-17  Martin Baulig  <martin@ximian.com>
7380
7381         * ecore.cs
7382         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7383
7384         * decl.cs (DeclSpace.ResolveType): Removed.
7385         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7386
7387 2004-11-17  Martin Baulig  <martin@ximian.com>
7388
7389         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7390         direction, like FindMembers() does.  Fixes #69546, testcase is in
7391         test-315.cs.    
7392
7393 2004-11-16  Martin Baulig  <martin@ximian.com>
7394
7395         This is based on a patch from Marek Safar, see bug #69082.
7396         Fixes bugs #63705 and #67130.
7397
7398         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7399         method; create a MemberCache for an interface type and cache the
7400         result.
7401
7402         * decl.cs (IMemberContainer.ParentContainer): Removed.
7403         (IMemberContainer.ParentCache): New property.
7404         (MemberCache.SetupCacheForInterface): Removed.
7405         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7406         to create a cache for an interface's "parent".
7407
7408         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7409         interfaces too.
7410
7411 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7412
7413         * statement.cs: Avoid adding bools to a hashtable.
7414
7415 2004-11-15  Martin Baulig  <martin@ximian.com>
7416
7417         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7418
7419 2004-11-11  Martin Baulig  <martin@ximian.com>
7420
7421         * typemanager.cs (TypeManager.GetMethodName): New method.
7422
7423         * class.cs (MethodData.Define): Include the generic arity in the
7424         name of an explicit interface; also add it to the method name.
7425
7426         * pending.cs (PendingImplementation.InterfaceMethod): The method
7427         name now includes the generic arity.
7428
7429 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7430
7431         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7432         calling an unsafe method from a safe location.
7433
7434 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7435
7436         Fix #69167
7437         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7438
7439 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7440
7441         * namespace.cs (VerifyUsing): use GetPartialName instead of
7442         ToString. 
7443
7444 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7445
7446         * statement.cs (Return.Resolve): Fix regression in typo: if
7447         `in_exc', we have to request a NeedReturnLabel, this was a typo
7448         introduced in the anonymous method check-in.  Fixes #69131.
7449
7450         * Indexers were using the ShortName when defining themselves,
7451         causing a regression in the compiler bootstrap when applying the
7452         patch from 2004-11-02 (first part), now they use their full name
7453         and the bug is gone.
7454
7455 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7456
7457         * driver.cs: Strip the path from the names of embedded resources. Fixes
7458         #68519.
7459
7460 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7461
7462         Fix error message regression: cs0104-2.cs.
7463         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7464         (AliasEntry.Resolve): Update.
7465         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7466         'silent' flag.
7467         (RootContext.LookupType): Update.
7468
7469 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7470
7471         * cs-parser.jay: Add support for handling accessor modifiers
7472         * class: Add support port accessor modifiers and error checking,
7473         define PropertyMethod.Define as virtual (not abstract anymore)
7474         * ecore.cs: Add checking for proeprties access with access modifiers
7475         * iterators.cs: Modify Accessor constructor call based in the modified
7476         constructor
7477 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7478
7479         * expression.cs (StringConcat): Handle being called twice,
7480         as when we have a concat in a field init with more than two
7481         ctors in the class
7482
7483 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7484
7485         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7486         special case explicit implementations, we should always produce
7487         the .property or .event declaration.
7488         
7489         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7490         since it will not return correct data if people use this
7491         unresolved in the presence of using statements (see test-313).
7492
7493         * class.cs (MethodData.Define): If we are an explicit interface
7494         implementation, set the method name to the full name of the
7495         interface plus the name of the method.  
7496
7497         Notice that using the method.MethodName.GetFullName() does not
7498         work, as it will only contain the name as declared on the source
7499         file (it can be a shorthand in the presence of using statements)
7500         and not the fully qualifed type name, for example:
7501
7502         using System;
7503
7504         class D : ICloneable {
7505                 object ICloneable.Clone ()  {
7506                 }
7507         }
7508
7509         Would produce a method called `ICloneable.Clone' instead of
7510         `System.ICloneable.Clone'.
7511
7512         * namespace.cs (Alias.Resolve): Use GetPartialName.
7513         
7514 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7515
7516         * cs-parser.jay: Add error 1055 report.
7517
7518 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7519
7520         * assign.cs (Assign.DoResolve): Only do the transform of
7521         assignment into a New if the types are compatible, if not, fall
7522         through and let the implicit code deal with the errors and with
7523         the necessary conversions. 
7524
7525 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7526
7527         * cs-parser.jay: Add error 1031 report.
7528
7529         * cs-tokenizer.cs: Add location for error 1038.
7530
7531 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7532
7533         * cs-parser.jay: Add error 1016 report.
7534
7535 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7536
7537         * cs-parser.jay: Add errors 1575,1611 report.
7538
7539 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7540
7541         * cs-parser.jay: Add error 1001 report.
7542
7543 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7544
7545         Fix #68850
7546         * attribute.cs (GetMarshal): Add method argument for
7547         caller identification.
7548
7549         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7550         agument for GetMarshal and RuntimeMissingSupport.
7551
7552 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7553
7554         * attribute.cs (ExtractSecurityPermissionSet): Removed
7555         TypeManager.code_access_permission_type.
7556
7557         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7558
7559 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7560
7561         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7562         for obsolete use of a variable here.   Fixes regression on errors
7563         cs0619-25 and cs0619-26.
7564
7565 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7566
7567         Fix #62358, implemented security attribute encoding.
7568
7569         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7570         Tests permitted SecurityAction for assembly or other types.
7571         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7572         data from SecurityPermissionAttribute to PermisionSet class.
7573
7574         * class.cs (ApplyAttributeBuilder): Added special handling
7575         for System.Security.Permissions.SecurityAttribute based types.
7576
7577         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7578         special handling for System.Security.Permissions.SecurityAttribute
7579         based types.
7580
7581         * enum.cs (ApplyAttributeBuilder): Added special handling
7582         for System.Security.Permissions.SecurityAttribute based types.
7583
7584         * parameter.cs (ApplyAttributeBuilder): Added special handling
7585         for System.Security.Permissions.SecurityAttribute based types.
7586
7587         * rootcontext.cs: Next 2 core types.
7588
7589         * typemanager.cs (TypeManager.security_permission_attr_type):
7590         Built in type for the SecurityPermission Attribute.
7591         (code_access_permission_type): Build in type.
7592
7593 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7594
7595         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7596         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7597         all of this information into
7598         EmitContext.EmitCapturedVariableInstance.
7599         
7600         * codegen.cs (EmitCapturedVariableInstance): move here the
7601         funcionality of emitting an ldarg.0 in the presence of a
7602         remapping.   This centralizes the instance emit code.
7603
7604         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7605         then emit a load of this: it means that we have reached the
7606         topmost ScopeInfo: the one that contains the pointer to the
7607         instance of the class hosting the anonymous method.
7608
7609         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7610         captures to the topmost CaptureContext.
7611
7612 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7613
7614         * expression.cs (LocalVariableReference): Move the knowledge about
7615         the iterators into codegen's EmitCapturedVariableInstance.
7616
7617 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7618
7619         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7620         all code paths return a value from an anonymous method (it is the
7621         same as the 161 error, but for anonymous methods).
7622
7623 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7624
7625         The introduction of anonymous methods in the compiler changed
7626         various ways of doing things in the compiler.  The most
7627         significant one is the hard split between the resolution phase
7628         and the emission phases of the compiler.
7629
7630         For instance, routines that referenced local variables no
7631         longer can safely create temporary variables during the
7632         resolution phase: they must do so from the emission phase,
7633         since the variable might have been "captured", hence access to
7634         it can not be done with the local-variable operations from the runtime.
7635         
7636         * statement.cs 
7637
7638         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7639         is a toplevel block.
7640
7641         (ToplevelBlock): A new kind of Block, these are the blocks that
7642         are created by the parser for all toplevel method bodies.  These
7643         include methods, accessors and anonymous methods.
7644
7645         These contain some extra information not found in regular blocks:
7646         A pointer to an optional CaptureContext (for tracking captured
7647         local variables and parameters).  A pointer to the parent
7648         ToplevelBlock.
7649         
7650         (Return.Resolve): Catch missmatches when returning a value from an
7651         anonymous method (error 1662).
7652         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7653         phase.
7654
7655         (Break.Resolve): ditto.
7656
7657         (SwitchLabel): instead of defining the labels during the
7658         resolution phase, we now turned the public ILLabel and ILLabelCode
7659         labels into methods called GetILLabelCode() and GetILLabel() that
7660         only define the label during the Emit phase.
7661
7662         (GotoCase): Track the SwitchLabel instead of the computed label
7663         (its contained therein).  Emit the code by using
7664         SwitchLabel.GetILLabelCode ().
7665
7666         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7667         whether the Local has been captured or not.
7668
7669         (LocalInfo.IsCaptured): New property, used to tell whether the
7670         local has been captured.
7671         
7672         * anonymous.cs: Vastly updated to contain the anonymous method
7673         support.
7674
7675         The main classes here are: CaptureContext which tracks any
7676         captured information for a toplevel block and ScopeInfo used to
7677         track the activation frames for various local variables.   
7678
7679         Each toplevel block has an optional capture context associated
7680         with it.  When a method contains an anonymous method both the
7681         toplevel method and the anonymous method will create a capture
7682         context.   When variables or parameters are captured, they are
7683         recorded on the CaptureContext that owns them, for example:
7684
7685         void Demo () {
7686              int a;
7687              MyDelegate d = delegate {
7688                  a = 1;
7689              }
7690         }
7691
7692         Here `a' will be recorded as captured on the toplevel
7693         CapturedContext, the inner captured context will not have anything
7694         (it will only have data if local variables or parameters from it
7695         are captured in a nested anonymous method.
7696
7697         The ScopeInfo is used to track the activation frames for local
7698         variables, for example:
7699
7700         for (int i = 0; i < 10; i++)
7701                 for (int j = 0; j < 10; j++){
7702                    MyDelegate d = delegate {
7703                         call (i, j);
7704                    }
7705                 }
7706
7707         At runtime this captures a single captured variable `i', but it
7708         captures 10 different versions of the variable `j'.  The variable
7709         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7710         recorded on a child.  
7711
7712         The toplevel ScopeInfo will also track information like the `this'
7713         pointer if instance variables were referenced (this is necessary
7714         as the anonymous method lives inside a nested class in the host
7715         type of the method). 
7716
7717         (AnonymousMethod): Expanded to track the Toplevel, implement
7718         `AnonymousMethod.Compatible' to tell whether an anonymous method
7719         can be converted to a target delegate type. 
7720
7721         The routine now also produces the anonymous method content
7722
7723         (AnonymousDelegate): A helper class that derives from
7724         DelegateCreation, this is used to generate the code necessary to
7725         produce the delegate for the anonymous method that was created. 
7726
7727         * assign.cs: API adjustments for new changes in
7728         Convert.ImplicitStandardConversionExists.
7729
7730         * class.cs: Adjustments to cope with the fact that now toplevel
7731         blocks are of type `ToplevelBlock'. 
7732
7733         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7734         insteda of standard blocks.
7735
7736         Flag errors if params arguments are passed to anonymous methods.
7737
7738         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7739         `CurrentAnonymousMethod' which points to the current Anonymous
7740         Method.  The variable points to the AnonymousMethod class that
7741         holds the code being compiled.  It is set in the new EmitContext
7742         created for the anonymous method.
7743
7744         (EmitContext.Phase): Introduce a variable and an enumeration to
7745         assist in enforcing some rules about when and where we are allowed
7746         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7747         only one that enfonces this right now).
7748
7749         (EmitContext.HaveCaptureInfo): new helper method that returns
7750         whether we have a CapturedContext initialized.
7751
7752         (EmitContext.CaptureVariable): New method used to register that a
7753         LocalInfo must be flagged for capturing. 
7754
7755         (EmitContext.CapturedParameter): New method used to register that a
7756         parameters must be flagged for capturing. 
7757         
7758         (EmitContext.CapturedField): New method used to register that a
7759         field must be flagged for capturing. 
7760
7761         (EmitContext.HaveCapturedVariables,
7762         EmitContext.HaveCapturedFields): Return whether there are captured
7763         variables or fields. 
7764
7765         (EmitContext.EmitMethodHostInstance): This is used to emit the
7766         instance for the anonymous method.  The instance might be null
7767         (static methods), this (for anonymous methods that capture nothing
7768         and happen to live side-by-side with the current method body) or a
7769         more complicated expression if the method has a CaptureContext.
7770
7771         (EmitContext.EmitTopBlock): Routine that drives the emission of
7772         code: it will first resolve the top block, then emit any metadata
7773         and then emit the code.  The split is done so that we can extract
7774         any anonymous methods and flag any captured variables/parameters.
7775         
7776         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7777         during this phase, the ILGenerator should not be used as labels
7778         and local variables declared here might not be accessible to any
7779         code that is part of an anonymous method.  
7780
7781         Exceptions to this include the temporary variables that are
7782         created by some statements internally for holding temporary
7783         variables. 
7784         
7785         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7786         metadata for a cb
7787
7788         (EmitContext.TemporaryReturn): This method is typically called
7789         from the Emit phase, and its the only place where we allow the
7790         ReturnLabel to be defined other than the EmitMeta.  The reason is
7791         that otherwise we would have to duplicate a lot of logic in the
7792         Resolve phases of various methods that today is on the Emit
7793         phase. 
7794
7795         (EmitContext.NeedReturnLabel): This no longer creates the label,
7796         as the ILGenerator is not valid during the resolve phase.
7797
7798         (EmitContext.EmitThis): Extended the knowledge in this class to
7799         work in anonymous methods in addition to iterators. 
7800
7801         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7802         code is necessary on the stack to access the instance to a local
7803         variable (the variable will be accessed as a field).
7804
7805         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7806         EmitContext.EmitAddressOfParameter): Routines to support
7807         parameters (not completed at this point). 
7808         
7809         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7810         will also remove the parameters.
7811
7812         * convert.cs (Convert): Define a `ConstantEC' which points to a
7813         null.  This is just to prefity some code that uses
7814         ImplicitStandardConversion code and do not have an EmitContext
7815         handy.
7816
7817         The idea is to flag explicitly that at that point in time, it is
7818         known that the conversion will not trigger the delegate checking
7819         code in implicit conversions (which requires a valid
7820         EmitContext). 
7821
7822         Everywhere: pass new EmitContext parameter since
7823         ImplicitStandardConversionExists now requires it to check for
7824         anonymous method conversions. 
7825
7826         (Convert.ImplicitStandardConversionExists): If the type of an
7827         expression is the anonymous_method_type, and the type is a
7828         delegate, we invoke the AnonymousMethod.Compatible method to check
7829         whether an implicit conversion is possible. 
7830
7831         (Convert.ImplicitConversionStandard): Only do implicit method
7832         group conversions if the language level is not ISO_1.
7833
7834         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7835         MethodInfo for the Invoke method.  used by Delegate and
7836         AnonymousDelegate.
7837
7838         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7839         method conversions if the target type is a delegate.
7840
7841         Removed extra debugging nops.
7842
7843         (LocalVariableReference): Turn the `local_info' into a public
7844         field. 
7845
7846         Add `prepared' field, the same hack used for FieldExprs to cope
7847         with composed assignments, as Local variables do not necessarily
7848         operate purely on the stack as they used to: they can be captured
7849         fields. 
7850
7851         Add `temp' for a temporary result, like fields.
7852
7853         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7854
7855         It now copes with Local variables that are captured and emits the
7856         proper instance variable to load it from a field in the captured
7857         case. 
7858
7859         (ParameterReference.DoResolveBase): During the resolve phase,
7860         capture parameters if we are in an anonymous method.
7861
7862         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7863         anonymous method, use the EmitContext helper routines to emit the
7864         parameter reference.
7865
7866         * iterators.cs: Set RemapToProxy to true/false during the
7867         EmitDispose class.
7868
7869         * parameters.cs (GetParameterByName): New helper method. 
7870
7871         * typemanager.cs (anonymous_method_type) a new type that
7872         represents an anonyous method.  This is always an internal type,
7873         used as a fencepost to test against the anonymous-methodness of an
7874         expression. 
7875         
7876 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7877
7878         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7879         561 report.
7880         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7881
7882 2004-11-10  Martin Baulig  <martin@ximian.com>
7883
7884         * expression.cs (Invocation.BetterFunction): If two methods have
7885         equal parameter types, but only one of them is generic, the
7886         non-generic one wins.
7887         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7888         instance; just use `Type.IsValueType' to determine whether
7889         something is a struct or not.
7890         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7891         so we can be called multiple times.
7892
7893 2004-11-10  Martin Baulig  <martin@ximian.com>
7894
7895         * generic.cs (TypeParameter.DefineConstraints): New public method.
7896         (TypeParameter.CheckAccessLevel): Override this and return true.
7897         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7898         override ResolveType() anymore.
7899         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7900
7901 2004-11-10  Martin Baulig  <martin@ximian.com>
7902
7903         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7904         call DeclSpace.ResolveNestedType() on it.
7905
7906 2004-11-10  Martin Baulig  <martin@ximian.com>
7907
7908         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7909         non-null, call ParameterModifier() on it.
7910
7911 2004-11-10  Martin Baulig  <martin@ximian.com>
7912
7913         * iterators.cs
7914         (Iterators): Added `current_type' and `this_type' fields.
7915         (Iterators.DefineIterator): Create a new EmitContext and store it
7916         in `ec'; compute `this_type'.
7917
7918 2004-11-10  Martin Baulig  <martin@ximian.com>
7919
7920         * typemanager.cs
7921         (TypeManager.IsPrivateAccessible): New public method.
7922         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7923
7924 2004-11-10  Martin Baulig  <martin@ximian.com>
7925
7926         * class.cs (TypeContainer.DefineType): Call
7927         TypeBuilder.DefineGenericParameters() before resolving the type
7928         parameters.
7929         (MethodData.parent_method): New protected field.
7930         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7931         (MethodData.Define): Compute `parent_method'.
7932
7933         * decl.cs
7934         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7935         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7936         (DeclSpace.ec): New protected field; store the EmitContext here.
7937         (DeclSpace.EmitContext): New public property.
7938         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7939         (DeclSpace.ResolveNestedType): New public method.
7940         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7941         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7942         (DeclSpace.FamilyAccessible): Likewise.
7943         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7944         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7945         EmitContext.
7946
7947         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7948         field.
7949
7950         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7951         (Enum.Emit): Don't create a new EmitContext.
7952
7953 2004-10-18  Martin Baulig  <martin@ximian.com>
7954
7955         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7956         `Type' directly, but call ResolveType() on it.
7957         (Catch.Resolve): Likewise.
7958         (Foreach.Resolve): Likewise.
7959
7960 2004-10-18  Martin Baulig  <martin@ximian.com>
7961
7962         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7963         `Type' directly, but call ResolveType() on it.
7964         (Probe.DoResolve): Likewise.
7965         (ArrayCreation.LookupType): Likewise.
7966         (TypeOf.DoResolve): Likewise.
7967         (SizeOf.DoResolve): Likewise.
7968
7969 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7970
7971         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7972         the ResolveType.
7973
7974 2004-10-17  John Luke  <john.luke@gmail.com>
7975
7976         * class.cs (Operator.GetSignatureForError): use CSharpName
7977
7978         * parameter.cs (Parameter.GetSignatureForError): Returns
7979         correct name even if was not defined.
7980
7981 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7982
7983         Fix #65816.
7984         * class.cs (TypeContainer.EmitContext): New property.
7985         (DefineNestedTypes): Create an emitcontext for each part.
7986         (MethodCore.DoDefineParameters): Use container's emitcontext.
7987         Pass type array to InternalParameters.
7988         (MemberBase.DoDefine): Use container's emitcontext.
7989         (FieldMember.Define): Likewise.
7990         (Event.Define): Likewise.
7991         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7992         Pass type array to InternalParameters.
7993         (SetIndexerMethod.GetParameterInfo): Likewise.
7994         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7995         * delegate.cs (Define): Pass emitcontext to
7996         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7997         array to InternalParameters.
7998         * expression.cs (ParameterReference.DoResolveBase): Pass
7999         emitcontext to GetParameterInfo.
8000         (ComposedCast.DoResolveAsTypeStep): Remove check on
8001         ec.ResolvingTypeTree.
8002         * parameter.cs (Parameter.Resolve): Change argument to
8003         EmitContext.  Use ResolveAsTypeTerminal.
8004         (Parameter.GetSignature): Change argument to EmitContext.
8005         (Parameters.ComputeSignature): Likewise.
8006         (Parameters.ComputeParameterTypes): Likewise.
8007         (Parameters.GetParameterInfo): Likewise.
8008         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8009         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8010         * support.cs (InternalParameters..ctor): Remove variant that takes
8011         a DeclSpace.
8012         * typemanager.cs (system_intptr_expr): New.
8013         (InitExpressionTypes): Initialize it.
8014
8015 2004-10-12  Chris Toshok  <toshok@ximian.com>
8016
8017         * cs-parser.jay: fix location for try_statement and catch_clause.
8018
8019 2004-10-18  Martin Baulig  <martin@ximian.com>
8020
8021         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8022         `Type' directly, but call ResolveType() on it.
8023         (MemberBase.DoDefine): Likewise.
8024
8025         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8026         `Type' directly, but call ResolveType() on it.
8027         (ComposedCast.DoResolveAsTypeStep): Likewise.
8028
8029         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8030         `Type' directly, but call ResolveType() on it.
8031
8032 2004-10-17  John Luke  <john.luke@gmail.com>
8033
8034         * class.cs (Operator.GetSignatureForError): use CSharpName
8035
8036         * parameter.cs (Parameter.GetSignatureForError): Returns
8037         correct name even if was not defined.
8038
8039 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8040
8041         Fix #65816.
8042         * class.cs (TypeContainer.EmitContext): New property.
8043         (DefineNestedTypes): Create an emitcontext for each part.
8044         (MethodCore.DoDefineParameters): Use container's emitcontext.
8045         Pass type array to InternalParameters.
8046         (MemberBase.DoDefine): Use container's emitcontext.
8047         (FieldMember.Define): Likewise.
8048         (Event.Define): Likewise.
8049         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8050         Pass type array to InternalParameters.
8051         (SetIndexerMethod.GetParameterInfo): Likewise.
8052         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8053         * delegate.cs (Define): Pass emitcontext to
8054         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8055         array to InternalParameters.
8056         * expression.cs (ParameterReference.DoResolveBase): Pass
8057         emitcontext to GetParameterInfo.
8058         (ComposedCast.DoResolveAsTypeStep): Remove check on
8059         ec.ResolvingTypeTree.
8060         * parameter.cs (Parameter.Resolve): Change argument to
8061         EmitContext.  Use ResolveAsTypeTerminal.
8062         (Parameter.GetSignature): Change argument to EmitContext.
8063         (Parameters.ComputeSignature): Likewise.
8064         (Parameters.ComputeParameterTypes): Likewise.
8065         (Parameters.GetParameterInfo): Likewise.
8066         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8067         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8068         * support.cs (InternalParameters..ctor): Remove variant that takes
8069         a DeclSpace.
8070         * typemanager.cs (system_intptr_expr): New.
8071         (InitExpressionTypes): Initialize it.
8072
8073 2004-10-12  Chris Toshok  <toshok@ximian.com>
8074
8075         * cs-parser.jay: fix location for try_statement and catch_clause.
8076
8077 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8078
8079         More DeclSpace.ResolveType avoidance.
8080         * decl.cs (MemberCore.InUnsafe): New property.
8081         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8082         with newly created EmitContext.
8083         (FieldMember.Define): Likewise.
8084         * delegate.cs (Delegate.Define): Likewise.
8085         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8086         only if normal name-lookup fails.
8087         (TypeExpr.DoResolve): Enable error-checking.
8088         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8089         (SizeOf.DoResolve): Likewise.
8090         (ComposedCast.DoResolveAsTypeStep): Likewise.
8091         (StackAlloc.DoResolve): Likewise.
8092         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8093         (Block.Unsafe): New property.
8094         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8095         (Unsafe): Set 'unsafe' flag of contained block.
8096         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8097         (Fixed.Resolve): Likewise.
8098         (Catch.Resolve): Likewise.
8099         (Using.ResolveLocalVariableDecls): Likewise.
8100         (Foreach.Resolve): Likewise.
8101
8102 2004-10-05  John Luke <john.luke@gmail.com>
8103
8104         * cs-parser.jay: add location to error CS0175
8105
8106 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8107
8108         * ecore.cs (Expression.Constantity): Add support for turning null
8109         into a constant.
8110
8111         * const.cs (Const.Define): Allow constants to be reference types
8112         as long as the value is Null.
8113
8114 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8115
8116         * namespace.cs (NamespaceEntry.Using): No matter which warning
8117         level is set, check if this namespace name has already been added.
8118
8119 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8120
8121         * expression.cs: reftype [!=]= null should always use br[true,false].
8122         # 67410
8123
8124 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8125
8126         Fix #67108
8127         * attribute.cs: Enum conversion moved to 
8128         GetAttributeArgumentExpression to be applied to the all
8129         expressions.
8130
8131 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8132
8133         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8134         * class.c (TypeContainer.DefineType): Flag error if
8135         base types aren't accessible due to access permissions.
8136         * decl.cs (DeclSpace.ResolveType): Move logic to
8137         Expression.ResolveAsTypeTerminal.
8138         (DeclSpace.ResolveTypeExpr): Thin layer over
8139         Expression.ResolveAsTypeTerminal.
8140         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8141         Refactor code into NestedAccess.  Use it.
8142         (DeclSpace.NestedAccess): New.
8143         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8144         argument to silence errors.  Check access permissions.
8145         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8146         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8147         (Cast.DoResolve): Likewise.
8148         (New.DoResolve): Likewise.
8149         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8150         (TypeOf.DoResolve): Likewise.
8151
8152         * expression.cs (Invocation.BetterConversion): Return the Type of
8153         the better conversion.  Implement section 14.4.2.3 more faithfully.
8154         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8155         section 14.4.2.2 explicit.
8156         (Invocation.OverloadResolve): Update.
8157         (Invocation): Remove is_base field.
8158         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8159         (Invocation.Emit): Likewise.
8160
8161 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8162
8163         * cs-parser.jay: Reverted 642 warning fix.
8164
8165 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8166
8167         Fix bug #66615
8168         * decl.cs (FindMemberWithSameName): Indexer can have more than
8169         1 argument.
8170
8171 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8172
8173         * expression.cs (LocalVariableReference.DoResolveLValue):
8174         Do not report warning 219 for out values.
8175         (EmptyExpression.Null): New member to avoid extra allocations.
8176
8177 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8178
8179         * cs-parser.jay: Fix wrong warning 642 report.
8180
8181         * cs-tokenizer.cs (CheckNextToken): New helper;
8182         Inspect next character if is same as expected.
8183
8184 2004-09-23  Martin Baulig  <martin@ximian.com>
8185
8186         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8187         (Convert.ImplicitReferenceConversionExists): Likewise.
8188
8189 2004-11-09  Raja R Harinath  <rharinath@novell.com>
8190
8191         * Makefile (DISTFILES): Comment out a few missing files.
8192
8193 2004-10-29  Raja R Harinath  <rharinath@novell.com>
8194
8195         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8196         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
8197         (gmcs.exe): Invoke bootstrap-libs.
8198         (clean-local): Clean the net_2_0_bootstrap profile too.
8199         (PROGRAM_INSTALL_DIR): New.
8200         (install-local): Use it.
8201
8202 2004-10-13  Martin Baulig  <martin@ximian.com>
8203
8204         * generic.cs (TypeManager.InflatedConstraints): New nested class.
8205         (TypeParameter.DefineType): If we're a method type parameter and
8206         that method is overriding something, "inflate" its constraints.
8207
8208 2004-10-12  Martin Baulig  <martin@ximian.com>
8209
8210         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8211         and have type arguments, create and resolve a ConstructedType.
8212
8213 2004-10-12  Martin Baulig  <martin@ximian.com>
8214
8215         * decl.cs (MemberCache.FindMemberToOverride): Use
8216         TypeManager.IsEqual() to compare the parameters and Type.Equals()
8217         to compare the invocationType.
8218
8219         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8220         When comparing two type parameters, only do the signature-only
8221         comparision for method type parameters.
8222
8223 2004-10-11  Martin Baulig  <martin@ximian.com>
8224
8225         * report.cs: Don't make --fatal abort on warnings, we have
8226         -warnaserror for that.
8227
8228 2004-10-11  Martin Baulig  <martin@ximian.com>
8229
8230         * typemanager.cs
8231         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8232         (TypeManager.IsEqual): Call ourself recursively instead of using
8233         Type.IsEqual(). 
8234
8235 2004-10-11  Martin Baulig  <martin@ximian.com>
8236
8237         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8238         on our own type parameters, not on the ones we inherit from a containing
8239         class.
8240
8241         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8242         the comparision.
8243
8244         * generic.cs (TypeParameter.Define): We may only be called once.
8245
8246         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8247         instead of TypeManager.IsEqual().
8248
8249 2004-09-28  Martin Baulig  <martin@ximian.com>
8250
8251         * generic.cs
8252         (GenericConstraints.EffectiveBaseClass): New public property.
8253         (TypeParameter.GenericConstraints): New public property.
8254         (ConstructedType.CheckConstraints): Improved.
8255
8256         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8257         (Convert.TypeParameterConversion): New private method; use this in
8258         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8259         for all conversions related to type parameters.
8260
8261 2004-09-24  Martin Baulig  <martin@ximian.com>
8262
8263         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8264         type parameter conversions for type parameters which are known to
8265         be reference types.
8266
8267 2004-09-24  Martin Baulig  <martin@ximian.com>
8268
8269         * generic.cs (GenericConstraints): Added `IsReferenceType' and
8270         `IsValueType' properties.
8271
8272         * support.cs (ReflectionConstraints): Use
8273         Type.GetGenericParameterConstraints() instead of the old hack.
8274
8275 2004-09-24  Martin Baulig  <martin@ximian.com>
8276
8277         * generic.cs (GenericConstraints): Moved here and made it an
8278         abstract class.
8279
8280         * support.cs (GenericConstraints): Moved to generic.cs.
8281
8282 2004-09-24  Martin Baulig  <martin@ximian.com>
8283
8284         * support.cs
8285         (ReflectionConstraints): Un-nested this class and made it public.
8286
8287         * typemanager.cs
8288         (TypeManager.GetTypeParameterConstraints): New public method.
8289         (TypeManager.HasConstructorConstraint): Use the attributes.
8290
8291 2004-09-24  Martin Baulig  <martin@ximian.com>
8292
8293         * support.cs (GenericConstraints): Replaced `HasConstructor',
8294         `IsReferenceType' and `IsValueType' with `Attributes'.
8295         (ReflectionParameters.ReflectionConstraints): Removed the Create()
8296         method and made the .ctor public.
8297
8298         * generic.cs (Constraints.Attributes): New public property.
8299         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8300         `IsReferenceType' -> `HasReferenceTypeConstraint' and
8301         `IsValueType' -> `HasValueTypeConstraint'.
8302
8303 2004-09-23  Martin Baulig  <martin@ximian.com>
8304
8305         * generic.cs (Constraints): Reflect latest runtime changes.
8306
8307 2004-09-23  Martin Baulig  <martin@ximian.com>
8308
8309         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8310         (Convert.ImplicitReferenceConversionExists): Likewise.
8311
8312 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8313
8314         * class.cs (Operator.Define): Add error 448 and 559 report.
8315         
8316 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8317
8318         * class.cs (MemberBase.IsTypePermitted): New protected
8319         method for checking error CS0610.
8320
8321 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8322
8323         * class.cs (TypeContainer.HasExplicitLayout): New property
8324         Returns whether container has StructLayout attribute set Explicit.
8325         (FieldMember): New abstract class for consts and fields.
8326         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8327         (Field): Reuse FieldMember.
8328
8329         * const.cs (Const): Reuse FieldMember.
8330
8331         * rootcontext.cs: EmitConstants call moved to class.
8332
8333 2004-09-22  Martin Baulig  <martin@ximian.com>
8334
8335         Marek and me just fixed one of our oldest bugs: #28562 :-)
8336
8337         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8338
8339         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8340         we're an EnumConstant, just return that.
8341         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8342         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8343         to get the value which'll actually be written into the attribute.
8344         However, we have to use GetValue() to access the attribute's value
8345         in the compiler.        
8346
8347 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8348
8349         * constant.cs (Constant.IsNegative): New abstract property
8350         IsNegative.
8351
8352         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8353         (StackAlloc.DoResolve): Reused IsNegative.
8354
8355 2004-09-22  Martin Baulig  <martin@ximian.com>
8356
8357         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8358         public method; like LookupTypeContainer, but also works for
8359         generic instances.
8360
8361         * report.cs (Report.SymbolRelatedToPreviousError): Use
8362         TypeManager.LookupGenericTypeContainer().       
8363
8364 2004-09-22  Martin Baulig  <martin@ximian.com>
8365
8366         Thanks to Peter Sestoft for this bug report.
8367
8368         * expression.cs (Conditional): If both the `trueExpr' and the
8369         `falseExpr' is a NullLiteral, return a NullLiteral.
8370
8371 2004-09-22  Martin Baulig  <martin@ximian.com>
8372
8373         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8374         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8375         for the "get_Current" call.
8376
8377 2004-09-21  Martin Baulig  <martin@ximian.com>
8378
8379         * convert.cs (Convert.ImplicitReferenceConversion): When
8380         converting to an interface type, first check whether we're
8381         converting from a reference type.
8382
8383 2004-09-14  Martin Baulig  <martin@ximian.com>
8384
8385         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8386
8387 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8388
8389         Fixed bug #61902
8390         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8391         called and is obsolete then this member suppress message
8392         when call is inside next [Obsolete] method or type.
8393
8394         * expression.cs: Use TestObsoleteMethodUsage member.
8395
8396 2004-09-14  Martin Baulig  <martin@ximian.com>
8397
8398         * genericparser.cs: Removed.
8399
8400 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8401
8402         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8403
8404 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8405
8406         * attribute.cs (Attribute.Resolve): Add error 653 report.
8407
8408         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8409         report.
8410         (Method.ApplyAttributeBuilder): Add error 685 report.
8411         (Operator.Define): Add error 564 report.
8412
8413         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8414
8415         * expression.cs (Invocation.DoResolve): Add error
8416         245 and 250 report.
8417
8418         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8419         error 674 report.
8420
8421 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8422
8423         * class.cs (ConstructorInitializer.Resolve):
8424         Wrong error number (515->516).
8425
8426 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8427
8428         * class.cs (Indexer.Define): Add error 631 report.
8429
8430 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8431
8432         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8433
8434 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8435
8436         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8437
8438 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8439
8440         * cs-parser.jay: Added error CS0241 report.
8441
8442 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8443
8444         * cs-parser.jay (fixed_statement): Introduce a scope for the
8445         declaration in the 'fixed' statement.
8446
8447 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8448
8449         * cs-parser.jay: Added CS0230 error report.
8450
8451 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8452
8453         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8454
8455 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8456
8457         * expression.cs (Argument.Resolve): Added error CS0192 and
8458         CS0199 report.
8459
8460 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8461
8462         C# 2.0 #pragma warning feature
8463
8464         * cs-tokenizer.cs (PreProcessPragma): New method; 
8465         Handles #pragma directive.
8466
8467         * report.cs (WarningRegions): New class; Support
8468         class for #pragma warning directive. It tests whether
8469         warning is enabled for a given line.
8470
8471 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8472
8473         * const.cs: Add more descriptive error report, tahnks to
8474         Sebastien. 
8475
8476 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8477
8478         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8479
8480 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8481
8482         * expression.cs: Apply patch from Ben: Remove dead code from
8483         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8484         as that code just threw an exception anwyays.
8485
8486         * const.cs: Remove the call to the turnintoconstant, for details
8487         see bug: #63144
8488         
8489         * literal.cs: The type of the null-literal is the null type;  So
8490         we use a placeholder type (literal.cs:System.Null, defined here)
8491         for it.
8492
8493         * expression.cs (Conditional.DoResolve): Remove some old code that
8494         is no longer needed, conversions have been fixed.
8495
8496         (ArrayCreationExpression.DoResolve): Return false if we fail to
8497         resolve the inner expression.
8498
8499 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8500
8501         Fix test-290.cs.
8502         * cs-parser.jay (delegate_declaration): Record a delegate
8503         declaration as a type declaration.
8504         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8505
8506 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8507
8508         * parameter.cs: Do not crash if the type can not be resolved. 
8509
8510         * expression.cs: Report errors with unsafe pointers, fixes #64896
8511
8512 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8513
8514         * expression.cs: Pointer arith always needs to do a conv.i
8515         if the operand is a long. fix 65320
8516
8517 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8518
8519         Fixed cs0619-37.cs, cs0619-38.cs
8520
8521         * enum.cs (GetObsoleteAttribute): Removed.
8522
8523         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8524         on Enum member is double staged. The first is tested member
8525         and then enum.
8526
8527 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8528
8529         Fixed #56986, #63631, #65231
8530
8531         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8532         adds member to name container.
8533         (TypeContainer.AddToTypeContainer): New method, adds type to
8534         name container.
8535         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8536         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8537         AddOperator): Simplified by reusing AddToMemberContainer.
8538         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8539         instead of field.
8540         (Method.CheckForDuplications): Fixed implementation to test all
8541         possibilities.
8542         (MemberBase): Detection whether member is explicit interface
8543         implementation is now in constructor.
8544         (MemberBase.UpdateMemberName): Handles IndexerName.
8545         (Accessor): Changed to keep also location information.
8546         (AbstractPropertyEventMethod): Is derived from MemberCore.
8547         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8548         will be emited or not.
8549         (PropertyBase.AreAccessorsDuplicateImplementation):
8550         Tests whether accessors are not in collision with some method.
8551         (Operator): Is derived from MethodCore to simplify common
8552         operations.
8553
8554         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8555         must be performed.
8556         (DeclSpace.AddToContainer): Adds the member to defined_names
8557         table. It tests for duplications and enclosing name conflicts.
8558
8559         * enum.cs (EnumMember): Clean up to reuse the base structures
8560
8561 2004-09-03  Martin Baulig  <martin@ximian.com>
8562
8563         Merged latest changes into gmcs.  Please keep this comment in
8564         here, it makes it easier for me to see what changed in MCS since
8565         the last time I merged.
8566
8567 2004-09-03  Martin Baulig  <martin@ximian.com>
8568
8569         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8570         into TypeContainer, to make partial classes work again.
8571
8572 2004-09-03  Martin Baulig  <martin@ximian.com>
8573
8574         * rootcontext.cs (RootContext.V2): Removed.
8575
8576 2004-03-23  Martin Baulig  <martin@ximian.com>
8577
8578         * expression.cs (Invocation.OverloadResolve): Added `bool
8579         may_fail' argument and use it instead of the Location.IsNull() hack.
8580
8581 2004-09-09  Martin Baulig  <martin@ximian.com>
8582
8583         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8584
8585 2004-09-09  Martin Baulig  <martin@ximian.com>
8586
8587         * generic.cs (TypeParameter.DefineType): Added support for
8588         explicit interface methods.
8589
8590 2004-09-09  Martin Baulig  <martin@ximian.com>
8591
8592         * README.Changes: New document.  Started to list important changes
8593         between MCS and GMCS here.
8594
8595 2004-09-08  Martin Baulig  <martin@ximian.com>
8596
8597         * class.cs
8598         (TypeContainer.CheckRecursiveDefinition): New protected method.
8599         (TypeContainer.DefineType): Move the CS0146 check into
8600         CheckRecursiveDefinition().     
8601
8602 2004-09-06  Martin Baulig  <martin@ximian.com>
8603
8604         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8605         types for the constructor constraint.
8606
8607 2004-09-03  Martin Baulig  <martin@ximian.com>
8608
8609         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8610         into TypeContainer, to make partial classes work again.
8611
8612 2004-09-03  Martin Baulig  <martin@ximian.com>
8613
8614         * rootcontext.cs (RootContext.V2): Removed.
8615
8616 2004-03-23  Martin Baulig  <martin@ximian.com>
8617
8618         * expression.cs (Invocation.OverloadResolve): Added `bool
8619         may_fail' argument and use it instead of the Location.IsNull() hack.
8620
8621 2004-09-03  Martin Baulig  <martin@ximian.com>
8622
8623         Merged latest changes into gmcs.  Please keep this comment in
8624         here, it makes it easier for me to see what changed in MCS since
8625         the last time I merged.
8626
8627 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8628
8629         Fix #61128.
8630         * expression.cs (BetterConversion): Don't allow either conversion 
8631         to be null.  Remove redundant implicit conversion test when 'q ==
8632         null' -- when this function is invoked, we already know that the
8633         implicit conversion exists.
8634         (BetterFunction): Assume that 'best' is non-null.  Remove
8635         redundant reimplementation of IsApplicable when 'best' is null.
8636         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8637         number of arguments.
8638         (IsAncestralType): Extract from OverloadResolve.
8639         (OverloadResolve): Make robust to the MethodGroupExpr being
8640         unsorted.  Implement all the logic of Section 14.5.5.1, and
8641         support overloading of methods from multiple applicable types.
8642         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8643
8644         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8645         (RealError, Warning): Append type of report to related symbol.
8646
8647 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8648
8649         * enum.cs: Fixed CLS-Compliance checks for enum members.
8650         Error tests cs3008-8.cs, cs3014-8.cs
8651
8652 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8653
8654         Fixed bug #62342, #63102
8655         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8656         like ImplementMethod.
8657
8658 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8659
8660         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8661         Fixed bug #65170.
8662
8663 2004-09-02  Martin Baulig  <martin@ximian.com>
8664
8665         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8666         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8667         on the MethodBase.
8668
8669 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8670
8671         C# 2.0 Static classes implemented
8672
8673         * class.cs (TypeContainer): instance_constructors,
8674         initialized_fields, initialized_static_fields,
8675         default_constructor, base_inteface_types are protected to be
8676         accessible from StaticClass.
8677         (TypeContainer.DefineDefaultConstructor): New virtual method
8678         for custom default constructor generating
8679         (StaticClass): New class to handle "Static classes" feature.
8680
8681         * cs-parser.jay: Handle static keyword on class like instance
8682         of StaticClass.
8683
8684         * driver.cs: Added "/langversion" command line switch with two
8685         options (iso-1, default).
8686
8687 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8688
8689         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8690
8691 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8692
8693         * delegate.cs: Style.
8694
8695 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8696
8697         * delegate.cs: Add seperate instance expr field for miguel.
8698
8699 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8700
8701         * PointerArithmetic (Resolve): make sure we are not doing
8702         pointer arith on void*. Also, make sure we are resolved
8703         by not setting eclass until resolve.
8704
8705         All callers: Make sure that PointerArithmetic gets resolved.
8706
8707 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8708
8709         * ArrayCreation (LookupType): If the type does not resolve 
8710         to an array, give an error.
8711
8712 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8713
8714         * statement.cs (Try.Resolve): Fixed bug #64222
8715
8716 2004-08-27  Martin Baulig  <martin@ximian.com>
8717
8718         * class.cs
8719         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8720         crash here.     
8721
8722 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8723
8724         * ecore.cs (Constantify): Get underlying type via
8725         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8726         Windows in special cases.
8727
8728 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8729
8730         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8731         for obtaining also private methods.
8732         (GetRemoveMethod): Used GetRemoveMethod (true)
8733         for obtaining also private methods.
8734
8735 2004-09-02  Martin Baulig  <martin@ximian.com>
8736
8737         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8738         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8739         on the MethodBase.
8740
8741 2004-08-27  Martin Baulig  <martin@ximian.com>
8742
8743         * class.cs
8744         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8745         crash here.     
8746
8747 2004-08-25  Martin Baulig  <martin@ximian.com>
8748
8749         * support.cs (ReflectionParameters..ctor): If this is a generic
8750         method, retrieve and store its type parameters.
8751         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8752         (ReflectionParameters.GenericConstraints): The argument specifies
8753         the type parameter, not the method parameter.
8754         (InternalParameters.GenericConstraints): Likewise.
8755
8756         * generic.cs (TypeParameter.DefineType): Correctly handle
8757         constraints wrt. generic methods in interfaces and their
8758         implementations.        
8759
8760 2004-08-24  Martin Baulig  <martin@ximian.com>
8761
8762         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8763         (Constraints.IsSubclassOf): New internal method.
8764
8765         * typemanager.cs (TypeManager.FindMembers): Added special support
8766         for GenericTypeParameterBuilder's.      
8767         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8768         type parameters.
8769
8770 2004-08-24  Martin Baulig  <martin@ximian.com>
8771
8772         * typemanager.cs
8773         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8774         this for accessibility checks.
8775         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8776         IsNestedFamilyAccessible.
8777         (TypeManager.IsSubclassOf): New method, do what the name actually
8778         says.   
8779
8780 2004-08-24  Martin Baulig  <martin@ximian.com>
8781
8782         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8783         as a SimpleName, include the generic arity.
8784
8785 2004-08-24  Martin Baulig  <martin@ximian.com>
8786
8787         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8788         MethodAttributes.HideBySig for operators.
8789
8790 2004-08-23  Martin Baulig  <martin@ximian.com>
8791
8792         Back to the old error reporting system :-)
8793
8794         * report.cs (Message): Removed.
8795         (Report.MessageData, ErrorData, WarningData): Removed.
8796         (Report.Error, Warning): Back to the old system.
8797
8798 2004-08-23  Martin Baulig  <martin@ximian.com>
8799
8800         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8801
8802         * class.cs (TypeContainer.ParentContainer): New public virtual
8803         method; replaces the explicit interface implementation.
8804         (ClassPart.ParentContainer): Override.
8805
8806 2004-08-23  Martin Baulig  <martin@ximian.com>
8807
8808         * statement.cs (Switch): Added support for constant switches; see
8809         #59428 or test-285.cs.
8810
8811 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8812
8813         Fixed bug #62740.
8814         * statement.cs (GetEnumeratorFilter): Removed useless
8815         logic because C# specs is strict. GetEnumerator must be
8816         public.
8817
8818 2004-08-22  Martin Baulig  <martin@ximian.com>
8819
8820         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8821         a switch and may break, reset the barrier.  Fixes #59867.
8822
8823 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8824
8825         CLS-Compliance speed up (~5% for corlib)
8826
8827         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8828         New method. Tests container for CLS-Compliant names
8829
8830         * class.cs (TypeContainer.VerifyClsName): New method.
8831         Checks whether container name is CLS Compliant.
8832         (Constructor): Implements IMethodData.
8833
8834         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8835         low-case table for CLS Compliance test.
8836         (MemberCache.VerifyClsParameterConflict): New method.
8837         Checks method parameters for CS3006 error.
8838
8839         * enum.cs (EnumMember): Is derived from MemberCore.
8840         (Enum.VerifyClsName): Optimized for better performance.
8841
8842 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8843
8844         * report.cs: Renamed Error_T to Error and changed all
8845         references.
8846
8847 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8848
8849         * class.cs (TypeContainer.IndexerArrayList): New inner class
8850         container for indexers.
8851         (TypeContainer.DefaultIndexerName): New constant for default
8852         indexer name. Replaced all "Item" with this constant.
8853         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8854
8855         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8856         DefaultMemberAttribute constructor.
8857
8858 2004-08-05  Martin Baulig  <martin@ximian.com>
8859
8860         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8861         Fix bug #59429.
8862
8863 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8864
8865         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8866         multi platforms problem.
8867
8868         * compiler.csproj: Included shared files.
8869
8870 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8871
8872         Fix bug 60333, 55971 in the more general way
8873         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8874         Added arg_type argument for constant conversion.
8875         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8876
8877 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8878
8879         Fix bug #59760
8880         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8881         OperatorArrayList, MethodCoreArrayList for typecontainer
8882         containers. Changed class member types to these new types.
8883         (MethodArrayList.DefineMembers): Added test for CS0659.
8884
8885 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8886
8887         * cfold.cs: Synchronize the folding with the code in expression.cs
8888         Binary.DoNumericPromotions for uint operands.
8889
8890         * attribute.cs: Revert patch from Raja, it introduced a regression
8891         while building Blam-1.2.1 (hard to isolate a test case).
8892
8893 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8894
8895         Fix for #55382
8896         * class.cs:
8897         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8898         name collision.
8899         (MethodCore.parent_method): New member. The method we're overriding
8900         if this is an override method.
8901         (MethodCore.CheckBase): Moved from Method class and made common.
8902         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8903         private.
8904         (MethodCore.CheckForDuplications): New abstract method. For custom
8905         member duplication search in a container
8906         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8907         method and its return type.
8908         (Event.conflict_symbol): New member. Symbol with same name in the
8909         parent class.
8910
8911         * decl.cs:
8912         (MemberCache.FindMemberWithSameName): New method. The method
8913         is looking for conflict with inherited symbols.
8914
8915 2004-08-04  Martin Baulig  <martin@ximian.com>
8916
8917         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8918
8919         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8920
8921 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8922
8923         * report.cs (Message): New enum for better error, warning reference in
8924         the code.
8925         (MessageData): New inner abstract class. It generally handles printing of
8926         error and warning messages.
8927         Removed unused Error, Warning, Message methods.
8928
8929 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8930
8931         Fix for cs0592-8.cs test
8932         * attribute.cs
8933         (Attributable.ValidAttributeTargets): Made public.
8934         (Attribute.ExplicitTarget): New member for explicit target value.
8935         (Attribute.CheckTargets): Now we translate explicit attribute
8936         target to Target here.
8937
8938 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8939
8940         * ecore.cs (MethodGroupExpr): new IsBase property.
8941
8942         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8943
8944         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8945         rather than an instance expr.
8946
8947         (DelegateCreation.Emit): Use the method group rather than
8948         the instance expression. Also, if you have base.Foo as the
8949         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8950
8951         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8952
8953         (NewDelegate.DoResolve): Only check for the existance of Invoke
8954         if the method is going to be needed. Use MethodGroupExpr.
8955
8956         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8957
8958         * expression.cs: For pointer arith., make sure to use
8959         the size of the type, not the size of the pointer to
8960         the type.
8961
8962 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8963
8964         Fix for #60722
8965         * class.cs (Class): Added error CS0502 test.
8966
8967 2004-08-03  John Luke  <jluke@cfl.rr.com>
8968             Raja R Harinath  <rharinath@novell.com>
8969
8970         Fix for #60997.
8971         * attribute.cs (Attribute.complained_before): New flag.
8972         (Attribute.ResolveType, Attribute.Resolve),
8973         (Attribute.DefinePInvokeMethod): Set it.
8974         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8975         
8976 2004-08-03  Martin Baulig  <martin@ximian.com>
8977
8978         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8979         use a user-defined operator; we still need to do numeric
8980         promotions in case one argument is a builtin type and the other
8981         one has an implicit conversion to that type.  Fixes #62322.
8982
8983 2004-08-18  Martin Baulig  <martin@ximian.com>
8984
8985         * class.cs (Method.Define): Use the correct method name when
8986         creating the MethodBuilder for a generic method.
8987
8988 2004-08-17  Martin Baulig  <martin@ximian.com>
8989
8990         * generic.cs (Constraints): Support type parameter constraints.
8991
8992 2004-08-16  Martin Baulig  <martin@ximian.com>
8993
8994         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8995         (Token.GENERIC_DIMENSION): New token; this is returned if we
8996         encounter an unbound generic type in a typeof() expression.
8997
8998         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8999         this token is only generated while parsing a typeof() expression.
9000         (typeof_expression): Removed the old unbound_type hack.
9001
9002         * generic.cs (TypeArguments.IsUnbound): New public property.
9003
9004         * decl.cs (MemberName): Added support for unbound types.
9005
9006 2004-08-14  Martin Baulig  <martin@ximian.com>
9007
9008         * typemanager.cs
9009         (TypeManager.IsEqualGenericInstance): New static method.
9010         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9011         just used to check accessibility, so follow the rules of 26.1.6.        
9012
9013         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9014         ConstructedType instead of a TypeExpression if we have type arguments.
9015
9016         * cs-parser.jay (typeof_expression): Support unbound generic types.
9017
9018         * ecore.cs (UnboundTypeExpression): New public class.
9019
9020 2004-08-12  Martin Baulig  <martin@ximian.com>
9021
9022         * typemanager.cs (TypeManager.IsNestedChildOf): Use
9023         TypeManager.IsEqual() rather than `=='.
9024
9025         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9026         generic instances as well.
9027
9028 2004-08-12  Martin Baulig  <martin@ximian.com>
9029
9030         * expression.cs (Invocation.InferType): We can only infer method
9031         type parameters.  Fixes #62647.
9032
9033 2004-08-11  Martin Baulig  <martin@ximian.com>
9034
9035         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9036         before resolving the base classes.
9037
9038 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9039
9040         * Makefile: install .mdb file too.
9041
9042 2004-08-05  Martin Baulig  <martin@ximian.com>
9043
9044         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9045         initializer, the current type is just the TypeBuilder, not the
9046         instantiated generic type.
9047         (FieldExpr.IsFieldInitializer): New public property.
9048
9049 2004-08-04  Martin Baulig  <martin@ximian.com>
9050
9051         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9052
9053         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9054
9055 2004-08-03  Martin Baulig  <martin@ximian.com>
9056
9057         * class.cs (MethodData.Define): If we're an explicit
9058         implementation, remove the generic arity from the type name.
9059
9060 2004-08-03  Martin Baulig  <martin@ximian.com>
9061
9062         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9063         use a user-defined operator; we still need to do numeric
9064         promotions in case one argument is a builtin type and the other
9065         one has an implicit conversion to that type.  Fixes #62322.
9066
9067 2004-08-02  Martin Baulig  <martin@ximian.com>
9068
9069         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9070         `TypeExpr[]' array.
9071         (TypeContainer.GetClassBases): Return the unexpanded list of
9072         interfaces; we expand them later.
9073         (TypeContainer.DefineType): After creating the TypeBuilder, call
9074         TypeManager.ExpandInterfaces() to get an expanded and resolved
9075         list of interfaces.
9076
9077         * ecore.cs (TypeExpr.GetInterfaces): Removed
9078
9079         * generics.cs (Constraints.InterfaceConstraints): Remove.
9080         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9081         register the interface constraints.
9082
9083         * typemanager.cs
9084         (TypeManager.AddUserType): Removed the `ifaces' argument.
9085         (TypeManager.AddTypeParameter): Likewise.
9086         (TypeManager.AddUserInterface): Removed, was unused.
9087         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9088         `TypeExpr[]' array for the interfaces.
9089         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9090         has been defined, returns a list of the resolved interfaces types.
9091         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9092         (TypeManager.GetExplicitInterfaces): Likewise.  
9093
9094 2004-08-02  Martin Baulig  <martin@ximian.com>
9095
9096         * expression.cs (Invocation.EmitCall): If we're invoking a method
9097         on a type parameter, use the new `Constrained' prefix opcode.
9098
9099 2004-08-02  Martin Baulig  <martin@ximian.com>
9100
9101         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9102         (LocalInfo.IsThis): New public property.
9103         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9104
9105 2004-08-01  Martin Baulig  <martin@ximian.com>
9106
9107         * class.cs (TypeContainer.GetClassBases): Don't set the default
9108         here since we may get called from GetPartialBases().
9109         (TypeContainer.DefineType): If GetClassBases() didn't return a
9110         parent, use the default one.
9111
9112 2004-07-30  Martin Baulig  <martin@ximian.com>
9113
9114         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9115
9116         * class.cs (SourceMethod): New public class, derive from the
9117         symbol writer's ISourceMethod.
9118         (Method): Use the new symbol writer API.
9119
9120         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9121         as argument and use the new symbol writer.
9122
9123         * location.cs
9124         (SourceFile): Implement the symbol writer's ISourceFile.
9125         (Location.SymbolDocument): Removed.
9126         (Location.SourceFile): New public property.
9127
9128         * symbolwriter.cs: Use the new symbol writer API.
9129
9130 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9131
9132         * Makefile (install-local): Remove.  Functionality moved to
9133         executable.make.
9134
9135 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9136
9137         * Makefile: Install mcs.exe.config file together with mcs.exe.
9138         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9139         correct runtime version.
9140         
9141 2004-07-25  Martin Baulig  <martin@ximian.com>
9142
9143         * class.cs
9144         (TypeContainer.RegisterOrder): Removed, this was unused.
9145         (TypeContainer, interface_order): Removed.
9146         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9147         TypeContainer as argument since we can also be called with a
9148         `PartialContainer' for a partial class/struct/interface.
9149         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9150         of checking whether we're an `Interface' - we could be a
9151         `PartialContainer'.
9152         (PartialContainer.Register): Override; call
9153         AddClass()/AddStruct()/AddInterface() on our parent.
9154
9155         * cs-parser.jay (interface_member_declaration): Add things to the
9156         `current_container', not the `current_class'.
9157
9158         * rootcontext.cs (RegisterOrder): The overloaded version which
9159         takes an `Interface' was unused, removed.
9160
9161         * typemanager.cs (TypeManager.LookupInterface): Return a
9162         `TypeContainer', not an `Interface'.
9163         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9164         contain a `PartialContainer' for an interface, so check it's
9165         `Kind' to figure out what it is.
9166
9167 2004-07-25  Martin Baulig  <martin@ximian.com>
9168
9169         * class.cs (Class.DefaultTypeAttributes): New public constant.
9170         (Struct.DefaultTypeAttributes): Likewise.
9171         (Interface.DefaultTypeAttributes): Likewise.
9172         (PartialContainer.TypeAttr): Override this and add the
9173         DefaultTypeAttributes.
9174
9175 2004-07-25  Martin Baulig  <martin@ximian.com>
9176
9177         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9178         we can just use the `Parent' field instead.
9179
9180 2004-07-25  Martin Baulig  <martin@ximian.com>
9181
9182         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9183
9184 2004-07-25  Martin Baulig  <martin@ximian.com>
9185
9186         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9187         our parts before defining any methods.
9188         (TypeContainer.VerifyImplements): Make this virtual.
9189         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9190         on our PartialContainer.
9191
9192 2004-07-25  Martin Baulig  <martin@ximian.com>
9193
9194         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9195
9196         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9197         argument, we can just use the `Parent' field instead.
9198
9199         * class.cs
9200         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9201         (MemberBase.DoDefine): Likewise.
9202
9203 2004-07-24  Martin Baulig  <martin@ximian.com>
9204
9205         * decl.cs (MemberCore.Parent): New public field.
9206         (DeclSpace.Parent): Moved to MemberCore.
9207
9208         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9209         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9210         parent's .ctor.
9211         (FieldBase, Field, Operator): Likewise.
9212         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9213         (EventField, Event): Likewise.
9214
9215 2004-07-23  Martin Baulig  <martin@ximian.com>
9216
9217         * class.cs (PartialContainer): New public class.
9218         (ClassPart): New public class.
9219         (TypeContainer): Added support for partial classes.
9220         (TypeContainer.GetClassBases): Splitted some of the functionality
9221         out into GetNormalBases() and GetPartialBases().
9222
9223         * cs-tokenizer.cs (Token.PARTIAL): New token.
9224         (Tokenizer.consume_identifier): Added some hacks to recognize
9225         `partial', but only if it's immediately followed by `class',
9226         `struct' or `interface'.
9227
9228         * cs-parser.jay: Added support for partial clases.
9229
9230 2004-07-23  Martin Baulig  <martin@ximian.com>
9231
9232         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9233         a `DeclSpace' and also made it readonly.
9234         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9235         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9236         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9237
9238         * cs-parser.jay: Pass the `current_class', not the
9239         `current_container' (at the moment, this is still the same thing)
9240         to a new Method, Property, Event, Indexer or Constructor.
9241
9242 2004-07-23  Martin Baulig  <martin@ximian.com>
9243
9244         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9245         and removed the `current_interface' one.
9246         (struct_declaration, class_declaration, interface_declaration):
9247         Set `current_class' to the newly created class/struct/interface;
9248         set their `Bases' and call Register() before parsing their body.
9249
9250 2004-07-23  Martin Baulig  <martin@ximian.com>
9251
9252         * class.cs (Kind): New public enum.
9253         (TypeContainer): Made this class abstract.
9254         (TypeContainer.Kind): New public readonly field.
9255         (TypeContainer.CheckDef): New public method; moved here from
9256         cs-parser.jay.
9257         (TypeContainer.Register): New public abstract method.
9258         (TypeContainer.GetPendingImplementations): New public abstract
9259         method.
9260         (TypeContainer.GetClassBases): Removed the `is_class' and
9261         `is_iface' parameters.
9262         (TypeContainer.DefineNestedTypes): Formerly known as
9263         DoDefineType().
9264         (ClassOrStruct): Made this class abstract.
9265
9266         * tree.cs (RootTypes): New public type. 
9267
9268 2004-07-20  Martin Baulig  <martin@ximian.com>
9269
9270         * tree.cs (Tree.RecordNamespace): Removed.
9271         (Tree.Namespaces): Removed.
9272
9273         * rootcontext.cs (RootContext.IsNamespace): Removed.
9274
9275         * cs-parser.jay (namespace_declaration): Just create a new
9276         NamespaceEntry here.
9277
9278 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
9279
9280         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9281         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9282         entry to make sure it runs in the correct runtime version.
9283         
9284 2004-07-18  Martin Baulig  <martin@ximian.com>
9285
9286         * generic.cs (ConstructedType.CheckConstraints): Improved
9287         constraints checking.
9288
9289 2004-07-18  Martin Baulig  <martin@ximian.com>
9290
9291         * expression.cs (Invocation.BetterMethod): Call
9292         TypeManager.TypeToCoreType() on all types and removed my previous
9293         hack; we're already doig the right thing here.
9294
9295 2004-07-17  Martin Baulig  <martin@ximian.com>
9296
9297         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9298
9299 2004-07-16  Martin Baulig  <martin@ximian.com>
9300
9301         * iterators.cs: Added generics support.
9302
9303 2004-07-16  Martin Baulig  <martin@ximian.com>
9304
9305         * iterators.cs: Rewrote this.  We're now using one single Proxy
9306         class for both the IEnumerable and the IEnumerator interface and
9307         `Iterator' derives from Class so we can use the high-level API.
9308
9309         * class.cs (TypeContainer.AddIterator): New method.
9310         (TypeContainer.DoDefineType): New protected virtual method, which
9311         is called from DefineType().
9312         (TypeContainer.DoDefineMembers): Call DefineType() and
9313         DefineMembers() on all our iterators.
9314         (TypeContainer.Emit): Call Emit() on all our iterators.
9315         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9316
9317         * codegen.cs (EmitContext.CurrentIterator): New public field.
9318
9319 2004-07-15  Martin Baulig  <martin@ximian.com>
9320
9321         * typemanager.cs
9322         (TypeManager.not_supported_exception_type): New type.   
9323
9324 2004-07-14  Martin Baulig  <martin@ximian.com>
9325
9326         * typemanager.cs
9327         (TypeManager.generic_ienumerable_type): New type.
9328         (TypeManager.generic_ienumerator_type): New type.
9329
9330         * rootcontext.cs
9331         (RootContext.interfaces_first_stage): Added
9332         "System.Collections.Generic.IEnumerator`1" and
9333         "System.Collections.Generic.IEnumerable`1".     
9334
9335 2004-07-14  Martin Baulig  <martin@ximian.com>
9336
9337         * iterators.cs: Use real error numbers.
9338
9339 2004-07-14  Martin Baulig  <martin@ximian.com>
9340
9341         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9342         requires this to be a System.Collection.IEnumerable and not a
9343         class implementing that interface.
9344         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9345
9346 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9347
9348         * class.cs: Fixed previous fix, it broke some error tests.
9349
9350 2004-07-12  Martin Baulig  <martin@ximian.com>
9351
9352         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9353         Fixes #61293.
9354
9355 2004-07-14  Martin Baulig  <martin@ximian.com>
9356
9357         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9358         an exclamation mark (!) for the generic arity to reflect the
9359         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9360
9361 2004-07-13  Martin Baulig  <martin@ximian.com>
9362
9363         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9364         specifiers being part of a type argument.
9365
9366 2004-07-13  Martin Baulig  <martin@ximian.com>
9367
9368         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9369         name for generic types.
9370
9371 2004-07-13  Martin Baulig  <martin@ximian.com>
9372
9373         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9374         bit to fix #60119.
9375
9376 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9377
9378         * assign.cs (LocalTemporary): Add new argument: is_address,If
9379         `is_address' is true, then the value that we store is the address
9380         to the real value, and not the value itself.
9381         
9382         * ecore.cs (PropertyExpr): use the new local temporary
9383         stuff to allow us to handle X.Y += z (where X is a struct)
9384
9385 2004-07-08  Martin Baulig  <martin@ximian.com>
9386
9387         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9388         not always return, just like we're doing in Using.Resolve().
9389
9390 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9391
9392         * cs-parser.jay (fixed_statement): flag this as Pinned.
9393
9394 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9395
9396         * typemanager.cs (TypeManager): Removed MakePinned method, this
9397         mechanism is replaced with the .NET 2.x compatible mechanism of
9398         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9399
9400         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9401         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9402         `IsFixed' property which has a different meaning.
9403
9404 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9405
9406         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9407         visible from inside a nested class, not just the names of the
9408         immediately enclosing class.
9409         Fix for bug #60730.
9410
9411 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9412
9413         * expression.cs (BetterConversion): Remove buggy special-case
9414         handling of "implicit constant expression conversions".  At this
9415         point, we already know that the conversion is possible -- we're
9416         only checking to see which is better.
9417
9418 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9419
9420         * cs-parser.jay: Added error CS0210 test.
9421
9422 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9423
9424         * cs-parser.jay: Added error CS0134 test.
9425
9426 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9427
9428         Fix bug #52507
9429         * cs-parser.jay: Added error CS0145 test.
9430
9431 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9432
9433         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9434
9435 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9436         
9437         * expression.cs (StackAlloc.Resolve): The argument may not
9438         be a constant; deal with this case.
9439         
9440 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9441
9442         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9443         GetIndexerAttributeValue.
9444         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9445
9446         * class.cs (Indexer.Define): Added error tests for CS0415,
9447         CS0609.
9448
9449 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9450
9451         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9452         property code.
9453
9454 2004-06-23  Martin Baulig  <martin@ximian.com>
9455
9456         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9457         neither return nor throw, reset the barrier as well.  Fixes #60457.
9458
9459 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9460
9461         * class.cs : EventAttributes is now set to None by default.
9462           This fixes bug #60459.
9463
9464 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9465
9466         Fix bug #60219
9467         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9468         Don't throw exception but return null (it's sufficient now).
9469
9470 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9471
9472         * typemanager.cs (GetArgumentTypes): Faster implementation.
9473
9474 2004-06-18  Martin Baulig  <martin@ximian.com>
9475
9476         * attribute.cs (Attribute.Resolve): Check whether we're an
9477         EmptyCast which a Constant child.  Fixes #60333.
9478
9479 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9480
9481         * statement.cs (EmitCollectionForeach): Account for the fact that
9482         not all valuetypes are in areas which we can take the address of.
9483         For these variables, we store to a temporary variable. Also, make
9484         sure that we dont emit a `callvirt' on a valuetype method.
9485
9486 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9487
9488         * expression.cs (StackAlloc.DoReSolve): Added test for
9489         negative parameter (CS0247).
9490
9491 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9492
9493         Fix bug #59792
9494         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9495
9496 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9497
9498         Fix bug #59781
9499         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9500         ulong.
9501
9502 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9503
9504         Fix bug #58254 & cs1555.cs, cs1556.cs
9505         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9506
9507 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9508
9509         * cs-parser.jay: Added error CS1669 test for indexers.
9510
9511 2004-06-18  Martin Baulig  <martin@ximian.com>
9512
9513         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9514         argument.  Fixes #60441.
9515
9516 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9517         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9518         The name needs to have the actual name of the method in order
9519         for other tests (such as the one in OverloadResolve for Invoke
9520         on a delegate) to work. As well, it does not really help
9521         error reporting because the method group had multiple methods.
9522         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9523         Make profiling work.
9524         
9525 2004-06-13  Martin Baulig  <martin@ximian.com>
9526
9527         * cs-parser.jay: Don't allow generic attributes.
9528
9529 2004-06-13  Martin Baulig  <martin@ximian.com>
9530
9531         * class.cs (MemberBase.DoDefineBase): New protected method.
9532         (MemberBase.DoDefine): Compute the `flags' in the new
9533         DoDefineBase() which must be called first.
9534         (Method.Define): Call DoDefineBase() first so we have the flags
9535         when defining the generic method.
9536
9537         * cs-parser.jay (interface_method_declaration): Support generic methods.
9538
9539 2004-06-13  Martin Baulig  <martin@ximian.com>
9540
9541         * decl.cs (TypeName): Removed.
9542         (MemberName): Removed TypeName and MemberNow; now we just have
9543         MemberName.
9544
9545         * cs-parser.jay: Don't distinguish between type arguments and type
9546         parameters in the grammar and simplified the rules a bit.  The
9547         reduce/reduce conflicts are now gone (except the one we inherited
9548         from mcs).
9549
9550 2004-06-11  Martin Baulig  <martin@ximian.com>
9551
9552         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9553         call this twice: for params and varargs methods.
9554
9555 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9556
9557         * class.cs:
9558         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9559
9560 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9561
9562         * attribute.cs (Attribute.GetValidTargets): Made public.
9563
9564         * class.cs: 
9565         (AbstractPropertyEventMethod): New class for better code sharing.
9566         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9567         CS1667 report.
9568         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9569
9570 2004-06-09  Martin Baulig  <martin@ximian.com>
9571
9572         * cs-parser.jay: Removed a reduce/reduce conflict.
9573
9574 2004-06-03  Martin Baulig  <martin@ximian.com>
9575
9576         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9577         GetSimpleName() and return a SimpleName.
9578
9579         * ecore.cs (SimpleName.Arguments): New public field.
9580         (SimpleName): Added overloaded ctor which takes an additional
9581         TypeArguments argument.
9582         (SimpleName.SimpleNameResolve): Added support for generic methods.
9583         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9584         formerly in MemberAccess.DoResolve(), but we also need it in
9585         SimpleNameResolve().
9586
9587         * expression.cs (MemberAccess.DoResolve): Use the new
9588         MethodGroupExpr.ResolveGeneric().       
9589
9590 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9591
9592         * decl.cs: If possible, use lookuptypedirect here. We can only do
9593         this if there is no `.' after the namespace. Avoids using
9594         LookupType, which does lots of slow processing.
9595         (FindNestedType) New method, does what it says :-).
9596         * namespace.cs: use LookupTypeDirect.
9597         * rootcontext.cs: use membercache, if possible.
9598         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9599
9600 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9601
9602         * expression.cs:
9603         According to the spec, 
9604
9605         In a member access of the form E.I, if E is a single identifier,
9606         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9607         field, property, localvariable, or parameter with the same type as
9608         the meaning of E as a type-name (§3.8), then both possible
9609         meanings of E are permitted.
9610
9611         We did not check that E as a simple-name had the same type as E as
9612         a type name.
9613
9614         This trivial check gives us 5-7% on bootstrap time.
9615
9616 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9617
9618         * expression.cs (Invocation.OverloadResolve): Avoid the
9619         use of hashtables and boxing here by allocating on demand.
9620
9621 2004-05-30  Martin Baulig  <martin@ximian.com>
9622
9623         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9624         we're doing a silent lookup.  Don't try to lookup nested types in
9625         TypeManager.object_type (thanks to Ben Maurer).
9626
9627 2004-05-30  Martin Baulig  <martin@ximian.com>
9628
9629         Committing a patch from Ben Maurer.
9630
9631         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9632
9633 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9634
9635         * convert.cs: add a trivial cache for overload operator resolution.
9636
9637 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9638
9639         * attribute.cs
9640         (AttributeTester.GetObsoleteAttribute): Returns instance of
9641         ObsoleteAttribute when type is obsolete.
9642
9643         * class.cs
9644         (TypeContainer.VerifyObsoleteAttribute): Override.
9645         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9646         (MethodCode.VerifyObsoleteAttribute): Override.
9647         (MemberBase.VerifyObsoleteAttribute): Override.
9648
9649         * decl.cs
9650         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9651         and report proper error.
9652
9653         *delegate.cs
9654         (Delegate.VerifyObsoleteAttribute): Override.
9655
9656         * ecore.cs
9657         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9658         and report proper error.
9659         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9660
9661         * enum.cs
9662         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9663         and enum member.
9664
9665         * expression.cs
9666         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9667         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9668         Added test for ObsoleteAttribute.
9669
9670         * statement.cs
9671         (Catch): Derived from Statement.
9672
9673 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9674
9675         * decl.cs: If possible, use lookuptypedirect here. We can only do
9676         this if there is no `.' after the namespace. Avoids using
9677         LookupType, which does lots of slow processing.
9678         (FindNestedType) New method, does what it says :-).
9679         * namespace.cs: use LookupTypeDirect.
9680         * rootcontext.cs: use membercache, if possible.
9681         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9682
9683 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9684
9685         * expression.cs:
9686         According to the spec, 
9687
9688         In a member access of the form E.I, if E is a single identifier,
9689         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9690         field, property, localvariable, or parameter with the same type as
9691         the meaning of E as a type-name (§3.8), then both possible
9692         meanings of E are permitted.
9693
9694         We did not check that E as a simple-name had the same type as E as
9695         a type name.
9696
9697         This trivial check gives us 5-7% on bootstrap time.
9698
9699 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9700
9701         Fixed bug #59071 & cs0160.cs
9702         * statement.cs (Try.Resolve): Check here whether order of catch
9703         clauses matches their dependencies.
9704
9705 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9706
9707         Fixed bug #58624
9708         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9709         unsafe type.
9710
9711 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9712
9713         * expression.cs (Invocation.OverloadResolve): Avoid the
9714         use of hashtables and boxing here by allocating on demand.
9715
9716 2004-05-30  Martin Baulig  <martin@ximian.com>
9717
9718         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9719         we're doing a silent lookup.  Don't try to lookup nested types in
9720         TypeManager.object_type (thanks to Ben Maurer).
9721
9722 2004-05-30  Martin Baulig  <martin@ximian.com>
9723
9724         Committing a patch from Ben Maurer.
9725
9726         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9727
9728 2004-05-29  Martin Baulig  <martin@ximian.com>
9729
9730         * class.cs (IMethodData.ShouldIgnore): New method.
9731
9732         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9733         `Location' argument, we don't need it anywhere.  Use
9734         `IMethodData.ShouldIgnore ()' instead of
9735         `MethodData.GetMethodFlags ()'.
9736         (TypeManager.AddMethod): Removed.
9737         (TypeManager.AddMethod2): Renamed to AddMethod.
9738
9739 2004-05-29  Martin Baulig  <martin@ximian.com>
9740
9741         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9742
9743         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9744         converting from a class type S to an interface type and we already
9745         have an object on the stack, don't box it again.  Fixes #52578.
9746
9747 2004-05-29  Martin Baulig  <martin@ximian.com>
9748
9749         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9750         Added support for `params' parameters.  Fixes #59267.
9751
9752 2004-05-29  Martin Baulig  <martin@ximian.com>
9753
9754         * literal.cs (NullPointer): Provide a private .ctor which sets
9755         `type' to TypeManager.object_type.  Fixes #59048.
9756
9757 2004-05-29  Martin Baulig  <martin@ximian.com>
9758
9759         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9760         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9761
9762         * ecore.cs (EventExpr.instance_expr): Make the field private.
9763
9764 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9765
9766         Fixed bug #50080 & cs0214-2.cs
9767         * expression.cs (Cast.DoResolve): Check unsafe context here.
9768         
9769         * statement.cs (Resolve.DoResolve): Likewise.
9770
9771 2004-05-26  Martin Baulig  <martin@ximian.com>
9772
9773         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9774
9775         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9776         (RootContext.LookupType): Pass down the `silent' flag.
9777
9778 2004-05-25  Martin Baulig  <martin@ximian.com>
9779
9780         * expression.cs
9781         (MethodGroupExpr.IdenticalTypeName): New public property.
9782         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9783         expression actually refers to a type.
9784
9785 2004-05-25  Martin Baulig  <martin@ximian.com>
9786
9787         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9788         for #56176 and made it actually work.
9789
9790 2004-05-25  Martin Baulig  <martin@ximian.com>
9791
9792         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9793         (FieldExpr, PropertyExpr): Override and implement
9794         CacheTemporaries.  Fixes #52279.
9795
9796 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9797
9798         * location.cs: In the new compiler listing a file twice is a
9799         warning, not an error.
9800
9801 2004-05-24  Martin Baulig  <martin@ximian.com>
9802
9803         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9804         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9805
9806 2004-05-24  Martin Baulig  <martin@ximian.com>
9807
9808         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9809         walking the `using' list.  Fixes #53921.
9810
9811 2004-05-24  Martin Baulig  <martin@ximian.com>
9812
9813         * const.cs (Const.LookupConstantValue): Added support for
9814         EmptyCast's; fixes #55251.
9815
9816 2004-05-24  Martin Baulig  <martin@ximian.com>
9817
9818         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9819         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9820         which does the CS0135 check.  The reason is that we first need to
9821         check whether the variable actually exists.
9822
9823 2004-05-24  Martin Baulig  <martin@ximian.com>
9824
9825         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9826         than RootContext.LookupType() to find the explicit interface
9827         type.  Fixes #58584.
9828
9829 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9830
9831         * Makefile: Simplify.  Use executable.make.
9832         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9833
9834 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9835
9836         * decl.cs:
9837         * enum.cs:
9838         Use the invariant culture when doing String.Compare for CLS case
9839         sensitivity.
9840         
9841 2004-05-23  Martin Baulig  <martin@ximian.com>
9842
9843         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9844         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9845
9846         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9847
9848 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9849
9850         * class.cs (MemberBase.Define): Reuse MemberType member for 
9851         resolved type. Other methods can use it too.
9852
9853 2004-05-23  Martin Baulig  <martin@ximian.com>
9854
9855         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9856         the variable also exists in the current block (otherwise, we need
9857         to report a CS0103).  Fixes #58670.
9858
9859 2004-05-23  Martin Baulig  <martin@ximian.com>
9860
9861         * flowanalysis.cs (Reachability.Reachable): Compute this
9862         on-the-fly rather than storing it as a field.
9863
9864 2004-05-23  Martin Baulig  <martin@ximian.com>
9865
9866         * flowanalysis.cs (Reachability.And): Manually compute the
9867         resulting `barrier' from the reachability.      
9868        
9869 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9870
9871         Fix bug #57835
9872         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9873         instance of ObsoleteAttribute when symbol is obsolete.
9874
9875         * class.cs
9876         (IMethodData): Extended interface for ObsoleteAttribute support.
9877
9878 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9879
9880         * attribute.cs: Fix bug #55970
9881
9882 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9883
9884         Fix bug #52705
9885         * attribute.cs
9886         (GetObsoleteAttribute): New method. Creates the instance of
9887         ObsoleteAttribute.
9888         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9889         ObsoleteAttribute when member is obsolete.
9890         (AttributeTester.Report_ObsoleteMessage): Common method for
9891         Obsolete error/warning reporting.
9892
9893         * class.cs
9894         (TypeContainer.base_classs_type): New member for storing parent type.
9895
9896         * decl.cs
9897         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9898         for this MemberCore.
9899
9900 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9901
9902         * attribute.cs, const.cs: Fix bug #58590
9903
9904 2004-05-21  Martin Baulig  <martin@ximian.com>
9905
9906         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9907         out parameters if the end of the method is unreachable.  Fixes
9908         #58098. 
9909
9910 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9911
9912         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9913         Hari was right, why extra method.
9914
9915 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9916
9917         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9918
9919 2004-05-20  Martin Baulig  <martin@ximian.com>
9920
9921         * delegate.cs: Convert this file to Unix mode - like the original
9922         version in mcs is.
9923
9924 2004-05-20  Martin Baulig  <martin@ximian.com>
9925
9926         * attribute.cs: Convert this file to Unix mode - like the original
9927         version in mcs is.
9928
9929 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9930
9931        Fix bug #58688 (MCS does not report error when the same attribute
9932        is assigned twice)
9933
9934        * attribute.cs (Attribute.Emit): Distinction between null and default.
9935
9936 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9937
9938        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9939        of a top-level attribute without an attribute target.
9940        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9941        Make non-static.
9942        (Attribute.Conditional_GetConditionName), 
9943        (Attribute.Obsolete_GetObsoleteMessage): Update.
9944        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9945        part of ScanForIndexerName.
9946        (Attribute.CanIgnoreInvalidAttribute): New function.
9947        (Attribute.ScanForIndexerName): Move to ...
9948        (Attributes.ScanForIndexerName): ... here.
9949        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9950        (Attributes.Search): New internal variant that can choose not to
9951        complain if types aren't resolved.  The original signature now
9952        complains.
9953        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9954        complaints suppressed.
9955        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9956        only if it not useful.
9957        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9958        top-level for attributes that are shared between the assembly
9959        and a top-level class.
9960        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9961        * class.cs: Update to reflect changes.
9962        (DefineIndexers): Fuse loops.
9963        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9964        a couple more variants of attribute names.
9965
9966 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9967
9968         Fix bug #52585 (Implemented explicit attribute declaration)
9969
9970         * attribute.cs:
9971         (Attributable.ValidAttributeTargets): New abstract method. It gets
9972         list of valid attribute targets for explicit target declaration.
9973         (Attribute.Target): It holds target itself.
9974         (AttributeSection): Removed.
9975         (Attribute.CheckTargets): New method. It checks whether attribute
9976         target is valid for the current element.
9977
9978         * class.cs:
9979         (EventProperty): New class. For events that are declared like
9980         property (with add and remove accessors).
9981         (EventField): New class. For events that are declared like field.
9982         class.cs
9983
9984         * cs-parser.jay: Implemented explicit attribute target declaration.
9985
9986         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9987         Override ValidAttributeTargets.
9988
9989         * parameter.cs:
9990         (ReturnParameter): Class for applying custom attributes on 
9991         the return type.
9992         (ParameterAtribute): New class. Class for applying custom
9993         attributes on the parameter type.
9994
9995 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9996
9997         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9998         definitions. 
9999
10000         (Method): Allow UNSAFE here.
10001
10002         * modifiers.cs: Support unsafe reporting.
10003
10004 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10005
10006         * decl.cs: Fix bug #58478.
10007
10008 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10009
10010         * statement.cs: When checking for unreachable code on an EmptyStatement,
10011         set the location. Fixes bug #58488.
10012
10013 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10014
10015         * driver.cs: Add -pkg handling.
10016
10017         From Gonzalo: UseShelLExecute=false
10018
10019 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10020
10021         * attribute.cs:
10022         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10023         for attribute.
10024         (Attribute.IsClsCompliaceRequired): Moved to base for better
10025         accesibility.
10026         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10027         when attribute is AttributeUsageAttribute.
10028         (Attribute.GetValidTargets): Simplified.
10029         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10030         attribute for this type.
10031         (Attribute.ApplyAttributes): Method renamed to Emit and make
10032         non-static.
10033         (GlobalAttributeSection): New class for special handling of global
10034         attributes (assembly, module).
10035         (AttributeSection.Emit): New method.
10036
10037         * class.cs: Implemented Attributable abstract methods.
10038         (MethodCore.LabelParameters): Moved to Parameter class.
10039         (Accessor): Is back simple class.
10040         (PropertyMethod): Implemented Attributable abstract class.
10041         (DelegateMethod): Implemented Attributable abstract class.
10042         (Event): New constructor for disctintion between normal Event
10043         and Event with accessors.
10044
10045         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10046
10047         * codegen.cs, const.cs, decl.cs, delegate.cs:
10048         (CommonAssemblyModulClass): Implemented Attributable abstract class
10049         and simplified.
10050
10051         * enum.cs: Implement IAttributeSupport interface.
10052         (EnumMember): New class for emum members. Implemented Attributable
10053         abstract class
10054
10055         * parameter.cs:
10056         (ParameterBase): Is abstract.
10057         (ReturnParameter): New class for easier [return:] attribute handling.
10058
10059         * typemanager.cs: Removed builder_to_attr.
10060
10061 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10062
10063         Fix bug #57151.
10064         * attribute.cs (Attribute.GetPositionalValue): New function.
10065         * class.cs (TypeContainer.VerifyMembers): New function.
10066         (TypeContainer.Emit): Use it.
10067         (ClassOrStruct): New base class for Class and Struct.
10068         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10069         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10070         class.
10071         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10072         then each non-static field should have a FieldOffset attribute.
10073         Otherwise, none of the fields should have a FieldOffset attribute.
10074         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10075         and FieldOffset attributes.
10076         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10077         (TypeManager.field_offset_attribute_type): New core types.
10078         (TypeManager.InitCoreTypes): Initialize them.
10079
10080 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10081
10082         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10083         Return correct type.
10084         From bug #58270.
10085
10086 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10087
10088         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10089         be implicitly converted to ulong.
10090         
10091         * expression.cs: The logic for allowing operator &, | and ^ worked
10092         was wrong, it worked before because we did not report an error in
10093         an else branch.  Fixes 57895.
10094
10095         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10096         allow volatile fields to be reference types.
10097
10098 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10099
10100         * driver.cs: Add support for /debug-
10101
10102 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10103
10104         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10105         Add a 'complain' parameter to silence errors.
10106         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10107         silently overlooked type-resolutions.
10108         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10109         to reflect changes.
10110         (Attributes.Search): New function.
10111         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10112         (Attributes.GetAttributeFullName): Remove hack.
10113         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10114         Update to reflect changes.
10115         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10116         Use Attributes.Search instead of nested loops.
10117
10118 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10119
10120         * decl.cs:
10121         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10122         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10123         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10124
10125         * report.cs: (Report.Warning): Renamed to Warning_T because of
10126         parameter collision.
10127
10128 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10129
10130         * expression.cs (MemberAccess.ResolveMemberAccess):
10131         Exit with non-zero status after Report.Error.
10132         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10133         Likewise.
10134         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10135
10136 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10137
10138         * support.cs: Don't hang when the file is empty.
10139
10140 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10141
10142         * support.cs: In SeekableStreamReader, compute the preamble size of the
10143           underlying stream. Position changes should take into account that initial
10144           count of bytes.
10145
10146 2004-05-03  Todd Berman  <tberman@sevenl.net>
10147
10148         * driver.cs: remove unused GetSysVersion function.
10149
10150 2004-05-03  Todd Berman  <tberman@sevenl.net>
10151
10152         * driver.cs: Remove the hack from saturday, as well as the hack
10153         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10154         link_paths to get that bit proper.
10155
10156 2004-05-01  Todd Berman  <tberman@sevenl.net>
10157
10158         * driver.cs: Try a LoadFrom before a Load, this checks the current
10159         path. This is currently a bug in mono that is be fixed, however, this
10160         provides a workaround for now. This will be removed when the bug
10161         is fixed.
10162
10163 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10164
10165         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10166         incomplete key pairs (#57941).
10167
10168 2004-05-01  Todd Berman  <tberman@sevenl.net>
10169
10170         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10171         from the GAC
10172
10173 2004-04-30  Jackson Harper  <jackson@ximian.com>
10174
10175         * codegen.cs: Open keys readonly.
10176         
10177 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10178
10179         * typemanager.cs: don't report cyclic struct layout when a struct
10180         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10181         which has 2 Pango.Rectangle fields.
10182
10183 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10184
10185         * expression.cs: Handle IntPtr comparisons with IL code
10186         rather than a method call.
10187
10188 2004-04-29  Martin Baulig  <martin@ximian.com>
10189
10190         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10191         the list of PropertyInfo's in class hierarchy and find the
10192         accessor.  Fixes #56013.
10193
10194 2004-04-29  Martin Baulig  <martin@ximian.com>
10195
10196         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10197
10198 2004-04-29  Martin Baulig  <martin@ximian.com>
10199
10200         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10201
10202         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10203
10204 2004-04-29  Martin Baulig  <martin@ximian.com>
10205
10206         * class.cs (ConstructorInitializer.Resolve): Check whether the
10207         parent .ctor is accessible.  Fixes #52146.
10208
10209 2004-04-29  Martin Baulig  <martin@ximian.com>
10210
10211         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10212
10213         * statement.cs (Using.EmitLocalVariableDecls): Use
10214         TypeManager.idisposable_type, not typeof (IDisposable).
10215         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10216
10217 2004-04-29  Martin Baulig  <martin@ximian.com>
10218
10219         * class.cs (Event.Define): Don't emit the field and don't set
10220         RTSpecialName and SpecialName for events on interfaces.  Fixes
10221         #57703. 
10222
10223 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10224
10225         Refactor Attribute.ApplyAttributes.
10226         * attribute.cs (Attributable): New base class for objects that can
10227         have Attributes applied on them.
10228         (Attribute): Make AttributeUsage fields public.
10229         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10230         (Attribute.IsInternalCall): New property.
10231         (Attribute.UsageAttr): Convert to a public read-only property.
10232         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10233         (Attribute.ResolveType, Attribute.Resolve)
10234         (Attribute.ScanForIndexerName): Update to reflect changes.
10235         (Attribute.CheckAttributeTarget): Re-format.
10236         (Attribute.ApplyAttributes): Refactor, to various
10237         Attributable.ApplyAttributeBuilder methods.
10238         * decl.cs (MemberCore): Make Attributable.
10239         * class.cs (Accessor): Make Attributable.
10240         (MethodData.ApplyAttributes): Use proper attribute types, not
10241         attribute names.
10242         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10243         (TypeContainer.ApplyAttributeBuilder)
10244         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10245         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10246         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10247         (Operator.ApplyAttributeBuilder): New factored-out methods.
10248         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10249         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10250         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10251         * parameter.cs (ParameterBase): New Attributable base class
10252         that can also represent Return types.
10253         (Parameter): Update to the changes.
10254
10255 2004-04-29  Jackson Harper  <jackson@ximian.com>
10256
10257         * driver.cs: Prefer the corlib system version when looking for
10258         assemblies in the GAC. This is still a hack, but its a better hack
10259         now.
10260         
10261 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10262
10263         * decl.cs, enum.cs: Improved error 3005 reporting.
10264   
10265         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10266         (related_symbols): New private member for list of symbols
10267         related to reported error/warning.
10268         
10269         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10270
10271 2004-04-29  Martin Baulig  <martin@ximian.com>
10272
10273         * ecore.cs (Expression.Constantify): If we're an enum and
10274         TypeManager.TypeToCoreType() doesn't give us another type, use
10275         t.UnderlyingSystemType.  Fixes #56178.  
10276
10277 2004-04-29  Martin Baulig  <martin@ximian.com>
10278
10279         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10280         interfaces and for each interface, only add members directly
10281         declared in that interface.  Fixes #53255.
10282
10283 2004-04-28  Martin Baulig  <martin@ximian.com>
10284
10285         * expression.cs (ConditionalLogicalOperator): Use a temporary
10286         variable for `left' to avoid that we evaluate it more than once;
10287         bug #52588.
10288
10289 2004-04-28  Martin Baulig  <martin@ximian.com>
10290
10291         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10292         `void[]' (CS1547).
10293
10294 2004-04-28  Martin Baulig  <martin@ximian.com>
10295
10296         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10297         void (CS1547).
10298
10299         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10300         whether the type is not void (CS1547).
10301
10302 2004-04-28  Martin Baulig  <martin@ximian.com>
10303
10304         * expression.cs (Unary.DoResolveLValue): Override this and report
10305         CS0131 for anything but Operator.Indirection.
10306
10307 2004-04-28  Martin Baulig  <martin@ximian.com>
10308
10309         Committing a patch from Ben Maurer; see bug #50820.
10310
10311         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10312         check for classes.
10313
10314         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10315         classes.        
10316
10317 2004-04-28  Martin Baulig  <martin@ximian.com>
10318
10319         Committing a patch from Ben Maurer; see bug #50820.
10320
10321         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10322         check for classes.
10323
10324         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10325         classes.        
10326
10327 2004-04-28  Martin Baulig  <martin@ximian.com>
10328
10329         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10330         (Block.AddLabel): Call DoLookupLabel() to only search in the
10331         current block.
10332
10333 2004-04-28  Martin Baulig  <martin@ximian.com>
10334
10335         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10336         comparing StringConstants and NullLiterals in Equality and Inequality.
10337
10338 2004-04-28  Jackson Harper  <jackson@ximian.com>
10339
10340         * driver.cs: Attempt to load referenced assemblies from the
10341         GAC. This is the quick and dirty version of this method that
10342         doesnt take into account versions and just takes the first
10343         canidate found. Will be good enough for now as we will not have more
10344         then one version installed into the GAC until I update this method.
10345
10346 2004-04-28  Martin Baulig  <martin@ximian.com>
10347
10348         * typemanager.cs (TypeManager.CheckStructCycles): New public
10349         static method to check for cycles in the struct layout.
10350
10351         * rootcontext.cs (RootContext.PopulateTypes): Call
10352         TypeManager.CheckStructCycles() for each TypeContainer.
10353         [Note: We only need to visit each type once.]
10354
10355 2004-04-28  Martin Baulig  <martin@ximian.com>
10356
10357         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10358
10359         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10360         success and added `out object value'.  Use a `bool resolved' field
10361         to check whether we've already been called rather than
10362         `ConstantValue != null' since this breaks for NullLiterals.
10363
10364 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10365
10366         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10367         setting of this flag, since the 'set' method may be non-public.
10368
10369 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10370
10371         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10372         check on current_vector.Block.
10373
10374 2004-04-27  Martin Baulig  <martin@ximian.com>
10375
10376         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10377         a field initializer.  Fixes #56459.
10378
10379 2004-04-27  Martin Baulig  <martin@ximian.com>
10380
10381         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10382         we're not attempting to use an indexer.  Fixes #52154.
10383
10384 2004-04-27  Martin Baulig  <martin@ximian.com>
10385
10386         * statement.cs (Return): Don't create a return label if we don't
10387         need it; reverts my change from January 20th.  Thanks to Ben
10388         Maurer for this.
10389
10390 2004-04-27  Martin Baulig  <martin@ximian.com>
10391
10392         According to the spec, `goto' can only leave a nested scope, but
10393         never enter it.
10394
10395         * statement.cs (Block.LookupLabel): Only lookup in the current
10396         block, don't recurse into parent or child blocks.
10397         (Block.AddLabel): Check in parent and child blocks, report
10398         CS0140/CS0158 if we find a duplicate.
10399         (Block): Removed this indexer for label lookups.
10400         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10401         this already does the error reporting for us.
10402
10403         * flowanalysis.cs
10404         (FlowBranching.UsageVector.Block): New public variable; may be null.
10405         (FlowBranching.CreateSibling): Added `Block' argument.
10406         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10407         label for the target of a `goto' and check whether we're not
10408         leaving a `finally'.
10409
10410 2004-04-27  Martin Baulig  <martin@ximian.com>
10411
10412         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10413         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10414         just for returns).
10415
10416 2004-04-27  Martin Baulig  <martin@ximian.com>
10417
10418         * statement.cs (Block.AddLabel): Also check for implicit blocks
10419         and added a CS0158 check.
10420
10421 2004-04-27  Martin Baulig  <martin@ximian.com>
10422
10423         * flowanalysis.cs (FlowBranchingLoop): New class.
10424         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10425         UsageVector's instead of an ArrayList.
10426         (FlowBranching.Label): Likewise.
10427         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10428         (FlowBranching.AddBreakVector): New method.
10429
10430 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10431
10432         * attribute.cs: Small regression fix: only convert the type if we
10433         the type is different, fixes System.Drawing build.
10434
10435 2004-04-27  Martin Baulig  <martin@ximian.com>
10436
10437         * attribute.cs (Attribute.Resolve): If we have a constant value
10438         for a named field or property, implicity convert it to the correct
10439         type.
10440
10441 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10442
10443         * statement.cs (Block.Block): Implicit blocks share
10444         'child_variable_names' fields with parent blocks.
10445         (Block.AddChildVariableNames): Remove.
10446         (Block.AddVariable): Mark variable as "used by a child block" in
10447         every surrounding block.
10448         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10449         been used in a child block, complain about violation of "Invariant
10450         meaning in blocks" rule.
10451         * cs-parser.jay (declare_local_variables): Don't use
10452         AddChildVariableNames.
10453         (foreach_statement): Don't create an implicit block: 'foreach'
10454         introduces a scope.
10455
10456 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10457
10458         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10459         converting from 0L to ulong.  Fixes 57522.
10460
10461 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10462
10463         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10464         derived class hides via 'new' keyword field from base class (test-242.cs).
10465         TODO: Handle this in the more general way.
10466         
10467         * class.cs (CheckBase): Ditto.
10468
10469 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10470
10471         * decl.cs (caching_flags): New member for storing cached values
10472         as bit flags.
10473         (MemberCore.Flags): New enum where bit flags for caching_flags
10474         are defined.
10475         (MemberCore.cls_compliance): Moved to caching_flags.
10476         (DeclSpace.Created): Moved to caching_flags.
10477
10478         * class.cs: Use caching_flags instead of DeclSpace.Created
10479         
10480 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10481
10482         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10483         if we are only a derived class, not a nested class.
10484
10485         * typemanager.cs: Same as above, but do this at the MemberLookup
10486         level (used by field and methods, properties are handled in
10487         PropertyExpr).   Allow for the qualified access if we are a nested
10488         method. 
10489
10490 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10491
10492         * class.cs: Refactoring.
10493         (IMethodData): New inteface; Holds links to parent members
10494         to avoid member duplication (reduced memory allocation).
10495         (Method): Implemented IMethodData interface.
10496         (PropertyBase): New inner classes for get/set methods.
10497         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10498         (Event): New inner classes for add/remove methods.
10499         (Event.DelegateMethod): Implemented IMethodData interface.
10500
10501         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10502         EmitContext (related to class.cs refactoring).
10503
10504 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10505
10506         * delegate.cs (Delegate.VerifyApplicability): If the number of
10507         arguments are the same as the number of parameters, first try to
10508         verify applicability ignoring  any 'params' modifier on the last
10509         parameter.
10510         Fixes #56442.
10511
10512 2004-04-08  Martin Baulig  <martin@ximian.com>
10513
10514         Merged latest changes into gmcs.  Please keep this comment in
10515         here, it makes it easier for me to see what changed in MCS since
10516         the last time I merged.
10517
10518 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10519
10520         * class.cs (TypeContainer.AddIndexer): Use
10521         'ExplicitInterfaceName' to determine if interface name was
10522         explicitly specified.  'InterfaceType' is not initialized at this time.
10523         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10524         Indexers array is already in the required order.  Initialize
10525         'IndexerName' only if there are normal indexers.
10526         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10527         (TypeContainer.Emit): Emit DefaultMember attribute only if
10528         IndexerName is initialized.
10529         Fixes #56300.
10530
10531 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10532
10533         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10534         Fixes #57007
10535
10536 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10537
10538         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10539         attributes.
10540         Fix for #56456.
10541
10542         * attribute.cs (Attribute.Resolve): Check for duplicate named
10543         attributes.
10544         Fix for #56463.
10545
10546 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10547
10548         * iterators.cs (MarkYield): track whether we are in an exception,
10549         and generate code accordingly.  Use a temporary value to store the
10550         result for our state.
10551
10552         I had ignored a bit the interaction of try/catch with iterators
10553         since their behavior was not entirely obvious, but now it is
10554         possible to verify that our behavior is the same as MS .NET 2.0
10555
10556         Fixes 54814
10557
10558 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10559
10560         * iterators.cs: Avoid creating temporaries if there is no work to
10561         do. 
10562
10563         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10564         Enumerations, use TypeManager.EnumToUnderlying and call
10565         recursively. 
10566
10567         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10568         bug #57013
10569
10570         (This.Emit): Use EmitContext.EmitThis to emit our
10571         instance variable.
10572
10573         (This.EmitAssign): Ditto.
10574
10575         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10576         codepaths, we will move all the functionality into
10577         Mono.CSharp.This 
10578
10579         (FieldExpr.EmitAssign): Ditto.
10580
10581         This fixes several hidden bugs that I uncovered while doing a code
10582         review of this today.
10583
10584         * codegen.cs (EmitThis): reworked so the semantics are more clear
10585         and also support value types "this" instances.
10586
10587         * iterators.cs: Changed so that for iterators in value types, we
10588         do not pass the value type as a parameter.  
10589
10590         Initialization of the enumerator helpers is now done in the caller
10591         instead of passing the parameters to the constructors and having
10592         the constructor set the fields.
10593
10594         The fields have now `assembly' visibility instead of private.
10595
10596 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10597
10598         * expression.cs (Argument.Resolve): Check if fields passed as ref
10599         or out are contained in a MarshalByRefObject.
10600
10601         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10602         another compiler type.
10603
10604 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10605
10606         * class.cs (Indexer.Define): use the new name checking method.
10607         Also, return false on an error.
10608         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10609         (is_identifier_[start/part]_character): make static.
10610
10611 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * expression.cs (Binary.ResolveOperator): Do no append strings
10614         twice: since we can be invoked more than once (array evaluation)
10615         on the same concatenation, take care of this here.  Based on a fix
10616         from Ben (bug #56454)
10617
10618 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10619
10620         * codegen.cs: Fix another case where CS1548 must be reported (when 
10621         delay-sign isn't specified and no private is available #56564). Fix
10622         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10623         error when MCS is used on the MS runtime and we need to delay-sign 
10624         (which seems unsupported by AssemblyBuilder - see #56621).
10625
10626 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10627
10628         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10629         (TypeManager.ComputeNamespaces): Faster implementation for
10630         Microsoft runtime.
10631
10632         * compiler.csproj: Updated AssemblyName to mcs.
10633
10634 2004-05-11  Jackson Harper  <jackson@ximian.com>
10635
10636         * Makefile: Preserve MONO_PATH
10637         
10638 2004-05-11  Jackson Harper  <jackson@ximian.com>
10639
10640         * Makefile: Use mono and mcs to build gmcs
10641         
10642 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10643
10644         * codegen.cs: Add patch from Robert Shade
10645         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10646         sync with mcs.
10647
10648 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10649
10650         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10651         incomplete key pairs (#57941).
10652
10653 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10654
10655         * codegen.cs: Fix another case where CS1548 must be reported (when 
10656         delay-sign isn't specified and no private is available #56564). Fix
10657         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10658         error when MCS is used on the MS runtime and we need to delay-sign 
10659         (which seems unsupported by AssemblyBuilder - see #56621).
10660
10661 2004-04-29  Jackson Harper  <jackson@ximian.com>
10662
10663         * Makefile: Set MONO_PATH to use the bootstrap corlib
10664         * driver.cs: Check the GAC for referenced assemblies.
10665                 
10666 2004-04-29  Martin Baulig  <martin@ximian.com>
10667
10668         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10669
10670 2004-04-07  Martin Baulig  <martin@ximian.com>
10671
10672         * expression.cs (Binary.ResolveOperator): Added special case for
10673         Equality/Inequality between a type parameter and a null literal.
10674
10675 2004-04-07  Martin Baulig  <martin@ximian.com>
10676
10677         * convert.cs: Check null literal -> type parameter conversions.
10678
10679 2004-04-07  Martin Baulig  <martin@ximian.com>
10680
10681         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10682         `class' and `struct' constraints.
10683
10684 2004-04-07  Martin Baulig  <martin@ximian.com>
10685
10686         * generic.cs (SpecialConstraint): New public enum.
10687         (Constraints.Resolve): Added support for the `class' and `struct'
10688         constraints.
10689
10690         * cs-parser.jay (type_parameter_constraint): Added support for the
10691         `class' and `struct' constraints.
10692
10693 2004-04-07  Martin Baulig  <martin@ximian.com>
10694
10695         * support.cs (GenericConstraints): Replaced `Types' by
10696         `ClassConstraint' and `InterfaceConstraints'; added
10697         `HasClassConstraint'.   
10698
10699 2004-04-07  Martin Baulig  <martin@ximian.com>
10700
10701         * generic.cs
10702         (Constraints.InterfaceConstraints): New public property.
10703         (Constraints.Types): Make this property public
10704         (TypeParameter): Implement IMemberContainer.
10705         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10706         instead of a TypeBuilder/MethodBuilder; pass the interface
10707         constraints to TypeManager.AddTypeParameter().
10708         (TypeParameter.DefineType): Just take an EmitContext and no
10709         TypeBuilder/MethodBuilder.  Use the new public API.
10710
10711         * typemanager.cs (TypeManager.AddTypeParameter): Added
10712         `TypeExpr[]' argument; add the interfaces to the
10713         `builder_to_ifaces' hash.
10714         (TypeManager.LookupMemberContainer): For
10715         GenericTypeParameterBuilders, get the TypeParameter from the
10716         `builder_to_type_param'.
10717         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10718         the TypeParameter and call FindMembers on it.
10719
10720 2004-04-07  Martin Baulig  <martin@ximian.com>
10721
10722         * class.cs
10723         (MethodCore.GenericMethod): Moved this field here from Method.
10724         (MethodCore.IsDuplicateImplementation): Take the number of type
10725         parameters into account if we're a generic method.
10726
10727         * expression.cs (Invocation.InferTypeArguments): Don't return true
10728         if `arguments' is null; we still need to check whether we actually
10729         don't need to infer anything in this case.
10730         (MemberAccess): Merged the functionality from GenericMemberAccess
10731         into this class.
10732
10733         * generic.cs (GenericMemberAccess): Removed.
10734
10735 2004-04-05  Martin Baulig  <martin@ximian.com>
10736
10737         * decl.cs (MemberCore): For generic classes, interfaces and
10738         structs, `Name' now includes the number of type parameters
10739         ("Stack!1.Node!1").
10740         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10741         encode the number of type arguments in the type name.
10742
10743         * expression.cs (Expression.MemberLookup): Removed the
10744         `num_type_args' argument; we now encode the number of type
10745         arguments in the type name.
10746
10747         * ecore.cs (SimpleName): Encode the number of type arguments in
10748         the type name itself.
10749
10750         * generic.cs (ConstructedType): Likewise.
10751
10752         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10753         `MemberName'; we now include the number of type parameters in the
10754         type name.
10755
10756         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10757         (TypeManager.MemberLookup): Removed the
10758         `num_type_args' argument; we now encode the number of type
10759         arguments in the type name.     
10760
10761 2004-04-03  Martin Baulig  <martin@ximian.com>
10762
10763         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10764         (MemberCore.MemberName): Moved here from MemberBase.
10765         (DeclSpace.SetParameterInfo): Just take the constraints as an
10766         ArrayList; we already have the type parameters in our
10767         `MemberName'; also do the CS0080 reporting here.
10768
10769         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10770         `IDENTIFIER opt_type_parameter_list'; when constructing our
10771         `MemberName', it'll already include our type parameters.
10772         (class_declaration, interface_declaration): Likewise.
10773         (delegate_declaration): Likewise.
10774         (MakeName): Take a MemberName and return a MemberName.
10775         The following two changes are required to avoid shift/reduce conflicts:
10776         (member_name): Don't include a TypeName anymore; ie. this is now
10777         just 'IDENTIFIER opt_type_parameter_list'.
10778         (property_declaration, event_declaration): Use a
10779         `namespace_or_type_name' instead of a `member_name'.            
10780
10781 2004-04-03  Martin Baulig  <martin@ximian.com>
10782
10783         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10784         `MemberName' class.
10785         (TypeName): Formerly known as MemberName.
10786
10787         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10788         instead of a `MemberName'.
10789
10790         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10791         (member_name): New rule; create a MemberName.
10792
10793 2004-04-02  Martin Baulig  <martin@ximian.com>
10794
10795         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10796         (CS0305 and CS0308).
10797
10798 2004-04-02  Martin Baulig  <martin@ximian.com>
10799
10800         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10801         support for nested types.
10802
10803 2004-04-02  Martin Baulig  <martin@ximian.com>
10804
10805         * ecore.cs (IAlias): New public interface.
10806         (TypeExpr, TypeExpression): Implement IAlias.
10807         (TypeAliasExpression): New public class.
10808
10809         * namespace.cs (Namespace): Implement IAlias.
10810         (Namespace.Lookup): Return an IAlias instead on an object.
10811         (Namespace.DefineName): Take an IAlias instead of an object.
10812         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10813         an object.
10814         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10815         Expression.
10816         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10817         object.
10818         (NamespaceEntry.Lookup): Likewise.
10819
10820         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10821         instead of a Type.      
10822
10823         * decl.cs (DeclSpace): Implement IAlias.
10824         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10825
10826         * generic.cs (ConstructedType): Improved error checking.
10827
10828 2004-04-02  Martin Baulig  <martin@ximian.com>
10829
10830         * convert.cs: Added type parameter conversions.
10831
10832         * ecore.cs
10833         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10834         (ClassCast.Emit): If the source type is a type parameter, box it.
10835         If the target type is a type parameter, emit an `unbox.any'
10836         instead of a `classcast'.1      
10837
10838 2004-04-01  Martin Baulig  <martin@ximian.com>
10839
10840         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10841
10842 2004-04-01  Martin Baulig  <martin@ximian.com>
10843
10844         * generic.cs (ConstructedType.CheckConstraints): Use
10845         Convert.ImplicitStandardConversionExists(); user-defined implicit
10846         conversions are not allowed according to the spec.
10847
10848 2004-03-30  Martin Baulig  <martin@ximian.com>
10849
10850         * expression.cs (New): Added support for type parameters.
10851
10852         * typemanager.cs
10853         (TypeManager.activator_type): New public static field.
10854         (TypeManager.activator_create_instance): Likewise.
10855
10856 2004-03-30  Martin Baulig  <martin@ximian.com>
10857
10858         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10859         public method.
10860
10861 2004-03-30  Martin Baulig  <martin@ximian.com>
10862
10863         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10864         the spec here: the argument type must be convertible to the
10865         constraints.
10866
10867 2004-03-30  Martin Baulig  <martin@ximian.com>
10868
10869         * generic.cs
10870         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10871         TypeManager.AddTypeParameter().
10872         (ConstructedType.CheckConstraints): Re-enable this and actually
10873         check whether we have a constructor constraint.
10874
10875         * typemanager.cs
10876         (TypeManager.builder_to_type_param): New static field.
10877         (TypeManager.AddTypeParameter): New static method.
10878         (TypeManager.LookupTypeParameter): New public method.
10879
10880 2004-03-30  Martin Baulig  <martin@ximian.com>
10881
10882         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10883         the new API to actually define the constructor constraint.
10884
10885         * typemanager.cs
10886         (TypeManager.new_constraint_attr_type): New static field.
10887         (TypeManager.InitCoreTypes): Initialize it.
10888
10889 2004-03-30  Martin Baulig  <martin@ximian.com>
10890
10891         * generic.cs (Constraints): Completed error checking, use correct
10892         error numbers.
10893
10894 2004-03-29  Martin Baulig  <martin@ximian.com>
10895
10896         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10897
10898         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10899         public version which takes a `ParameterData pd' instead of an
10900         `ArrayList args'.
10901
10902 2004-03-29  Martin Baulig  <martin@ximian.com>
10903
10904         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10905         not a MethodInfo.       
10906
10907 2004-03-29  Martin Baulig  <martin@ximian.com>
10908
10909         * expression.cs (Argument.ResolveMethodGroup): If we're a
10910         ConstructedType, call GetMemberAccess() on it.  
10911
10912 2004-03-29  Martin Baulig  <martin@ximian.com>
10913
10914         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10915         (MethodCore.CheckGenericOverride): When overriding a generic
10916         method, check whether the constraints match.
10917
10918         * support.cs (GenericConstraints): New public interface.
10919         (ParameterData.GenericConstraints): New public method.
10920
10921         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10922         method parameter and compute our constraints if appropriate.
10923         (Parameter.GenericConstraints): New public property.
10924
10925         * generic.cs (Constraints): Implement GenericConstraints.
10926
10927 2004-03-29  Martin Baulig  <martin@ximian.com>
10928
10929         * decl.cs (MemberCache.FindMemberToOverride): Use
10930         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10931
10932 2004-03-29  Martin Baulig  <martin@ximian.com>
10933
10934         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10935
10936 2004-03-29  Martin Baulig  <martin@ximian.com>
10937
10938         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10939         not allowed on non-generic declarations").
10940
10941 2004-03-29  Martin Baulig  <martin@ximian.com>
10942
10943         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10944         public version of this method.
10945
10946         * class.cs (MethodCore.IsDuplicateImplementation): Use
10947         Invocation.InferTypeArguments() to check this.
10948
10949 2004-03-29  Martin Baulig  <martin@ximian.com>
10950
10951         * convert.cs: Use TypeManager.IsDelegateType() instead of
10952         comparing types correctly.
10953
10954 2004-03-29  Martin Baulig  <martin@ximian.com>
10955
10956         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10957         types directly to make it work for generic instances.
10958
10959         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10960
10961 2004-03-29  Martin Baulig  <martin@ximian.com>
10962
10963         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10964         support for arrays.     
10965
10966 2004-03-24  Martin Baulig  <martin@ximian.com>
10967
10968         * decl.cs (DeclSpace.FindType): Also use
10969         TypeManager.CheckGeneric() for types from the using clauses.
10970
10971 2004-03-23  Martin Baulig  <martin@ximian.com>
10972
10973         * expression.cs (Invocation.OverloadResolve): Added `bool
10974         may_fail' argument and use it instead of the Location.IsNull() hack.
10975
10976 2004-03-23  Martin Baulig  <martin@ximian.com>
10977
10978         * expression.cs (Invocation.InferType): Use correct type inference
10979         rules here.     
10980
10981 2004-03-23  Martin Baulig  <martin@ximian.com>
10982
10983         * ecore.cs (MethodGroupExpr.Name): Use
10984         TypeManager.CSharpSignature() instead of just the name.
10985
10986         * expression.cs (Invocation.OverloadResolve): Provide better error
10987         reporting.
10988         (Invocation.DoResolve): OverloadResolve() never returns null
10989         without reporting an error, so removed the error -6 reporting here.
10990
10991 2004-03-23  Martin Baulig  <martin@ximian.com>
10992
10993         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10994         generic methods.
10995
10996         * cs-parser.jay (delegate_declaration): Support generic delegates.
10997
10998         * delegate.cs: Support generic delegates.
10999
11000 2004-03-22  Martin Baulig  <martin@ximian.com>
11001
11002         * expression.cs (Invocation.InferParamsTypeArguments): New static
11003         method; does type inference for params arguments.
11004
11005 2004-03-21  Martin Baulig  <martin@ximian.com>
11006
11007         * typemanager.cs (TypeManager.IsGenericMethod): New public static
11008         method; checks whether a method is a generic method.    
11009
11010         * expression.cs (Invocation.InferTypeArguments): New static method;
11011         infer type arguments for generic method invocation.
11012
11013         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11014         property; we set this to true if we're resolving a generic method
11015         invocation and the user specified type arguments, ie. we're not
11016         doing type inference.
11017
11018 2004-03-20  Martin Baulig  <martin@ximian.com>
11019
11020         * class.cs (MethodData.DeclaringType): New public property.
11021         (MethodData.Define): Set DeclaringType here.
11022         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11023         instead of OperatorMethodBuilder.DeclaringType.
11024
11025 2004-03-20  Martin Baulig  <martin@ximian.com>
11026
11027         * cs-tokenizer.cs (xtoken): Return a special
11028         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11029
11030         * cs-parser.jay (default_value_expression): Switch to the new
11031         syntax (14.5.13).
11032
11033 2004-03-19  Martin Baulig  <martin@ximian.com>
11034
11035         * decl.cs (MemberName): New class.  We use this to "construct"
11036         namespace_or_type_name's.
11037
11038         * generics.cs (TypeArguments.GetDeclarations): New public method;
11039         returns the type arguments as a string[] and reports a CS0081 if
11040         one of them is not an identifier.
11041
11042         * class.cs (MemberBase): The .ctor now takes the name as a
11043         MemberName instead of a string.
11044         (MemberBase.ExplicitInterfaceName): Changed type from string to
11045         Expression.
11046         (MemberBase.DoDefine): If we're an explicit implementation, the
11047         InterfaceType may be a generic instance.
11048
11049         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11050         (namespace_name): Call MemberName.GetName () to transform the
11051         MemberName into a string and ensure we don't have any type
11052         arguments.
11053         (type_name): Call MemberName.GetTypeExpression() to transfrom the
11054         MemberName into an expression.
11055         (method_header): Use namespace_or_type_name instead of member_name.     
11056
11057 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11058
11059         * rootcontext.cs: Add new types to the boot resolution.
11060
11061         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11062         MulticastDelegate is not allowed.
11063
11064         * typemanager.cs: Add new types to lookup: System.TypedReference
11065         and ArgIterator.
11066
11067         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11068         check for TypedReference or ArgIterator, they are not allowed. 
11069
11070         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11071         makes us properly catch 1510 in some conditions (see bug 56016 for
11072         details). 
11073
11074 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11075
11076         * CryptoConvert.cs: update from corlib version
11077         with endian fixes.
11078
11079 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11080
11081         * class.cs (Indexer.Define): Check indexername declaration
11082
11083 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11084
11085         * attribute.cs (IsClsCompliant): Fixed problem with handling
11086         all three states (compliant, not-compliant, undetected).
11087
11088 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11089
11090         * attribute.cs (Attribute): Location is now public.
11091         (Resolve): Store resolved arguments (pos_values) in attribute class.
11092         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11093         (GetClsCompliantAttributeValue): New method that gets
11094         CLSCompliantAttribute value.
11095         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11096         if exists else null.
11097         (AttributeTester): New class for CLS-Compliant verification routines.
11098
11099         * class.cs (Emit): Add CLS-Compliant verification.
11100         (Method.GetSignatureForError): Implemented.
11101         (Constructor.GetSignatureForError): Implemented
11102         (Constructor.HasCompliantArgs): Returns if constructor has
11103         CLS-Compliant arguments.
11104         (Constructor.Emit): Override.
11105         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11106         is needed to test only parameters.
11107         (FieldBase.GetSignatureForError): Implemented.
11108         (TypeContainer): New member for storing base interfaces.
11109         (TypeContainer.FindMembers): Search in base interfaces too.
11110
11111         * codegen.cs (GetClsComplianceAttribute): New method that gets
11112         assembly or module CLSCompliantAttribute value.
11113         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11114         for assembly.
11115         (ModuleClass.Emit): Add error 3012 test.
11116
11117         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11118
11119         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11120         state for all decl types.
11121         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11122         if CLS-Compliant tests are required.
11123         (IsClsCompliaceRequired): New method. Analyze whether code
11124         must be CLS-Compliant.
11125         (IsExposedFromAssembly): New method. Returns true when MemberCore
11126         is exposed from assembly.
11127         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11128         value or gets cached value.
11129         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11130         is explicitly marked with CLSCompliantAttribute.
11131         (IsIdentifierClsCompliant): New abstract method. This method is
11132         used to testing error 3005.
11133         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11134         for identifier and parameters CLS-Compliant testing.
11135         (VerifyClsCompliance): New method. The main virtual method for
11136         CLS-Compliant verifications.
11137         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11138         null. I don't know why is null (too many public members !).
11139         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11140         and get value of first CLSCompliantAttribute that found.
11141
11142         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11143         (VerifyClsCompliance): Override and add extra tests.
11144
11145         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11146         clscheck- disable CLS-Compliant verification event if assembly is has
11147         CLSCompliantAttribute(true).
11148
11149         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11150         ApllyAttribute is now called in emit section as in the other cases.
11151         Possible future Emit integration.
11152         (IsIdentifierClsCompliant): New override.
11153         (VerifyClsCompliance): New override.
11154         (GetEnumeratorName): Returns full enum name.
11155
11156         * parameter.cs (GetSignatureForError): Implemented.
11157
11158         * report.cs (WarningData): New struct for Warning message information.
11159         (LocationOfPreviousError): New method.
11160         (Warning): New method. Reports warning based on the warning table.
11161         (Error_T): New method. Reports error based on the error table.
11162
11163         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11164         verifications are done here.
11165
11166         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11167
11168         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11169         CLSCompliantAttribute.
11170         (all_imported_types): New member holds all imported types from other
11171         assemblies.
11172         (LoadAllImportedTypes): New method fills static table with exported types
11173         from all referenced assemblies.
11174         (Modules): New property returns all assembly modules.
11175
11176 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11177
11178         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11179         throwing a parser error.
11180
11181         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11182         which removes the hardcoded get_/set_ prefixes for properties, as
11183         IL allows for the properties to be named something else.  
11184
11185         Bug #56013
11186
11187         * expression.cs: Do not override operand before we know if it is
11188         non-null.  Fix 56207
11189
11190 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11191
11192         * typemanager.cs: support for pinned variables.
11193
11194 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11195
11196         * decl.cs, typemanager.cs: Avoid using an arraylist
11197         as a buffer if there is only one result set.
11198
11199 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11200
11201         * expression.cs: Make sure you cant call a static method
11202         with an instance expression, bug #56174.
11203
11204 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11205
11206         * class.cs (IsDuplicateImplementation): Improve error reporting to
11207         flag 663 (method only differs in parameter modifier).
11208
11209         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11210         in preprocessor directives.
11211
11212         * location.cs (LookupFile): Allow for the empty path.
11213
11214         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11215         better approach for some of that patch, but its failing with the
11216         CharSet enumeration.  For now try/catch will do.
11217
11218         * typemanager.cs: Do not crash if a struct does not have fields.
11219         Fixes 56150.
11220
11221 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11222
11223         * expression.cs: cs0213, cant fix a fixed expression.
11224         fixes 50231.
11225
11226 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11227
11228         * cs-parser.jay: detect invalid embeded statements gracefully.
11229         bug #51113.
11230
11231 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11232
11233         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11234         As a regex:
11235         s/
11236         the invocation type may not be a subclass of the tye of the item/
11237         The type of the item must be a subclass of the invocation item.
11238         /g
11239
11240         Fixes bug #50820.
11241
11242 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11243
11244         * attribute.cs: Added methods to get a string and a bool from an
11245         attribute. Required to information from AssemblyKeyFileAttribute,
11246         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11247         * codegen.cs: Modified AssemblyName creation to include support for
11248         strongnames. Catch additional exceptions to report them as CS1548.
11249         * compiler.csproj: Updated include CryptoConvert.cs.
11250         * compiler.csproj.user: Removed file - user specific configuration.
11251         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11252         Mono.Security assembly. The original class is maintained and tested in
11253         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11254         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11255         like CSC 8.0 (C# v2) supports.
11256         * Makefile: Added CryptoConvert.cs to mcs sources.
11257         * rootcontext.cs: Added new options for strongnames.
11258
11259 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11260
11261         * driver.cs: For --expect-error, report error code `2'
11262         if the program compiled with no errors, error code `1' if
11263         it compiled with an error other than the one expected.
11264
11265 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11266
11267         * compiler.csproj: Updated for Visual Studio .NET 2003.
11268         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11269         * compiler.sln: Updated for Visual Studio .NET 2003.
11270
11271 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11272
11273         * expression.cs: Fix bug #47234. We basically need to apply the
11274         rule that we prefer the conversion of null to a reference type
11275         when faced with a conversion to 'object' (csc behaviour).
11276
11277 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11278
11279         * statement.cs: Shorter form for foreach, eliminates
11280         a local variable. r=Martin.
11281
11282 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11283
11284         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11285         checks if we can use brtrue/brfalse to test for 0.
11286         * expression.cs: use the above in the test for using brtrue/brfalse.
11287         cleanup code a bit.
11288
11289 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11290
11291         * expression.cs: Rewrite string concat stuff. Benefits:
11292
11293         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11294         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11295         rather than a concat chain.
11296
11297         * typemanager.cs: Add lookups for more concat overloads.
11298
11299 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11300
11301         * expression.cs: Emit shorter il code for array init.
11302
11303         newarr
11304         dup
11305         // set 1
11306
11307         // set 2
11308
11309         newarr
11310         stloc.x
11311
11312         ldloc.x
11313         // set 1
11314
11315         ldloc.x
11316         // set 2
11317
11318 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11319
11320         * statement.cs: Before, two switch blocks would be merged if the
11321         total size of the blocks (end_item - begin_item + 1) was less than
11322         two times the combined sizes of the blocks.
11323
11324         Now, it will only merge if after the merge at least half of the
11325         slots are filled.
11326
11327         fixes 55885.
11328
11329 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11330
11331         * class.cs : csc build fix for GetMethods(). See bug #52503.
11332
11333 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11334
11335         * expression.cs: Make sure fp comparisons work with NaN.
11336         This fixes bug #54303. Mig approved this patch a long
11337         time ago, but we were not able to test b/c the runtime
11338         had a related bug.
11339
11340 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11341
11342         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11343
11344 2004-03-19  Martin Baulig  <martin@ximian.com>
11345
11346         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11347         two overloads may unify for some type parameter substitutions and
11348         report a CS0408 if appropriate.
11349
11350 2004-03-19  Martin Baulig  <martin@ximian.com>
11351
11352         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11353         error here and not in our caller.
11354
11355 2004-03-19  Martin Baulig  <martin@ximian.com>
11356
11357         * interface.cs: Completely killed this file.
11358         (Interface): We're now a TypeContainer and live in class.cs.
11359
11360         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11361         argument; we're now also called for interfaces.
11362         (TypeContainer.DefineMembers): Allow this method being called
11363         multiple times.
11364         (TypeContainer.GetMethods): New public method; formerly known as
11365         Interface.GetMethod().  This is used by PendingImplementation.
11366         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11367         it's now private and non-static.
11368         (Interface): Moved this here; it's now implemented similar to
11369         Class and Struct.
11370         (Method, Property, Event, Indexer): Added `bool is_interface'
11371         argument to their .ctor's.
11372         (MemberBase.IsInterface): New public field.
11373
11374         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11375         instances instead of InterfaceMethod, InterfaceProperty, etc.
11376         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11377         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11378
11379 2004-03-19  Martin Baulig  <martin@ximian.com>
11380
11381         * class.cs (MethodCore.IsDuplicateImplementation): New private
11382         method which does the CS0111 checking.
11383         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11384         Use IsDuplicateImplementation().
11385
11386 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11387
11388         * decl.cs (FindMemberToOverride): New method to find the correct
11389         method or property to override in the base class.
11390         * class.cs
11391             - Make Method/Property use the above method to find the
11392               version in the base class.
11393             - Remove the InheritableMemberSignatureCompare as it is now
11394               dead code.
11395
11396         This patch makes large code bases much faster to compile, as it is
11397         O(n) rather than O(n^2) to do this validation.
11398
11399         Also, it fixes bug 52458 which is that nested classes are not
11400         taken into account when finding the base class member.
11401
11402         Reviewed/Approved by Martin.
11403
11404 2004-03-17  Martin Baulig  <martin@ximian.com>
11405
11406         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11407         of type arguments into account; use the `real_num_type_args'
11408         approach like in DoResolveAsTypeStep().
11409
11410         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11411         nested types.
11412
11413 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11414
11415         * interface.cs: In all interface classes removed redundant
11416         member initialization.
11417
11418 2004-03-16  Martin Baulig  <martin@ximian.com>
11419
11420         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11421
11422 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11423
11424         * decl.cs (DefineTypeAndParents): New helper method to define a
11425         type's containers before the type itself is defined;  This is a
11426         bug exposed by the recent changes to Windows.Forms when an
11427         implemented interface was defined inside a class that had not been
11428         built yet.   
11429
11430         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11431
11432         (Check): Loop correctly to report errors modifiers
11433         (UNSAFE was not in the loop, since it was the same as TOP).
11434
11435         * interface.cs: Every interface member now takes a ModFlags,
11436         instead of a "is_new" bool, which we set on the base MemberCore. 
11437
11438         Every place where we called "UnsafeOk" in the interface, now we
11439         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11440         the unsafe settings from the member declaration instead of the
11441         container interface. 
11442
11443         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11444
11445         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11446         `set_indexer_name' to the pending bits (one per type).
11447
11448         We fixed a bug today that was picking the wrong method to
11449         override, since for properties the existing InterfaceMethod code
11450         basically ignored the method name.  Now we make sure that the
11451         method name is one of the valid indexer names.
11452
11453 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11454  
11455         * support.cs (SeekableStreamReader): Keep track of stream byte
11456         positions and don't mix them with character offsets to the buffer.
11457
11458         Patch from Gustavo Giráldez
11459
11460 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11461
11462         * interface.cs (InterfaceSetGetBase): Removed double member
11463         initialization, base class does it as well.
11464
11465 2004-03-13  Martin Baulig  <martin@ximian.com>
11466
11467         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11468         when compiling corlib.
11469
11470 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11471
11472         * convert.cs (ExplicitConversion): We were reporting an error on
11473         certain conversions (object_type source to a value type, when the
11474         expression was `null') before we had a chance to pass it through
11475         the user defined conversions.
11476
11477         * driver.cs: Replace / and \ in resource specifications to dots.
11478         Fixes 50752
11479
11480         * class.cs: Add check for duplicate operators.  Fixes 52477
11481
11482 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11483
11484         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11485         that are in the middle of the statements, not only at the end.
11486         Fixes #54987
11487
11488         * class.cs (TypeContainer.AddField): No longer set the
11489         `HaveStaticConstructor' flag, now we call it
11490         `UserDefineStaticConstructor' to diferentiate the slightly
11491         semantic difference.
11492
11493         The situation is that we were not adding BeforeFieldInit (from
11494         Modifiers.TypeAttr) to classes that could have it.
11495         BeforeFieldInit should be set to classes that have no static
11496         constructor. 
11497
11498         See:
11499
11500         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11501
11502         And most importantly Zoltan's comment:
11503
11504         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11505
11506         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11507          before its static fields are used', i.e. initialization does not need
11508          to be triggered by the first access to the type. Setting this flag
11509          helps the JIT to compile better code, since it can run the static
11510          constructor at JIT time, and does not need to generate code to call it
11511          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11512          this flag for lots of classes like String. 
11513          
11514          csc sets this flag if the type does not have an explicit static 
11515          constructor. The reasoning seems to be that if there are only static
11516          initalizers for a type, and no static constructor, then the programmer
11517          does not care when this initialization happens, so beforefieldinit
11518          can be used.
11519          
11520          This bug prevents the AOT compiler from being usable, since it 
11521          generates so many calls to mono_runtime_class_init that the AOT code
11522          is much slower than the JITted code. The JITted code is faster, 
11523          because it does not generate these calls if the vtable is type is
11524          already initialized, which is true in the majority of cases. But the
11525          AOT compiler can't do this."
11526
11527 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11528
11529         * class.cs (MethodData.Emit): Refactor the code so symbolic
11530         information is generated for destructors;  For some reasons we
11531         were taking a code path that did not generate symbolic information
11532         before. 
11533
11534 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11535
11536         * class.cs: Create a Constructor.CheckBase method that
11537         takes care of all validation type code. The method
11538         contains some code that was moved from Define.
11539
11540         It also includes new code that checks for duplicate ctors.
11541         This fixes bug #55148.
11542
11543 2004-03-09  Joshua Tauberer <tauberer@for.net>
11544
11545         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11546         a { ... }-style array creation invokes EmitStaticInitializers
11547         which is not good for reference-type arrays.  String, decimal
11548         and now null constants (NullCast) are not counted toward
11549         static initializers.
11550
11551 2004-03-05  Martin Baulig  <martin@ximian.com>
11552
11553         * location.cs (SourceFile.HasLineDirective): New public field;
11554         specifies whether the file contains or is referenced by a "#line"
11555         directive.
11556         (Location.DefineSymbolDocuments): Ignore source files which
11557         either contain or are referenced by a "#line" directive.        
11558
11559 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11560
11561         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11562         direct access to our parent, so check the method inline there.
11563
11564 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11565
11566         * expression.cs (Invocation.EmitCall): Miguel's last commit
11567         caused a regression. If you had:
11568
11569             T t = null;
11570             t.Foo ();
11571
11572         In Foo the implict this would be null.
11573
11574 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11575
11576         * expression.cs (Invocation.EmitCall): If the method is not
11577         virtual, do not emit a CallVirt to it, use Call.
11578
11579         * typemanager.cs (GetFullNameSignature): Improve the method to
11580         cope with ".ctor" and replace it with the type name.
11581
11582         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11583         as an argument the ConstructorBuilder where it is being defined,
11584         to catch the recursive constructor invocations.
11585
11586 2004-03-16  Martin Baulig  <martin@ximian.com>
11587
11588         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11589         ConstructedType, call ResolveType() on it to get the type rather
11590         than just using `expr.Type'.
11591
11592 2004-03-16  Martin Baulig  <martin@ximian.com>
11593
11594         * generics.cs (ConstructedType.GetMemberAccess): Take the
11595         EmitContext instead on the TypeExpr and use
11596         ec.TypeContainer.CurrentType/ec.ContainerType.
11597
11598 2004-03-16  Martin Baulig  <martin@ximian.com>
11599
11600         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11601         parameters before aliases.
11602
11603 2004-03-16  Martin Baulig  <martin@ximian.com>
11604
11605         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11606         New oublic function; checks whether two generic instances may become
11607         equal under some instantiations (26.3.1).
11608
11609         * class.cs (TypeContainer.Define): Call
11610         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11611         error.
11612
11613 2004-03-16  Martin Baulig  <martin@ximian.com>
11614
11615         * class.cs (TypeContainer.GetClassBases): Moved
11616         Error_TypeParameterAsBase() here and also check whether the base
11617         class is not an attribute.
11618
11619 2004-03-16  Martin Baulig  <martin@ximian.com>
11620
11621         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11622
11623 2004-03-16  Martin Baulig  <martin@ximian.com>
11624
11625         * class.cs (Error_TypeParameterAsBase): Use correct error number
11626         here (CS0689).  
11627
11628 2004-03-16  Martin Baulig  <martin@ximian.com>
11629
11630         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11631         for generics.
11632
11633         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11634         error reporting.
11635
11636 2004-03-15  Martin Baulig  <martin@ximian.com>
11637
11638         * typemanager.cs (TypeManager.GetFullName): New public method.
11639         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11640         argument; only return members with the correct number of type
11641         arguments.
11642         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11643         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11644         whether the number of type arguments matches.
11645
11646         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11647         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11648
11649         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11650         field; it's set by the protected .ctor when we're actually a
11651         GenericMemberAccess.
11652         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11653         arguments and pass it to MemberLookupFinal ().
11654
11655         * ecore.cs (Expression.MemberLookup): Added `int
11656         num_type_arguments' argument; only return members with the correct
11657         number of type arguments.
11658         (Expression.MemberLookupFailed): Check whether the MemberLookup
11659         failed because we did not have the correct number of type
11660         arguments; report CS0305 in this case.
11661
11662         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11663         `e.ResolveAsTypeTerminal()' already did so.
11664
11665 2004-03-15  Martin Baulig  <martin@ximian.com>
11666
11667         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11668         we're a ConstructedType; in this case, the caller must report an
11669         error (for instance CS0131).
11670
11671         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11672         (TypeArguments.Resolve): Actually report errors here.
11673
11674 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11675
11676         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11677         `set_indexer_name' to the pending bits (one per type).
11678
11679         We fixed a bug today that was picking the wrong method to
11680         override, since for properties the existing InterfaceMethod code
11681         basically ignored the method name.  Now we make sure that the
11682         method name is one of the valid indexer names.
11683
11684 2004-03-15  Martin Baulig  <martin@ximian.com>
11685
11686         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11687         for generic instances.
11688
11689 2004-03-13  Martin Baulig  <martin@ximian.com>
11690
11691         * class.cs (TypeContainer.DefineType): Call
11692         TypeManager.AddUserType() immediately after creating the
11693         TypeBuilder; pass all type parameters when creating the
11694         CurrentType.
11695
11696         * decl.cs (DeclSpace.FindNestedType): New public method.
11697         (DeclSpace.FindType): Added `int num_type_args' argument; only
11698         return types with the correct number of type parameters.
11699         (DeclSpace.CountTypeParams): New public property.
11700
11701         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11702         the number of type parameters; defaults to zero.
11703
11704         * generic.cs (TypeArguments.Count): New public property.
11705         (ConstructedType.DoResolveAsTypeStep): First call
11706         ds.FindNestedType() to find out whether we're nested in the
11707         current generic type; in this case, we inherit all type parameters
11708         from the current class.
11709
11710         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11711         num_type_args' argument.
11712         (RootContext.LookupType): Added overloaded version which takes the
11713         number of type arguments; only return types with the correct
11714         number of type arguments.
11715
11716         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11717         checks whether `Type t' has `int num_type_args'.
11718
11719 2004-03-13  Martin Baulig  <martin@ximian.com>
11720
11721         * generic.cs (GenericMethod.DefineType): New method; calls
11722         DefineType() on all the type parameters.
11723
11724         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11725         (MethodData.Define): If we're a generic method, call
11726         GenericMethod.DefineType() to define the type parameters.       
11727
11728 2004-03-10  Martin Baulig  <martin@ximian.com>
11729
11730         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11731         instead of IsAssignableFrom.    
11732
11733 2004-03-10  Martin Baulig  <martin@ximian.com>
11734
11735         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11736
11737         * support.cs (ParameterData.HasArrayParameter): New property.
11738         (ReflectionParameters.ctor): Take a MethodBase instead of a
11739         ParameterInfo[].  If we have any type parameters, get the generic
11740         method definition and ask it whether we have variable arguments.
11741
11742 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11743
11744         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11745         routines to check if a type is an enumerable/enumerator allow
11746         classes that implement the IEnumerable or IEnumerator interfaces.
11747
11748         * class.cs (Property, Operator): Implement IIteratorContainer, and
11749         implement SetYields.
11750
11751         (Property.Define): Do the block swapping for get_methods in the
11752         context of iterators.   We need to check if Properties also
11753         include indexers or not.
11754
11755         (Operator): Assign the Block before invoking the
11756         OperatorMethod.Define, so we can trigger the Iterator code
11757         replacement. 
11758
11759         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11760         Property and Operator classes are not created when we parse the
11761         declarator but until we have the block completed, so we use a
11762         singleton SimpleIteratorContainer.Simple to flag whether the
11763         SetYields has been invoked.
11764
11765         We propagate this setting then to the Property or the Operator to
11766         allow the `yield' to function.
11767
11768 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11769
11770         * codegen.cs: Implemented attribute support for modules.
11771         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11772         Assembly/Module functionality.
11773
11774         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11775         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11776         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11777
11778 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11779
11780         * interface.cs (FindMembers): The operation is performed on all base
11781         interfaces and not only on the first. It is required for future CLS Compliance patch.
11782
11783 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11784
11785         * statement.cs, codegen.cs:
11786         This patch deals with patterns such as:
11787
11788         public class List : IEnumerable {
11789
11790                 public MyEnumerator GetEnumerator () {
11791                         return new MyEnumerator(this);
11792                 }
11793
11794                 IEnumerator IEnumerable.GetEnumerator () {
11795                         ...
11796                 }
11797                 
11798                 public struct MyEnumerator : IEnumerator {
11799                         ...
11800                 }
11801         }
11802
11803         Before, there were a few things we did wrong:
11804         1) we would emit callvirt on a struct, which is illegal
11805         2) we emited ldarg when we needed to emit ldarga
11806         3) we would mistakenly call the interface methods on an enumerator
11807         type that derived from IEnumerator and was in another assembly. For example:
11808
11809         public class MyEnumerator : IEnumerator
11810
11811         Would have the interface methods called, even if there were public impls of the
11812         method. In a struct, this lead to invalid IL code.
11813
11814 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11815
11816         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11817           renamed to Emit.
11818
11819         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11820
11821 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11822
11823         * cs-parser.jay: Fix small regression: we were not testing V2
11824         compiler features correctly.
11825
11826         * interface.cs: If the emit context is null, then create one
11827
11828 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11829
11830         * decl.cs (GetSignatureForError): New virtual method to get full name
11831           for error messages.
11832
11833         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11834           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11835
11836         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11837           Duplicated members and code in these classes has been removed.
11838           Better encapsulation in these classes.
11839
11840 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11841
11842         * assign.cs (Assign.DoResolve): When dealing with compound
11843         assignments, there is a new rule in ECMA C# 2.4 (might have been
11844         there before, but it is documented here) that states that in:
11845
11846         a op= b;
11847
11848         If b is of type int, and the `op' is a shift-operator, then the
11849         above is evaluated as:
11850
11851         a = (int) a op b 
11852
11853         * expression.cs (Binary.ResolveOperator): Instead of testing for
11854         int/uint/long/ulong, try to implicitly convert to any of those
11855         types and use that in pointer arithmetic.
11856
11857         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11858         method to print information for from the type, not from the
11859         null-method we were given.
11860
11861 2004-02-01  Duncan Mak  <duncan@ximian.com>
11862
11863         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11864         parsing for cmd, fixes bug #53694.
11865
11866 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11867
11868         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11869         in the member name duplication tests. Property and operator name duplication
11870         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11871
11872 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11873
11874         * interface.cs (PopulateMethod): Fixed crash when interface method
11875         returns not existing type (error test cs0246-3.cs).
11876
11877 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11878
11879         * cs-parser.jay (interface_accessors): Re-write actions to also
11880         store attributes attached to get and set methods. Fix spelling
11881         while at it.
11882
11883         (inteface_property_declaration): Modify accordingly.
11884
11885         (InterfaceAccessorInfo): New helper class to store information to pass
11886         around between rules that use interface_accessors.
11887
11888         * interface.cs (Emit): Apply attributes on the get and set
11889         accessors of properties and indexers too.
11890
11891         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11892         right MethodBuilder when applying attributes to the get and set accessors.
11893
11894 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11895
11896         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11897
11898 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11899
11900         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11901
11902 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11903
11904         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11905         changes that treat `yield' specially when present before `break'
11906         or `return' tokens.
11907
11908         * cs-tokenizer.cs: yield is no longer a keyword.
11909
11910 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11911
11912         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11913         setting for default constructors.
11914         For default constructors are almost every time set wrong Modifier. The
11915         generated IL code has been alright. But inside mcs this values was
11916         wrong and this was reason why several of my CLS Compliance tests
11917         failed.
11918
11919 2004-02-27  Martin Baulig  <martin@ximian.com>
11920
11921         * generics.cs (ConstructedType.ResolveType): Make the nested type
11922         stuff actually work.
11923
11924 2004-02-25  Martin Baulig  <martin@ximian.com>
11925
11926         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11927         property; returns the type parameters just from the current type,
11928         ie. with the ones from outer classes.
11929         (DeclSpace.LookupGeneric): First search in the current class, then
11930         in outer classes.
11931         (DeclSpace.initialize_type_params): When hiding a type parameter
11932         from an outer class, put it into the `type_param_list' anyways.
11933
11934         * expression.cs (MemberAccess.expr): Made this field protected.
11935
11936         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11937         the type parameters from the current class.
11938
11939         * generic.cs (ConstructedType.ResolveType): Support nested generic
11940         types by taking the type parameters which we inherit from outer
11941         classes into account.
11942         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11943         support for nested generic types.
11944
11945 2004-02-23  Martin Baulig  <martin@ximian.com>
11946
11947         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11948         field and check whether we're nested inside a generic type.
11949         (DeclSpace.ResolveType): If we're resolving to a generic type
11950         definition, create a ConstructedType and return its resolved type.
11951         (DeclSpace.initialize_type_params): New private method;
11952         initializes the `type_param_list' field from the type parameters
11953         from this and all enclosing classes.
11954         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11955         we're already initialized.
11956
11957 2004-02-23  Martin Baulig  <martin@ximian.com>
11958
11959         * class.cs (Method.Define): Create the generic method before
11960         calling DoDefine().
11961         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11962         the TypeContainer one); we use this for generic methods.
11963
11964         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11965         parent's TypeBuilder.
11966
11967 2004-02-18  Martin Baulig  <martin@ximian.com>
11968
11969         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11970         to check for equality.
11971
11972 2004-02-05  Martin Baulig  <martin@ximian.com>
11973
11974         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11975         `ec.TypeContainer.CurrentType', use it instead of
11976         `ec.ContainerType' to check whether we're in the type's ctor.
11977
11978 2004-01-29  Martin Baulig  <martin@ximian.com>
11979
11980         * expression.cs (Invocation.DoResolve): If we're a
11981         `ConstructedType', then we're actually a generic method, so
11982         rewrite the expr as a GenericMemberAccess.
11983
11984         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11985         here; manually parse it into a string.
11986
11987 2004-01-28  Martin Baulig  <martin@ximian.com>
11988
11989         * typemanager.cs (TypeManager.IsEqual): New static method.
11990         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11991         check for equality instead of using `=='.
11992
11993 2004-01-26  Martin Baulig  <martin@ximian.com>
11994
11995         * decl.cs (DeclSpace.CurrentType): New public field.
11996
11997         * expression.cs (This.ResolveBase): If we have an
11998         `ec.TypeContainer.CurrentType', use it instead of
11999         `ec.ContainerType'.
12000
12001         * class.cs (TypeContainer.DefineType): If we're a generic type,
12002         create the `CurrentType' (unresolved).
12003         (TypeContainer.GenericType): New private field.
12004         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12005         it and store it in `GenericType' before creating the MemberCache.
12006         (TypeContainer.GetMembers): If we have a `GenericType', call
12007         TypeManager.FindMembers() on it.
12008
12009         * interface.cs (Interface.GenericType): New private field.
12010         (Interface.DefineType): If we're a generic type, create the
12011         `CurrentType' (unresolved).
12012         (Interface.DefineMembers): If we have a `CurrentType', resolve it
12013         and store it in `GenericType' before creating the MemberCache.
12014         (Interface.GetMembers): If we have a `GenericType', call
12015         TypeManager.FindMembers() on it.
12016
12017 2004-01-22  Martin Baulig  <martin@ximian.com>
12018
12019         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12020         not a QualifiedIdentifier.  This is what `type_name_expression'
12021         was previously doing.
12022         (type_name_expression): Removed; the code is now in
12023         `namespace_or_type_name'.
12024         (qualified_identifier): Removed, use `namespace_or_type_name'
12025         instead.
12026         (QualifiedIdentifier): Removed this class.      
12027
12028 2004-01-22  Martin Baulig  <martin@ximian.com>
12029
12030         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12031         not a string as alias name.
12032
12033 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12034
12035         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12036         #52730 bug, and instead compute correctly the need to use a
12037         temporary variable when requesting an address based on the
12038         static/instace modified of the field and the constructor.
12039  
12040 2004-01-21  Martin Baulig  <martin@ximian.com>
12041
12042         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12043         class and namespace before looking up aliases.  Fixes #52517.
12044
12045 2004-01-21  Martin Baulig  <martin@ximian.com>
12046
12047         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12048         assinged in a 'try'; fixes exception4.cs.
12049
12050 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12051         * class.cs : Implemented parameter-less constructor for TypeContainer
12052
12053         * decl.cs: Attributes are now stored here. New property OptAttributes
12054
12055         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12056
12057         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12058
12059 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12060
12061         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12062           (CSharpSignature): New method for indexer and property signature.
12063
12064 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12065
12066         * pending.cs (IsVirtualFilter): Faster implementation.
12067
12068 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12069
12070         * typemanager.cs: Avoid inclusion of same assembly more than once.
12071
12072 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12073
12074         * cs-parser.jay: Fixed problem where the last assembly attribute
12075           has been applied also to following declaration (class, struct, etc.)
12076           
12077 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12078
12079         * class.cs: Added error CS0538, CS0539 reporting.
12080         Fixed crash on Microsoft runtime when field type is void.
12081
12082         * cs-parser.jay: Added error CS0537 reporting.
12083
12084         * pending.cs: Added error CS0535 reporting.
12085         Improved error report for errors CS0536, CS0534.
12086
12087 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12088
12089         Merge a few bits from the Anonymous Method MCS tree.
12090
12091         * statement.cs (ToplevelBlock): New class for toplevel methods,
12092         will hold anonymous methods, lifted variables.
12093
12094         * cs-parser.jay: Create toplevel blocks for delegates and for
12095         regular blocks of code. 
12096
12097 2004-01-20  Martin Baulig  <martin@ximian.com>
12098
12099         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12100         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12101         and `NeedExplicitReturn'; added `IsLastStatement'.
12102         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12103         have a `ReturnLabel' or we're not unreachable.
12104
12105         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12106         child's reachability; don't just override ours with it.  Fixes
12107         #58058 (lluis's example).
12108         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12109         InFinally(), InLoop(), InSwitch() and
12110         BreakCrossesTryCatchBoundary() methods.
12111
12112         * statement.cs (Return): Do all error checking in Resolve().
12113         Unless we are the last statement in a top-level block, always
12114         create a return label and jump to it.
12115         (Break, Continue): Do all error checking in Resolve(); also make
12116         sure we aren't leaving a `finally'.
12117         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12118         statement in a top-level block.
12119         (Block.Flags): Added `IsDestructor'.
12120         (Block.IsDestructor): New public property.
12121
12122 2004-01-20  Martin Baulig  <martin@ximian.com>
12123
12124         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12125
12126 2004-01-20  Martin Baulig  <martin@ximian.com>
12127
12128         * statement.cs (Statement.ResolveUnreachable): New public method.
12129         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12130         (Block.Resolve): Resolve unreachable statements.
12131
12132 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12133
12134         * expression.cs: We need to fix the case where we do
12135         not have a temp variable here.
12136
12137         * assign.cs: Only expression compound assignments need
12138         temporary variables.
12139
12140 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12141
12142         * flowanalysis.cs: Reduce memory allocation in a few ways:
12143           - A block with no variables should not allocate a bit
12144             vector for itself.
12145           - A method with no out parameters does not need any tracking
12146             for assignment of the parameters, so we need not allocate
12147             any data for it.
12148           - The arrays:
12149                 public readonly Type[] VariableTypes;
12150                 public readonly string[] VariableNames;
12151             Are redundant. The data is already stored in the variable
12152             map, so we need not allocate another array for it.
12153           - We need to add alot of checks for if (params | locals) == null
12154             due to the first two changes.
12155
12156 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12157
12158         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12159         implement IMemoryLocation, we store a copy on a local variable and
12160         take the address of it.  Patch from Benjamin Jemlich
12161
12162         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12163         to use a special "type_name_expression" rule which reduces the
12164         number of "QualifiedIdentifier" classes created, and instead
12165         directly creates MemberAccess expressions.
12166
12167 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12168
12169         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12170         that fixes #52853.  Null literal assignment to ValueType
12171
12172         * class.cs (MethodData.Emit): Instead of checking the name of the
12173         method to determine if its a destructor, create a new derived
12174         class from Method called Destructor, and test for that.  
12175
12176         * cs-parser.jay: Create a Destructor object instead of a Method.  
12177
12178         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12179
12180         Fixes: 52933
12181
12182 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12183
12184         * expression.cs (Binary.ResolveOperator): Perform an implicit
12185         conversion from MethodGroups to their delegate types on the
12186         Addition operation.
12187
12188         * delegate.cs: Introduce a new class DelegateCreation that is the
12189         base class for `NewDelegate' and `ImplicitDelegateCreation',
12190         factor some code in here.
12191
12192         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12193         conversion from MethodGroups to compatible delegate types. 
12194
12195         * ecore.cs (Expression.Resolve): Do not flag error 654
12196         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12197         we allow conversions from MethodGroups to delegate types now.
12198
12199         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12200         assignments in v2 either.
12201
12202 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12203
12204         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12205         static read-only fields in ctors.
12206
12207         Applied patch from Benjamin Jemlich 
12208
12209         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12210
12211 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12212
12213         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12214         here to return true, as they can be used like this:
12215
12216                 (XXX) int.MEMBER ()
12217
12218         Fixed 49836 and all the other dups
12219
12220 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12221
12222         * driver.cs: Implement /win32res and /win32icon.
12223
12224 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12225
12226         * cs-parser.jay: Add a rule to improve error handling for the
12227         common mistake of placing modifiers after the type.
12228
12229 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * cs-parser.jay (interface_event_declaration): Catch
12232         initialization of events on interfaces, and report cs0068
12233
12234         * cs-parser.jay (interface_event_declaration): Catch
12235         initialization of events. 
12236
12237         * ecore.cs: Better report missing constructors.
12238
12239         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12240         the error reporting done in the wrong place.  Fix.
12241
12242         * expression.cs (Binary.ResolveOperator): Catch the 
12243         operator + (E x, E y) error earlier, and later allow for implicit
12244         conversions in operator +/- (E e, U x) from U to the underlying
12245         type of E.
12246
12247         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12248         52596, if the container class is abstract, the default constructor
12249         is protected otherwise its public (before, we were always public).
12250
12251         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12252         fixed statement.
12253
12254         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12255         Jemlich that fixes bug #52597, MCS was generating invalid code for
12256         idisposable structs.   Thanks to Ben for following up with this
12257         bug as well.
12258
12259 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12260
12261         * driver.cs: Allow assemblies without code to be generated, fixes
12262         52230.
12263
12264 2004-01-07  Nick Drochak <ndrochak@gol.com>
12265
12266         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12267
12268 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12269
12270         * cs-parser.jay: Add rules to improve error reporting if fields or
12271         methods are declared at the namespace level (error 116)
12272
12273         * Add rules to catch event add/remove
12274
12275 2004-01-04  David Sheldon <dave-mono@earth.li>
12276
12277   * expression.cs: Added matching ")" to error message for 
12278   CS0077
12279
12280 2004-01-03 Todd Berman <tberman@gentoo.org>
12281
12282         * ecore.cs, attribute.cs:
12283         Applying fix from #52429.
12284
12285 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12286
12287         * ecore.cs, expression.cs, statement.cs:
12288         Total rewrite of how we handle branching. We
12289         now handle complex boolean expressions with fewer
12290         jumps. As well if (x == 0) no longer emits a ceq.
12291
12292         if (x is Foo) is much faster now, because we generate
12293         better code.
12294
12295         Overall, we get a pretty big improvement on our benchmark
12296         tests. The code we generate is smaller and more readable.
12297
12298         I did a full two-stage bootstrap. The patch was reviewed
12299         by Martin and Miguel.
12300
12301 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12302
12303         * cs-parser.jay: Make primary_expression not take a QI.
12304         we dont need this because the member_access rule covers
12305         us here. So we replace the rule with just IDENTIFIER.
12306
12307         This has two good effects. First, we remove a s/r conflict.
12308         Second, we allocate many fewer QualifiedIdentifier objects.
12309
12310 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12311
12312         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12313         set the correct information via SRE. This prevents
12314         hanging on the MS runtime. Fixes #29374.
12315
12316 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12317
12318         * convert.cs: correctly handle conversions to value types
12319         from Enum and ValueType as unboxing conversions.
12320
12321         Fixes bug #52569. Patch by Benjamin Jemlich.
12322
12323 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12324
12325         * expression.cs (BetterConversion): Prefer int -> uint
12326         over int -> ulong (csc's behaviour). This fixed bug #52046.
12327
12328 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12329
12330         * decl.cs (MemberCache.FindMembers): now returns a
12331         MemberInfo [].
12332
12333         * typemanager.cs: In general, go with with ^^.
12334         (CopyNewMethods): take an IList.
12335         (RealMemberLookup): Only allocate an arraylist
12336         if we copy from two sets of methods.
12337
12338         This change basically does two things:
12339         1) Fewer array lists allocated due to CopyNewMethods.
12340         2) the explicit cast in MemberList costed ALOT.
12341
12342 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12343
12344         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12345         a hashtable to avoid needless string allocations when an identifier is
12346         used more than once (the common case).
12347
12348 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12349
12350         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12351         is broken, it will not return anything. So, we
12352         have to use the information we have in mcs to
12353         do the task.
12354
12355         * typemanager.cs: Add a cache for GetInterfaces,
12356         since this will now be used more often (due to ^^)
12357
12358         (GetExplicitInterfaces) New method that gets the
12359         declared, not effective, interfaces on a type
12360         builder (eg, if you have interface IFoo, interface
12361         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12362         { IBar }.
12363
12364         This patch makes MCS able to bootstrap itself on
12365         Windows again.
12366
12367 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12368
12369         * expression.cs: Remove the Nop's that Miguel put
12370         in by mistake.
12371
12372 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12373
12374         * report.cs, codegen.cs: Give the real stack trace to
12375         the error when an exception is thrown.
12376
12377 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12378
12379         * decl.cs: only allocate hashtables for ifaces if 
12380         it is an iface!
12381
12382 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12383
12384         * expression.cs: fix the error from cs0121-2.cs
12385         (a parent interface has two child interfaces that
12386         have a function with the same name and 0 params
12387         and the function is called through the parent).
12388
12389 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12390
12391         * class.cs, rootcontext.cs, typmanager.cs: do not
12392         leak pointers.
12393
12394 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12395
12396         * codegen.cs: remove stack for the ec flow branching.
12397         It is already a linked list, so no need.
12398
12399 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12400
12401         * Makefile: Allow custom profiler here.
12402
12403 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12404
12405         * typemanager.cs (LookupType):
12406           - Use a static char [], because split takes
12407             a param array for args, so it was allocating
12408             every time.
12409           - Do not store true in a hashtable, it boxes.
12410
12411 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12412
12413         * flowanalysis.cs: bytify common enums.
12414
12415 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12416
12417         * modifiers.cs: Add a new set of flags for the
12418         flags allowed on explicit interface impls.
12419         * cs-parser.jay: catch the use of modifiers in
12420         interfaces correctly.
12421         * class.cs: catch private void IFoo.Blah ().
12422
12423         All related to bug #50572.
12424
12425 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12426
12427         * decl.cs: Rewrite the consistant accessability checking.
12428         Accessability is not linear, it must be implemented in
12429         a tableish way. Fixes #49704.
12430
12431 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12432
12433         * expression.cs: Handle negation in a checked context.
12434         We must use subtraction from zero. Fixes #38674.
12435
12436 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12437
12438         * class.cs: Ignore static void main in DLLs.
12439         * rootcontext.cs: Handle the target type here,
12440         since we are have to access it from class.cs
12441         * driver.cs: account for the above.
12442
12443 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12444
12445         * report.cs: Give line numbers and files if available.
12446
12447 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12448
12449         * driver.cs: Implement /addmodule.
12450
12451         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12452         ModuleBuilders.
12453
12454 2003-12-20  Martin Baulig  <martin@ximian.com>
12455
12456         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12457         (FieldBase.IsAssigned): Removed this field.
12458         (FieldBase.SetAssigned): New public method.
12459         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12460
12461 2003-12-20  Martin Baulig  <martin@ximian.com>
12462
12463         * expression.cs (LocalVariableReference.DoResolve): Don't set
12464         `vi.Used' if we're called from DoResolveLValue().
12465
12466         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12467         returns the usage vector it just merged into the current one -
12468         pass this one to UsageWarning().
12469         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12470         of the `EmitContext', don't call this recursively on our children.
12471
12472 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12473
12474         * driver.cs: Implement /target:module.
12475
12476 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12477
12478         * support.cs (CharArrayHashtable): New helper class.
12479
12480         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12481         char arrays, not strings, so we can avoid creating a string in
12482         consume_identifier if the identifier is a keyword.
12483
12484 2003-12-16  Martin Baulig  <martin@ximian.com>
12485
12486         * statement.cs (LocalInfo.Assigned): Removed this property.
12487         (LocalInfo.Flags): Removed `Assigned'.
12488         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12489         and uses flow analysis.
12490         (Block.UsageWarning): Made this method private.
12491         (Block.Resolve): Call UsageWarning() if appropriate.
12492
12493         * expression.cs (LocalVariableReference.DoResolve): Always set
12494         LocalInfo.Used here.
12495
12496 2003-12-13  Martin Baulig  <martin@ximian.com>
12497
12498         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12499         any value here; we're now using flow analysis to figure out
12500         whether a statement/block returns a value.
12501
12502 2003-12-13  Martin Baulig  <martin@ximian.com>
12503
12504         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12505         working again.
12506         (FlowBranching.MergeFinally): Don't call
12507         `branching.CheckOutParameters()' here, this is called in
12508         MergeTopBlock().
12509         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12510         when adding the `finally' vector.       
12511
12512 2003-12-13  Martin Baulig  <martin@ximian.com>
12513
12514         * flowanalysis.cs
12515         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12516         actually work and also fix #48962.
12517
12518 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12519
12520         * decl.cs: Do not check System.Object for nested types,
12521         since we know it does not have any. Big bang for buck:
12522
12523         BEFORE:
12524            Run 1:   8.35 seconds
12525            Run 2:   8.32 seconds
12526            corlib:  17.99 seconds
12527         AFTER:
12528            Run 1:   8.17 seconds
12529            Run 2:   8.17 seconds
12530            corlib:  17.39 seconds
12531
12532 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12533
12534         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12535         time we are returning 0 members, so we save alot here.
12536
12537 2003-12-11  Martin Baulig  <martin@ximian.com>
12538
12539         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12540         `MergeChild()', also just take the `FlowBranching' as argument;
12541         call Merge() on it and return the result.
12542         (FlowBranching.Merge): We don't need to do anything if we just
12543         have one sibling.
12544
12545 2003-12-11  Martin Baulig  <martin@ximian.com>
12546
12547         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12548         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12549         Maurer for this idea.
12550
12551 2003-12-11  Martin Baulig  <martin@ximian.com>
12552
12553         * flowanalysis.cs (MergeResult): This class is now gone; we now
12554         use the `UsageVector' for this.  The reason for this is that if a
12555         branching just has one sibling, we don't need to "merge" them at
12556         all - that's the next step to do.
12557         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12558         `MergeResult'.
12559
12560 2003-12-11  Martin Baulig  <martin@ximian.com>
12561
12562         Reworked flow analyis and made it more precise and bug-free.  The
12563         most important change is that we're now using a special `Reachability'
12564         class instead of having "magic" meanings of `FlowReturns'.  I'll
12565         do some more cleanups and optimizations and also add some more
12566         documentation this week.
12567
12568         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12569         largely reworked this class.
12570         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12571         the new `Reachability' class instead of having "magic" values here.
12572         (FlowBranching): We're now using an instance of `Reachability'
12573         instead of having separate `Returns', `Breaks' etc. fields.
12574
12575         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12576         based on flow analysis; ignore the return value of block.Emit ().
12577
12578 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12579
12580         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12581         if they are private.
12582
12583 2003-12-09  Martin Baulig  <martin@ximian.com>
12584
12585         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12586         call them directly on the UsageVector.
12587
12588 2003-12-09  Martin Baulig  <martin@ximian.com>
12589
12590         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12591         Changed return type from `FlowReturns' to `Reachability'.
12592
12593 2003-12-09  Martin Baulig  <martin@ximian.com>
12594
12595         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12596         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12597         `Reachable' fields with a single `Reachability' one.
12598
12599 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12600
12601         * class.cs (FindMembers): Remove foreach's.
12602
12603         Bootstrap times:
12604
12605         BEFORE
12606                 Run 1:   8.74 seconds
12607                 Run 2:   8.71 seconds
12608
12609         AFTER
12610                 Run 1:   8.64 seconds
12611                 Run 2:   8.58 seconds
12612
12613
12614 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12615
12616         * cs-parser.jay:
12617         * gen-treedump.cs:
12618         * statement.cs:
12619         This patch does a few things:
12620                 1. EmptyStatement is now a singleton, so it is never reallocated.
12621                 2. All blah is EmptyStatement constructs have been changed to
12622                    blah == EmptyStatement.Value, which is much faster and valid
12623                    now that EmptyStatement is a singleton.
12624                 3. When resolving a block, rather than allocating a new array for
12625                    the non-empty statements, empty statements are replaced with
12626                    EmptyStatement.Value
12627                 4. Some recursive functions have been made non-recursive.
12628         Mainly the performance impact is from (3), however (1) and (2) are needed for
12629         this to work. (4) does not make a big difference in normal situations, however
12630         it makes the profile look saner.
12631
12632         Bootstrap times:
12633
12634         BEFORE
12635         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12636         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12637         Total memory allocated: 56397 KB
12638
12639         AFTER
12640         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12641         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12642         Total memory allocated: 55666 KB
12643
12644 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12645
12646         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12647         than the hashtable in a hashtable version
12648
12649         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12650         we always end up concating a string. This results in a huge perf
12651         loss, because many strings have to be tracked by the GC. In this
12652         patch, we first use a hashtable that works with two keys, so that
12653         the strings do not need to be concat'ed.
12654
12655         Bootstrap times:
12656         BEFORE
12657                 Run 1:   8.74 seconds
12658                 Run 2:   8.71 seconds
12659
12660         AFTER
12661                 Run 1:   8.65 seconds
12662                 Run 2:   8.56 seconds
12663
12664 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12665
12666         * Makefile: Add a new target `do-time' that does a quick and simple
12667         profile, leaving easy to parse output.
12668
12669 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12670
12671         * codegen.cs (Init): Create the dynamic assembly with 
12672         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12673
12674 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12675
12676         * support.cs: Make the PtrHashtable use only one
12677         instance of its comparer.
12678
12679 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12680
12681         * typemanager.cs: Fix lookup of GetNamespaces.
12682
12683 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12684
12685         * expression.cs: Removed redundant line.
12686
12687         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12688         ArrayLists, use for loops with bounds.  
12689
12690         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12691         arraylist.
12692
12693         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12694         arraylists, use for loop with bounds.
12695
12696         The above three changes give us a 0.071 second performance
12697         improvement out of 3.294 seconds down to 3.223.  On my machine
12698         the above changes reduced the memory usage by 1,387 KB during
12699         compiler bootstrap.
12700
12701         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12702         QualifiedIdentifiers.  Before we created a new string through
12703         concatenation, and mostly later on, the result would be
12704         manipulated by DecomposeQI through string manipulation.
12705
12706         This reduced the compiler memory usage for bootstrapping from
12707         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12708         compile times in 0.05 seconds.
12709
12710 2003-11-28  Dick Porter  <dick@ximian.com>
12711
12712         * support.cs: Do string compares with the Invariant culture.
12713
12714         * rootcontext.cs: 
12715         * gen-treedump.cs: 
12716         * expression.cs: 
12717         * driver.cs: 
12718         * decl.cs: 
12719         * codegen.cs: 
12720         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12721         the comparison is done with the Invariant culture.
12722
12723 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12724
12725         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12726         GetEnumerator method.
12727
12728         (ProbeCollectionType): Iterate starting at the most specific type
12729         upwards looking for a GetEnumerator
12730
12731         * expression.cs: Shift count can be up to 31 for int/uint and 63
12732         for long/ulong.
12733
12734 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12735
12736         * statement.cs (Block.LookupLabel): Also look for the label on the
12737         children blocks.  Use a hash table to keep track of visited
12738         nodes. 
12739
12740         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12741         we actually did transform the other operand, otherwise fall back
12742         to the common codepath that casts to long.
12743
12744         * cs-tokenizer.cs: Use the same code pattern as the int case.
12745         Maybe I should do the parsing myself, and avoid depending on the
12746         Parse routines to get this done.
12747
12748 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12749
12750         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12751         which fixes bug 51347.  This time test it.
12752
12753         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12754         attributes for example can not tell the difference between these.
12755         The difference was only a syntax feature of the language. 
12756
12757         * attribute.cs: Apply attributes to delegates.
12758
12759         * delegate.cs: Call the apply attributes method.
12760
12761 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12762
12763         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12764         comparing 0 vs Byte.MinValue, not the value
12765
12766         (ImplicitConversionRequired): When reporting a conversion error,
12767         use error 31 to print out the constant error instead of the
12768         simpler 29.
12769
12770         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12771         which fixes bug 51347.
12772
12773 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12774
12775         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12776         which fixes the -warnaserror command line option.
12777
12778 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12779
12780         * cfold.cs (DoNumericPromotions): During constant folding of
12781         additions on UIntConstant, special case intconstants with
12782         IntConstants like we do on the expression binary operator. 
12783
12784 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12785
12786         * convert.cs (ImplicitReferenceConversion): We were missing a case
12787         (System.Enum are not value types or class types, so we need to
12788         classify them separatedly).
12789
12790         * driver.cs: We do not support error 2007.
12791
12792 2003-11-12 Jackson Harper <jackson@ximian.com>
12793
12794         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12795         system directory. Also use the full file name so users can
12796         libraries names mscorlib-o-tron.dll in a non system dir.
12797         
12798 2004-01-04  David Sheldon <dave-mono@earth.li>
12799
12800         * expression.cs: Added matching ")" to error message for CS0077.
12801
12802 2003-12-19  Martin Baulig  <martin@ximian.com>
12803
12804         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12805         static method; see documentation in the method.
12806         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12807
12808         * convert.cs (Convert.ImplicitReferenceConversion,
12809         Convert.ImplicitReferenceConversionExists): Add support for
12810         generic type declarations; see gen-36.cs.
12811
12812 2003-12-19  Martin Baulig  <martin@ximian.com>
12813
12814         * pending.cs (Pending.InterfaceMethod): Use
12815         `Type.IsAssignableFrom()' instead of `=='.
12816
12817 2003-12-18  Martin Baulig  <martin@ximian.com>
12818
12819         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12820         byref types first.
12821
12822         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12823         `expr_type.Equals (target_type)' instead of `=='.
12824
12825 2003-12-08  Martin Baulig  <martin@ximian.com>
12826
12827         * generics.cs (Constraints.Types): Removed.
12828         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12829         to Type's.
12830         (Constraints.ResolveTypes): New public method; resolves the
12831         TypeExpr's to Type's.
12832         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12833         longer takes the constraints.
12834         (TypeParameter.DefineMethod): Likewise.
12835         (TypeParameter.DefineType): New public method.  Calls
12836         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12837         the constraints.
12838
12839 2003-12-08  Martin Baulig  <martin@ximian.com>
12840
12841         * convert.cs (Convert.ImplicitConversionStandard): Use
12842         `expr_type.Equals (target_type)' instead of `=='.
12843
12844 2003-12-08  Martin Baulig  <martin@ximian.com>
12845
12846         * typemanager.cs (TypeManager.GetReferenceType): Call
12847         `Type.MakeByRefType ()'.
12848
12849 2003-12-08  Martin Baulig  <martin@ximian.com>
12850
12851         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12852         just has some special meaning in some situations.  For instance,
12853         it is allowed to use `where' as the name of a variable etc.
12854
12855 2003-12-04  Martin Baulig  <martin@ximian.com>
12856
12857         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12858         `Type.MakeArrayType()' for array types.
12859
12860 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12861
12862         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12863         debugging message.
12864
12865         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12866         corlib to compile.
12867
12868 2003-11-16  Martin Baulig  <martin@ximian.com>
12869
12870         * codegen.cs (EmitContext.IsGeneric): Removed.
12871
12872         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12873         ResolveGeneric() on the DeclSpace.
12874
12875 2003-11-16  Martin Baulig  <martin@ximian.com>
12876
12877         * generic.cs (TypeArguments.Resolve):
12878         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12879         `ResolveType()' on it to get the Type.
12880
12881 2003-11-15  Martin Baulig  <martin@ximian.com>
12882
12883         * generic.cs (ConstructedType.GetInterfaces): Override this.
12884
12885 2003-11-14  Martin Baulig  <martin@ximian.com>
12886
12887         * interface.cs (Interface.DefineType): Define all type parameters
12888         before adding the interfaces we inherit.
12889
12890 2003-11-11  Martin Baulig  <martin@ximian.com>
12891
12892         * generic.cs (ConstructedType.ResolveType): Always call
12893         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12894
12895 2003-11-10  Martin Baulig  <martin@ximian.com>
12896
12897         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12898         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12899         calling `ResolveType()' on them, directly assign their `Type'.
12900
12901 2003-11-08  Martin Baulig  <martin@ximian.com>
12902
12903         * generic.cs (ConstructedType): Override `IsClass' etc.
12904
12905 2003-11-08  Martin Baulig  <martin@ximian.com>
12906
12907         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12908         return value and the `out parent' parameter.
12909         (TypeContainer.DefineType): Moved the CS0644 check into
12910         GetClassBases().  Don't pass the interface types to the
12911         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12912         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12913
12914         * ecore.cs (TypeExpr.IsAttribute): New property.
12915         (TypeExpr.GetInterfaces): New method.
12916
12917         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12918         TypeExpr instead of a Type.
12919         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12920         (Interface.DefineType): Don't pass the interface types to the
12921         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12922         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12923
12924         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12925         instead of a `Type[]'.
12926         (TypeManager.RegisterBuilder): Likewise.
12927         (TypeManager.AddUserInterface): Likewise.
12928         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12929         `Type[]' and also return a `TypeExpr[]'.
12930         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12931
12932 2003-11-08  Martin Baulig  <martin@ximian.com>
12933
12934         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12935         Expression.     
12936
12937 2003-11-08  Martin Baulig  <martin@ximian.com>
12938
12939         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12940         TypeManager.ResolveExpressionTypes().
12941
12942         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12943         instead of an Expression.
12944         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12945         (TypeExpression): New public class; formerly known as `TypeExpr'.
12946
12947         * expression.cs (ComposedCast): Derive from TypeExpr.
12948
12949         * typemanager.cs (TypeManager.system_*_expr): These are now
12950         TypExpr's instead of Expression's.
12951         (TypeManager.ResolveExpressionTypes): New public static function;
12952         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12953         of them.        
12954
12955 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12956
12957         * expression.cs (New.DoResolve): Do not dereference value that
12958         might be a null return.
12959
12960         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12961         sure that the constant value has the right type.  Fixes an
12962         unreported bug, similar to 50425.
12963
12964         * const.cs (Const.LookupConstantValue): Call
12965         ImplicitStandardConversionExists before doing a conversion to
12966         avoid havng the TypeManager.ChangeType do conversions.
12967
12968         Reduced the number of casts used
12969
12970         (Const.ChangeType): New routine to enable reuse of the constant
12971         type changing code from statement.
12972
12973         * typemanager.cs (ChangeType): Move common initialization to
12974         static global variables.
12975
12976         Fixes #50425.
12977
12978         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12979         every value type to go through, even if it was void.  Fix that. 
12980
12981         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12982         character of the define, and the is_identifier_part_character for
12983         the rest of the string.
12984
12985 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12986
12987         * expression.cs (UnaryMutator.EmitCode): When I updated
12988         LocalVariableReference.DoResolve, I overdid it, and dropped an
12989         optimization done on local variable references.
12990
12991 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12992
12993         * ecore.cs: Convert the return from Ldlen into an int.
12994
12995 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12996
12997         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12998         the accessibility, this is a special case for toplevel non-public
12999         classes (internal for instance).
13000
13001 2003-10-20  Nick Drochak <ndrochak@gol.com>
13002
13003         * ecore.cs: Fix typo and build.  Needed another right paren.
13004
13005 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13006
13007         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13008         `internal' case regular and protected, but not allowing protected
13009         to be evaluated later.  Bug 49840
13010
13011 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13012
13013         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13014         to kb.Nlast, and not the kb.nFirst to isolate the switch
13015         statement.
13016
13017         Extract the underlying type, so enumerations of long/ulong are
13018         treated like long/ulong.
13019
13020 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13021
13022         * expression.cs (New): Overload the meaning of RequestedType to
13023         track the possible creation of the NewDelegate type, since
13024         DoResolve is invoked more than once for new constructors on field
13025         initialization.
13026
13027         See bugs: #48800 and #37014
13028
13029         * cs-parser.jay (declare_local_constants): Take an arraylist
13030         instead of a single constant.
13031
13032         (local_constant_declaration): It should take a
13033         constant_declarators, not a constant_declarator.  Fixes 49487
13034
13035         * convert.cs: Fix error report.
13036
13037 2003-10-13 Jackson Harper <jackson@ximian.com>
13038
13039         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13040         bug #49611
13041         
13042 2003-11-03  Martin Baulig  <martin@ximian.com>
13043
13044         * expression.cs (ArrayAccess.GetStoreOpcode): Added
13045         `out bool has_type_arg'; if set, we need to pass the type to
13046         ig.Emit().
13047         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13048         Stelem_Any/Ldelem_Any for generic parameters.   
13049
13050 2003-11-02  Martin Baulig  <martin@ximian.com>
13051
13052         * expression.cs (Invocation.EmitCall): Use
13053         `TypeManager.IsValueType()' to check whether it's a value type.
13054         Don't set `struct_call' when calling a method on a type parameter.
13055
13056 2003-11-02  Martin Baulig  <martin@ximian.com>
13057
13058         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13059         and removed the TypeBuilder argument.
13060
13061         * typemanager.cs (TypeManager.IsValueType): Return
13062         `t.IsGenericParameter || t.IsValueType'.
13063
13064 2003-10-25  Martin Baulig  <martin@ximian.com>
13065
13066         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13067         call ConstructedType.Resolve() on it.
13068
13069         * generic.cs (ConstructedType.Resolve): Set `type' on success.
13070
13071 2003-10-25  Martin Baulig  <martin@ximian.com>
13072
13073         * class.cs (TypeContainer.GetClassBases): Changed
13074         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
13075         CS8214 reporting here.
13076         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13077         instead of a `Type' for our parent.  In case of a recursive
13078         declaration (see tests/gen-23.cs for an example), our parent is a
13079         ConstructedType and it doesn't have its type set.  So, first
13080         create our own TypeBuilder, then call constructed.Resolve() to get
13081         the parent's type and finally TypeBuilder.SetParent() it.
13082
13083         * ecore.cs (TypeExpr.Name): New public virtual property.
13084
13085         * generic.cs
13086         (ConstructedType): We're now a TypeExpr and not just an Expression.
13087         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13088         arguments here; this is done later.
13089         (ConstructedType.Resolve): New public method to resolve the type
13090         arguments and bind them.
13091
13092 2003-10-21  Martin Baulig  <martin@ximian.com>
13093
13094         * convert.cs: Use `TypeManager.IsValueType' instead of
13095         'type.IsValueType' everywhere.
13096
13097         * typemanager.cs (TypeManager.IsValueType): Return true for type
13098         parameters.  The reason for this is that we need to box a type
13099         parameter when converting it to a reference type.
13100
13101         * cs-parser.jay: Added support for default value expressions.
13102
13103         * generics.cs (DefaultValueExpression): New public class.       
13104
13105 2003-10-17  Martin Baulig  <martin@ximian.com>
13106
13107         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13108         TypeContainer so we can also use this for Interfaces.
13109         (TypeParameter.Resolve): Likewise.
13110
13111         * interface.cs (Interface.DefineType): Added support for generic
13112         interfaces.
13113
13114         * cs-parser.jay: Added support for generic structs and interfaces.
13115
13116 2003-10-17  Martin Baulig  <martin@ximian.com>
13117
13118         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13119         call generic methods :-)
13120
13121 2003-10-16  Martin Baulig  <martin@ximian.com>
13122
13123         * cs-parser.jay (namespace_or_type_name): Only create a
13124         GenericMemberAccess if we actually have type arguments.
13125
13126 2003-10-13  Martin Baulig  <martin@ximian.com>
13127
13128         * class.cs (Method.Define): If we're a generic method, call
13129         TypeBuilder.DefineGenericMethod () before resolving
13130         the parameters.
13131         (MethodData): Added .ctor which takes an additional MethodBuilder
13132         argument; this is used for generic methods.
13133         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13134         we already have a MethodBuilder.
13135
13136 2003-10-10  Martin Baulig  <martin@ximian.com>
13137
13138         * class.cs (Method): Added .ctor which takes a `GenericMethod'
13139         instead of a `DeclSpace'.  This is used for generic methods.
13140
13141         * cs-parser.jay (method_header): Added support for generic
13142         methods; create a `GenericMethod' instance and pass it to the
13143         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13144         parameters and locals.
13145
13146         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13147         since we already have the location.  Check whether we're a generic
13148         type declaration or a generic method and create the correct type
13149         parameter.
13150
13151         * generic.cs (TypeParameter.DefineMethod): New public method.
13152         (GenericMethod): New public class; derives from DeclSpace and is
13153         used for generic methods.       
13154
13155 2003-10-09  Martin Baulig  <martin@ximian.com>
13156
13157         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13158         to the .ctor.
13159         (MethodCore.DoDefineParameters): Removed the TypeContainer
13160         argument; use the DeclSpace which was passed to the .ctor instead.
13161         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13162         TypeContainer; we only need a DeclSpace here.
13163
13164 2003-10-09  Martin Baulig  <martin@ximian.com>
13165
13166         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13167         to the .ctor.
13168         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13169         EmitContext's .ctor.    
13170
13171 2003-10-09  Martin Baulig  <martin@ximian.com>
13172
13173         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13174         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13175         AsAccessible(), moved them as well.
13176
13177         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13178
13179 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13180
13181         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13182         generation for >=, as spotted by Paolo, bug 48679.  
13183         Patch from David Waite.
13184
13185         * cs-tokenizer.cs: Add handling for #pragma.
13186
13187         * cs-parser.jay: Allow for both yield and yield return in the
13188         syntax.  The anti-cobolization of C# fight will go on!
13189
13190         * class.cs (TypeBuilder.DefineType): Catch error condition here
13191         (Parent.DefineType erroring out and returning null).
13192
13193         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13194         coping with enumerations variables, we were mistakenly processing
13195         them as a regular value type instead of built-in types.  Fixes the
13196         bug #48063
13197
13198         * typemanager.cs (IsBuiltinOrEnum): New method.
13199
13200 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13201
13202         * cs-parser.jay: Upgrade: yield now needs the return clause.
13203
13204 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13205
13206         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13207
13208 2003-09-29  Martin Baulig  <martin@ximian.com>
13209
13210         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13211         inflated generic methods.
13212
13213         * generics.cs (ConstructedType): Distinguish between open and
13214         closed constructed types; correctly resolve the arguments.
13215
13216 2003-09-22  Martin Baulig  <martin@ximian.com>
13217
13218         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13219         all type arguments meet their constraints.
13220
13221 2003-09-19  Martin Baulig  <martin@ximian.com>
13222
13223         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13224         `MemberCache parent' argument.  Normally, an interface doesn't
13225         have a parent type except System.Object, but we use this in gmcs
13226         for generic type parameters.
13227
13228 2003-09-18  Martin Baulig  <martin@ximian.com>
13229
13230         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13231         on `type.IsInterface'; don't check whether the type has a parent
13232         to determine whether it's an interface.
13233
13234 2003-09-17  Martin Baulig  <martin@ximian.com>
13235
13236         * generic.cs (ConstructedType.ToString): Always use `name' as the
13237         type name.
13238
13239 2003-09-15  Martin Baulig  <martin@ximian.com>
13240
13241         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13242
13243         * generic.cs (Constraints.Resolve): New public method; this is
13244         called to resolve the constraint types and to check whether all
13245         the constraints are correct.
13246         (Constraints.Types): New public property.
13247         (TypeParameter.Resolve): New public method; resolves all the
13248         type's constraints.
13249
13250         * class.cs (TypeContainer.DefineType): Call
13251         TypeParameter.Resolve() before actually defining the type.
13252
13253 2003-09-15  Martin Baulig  <martin@ximian.com>
13254
13255         * class.cs (TypeContainer.DefineType): Added an error flag to
13256         avoid reporting duplicate CS0146's ("class definition is
13257         circular.").
13258
13259         * driver.cs (Driver.MainDriver): Abort if
13260         RootContext.ResolveTree() reported any errors.
13261
13262 2003-09-07  Martin Baulig  <martin@ximian.com>
13263
13264         * report.cs (Error, Warning): Added overloaded versions which take
13265         a `params object[] args' and call String.Format().
13266
13267 2003-09-07  Martin Baulig  <martin@ximian.com>
13268
13269         * decl.cs (DeclSpace..ctor): Don't call
13270         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13271         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13272         (DeclSpace.RecordDecl): New method.
13273
13274         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13275
13276 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13277
13278         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13279         value attributes to be applied to ParameterBuilders.
13280
13281         * class.cs (MethodCore.LabelParameters): Make static and more
13282         generic so that it can be used from other places - like interface
13283         methods, for instance.
13284
13285         * interface.cs (Interface.Emit): Call LabelParameters before
13286         emitting attributes on the InterfaceMethod.
13287
13288 2003-09-07  Martin Baulig  <martin@ximian.com>
13289
13290         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13291         if the number of type parameters doesn't match.
13292
13293 2003-09-04  Martin Baulig  <martin@ximian.com>
13294
13295         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13296         for arrays of generic type params (ie. `!0[]').
13297
13298 2003-09-04  Martin Baulig  <martin@ximian.com>
13299
13300         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13301         for the moment.
13302
13303 2003-09-04  Martin Baulig  <martin@ximian.com>
13304
13305         * decl.cs (DeclSpace.LookupGeneric): New method.
13306         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13307         moment.
13308
13309         * generic.cs (TypeParameterExpr): Take a TypeParameter as
13310         argument, not just a string.
13311         (TypeParameter.Define): New public method; this is called to
13312         actually define the generic parameter; after this, you can use the
13313         new `Type' property to get the type.
13314
13315 2003-09-04  Martin Baulig  <martin@ximian.com>
13316
13317         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13318         is now an ArrayList; initialize the result of the `TypeParameters'
13319         property here.
13320         (DeclSpace.GetGenericData): Removed.
13321         (DeclSpace.LookupGeneric): Temporarily removed; we need to
13322         implement this in a different way.
13323         (DeclSpace.GetTypeParameters): Removed; there's now a
13324         `TypeParameters' property.
13325         (DeclSpace.TypeParameters): New public property.
13326
13327         * generic.cs (Constraints): Make this class public.
13328         (TypeParameter): New public class.
13329
13330 2003-09-04  Martin Baulig  <martin@ximian.com>
13331
13332         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13333         generic parameters.
13334
13335         * class.cs (TypeContainer.DefineType): Call
13336         TypeBuilder.DefineGenericParameter () on all generic parameters if
13337         this is a generic type.
13338
13339 2003-08-28  Martin Baulig  <martin@ximian.com>
13340
13341         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13342         sample-stack.il".
13343
13344         * sample-hello.cs: Compile this with gmcs: "gmcs
13345         /r:sample-stack.dll sample-hello.cs".
13346
13347 2003-08-28  Martin Baulig  <martin@ximian.com>
13348
13349         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13350         the parameters to the generic type.
13351
13352 2003-08-28  Martin Baulig  <martin@ximian.com>
13353
13354         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13355
13356 2003-08-28  Martin Baulig  <martin@ximian.com>
13357
13358         * cs-parser.jay (opt_type_argument_list): Use
13359         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13360         (primary_expression): Replace `qualified_identifier' with `type_name'.
13361         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13362
13363         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13364         parser to check whether it is syntactically a type parameter list;
13365         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13366         this case.
13367
13368 2003-08-26  Martin Baulig  <martin@ximian.com>
13369
13370         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13371         resolving aliases; fixes #47927.
13372
13373 2003-08-26  Martin Baulig  <martin@ximian.com>
13374
13375         * statement.cs (Using.DoResolve): This is internally emitting a
13376         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13377         do not always return.  Fixes #47681.
13378
13379 2003-08-26  Martin Baulig  <martin@ximian.com>
13380
13381         * decl.cs (MemberCore): Moved WarningNotHiding(),
13382         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13383         into MemberBase.
13384         (AdditionResult): Make this nested in DeclSpace.
13385         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13386         argument; call NamespaceEntry.Define() unless we're nested in a
13387         class or struct.
13388
13389         * namespace.cs (Namespace.DefineName): New public function.  This
13390         is called from DeclSpace's .ctor to add 
13391         (Namespace.Lookup): Include DeclSpaces in the lookup.
13392
13393         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13394
13395         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13396
13397 2003-08-25  Martin Baulig  <martin@ximian.com>
13398
13399         * convert.cs (Convert.ExplicitReferenceConversion): When
13400         converting from an interface type to a class, unbox if the target
13401         type is a struct type.  Fixes #47822.
13402
13403 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13404
13405         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13406         #47854.
13407
13408 2003-08-22  Martin Baulig  <martin@ximian.com>
13409
13410         * class.cs (TypeManager.DefineType): When defining a nested type,
13411         call DefineType() on our parent; fixes #47801.
13412
13413 2003-08-22  Martin Baulig  <martin@ximian.com>
13414
13415         * class.cs (MethodData.Define): While checking if a method is an
13416         interface implementation, improve the test a bit more to fix #47654.
13417
13418 2003-08-22  Martin Baulig  <martin@ximian.com>
13419
13420         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13421         correctly; fixes #47722.
13422
13423 2003-08-22  Martin Baulig  <martin@ximian.com>
13424
13425         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13426         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13427
13428         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13429
13430 2003-08-22  Martin Baulig  <martin@ximian.com>
13431
13432         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13433         can only be assigned in static constructors.  Fixes #47161.
13434
13435 2003-08-22  Martin Baulig  <martin@ximian.com>
13436
13437         Rewrote and improved the flow analysis code.
13438
13439         * flowbranching.cs (FlowBranching): Make this class abstract.
13440         (FlowBranching.CreateBranching): New static function to create a
13441         new flow branching.
13442         (FlowBranchingBlock, FlowBranchingException): New classes.
13443         (FlowBranching.UsageVector.Type): New public readonly field.
13444         (FlowBranching.UsageVector.Breaks): Removed the setter.
13445         (FlowBranching.UsageVector.Returns): Removed the setter.
13446         (FlowBranching.UsageVector): Added Break(), Return(),
13447         NeverReachable() and Throw() methods to modify the reachability.
13448         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13449         done by FlowBranching.Merge().
13450         (FlowBranching.UsageVector.MergeChild): New method; merges the
13451         merge result into the current vector.
13452         (FlowBranching.Merge): New abstract method to merge a branching.
13453
13454 2003-08-12  Martin Baulig  <martin@ximian.com>
13455
13456         * expression.cs (Indirection.CacheTemporaries): Create the
13457         LocalTemporary with the pointer type, not its element type.
13458
13459 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13460
13461         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13462         token was a keyword or not.
13463
13464         Add `error' options where an IDENTIFIER was expected;  Provide
13465         CheckToken and CheckIdentifierToken convenience error reporting
13466         functions. 
13467
13468         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13469
13470         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13471         NameSpaceEntry NameSpaceEntry.
13472
13473         (LookupInterfaceOrClass): Avoid creating a full qualified name
13474         from namespace and name: avoid doing lookups when we know the
13475         namespace is non-existant.   Use new Tree.LookupByNamespace which
13476         looks up DeclSpaces based on their namespace, name pair.
13477
13478         * driver.cs: Provide a new `parser verbose' to display the
13479         exception thrown during parsing.  This is turned off by default
13480         now, so the output of a failure from mcs is more graceful.
13481
13482         * namespace.cs: Track all the namespaces defined in a hashtable
13483         for quick lookup.
13484
13485         (IsNamespace): New method
13486
13487 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13488
13489         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13490         we know that we need to concatenate (full typename can never be
13491         null). 
13492
13493         * class.cs: ditto.
13494
13495         * statement.cs: Use a bitfield;  Do not initialize to null things
13496         which are done by the constructor by default.
13497
13498         * cs-parser.jay: bug fix, parameter was 4, not 3.
13499
13500         * expression.cs: Just use the property;
13501
13502         * statement.cs: No need for GetVariableInfo method.
13503
13504 2003-08-08  Martin Baulig  <martin@ximian.com>
13505
13506         * flowanalysis.cs (FlowReturns): This is now nested in the
13507         `FlowBranching' class.
13508         (MyBitVector): Moved this here from statement.cs.
13509         (FlowBranching.SiblingType): New enum type.
13510         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13511
13512 2003-08-07  Martin Baulig  <martin@ximian.com>
13513
13514         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13515         `FlowBranching' class and called `BranchingType'.
13516
13517 2003-08-07  Martin Baulig  <martin@ximian.com>
13518
13519         * flowanalysis.cs: Moved all the control flow analysis code into
13520         its own file.
13521
13522 2003-08-07  Martin Baulig  <martin@ximian.com>
13523
13524         * assign.cs (Assign.DoResolve): `target' must either be an
13525         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13526         #37319.
13527
13528 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13529
13530         * expression.cs (BinaryMethod): This kind of expression is created by the
13531         Binary class if it determines that the operator has to be handled
13532         by a method.
13533
13534         (BinaryDelegate): This kind of expression is created if we are
13535         dealing with a + or - operator on delegates.
13536
13537         (Binary): remove method, argumetns, and DelegateOperator: when
13538         dealing with methods, 
13539
13540         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13541
13542         * statement.cs (Block): use bitfields for the three extra booleans
13543         we had in use.   Remove unused topblock parameter.
13544
13545         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13546
13547         * assign.cs: Drop extra unneeded tests.
13548
13549 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13550
13551         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13552
13553         * statement.cs (Foreach): Use VariableStorage instead of
13554         LocalBuilders.   
13555
13556         * codegen.cs (VariableStorage): New class used by clients that
13557         require a variable stored: locals or fields for variables that
13558         need to live across yield.
13559
13560         Maybe provide a convenience api for EmitThis+EmitLoad?
13561
13562         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13563         these bad boys.
13564
13565 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13566
13567         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13568         RemapParameterLValue): New methods that are used to turn a
13569         precomputed FieldInfo into an expression like this:
13570
13571                 instance.FieldInfo
13572
13573         The idea is to use this instead of making LocalVariableReference
13574         have more than one meaning.
13575
13576         * cs-parser.jay: Add error production to BASE.
13577
13578         * ecore.cs: Deal with TypeManager.GetField returning null, which
13579         is now a valid return value.
13580
13581         (FieldExprNoAddress): New expression for Fields whose address can
13582         not be taken.
13583
13584         * expression.cs (LocalVariableReference): During the resolve
13585         phases, create new expressions if we are in a remapping context.
13586         Remove code that dealt with remapping here.
13587
13588         (ParameterReference): same.
13589
13590         (ProxyInstance): New expression, like the `This' expression, but
13591         it is born fully resolved.  We know what we are doing, so remove
13592         the errors that are targeted to user-provided uses of `this'.
13593
13594         * statement.cs (Foreach): our variable is now stored as an
13595         Expression;  During resolution, follow the protocol, dont just
13596         assume it will return this.
13597
13598 2003-08-06  Martin Baulig  <martin@ximian.com>
13599
13600         * support.cs (SeekableStreamReader.cs): New public class.
13601
13602         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13603         SeekableStreamReader instead of the normal StreamReader.
13604
13605 2003-08-04  Martin Baulig  <martin@ximian.com>
13606
13607         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13608         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13609         deambiguate casts and delegate invocations.
13610         (parenthesized_expression): Use the new tokens to ensure this is
13611         not a cast of method invocation.
13612
13613         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13614         when reading a `)' and Deambiguate_CloseParens () was previously
13615         called.
13616
13617         * expression.cs (ParenthesizedExpression): New class.  This is
13618         just used for the CS0075 test.
13619         (Binary.DoResolve): Check for CS0075.   
13620
13621 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13622
13623         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13624         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13625         reference comparison.
13626
13627         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13628         examine the ReturnType for equality - this is necessary in the
13629         cases of implicit and explicit operators whose signature also
13630         includes the return type.
13631
13632 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13633
13634         * namespace.cs: Cache the result of the namespace computation,
13635         instead of computing it every time.
13636
13637 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13638
13639         * decl.cs: Use a global arraylist that we reuse over invocations
13640         to avoid excesive memory consumption.  Reduces memory usage on an
13641         mcs compile by one meg (45 average).
13642
13643         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13644         private, work around that.
13645
13646 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13647
13648         * literal.cs (IntLiteral): Define Zero and One static literals. 
13649
13650         * cs-parser.jay (integer_literal): use static literals to reduce
13651         memory usage for the most used literals (0, 1 and -1).  211kb
13652         reduced in memory usage.
13653
13654         Replace all calls to `new ArrayList' with `new
13655         ArrayList(4)' which is a good average number for most allocations,
13656         and also requires only 16 bytes of memory for its buffer by
13657         default. 
13658
13659         This reduced MCS memory usage in seven megabytes for the RSS after
13660         bootstrapping.
13661
13662 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13663
13664         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13665         handle params methods the correct way by forming only one
13666         applicable set with params and normal methods in them. Earlier we
13667         were looking at params methods only if we found no normal methods
13668         which was not the correct thing to do.
13669
13670         (Invocation.BetterFunction): Take separate arguments indicating
13671         when candidate and the best method are params methods in their
13672         expanded form.
13673
13674         This fixes bugs #43367 and #46199.
13675
13676         * attribute.cs: Documentation updates.
13677
13678         (CheckAttribute): Rename to CheckAttributeTarget.
13679         (GetValidPlaces): Rename to GetValidTargets.
13680
13681         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13682         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13683
13684         Fixes bug #44468.
13685
13686 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13687
13688         * codegen.cs: Compute IsGeneric correctly.
13689
13690         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13691         resolution. 
13692
13693         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13694         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13695         regressions, and I was chasing more bugs than I required.
13696
13697         * interface.cs: Use expressions for base type names (like classes
13698         and structs have been doing for a while now), and resolve that.
13699         This patch should probably go into head as well.
13700
13701         This makes it one less user of FindType.
13702
13703 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13704
13705         This compiler can not self host currently.  Need to fix that.
13706         
13707         * Makefile: compile to `gmcs.exe'
13708
13709         * driver.cs: Turn on v2 by default on gmcs.
13710
13711         * generic.cs (ConstructedType): Does no longer take a container
13712         type argument;  That will be taken care of later.
13713
13714         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13715         Use SimpleName to resolve for now, so we can continue the work on
13716         the parser, until we get Type.GetType that understands generics.
13717
13718         (ConstructedType.ToString): Implement
13719
13720         (TypeArguments.Resolve): Resolve the child expressions as types. 
13721         
13722         * cs-parser.jay: Rename interface_constraints to
13723         type_parameter_constraints
13724
13725         (namespace_or_type_name): Only use constructed types for the basic
13726         construction, we will deal with identifier<...> later.
13727
13728         (type/type_name): No longer call DecomposeQI, as
13729         namespace_or_type_name is always decoded now.
13730         
13731 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13732
13733         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13734         closely: we eliminate methods in base types when we have an
13735         applicable method in a top-level type.
13736
13737         Please see section 14.5.5.1 for an exact description of what goes
13738         on. 
13739
13740         This fixes bug #45127 and a host of other related to corlib compilation.
13741
13742         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13743         array is the method corresponding to the top-level type (this is
13744         because of the changes made to icall.c) so we change this
13745         accordingly.
13746
13747         (MethodGroupExpr.Name): This too.
13748
13749         * typemanager.cs (GetElementType): New method which does the right
13750         thing when compiling corlib. 
13751
13752         * everywhere: Make use of the above in the relevant places.
13753
13754 2003-07-22  Martin Baulig  <martin@ximian.com>
13755
13756         * cs-parser.jay (invocation_expression): Moved
13757         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13758         `cast_expression', but create a InvocationOrCast which later
13759         resolves to either an Invocation or a Cast.
13760
13761         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13762         method; call this before EmitStatement() to make sure that this
13763         expression can be used as a statement.
13764
13765         * expression.cs (InvocationOrCast): New class; resolves to either
13766         an Invocation or a Cast.
13767
13768         * statement.cs (StatementExpression): Call ResolveStatement() on
13769         the ExpressionStatement before emitting it.
13770
13771 2003-07-21  Martin Baulig  <martin@ximian.com>
13772
13773         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13774         `ref' and `out' attributes match; fixes #46220.
13775         (MemberAccess.ResolveMemberAccess): You can't reference a type
13776         through an expression; fixes #33180.
13777         (Indexers.GetIndexersForType): Don't return the indexers from
13778         interfaces the class implements; fixes #46502.
13779
13780 2003-07-21  Martin Baulig  <martin@ximian.com>
13781
13782         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13783         CS0661 checks; fixes bug #30442.
13784
13785 2003-07-21  Martin Baulig  <martin@ximian.com>
13786
13787         * decl.cs (AdditionResult): Added `Error'.
13788
13789         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13790
13791         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13792         cs0031.cs actually work.
13793
13794  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13795  
13796         * cs-parser.jay (namespace_name): do not use
13797         namespace_or_type_name, use qualified_identifier, because
13798         namespace_or_type_name will soon return a composed expression
13799         instead of a string.
13800  
13801         (namespace_or_type_name): Instead of returning a string, now this
13802         production returns an expression.
13803  
13804         * codegen.cs (EmitContext): Setup IsGeneric property based on
13805         whether our DeclSpace is generic, our the method is generic.
13806  
13807         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13808         the method is generic.
13809  
13810         * cs-parser.jay (type_arguments, opt_type_argument_list,
13811         type_parameters, type_parameter_list, opt_type_parameter_list,
13812         type_parameter,, opt_type_parameter_constraints_clauses,
13813         type_parameter_constraints_clauses,
13814         type_parameter_constraint_clause, type_parameter_constraint,
13815         interface_constraints): Add new production
13816  
13817         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13818         DeclSpace is generic or not.
13819  
13820         (DeclSpace.SetParameterInfo): New routine, used to set the
13821         parameter info for a type.
13822  
13823         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13824         returns a GenericTypeExpr
13825  
13826         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13827         generic, lookup the generic argument.
13828  
13829         * attribute.cs: Do not allow TypeParameterExpressions in
13830         Attributes.
13831  
13832         * class.cs: Do not allow the Main method to be defined in a
13833         Generic container.
13834  
13835         * expression.cs (SizeOf): Do not allow generic types to be used as
13836         arguments to sizeof.
13837  
13838         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13839         it: whether a type is generic or not.  Only works for types we are
13840         currently building for now.
13841         
13842 2003-07-20  Martin Baulig  <martin@ximian.com>
13843
13844         * namespace.cs: Fixed that bug which caused a crash when compiling
13845         the debugger's GUI.
13846
13847 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13848
13849         * typemanager.cs (LookupTypeReflection): Never expose types which
13850         are NotPublic, NestedPrivate, NestedAssembly, or
13851         NestedFamANDAssem.  We used to return these, and later do a check
13852         that would report a meaningful error, but the problem is that we
13853         would not get the real match, if there was a name override.
13854
13855 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13856
13857         * namespace.cs (Namespace, Name): Do not compute the namespace
13858         name dynamically, compute it in the constructor.  This reduced
13859         memory usage by 1697 KB.
13860
13861         * driver.cs: Use --pause to pause at the end.
13862
13863 2003-07-17  Peter Williams  <peter@newton.cx>
13864
13865         * Makefile: Change the name of the test target so that it doesn't
13866         conflict with the recursive test target.
13867
13868 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13869
13870         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13871         AddressOf): Do not use EmitThis, that was wrong, use the actual
13872         this pointer.
13873
13874 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13875
13876         * class.cs (MethodData.Define): While checking if a method is an
13877         interface implementation, improve the test: If we are not public
13878         (use new test here: use the computed MethodAttributes directly,
13879         instead of the parsed modifier flags) check if the `implementing'
13880         method comes from an interface or not.
13881
13882         * pending.cs (VerifyPendingMethods): Slightly better error
13883         message.
13884
13885         * makefile: add test target that does the mcs bootstrap.
13886
13887 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13888
13889         * interface.cs (Define): Do nothing here since there are no
13890         members to populate etc. Move the attribute emission out of here
13891         since this was just totally the wrong place to put it. Attribute
13892         application happens during the 'Emit' phase, not in the 'Define'
13893         phase.
13894
13895         (Emit): Add this method and move the attribute emission here
13896
13897         * rootcontext.cs (EmitCode): Call the Emit method on interface
13898         types too.
13899
13900 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13901
13902         * expression.cs (OverloadResolve): Report error only if Location
13903         is not 'Null' which means that there was a probe going on.
13904
13905 2003-07-14  Martin Baulig  <martin@ximian.com>
13906
13907         * expression.cs (ConditionalLogicalOperator): New public class to
13908         implement user defined conditional logical operators.
13909         This is section 14.11.2 in the spec and bug #40505.
13910
13911 2003-07-14  Martin Baulig  <martin@ximian.com>
13912
13913         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13914
13915 2003-07-14  Martin Baulig  <martin@ximian.com>
13916
13917         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13918
13919         * ecore.cs (IVariable.VerifyFixed): New interface method.
13920
13921         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13922         operator, check whether the variable is actually fixed.  Fixes bug
13923         #36055.  Set a variable definitely assigned when taking its
13924         address as required by the spec.
13925
13926         * statement.cs (LocalInfo.IsFixed): New field.
13927         (LocalInfo.MakePinned): Set `IsFixed' to true.
13928
13929 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13930
13931         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13932         for .ctors, ensure that we only ask for members declared in the
13933         attribute type (BindingFlags.DeclaredOnly).
13934
13935         Fixes bug #43632.
13936
13937         * expression.cs (Error_WrongNumArguments): Report error 1501
13938         correctly the way CSC does.
13939
13940 2003-07-13  Martin Baulig  <martin@ximian.com>
13941
13942         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13943         lookup on the fully qualified name, to make things like "X.X" work
13944         where "X.X" is a fully qualified type name, but we also have a
13945         namespace "X" in the using list.  Fixes #41975.
13946
13947 2003-07-13  Martin Baulig  <martin@ximian.com>
13948
13949         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13950         function. If we're a CompoundAssign, we need to create an embedded
13951         CompoundAssign, not an embedded Assign.
13952         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13953         Fixes #45854.
13954
13955 2003-07-13  Martin Baulig  <martin@ximian.com>
13956
13957         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13958         work to fix bug #46088.
13959
13960 2003-07-13  Ravi Pratap <ravi@ximian.com>
13961
13962         * class.cs (Operator.Emit): Do not emit attributes here - it is
13963         taken care of by the Method class that we delegate too. This takes
13964         care of bug #45876.
13965
13966 2003-07-10  Martin Baulig  <martin@ximian.com>
13967
13968         * expression.cs (TypeOfVoid): New class.
13969         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13970
13971 2003-07-10  Martin Baulig  <martin@ximian.com>
13972
13973         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13974         bug #35957.
13975
13976 2003-07-10  Martin Baulig  <martin@ximian.com>
13977
13978         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13979         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13980
13981         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13982
13983         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13984
13985 2003-07-10  Martin Baulig  <martin@ximian.com>
13986
13987         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13988         of decimal.  Fixes #42850.
13989
13990         NOTE: I also fixed the created byte blob, but this doesn't work on
13991         the MS runtime and csc never produces any byte blobs for decimal
13992         arrays.
13993
13994 2003-07-10  Martin Baulig  <martin@ximian.com>
13995
13996         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13997         structs; fixes #32068.
13998         (Block.AddChildVariableNames): Fixed #44302.
13999
14000 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14001
14002         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14003
14004 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14005
14006         * attribute.cs: And this test is onger needed.
14007
14008 2003-07-08  Martin Baulig  <martin@ximian.com>
14009
14010         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14011         inaccessible types.  Fixes #36313.
14012
14013         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14014
14015         * namespace.cs (NamespaceEntry): Create implicit entries for all
14016         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14017         implicit entries for N1.N2 and N1.
14018
14019 2003-07-08  Martin Baulig  <martin@ximian.com>
14020
14021         Rewrote the handling of namespaces to fix a lot of the issues
14022         wrt. `using' aliases etc.
14023
14024         * namespace.cs (Namespace): Splitted this class into a
14025         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14026
14027         * typemanager.cs (TypeManager.IsNamespace): Removed.
14028         (TypeManager.ComputeNamespaces): Only compute namespaces from
14029         loaded assemblies here, not the namespaces from the assembly we're
14030         currently compiling.
14031
14032 2003-07-08  Martin Baulig  <martin@ximian.com>
14033
14034         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14035
14036 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14037
14038         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14039         already fixed it.  
14040
14041         I thought about the memory savings here, but LookupTypeReflection
14042         is used under already very constrained scenarios.  Compiling
14043         corlib or mcs only exposes one hit, so it would not really reduce
14044         any memory consumption.
14045
14046 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14047
14048         * typemanager.cs: fixes bug #45889 by only adding public types from
14049         other assemblies to the list of known types.
14050
14051 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14052
14053         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14054         on the type we resolved.
14055
14056 2003-07-05  Martin Baulig  <martin@ximian.com>
14057
14058         * pending.cs (PendingImplementation.ParentImplements): Don't
14059         create the proxy if the parent is abstract.
14060
14061         * class.cs (TypeContainer.DefineIndexers): Process explicit
14062         interface implementations first.  Fixes #37714.
14063
14064 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14065
14066         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14067         defined recursively;  but since we modify the input parameters
14068         (left is set to `this' temporarily), we reset this value if the
14069         left_is_explicit is false, which gives the original semantics to
14070         the code.  
14071
14072         * literal.cs (NullPointer): new class used to represent a null
14073         literal in a pointer context.
14074
14075         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14076         type is a pointer, use a NullPointer object instead of a
14077         NullLiteral.   Closes 43687
14078
14079         (ExplicitConversion): Convert pointer values using
14080         the conv opcode to the proper type.
14081
14082         * ecore.cs (New): change ValueTypeVariable property into a method,
14083         that returns whether the valuetype is suitable for being used.
14084
14085         * expression.cs (Binary.DoNumericPromotions): Only return if we
14086         the int constant was a valid uint, and we can return both left and
14087         right as uints.  If not, we continue processing, to trigger the
14088         type conversion.  This fixes 39018.
14089
14090         * statement.cs (Block.EmitMeta): During constant resolution, set
14091         the CurrentBlock property on the emitcontext, so that we resolve
14092         constants propertly.
14093
14094 2003-07-02  Martin Baulig  <martin@ximian.com>
14095
14096         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14097         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14098
14099         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14100         than emitting it here.
14101
14102         * statement.cs: Fixed some more flow analysis bugs.
14103
14104 2003-07-02  Martin Baulig  <martin@ximian.com>
14105
14106         * class.cs (MethodData.Define): When implementing interface
14107         methods, set Final unless we're Virtual.
14108
14109         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14110         check work for interface methods.
14111
14112 2003-07-01  Martin Baulig  <martin@ximian.com>
14113
14114         * ecore.cs (EmitContext.This): Replaced this property with a
14115         GetThis() method which takes a Location argument.  This ensures
14116         that we get the correct error location for a CS0188.
14117
14118 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14119
14120         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14121         ImplicitStandardConversion.
14122
14123         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14124
14125 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14126
14127         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14128         optimization.
14129
14130 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14131
14132         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14133         constructors.
14134
14135         (MethodData.Define): Turn off initlocals for unsafe methods.
14136
14137 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14138
14139         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14140         complete;  Fixes #37521.
14141
14142         * delegate.cs: Use Modifiers.TypeAttr to compute the
14143         TypeAttributes, instead of rolling our own.  This makes the flags
14144         correct for the delegates.
14145
14146 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14147
14148         * class.cs (Constructor.Define): Set the private flag for static
14149         constructors as well.
14150
14151         * cs-parser.jay (statement_expression): Set the return value to
14152         null, to avoid a crash when we catch an error.
14153
14154 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14155
14156         * cs-parser.jay: Applied patch from Jackson that adds support for
14157         extern and unsafe modifiers to destructor declarations.
14158
14159         * expression.cs: Report error 21 if the user is trying to index a
14160         System.Array.
14161
14162         * driver.cs: Add an error message, suggested by the bug report.
14163
14164         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14165         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14166
14167 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14168
14169         * namespace.cs: Add some information to reduce FAQs.
14170
14171 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14172
14173         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14174         underlying enumeration types.  Fixes #43915.
14175
14176         * expression.cs: Treat ushort/short as legal values to be used in
14177         bitwise operations.
14178
14179 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14180
14181         * delegate.cs: transfer custom attributes for paramenters from
14182         the delegate declaration to Invoke and BeginInvoke.
14183
14184 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14185
14186         * attribute.cs: handle custom marshalers and emit marshal info
14187         for fields, too.
14188
14189 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14190
14191         * makefile.gnu: Added anonymous.cs to the compiler sources.
14192
14193 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14194
14195         * iterators.cs: Change the name of the proxy class to include two
14196         underscores.
14197
14198         * cs-parser.jay: Update grammar to include anonymous methods.
14199
14200         * anonymous.cs: new file.
14201
14202 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14203
14204         * class.cs (Field.Define): Add missing test for pointers and
14205         safety. 
14206
14207 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14208
14209         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14210         we use the stobj opcode.
14211
14212         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14213         since it wasn't the correct fix. 
14214
14215         It still is puzzling that we are required to use stobj for IntPtr
14216         which seems to be a ValueType.
14217
14218 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14219
14220         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14221         during regular simple name resolution.   Now, the trick is that
14222         instead of returning for processing the simplename, we do a
14223         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14224         contextual lookup type).   If a match is found, return that, if
14225         not, return for further composition.
14226
14227         This fixes long-standing 30485.
14228
14229         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14230         using the address to initialize an object, do an Stobj instead of
14231         using the regular Stelem.
14232
14233         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14234         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14235         Because if we are a BaseIndexerAccess that value will be true.
14236         Fixes 43643.
14237
14238         * statement.cs (GotoCase.Resolve): Return after reporting an
14239         error, do not attempt to continue. 
14240
14241         * expression.cs (PointerArithmetic.Emit): If our operand is a
14242         long, convert our constants to match the operand before
14243         multiplying.  Convert to I type before adding.   Fixes 43670.
14244
14245 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14246
14247         * enum.cs (ImplicitConversionExists) : Rename to
14248         ImplicitEnumConversionExists to remove ambiguity. 
14249
14250         * ecore.cs (NullCast): New type of cast expression class which
14251         basically is very similar to EmptyCast with the difference being
14252         it still is a constant since it is used only to cast a null to
14253         something else
14254         (eg. (string) null)
14255
14256         * convert.cs (ImplicitReferenceConversion): When casting a null
14257         literal, we return a NullCast.
14258
14259         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14260         should be around anymore.
14261
14262         The renaming (reported was slightly wrong). Corrections:
14263
14264         ConvertImplicitStandard -> ImplicitConversionStandard
14265         ConvertExplicitStandard -> ExplicitConversionStandard
14266
14267         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14268         before passing them in !
14269
14270         * convert.cs (ImplicitConversionStandard): When comparing for
14271         equal expr and target types, ensure that expr is not a
14272         NullLiteral.
14273
14274         In general, we must not be checking (expr_type ==
14275         target_type) in the top level conversion methods
14276         (ImplicitConversion, ExplicitConversion etc). This checking is
14277         done in the methods that they delegate to.
14278
14279 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14280
14281         * convert.cs: Move Error_CannotConvertType,
14282         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14283         ImplicitNumericConversion, ImplicitConversionExists,
14284         ImplicitUserConversionExists, StandardConversionExists,
14285         FindMostEncompassedType, FindMostSpecificSource,
14286         FindMostSpecificTarget, ImplicitUserConversion,
14287         ExplicitUserConversion, GetConversionOperators,
14288         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14289         TryImplicitIntConversion, Error_CannotConvertImplicit,
14290         ConvertImplicitRequired, ConvertNumericExplicit,
14291         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14292         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14293         its own file.
14294
14295         Perform the following renames:
14296
14297         StandardConversionExists -> ImplicitStandardConversionExists
14298         ConvertImplicit -> ImplicitConversion
14299         ConvertImplicitStandard -> ImplicitStandardConversion
14300         TryImplicitIntConversion -> ImplicitIntConversion
14301         ConvertImplicitRequired -> ImplicitConversionRequired
14302         ConvertNumericExplicit -> ExplicitNumericConversion
14303         ConvertReferenceExplicit -> ExplicitReferenceConversion
14304         ConvertExplicit -> ExplicitConversion
14305         ConvertExplicitStandard -> ExplicitStandardConversion
14306
14307 2003-05-19  Martin Baulig  <martin@ximian.com>
14308
14309         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14310         (TypeInfo): Added support for structs having structs as fields.
14311
14312         * ecore.cs (FieldExpr): Implement IVariable.
14313         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14314         VariableInfo for the field.
14315
14316 2003-05-18  Martin Baulig  <martin@ximian.com>
14317
14318         * expression.cs (This.DoResolve): Report a CS0027 if we're
14319         emitting a field initializer.
14320
14321 2003-05-18  Martin Baulig  <martin@ximian.com>
14322
14323         * expression.cs (This.ResolveBase): New public function.
14324         (This.DoResolve): Check for CS0188.
14325
14326         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14327         This.Resolve().
14328
14329         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14330         `instance_expression' to null if we don't have any non-static
14331         methods.
14332
14333 2003-05-18  Martin Baulig  <martin@ximian.com>
14334
14335         Reworked the way how local variables and parameters are handled by
14336         the flow analysis code.
14337
14338         * statement.cs (TypeInfo, VariableMap): New public classes.
14339         (VariableInfo): New public class.  This is now responsible for
14340         checking whether a variable has been assigned.  It is used for
14341         parameters and local variables.
14342         (Block.EmitMeta): Take the InternalParameters as argument; compute
14343         the layout of the flow vectors here.
14344         (Block.LocalMap, Block.ParameterMap): New public properties.
14345         (FlowBranching): The .ctor doesn't get the InternalParameters
14346         anymore since Block.EmitMeta() now computes the layout of the flow
14347         vector.
14348         (MyStructInfo): This class is now known as `StructInfo' and nested
14349         in `TypeInfo'; we don't access this directly anymore.
14350
14351         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14352         property and removed IsAssigned(), IsFieldAssigned(),
14353         SetAssigned() and SetFieldAssigned(); we now call them on the
14354         VariableInfo so we don't need to duplicate this code everywhere.
14355
14356         * expression.cs (ParameterReference): Added `Block block' argument
14357         to the .ctor.
14358         (LocalVariableReference, ParameterReference, This): The new
14359         VariableInfo class is now responsible for all the definite
14360         assignment stuff.
14361
14362         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14363         IsParameterAssigned, SetParameterAssigned): Removed.
14364
14365 2003-05-18  Martin Baulig  <martin@ximian.com>
14366
14367         * typemanager.cs (InitCoreTypes): Try calling
14368         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14369         the 3-args-version.  Corlib now also needs our `void_type'.
14370         (GetMethod): Added overloaded version which takes an optional
14371         `bool report_errors' to allow lookups of optional methods.
14372
14373 2003-05-12  Martin Baulig  <martin@ximian.com>
14374
14375         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14376         only used for locals and not for parameters.
14377
14378 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14379
14380         * support.cs (InternalParameters.ParameterType): Return the
14381         ExternalType of the parameter.
14382
14383         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14384         they were unused.
14385
14386 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14387
14388         * class.cs (MethodData.Define): Do not set the `newslot' on
14389         interface members, if they are also flagged as "override".
14390
14391         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14392         better code for ++i and i++.  This only works for static fields
14393         and local variables.
14394
14395         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14396         want to pull the DeclSpace out of the builder_to_declspace instead
14397         of the TypeBuilder (like in TypeContainer.FindMembers).
14398
14399         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14400         instead of LookupTypeContainer.  Fixes the crash on .NET for
14401         looking up interface members.
14402
14403         * const.cs: Create our own emit context during the Definition
14404         stage, so that constants are evaluated in the proper context, when
14405         a recursive definition happens.
14406
14407 2003-05-11  Martin Baulig  <martin@ximian.com>
14408
14409         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14410         new block for a switch section.
14411         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14412         the adding/lookup in the switch block.  Fixes #39828.
14413
14414 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14415
14416         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14417         functionality: I needed to convert the data after I had performed
14418         the add/sub operation into the operands type size.
14419
14420         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14421         pass the type for the box operation, otherwise the resulting
14422         object would have been of type object.
14423
14424         (BoxedCast): Add constructor to specify the type to box as.
14425
14426 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14427
14428         * iterators.cs: I was reusing the `count' variable inadvertently,
14429         take steps to not allow this to happen.
14430
14431 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14432
14433         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14434         by creating an array at the point where the params starts and
14435         putting all those arguments there, then adjusting the size of the
14436         array.
14437
14438 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14439
14440         * expression.cs (New.AddressOf): Implement interface
14441         IMemoryLocation.  This is used when the `new' operator is used in
14442         the context of an invocation to a method on a value type.
14443
14444         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14445         example. 
14446
14447         * namespace.cs: Also check the using aliases here.
14448
14449         * driver.cs: Move the test for using validity after the types have
14450         been entered, so we do a single pass that also includes the using
14451         aliases. 
14452
14453         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14454         in the regular case.   CreateSiblingForFinally is doing extra
14455         error checking.
14456
14457         * attribute.cs (GetAttributeArgumentExpression): Store the result
14458         on an out value, and use the return value to indicate failure
14459         instead of using null (which is a valid return for Constant.GetValue).
14460
14461         * statement.cs: Perform the analysis flow for the increment
14462         portion after the statement, because this will be the real flow of
14463         execution.  Fixes #42385
14464
14465         * codegen.cs (EmitContext.EmitArgument,
14466         EmitContext.EmitStoreArgument): New helper functions when the
14467         RemapToProxy flag is set.
14468
14469         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14470         function.
14471
14472         Add support for remapping parameters. 
14473
14474         * iterators.cs: Propagate parameter values;  Store parameter
14475         values in the proxy classes.
14476
14477 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14478
14479         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14480         need a proxy reference;  I do not know what I was thinking
14481
14482         * cs-parser.jay (constructor_initializer): catch another error,
14483         and display nice message.
14484
14485         (field_declaration): catch void field declaration
14486         to flag a better error. 
14487
14488         * class.cs (MemberBase.CheckBase): Report an error instead of a
14489         warning if a new protected member is declared in a struct. 
14490         (Field.Define): catch the error of readonly/volatile.
14491
14492         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14493
14494         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14495         volatile variable is taken
14496
14497 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14498
14499         * statement.cs (Fixed.Resolve): Report an error if we are not in
14500         an unsafe context.
14501
14502 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14503
14504         * typemanager.cs: reuse the code that handles type clashes for
14505         delegates and enumerations.
14506
14507         * class.cs (Report28): Always report.
14508
14509         * expression.cs (EncodeAsAttribute): Allow nulls here.
14510
14511 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14512
14513         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14514         the functionality for testing whether an expression is valid for
14515         an attribute here.  Also handle the case of arrays of elements
14516         being stored. 
14517
14518         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14519         encoding a linear array into an array of objects that are suitable
14520         to be passed to an CustomAttributeBuilder.
14521
14522         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14523
14524         * ecore.cs: (FieldExpr): Handle field remapping here.
14525
14526         * iteratators.cs: Pass the instance variable (if the method is an
14527         instance method) to the constructors, so we can access the field
14528         variables on the class.
14529
14530         TODO: Test this with structs.  I think the THIS variable on
14531         structs might have to be a pointer, and not a refenrece
14532
14533 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14534
14535         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14536         local variables to fields in a proxy class.
14537
14538         * iterators.cs (PopulateProxy): Rename our internal fields to
14539         <XXX>.  
14540         Create a <THIS> field if we are an instance method, so we can
14541         reference our parent container variables.
14542         (MapVariable): Called back from the EmitContext code to enter a
14543         new variable to field mapping into the proxy class (we just create
14544         a FieldBuilder).
14545
14546         * expression.cs
14547         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14548         for using the remapped locals to fields.
14549
14550         I placed the code here, because that gives the same semantics to
14551         local variables, and only changes the Emit code.
14552
14553         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14554         statements inside iterators.
14555         (VariableInfo): Add a FieldBuilder for the cases when we are
14556         remapping local variables to fields in a proxy class
14557
14558         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14559         current_block != null.
14560
14561         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14562         not cope with strings, as it has been moved to the
14563         TableSwitchEmit.  Fixed bug in switch generation.
14564
14565         * expression.cs (New.DoResolve): Provide more context for the user
14566         when reporting an error.
14567
14568         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14569         pointers. 
14570
14571         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14572         check the permissions for it.  Note than in a type-resolution
14573         context the check was already present in DeclSpace.ResolveType,
14574         but was missing from the MemberAccess.
14575
14576         (ArrayCreation.CheckIndices): warn if the user has
14577         more nested levels of expressions, but there are no more
14578         dimensions specified.  Avoids crash on bug 41906.
14579
14580 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14581
14582         * statement.cs (Block): replace Implicit bool, for a generic
14583         flags.   
14584         New flag: `Unchecked'.  This is used during the EmitMeta phase
14585         (which is out-of-line with the regular Resolve/Emit process for a
14586         statement, as this is done ahead of time, but still gets a chance
14587         to call constant resolve).
14588
14589         (Block.Flags): new enum for adding a new flag.
14590
14591         (Block.EmitMeta): track the state of unchecked.
14592
14593         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14594         to enable constant resolution to work there as well.
14595
14596 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * typemanager.cs (ienumerable_type): Also look up
14599         System.Collections.IEnumerable. 
14600
14601 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14602
14603         TODO: Test more than one conditional per method.
14604
14605         * class.cs (Indexer.Define): Report the location where the user is
14606         referencing the unsupported feature.
14607
14608         (MethodData): Overload the use of `conditionals' to
14609         minimize the creation of needless ArrayLists.   This saves roughly
14610         212kb on my machine.
14611
14612         (Method): Implement the new IIteratorContainer interface.
14613         (Method.SetYields): Implement the method by setting the ModFlags
14614         to contain METHOD_YIELDS.
14615
14616         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14617         which just got set to null.
14618
14619         * iterators.cs: New file.
14620
14621         (Yield, YieldBreak): New statements.
14622
14623         * statement.cs (Return.Resolve): Flag an error if we are used in
14624         an iterator method.
14625
14626         * codegen.cs (InIterator): New flag set if the code is being
14627         compiled in an iterator method.
14628
14629         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14630         internal modifier, and we just use it to avoid adding extra
14631         fields, as this is seldom used.  
14632
14633         * cs-parser.jay: Add yield_statement (yield and yield break).
14634
14635         * driver.cs: New flag -v2 to turn on version 2 features. 
14636
14637         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14638         hashtable when v2 is enabled.
14639
14640 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14641
14642         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14643         there is already a namespace defined with this name.
14644
14645         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14646         people upgraded their corlibs.
14647
14648         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14649         always use fully qualified types, no need to use the compiler
14650         front end.
14651
14652         (TypeManager.IsNamespace): Use binarysearch.
14653
14654         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14655         AddDelegate): I did not quite use the new IsValid API properly: I
14656         have to pass the short-name and the fullname.  I was passing only
14657         the basename instead of the fullname sometimes. 
14658
14659         (TypeContainer.DefineType): call NamespaceClash.
14660
14661         * interface.cs (Interface.DefineType): use NamespaceClash before
14662         defining the type.
14663
14664         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14665         defining the type.
14666
14667         * enum.cs: (Enum.DefineType): use NamespaceClash before
14668         defining the type.
14669
14670         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14671         speed increase.  First, use the negative_hits cache when we get a
14672         negative.  Second, add the type with its full original name
14673         instead of the new . and + encoded name (reflection uses + to
14674         separate type from a nested type).  Use LookupTypeReflection
14675         directly which bypasses the type->name hashtable (that we already
14676         know does not contain the type.
14677
14678         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14679         location/container type. 
14680
14681         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14682
14683 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14684
14685         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14686
14687         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14688         method is being referenced in the method group from a static
14689         context, and report error 120 if so.
14690
14691         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14692         Error118. 
14693
14694         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14695         is created, we create the A namespace).
14696
14697         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14698         Fixes #41591
14699
14700 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14701
14702         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14703         invocation to ModuleBuilder.GetType with the same values will
14704         return a new type instance, so we need to cache its return
14705         values. 
14706
14707         * expression.cs (Binary.ResolveOperator): Only allow the compare
14708         operators on enums if they are of the same type.
14709
14710         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14711         types of ValueType on their own case.  Before we were giving them
14712         the same treatment as objects.
14713
14714         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14715         fullname.  Short name is used to compare against container name.
14716         Fullname is used to check against defined namespace names.
14717
14718         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14719         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14720
14721         (Method.CheckBase): Call parent.
14722         (MemberBase.CheckBase): Check for protected members on sealed
14723         classes.
14724         (PropertyBase.CheckBase): Call parent.
14725         (Field.Define): Call parent.
14726
14727         * report.cs: Negative error codes are now mapped to 8000 - code,
14728         so that the display is render more nicely.
14729
14730         * typemanager.cs: Do not use try/catch, instead report a regular
14731         error. 
14732
14733         (GetPointerType, GetReferenceType): These methods provide
14734         mechanisms to obtain the T* and T& from a T.  We had the code
14735         previously scattered around the code base, and it also used
14736         TypeManager.LookupType that would go through plenty of caches.
14737         This one goes directly to the type source.
14738
14739         In some places we did the Type.GetType followed by
14740         ModuleBuilder.GetType, but not in others, so this unifies the
14741         processing as well.
14742
14743         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14744         statements now that we have namespace information.
14745
14746         * typemanager.cs (IsNamespace): New method, returns whether the
14747         string presented is a namespace or not.
14748
14749         (ComputeNamespaces): New public entry point, computes the list of
14750         available namespaces, using the GetNamespaces API call in Mono, or
14751         the slower version in MS.NET.   
14752
14753         Now before we start the semantic analysis phase, we have a
14754         complete list of namespaces including everything that the user has
14755         provided.
14756
14757         Deleted old code to cache namespaces in .nsc files.
14758
14759 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14760
14761         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14762         class/struct location definition Location for the implicit
14763         constructor location.
14764
14765         (Operator.Define): Use the location of the operator for the
14766         implicit Method definition.
14767
14768         (Constructor.Emit): use the constructor location for the implicit
14769         base initializer constructor.
14770
14771         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14772         and the Expression class now contains two new methods:
14773
14774         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14775         isolate type lookup from the rest of the resolution process.
14776
14777         Since we use Expressions to hold type definitions due to the way
14778         we parse the input we have historically overloaded Resolve to
14779         perform the Type lookups if a special flag is passed.  Now this is
14780         eliminated and two methods take their place. 
14781
14782         The differences in the two methods between xStep and xTerminal is
14783         that xStep is involved in our current lookup system that uses
14784         SimpleNames to compose a name, while xTerminal is used just to
14785         catch the case where the simplename lookup failed.
14786
14787 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14788
14789         * expression.cs (ResolveMemberAccess): Remove redundant code.
14790         TypeExpr expressions are always born fully resolved.
14791
14792         * interface.cs (PopulateMethod): Do not lookup the types twice.
14793         We were doing it once during SemanticAnalysis and once during
14794         PopulateMethod.
14795
14796         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14797         in local variable type definitions, were being returned as a
14798         SimpleName (we decomposed everything into a string), that is
14799         because primary_expression was being used instead of a type in the
14800         grammar (reduce/reduce conflicts).
14801
14802         The part that was wrong is that we converted the expression into a
14803         string (an oversimplification in one hand, compounded with primary
14804         expressions doing string concatenation).
14805
14806         So things like:
14807
14808         A.B.C [] x;
14809
14810         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14811         using clauses from working on this particular context.  And a type
14812         was being matched directly against "A.B.C[]".
14813
14814         We now use the correct approach, and allow for ComposedCast to be
14815         part of the unary expression.  So the "A.B.C []" become a composed
14816         cast of "A.B.C" (as a nested group of MemberAccess with a
14817         SimpleName at the end) plus the rank composition "[]". 
14818
14819         Also fixes 35567
14820
14821 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14822
14823         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14824         for the access level checking.
14825
14826         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14827         `TypeContainer container', because I kept getting confused when I
14828         was debugging this code.
14829
14830         * expression.cs (Indexers): Instead of tracking getters/setters,
14831         we now track them in parallel.  We create one arraylist less, but
14832         most importantly it is possible now for the LValue code to find a
14833         matching get for a set.
14834
14835         (IndexerAccess.DoResolveLValue): Update the code.
14836         GetIndexersForType has been modified already to extract all the
14837         indexers from a type.  The code assumed it did not.
14838
14839         Also make the code set the correct return type for the indexer.
14840         This was fixed a long time ago for properties, but was missing for
14841         indexers.  It used to be void_type.
14842
14843         (Binary.Emit): Test first for doubles instead of
14844         floats, as they are more common.
14845
14846         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14847         when dealing with floats and the <=, >= operators.  This fixes bug
14848         #39314 
14849
14850         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14851         to load the array value by emitting a load on the foreach variable
14852         type.  This was incorrect.  
14853
14854         We now emit the code to load an element using the the array
14855         variable type, and then we emit the conversion operator.
14856
14857         Fixed #40176
14858
14859 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14860
14861         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14862
14863 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14864
14865         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14866         test for protection before we test for signatures. 
14867
14868         (MethodSignature.ToString): implement.
14869
14870         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14871         to the case where we reduced into a LongConstant.
14872
14873         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14874         depend on whether the information is acurrate, because the
14875         Microsoft runtime will always claim that the array type is public,
14876         regardless of the real state.
14877
14878         If the type is a pointer, another problem happens: the type is
14879         reported as non-public in Microsoft.  
14880
14881         In both cases we have to call CheckAccessLevel recursively with
14882         the underlying type as the argument to be tested.
14883
14884 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14885
14886         * assign.cs (Assign.Emit): If we are dealing with a compound
14887         assignment expression, we should use the code path that stores the
14888         intermediate result in a temporary value.  This fixes #40903.
14889
14890         *expression.cs (Indirection.ToString): Provide ToString method for
14891         debugging. 
14892
14893 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14894
14895         * class.cs: Null out fields holding references to Block objects so
14896         they can be garbage collected.
14897
14898         * expression.cs (OverloadResolve): Remove unused local.
14899
14900 2003-04-07  Martin Baulig  <martin@ximian.com>
14901
14902         * codegen.cs (EmitContext.CurrentFile): New public field.
14903         (EmitContext.Mark): Use the CurrentFile to check whether the
14904         location is in the correct file.
14905         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14906
14907 2003-04-07  Martin Baulig  <martin@ximian.com>
14908
14909         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14910
14911         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14912         location.  [FIXME: The location argument which gets passed to this
14913         method is sometimes wrong!]
14914
14915 2003-04-07  Nick Drochak <ndrochak@gol.com>
14916
14917         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14918
14919 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14920
14921         * expression.cs (Indirection.EmitAssign): We were using the
14922         temporary, but returning immediately instead of continuing the
14923         EmitAssing flow.
14924
14925 2003-04-06  Martin Baulig  <martin@ximian.com>
14926
14927         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14928         if it's a nested child, but also deriving from the outer class.
14929         See test 190.cs.
14930
14931         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14932         nested child, but also deriving from the outer class.  See
14933         test-190.cs.
14934         (FilterWithClosure): We may access private members of the outer
14935         class if we're a nested child and deriving from the outer class.
14936         (RealMemberLookup): Only set `closure_private_ok' if the
14937         `original_bf' contained BindingFlags.NonPublic.
14938
14939 2003-04-05  Martin Baulig  <martin@ximian.com>
14940
14941         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14942         probe if its a type parameter, and if so, flag an error.
14943
14944         * decl.cs: Move here the SetParameterInfo code from class.cs.
14945         Handle IsGeneric here.
14946
14947         Handle a variety of errors in the parameter info definition.
14948
14949         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14950         type parameters here.
14951
14952         * cs-parser.jay (class_declaration): report errors for parameters
14953         here as well.
14954
14955 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14956
14957         * generic.cs: New file, contains support code for generics.
14958
14959         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14960         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14961
14962         Update parser for the above removals.
14963
14964         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14965         now taken care of in the parser.
14966
14967 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14968
14969         * class.cs (Event.Define): Do not allow abstract events to have
14970         initializers. 
14971
14972 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14973
14974         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14975         block in event declarations.
14976
14977         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14978         value type, get its address.
14979
14980         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14981         leaving a class on the stack instead of a boolean value (int
14982         0/1).  Change the code so we compare against null, and then the
14983         result against zero.
14984
14985         * class.cs (TypeContainer.GetClassBases): We were checking for the
14986         parent class being sealed too late.
14987
14988         * expression.cs (Binary.Emit): For <= and >= when dealing with
14989         floating point values, use cgt.un and clt.un instead of cgt and
14990         clt alone.
14991
14992 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14993
14994         * statement.cs: Apply the same optimization as MS: skip the 
14995         GetEnumerator returning an IEnumerator, and use the one returning a 
14996         CharEnumerator instead. This allows us to avoid the try-finally block 
14997         and the boxing.
14998
14999 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15000
15001         * cs-parser.jay: Attributes cannot be applied to
15002                          namespaces. Fixes #40473
15003
15004 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15005
15006         * class.cs:
15007         (Add*): check if the name is valid using the full name for constants,
15008         fields, properties and events.
15009
15010 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15011
15012         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15013         char constants to be part of the enumeration.
15014
15015         * expression.cs (Conditional.DoResolve): Add support for operator
15016         true. Implements the missing functionality from 14.12
15017
15018         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15019         operator true/false as required by the spec.
15020
15021         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15022         implicit conversion to boolean.
15023
15024         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15025         also one where the type implements `operator true'. 
15026
15027         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15028         get an expression that will invoke operator true based on an
15029         expression.  
15030
15031         (GetConversionOperators): Removed the hack that called op_True
15032         here.  
15033
15034         (Expression.ResolveBoolean): Move this from Statement.
15035
15036 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15037
15038         * ecore.cs (FieldExpr): do not allow initialization of initonly
15039         fields on derived classes
15040
15041 2003-03-13  Martin Baulig  <martin@ximian.com>
15042
15043         * statement.cs (Block.Emit): Call ig.BeginScope() and
15044         ig.EndScope() when compiling with debugging info; call
15045         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15046
15047 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15048
15049         * expression.cs (Indexers): Do not construct immediately, allow
15050         for new members to be appended as we go.  Fixes 38143
15051
15052 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15053
15054         * expression.cs: save/restore context when resolving an unchecked
15055         expression.
15056
15057 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * cfold.cs: Catch division by zero in modulus operator during
15060         constant folding.
15061
15062 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15063
15064         * interface.cs (Interface.DefineMembers): Avoid defining members
15065         twice. 
15066
15067 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15068
15069         * driver.cs: handle the +/- options for -noconfig
15070
15071         * statement.cs (Unckeched.Resolve): Also track the state of
15072         unchecked in the Resolve phase.
15073
15074 2003-02-27  Martin Baulig  <martin@ximian.com>
15075
15076         * ecore.cs (Expression.MemberLookup): Don't create a
15077         MethodGroupExpr for something which is not a method.  Fixes #38291.
15078
15079 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15080
15081         * class.cs (MemberBase.CheckParameters): Also check that the type
15082         is unmanaged if it is a pointer.
15083
15084         * expression.cs (SizeOf.Resolve): Add location information.
15085
15086         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15087         a managed type is declared.
15088
15089         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15090         parameter modifiers as well.  Fixes bug 38606
15091
15092         * class.cs: Very sad.  Am backing out the speed up changes
15093         introduced by the ArrayList -> Array in the TypeContainer, as they
15094         were not actually that much faster, and introduced a bug (no error
15095         reports on duplicated methods).
15096
15097         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15098         source first, this will guarantee that we have a valid expression
15099         before calling in lower levels functions that will require a
15100         resolved object.  Then use this original_source in the
15101         target.ResolveLValue instead of the original source that was
15102         passed to us.
15103
15104         Another change.  Use target.Resolve instead of LValueResolve.
15105         Although we are resolving for LValues, we will let the Assign code
15106         take care of that (it will be called again from Resolve).  This
15107         basically allows code like this:
15108
15109         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15110         class Y { void A (X x) { x [0] += o; }
15111
15112         The problem was that the indexer was trying to resolve for
15113         set_Item (idx, object o) and never finding one.  The real set_Item
15114         was set_Item (idx, X).  By delaying the process we get the right
15115         semantics. 
15116
15117         Fixes bug 36505
15118
15119 2003-02-23  Martin Baulig  <martin@ximian.com>
15120
15121         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15122         while calling DoEmit ().
15123
15124         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15125         source files; if you use the #line directive inside a method, the
15126         compiler stops emitting line numbers for the debugger until it
15127         reaches the end of the method or another #line directive which
15128         restores the original file.
15129
15130 2003-02-23  Martin Baulig  <martin@ximian.com>
15131
15132         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15133
15134 2003-02-23  Martin Baulig  <martin@ximian.com>
15135
15136         * statement.cs (Block.AddChildVariableNames): We need to call this
15137         recursively, not just for our immediate children.
15138
15139 2003-02-23  Martin Baulig  <martin@ximian.com>
15140
15141         * class.cs (Event.Define): Always make the field private, like csc does.
15142
15143         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15144         actually work, fixes bug #37521.
15145
15146 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * delegate.cs: When creating the various temporary "Parameters"
15149         classes, make sure that we call the ComputeAndDefineParameterTypes
15150         on those new parameters (just like we do with the formal ones), to
15151         allow them to be resolved in the context of the DeclSpace.
15152
15153         This fixes the bug that Dick observed in Bugzilla #38530.
15154
15155 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15156
15157         * expression.cs (ResolveMemberAccess): When resolving a constant,
15158         do not attempt to pull a constant if the value was not able to
15159         generate a valid constant.
15160
15161         * const.cs (LookupConstantValue): Do not report more errors than required.
15162
15163 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15164
15165         * expression.cs: fixes bug #38328.
15166
15167 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15168
15169         * class.cs: Changed all the various members that can be part of a
15170         class from being an ArrayList to be an Array of the right type.
15171         During the DefineType type_list, interface_list, delegate_list and
15172         enum_list are turned into types, interfaces, delegates and enums
15173         arrays.  
15174
15175         And during the member population, indexer_list, event_list,
15176         constant_list, field_list, instance_constructor_list, method_list,
15177         operator_list and property_list are turned into their real arrays.
15178
15179         Although we could probably perform this operation earlier, for
15180         good error reporting we need to keep the lists and remove the
15181         lists for longer than required.
15182
15183         This optimization was triggered by Paolo profiling the compiler
15184         speed on the output of `gen-sample-program.pl' perl script. 
15185
15186         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15187         not crash in methods like MemberLookupFailed that use this field.  
15188
15189         This problem arises when the compiler fails to resolve a type
15190         during interface type definition for example.
15191
15192 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15193
15194         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15195         inherit from System.Object, so we have to stop at null, not only
15196         when reaching System.Object.
15197
15198 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15199
15200         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15201         DeclaredOnly because the parent indexer might have had a different
15202         name, but did not loop until the top of the hierarchy was reached.
15203
15204         The problem this one fixes is 35492: when a class implemented an
15205         indexer from an interface, we were getting the interface method
15206         (which was abstract) and we were flagging an error (can not invoke
15207         abstract method).
15208
15209         This also keeps bug 33089 functioning, and test-148 functioning.
15210
15211         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15212         out if a method is special is to see if it is declared in a
15213         property or event, or whether it is one of the predefined operator
15214         names.   This should fix correctly #36804.
15215
15216 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15217
15218         The goal here is to remove the dependency on EmptyCast.Peel ().
15219         Killing it completely.
15220
15221         The problem is that currently in a number of places where
15222         constants are expected, we have to "probe" for an EmptyCast, and
15223         Peel, which is not the correct thing to do, as this will be
15224         repetitive and will likely lead to errors. 
15225
15226         The idea is to remove any EmptyCasts that are used in casts that
15227         can be reduced to constants, so we only have to cope with
15228         constants. 
15229
15230         This bug hunt was triggered by Bug 37363 and the desire to remove
15231         the duplicate pattern where we were "peeling" emptycasts to check
15232         whether they were constants.  Now constants will always be
15233         constants.
15234
15235         * ecore.cs: Use an enumconstant here instead of wrapping with
15236         EmptyCast.  
15237
15238         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15239         throwing me off.  By handling this we can get rid of a few hacks.
15240
15241         * statement.cs (Switch): Removed Peel() code.
15242
15243 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15244
15245         * class.cs: Location information for error 508
15246
15247         * expression.cs (New.DoResolve): Add a guard against double
15248         resolution of an expression.  
15249
15250         The New DoResolve might be called twice when initializing field
15251         expressions (see EmitFieldInitializers, the call to
15252         GetInitializerExpression will perform a resolve on the expression,
15253         and later the assign will trigger another resolution
15254
15255         This leads to bugs (#37014)
15256
15257         * delegate.cs: The signature for EndInvoke should contain any ref
15258         or out parameters as well.  We were not doing this in the past. 
15259
15260         * class.cs (Field.Define): Do not overwrite the type definition
15261         inside the `volatile' group.  Turns out that volatile enumerations
15262         were changing the type here to perform a validity test, which
15263         broke conversions. 
15264
15265 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15266
15267         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15268         and structs, we do not want to load the instance variable
15269
15270         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15271         enum_type has to be handled like an object reference (implicit
15272         conversions exists from this to object), but the regular IsClass
15273         and IsValueType tests will never return true for this one.
15274
15275         Also we use TypeManager.IsValueType instead of type.IsValueType,
15276         just for consistency with the rest of the code (this is only
15277         needed if we ever use the construct exposed by test-180.cs inside
15278         corlib, which we dont today).
15279
15280 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15281
15282         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15283         just InternalCall.
15284
15285 2003-02-09  Martin Baulig  <martin@ximian.com>
15286
15287         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15288         (Namespace.DefineNamespaces): New static public method; this is
15289         called when we're compiling with debugging to add all namespaces
15290         to the symbol file.
15291
15292         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15293         pass it to the Namespace's .ctor.
15294
15295         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15296         and MethodBase arguments; pass the namespace ID to the symwriter;
15297         pass the MethodBase instead of the token to the symwriter.
15298         (SymbolWriter.DefineNamespace): New method to add a namespace to
15299         the symbol file.
15300
15301 2003-02-09  Martin Baulig  <martin@ximian.com>
15302
15303         * symbolwriter.cs: New file.  This is a wrapper around
15304         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15305         methods here in near future.
15306
15307 2003-02-09  Martin Baulig  <martin@ximian.com>
15308
15309         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15310         ILGenerator.MarkSequencePoint() which are actually used by the
15311         symbol writer.
15312
15313 2003-02-09  Martin Baulig  <martin@ximian.com>
15314
15315         * location.cs (SourceFile): New public sealed class.  This
15316         contains the name and an index which is used in the location's token.
15317         (Location): Reserve an appropriate number of bits in the token for
15318         the source file instead of walking over that list, this gives us a
15319         really huge performance improvement when compiling with debugging.
15320
15321         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15322         `SourceFile' argument instead of a string.
15323         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15324         but don't parse/tokenize here, we need to generate the list of all
15325         source files before we do that.
15326         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15327         the files.
15328
15329         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15330         instead of a string.
15331
15332         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15333         of a string.
15334
15335 2003-02-09  Martin Baulig  <martin@ximian.com>
15336
15337         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15338         filename on `#line default'.
15339
15340 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15341
15342         * statement.cs: don't clear the pinned var when the fixed statement
15343         returns from the method (fixes bug#37752).
15344
15345 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15346
15347         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15348         to IsValueType.
15349
15350 2003-02-07  Martin Baulig  <martin@ximian.com>
15351
15352         * driver.cs: Removed the `--debug-args' command line argument.
15353
15354         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15355         automatically by the AsssemblyBuilder.
15356         (CodeGen.InitializeSymbolWriter): We don't need to call any
15357         initialization function on the symbol writer anymore.  This method
15358         doesn't take any arguments.
15359
15360 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15361
15362         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15363         from referenced assemblies as well.
15364
15365 2003-02-02  Martin Baulig  <martin@ximian.com>
15366
15367         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15368
15369 2003-02-02  Martin Baulig  <martin@ximian.com>
15370
15371         * class.cs (Constructor.Emit): Open the symbol writer before
15372         emitting the constructor initializer.
15373         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15374         single-stepping through constructor initializers.
15375
15376 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15377
15378         * class.cs: Handle error 549: do not allow virtual methods in
15379         sealed classes. 
15380
15381 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15382
15383         * decl.cs: Check access levels when resolving types
15384
15385 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15386
15387         * statement.cs: Add parameters and locals set in catch blocks that might 
15388         return to set vector
15389
15390 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15391
15392         * class.cs (Operator): Set the SpecialName flags for operators.
15393
15394         * expression.cs (Invocation.DoResolve): Only block calls to
15395         accessors and operators on SpecialName methods.
15396
15397         (Cast.TryReduce): Handle conversions from char constants.
15398
15399
15400 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15401
15402         * statement.cs: small memory and time optimization in FlowBranching.
15403
15404 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15405
15406         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15407         problem that the last fix but in the other sid (Set).
15408
15409         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15410         access when there is no indexer in the hierarchy.
15411
15412 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15413
15414         * class.cs: Combine some if statements.
15415
15416 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15417
15418         * driver.cs: fixed bug #37187.
15419
15420 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15421
15422         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15423         any indexer, it's needed to build a list with all the indexers in the
15424         hierarchy (AllGetters), else we have problems. Fixes #35653.
15425
15426 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15427
15428         * class.cs (MethodData.Define): It is wrong for an interface
15429         implementation to be static in both cases: explicit and implicit.
15430         We were only handling this in one case.
15431
15432         Improve the if situation there to not have negations.
15433
15434         * class.cs (Field.Define): Turns out that we do not need to check
15435         the unsafe bit on field definition, only on usage.  Remove the test.
15436
15437 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15438
15439         * driver.cs: use assembly.Location instead of Codebase (the latest
15440         patch made mcs fail when using MS assemblies).
15441
15442 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15443
15444         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15445         get the path to *corlib.dll.
15446
15447 2003-01-21  Nick Drochak <ndrochak@gol.com>
15448
15449         * cs-tokenizer.cs:
15450         * pending.cs:
15451         * typemanager.cs: Remove compiler warnings
15452
15453 2003-01-20  Duncan Mak  <duncan@ximian.com>
15454
15455         * AssemblyInfo.cs: Bump the version number to 0.19.
15456
15457 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15458
15459         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15460
15461 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15462
15463         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15464
15465 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15466
15467         * cs-parser.jay: Small fix: we were not comparing the constructor
15468         name correctly.   Thanks to Zoltan for the initial pointer.
15469
15470 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15471
15472         * cs-tokenizer.cs: Set file name when specified with #line
15473
15474 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15475
15476         * cs-parser.jay: Only perform the constructor checks here if we
15477         are named like the class;  This will help provider a better
15478         error.  The constructor path is taken when a type definition is
15479         not found, but most likely the user forgot to add the type, so
15480         report that rather than the constructor error.
15481
15482 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15483
15484         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15485         allocations.
15486
15487 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15488
15489         * cs-parser.jay: Add cleanup call.
15490
15491 2003-01-13  Duncan Mak  <duncan@ximian.com>
15492
15493         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15494         consistent with other methods.
15495
15496 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15497
15498         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15499
15500 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15501
15502         * attribute.cs: only set GuidAttr to true when we have a
15503         GuidAttribute.
15504
15505 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15506
15507         * ecore.cs:
15508         * expression.cs:
15509         * typemanager.cs: fixes to allow mcs compile corlib with the new
15510         Type.IsSubclassOf fix.
15511
15512 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15513
15514         * expression.cs (LocalVariableReference.DoResolve): Classify a
15515         constant as a value, not as a variable.   Also, set the type for
15516         the variable.
15517
15518         * cs-parser.jay (fixed_statement): take a type instead of a
15519         pointer_type, so we can produce a better error message later.
15520
15521         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15522         as an error.  
15523
15524         (For.DoEmit): Make inifinite loops have a
15525         non-conditional branch back.
15526
15527         (Fixed.DoEmit): First populate the pinned variables, then emit the
15528         statement, then clear the variables.  Before I was emitting the
15529         code once for each fixed piece.
15530
15531
15532 2003-01-08  Martin Baulig  <martin@ximian.com>
15533
15534         * statement.cs (FlowBranching.MergeChild): A break in a
15535         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15536
15537 2003-01-08  Martin Baulig  <martin@ximian.com>
15538
15539         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15540         lives in the same number space than `param_map'.  Fixes #36154.
15541
15542 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15543
15544         * cs-parser.jay (constructor_declaration): Set the
15545         Constructor.ModFlags before probing for it.  This makes the
15546         compiler report 514, 515 and 132 (the code was there, but got
15547         broken). 
15548
15549         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15550         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15551         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15552
15553 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15554
15555         * enum.cs: create the enum static fields using the enum type.
15556
15557 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15558
15559         * class.cs: don't try to create the ParamBuilder for the return
15560         type if it's not needed (and handle it breaking for the ms runtime
15561         anyway).
15562
15563 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15564
15565         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15566
15567 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15568
15569         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15570         the command.   This showed up while compiling the JANET source
15571         code, which used \r as its only newline separator.
15572
15573 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15574
15575         * class.cs (Method.Define): If we are an operator (because it
15576         reuses our code), then set the SpecialName and HideBySig.  #36128
15577
15578 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15579
15580         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15581         exception, report error 120 `object reference required'.
15582
15583         * driver.cs: Add --pause option, used during to measure the size
15584         of the process as it goes with --timestamp.
15585
15586         * expression.cs (Invocation.DoResolve): Do not allow methods with
15587         SpecialName to be invoked.
15588
15589 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15590
15591         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15592         number before adding it.
15593
15594 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15595
15596         * ecore.cs (StandardImplicitConversion): When in an unsafe
15597         context, we allow conversion between void * to any other pointer
15598         type. This fixes bug #35973.
15599
15600 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15601
15602         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15603         is not thrown when extensionless outputs are used 
15604
15605 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15606
15607         * rootcontext.cs: fixed compilation of corlib.
15608
15609 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * attribute.cs (Attributes.Contains): Add new method.
15612
15613         * class.cs (MethodCore.LabelParameters): if the parameter is an
15614         `out' parameter, check that no attribute `[In]' has been passed.
15615
15616         * enum.cs: Handle the `value__' name in an enumeration.
15617
15618 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15619
15620         * decl.cs: Added special case to allow overrides on "protected
15621         internal" methods
15622
15623 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15624
15625         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15626         since it makes much more sense.
15627
15628         (Attributes.ctor): Don't require a Location parameter.
15629
15630         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15631
15632         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15633         since we already have that information per attribute.
15634
15635         * everywhere : make appropriate changes.
15636
15637         * class.cs (LabelParameters): Write the code which actually
15638         applies attributes to the return type. We can't do this on the MS
15639         .NET runtime so we flag a warning in the case an exception is
15640         thrown.
15641
15642 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15643
15644         * const.cs: Handle implicit null conversions here too.
15645
15646 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15647
15648         * class.cs (MethodCore.LabelParameters): Remove the extra
15649         Type [] parameter since it is completely unnecessary. Instead
15650         pass in the method's attributes so that we can extract
15651         the "return" attribute.
15652
15653 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15654
15655         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15656         of ignoring it and letting the compile continue.
15657
15658         * typemanager.cs (ChangeType): use an extra argument to return an
15659         error condition instead of throwing an exception.
15660
15661 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15662
15663         * expression.cs (Unary.TryReduce): mimic the code for the regular
15664         code path.  Perform an implicit cast in the cases where we can
15665         implicitly convert to one of the integral types, and then reduce
15666         based on that constant.   This fixes bug #35483.
15667
15668 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15669
15670         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15671
15672 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15673
15674         * namespace.cs: fixed bug #35489.
15675
15676 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15677
15678         * class.cs: Remove some dead code.
15679
15680         * cs-parser.jay: Estimate the number of methods needed
15681         (RootContext.MethodCount);
15682
15683         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15684         numbers instead of StringBuilders.
15685
15686         * support.cs (PtrHashtable): Add constructor with initial size;
15687         We can now reduce reallocations of the method table.
15688
15689 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15690
15691         * attribute.cs (ApplyAttributes): Keep track of the emitted
15692         attributes on a per-target basis. This fixes bug #35413.
15693
15694 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15695
15696         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15697         default to the Windows 1252 encoding.
15698
15699         (UnixParseOption): Support version, thanks to Alp for the missing
15700         pointer. 
15701
15702         * AssemblyInfo.cs: Add nice assembly information.
15703
15704         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15705         (bug 35169).
15706
15707         * cs-parser.jay: Allow a trailing comma before the close bracked
15708         in the attribute_section production.
15709
15710         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15711         address of the instance was being taken, I will take this out,
15712         because we take the address of the object immediately here.
15713
15714 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15715
15716         * typemanager.cs (AreMultipleAllowed): Take care of the most
15717         obvious case where attribute type is not in the current assembly -
15718         stupid me ;-)
15719
15720 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15721
15722         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15723         definitions, instead of doing that afterwards.  
15724
15725         Also we use a nice little hack, depending on the constructor, we
15726         know if we are a "composed" name or a simple name.  Hence, we
15727         avoid the IndexOf test, and we avoid 
15728
15729         * codegen.cs: Add code to assist in a bug reporter to track down
15730         the source of a compiler crash. 
15731
15732 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15733
15734         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15735         types have been emitted for a given element and flag an error
15736         if something which does not have AllowMultiple set is used more
15737         than once.
15738
15739         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15740         attribute types and their corresponding AllowMultiple properties
15741
15742         (AreMultipleAllowed): Check the property for a given type.
15743
15744         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15745         property in the case we have a TypeContainer.
15746
15747         (Attributes.AddAttribute): Detect duplicates and just skip on
15748         adding them. This trivial fix catches a pretty gross error in our
15749         attribute emission - global attributes were being emitted twice!
15750
15751         Bugzilla bug #33187 is now fixed.
15752
15753 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15754
15755         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15756         instead of pp_and).
15757
15758         * expression.cs (Binary.ResolveOperator): I can only use the
15759         Concat (string, string, string) and Concat (string, string,
15760         string, string) if the child is actually a concatenation of
15761         strings. 
15762
15763 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15764
15765         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15766         context where we need a 2-character lookahead.
15767
15768         * pending.cs (PendingImplementation): Rework so we can keep track
15769         of interface types all the time, and flag those which were
15770         implemented by parents as optional.
15771
15772 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15773
15774         * expression.cs (Binary.ResolveOperator): Use
15775         String.Concat(string,string,string) or
15776         String.Concat(string,string,string,string) when possible. 
15777
15778         * typemanager: More helper methods.
15779
15780
15781 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15782
15783         * pending.cs: remove the bogus return from GetMissingInterfaces()
15784         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15785
15786 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15787
15788         * namespace.cs: avoid duplicated 'using xxx' being added to
15789         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15790         when we get more than one 'using' statement for the same namespace.
15791         Report a CS0105 warning for it.
15792
15793 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15796         of calling getChar/putback, uses internal knowledge of it.    
15797
15798         (xtoken): Reorder tokenizer so most common patterns are checked
15799         first.  This reduces the compilation time in another 5% (from 8.11s
15800         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15801
15802         The parsing time is 22% of the compilation in mcs, and from that
15803         64% is spent on the tokenization process.  
15804
15805         I tried using a binary search for keywords, but this is slower
15806         than the hashtable.  Another option would be to do a couple of
15807         things:
15808
15809                 * Not use a StringBuilder, instead use an array of chars,
15810                   with a set value.  Notice that this way we could catch
15811                   the 645 error without having to do it *afterwards*.
15812
15813                 * We could write a hand-parser to avoid the hashtable
15814                   compares altogether.
15815
15816         The identifier consumption process takes 37% of the tokenization
15817         time.  Another 15% is spent on is_number.  56% of the time spent
15818         on is_number is spent on Int64.Parse:
15819
15820                 * We could probably choose based on the string length to
15821                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15822                   computations. 
15823
15824         Another 3% is spend on wrapping `xtoken' in the `token' function.
15825
15826         Handle 0xa0 as whitespace (#34752)
15827
15828 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15829
15830         * typemanager.cs (IsCLRType): New routine to tell whether a type
15831         is one of the builtin types.  
15832
15833         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15834         typecode in more places instead of doing pointer comparissions.
15835         We could leverage some knowledge about the way the typecodes are
15836         laid out.
15837
15838         New code to cache namespaces in assemblies, it is currently not
15839         invoked, to be used soon.
15840
15841         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15842
15843         * expression.cs (Binary.ResolveOperator): specially handle
15844         strings, and do not perform user-defined operator overloading for
15845         built-in types.
15846
15847 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15848
15849         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15850         internalcall as it is a pretty simple operation;  Avoid whenever
15851         possible to call Char.IsLetter.
15852
15853         (consume_identifier): Cut by half the number of
15854         hashtable calls by merging the is_keyword and GetKeyword behavior.
15855
15856         Do not short-circuit, because if we do, we
15857         report errors (ie, #if false && true would produce an invalid
15858         directive error);
15859
15860
15861 2002-11-24  Martin Baulig  <martin@ximian.com>
15862
15863         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15864         check constant ranges and report a CS0221.  Fixes #33186.
15865
15866 2002-11-24  Martin Baulig  <martin@ximian.com>
15867
15868         * cs-parser.jay: Make this work for uninitialized variable
15869         declarations in the `for' initializer.  Fixes #32416.
15870
15871 2002-11-24  Martin Baulig  <martin@ximian.com>
15872
15873         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15874         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15875
15876 2002-11-24  Martin Baulig  <martin@ximian.com>
15877
15878         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15879         argument; if true, we also check for user-defined conversions.
15880         This is only needed if both arguments are of a user-defined type.
15881         Fixes #30443, added test-175.cs.
15882         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15883
15884         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15885
15886 2002-11-24  Martin Baulig  <martin@ximian.com>
15887
15888         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15889         function to get the store opcode.
15890         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15891         only emit the Ldelema if the store opcode is Stobj.  You must run
15892         both test-34 and test-167 to test this.  Fixes #34529.
15893
15894 2002-11-23  Martin Baulig  <martin@ximian.com>
15895
15896         * ecore.cs (Expression.MemberLookup): Added additional
15897         `qualifier_type' argument which is used when we're being called
15898         from MemberAccess.DoResolve() and null if we're called from a
15899         SimpleName lookup.
15900         (Expression.MemberLookupFailed): New method to report errors; this
15901         does the CS1540 check and reports the correct error message.
15902
15903         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15904         argument for the CS1540 check and redone the way how we're dealing
15905         with private members.  See the comment in the source code for details.
15906         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15907         `closure_start_type' to `closure_qualifier_type' and check whether
15908         it's not null.  It was not this filter being broken, it was just
15909         being called with the wrong arguments.
15910
15911         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15912         and pass it the correct `qualifier_type'; this also does the error
15913         handling for us.
15914
15915 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15916
15917         * expression.cs (Invocation.EmitParams): If the we are dealing
15918         with a non-built-in value type, load its address as well.
15919
15920         (ArrayCreation): Use a a pretty constant instead
15921         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15922         static initializers.  
15923
15924         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15925         because they are not really value types, just glorified integers. 
15926
15927         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15928
15929         * ecore.cs: Remove redundant code for enumerations, make them use
15930         the same code path as everything else, fixes the casting issue
15931         with enumerations in Windows.Forms.
15932
15933         * attribute.cs: Do only cast to string if it is a string, the
15934         validation happens later.
15935
15936         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15937         people upgrade their corlibs.
15938
15939         * ecore.cs: Oops, enumerations were not following the entire code path
15940
15941 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15942
15943         * typemanager.cs (FilterWithClosure): Commented out the test for
15944         1540 in typemanager.cs, as it has problems when accessing
15945         protected methods from a parent class (see test-174.cs). 
15946
15947         * attribute.cs (Attribute.ValidateGuid): new method.
15948         (Attribute.Resolve): Use above.
15949
15950 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15951
15952         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15953
15954         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15955         handling for enumerations, as we only needed the TypeContainer
15956         functionality to begin with (this is required for the fix below to
15957         work for enums that reference constants in a container class for
15958         example). 
15959
15960         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15961
15962         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15963         a valid TypeBuilder to perform lookups on.o
15964
15965         * class.cs (InheritableMemberSignatureCompare): Use true in the
15966         call to GetGetMethod and GetSetMethod, because we are comparing
15967         the signature, and we need to get the methods *even* if they are
15968         private. 
15969
15970         (PropertyBase.CheckBase): ditto.
15971
15972         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15973         GotoCase.Resolve): Use Peel on EmpytCasts.
15974
15975         * ecore.cs (EmptyCast): drop child, add Peel method.
15976
15977 2002-11-17  Martin Baulig  <martin@ximian.com>
15978
15979         * ecore.cs (EmptyCast.Child): New public property.
15980
15981         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15982         label resolved to an EmptyCast.  Fixes #34162.
15983         (GotoCase.Resolve): Likewise.
15984         (Block.EmitMeta): Likewise.
15985
15986 2002-11-17  Martin Baulig  <martin@ximian.com>
15987
15988         * expression.cs (Invocation.BetterConversion): Prefer int over
15989         uint; short over ushort; long over ulong for integer literals.
15990         Use ImplicitConversionExists instead of StandardConversionExists
15991         since we also need to check for user-defined implicit conversions.
15992         Fixes #34165.  Added test-173.cs.
15993
15994 2002-11-16  Martin Baulig  <martin@ximian.com>
15995
15996         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15997         with the `true' and `false' literals.  Fixes #33151.
15998
15999 2002-11-16  Martin Baulig  <martin@ximian.com>
16000
16001         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16002         October 22nd; don't do the cs1540 check for static members.
16003
16004         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16005         now using our own filter here and doing the cs1540 check again.
16006
16007 2002-11-16  Martin Baulig  <martin@ximian.com>
16008
16009         * support.cs (InternalParameters): Don't crash if we don't have
16010         any fixed parameters.  Fixes #33532.
16011
16012 2002-11-16  Martin Baulig  <martin@ximian.com>
16013
16014         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16015         when looking up static methods to make this work on Windows.
16016         Fixes #33773.
16017
16018 2002-11-16  Martin Baulig  <martin@ximian.com>
16019
16020         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16021         a setter rather than using PropertyInfo.CanWrite.
16022
16023 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16024
16025         * class.cs: Allow acces to block member by subclasses. Fixes build
16026         breaker.
16027
16028 2002-11-14  Martin Baulig  <martin@ximian.com>
16029
16030         * class.cs (Constructor.Emit): Added the extern/block check.
16031         Fixes bug #33678.
16032
16033 2002-11-14  Martin Baulig  <martin@ximian.com>
16034
16035         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16036         iteration while looking for indexers, this is needed because the
16037         indexer may have a different name in our base classes.  Fixed the
16038         error reporting (no indexers at all, not get accessor, no
16039         overloaded match).  Fixes bug #33089.
16040         (IndexerAccess.DoResolveLValue): Likewise.
16041
16042 2002-11-14  Martin Baulig  <martin@ximian.com>
16043
16044         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16045         indexers.  Fixes the first part of bug #33089.
16046         (MethodSignature.InheritableMemberSignatureCompare): Added support
16047         for properties.
16048
16049 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16050
16051         * attribute.cs (Attribute.Resolve): Catch the
16052         NullReferenceException and report it since it isn't supposed to
16053         happen. 
16054
16055 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16056
16057         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16058         LogicalOr and LogicalAnd that can benefit from recursively
16059         handling EmitBranchable.  The code now should be nice for Paolo.
16060
16061 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16062
16063         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16064         the Type lookups, as we perform quite a number of lookups on
16065         non-Types.  This can be removed once we can deterministically tell
16066         whether we have a type or a namespace in advance.
16067
16068         But this might require special hacks from our corlib.
16069
16070         * TODO: updated.
16071
16072         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16073         and double which avoids a conversion from an integer to a double.
16074
16075         * expression.cs: tiny optimization, avoid calling IsConstant,
16076         because it effectively performs the lookup twice.
16077
16078 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16079
16080         But a bogus return here to keep the semantics of the old code
16081         until the Mono runtime is fixed.
16082
16083         * pending.cs (GetMissingInterfaces): New method used to remove all
16084         the interfaces that are already implemented by our parent
16085         classes from the list of pending methods. 
16086
16087         * interface.cs: Add checks for calls after ResolveTypeExpr.
16088
16089 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16090
16091         * class.cs (Class.Emit): Report warning 67: event not used if the
16092         warning level is beyond 3.
16093
16094         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16095         being a NullLiteral.
16096
16097         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16098         specifiers. 
16099
16100         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16101         path that might fail if a type can not be resolved.
16102
16103         * expression.cs (Binary.Emit): Emit unsigned versions of the
16104         operators. 
16105
16106         * driver.cs: use error 5.
16107
16108 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16109
16110         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16111
16112 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16113
16114         * cs-parser.jay (switch_section): A beautiful patch from Martin
16115         Baulig that fixed 33094.
16116
16117 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16118
16119         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16120         Check whether the base is abstract and report an error if so.
16121
16122         * expression.cs (IndexerAccess.DoResolveLValue,
16123         IndexerAccess.DoResolve): ditto. 
16124
16125         (Invocation.DoResolve): ditto.
16126
16127         (Invocation.FullMethodDesc): Improve the report string.
16128
16129         * statement.cs (Block): Eliminate IsVariableDefined as it is
16130         basically just a wrapper for GetVariableInfo.
16131
16132         * ecore.cs (SimpleName): Use new 
16133
16134         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16135         type, as we return the actual parameter ref/unref state on a
16136         different call.
16137
16138 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16139
16140         * support.cs: Return proper flags REF/OUT fixing the previous
16141         commit.  
16142
16143         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16144         not used to mean `ref' but `ref or out' in ParameterReference
16145
16146         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16147         full type signature instead of calling TypeManger.CSharpName
16148         ourselves. 
16149
16150         * support.cs (InternalParameters.ParameterDesc): Do not compare
16151         directly to the modflags, because REF/OUT will actually be bitsets
16152         if set. 
16153
16154         * delegate.cs (VerifyMethod): Check also the modifiers.
16155
16156         * cs-tokenizer.cs: Fix bug where floating point values with an
16157         exponent where a sign was missing was ignored.
16158
16159         * driver.cs: Allow multiple assemblies to be specified in a single
16160         /r: argument
16161
16162 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16163
16164         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16165         because identifiers after a parenthesis would end up in this kind
16166         of production, and we needed to desamiguate it for having casts
16167         like:
16168
16169                 (UserDefinedType *) xxx
16170
16171 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16172
16173         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16174         we should set on the Bindingflags.NonPublic, but not turn on
16175         private_ok.  private_ok controls whether a Private member is
16176         returned (this is chekced on the filter routine), while the
16177         BindingFlags.NonPublic just controls whether private/protected
16178         will be allowed.   This fixes the problem part of the problem of
16179         private properties being allowed to be used in derived classes.
16180
16181         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16182         so we can call the children DoResolveLValue method (this will
16183         properly signal errors on lvalue assignments to base properties)
16184
16185         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16186         getter are null, and we have a property info, we know that this
16187         happened because the lookup failed, so we report an error 122 for
16188         protection level violation.
16189
16190         We also silently return if setter and getter are null in the
16191         resolve functions, this condition only happens if we have flagged
16192         the error before.  This is the other half of the problem. 
16193
16194         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16195         not have accessibility information, that is why we were returning
16196         true in the filter function in typemanager.cs.
16197
16198         To properly report 122 (property is inaccessible because of its
16199         protection level) correctly, we report this error in ResolveAccess
16200         by failing if both the setter and the getter are lacking (ie, the
16201         lookup failed). 
16202
16203         DoResolve and DoLResolve have been modified to check for both
16204         setter/getter being null and returning silently, the reason being
16205         that I did not want to put the knowledge about this error in upper
16206         layers, like:
16207
16208         int old = Report.Errors;
16209         x = new PropertyExpr (...);
16210         if (old != Report.Errors)
16211                 return null;
16212         else
16213                 return x;
16214
16215         So the property expr is returned, but it is invalid, so the error
16216         will be flagged during the resolve process. 
16217
16218         * class.cs: Remove InheritablePropertySignatureCompare from the
16219         class, as we no longer depend on the property signature to compute
16220         whether it is possible to implement a method or not.
16221
16222         The reason is that calling PropertyInfo.GetGetMethod will return
16223         null (in .NET, in Mono it works, and we should change this), in
16224         cases where the Get Method does not exist in that particular
16225         class.
16226
16227         So this code:
16228
16229         class X { public virtual int A { get { return 1; } } }
16230         class Y : X { }
16231         class Z : Y { public override int A { get { return 2; } } }
16232
16233         Would fail in Z because the parent (Y) would not have the property
16234         defined.  So we avoid this completely now (because the alternative
16235         fix was ugly and slow), and we now depend exclusively on the
16236         method names.
16237
16238         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16239         reference method, instead of using the property.
16240
16241         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16242         routines are gone now.
16243
16244         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16245         names, they were incorrectly named.
16246
16247         * cs-tokenizer.cs: Return are more gentle token on failure. 
16248
16249         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16250         had an out-of-sync index variable, which caused it to remove from
16251         the list of pending methods the wrong method sometimes.
16252
16253 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16254
16255         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16256         CanWrite, because those refer to this particular instance of the
16257         property, and do not take into account the fact that we can
16258         override single members of a property.
16259
16260         Constructor requires an EmitContext.  The resolution process does
16261         not happen here, but we need to compute the accessors before,
16262         because the resolution does not always happen for properties.
16263
16264         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16265         subclass, before we did not update this flag, but we did update
16266         bindingflags. 
16267
16268         (GetAccessors): Drop this routine, as it did not work in the
16269         presence of partially overwritten set/get methods. 
16270
16271         Notice that this broke the cs1540 detection, but that will require
16272         more thinking. 
16273
16274 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16275
16276         * class.cs:
16277         * codegen.cs:
16278         * driver.cs: issue a warning instead of an error if we don't support
16279         debugging for the platform. Also ignore a couple of errors that may
16280         arise when trying to write the symbols. Undo my previous patch.
16281
16282 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16283
16284         * driver.cs: ignore /debug switch except for Unix platforms.
16285
16286 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16287
16288         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16289
16290 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16291
16292         * driver.cs: Do not make mcs-debug conditional, so we do not break
16293         builds that use it.
16294
16295         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16296         review this patch.  But basically after all the children variables
16297         have been merged, the value of "Breaks" was not being set to
16298         new_breaks for Switch blocks.  I think that it should be set after
16299         it has executed.  Currently I set this to the value of new_breaks,
16300         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16301         conservative, but I do not understand this code very well.
16302
16303         I did not break anything in the build, so that is good ;-)
16304
16305         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16306
16307 2002-10-20  Mark Crichton  <crichton@gimp.org>
16308
16309         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16310
16311 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16312
16313         * cfold.cs: Fixed compile blocker.
16314
16315 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16316
16317         * driver.cs: I was chekcing the key, not the file.
16318
16319 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16320
16321         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16322         message that we were generating - we just need to silently return
16323         a null.
16324
16325 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16326
16327         * class.cs (Event.Define): Change my previous commit, as this
16328         breaks the debugger.  This is a temporary hack, as it seems like
16329         the compiler is generating events incorrectly to begin with.
16330
16331         * expression.cs (Binary.ResolveOperator): Added support for 
16332         "U operator - (E x, E y)"
16333
16334         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16335         y)".
16336
16337         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16338         init-only variables, but this path did not take into account that
16339         there might be also instance readonly variables.  Correct this
16340         problem. 
16341
16342         This fixes bug 32253
16343
16344         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16345         delegates as well.
16346
16347         * driver.cs: Change the extension for modules to `netmodule'
16348
16349         * cs-parser.jay: Improved slightly the location tracking for
16350         the debugger symbols.
16351
16352         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16353         modifiers that were specified instead of the hardcoded value
16354         (FamAndAssem).  This was basically ignoring the static modifier,
16355         and others.  Fixes 32429.
16356
16357         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16358         fixed a bug in the process (32476)
16359
16360         * expression.cs (ArrayAccess.EmitAssign): Patch from
16361         hwang_rob@yahoo.ca that fixes bug 31834.3
16362
16363 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16364
16365         * driver.cs: Make the module extension .netmodule.
16366
16367 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16368
16369         * driver.cs: Report an error if the resource file is not found
16370         instead of crashing.
16371
16372         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16373         false, like Emit does.
16374
16375 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16376
16377         * typemanager.cs: Remove unused private member.  Also reported mcs
16378         bug to report this as a warning like csc.
16379
16380 2002-10-15  Martin Baulig  <martin@gnome.org>
16381
16382         * statement.cs (Statement.Emit): Made this a virtual method; emits
16383         the line number info and calls DoEmit().
16384         (Statement.DoEmit): New protected abstract method, formerly knows
16385         as Statement.Emit().
16386
16387         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16388
16389 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16390
16391         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16392         have fixed a remaining problem: not every AddXXXX was adding a
16393         fully qualified name.  
16394
16395         Now everyone registers a fully qualified name in the DeclSpace as
16396         being defined instead of the partial name.  
16397
16398         Downsides: we are slower than we need to be due to the excess
16399         copies and the names being registered this way.  
16400
16401         The reason for this is that we currently depend (on the corlib
16402         bootstrap for instance) that types are fully qualified, because
16403         we dump all the types in the namespace, and we should really have
16404         types inserted into the proper namespace, so we can only store the
16405         basenames in the defined_names array.
16406
16407 2002-10-10  Martin Baulig  <martin@gnome.org>
16408
16409         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16410         from bug #31834, see the bug report for a testcase which is
16411         miscompiled.
16412
16413 2002-10-10  Martin Baulig  <martin@gnome.org>
16414
16415         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16416         flow analysis code for this.
16417
16418         * statement.cs (Do, While, For): Tell the flow analysis code about
16419         infinite loops.
16420         (FlowBranching.UsageVector): Added support for infinite loops.
16421         (Block.Resolve): Moved the dead code elimination here and use flow
16422         analysis to do it.
16423
16424 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16425
16426         * class.cs (Field.Define): Catch cycles on struct type
16427         definitions. 
16428
16429         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16430         fields if the fields are static.  We only need to check instance
16431         fields. 
16432
16433         * expression.cs (As.DoResolve): Test for reference type.
16434
16435         * statement.cs (Using.ResolveExpression): Use
16436         ConvertImplicitRequired, not ConvertImplicit which reports an
16437         error on failture
16438         (Using.ResolveLocalVariableDecls): ditto.
16439
16440         * expression.cs (Binary.ResolveOperator): Report errors in a few
16441         places where we had to.
16442
16443         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16444
16445 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16446
16447         * expression.cs: Use StoreFromPtr instead of extracting the type
16448         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16449
16450         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16451         an enumeration value to a System.Enum, but System.Enum is not a
16452         value type, but an class type, so we need to box.
16453
16454         (Expression.ConvertExplicit): One codepath could return
16455         errors but not flag them.  Fix this.  Fixes #31853
16456
16457         * parameter.cs (Resolve): Do not allow void as a parameter type.
16458
16459 2002-10-06  Martin Baulig  <martin@gnome.org>
16460
16461         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16462         if it's a class type and not a struct.  Fixes #31815.
16463
16464 2002-10-06  Martin Baulig  <martin@gnome.org>
16465
16466         * statement.cs: Reworked the flow analysis code a bit to make it
16467         usable for dead code elimination.
16468
16469 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16470
16471         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16472
16473 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16474
16475         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16476         to fix the test 165, will investigate deeper.
16477
16478 2002-10-04  Martin Baulig  <martin@gnome.org>
16479
16480         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16481         finally blocks actually work.
16482         (Try.Resolve): We don't need to create a sibling for `finally' if
16483         there is no finally block.
16484
16485 2002-10-04  Martin Baulig  <martin@gnome.org>
16486
16487         * class.cs (Constructor.Define): The default accessibility for a
16488         non-default constructor is private, not public.
16489
16490 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16491
16492         * class.cs (Constructor): Make AllowedModifiers public, add
16493         EXTERN.
16494
16495         * cs-parser.jay: Perform the modifiers test here, as the
16496         constructor for the Constructor class usually receives a zero
16497         because of the way we create it (first we create, later we
16498         customize, and we were never checking the modifiers).
16499
16500         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16501         is a version of LookupTypeReflection that includes the type-name
16502         cache.  This can be used as a fast path for functions that know
16503         the fully qualified name and are only calling into *.GetType() to
16504         obtain a composed type.
16505
16506         This is also used by TypeManager.LookupType during its type
16507         composition.
16508
16509         (LookupType): We now also track the real type name, as sometimes
16510         we can get a quey for the real type name from things like
16511         ComposedCast.  This fixes bug 31422.
16512
16513         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16514         complete type fullname, it does not have to go through the type
16515         resolution system to obtain the composed version of the type (for
16516         obtaining arrays or pointers).
16517
16518         (Conditional.Emit): Use the EmitBoolExpression to
16519         generate nicer code, as requested by Paolo.
16520
16521         (ArrayCreation.CheckIndices): Use the patch from
16522         hwang_rob@yahoo.ca to validate the array initializers. 
16523
16524 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16525
16526         * class.cs (ConstructorInitializer.Emit): simplify code by using
16527         Invocation.EmitCall, and at the same time, fix the bugs in calling
16528         parent constructors that took variable arguments. 
16529
16530         * ecore.cs (Expression.ConvertNumericExplicit,
16531         Expression.ImplicitNumericConversion): Remove the code that
16532         manually wrapped decimal (InternalTypeConstructor call is now gone
16533         as well).
16534
16535         * expression.cs (Cast.TryReduce): Also handle decimal types when
16536         trying to perform a constant fold on the type.
16537
16538         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16539
16540         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16541         that only turned off an error report, and did nothing else. 
16542
16543 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16544
16545         * driver.cs: Handle and ignore /fullpaths
16546
16547 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16548
16549         * expression.cs (Binary.ResolveOperator): Catch the case where
16550         DoNumericPromotions returns true, 
16551
16552         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16553
16554 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16555
16556         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16557         report error 70.
16558
16559 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16560
16561         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16562         conversion exists, but it is also required that the conversion be
16563         performed.  This manifested in "(Type64Enum) 2".  
16564
16565         * class.cs (TypeManager.AddMethod): The fix is not to change
16566         AddEnum, because that one was using a fully qualified name (every
16567         DeclSpace derivative does), but to change the AddMethod routine
16568         that was using an un-namespaced name.  This now correctly reports
16569         the duplicated name.
16570
16571         Revert patch until I can properly fix it.  The issue
16572         is that we have a shared Type space across all namespaces
16573         currently, which is wrong.
16574
16575         Options include making the Namespace a DeclSpace, and merge
16576         current_namespace/current_container in the parser.
16577
16578 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16579
16580         * cs-parser.jay: Improve error reporting when we get a different
16581         kind of expression in local_variable_type and
16582         local_variable_pointer_type. 
16583
16584         Propagate this to avoid missleading errors being reported.
16585
16586         * ecore.cs (ImplicitReferenceConversion): treat
16587         TypeManager.value_type as a target just like object_type.   As
16588         code like this:
16589
16590         ValueType v = 1;
16591
16592         Is valid, and needs to result in the int 1 being boxed before it
16593         is assigned to the value type v.
16594
16595         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16596         to validate the enumeration name.
16597
16598         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16599         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16600         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16601
16602         * ecore.cs (TryImplicitIntConversion): When doing an
16603         implicit-enumeration-conversion, check if the type is 64-bits and
16604         perform a conversion before passing to EnumConstant.
16605
16606 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16609         report ambiguous type references.  Unlike the MS version, we
16610         report what the ambiguity is.   Innovation at work ;-)
16611
16612         (DeclSpace.FindType): Require a location argument to
16613         display when we display an ambiguous error.
16614
16615         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16616
16617         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16618
16619         * expression.cs (EmitDynamicInitializers): Apply patch from
16620         hwang_rob@yahoo.ca that fixes the order in which we emit our
16621         initializers. 
16622
16623 2002-09-21  Martin Baulig  <martin@gnome.org>
16624
16625         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16626         delegate takes no arguments.
16627
16628 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16629
16630         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16631         from integers.
16632
16633         * expression.cs: Extract the underlying type.
16634
16635         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16636
16637         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16638
16639 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16640
16641         * class.cs (TypeContainer.DefineType): We can not use the nice
16642         PackingSize with the size set to 1 DefineType method, because it
16643         will not allow us to define the interfaces that the struct
16644         implements.
16645
16646         This completes the fixing of bug 27287
16647
16648         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16649         means also structs.  This fixes part of the problem. 
16650         (Expresion.ImplicitReferenceConversionExists): ditto.
16651
16652         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16653         error if there were no errors reported during the type lookup
16654         process, to avoid duplicates or redundant errors.  Without this
16655         you would get an ambiguous errors plus a type not found.  We have
16656         beaten the user enough with the first error.  
16657
16658         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16659         reference. 
16660
16661         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16662         during the resolution process, stop the lookup, this avoids
16663         repeated error reports (same error twice).
16664
16665         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16666
16667         * typemanager.cs (LookupType): Redo the type lookup code to match
16668         the needs of System.Reflection.  
16669
16670         The issue is that System.Reflection requires references to nested
16671         types to begin with a "+" sign instead of a dot.  So toplevel
16672         types look like: "NameSpace.TopLevelClass", and nested ones look
16673         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16674         levels. 
16675
16676 2002-09-19  Martin Baulig  <martin@gnome.org>
16677
16678         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16679         says that a method always returns or always throws an exception,
16680         don't report the CS0161.
16681
16682         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16683         set `Returns = new_returns'.
16684
16685 2002-09-19  Martin Baulig  <martin@gnome.org>
16686
16687         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16688         to an enum constant, check for a CS0176.
16689
16690 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16691
16692         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16693         for operators that must be in pairs and report errors.
16694
16695         * ecore.cs (SimpleName.DoResolveType): During the initial type
16696         resolution process, when we define types recursively, we must
16697         check first for types in our current scope before we perform
16698         lookups in the enclosing scopes.
16699
16700         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16701
16702         (Invocation.VerifyArgumentsCompat): Call
16703         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16704         I thought we were supposed to always call this, but there are a
16705         few places in the code where we dont do it.
16706
16707 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16708
16709         * driver.cs: Add support in -linkres and -resource to specify the
16710         name of the identifier.
16711
16712 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16713
16714         * ecore.cs (StandardConversionExists): Sync with the conversion
16715         code: allow anything-* to void* conversions.
16716
16717         (FindMostSpecificSource): Use an Expression argument
16718         instead of a Type, because we might be handed over a Literal which
16719         gets a few more implicit conversions that plain types do not.  So
16720         this information was being lost.
16721
16722         Also, we drop the temporary type-holder expression when not
16723         required.
16724
16725 2002-09-17  Martin Baulig  <martin@gnome.org>
16726
16727         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16728         this is an explicit interface implementation.
16729
16730 2002-09-17  Martin Baulig  <martin@gnome.org>
16731
16732         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16733         different `IndexerName' attributes.
16734
16735         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16736         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16737         virtual CommonResolve().
16738
16739 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16740
16741         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16742         and convert that to the UnderlyingType.
16743
16744         * statement.cs (Foreach.Resolve): Indexers are just like variables
16745         or PropertyAccesses.
16746
16747         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16748         inside quoted strings, we were not doing this before.
16749
16750 2002-09-16  Martin Baulig  <martin@gnome.org>
16751
16752         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16753         resolve it.  This is needed for the definite assignment check of the
16754         instance expression, fixes bug #29846.
16755         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16756
16757 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16758
16759         * parameter.cs: Fix compile error.  Cannot reference static member
16760         from an instance object.  Is this an mcs bug?
16761
16762 2002-09-14  Martin Baulig  <martin@gnome.org>
16763
16764         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16765         multiple times.  Fixes bug #30295, added test-166.cs.
16766
16767 2002-09-14  Martin Baulig  <martin@gnome.org>
16768
16769         * statement.cs (Block.Emit): Don't emit unreachable code.
16770         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16771         `break' statements.
16772         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16773
16774 2002-09-14  Martin Baulig  <martin@gnome.org>
16775
16776         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16777         is set.
16778
16779 2002-09-14  Martin Baulig  <martin@gnome.org>
16780
16781         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16782         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16783         be false on the ms runtime.
16784
16785 2002-09-13  Martin Baulig  <martin@gnome.org>
16786
16787         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16788         the CS0038 error message.
16789
16790 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16791
16792         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16793         constant inside, return it.
16794
16795 2002-09-12  Martin Baulig  <martin@gnome.org>
16796
16797         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16798         implicit conversion can be done between enum types.
16799
16800         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16801         check whether an implicit conversion to the current enum's UnderlyingType
16802         exists and report an error if not.
16803
16804         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16805         without debugging support.
16806
16807         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16808         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16809
16810 2002-09-12  Martin Baulig  <martin@gnome.org>
16811
16812         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16813
16814         * ecore.cs (IMemberExpr.DeclaringType): New property.
16815         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16816         nonstatic member of an outer type (CS0038).
16817
16818 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16819
16820         * driver.cs: Activate the using-error detector at warning level
16821         4 (at least for MS-compatible APIs).
16822
16823         * namespace.cs (VerifyUsing): Small buglett fix.
16824
16825         * pending.cs (PendingImplementation): pass the container pointer. 
16826
16827         * interface.cs (GetMethods): Allow for recursive definition.  Long
16828         term, I would like to move every type to support recursive
16829         definitions, not the current ordering mechanism that we have right
16830         now.
16831
16832         The situation is this: Attributes are handled before interfaces,
16833         so we can apply attributes to interfaces.  But some attributes
16834         implement interfaces, we will now handle the simple cases
16835         (recursive definitions will just get an error).  
16836
16837         * parameter.cs: Only invalidate types at the end if we fail to
16838         lookup all types.  
16839
16840 2002-09-09  Martin Baulig  <martin@gnome.org>
16841
16842         * ecore.cs (PropertyExpr.Emit): Also check for
16843         TypeManager.system_int_array_get_length so this'll also work when
16844         compiling corlib.  Fixes #30003.
16845
16846 2002-09-09  Martin Baulig  <martin@gnome.org>
16847
16848         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16849         and throw an exception if we can't get the type's size.  Fixed #30040,
16850         added test-165.cs.
16851
16852 2002-09-09  Martin Baulig  <martin@gnome.org>
16853
16854         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16855
16856         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16857         context.  Fixes bug #30027.
16858
16859         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16860         virtual functions.  Fixes bug #30043, added test-164.cs.
16861
16862 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16863
16864         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16865
16866 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16867
16868         * driver.cs: Use an object to get the windows codepage since it's not a
16869         static property.
16870
16871 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16872
16873         * statement.cs (For.Emit): for infinite loops (test == null)
16874         return whether there is a break inside, not always "true".
16875
16876         * namespace.cs (UsingEntry): New struct to hold the name of the
16877         using definition, the location where it is defined, and whether it
16878         has been used in a successful type lookup.
16879
16880         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16881         strings.
16882
16883         * decl.cs: ditto.
16884
16885 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16886
16887         * attribute.cs : Fix incorrect code which relied on catching
16888         a NullReferenceException to detect a null being passed in
16889         where an object was expected.
16890
16891 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16892
16893         * statement.cs (Try): flag the catch variable as assigned
16894
16895         * expression.cs (Cast): Simplified by using ResolveType instead of
16896         manually resolving.
16897
16898         * statement.cs (Catch): Fix bug by using ResolveType.
16899
16900 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16901
16902         * expression.cs (BetterConversion): Special case for when we have
16903         a NullLiteral as the argument and we have to choose between string
16904         and object types - we choose string the way csc does.
16905
16906         * attribute.cs (Attribute.Resolve): Catch the
16907         NullReferenceException and report error #182 since the Mono
16908         runtime no more has the bug and having this exception raised means
16909         we tried to select a constructor which takes an object and is
16910         passed a null.
16911
16912 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16913
16914         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16915         message (1502, 1503) when we can't locate a method after overload
16916         resolution. This is much more informative and closes the bug
16917         Miguel reported.
16918
16919         * interface.cs (PopulateMethod): Return if there are no argument
16920         types. Fixes a NullReferenceException bug.
16921
16922         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16923         expressions too. Previously we were checking only in one place for
16924         positional arguments leaving out named arguments.
16925
16926         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16927         type to the enum type is not allowed. Remove code corresponding to
16928         that.
16929
16930         (ConvertNumericExplicit): Allow explicit conversions from
16931         the underlying type to enum type. This precisely follows the spec
16932         and closes a bug filed by Gonzalo.
16933
16934 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16935
16936         * compiler.csproj:
16937         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16938
16939 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16940
16941         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16942         it was important that we stored the right value after the
16943         reduction in `converted'.
16944
16945 2002-09-04  Martin Baulig  <martin@gnome.org>
16946
16947         * location.cs (Location.SymbolDocument): Use full pathnames for the
16948         source files.
16949
16950 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16953         of the expression resolve mechanism, because that will catch the
16954         SimpleName error failures.
16955
16956         (Conditional): If we can not resolve the
16957         expression, return, do not crash.
16958
16959 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16960
16961         * cs-tokenizer.cs:
16962         (location): display token name instead of its number.
16963
16964 2002-08-28  Martin Baulig  <martin@gnome.org>
16965
16966         * expression.cs (Binary.ResolveOperator): Don't silently return
16967         but return an error if an operator cannot be applied between two
16968         enum types.
16969
16970 2002-08-28  Martin Baulig  <martin@gnome.org>
16971
16972         * class.cs (Constructor.Define): Set the permission attributes
16973         correctly instead of making all constructors public.
16974
16975 2002-08-28  Martin Baulig  <martin@gnome.org>
16976
16977         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16978         for private members before reporting a CS0103; if we find anything,
16979         it's a CS0122.
16980
16981 2002-08-28  Martin Baulig  <martin@gnome.org>
16982
16983         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16984         to check whether `closure_start_type == closure_invocation_type',
16985         we also need to check whether `m.DeclaringType == closure_invocation_type'
16986         before bypassing the permission checks.  We might be accessing
16987         protected/private members from the base class.
16988         (TypeManager.RealMemberLookup): Only set private_ok if private
16989         members were requested via BindingFlags.NonPublic.
16990
16991         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16992
16993         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16994         MethodGroupExpr.IsExplicitImpl if appropriate.
16995         (Invocation.DoResolve): Don't report the CS0120 for explicit
16996         interface implementations.
16997
16998 2002-08-27  Martin Baulig  <martin@gnome.org>
16999
17000         * expression.cs (Invocation.DoResolve): If this is a static
17001         method and we don't have an InstanceExpression, we must report
17002         a CS0120.
17003
17004 2002-08-25  Martin Baulig  <martin@gnome.org>
17005
17006         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17007         `==' between a valuetype and an object.
17008
17009 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17010
17011         * ecore.cs (TypeExpr): Provide a ToString method.
17012
17013 2002-08-24  Martin Baulig  <martin@gnome.org>
17014
17015         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17016         now called proggie.dbg and it's a binary file.
17017
17018 2002-08-23  Martin Baulig  <martin@gnome.org>
17019
17020         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17021
17022 2002-08-23  Martin Baulig  <martin@gnome.org>
17023
17024         * struct.cs (MyStructInfo.ctor): Make this work with empty
17025         structs; it's not allowed to use foreach() on null.
17026
17027 2002-08-23  Martin Baulig  <martin@gnome.org>
17028
17029         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17030         writer the full pathname of the generated assembly.
17031
17032 2002-08-23  Martin Baulig  <martin@gnome.org>
17033
17034         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17035         A `finally' block never returns or breaks; improved handling of
17036         unreachable code.
17037
17038 2002-08-23  Martin Baulig  <martin@gnome.org>
17039
17040         * statement.cs (Throw.Resolve): Allow `throw null'.
17041
17042 2002-08-23  Martin Baulig  <martin@gnome.org>
17043
17044         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17045         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17046         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17047         MemberLookup would return a wrong event if this is an explicit
17048         interface implementation and the class has an event with the same
17049         name.
17050
17051 2002-08-23  Martin Baulig  <martin@gnome.org>
17052
17053         * statement.cs (Block.AddChildVariableNames): New public method.
17054         (Block.AddChildVariableName): Likewise.
17055         (Block.IsVariableNameUsedInChildBlock): Likewise.
17056         (Block.AddVariable): Check whether a variable name has already
17057         been used in a child block.
17058
17059         * cs-parser.jay (declare_local_variables): Mark all variable names
17060         from the current block as being used in a child block in the
17061         implicit block.
17062
17063 2002-08-23  Martin Baulig  <martin@gnome.org>
17064
17065         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17066         find the symbol writer.
17067
17068         * driver.cs: csc also allows the arguments to /define being
17069         separated by commas, not only by semicolons.
17070
17071 2002-08-23  Martin Baulig  <martin@gnome.org>
17072
17073         * interface.cs (Interface.GetMembers): Added static check for events.
17074
17075 2002-08-15  Martin Baulig  <martin@gnome.org>
17076
17077         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17078         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17079
17080         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17081         why the MethodData.EmitDestructor() change was necessary.
17082
17083 2002-08-20  Martin Baulig  <martin@gnome.org>
17084
17085         * class.cs (TypeContainer.FindMembers): Added static check for events.
17086
17087         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17088
17089         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17090         use Type.GetEvents(), not Type.FindMembers().
17091
17092 2002-08-20  Martin Baulig  <martin@gnome.org>
17093
17094         * decl.cs (MemberCache): Added a special method cache which will
17095         be used for method-only searched.  This ensures that a method
17096         search will return a MethodInfo with the correct ReflectedType for
17097         inherited methods.      
17098
17099 2002-08-20  Martin Baulig  <martin@gnome.org>
17100
17101         * decl.cs (DeclSpace.FindMembers): Made this public.
17102
17103 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17104
17105         * delegate.cs: fixed build on windows.
17106         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17107
17108 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17109
17110         * ecore.cs (StandardConversionExists): Return a false
17111         if we are trying to convert the void type to anything else
17112         since that is not allowed.
17113
17114         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17115         we flag error 70 in the event an event is trying to be accessed
17116         directly from outside the declaring type.
17117
17118 2002-08-20  Martin Baulig  <martin@gnome.org>
17119
17120         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17121         MemberCache from typemanager.cs to decl.cs.
17122
17123 2002-08-19  Martin Baulig  <martin@gnome.org>
17124
17125         * class.cs (TypeContainer): Implement IMemberContainer.
17126         (TypeContainer.DefineMembers): Create the MemberCache.
17127         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17128         return public members if BindingFlags.Public was given, check
17129         whether members are static.
17130
17131 2002-08-16  Martin Baulig  <martin@gnome.org>
17132
17133         * decl.cs (DeclSpace.Define): Splitted this in Define and
17134         DefineMembers.  DefineMembers is called first and initializes the
17135         MemberCache.
17136
17137         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17138         DefineMembers() on all our DeclSpaces.
17139
17140         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17141         but call DefineMembers() on all nested interfaces.  We call their
17142         Define() in our new Define() function.
17143
17144         * interface.cs (Interface): Implement IMemberContainer.
17145         (Interface.Define): Moved all code except the attribute stuf to
17146         DefineMembers().
17147         (Interface.DefineMembers): Initialize the member cache.
17148
17149         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17150         need this anymore since we can use MemberCache.FindMembers directly.
17151
17152 2002-08-19  Martin Baulig  <martin@gnome.org>
17153
17154         * typemanager.cs (MemberCache): When creating the cache for an
17155         interface type, add all inherited members.
17156         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17157         to `out bool used_cache' and documented it.
17158         (TypeManager.MemberLookup): If we already used the cache in the first
17159         iteration, we don't need to do the interfaces check.
17160
17161 2002-08-19  Martin Baulig  <martin@gnome.org>
17162
17163         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17164         here from IMemberFinder and don't implement this interface anymore.
17165         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17166
17167         * typemanager.cs (IMemberFinder): This interface is now only used by
17168         classes which actually support the member cache.
17169         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17170         since we only put DeclSpaces into this Hashtable.
17171         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17172         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17173
17174 2002-08-16  Martin Baulig  <martin@gnome.org>
17175
17176         * typemanager.cs (ICachingMemberFinder): Removed.
17177         (IMemberFinder.MemberCache): New property.
17178         (TypeManager.FindMembers): Merged this with RealFindMembers().
17179         This function will never be called from TypeManager.MemberLookup()
17180         so we can't use the cache here, just the IMemberFinder.
17181         (TypeManager.MemberLookup_FindMembers): Check whether the
17182         IMemberFinder has a MemberCache and call the cache's FindMembers
17183         function.
17184         (MemberCache): Rewrote larger parts of this yet another time and
17185         cleaned it up a bit.
17186
17187 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17188
17189         * driver.cs (LoadArgs): Support quoting.
17190
17191         (Usage): Show the CSC-like command line arguments.
17192
17193         Improved a few error messages.
17194
17195 2002-08-15  Martin Baulig  <martin@gnome.org>
17196
17197         * typemanager.cs (IMemberContainer.Type): New property.
17198         (IMemberContainer.IsInterface): New property.
17199
17200         The following changes are conditional to BROKEN_RUNTIME, which is
17201         defined at the top of the file.
17202
17203         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17204         class'es members, but add all members from TypeHandle.ObjectType
17205         if we're an interface.
17206         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17207         is the current type.
17208         (MemberCache.CacheEntry.Container): Removed this field.
17209         (TypeHandle.GetMembers): Include inherited members.
17210
17211 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17212
17213         * typemanager.cs: fixed compilation and added a comment on a field that
17214         is never used.
17215
17216 2002-08-15  Martin Baulig  <martin@gnome.org>
17217
17218         * class.cs (ConstructorInitializer.Resolve): In the
17219         Expression.MemberLookup call, use the queried_type as
17220         invocation_type.
17221
17222         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17223         declared' attribute, it's always true.
17224         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17225         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17226         temporary wrapper for FindMembers which tells MemberLookup whether
17227         members from the base classes are included in the return value.
17228         This will go away soon.
17229         (TypeManager.MemberLookup): Use this temporary hack here; once the
17230         new MemberCache is completed, we don't need to do the DeclaredOnly
17231         looping here anymore since the MemberCache will take care of this.
17232         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17233         (MemberCache): When creating the MemberCache for a class, get
17234         members from the current class and all its base classes.
17235         (MemberCache.CacheEntry.Container): New field.  This is a
17236         temporary hack until the Mono runtime is fixed to distinguish
17237         between ReflectedType and DeclaringType.  It allows us to use MCS
17238         with both the MS runtime and the unfixed Mono runtime without
17239         problems and without accecting performance.
17240         (MemberCache.SearchMembers): The DeclaredOnly looping from
17241         TypeManager.MemberLookup is now done here.      
17242
17243 2002-08-14  Martin Baulig  <martin@gnome.org>
17244
17245         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17246         Type.GetFields on dynamic types but get the fields from the
17247         corresponding TypeContainer.
17248         (MyStructInfo.GetStructInfo): Added check for enum types.
17249
17250         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17251         (MemberList.SyncRoot): Implemented.
17252         (TypeManager.FilterWithClosure): No need to check permissions if
17253         closure_start_type == closure_invocation_type, don't crash if
17254         closure_invocation_type is null.
17255
17256 2002-08-13  Martin Baulig  <martin@gnome.org>
17257
17258         Rewrote TypeContainer.FindMembers to use a member cache.  This
17259         gives us a speed increase of about 35% for the self-hosting MCS
17260         build and of about 15-20% for the class libs (both on GNU/Linux).
17261
17262         * report.cs (Timer): New class to get enhanced profiling.  This
17263         whole class is "TIMER" conditional since it remarkably slows down
17264         compilation speed.
17265
17266         * class.cs (MemberList): New class.  This is an IList wrapper
17267         which we're now using instead of passing MemberInfo[]'s around to
17268         avoid copying this array unnecessarily.
17269         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17270         (ICachingMemberFinder, IMemberContainer): New interface.
17271         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17272         has already been checked, otherwise use it for the name comparision.
17273         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17274         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17275         if possible.  Returns a MemberList, not a MemberInfo [].
17276         (TypeHandle): New class, implements IMemberContainer.  We create
17277         one instance of this class per type, it contains a MemberCache
17278         which is used to do the member lookups.
17279         (MemberCache): New class.  Each instance of this class contains
17280         all members of a type and a name-based hash table.
17281         (MemberCache.FindMembers): This is our new member lookup
17282         function.  First, it looks up all members of the requested name in
17283         the hash table.  Then, it walks this list and sorts out all
17284         applicable members and returns them.
17285
17286 2002-08-13  Martin Baulig  <martin@gnome.org>
17287
17288         In addition to a nice code cleanup, this gives us a performance
17289         increase of about 1.4% on GNU/Linux - not much, but it's already
17290         half a second for the self-hosting MCS compilation.
17291
17292         * typemanager.cs (IMemberFinder): New interface.  It is used by
17293         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17294         Enum, Delegate or Interface.
17295         (TypeManager.finder_to_member_finder): New PtrHashtable.
17296         (TypeManager.finder_to_container): Removed.
17297         (TypeManager.finder_to_delegate): Removed.
17298         (TypeManager.finder_to_interface): Removed.
17299         (TypeManager.finder_to_enum): Removed.
17300
17301         * interface.cs (Interface): Implement IMemberFinder.
17302
17303         * delegate.cs (Delegate): Implement IMemberFinder.
17304
17305         * enum.cs (Enum): Implement IMemberFinder.
17306
17307         * class.cs (TypeContainer): Implement IMemberFinder.
17308
17309 2002-08-12  Martin Baulig  <martin@gnome.org>
17310
17311         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17312
17313 2002-08-12  Martin Baulig  <martin@gnome.org>
17314
17315         * ecore.cs (ITypeExpression): New interface for expressions which
17316         resolve to a type.
17317         (TypeExpression): Renamed to TypeLookupExpression.
17318         (Expression.DoResolve): If we're doing a types-only lookup, the
17319         expression must implement the ITypeExpression interface and we
17320         call DoResolveType() on it.
17321         (SimpleName): Implement the new ITypeExpression interface.
17322         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17323         hack, the situation that we're only looking up types can't happen
17324         anymore when this method is called.  Moved the type lookup code to
17325         DoResolveType() and call it.
17326         (SimpleName.DoResolveType): This ITypeExpression interface method
17327         is now doing the types-only lookup.
17328         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17329         (ResolveFlags): Added MaskExprClass.
17330
17331         * expression.cs (MemberAccess): Implement the ITypeExpression
17332         interface.
17333         (MemberAccess.DoResolve): Added support for a types-only lookup
17334         when we're called via ITypeExpression.DoResolveType().
17335         (ComposedCast): Implement the ITypeExpression interface.
17336
17337         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17338         Expression.Resolve() with ResolveFlags.Type instead.
17339
17340 2002-08-12  Martin Baulig  <martin@gnome.org>
17341
17342         * interface.cs (Interface.Define): Apply attributes.
17343
17344         * attribute.cs (Attribute.ApplyAttributes): Added support for
17345         interface attributes.
17346
17347 2002-08-11  Martin Baulig  <martin@gnome.org>
17348
17349         * statement.cs (Block.Emit): Only check the "this" variable if we
17350         do not always throw an exception.
17351
17352         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17353         whether the property has a set accessor.
17354
17355 2002-08-11  Martin Baulig  <martin@gnome.org>
17356
17357         Added control flow analysis support for structs.
17358
17359         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17360         with control flow analysis turned off.
17361         (IVariable): New interface.
17362         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17363         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17364         (FieldExpr.DoResolve): Resolve the instance expression with flow
17365         analysis turned off and do the definite assignment check after the
17366         resolving when we know what the expression will resolve to.
17367
17368         * expression.cs (LocalVariableReference, ParameterReference):
17369         Implement the new IVariable interface, only call the flow analysis
17370         code if ec.DoFlowAnalysis is true.
17371         (This): Added constructor which takes a Block argument.  Implement
17372         the new IVariable interface.
17373         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17374         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17375         This does the definite assignment checks for struct members.
17376
17377         * class.cs (Constructor.Emit): If this is a non-static `struct'
17378         constructor which doesn't have any initializer, call
17379         Block.AddThisVariable() to tell the flow analysis code that all
17380         struct elements must be initialized before control returns from
17381         the constructor.
17382
17383         * statement.cs (MyStructInfo): New public class.
17384         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17385         argument to this indexer.  If non-zero, check an individual struct
17386         member, not the whole struct.
17387         (FlowBranching.CheckOutParameters): Check struct members.
17388         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17389         overloaded versions of these methods which take an additional
17390         `int field_idx' argument to check struct members.
17391         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17392         overloaded versions of these methods which take an additional
17393         `string field_name' argument to check struct member.s
17394         (VariableInfo): Implement the IVariable interface.
17395         (VariableInfo.StructInfo): New public property.  Returns the
17396         MyStructInfo instance of the variable if it's a struct or null.
17397         (Block.AddThisVariable): New public method.  This is called from
17398         Constructor.Emit() for non-static `struct' constructor which do
17399         not have any initializer.  It creates a special variable for the
17400         "this" instance variable which will be checked by the flow
17401         analysis code to ensure that all of the struct's fields are
17402         initialized before control returns from the constructor.
17403         (UsageVector): Added support for struct members.  If a
17404         variable/parameter is a struct with N members, we reserve a slot
17405         in the usage vector for each member.  A struct is considered fully
17406         initialized if either the struct itself (slot 0) or all its
17407         members are initialized.
17408
17409 2002-08-08  Martin Baulig  <martin@gnome.org>
17410
17411         * driver.cs (Driver.MainDriver): Only report an error CS5001
17412         if there were no compilation errors.
17413
17414         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17415         `UnsafeContext' property to determine whether the parent is in
17416         unsafe context rather than checking the parent's ModFlags:
17417         classes nested in an unsafe class are unsafe as well.
17418
17419 2002-08-08  Martin Baulig  <martin@gnome.org>
17420
17421         * statement.cs (UsageVector.MergeChildren): Distinguish between
17422         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17423         we return.  Added test17() and test18() to test-154.cs.
17424
17425 2002-08-08  Martin Baulig  <martin@gnome.org>
17426
17427         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17428         Family access, make sure the invoking type isn't a subclass of the
17429         queried type (that'd be a CS1540).
17430
17431         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17432         this method which takes an additional `Type invocation_type'.
17433
17434         * expression.cs (BaseAccess.DoResolve): Use the base type as
17435         invocation and query type.
17436         (MemberAccess.DoResolve): If the lookup failed and we're about to
17437         report a CS0122, try a lookup with the ec.ContainerType - if this
17438         succeeds, we must report a CS1540.
17439
17440 2002-08-08  Martin Baulig  <martin@gnome.org>
17441
17442         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17443         (MethodGroupExpr): Implement the IMemberExpr interface.
17444
17445         * expression (MemberAccess.ResolveMemberAccess): No need to have
17446         any special code for MethodGroupExprs anymore, they're now
17447         IMemberExprs.   
17448
17449 2002-08-08  Martin Baulig  <martin@gnome.org>
17450
17451         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17452         Family, FamANDAssem and FamORAssem permissions.
17453         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17454
17455 2002-08-08  Martin Baulig  <martin@gnome.org>
17456
17457         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17458         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17459         or loop block.
17460
17461 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17462
17463         * driver.cs: implemented /resource option to embed managed resources.
17464
17465 2002-08-07  Martin Baulig  <martin@gnome.org>
17466
17467         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17468         (FieldBase.HasFieldInitializer): New public property.
17469         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17470         returns the field initializer and makes sure it is only resolved once.
17471         (TypeContainer.EmitFieldInitializers): Call
17472         FieldBase.GetInitializerExpression to get the initializer, this ensures
17473         that it isn't resolved multiple times.
17474
17475         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17476         the resolving process (SimpleName/MemberLookup) that we're currently
17477         emitting a field initializer (which must not access any instance members,
17478         this is an error CS0236).
17479
17480         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17481         argument, if the `IsFieldInitializer' flag is set, we must report and
17482         error CS0236 and not an error CS0120.   
17483
17484 2002-08-07  Martin Baulig  <martin@gnome.org>
17485
17486         * ecore.cs (IMemberExpr): New public interface.
17487         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17488         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17489         if the expression is an IMemberExpr.
17490
17491         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17492         to be null, implicitly default to `this' if we're non-static in
17493         this case.  Simplified the code a lot by using the new IMemberExpr
17494         interface.  Also fixed bug #28176 here.
17495
17496 2002-08-06  Martin Baulig  <martin@gnome.org>
17497
17498         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17499         ParameterReferences during semantic analysis so that we can do a
17500         type-only search when resolving Cast, TypeOf and SizeOf.
17501         (block): Pass the `current_local_parameters' to the Block's
17502         constructor.
17503
17504         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17505         argument to the constructor.
17506         (ConstructorInitializer.Resolve): Create a temporary implicit
17507         block with the parameters.
17508
17509         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17510         references here if we aren't doing a type-only search.
17511
17512         * statement.cs (Block): Added constructor which takes a
17513         `Parameters parameters' argument.
17514         (Block.Parameters): New public property.
17515
17516         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17517         to `Parameters' and made it public readonly.
17518
17519 2002-08-06  Martin Baulig  <martin@gnome.org>
17520
17521         * ecore.cs (Expression.Warning): Made this public as well.
17522
17523         * report.cs (Report.Debug): Print the contents of collections.
17524
17525 2002-08-06  Martin Baulig  <martin@gnome.org>
17526
17527         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17528         used to tell Resolve() which kinds of expressions it may return.
17529         (Expression.Resolve): Added overloaded version of this method which
17530         takes a `ResolveFlags flags' argument.  This can be used to tell
17531         Resolve() which kinds of expressions it may return.  Reports a
17532         CS0118 on error.
17533         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17534         ResolveFlags.SimpleName.
17535         (Expression.Error118): Added overloaded version of this method which
17536         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17537         which kinds of expressions are allowed.
17538
17539         * expression.cs (Argument.ResolveMethodGroup): New public method.
17540         Resolves an argument, but allows a MethodGroup to be returned.
17541         This is used when invoking a delegate.
17542
17543         * TODO: Updated a bit.
17544
17545 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17546
17547         Fixed compilation with csc.
17548
17549         * ecore.cs: Expression.Error made public. Is this correct? Should
17550         Warning be made public too?
17551
17552         * expression.cs: use ea.Location instead of ea.loc.
17553         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17554
17555 2002-08-06  Martin Baulig  <martin@gnome.org>
17556
17557         * ecore.cs (Expression.loc): Moved the location here instead of
17558         duplicating it in all derived classes.
17559         (Expression.Location): New public property.
17560         (Expression.Error, Expression.Warning): Made them non-static and
17561         removed the location argument.
17562         (Expression.Warning): Added overloaded version which takes an
17563         `int level' argument.
17564         (Expression.Error118): Make this non-static and removed the
17565         expression and location arguments.
17566         (TypeExpr): Added location argument to the constructor.
17567
17568         * expression.cs (StaticCallExpr): Added location argument to
17569         the constructor.
17570         (Indirection, PointerArithmetic): Likewise.
17571         (CheckedExpr, UnCheckedExpr): Likewise.
17572         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17573         (StringPtr): Likewise.
17574
17575
17576 2002-08-05  Martin Baulig  <martin@gnome.org>
17577
17578         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17579
17580         * assign.cs (Assign.DoResolve): Check whether the source
17581         expression is a value or variable.
17582
17583         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17584         while resolving the corresponding blocks.
17585
17586         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17587         an error, don't silently return null.
17588
17589         * statement.cs (Block.AddVariable): Do the error reporting here
17590         and distinguish between CS0128 and CS0136.
17591         (Block.DoResolve): Report all unused labels (warning CS0164).
17592         (LabeledStatement): Pass the location to the constructor.
17593         (LabeledStatement.HasBeenReferenced): New property.
17594         (LabeledStatement.Resolve): Set it to true here.
17595
17596         * statement.cs (Return.Emit): Return success even after reporting
17597         a type mismatch error (CS0126 or CS0127), this is what csc does and
17598         it avoids confusing the users with any consecutive errors.
17599
17600 2002-08-05  Martin Baulig  <martin@gnome.org>
17601
17602         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17603
17604         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17605
17606         * expression.cs (MemberAccess.DoResolve): Silently return if an
17607         error has already been reported.
17608
17609         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17610         error has already been reported.
17611
17612 2002-08-05  Martin Baulig  <martin@gnome.org>
17613
17614         * statement.cs (UsageVector): Only initialize the `parameters'
17615         vector if we actually have any "out" parameters.
17616
17617 2002-08-05  Martin Baulig  <martin@gnome.org>
17618
17619         * expression.cs (Binary.ResolveOperator): When combining delegates,
17620         they must have the same type.
17621
17622 2002-08-05  Martin Baulig  <martin@gnome.org>
17623
17624         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17625         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17626         work with the ms runtime and we also don't need it: if we're a
17627         PropertyBuilder and not in the `indexer_arguments' hash, then we
17628         are a property and not an indexer.
17629
17630         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17631         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17632         since the latter one doesn't work with the ms runtime.
17633
17634 2002-08-03  Martin Baulig  <martin@gnome.org>
17635
17636         Fixed bugs #27998 and #22735.
17637
17638         * class.cs (Method.IsOperator): New public field.
17639         (Method.CheckBase): Report CS0111 if there's already a method
17640         with the same parameters in the current class.  Report CS0508 when
17641         attempting to change the return type of an inherited method.
17642         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17643         and it's not marked abstract or extern.
17644         (PropertyBase): New abstract base class for Property and Indexer.
17645         (PropertyBase.CheckBase): Moved here from Property and made it work
17646         for indexers.
17647         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17648         the same so we can reuse it there.
17649         (Property, Indexer): Derive from PropertyBase.
17650         (MethodSignature.inheritable_property_signature_filter): New delegate
17651         to find properties and indexers.
17652
17653         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17654         argument and improved error reporting.
17655
17656         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17657         EmptyReadOnlyParameters and made it a property.
17658
17659         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17660         version of this method which takes a `PropertyInfo indexer'.
17661         (TypeManager.RegisterIndexer): New method.
17662
17663         * class.cs: Added myself as author of this file :-)
17664
17665 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17666
17667         * class.cs: fixed compilation on windoze.
17668
17669 2002-08-03  Martin Baulig  <martin@gnome.org>
17670
17671         * interface.cs (Interface.GetInterfaceBases): Check whether all
17672         base interfaces are at least as accessible than the current one.
17673
17674         * class.cs (TypeContainer.GetClassBases): Check whether base types
17675         are at least as accessible than the current type.
17676         (TypeContainer.AsAccessible): Implemented and made non-static.
17677         (MemberBase.CheckParameters): Report errors if the accessibility
17678         checks fail.
17679
17680         * delegate.cs (Delegate.Delegate): The default visibility is
17681         internal for top-level types and private for nested types.
17682         (Delegate.Define): Report errors if the accessibility checks fail.
17683
17684         * enum.cs (Enum.Enum): The default visibility is internal for
17685         top-level types and private for nested types.
17686         (Enum.DefineType): Compute the correct visibility.
17687
17688         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17689         function which takes a `bool is_toplevel' instead of a TypeContainer.
17690
17691         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17692         builtin type.
17693
17694 2002-08-02  Martin Baulig  <martin@gnome.org>
17695
17696         * expression.cs (LocalVariableReferenc): Added constructor which
17697         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17698         (LocalVariableReference.IsReadOnly): New property.
17699         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17700         variable is readonly, use our own readonly flag to do this; you can
17701         use the new constructor to get a writable reference to a read-only
17702         variable.
17703
17704         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17705         reference to the local variable.
17706
17707 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17708
17709         * rootcontext.cs (ResolveCore): Also include System.Exception
17710
17711         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17712         we reach an EmptyStatement.
17713
17714         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17715         is also fine.
17716
17717         * expression.cs (Binary.ResolveOperator): Check error result in
17718         two places.
17719
17720         use brtrue/brfalse directly and avoid compares to null.
17721
17722 2002-08-02  Martin Baulig  <martin@gnome.org>
17723
17724         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17725         Fixes bug #28407, added test-155.cs.
17726
17727 2002-08-01  Martin Baulig  <martin@gnome.org>
17728
17729         * class.cs (Event.EmitDefaultMethod): Make this work with static
17730         events.  Fixes #28311, added verify-3.cs.
17731
17732 2002-08-01  Martin Baulig  <martin@gnome.org>
17733
17734         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17735         `is_disposable' fields.
17736         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17737         `hm.is_disposable' if we're using the collection pattern.
17738         (Foreach.EmitCollectionForeach): Use the correct type for the
17739         enumerator's local variable, only emit the try/finally block if
17740         necessary (fixes #27713).
17741
17742 2002-08-01  Martin Baulig  <martin@gnome.org>
17743
17744         * ecore.cs (Expression.report118): Renamed to Error118 and made
17745         it public static.
17746
17747         * statement.cs (Throw.Resolve): Check whether the expression is of
17748         the correct type (CS0118) and whether the type derives from
17749         System.Exception (CS0155).
17750         (Catch.Resolve): New method.  Do the type lookup here and check
17751         whether it derives from System.Exception (CS0155).
17752         (Catch.CatchType, Catch.IsGeneral): New public properties.
17753
17754         * typemanager.cs (TypeManager.exception_type): Added.
17755
17756 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17757
17758         * driver.cs: Updated About function.
17759
17760 2002-07-31  Martin Baulig  <martin@gnome.org>
17761
17762         Implemented Control Flow Analysis.
17763
17764         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17765         (EmitContext.CurrentBranching): Added.
17766         (EmitContext.StartFlowBranching): Added.
17767         (EmitContext.EndFlowBranching): Added.
17768         (EmitContext.KillFlowBranching): Added.
17769         (EmitContext.IsVariableAssigned): Added.
17770         (EmitContext.SetVariableAssigned): Added.
17771         (EmitContext.IsParameterAssigned): Added.
17772         (EmitContext.SetParameterAssigned): Added.
17773         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17774         Added control flow analysis stuff here.
17775
17776         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17777         resolve the expression as lvalue.
17778         (LocalVariableReference.DoResolve): Check whether the variable has
17779         already been assigned.
17780         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17781         the parameter as assigned here.
17782         (ParameterReference.DoResolve): Check whether the parameter has already
17783         been assigned.
17784         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17785         expression as lvalue.
17786
17787         * statement.cs (FlowBranching): New class for the flow analysis code.
17788         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17789         (LabeledStatement.IsDefined): New public property.
17790         (LabeledStatement.AddUsageVector): New public method to tell flow
17791         analyis that the label may be reached via a forward jump.
17792         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17793         flow analysis.
17794         (VariableInfo.Number): New public field.  This is used by flow analysis
17795         to number all locals of a block.
17796         (Block.CountVariables): New public property.  This is the number of
17797         local variables in this block (including the locals from all parent
17798         blocks).
17799         (Block.EmitMeta): Number all the variables.
17800
17801         * statement.cs: Added flow analysis support to all classes.
17802
17803 2002-07-31  Martin Baulig  <martin@gnome.org>
17804
17805         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17806         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17807         then use this argument.
17808
17809         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17810
17811         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17812         use this to specify /define options.
17813
17814 2002-07-29  Martin Baulig  <martin@gnome.org>
17815
17816         * statement.cs (Fixed): Moved all code that does variable lookups
17817         and resolvings from Emit to Resolve.
17818
17819         * statement.cs (For): Moved all code that does variable lookups
17820         and resolvings from Emit to Resolve.
17821
17822         * statement.cs (Using): Moved all code that does variable lookups
17823         and resolvings from Emit to Resolve.
17824
17825 2002-07-29  Martin Baulig  <martin@gnome.org>
17826
17827         * attribute.cs (Attribute.Resolve): Explicitly catch a
17828         System.NullReferenceException when creating the
17829         CustromAttributeBuilder and report a different warning message.
17830
17831 2002-07-29  Martin Baulig  <martin@gnome.org>
17832
17833         * support.cs (ParameterData.ParameterName): Added method to
17834         get the name of a parameter.
17835
17836         * typemanager.cs (TypeManager.IsValueType): New public method.
17837
17838 2002-07-29  Martin Baulig  <martin@gnome.org>
17839
17840         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17841         is a flag which specifies that it's either ref or out.
17842         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17843         the out parameter to `out Parameter.Modifier mod', also set the
17844         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17845
17846         * support.cs (InternalParameters.ParameterModifier): Distinguish
17847         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17848         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17849
17850         * expression.cs (Argument.GetParameterModifier): Distinguish
17851         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17852         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17853
17854 2002-07-29  Martin Baulig  <martin@gnome.org>
17855
17856         * expression.cs (ParameterReference.ParameterReference): Added
17857         `Location loc' argument to the constructor.
17858
17859         * cs-parser.jay: Pass location to ParameterReference.
17860
17861 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17862
17863         * statement.cs (Try): Initialize the location.
17864
17865         * cs-parser.jay: pass location to Try.
17866
17867         * expression.cs (Unary.Reduce): Change the prototype to return
17868         whether a constant fold could be performed or not.  The result is
17869         returned in an out parameters.  In the case of Indirection and
17870         AddressOf, we want to perform the full tests.
17871
17872 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17873
17874         * statement.cs (Statement.Emit): Flag dead code.
17875
17876 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17877
17878         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17879
17880 2002-07-27  Martin Baulig  <martin@gnome.org>
17881
17882         * class.cs (MethodData.Define): Put back call to
17883         TypeManager.AddMethod(), accidentally commented this out.
17884
17885         * report.cs (Debug): New public method to print debugging information,
17886         this is `[Conditional ("DEBUG")]'.
17887
17888 2002-07-26  Martin Baulig  <martin@gnome.org>
17889
17890         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17891         (switch_statement): Push the current_block to the switch_stack and
17892         pop it again when we're done with the switch.
17893         (switch_section): The new block is a child of the current_block.
17894         Fixes bug #24007, added test-152.cs.
17895
17896 2002-07-27  Martin Baulig  <martin@gnome.org>
17897
17898         * expression.cs (Invocation.EmitArguments): When calling a varargs
17899         function with only its fixed arguments, we need to pass an empty
17900         array.
17901
17902 2002-07-27  Martin Baulig  <martin@gnome.org>
17903
17904         Mono 0.13 has been released.
17905
17906 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17907
17908         * driver.cs: Rename --resource to --linkres, because that is what
17909         we do currently, we dont support --resource yet.
17910
17911         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17912
17913 2002-07-25  Martin Baulig  <martin@gnome.org>
17914
17915         * class.cs (MethodData): New public class.  This is a `method builder'
17916         class for a method or one accessor of a Property/Indexer/Event.
17917         (MethodData.GetMethodFlags): Moved here from MemberBase.
17918         (MethodData.ApplyAttributes): Likewise.
17919         (MethodData.ApplyObsoleteAttribute): Likewise.
17920         (MethodData.ApplyConditionalAttribute): Likewise.
17921         (MethodData.ApplyDllImportAttribute): Likewise.
17922         (MethodData.CheckAbstractAndExternal): Likewise.
17923         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17924         (MethodData.Emit): Formerly known as Method.Emit().
17925         (MemberBase): Moved everything which was specific to a single
17926         accessor/method to MethodData.
17927         (Method): Create a new MethodData and call Define() and Emit() on it.
17928         (Property, Indexer, Event): Create a new MethodData objects for each
17929         accessor and call Define() and Emit() on them.
17930
17931 2002-07-25  Martin Baulig  <martin@gnome.org>
17932
17933         Made MethodCore derive from MemberBase to reuse the code from there.
17934         MemberBase now also checks for attributes.
17935
17936         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17937         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17938         as virtual.
17939         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17940         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17941         (MemberBase.ApplyAttributes): New virtual method; applies the
17942         attributes to a method or accessor.
17943         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17944         (MemberBase.ApplyConditionalAttribute): Likewise.
17945         (MemberBase.ApplyDllImportAttribute): Likewise.
17946         (MemberBase.CheckAbstractAndExternal): Likewise.
17947         (MethodCore.ParameterTypes): This is now a property instead of a
17948         method, it's initialized from DoDefineParameters().
17949         (MethodCore.ParameterInfo): Removed the set accessor.
17950         (MethodCore.DoDefineParameters): New protected virtual method to
17951         initialize ParameterTypes and ParameterInfo.
17952         (Method.GetReturnType): We can now simply return the MemberType.
17953         (Method.GetMethodFlags): Override the MemberBase version and add
17954         the conditional flags.
17955         (Method.CheckBase): Moved some code from Define() here, call
17956         DoDefineParameters() here.
17957         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17958         here to avoid some larger code duplication.
17959         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17960         ensure that abstract and external accessors don't declare a body.
17961
17962         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17963         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17964         lookup in the attribute's parent classes, so we need to abort as soon
17965         as we found the first match.
17966         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17967         the attribute has no arguments.
17968
17969         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17970         of a Method.
17971
17972 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17973
17974         * cs-parser.jay: reverted previous patch.
17975
17976 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17977
17978         * cs-parser.jay: fixed bug #22119.
17979
17980 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17981
17982         * attribute.cs: fixed compilation. The error was:
17983         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17984         be assigned to before control leaves the current method."
17985         [FIXME:  Filed as bug #28186: MCS must report this error.]
17986
17987 2002-07-25  Martin Baulig  <martin@gnome.org>
17988
17989         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17990         method to pull the condition name ouf of a Conditional attribute.
17991         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17992         the obsolete message and error flag out of an Obsolete attribute.
17993
17994         * class.cs (Method.GetMethodFlags): New public method to get the
17995         TypeManager.MethodFlags for this method.
17996         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17997         private methods.
17998         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17999         if we're overriding a virtual function, set the new private variable
18000         `parent_method'; call the new TypeManager.AddMethod().
18001
18002         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18003         the MethodBuilder and the Method in a PtrHashtable.
18004         (TypeManager.builder_to_method): Added for this purpose.
18005         (TypeManager.MethodFlags): Added IsObsoleteError.
18006         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18007         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18008         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18009         the message from the attribute.
18010
18011 2002-07-24  Martin Baulig  <martin@gnome.org>
18012
18013         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18014         preprocessor directives, ensure that the argument to #define/#undef is
18015         exactly one identifier and that it's actually an identifier.
18016
18017         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18018         did not work ....
18019
18020 2002-07-24  Martin Baulig  <martin@gnome.org>
18021
18022         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18023         initialize it to TypeManager.object_type in the constructor.
18024         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18025         of the `hm.get_current' method if we're using the collection pattern.
18026         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18027         for the explicit conversion to make it work when we're using the collection
18028         pattern and the `Current' property has a different return type than `object'.
18029         Fixes #27713.
18030
18031 2002-07-24  Martin Baulig  <martin@gnome.org>
18032
18033         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18034         does not match, but don't report any errors.  This method is called in
18035         order for all methods in a MethodGroupExpr until a matching method is
18036         found, so we don't want to bail out if the first method doesn't match.
18037         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18038         matches, report the 123.  Fixes #28070.
18039
18040 2002-07-24  Martin Baulig  <martin@gnome.org>
18041
18042         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18043         TypeManager.TypeToCoreType() to the top of the method so the
18044         following equality checks will work.  Fixes #28107.
18045
18046 2002-07-24  Martin Baulig  <martin@gnome.org>
18047
18048         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18049         operand is of type uint, and the other operand is of type sbyte,
18050         short or int, the operands are converted to type long." -
18051         Actually do what this comment already told us.  Fixes bug #28106,
18052         added test-150.cs.
18053
18054 2002-07-24  Martin Baulig  <martin@gnome.org>
18055
18056         * class.cs (MethodBase): New abstract class.  This is now a base
18057         class for Property, Indexer and Event to avoid some code duplication
18058         in their Define() and DefineMethods() methods.
18059         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18060         generic methods for Define() and DefineMethods().
18061         (FieldBase): Derive from MemberBase, not MemberCore.
18062         (Property): Derive from MemberBase, not MemberCore.
18063         (Property.DefineMethod): Moved all the code from this method to the
18064         new MethodBase.DefineAccessor(), just call it with appropriate
18065         argumetnts.
18066         (Property.Define): Call the new Property.DoDefine(), this does some
18067         sanity checks and we don't need to duplicate the code everywhere.
18068         (Event): Derive from MemberBase, not MemberCore.
18069         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18070         accessors, this will also make them work with interface events.
18071         (Indexer): Derive from MemberBase, not MemberCore.
18072         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18073         (Indexer.Define): Use the new MethodBase functions.
18074
18075         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18076         argument to the constructor.
18077         (Interface.FindMembers): Added support for interface events.
18078         (Interface.PopluateEvent): Implemented.
18079
18080         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18081
18082 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18083
18084         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18085         but this is required to check for a method name being the same as
18086         the containing class.  
18087
18088         Handle this now.
18089
18090 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18091
18092         * interface.cs: initialize variable.
18093
18094 2002-07-23  Martin Baulig  <martin@gnome.org>
18095
18096         Implemented the IndexerName attribute in interfaces.
18097
18098         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18099         name if this is an explicit interface implementation.
18100         (Indexer.InterfaceIndexerName): New public variable.  If we're
18101         implementing an interface indexer, this is the IndexerName in that
18102         interface.  Otherwise, it's the IndexerName.
18103         (Indexer.DefineMethod): If we're implementing interface indexer,
18104         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18105         and Pending.ImplementIndexer methods.
18106         (Indexer.Define): Also define the PropertyBuilder if we're
18107         implementing an interface indexer and this is neither an explicit
18108         interface implementation nor do the IndexerName match the one in
18109         the interface.
18110
18111         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18112         If a method is defined here, then we always need to create a proxy
18113         for it.  This is used when implementing interface indexers.
18114         (Pending.IsInterfaceIndexer): New public method.
18115         (Pending.ImplementIndexer): New public method.
18116         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18117         This is used when implementing interface indexers to define a proxy
18118         if necessary.
18119         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18120         define a proxy if necessary.
18121
18122         * interface.cs (Interface.IndexerName): New public variable.
18123         (Interface.PopulateIndexer): Set the IndexerName.
18124         (Interface.DefineIndexers): New private method.  Populate all the
18125         indexers and make sure their IndexerNames match.
18126
18127         * typemanager.cs (IndexerPropertyName): Added support for interface
18128         indexers.
18129
18130 2002-07-22  Martin Baulig  <martin@gnome.org>
18131
18132         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18133         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18134         ret if HasReturnLabel.
18135         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18136         variables.
18137
18138         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18139         and set the ec.LoopBeginTryCatchLevel.
18140         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18141         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18142         the current ec.TryCatchLevel, the branch goes out of an exception
18143         block.  In this case, we need to use Leave and not Br.
18144
18145 2002-07-22  Martin Baulig  <martin@gnome.org>
18146
18147         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18148         block unless the block does not always return or it is contained in
18149         another try { ... } catch { ... } block.  Fixes bug #26506.
18150         Added verify-1.cs to the test suite.
18151
18152 2002-07-22  Martin Baulig  <martin@gnome.org>
18153
18154         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18155         then we do not always return.  Fixes bug #24985.
18156
18157 2002-07-22  Martin Baulig  <martin@gnome.org>
18158
18159         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18160         lookup on a per-class level; ie. walk up the class hierarchy until we
18161         found at least one applicable method, then choose the best among them.
18162         Fixes bug #24463 and test-29.cs.
18163
18164 2002-07-22  Martin Baulig  <martin@gnome.org>
18165
18166         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18167         return types of the methods.  The return type is not part of the
18168         signature and we must not check it to make the `new' modifier work.
18169         Fixes bug #27999, also added test-147.cs.
18170         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18171
18172         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18173         on the method's return type.
18174
18175 2002-07-21  Martin Baulig  <martin@gnome.org>
18176
18177         * assign.cs: Make this work if the rightmost source is a constant and
18178         we need to do an implicit type conversion.  Also adding a few more tests
18179         to test-38.cs which should have caught this.
18180
18181         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18182         target in the makefile for this.  The makefile.gnu is primarily intended
18183         for end-users who don't want to debug the compiler.
18184
18185 2002-07-21  Martin Baulig  <martin@gnome.org>
18186
18187         * assign.cs: Improved the Assign class so it can now handle embedded
18188         assignments (X = Y = Z = something).  As a side-effect this'll now also
18189         consume less local variables.  test-38.cs now passes with MCS, added
18190         a few new test cases to that test.
18191
18192 2002-07-20  Martin Baulig  <martin@gnome.org>
18193
18194         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18195         instructions.  Fixes bug #27977, also added test-146.cs.
18196
18197 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18198
18199         * cs-tokenizer.cs: fixed getHex ().
18200
18201 2002-07-19  Martin Baulig  <martin@gnome.org>
18202
18203         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18204         not Type.GetType() to lookup the array type.  This is needed when
18205         we're constructing an array of a user-defined type.
18206         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18207         single-dimensional arrays, but also for single-dimensial arrays of
18208         type decimal.
18209
18210 2002-07-19  Martin Baulig  <martin@gnome.org>
18211
18212         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18213         this function is called, it's not allowed to share LocalBuilders
18214         among ILGenerators.
18215
18216 2002-07-19  Martin Baulig  <martin@gnome.org>
18217
18218         * expression.cs (Argument.Resolve): Report an error 118 when trying
18219         to pass a type as argument.
18220
18221 2002-07-18  Martin Baulig  <martin@gnome.org>
18222
18223         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18224         Conv_R_Un for the signed `long' type.
18225
18226 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18227
18228         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18229         `expr' for the temporary result, as that will fail if we do
18230         multiple resolves on the same expression.
18231
18232 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18235         ec.TypeContainer for looking up aliases. 
18236
18237         * class.cs (TypeContainer): Remove LookupAlias from here.
18238
18239         * decl.cs (DeclSpace); Move here.
18240
18241 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18242
18243         * class.cs (FindMembers): Only call filter if the constructor
18244         bulider is not null.
18245
18246         Also handle delegates in `NestedTypes' now.  Now we will perform
18247         type lookups using the standard resolution process.  This also
18248         fixes a bug.
18249
18250         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18251         This uses Expressions (the limited kind that can be parsed by the
18252         tree) instead of strings.
18253
18254         * expression.cs (ComposedCast.ToString): Implement, used to flag
18255         errors since now we have to render expressions.
18256
18257         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18258         FormArrayType. 
18259
18260         * ecore.cs (SimpleName.ToString): ditto.
18261
18262         * cs-parser.jay: Instead of using strings to assemble types, use
18263         Expressions to assemble the type (using SimpleName, ComposedCast,
18264         MemberAccess).  This should fix the type lookups in declarations,
18265         because we were using a different code path for this.
18266
18267         * statement.cs (Block.Resolve): Continue processing statements
18268         even when there is an error.
18269
18270 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18271
18272         * class.cs (Event.Define): Also remove the `remove' method from
18273         the list of pending items.
18274
18275         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18276         generate more compact code. 
18277
18278 2002-07-17  Martin Baulig  <martin@gnome.org>
18279
18280         * const.cs (Const.LookupConstantValue): Add support for constant
18281         `unchecked' and `checked' expressions.
18282         Also adding test case test-140.cs for this.
18283
18284 2002-07-17  Martin Baulig  <martin@gnome.org>
18285
18286         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18287         check whether mi.ReturnType implements the IEnumerator interface; the
18288         `==' and the IsAssignableFrom() will fail in this situation.
18289
18290 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18291
18292         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18293         here too.
18294
18295 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18296
18297         * expression.cs: fixed bug #27811.
18298
18299 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18300
18301         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18302         Molaro: when we are a ref, the value already contains a pointer
18303         value, do not take the address of it.
18304
18305 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18306         * removed mb-parser.jay and mb-tokenizer.cs
18307
18308 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18309
18310         * expression.cs: check against the building corlib void type.
18311
18312 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18313
18314         * ecore.cs: fix for valuetype static readonly fields: when 
18315         initializing them, we need their address, not the address of a copy.
18316
18317 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18318
18319         * typemanager.cs: register also enum_type in corlib.
18320
18321 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18322
18323         * class.cs: allow calling this (but not base) initializers in structs.
18324
18325 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18326
18327         * ecore.cs: make sure we compare against the building base types
18328         in GetTypeSize ().
18329
18330 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18331
18332         * typemanager.cs: fix TypeToCoreType() to handle void and object
18333         (corlib gets no more typerefs after this change).
18334
18335 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18336
18337         * expression.cs (ArrayCreation.EmitArrayArguments): use
18338         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18339
18340         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18341         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18342         array indexes, the runtime actually forbids them.
18343
18344         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18345         for array arguments here.
18346
18347         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18348         instead of the default for ValueTypes.
18349
18350         (New.DoEmit): Use IsValueType instead of
18351         IsSubclassOf (value_type)
18352         (New.DoResolve): ditto.
18353         (Invocation.EmitCall): ditto.
18354
18355         * assign.cs (Assign): ditto.
18356
18357         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18358         Statements *are* currently doing part of their resolution during
18359         Emit.  
18360
18361         Expressions do always resolve during resolve, but statements are
18362         only required to propagate resolution to their children.
18363
18364 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18365
18366         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18367
18368         (LoadAssembly): Do not add the dll if it is already specified
18369
18370         (MainDriver): Add the System directory to the link path at the end,
18371         after all the other -L arguments. 
18372
18373         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18374         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18375         ldelem.u1) and using the opposite for sbytes.
18376
18377         This fixes Digger, and we can finally run it.
18378
18379         * driver.cs (UnixParseOption): Move the option parsing here.  
18380         (CSCParseOption): Implement CSC-like parsing of options.
18381
18382         We now support both modes of operation, the old Unix way, and the
18383         new CSC-like way.  This should help those who wanted to make cross
18384         platform makefiles.
18385
18386         The only thing broken is that /r:, /reference: and /lib: are not
18387         implemented, because I want to make those have the same semantics
18388         as the CSC compiler has, and kill once and for all the confussion
18389         around this.   Will be doing this tomorrow.
18390
18391         * statement.cs (Unsafe.Resolve): The state is checked during
18392         resolve, not emit, so we have to set the flags for IsUnsfe here.
18393
18394 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18395
18396         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18397         not catch the Error_ObjectRefRequired in SimpleName (as it is
18398         possible to have a class/instance variable name that later gets
18399         deambiguated), we have to check this here.      
18400
18401 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18402
18403         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18404         make static and put into Expression.
18405
18406         (Event.Define): Register the private field of the event with the 
18407         TypeManager so that GetFieldFromEvent can get at it.
18408
18409         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18410         keep track of the private field associated with an event which
18411         has no accessors.
18412
18413         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18414         private field.
18415
18416         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18417
18418 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18419
18420         * expression.cs (Binary.EmitBranchable): this routine emits the
18421         Binary expression in a branchable context.  This basically means:
18422         we need to branch somewhere, not just get the value on the stack.
18423
18424         This works together with Statement.EmitBoolExpression.
18425
18426         * statement.cs (Statement.EmitBoolExpression): Use
18427         EmitBranchable. 
18428
18429 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18430
18431         * statement.cs (For): Reduce the number of jumps in loops.
18432
18433         (For): Implement loop inversion for the For statement.
18434
18435         (Break): We can be breaking out of a Try/Catch controlled section
18436         (foreach might have an implicit try/catch clause), so we need to
18437         use Leave instead of Br.
18438
18439         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18440         now).  If the instace expression supports IMemoryLocation, we use
18441         the AddressOf method from the IMemoryLocation to extract the
18442         address instead of emitting the instance.
18443
18444         This showed up with `This', as we were emitting the instance
18445         always (Emit) instead of the Address of This.  Particularly
18446         interesting when This is a value type, as we dont want the Emit
18447         effect (which was to load the object).
18448
18449 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18450
18451         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18452
18453         * statement.cs (Checked): Set the CheckedState during the resolve
18454         process too, as the ConvCast operations track the checked state on
18455         the resolve process, and not emit.
18456
18457         * cs-parser.jay (namespace_member_declaration): Flag that we have
18458         found a declaration when we do.  This is used to flag error 1529
18459
18460         * driver.cs: Report ok when we display the help only.
18461
18462 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18463
18464         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18465
18466 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18467
18468         * cs-tokenizer.cs (define): We also have to track locally the
18469         defines.  AllDefines is just used for the Conditional Attribute,
18470         but we also need the local defines for the current source code. 
18471
18472 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * statement.cs (While, For, Do): These loops can exit through a
18475         Break statement, use this information to tell whether the
18476         statement is the last piece of code.
18477
18478         (Break): Flag that we break.
18479
18480         * codegen.cs (EmitContexts): New `Breaks' state variable.
18481
18482 2002-07-03  Martin Baulig  <martin@gnome.org>
18483
18484         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18485         modifiers in method declarations in structs.  Otherwise, you won't
18486         be able to override things like Object.Equals().
18487
18488 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18489
18490         * class.cs (Method, Property, Indexer): Do not allow the public
18491         modifier to be used in explicit interface implementations.
18492
18493         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18494         override modifiers in method declarations in structs
18495
18496 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18497
18498         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18499         integer or real overflow, report an error
18500
18501 2002-07-02  Martin Baulig  <martin@gnome.org>
18502
18503         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18504         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18505         to tell the runtime about our newly created System.Object and
18506         System.ValueType types.
18507
18508 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18509
18510         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18511         struct instead of Ldarg/Starg.
18512
18513 2002-07-02  Martin Baulig  <martin@gnome.org>
18514
18515         * expression.cs (Indirection.Indirection): Call
18516         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18517
18518 2002-07-02  Martin Baulig  <martin@gnome.org>
18519
18520         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18521         ValueType, call TypeManager.TypeToCoreType() on it.
18522         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18523         the OpCodes.Newarr argument.
18524
18525 2002-07-02  Martin Baulig  <martin@gnome.org>
18526
18527         * expression.cs (Invocation.EmitCall): When compiling corlib,
18528         replace all calls to the system's System.Array type to calls to
18529         the newly created one.
18530
18531         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18532         System.Array methods.
18533         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18534         from the system's System.Array type which must be replaced.
18535
18536 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18537
18538         * typemanager.cs: load unverifiable_code_ctor so we can build
18539         corlib using the correct type. Avoid using GetTypeCode() with
18540         TypeBuilders.
18541         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18542         TypeManager.object_type to allow building corlib.
18543
18544 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18545
18546         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18547
18548 2002-07-01  Martin Baulig  <martin@gnome.org>
18549
18550         * class.cs: Make the last change actually work, we need to check
18551         whether `ifaces != null' to avoid a crash.
18552
18553 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18554
18555         * class.cs: when we build structs without fields that implement
18556         interfaces, we need to add the interfaces separately, since there is
18557         no API to both set the size and add the interfaces at type creation
18558         time.
18559
18560 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18561
18562         * expression.cs: the dimension arguments to the array constructors
18563         need to be converted if they are a long.
18564
18565 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18566
18567         * class.cs: don't emit ldarg.0 if there is no parent constructor
18568         (fixes showstopper for corlib).
18569
18570 2002-06-29  Martin Baulig  <martin@gnome.org>
18571
18572         MCS now compiles corlib on GNU/Linux :-)
18573
18574         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18575         ie. check for MethodImplOptions.InternalCall.
18576
18577         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18578         and TypeManager.attribute_type are null, so we must explicitly check
18579         whether parent is not null to find out whether it's an attribute type.
18580         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18581         and SetBuilder, not only if the property is neither abstract nor external.
18582         This is necessary to set the MethodImplOptions on the accessor methods.
18583         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18584         SetBuilder, see Property.Emit().
18585
18586         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18587         populate "System.Object", "System.ValueType" and "System.Attribute" since
18588         they've already been populated from BootCorlib_PopulateCoreTypes().
18589
18590 2002-06-29  Martin Baulig  <martin@gnome.org>
18591
18592         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18593         is the NullLiteral, we also need to make sure that target_type is not
18594         an enum type.   
18595
18596 2002-06-29  Martin Baulig  <martin@gnome.org>
18597
18598         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18599         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18600         before calling BootstrapCorlib_ResolveDelegate ().
18601
18602 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18603
18604         * statement.cs: fixed build-breaker. All tests passed ok.
18605
18606 2002-06-27  Martin Baulig  <martin@gnome.org>
18607
18608         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18609         for System.Decimal when compiling corlib.
18610
18611 2002-06-27  Martin Baulig  <martin@gnome.org>
18612
18613         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18614         switch blocks which contain nothing but a default clause.
18615
18616 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18617
18618        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18619
18620 2002-06-27  Martin Baulig  <martin@gnome.org>
18621
18622         * ecore.cs (PropertyExpr.PropertyExpr): Call
18623         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18624
18625         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18626         is already a TypeBuilder.
18627
18628 2002-06-27  Martin Baulig  <martin@gnome.org>
18629
18630         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18631         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18632         the "from an array-type to System.Array" case.  This makes it work
18633         when compiling corlib.
18634
18635 2002-06-27  Martin Baulig  <martin@gnome.org>
18636
18637         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18638         non-static PropertyExpr, set its InstanceExpression.  This makes
18639         the `ICollection.Count' property work in System/Array.cs.
18640
18641 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18642
18643         * driver.cs: Made error handling more consistent.  Errors now
18644         tracked by Report class, so many methods which used to return int
18645         now return void.  Main() now prints success/failure and 
18646         errors/warnings message.
18647
18648         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18649         the magic number return values (123 and 124).  Now, if the
18650         expected error occurs, the compiler exits with success (exit value
18651         0).  If the compilation completes without seeing that particular
18652         error, the compiler exits with failure (exit value 1).  The
18653         makefile in mcs/errors has been changed to handle the new behaviour.
18654
18655         * report.cs: Made 'expected error' number a property and renamed
18656         it from 'Probe' to 'ExpectedError'.
18657
18658         * genericparser.cs: Removed error handling support, since it is
18659         now all done by Report class.
18660
18661         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18662         class, so parse() no longer returns an int.
18663
18664         * namespace.cs: Use Report.Error instead of GenericParser.error
18665
18666 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18667
18668         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18669         TypeContainer.AddOperator): At the front of the list put the
18670         explicit implementations, so they get resolved/defined first. 
18671
18672 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18673
18674         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18675         interface type is implemented by this TypeContainer.  Used during
18676         explicit interface implementation.
18677
18678         (Property.Define, Indexer.Define, Method.Define): Validate that
18679         the given interface in the explicit implementation is one of the
18680         base classes for the containing type.
18681
18682         Also if we are explicitly implementing an interface, but there is
18683         no match in the pending implementation table, report an error.
18684
18685         (Property.Define): Only define the property if we are
18686         not explicitly implementing a property from an interface.  Use the
18687         correct name also for those properties (the same CSC uses,
18688         although that is really not needed).
18689
18690         (Property.Emit): Do not emit attributes for explicitly implemented
18691         properties, as there is no TypeBuilder.
18692
18693         (Indexer.Emit): ditto.
18694
18695         Hiding then means that we do not really *implement* a pending
18696         implementation, which makes code fail.
18697
18698 2002-06-22  Martin Baulig  <martin@gnome.org>
18699
18700         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18701         the return value of Object.GetType().  [FIXME: we need to do this whenever
18702         we get a type back from the reflection library].
18703
18704 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18705
18706         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18707
18708 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18709
18710         * attribute.cs: Return null if we can not look up the type.
18711
18712         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18713         the interface types found.
18714
18715         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18716         interface types found.
18717
18718         * typemanager.cs (GetInterfaces): Make this routine returns alll
18719         the interfaces and work around the lame differences between
18720         System.Type and System.Reflection.Emit.TypeBuilder in the results
18721         result for GetInterfaces.
18722
18723         (ExpandInterfaces): Given an array of interface types, expand and
18724         eliminate repeated ocurrences of an interface.  This expands in
18725         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18726         be IA, IB, IC.
18727
18728 2002-06-21  Martin Baulig  <martin@gnome.org>
18729
18730         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18731         on System.Enum.
18732
18733 2002-06-21  Martin Baulig  <martin@gnome.org>
18734
18735         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18736         and called with one of the core types, return the corresponding typebuilder for
18737         that type.
18738
18739         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18740         element type.
18741
18742 2002-06-21  Martin Baulig  <martin@gnome.org>
18743
18744         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18745         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18746         (Expression.ConvertReferenceExplicit): Likewise.
18747
18748         * expression.cs (ElementAccess.DoResolve): Likewise.
18749         (ElementAccess.DoResolveLValue): Likewise.
18750
18751 2002-06-10  Martin Baulig  <martin@gnome.org>
18752
18753         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18754         add the "value" parameter to the parameter list.
18755
18756         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18757         to our caller.
18758
18759 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18760
18761         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18762         the argument to an int, uint, long or ulong, per the spec.  Also
18763         catch negative constants in array creation.
18764
18765 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18766
18767         * class.cs: do not allow the same interface to appear twice in
18768         the definition list.
18769
18770 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18771
18772         * ecore.cs: don't use ldlen with System.Array.
18773
18774 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18775
18776         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18777
18778 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18779
18780         * modifiers.cs: produce correct field attributes for protected
18781         internal. Easy fix so miguel can work on ther harder stuff:-)
18782
18783 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18784
18785         * pending.cs: New file.  Move the code from class.cs here.
18786         Support clearning the pending flag for all methods (when not doing
18787         explicit interface implementation).
18788
18789 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18790
18791         * rootcontext.cs: added a couple more types needed to bootstrap.
18792
18793 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18794
18795         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18796         constructor in the type, instead of any constructor in the type
18797         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18798         a bug in the Mono runtime when applying the params attribute). 
18799
18800 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18801         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18802
18803 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18804
18805         * expression.cs (Unary.ResolveOperator): Use TypeManager
18806         to resolve the type.
18807
18808 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18809
18810         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18811         attached.
18812
18813         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18814         with each member too.
18815
18816         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18817         field builders too - this takes care of the enum member case.
18818
18819 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18820
18821         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18822         address-of operator on both value types and pointers.
18823
18824 2002-06-10  Martin Baulig  <martin@gnome.org>
18825
18826         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18827         PropertyBuilder to the `property_builders' list.
18828
18829         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18830         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18831         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18832         find any indexers which are inherited from an interface.
18833
18834 2002-06-09  Martin Baulig  <martin@gnome.org>
18835
18836         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18837         the same type as the constant if necessary.  There's also a test-130.cs
18838         for this.
18839
18840         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18841
18842         * typemanager.cs (TypeManager.ChangeType): Previously known as
18843         Enum.ChangeEnumType().
18844
18845 2002-06-09  Martin Baulig  <martin@gnome.org>
18846
18847         * expression.cs (Cast.TryReduce): Added support for consts.
18848
18849 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18850
18851         * class.cs (Accessor): Hold attributes information so we can pass
18852         it along.
18853
18854         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18855         Modify to pass in attributes attached to the methods.
18856
18857         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18858
18859         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18860         to handle the Accessor kind :-)
18861
18862         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18863
18864 2002-06-08  Martin Baulig  <martin@gnome.org>
18865
18866         * expression.cs (Unary.TryReduceNegative): Added support for
18867         ULongConstants.
18868
18869 2002-06-08  Martin Baulig  <martin@gnome.org>
18870
18871         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18872         name can't be found in the `defined_names' - the caller will do a
18873         MemberLookup in this case and thus find methods in System.Enum
18874         such as Enum.IsDefined().
18875
18876 2002-06-08  Martin Baulig  <martin@gnome.org>
18877
18878         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18879         Convert.ChangeType() which works with TypeBuilder created types.
18880         (Enum.LookupEnumValue, Enum.Define): Use it here.
18881
18882         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18883         `TypeBuilder.BaseType != null' check.
18884         (TypeContainer.FindMembers): Only lookup parent members if we
18885         actually have a parent.
18886         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18887         (ConstructorInitializer.Resolve): Likewise.
18888
18889         * interface.cs (Interface.FindMembers): Added
18890         `TypeBuilder.BaseType != null' check.
18891
18892         * rootcontext.cs (RootContext.ResolveCore): Added
18893         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18894         classes_second_stage.
18895
18896         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18897         debug_type and trace_type when compiling with --nostdlib.       
18898
18899 2002-06-07  Martin Baulig  <martin@gnome.org>
18900
18901         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18902         (AddField): Set it to true when adding a non-static field.
18903         (DefineType): Use `have_nonstatic_fields' to find out whether we
18904         have non-static fields, not `Fields != null'.
18905
18906 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18909         dereferencing a null on the static-field code path)
18910
18911 2002-05-30  Martin Baulig  <martin@gnome.org>
18912
18913         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18914         to take command line arguments.  Use reflection to call the new
18915         custom `Initialize' function on the symbol writer and pass it the
18916         command line arguments.
18917
18918         * driver.cs (--debug-args): New command line argument to pass command
18919         line arguments to the symbol writer.
18920
18921 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18922
18923         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18924         the target type for indexers and properties.  Thanks to Joe for
18925         catching this.
18926
18927 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18928
18929         * typemanager.cs (MethodFlags): returns the method flags
18930         (Obsolete/ShouldIgnore) that control warning emission and whether
18931         the invocation should be made, or ignored. 
18932
18933         * expression.cs (Invocation.Emit): Remove previous hack, we should
18934         not do this on matching a base type, we should do this based on an attribute
18935
18936         Only emit calls to System.Diagnostics.Debug and
18937         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18938         on the command line.
18939
18940         * rootcontext.cs: Global settings for tracing and debugging.
18941
18942         * cs-tokenizer.cs (define): New utility function to track
18943         defines.   Set the global settings for TRACE and DEBUG if found.
18944
18945 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18946
18947         * interface.cs (Populate*): Pass in the TypeContainer as well as
18948         the DeclSpace as parameters so that we can create EmitContexts and
18949         then use that to apply attributes etc.
18950
18951         (PopulateMethod, PopulateEvent, PopulateProperty)
18952         (PopulateIndexer): Apply attributes everywhere.
18953
18954         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18955         etc.
18956
18957         (ApplyAttributes): Update accordingly.
18958
18959         We now apply interface attributes for all members too.
18960
18961 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18962
18963         * class.cs (Indexer.Define); Correctly check if we are explicit
18964         implementation (instead of checking the Name for a ".", we
18965         directly look up if the InterfaceType was specified).
18966
18967         Delay the creation of the PropertyBuilder.
18968
18969         Only create the PropertyBuilder if we are not an explicit
18970         interface implementation.   This means that explicit interface
18971         implementation members do not participate in regular function
18972         lookups, and hence fixes another major ambiguity problem in
18973         overload resolution (that was the visible effect).
18974
18975         (DefineMethod): Return whether we are doing an interface
18976         implementation. 
18977
18978         * typemanager.cs: Temporary hack until we get attributes in
18979         interfaces (Ravi is working on that) and we get IndexerName
18980         support in interfaces.
18981
18982         * interface.cs: Register the indexers as properties.
18983
18984         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18985         warning, I have verified that this is a bug in the .NET runtime
18986         (JavaScript suffers of the same problem).
18987
18988         * typemanager.cs (MemberLookup): When looking up members for
18989         interfaces, the parent of an interface is the implicit
18990         System.Object (so we succeed in searches of Object methods in an
18991         interface method invocation.  Example:  IEnumerable x;  x.ToString
18992         ()) 
18993
18994 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18995
18996         * class.cs (Event): Events should also register if they do
18997         implement the methods that an interface requires.
18998
18999         * typemanager.cs (MemberLookup); use the new GetInterfaces
19000         method. 
19001
19002         (GetInterfaces): The code used to lookup interfaces for a type is
19003         used in more than one place, factor it here. 
19004
19005         * driver.cs: Track the errors at the bottom of the file, we kept
19006         on going.
19007
19008         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19009         instance if the method we are calling is static!
19010
19011 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19012
19013         * attribute.cs (ApplyAttributes): Make this function filter out
19014         the IndexerName attribute (as that attribute in reality is never
19015         applied) and return the string constant for the IndexerName
19016         attribute. 
19017
19018         * class.cs (TypeContainer.Emit): Validate that all the indexers
19019         have the same IndexerName attribute, and if so, set the
19020         DefaultName attribute on the class. 
19021
19022         * typemanager.cs: The return value might contain other stuff (not
19023         only methods).  For instance, consider a method with an "Item"
19024         property and an Item method.
19025
19026         * class.cs: If there is a problem with the parameter types,
19027         return. 
19028
19029 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19030
19031         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19032         looks at user defined conversion after making a call to 
19033         StandardConversionExists - we need this for overload resolution.
19034
19035         * expression.cs : Update accordingly the various method calls.
19036
19037         This fixes 2 bugs filed against implicit user defined conversions 
19038
19039 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19040
19041         * statement.cs: Track the result of the assignment.
19042
19043 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19044
19045         * expression.cs (MemberAccess): Improved error reporting for
19046         inaccessible members.
19047
19048 2002-05-22  Martin Baulig  <martin@gnome.org>
19049
19050         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19051         itself with debugging support.
19052
19053 2002-05-22  Martin Baulig  <martin@gnome.org>
19054
19055         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19056         Removed, this isn't needed anymore.
19057
19058 2002-05-20  Martin Baulig  <martin@gnome.org>
19059
19060         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19061         be underlying type for an enum.
19062
19063 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19064
19065         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19066         that splits out the loading of just the core types.
19067
19068         * rootcontext.cs (ResolveCore): Split the struct resolution in
19069         two, so we can load the enumeration underlying types before any
19070         enums are used.
19071
19072         * expression.cs (Is): Bandaid until we fix properly Switch (see
19073         bug #24985 for details).
19074
19075         * typemanager.cs (ImplementsInterface): The hashtable will contain
19076         a null if there are no interfaces implemented.
19077
19078 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * cs-parser.jay (indexer_declarator): It is fine to have array
19081         parameters
19082
19083 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19084
19085         * typemanager.cs: (RegisterBuilder): New function used to register
19086         TypeBuilders that implement interfaces.  Since
19087         TypeBuilder.GetInterfaces (as usual) does not work with lame
19088         Reflection.Emit. 
19089         (AddUserType): register interfaces.
19090
19091         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19092         dealing with TypeBuilder.  Also, arrays are showing up as
19093         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19094         methods can not be invoked on them!
19095
19096         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19097         (ImplicitReferenceConversionExists): Split out from
19098         StandardConversionExists. 
19099
19100         * expression.cs (As): We were only implementing one of the three
19101         cases for the as operator.  We now implement them all.
19102         (Is): Implement the various other cases for Is as well.
19103
19104         * typemanager.cs (CACHE): New define used to control if we want or
19105         not the FindMembers cache.  Seems to have a negative impact on
19106         performance currently
19107
19108         (MemberLookup): Nested types have full acess to
19109         enclosing type members
19110
19111         Remove code that coped with instance/static returns for events, we
19112         now catch this in RealFindMembers.
19113
19114         (RealFindMembers): only perform static lookup if the instance
19115         lookup did not return a type or an event.  
19116
19117 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19118
19119         * assign.cs (CompoundAssign): We pass more semantic information
19120         now to Compound Assignments than we did before: now we have all
19121         the information at hand, and now we resolve the target *before* we
19122         do the expression expansion, which allows the "CacheValue" method
19123         to have the effect we intended (before, a [x] += 1 would generate
19124         two differen ArrayAccess expressions from the ElementAccess,
19125         during the resolution process).
19126
19127         (CompoundAssign.DoResolve): Resolve target and original_source here.
19128
19129 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19130
19131         * expression.cs (ArrayAccess): dropped debugging information. 
19132
19133         * typemanager.cs: Small bug fix: I was always returning i_members,
19134         instead of one of i_members or s_members (depending on which had
19135         the content).
19136
19137         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19138         method is invoked before any code generation takes place, and it
19139         is a mechanism to inform that the expression will be invoked more
19140         than once, and that the method should use temporary values to
19141         avoid having side effects
19142
19143         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19144
19145         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19146         implementation.
19147
19148         * expression.cs (Indirection, ArrayAccess): Add support for
19149         CacheTemporaries in these two bad boys. 
19150
19151         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19152         ldobj or ldind_ref.  
19153         (StoreFromPtr): Handle stobj as well.
19154
19155         * expression.cs (UnaryMutator): Share more code.
19156
19157         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19158         down: I was not tracking the Filter function as well, which
19159         was affecting the results of the cache.
19160
19161 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19162
19163         * attribute.cs: Remove the hack to handle the CharSet property on
19164         StructLayouts. 
19165
19166 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19167
19168         * attribute.cs (DoResolve): More uglyness, we now only try to
19169         resolve the attribute partially, to extract the CharSet
19170         information (only if we are a StructLayout attribute).  Otherwise 
19171
19172         (GetExtraTypeInfo): Add some code to conditionally kill in the
19173         future this.   I am more and more convinced that the .NET
19174         framework has special code to handle the attribute setting on
19175         certain elements.
19176
19177         * expression.cs (IsParamsMethodApplicable): Revert my previous
19178         foreach change here, it was wrong.
19179
19180 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19181
19182         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19183         (pp_expr): do not abort on unknown input, just return.
19184         (eval): abort if there are pending chars.
19185
19186         * attribute.cs (Attribute.Resolve): Positional parameters are
19187         optional.  Deal with that case.
19188
19189         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19190         the Ansi/Unicode/Auto information for the type.
19191
19192         (TypeContainer.DefineType): instantiate the EmitContext here, as
19193         we will be using it during the type definition (to resolve
19194         attributes) and during the emit phase.
19195
19196         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19197         to pull type information out of the attributes
19198
19199         (Attribute.Resolve): track the constructor builder, and allow for
19200         multiple invocations (structs and classes will use this).
19201
19202         * ecore.cs (MemberLookupFinal): new version with all the
19203         parameters customizable.
19204
19205         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19206         constructors.  Return if the result value is null (as the error
19207         would have been flagged already by MemberLookupFinal)
19208
19209         Do not allow instances of abstract classes or interfaces to be
19210         created.
19211
19212         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19213         We have to compare the assembly property here when dealing with
19214         FamANDAssem and Assembly access modifiers, because we might be
19215         creating an assembly from *modules* (that means that we are not
19216         getting TypeBuilders for types defined in other modules that are
19217         part of this assembly).
19218
19219         (Method.Emit): If the method is marked abstract and has a body,
19220         emit an error. 
19221
19222         (TypeContainer.DefineMembers): If both the defined member and the
19223         parent name match are methods, then do not emit any warnings: let
19224         the Method.Define routine take care of flagging warnings.  But if
19225         there is a mismatch (method overrides something else, or method is
19226         overriwritten by something, then emit warning).
19227
19228         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19229         set to null, this means `do not check for the return type on the
19230         signature'. 
19231
19232         (Method.Define): set the return type for the method signature to
19233         null, so that we get methods with the same name and parameters and
19234         different return types.  This is used to flag warning 114 (you are
19235         hiding a method, and you probably want to use the new/override
19236         keywords instead).
19237
19238         * typemanager.cs (MemberLookup): Implemented proper access
19239         control, closing a long standing set of bug reports.  The problem
19240         was that the Framework only has two bits: Public and NonPublic,
19241         and NonPublic includes private and protected methods, but we need
19242         to enforce the FamANDAssem, FamOrAssem and Family. 
19243
19244 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19245
19246         * statement.cs (GotoCase): Return true: Ammounts to giving up
19247         knowledge on whether we return or not, and letting the other case
19248         be responsible for it.
19249
19250 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19251
19252         * driver.cs: Do not load directories for each file processed, only
19253         do it if there is a pattern.
19254
19255         * ecore.cs: Report readonly assigns here as well, as we might have
19256         been resolved only by MemberAccess.
19257
19258         (SimpleName.SimpleNameResolve): Also be useful for LValue
19259         resolution.   We need this to propagate assign to local readonly variables
19260
19261         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19262         do not want to reuse potential criteria memory.
19263
19264         * class.cs (MyEventBuilder): Set reflected_type;
19265
19266         * ecore.cs (Constantify): Added support for constifying bools.
19267
19268         (RootContext.LookupType): Added a cache for values looked up in
19269         the declaration space.
19270
19271         * typemanager.cs (FindMembers): Now is a front-end to
19272         RealFindMembers, and provides a two-level hashtable-based cache to
19273         the request.  
19274
19275         15% performance improvement: from 22.5 to 19.2 seconds.
19276
19277         * expression.cs (IsParamsMethodApplicable): use foreach.
19278         (Invocation.DoResolve): ditto.
19279         (New.DoResolve): ditto.
19280         (ArrayCreation.DoResolve): ditto.
19281
19282         * ecore.cs (FindMostEncompassingType): use foreach.
19283
19284         * delegate.cs (NewDelegate.DoResolve): Use foreach
19285
19286         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19287         (RemoveMethods): use foreach.
19288
19289         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19290         nested foreach statements instead of for, and also break out of
19291         the inner loop once a match is found.
19292
19293         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19294
19295 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19296
19297         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19298         we actually unwrap the expression to allow for extra information
19299         to be extracted. 
19300
19301         * expression.cs: Use Shr_Un on unsigned operations. 
19302
19303 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19304
19305         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19306         applicable operators was not being considered correctly. This closes
19307         the bug Miguel reported.
19308
19309 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19310
19311         * attribute.cs: check that the type derives from System.Attribute
19312         and report the correct error in that case (moved the duplicate code to
19313         its own method, too).
19314
19315 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19316
19317         * attribute.cs: lookup attribute type name as the spec says: first the
19318         bare attribute name and then name + "Attribute" (nant compiles with
19319         mcs after this fix).
19320
19321 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19322
19323         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19324         Because of the way we parse things, we should try to see if a
19325         UIntConstant can fit in an integer.
19326
19327 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19328
19329         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19330         when we are in an explicit context.
19331
19332         (ConvertReferenceExplicit): When converting from Iface type S to Class
19333         T make sure the rules are implemented as an OR.
19334
19335         * parameter.cs (ParameterType): Make it a property for now although the
19336         purpose really isn't anything immediate.
19337
19338         * expression.cs (Is*Applicable): Do better checking on the parameter type
19339         of a ref/out parameter. The ones from the system assemblies are already 
19340         marked with the correct type so we don't need to do any correction.
19341
19342         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19343         the object type is standard too so include that.
19344
19345 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19346
19347         * ecore.cs (StandardConversionExists): Augment with missing code:
19348         deal with IntConstant, LongConstants and Enumerations.
19349
19350         * assign.cs: Report the error, instead of failing silently
19351
19352         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19353         typecontainer that they are declared, because the
19354         typecontainer/namespace will have the list of using clauses that
19355         need to be applied.
19356
19357         Assembly Attributes were escaping the normal registration
19358         mechanism. 
19359
19360         (EmitCode): Apply attributes within an EmitContext that represents
19361         the container they were declared on.
19362
19363         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19364
19365 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19366
19367         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19368         Revamp completely - make much cleaner as we now operate only
19369         on a set of Types.
19370
19371         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19372         to implement the logic detailed in the spec more correctly.
19373
19374         (UserDefinedConversion): Update accordingly.
19375
19376 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19377
19378         * statement.cs: Return flow analysis information up.
19379
19380         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19381         and the default.
19382
19383         (token): Do not consume an extra character before calling
19384         decimal_digits.
19385
19386 2002-05-06  Piers Haken <piersh@friskit.com>
19387
19388         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19389
19390 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19391
19392         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19393         EmitContext during the instance constructor initializer
19394         resolution, to stop access to instance variables.
19395
19396         This is mandated by the spec, last paragraph of the `constructor
19397         initializers' section. 
19398
19399 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19400
19401         * cs-parser.jay, class.cs (Accessor): new class used to represent
19402         an accessor (get or set).  In the past we used `null' to represent
19403         a missing accessor.  But this is ambiguous because there was no
19404         way to tell in abstract indexers/properties if one of them was
19405         specified.
19406
19407         Now there is a way of addressing that.
19408
19409         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19410         instead of FindMembers.
19411
19412         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19413         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19414
19415         * attribute.cs: Treat indexers and properties as the same in terms
19416         of applying attributes
19417
19418         * ecore.cs (FindMostEncompassedType): Use statically initialized
19419         EmptyExpressions()s like we do elsewhere to avoid creating useless
19420         objects (and we take this out of the tight loop).
19421
19422         (GetConversionOperators): Move the code to extract the actual
19423         operators to a separate routine to clean things up.
19424
19425 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19426
19427         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19428         events are always registered FieldBuilders.
19429
19430         * class.cs (FieldBase): New class shared by Fields 
19431
19432         * delegate.cs: If we are a toplevel delegate, use our full name.
19433         If we are a nested delegate, then only use our tail name.
19434
19435 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19436
19437         * expression.cs (IsApplicable): Ensure that we add the "&" to
19438         ref/out types before comparing it with the type of the argument.
19439
19440         (IsParamsMethodApplicable): Ditto.
19441
19442         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19443         silly me ;-)
19444
19445         * delegate.cs : Handle the case when we have more than one applicable
19446         method. Flag an error only when we finish checking all.
19447
19448 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19449
19450         * expression.cs: Add support for boolean static initializers.
19451
19452 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19453
19454         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19455
19456         * parameter.cs (ComputeParameterTypes,
19457         ComputeAndDefineParameterTypes): Better error handling: now we
19458         clear the `types' cache if we fail during any of the type lookups.
19459         We also return the status code correctly to our caller
19460
19461         * delegate.cs: If we fail to define a delegate, abort the extra
19462         steps. 
19463
19464         * expression.cs (Binary.ResolveOperator): for
19465         operator==(object,object) and operator !=(object, object) we also
19466         have to verify that there is an implicit conversion from one to
19467         the other.
19468
19469         (ArrayAccess.DoResolve): Array Access can operate on
19470         non-variables. 
19471
19472 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19473
19474         * assign.cs (CompoundAssign): A new class used as a "flag" that
19475         the assignment actually is happening as part of a compound
19476         assignment operator.
19477
19478         During compound assignment, a few new rules exist to enable things
19479         like:
19480
19481         byte b |= 1 + 2
19482
19483         From the spec:
19484
19485         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19486         to the type of x) if y is implicitly convertible to the type of x,
19487         and the operator is a builtin operator and the return type of the
19488         operator is explicitly convertible to the type of x. 
19489
19490         * rootcontext.cs: Reset warning level to 2.  4 catches various
19491         "interesting" features in mcs, we must clean this up at some
19492         point, but currently am trying to kill other bugs ;-)
19493
19494         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19495         in container classes as well.  
19496
19497         * expression.cs (Binary.ResolveOperator): Handle string case
19498         before anything else (as operator overloading does emit an error
19499         before doing anything else).
19500
19501         This code could go away when we move to a table driven model, but
19502         i could not come up with a good plan last night.
19503
19504 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19505
19506         * typemanager.cs (CSharpName): reimplementation using regex.
19507         * class.cs: added null check for fields in Emit
19508         * rootcontext.cs: set warninglevel to 4
19509
19510 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19511
19512         * typemanager.cs (CSharpName): reimplemented with Lupus
19513         suggestion.
19514
19515 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * statement.cs (If): correclty implement Resolve, because we were
19518         not catching sem errors in there.  The same process is needed
19519         everywhere else. 
19520         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19521
19522
19523         (Statement.Warning_DeadCodeFound): Factorize code.
19524         (While): Report dead code here too.
19525
19526         (Statement): Added Resolve virtual method to allow
19527         for resolution split from the emit code.
19528
19529 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19530
19531         * statement.cs (EmitBoolExpression): No longer try to resolve the
19532         expression here.    
19533         (MakeBoolean): New utility function that resolve, implicitly
19534         converts to boolean and tags the expression. 
19535
19536
19537         (If, Do): Implement dead code elimination.
19538         (While): Implement loop inversion
19539
19540         (Do, While, For, If): Resolve the expression prior to calling our
19541         code generation.
19542
19543 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19544
19545         * class.cs:
19546           - added method Report28 (warning: program has more than one entry point)
19547           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19548           - modified method Method.Define, the part at the end of the method
19549
19550         * rootcontext.cs: added static public Location EntryPointLocation;
19551           
19552         * ../errors/cs0028.cs : Add test case for the above warning.              
19553
19554         * typemanager.cs:
19555           - modified method CSharpName to allow arrays of primitive type to
19556             be printed nicely (e.g. instead of System.Int32[][] it now prints
19557             int[][])
19558           - added method CSharpSignature: returns the signature of a method
19559             in string format to be used in reporting errors, warnings, etc.
19560
19561         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19562         with String.Empty.
19563
19564 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19565
19566         * delegate.cs (Define): Fix extremely silly bug where I was
19567         setting the type of the 'object' parameter of the BeginInvoke
19568         method to System.IAsyncResult instead of System.Object ;-)
19569
19570 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19573         here. 
19574
19575         (Constructor.Emit): return if we fail to initialize the
19576         constructor.  Another door closed!  
19577
19578         * expression.cs (New.DoResolve): Improve error message (from -6 to
19579         1501).  Use DeclaredOnly lookup to find the exact constructor.
19580
19581         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19582         loop.  This is useful.
19583
19584         * cs-parser.jay: Adjust the default parameters so that destructors
19585         have the proper signature.
19586
19587 2002-04-26  Martin Baulig  <martin@gnome.org>
19588
19589         * driver.cs (LoadAssembly): If `assembly' contains any characters
19590         which are only valid in path names and not in assembly names
19591         (currently slash, backslash and point), use Assembly.LoadFrom ()
19592         instead of Assembly.Load () on the `assembly' (before iteration
19593         over the link_paths).
19594
19595 2002-04-26  Martin Baulig  <martin@gnome.org>
19596
19597         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19598
19599 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19600
19601         * class.cs (Property): use the new typemanager.MemberLookup
19602
19603         (TypeContainer.MemberLookup): Implement using the
19604         TypeManager.MemberLookup now. 
19605
19606         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19607         and return MemberInfos, so that these can be used without an
19608         EmitContext (what we had before).
19609
19610 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19611
19612         * expression.cs: Fix the case where the argument to params if the
19613         type of the params.  I omitted handling this before.   Fixed
19614
19615 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19616
19617         * driver.cs: Call BootCorlib_PopulateCoreType
19618
19619         * class.cs (Property.CheckBase): Check for properties only, not
19620         for all members. 
19621
19622         * interface.cs: Temporary hack: try/catch around the
19623         CustomAttributeBuilder, because I am getting an exception that I
19624         do not understand.
19625
19626         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19627         types whose definitions are required to be there (attributes are
19628         defined before standard types).
19629
19630         Compute definitions as we boot the various types, as they are used
19631         immediately (value_type class will need object_type, but if we do
19632         not initialize object_type, we will pass a null, which will let
19633         the runtime pick the System.Object from the existing corlib, which
19634         is not what we want).
19635
19636 2002-04-22  Patrik Torstensson <totte@labs2.com>
19637
19638         * cs-tokenizer.cs: fixed a number of trim() issues.
19639
19640 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19641
19642         * expression.cs (Argument.Type): Ensure that we return the correct
19643         type when we have out or ref parameters [in which case we 
19644         append a "&"].
19645
19646 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19647
19648         * class.cs (Property, Indexer): Allow extern modifier in there. 
19649
19650         * typemanager.cs (InitBaseTypes): Initializes object_type and
19651         value_type, since those will be used early on during the bootstrap
19652         process to compile corlib.
19653
19654         (InitCoreTypes): Move code from here to InitBaseTypes.
19655
19656 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19657
19658         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19659         single-dimension arrays as using the ldlen opcode.  
19660
19661         Daniel Lewis discovered this optimization.  
19662
19663         * typemanager.cs: Add signature for System.Array::get_Length
19664
19665 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19666
19667         * statement.cs: report the error when the foreach does not apply to an
19668         array nor a collection.
19669
19670 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19671
19672         * expression.cs: Add implicit conversions to the operator ~.
19673
19674         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19675
19676         * typemanager.cs: Locate the decimal constructor.
19677
19678 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19679
19680         * attribute.cs: use the new property of TypeOf.
19681         * expression.cs: added 'get' property around typearg.
19682
19683         These changes fix a build breaker reported by NickD. Is this the
19684         correct way to fix?  If not, please, revert my changes and make it
19685         work :-).
19686
19687 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * attribute.cs: Add support for typeof in attribute invocations.
19690         I am not sure that this is right though.
19691
19692 2002-04-14  Duncan Mak  <duncan@ximian.com>
19693
19694         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19695         Binary.Operator.Division case.
19696
19697 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19698
19699         * class.cs (DefineType): Ensure that we do a proper check on
19700         attribute types and also register it with the TypeManager.
19701
19702         (TypeContainer.Targets): The default for attribute types is
19703         AttributeTargets.All.
19704
19705         * attribute.cs (ApplyAttributes): Registering the attribute type
19706         is done elsewhere, not when we discover we have a Usage attribute.
19707
19708 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19709
19710         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19711         and get rid of is_delegate parameter.
19712
19713         * everywhere : update.
19714
19715 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19716
19717         * cs-parser.jay (compilation_unit): Revamp completely to use
19718         some new ideas that I got from Rhys' grammar to solve the problems
19719         with assembly level attributes.
19720
19721         (outer_declaration): New grammar production.
19722
19723         (attribute_sections): Add.
19724
19725         (opt_attributes): Base on attribute_sections
19726
19727         (namespace_declaration): Allow opt_attributes to tackle the case
19728         when we have assembly level attributes - we are clever in this
19729         regard now ;-)
19730
19731         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19732         attributes in the non-global context.
19733
19734         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19735         instead of SetGlobalAttributes.
19736
19737         * class.cs, rootcontext.cs : Ensure we define and generate 
19738         attribute types before anything else.
19739
19740         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19741         and flag the new error -20 for the case when the attribute type
19742         does not have valid targets specified. csc does not catch this.
19743
19744         * ../errors/errors.txt : update for error # -20
19745
19746 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19747
19748         * support.cs (InternalParameters.ParameterModifier): Do some null
19749         checking and return sane values.
19750
19751         * class.cs (Method.Define): If we are a PInvoke method, ensure
19752         that we are static and extern. Report error # 601
19753
19754         * ../errors/cs0601.cs : Add test case for the above error.
19755
19756 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19757
19758         * rootcontext.cs (attribute_types): We need to keep type of
19759         all attribute types separately and emit code for them first.
19760
19761         (RegisterAttribute) : Implement.
19762
19763         * class.cs (DefineType): Check if the current Type is a custom
19764         attribute type and register it accordingly.
19765
19766         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19767         adding the first attribute twice and rename to
19768
19769         (SetGlobalAttributes): this.
19770
19771         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19772         lookups.
19773
19774         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19775         if we are processing global arguments. Hmm, I am unsure of this.
19776
19777 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19778
19779         * expression.cs: added static array of strings to avoid calling
19780         Enum.ToString () for Operator in Binary. Significant recover of
19781         performance.
19782
19783 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19784
19785         * class.cs (FindMembers): Allow the Builders of the various
19786         members to be null.  If they are skip them.  This only happens
19787         during the PInvoke declaration.
19788
19789 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19790
19791         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19792         failure, so we do not keep going afterwards.
19793
19794         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19795         wanted to pass `false' as the `is_delegate' argument.  If this is
19796         the case, why not use delegate_type == null to mean `is_delegate =
19797         false' and anything else as is_delegate = true.
19798
19799 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19800
19801         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19802         code for the section, not the beginning of the tests.
19803
19804 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19805
19806         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19807
19808         * expression.cs (Binary): same.  Warn about errors where we have
19809         Enum/Enum in operator + as well.
19810
19811 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19812
19813         * statement.cs:
19814                 - added support for switch(bool)
19815                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19816                 - add TableSwitchEmit() to handle table-based switch statements
19817
19818 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19819
19820         * expression.cs (Invocation.OverloadResolve): Factor out code which
19821         does parameter compatibility checking with arguments so that we can 
19822         re-use the code even from Delegate.VerifyApplicability
19823
19824         (VerifyArgumentsCompat): Move above code here.
19825
19826         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19827         and instead make a call to the above method.
19828
19829 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19830
19831         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19832         We use it to keep track of classes which are attribute types.
19833
19834 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19835
19836         * delegate.cs (Delegate.Define): Correctly define the types in the
19837         presence of fixed and array parameters.
19838
19839         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19840         doing FindMembers.
19841
19842         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19843         include NonPublic after the first iteration.
19844
19845         * class.cs (Indexer.CheckBase): Only check if both parents are
19846         non-null. 
19847
19848         * cs-parser.jay (accessor_body): If empty, set to null.
19849
19850         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19851         same code path here to resolve constants names that we did have in
19852         MemberAccess.DoResolve.  There is too much code duplicated here.
19853
19854 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19855
19856         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19857
19858         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19859         to MakeUnionSet.
19860
19861         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19862         tokens, numbers and strings.
19863
19864         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19865         parenthesis.
19866
19867         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19868         asyncronous parameters and the regular parameters.  
19869
19870         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19871         specify the target directory.
19872
19873         * expression.cs: (This.DoResolve): Simplify
19874         (As.Emit): Optimize, do not generate IsInst if the expression is
19875         always of the given type.
19876
19877         (Is.DoResolve): Bug fix, we were reporting both always/never for
19878         the is expression.
19879
19880         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19881         creating too many unnecessary arrays.
19882
19883 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19884
19885         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19886         fields instead of rolling our own initializer.   Takes care of all
19887         implicit conversions, and drops unnecessary static checks/argument.
19888
19889 2002-03-31  Dick Porter  <dick@ximian.com>
19890
19891         * driver.cs: use the GetDirectories() return values properly, and
19892         use "/" as path separator.
19893
19894 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19895
19896         * expression.cs (Unary): Optimize - - expr into expr.
19897         (Binary): Optimize a + (-b) into a -b.
19898
19899         * codegen.cs (CodeGen): Made all methods static.
19900
19901 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19902
19903         * rootcontext.cs: 
19904
19905         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19906         TypeBuilder property.
19907
19908         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19909         instead. 
19910
19911         * tree.cs: Removed the various RecordXXXX, and replaced with a
19912         single RecordDecl.  Removed all the accessor methods, and just
19913         left a single access point Type 
19914
19915         * enum.cs: Rename DefineEnum to DefineType.
19916
19917         * decl.cs: New abstract method `DefineType' used to unify the
19918         Defines for Enumerations, Interfaces, TypeContainers and
19919         Delegates.
19920
19921         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19922         LookupBaseClasses method that used to live in class.cs and
19923         interface.cs here, and renamed to FindType.
19924
19925         * delegate.cs: Implement DefineType.  Take advantage of the
19926         refactored pattern for locating the parent builder without taking
19927         the parent_builder argument (which we know does not work if we are
19928         nested, and triggering a toplevel definition).
19929
19930 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19931
19932         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19933         accessibility of a member has changed during override and report
19934         an error if so.
19935
19936         * class.cs (Method.Define, Property.Define): Only complain on
19937         overrides if the method is private, any other accessibility is
19938         fine (and since we just checked the permission is the same, we are
19939         good to go).
19940
19941         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19942         and elif are processed always.  The other pre-processing
19943         directives are only processed if we are "taking" the path
19944
19945 2002-03-29  Martin Baulig  <martin@gnome.org>
19946
19947         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19948         current location is not Null.
19949
19950         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19951         a separate method so we can profile it.
19952
19953         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19954         `span.Seconds' are just seconds, but no minutes or hours.
19955         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19956
19957 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19958
19959         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19960         Remove the gratuitous set of Final:
19961
19962                                 // If an interface implementation, then we can set Final.
19963                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19964                                     implementing.DeclaringType.IsInterface)
19965                                         flags |= MethodAttributes.Final;
19966
19967         I do not know what I was smoking when I used that.
19968
19969
19970         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19971         step into fixing the name resolution issues for delegates and
19972         unifying the toplevel name resolution.
19973
19974 2002-03-28  Martin Baulig  <martin@gnome.org>
19975
19976         * class.cs (Method.Emit): If we have a symbol writer, call its
19977         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19978         tell it about the current method.
19979
19980         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19981         writer that we're going to emit the first byte of IL code for a new
19982         statement (a new source line).
19983         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19984         EmitContext.Mark() before emitting any code.
19985
19986         * location.cs (SymbolDocument): Return null when we're Null.
19987
19988         * statement.cs (Statement): Moved the `Location loc' variable here.
19989         (Statement.EmitBoolExpression): If we have a symbol writer, call
19990         ec.Mark() before emitting any code to tell it that we're at the
19991         beginning of a new statement.
19992         (StatementExpression): Added `Location' argument to the constructor.
19993         (Block): Added public readonly variable `StartLocation' and public
19994         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19995         (Block): Added constructor which takes a start and end location.
19996         (Block.SetEndLocation): New method. This sets the end location.
19997         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19998         local variables we create.
19999         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20000         each statement and do also mark the begin and end of the block.
20001
20002         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20003         tell it the current lexer.Location, use Location.Null for the end of the
20004         block.
20005         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20006         current block, set its end location using SetEndLocation().
20007         (statement_expression): StatementExpression constructor now takes the
20008         lexer.Location as additional argument.
20009         (for_statement, declare_local_variables): Likewise.
20010         (declare_local_variables): When creating a new implicit block, use the
20011         new Block constructor and pass it the lexer.Location.
20012
20013 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20014
20015         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20016         members also on the parent interfaces recursively.
20017
20018 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20019
20020         * report.cs: Use new formats, since Gonzalo finished the missing
20021         bits. 
20022
20023         * expression.cs (Binary.ResolveOperator): added missing operator|
20024         operator& and operator^ for bool/bool.
20025
20026         * cs-parser.jay: CheckDef now takes a Location argument that is
20027         used to report errors more precisly (instead of reporting the end
20028         of a definition, we try to track something which is a lot closer
20029         to the source of the problem).
20030
20031         * cs-tokenizer.cs: Track global token use, so we can properly flag
20032         the use of #define/#undef after the first token has been seen.
20033
20034         Also, rename the reportXXXX to Error_DescriptiveName
20035
20036         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20037         TypeContainer, so that Enum and Interface can use this too.
20038
20039         * class.cs (TypeContainer.LookupInterfaceOrClass,
20040         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20041         `builder' argument.  Typically this was used to pass the parent
20042         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20043         the definition).  
20044
20045         The problem is that a nested class could trigger the definition of
20046         a toplevel class, and the builder would be obviously wrong in that
20047         case. 
20048
20049         So we drop this argument, and we compute dynamically the
20050         TypeBuilder/ModuleBuilder (the correct information was available
20051         to us anyways from DeclSpace.Parent)
20052
20053         * interface.cs (Interface.DefineInterface): Drop builder
20054         parameter cleanup like class.cs
20055
20056         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20057         like class.cs
20058
20059         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20060         values. 
20061
20062         (Try.Emit): Propagate the returns value from the statement.
20063
20064         (Return.Emit): Even if we are leavning 
20065
20066         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20067
20068         * modifiers.cs: Fix the computation of MethodAttributes flags.
20069
20070 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20071
20072         * driver.cs: allow compilation of files that start with '/'.
20073         Add a default case when checking the argument of --target.
20074
20075 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20076
20077         * interface.cs: Implement the same search algorithm for types in
20078         the interface code.
20079
20080         * delegate.cs: Do not allow multiple definition.
20081
20082         * Recovered ChangeLog that got accidentally amputated
20083
20084         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20085
20086         * rootcontext.cs: Load manually enum to allow core classes to
20087         contain enumerations.
20088
20089         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20090         Update to new static methods in TypeManager.
20091
20092         * typemanager.cs (GetMethod, GetConstructor): Use our
20093         implementation of FindMembers to find the members, since during
20094         corlib compilation, the types are TypeBuilders and GetMethod and
20095         GetConstructor do not work.
20096
20097         Make all methods in TypeManager static.
20098
20099         (InitCodeHelpers): Split the functionality from
20100         the InitCodeTypes function.
20101
20102         * driver.cs: Call InitCodeHelpers after we have populated the
20103         types. 
20104
20105         * cs-parser.jay (delegate_declaration): we did not used to compute
20106         the delegate name correctly for void delegates.
20107
20108 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20109
20110         * rootcontext.cs (RootContext): Init the interface_resolve_order
20111         and type_container_resolve_order always.
20112
20113         (ResolveCore, BootstrapCorlib_ResolveClass,
20114         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20115         compiler when compiling with --nostdlib
20116
20117         * class.cs (TypeContainer.DefineType): Check that our parent is
20118         not null.  This test is most important when we are bootstraping
20119         the core types.
20120
20121         * codegen.cs: Split out the symbol writing code.
20122
20123 2002-03-25  Martin Baulig  <martin@gnome.org>
20124
20125         * driver.cs (-g): Made -g an alias for --debug.
20126
20127 2002-03-24  Martin Baulig  <martin@gnome.org>
20128
20129         * codegen.cs (SymbolWriter): New public variable. Returns the
20130         current symbol writer.
20131         (CodeGen): Added `bool want_debugging_support' argument to the
20132          constructor. If true, tell the ModuleBuild that we want debugging
20133         support and ask it for the ISymbolWriter.
20134         (Save): If we have a symbol writer, call it's Close() method after
20135         saving the assembly.
20136
20137         * driver.c (--debug): New command line argument to create a
20138         debugger information file.
20139
20140         * location.cs (SymbolDocument): New public property. Returns an
20141         ISymbolDocumentWriter object for the current source file or null
20142         if we don't have a symbol writer.
20143
20144 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * driver.cs (LoadAssembly): Correctly return when all the paths
20147         have been tried and not before.
20148
20149         * statement.cs (Switch.Emit): return the actual coverage for this
20150         statement (returns/not-returns)
20151
20152         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20153         switch of the statement if we are the last switch section.  That
20154         kills two problems: try/catch problems (we used to emit an empty
20155         nop at the end) and switch statements where all branches would
20156         return. 
20157
20158 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20159
20160         * driver.cs: Add default assemblies (the equivalent to the
20161         Microsoft CSC.RSP file)
20162
20163         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20164         also update tokens_seen and set it to false.
20165
20166         * driver.cs: Implement --recurse for Mike.
20167
20168         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20169         correctly splitting out the paths.
20170
20171 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20172
20173         * interface.cs (Interface.PopulateProperty): Instead of using
20174         `parent' as the declaration space for the set parameters, use
20175         `this' 
20176
20177         * support.cs (InternalParameters): InternalParameters constructor
20178         takes a DeclSpace instead of a TypeContainer.
20179
20180         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20181         types are being initialized, load the address of it before calling
20182         the function.  
20183
20184         (New): Provide a mechanism to disable the generation of local
20185         value type temporaries when the caller will be providing us with
20186         an address to store it.
20187
20188         (ArrayCreation.EmitDynamicInitializers): Use it.
20189
20190 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20191
20192         * expression.cs (Invocation.EmitArguments): Only probe for array
20193         property if there is more than one argument.  Sorry about that.
20194
20195         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20196         empty param arrays.
20197
20198         * class.cs (Method.LabelParameters): Fix incorrect code path that
20199         prevented the `ParamArrayAttribute' from being applied to the
20200         params attribute.
20201
20202 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20203
20204         * support.cs (ReflectionParameters): Correctly compute whether the
20205         last argument is a params array.  Fixes the problem with
20206         string.Split ('a')
20207
20208         * typemanager.cs: Make the assemblies array always be non-null
20209         (empty, but non-null)
20210
20211         * tree.cs (RecordDecl): New function that abstracts the recording
20212         of names.  This reports error 101, and provides a pointer to the
20213         previous declaration.  Fixes a crash in the compiler.
20214
20215         * cs-parser.jay (constructor_declaration): Update to new grammar,
20216         and provide a constructor_body that can be empty.
20217
20218 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20219
20220         * driver.cs: Add support for --resources.
20221
20222         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20223         Make all types for the various array helper methods be integer.
20224
20225         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20226         CheckState to ConvCast.
20227
20228         (ConvCast): Now it takes a `checked' state argument, to avoid
20229         depending on the emit context for the conversion, and just using
20230         the resolve time setting.
20231
20232         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20233         instead of Invocation.EmitArguments.  We do not emit the original
20234         arguments, instead we emit those which have been converted to
20235         unsigned int expressions.
20236
20237         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20238
20239         * codegen.cs: ditto.
20240
20241         * expression.cs (LocalVariableReference): Drop the use of the
20242         Store function that depended on the variable index.
20243
20244         * statement.cs (VariableInfo): Drop the `Idx' property from this
20245         class, as this is not taking into account the indexes for
20246         temporaries tat we generate during the execution, getting the
20247         indexes wrong.
20248
20249         * class.cs: First emit class initializers, then call the parent
20250         constructor. 
20251
20252         * expression.cs (Binary): Fix opcode emision.
20253         (UnaryMutator.EmitCode): Support checked code generation
20254
20255         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20256         matches for events for both the Static and Instance scans,
20257         pointing to the same element.   Fix that.
20258
20259 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * rootcontext.cs (ResolveTree): Always set the
20262         interface_resolve_order, because nested interfaces will be calling
20263         into us.
20264
20265         * class.cs (GetInterfaceOrClass): Track the same resolution
20266         process used by TypeManager.LookupType.  This fixes the nested
20267         type lookups in class declarations (separate path from
20268         LookupType). 
20269
20270         (TypeContainer.DefineType): Also define nested interfaces.
20271         (TypeContainer.RegisterOrder): New public function used to
20272         register the order in which child interfaces need to be closed.
20273
20274         Nested interfaces need to be closed after their parents have been
20275         created. 
20276
20277         * interface.cs (InterfaceAttr): Put all the logic for computing
20278         the interface attribute here. 
20279
20280         (DefineInterface): Register our interface order with the
20281         RootContext or with the TypeContainer depending on the case.
20282
20283 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20284
20285         * cs-parser.jay: rework foreach statement to work with the new
20286         changes to the policy on SimpleNames.
20287
20288         * report.cs: support Stacktrace on warnings as well.
20289
20290         * makefile: drop --unsafe and /unsafe from the compile.
20291
20292 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20293
20294         * ecore.cs (StandardConversionExists): Modify to take an Expression
20295         as the first parameter. Ensure we do null -> reference type conversion
20296         checking.
20297
20298         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20299         temporary Expression objects.
20300
20301 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20302
20303         * interface.cs: workaround bug in method overloading resolution
20304         (there is already a bugzilla bug for it).
20305
20306 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20307
20308         We could also solve this problem by having a separate path for
20309         performing type lookups, instead of DoResolve, we could have a
20310         ResolveType entry point, and only participating pieces of the
20311         production (simplename, deref, array) would implement this. 
20312
20313         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20314         signal SimpleName to only resolve type names and not attempt to
20315         resolve anything else.
20316
20317         * expression.cs (Cast): Set the flag.
20318
20319         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20320
20321         * class.cs: Only report 108 if there is no `new' modifier.
20322
20323         * cs-parser.jay: rework foreach statement to work with the new
20324         changes to the policy on SimpleNames.
20325         
20326         * report.cs: support Stacktrace on warnings as well.
20327
20328         * makefile: drop --unsafe and /unsafe from the compile.
20329
20330 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20331
20332         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20333         lookups here, instead of doing that at parse time.  This means
20334         that our grammar will not introduce `LocalVariableReferences' as
20335         expressions at this point.  That solves the problem of code like
20336         this:
20337
20338         class X {
20339            static void Main ()
20340            { int X = 1;
20341             { X x = null }}}
20342
20343         This is only half the fix.  The full fix requires parameters to
20344         also be handled in this way.
20345
20346         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20347         makes the use more obvious of the DeclSpace.  The
20348         ec.TypeContainer.TypeBuilder is now only used to pull the
20349         TypeBuilder for it.
20350
20351         My theory is that I can get rid of the TypeBuilder completely from
20352         the EmitContext, and have typecasts where it is used (from
20353         DeclSpace to where it matters).  
20354
20355         The only pending problem is that the code that implements Aliases
20356         is on TypeContainer, and probably should go in DeclSpace.
20357
20358         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20359         lookups here, instead of doing that at parse time.  This means
20360         that our grammar will not introduce `LocalVariableReferences' as
20361         expressions at this point.  That solves the problem of code like
20362         this:
20363
20364         class X {
20365            static void Main ()
20366            { int X = 1;
20367             { X x = null }}}
20368
20369         This is only half the fix.  The full fix requires parameters to
20370         also be handled in this way.
20371
20372         * class.cs (Property.DefineMethod): When implementing an interface
20373         method, set newslot, when implementing an abstract method, do not
20374         set the flag (before we tried never setting it, or always setting
20375         it, which is the difference).
20376         (Indexer.DefineMethod): same.
20377         (Method.DefineMethod): same.
20378
20379         * ecore.cs: Only set the status used flag if we get back a Field.
20380
20381         * attribute.cs: Temporary hack, so Paolo can keep working.
20382
20383 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20384
20385         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20386         the unmanaged type in the case we have a MarshalAs attribute.
20387
20388         (Resolve): Handle the case when we are parsing the special MarshalAs
20389         attribute [we need to store the unmanaged type to use later]
20390
20391         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20392         MarshalAs Attribute.
20393
20394         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20395         on parameters and accordingly set the marshalling info.
20396
20397 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20398
20399         * class.cs: Optimizing slightly by removing redundant code after
20400         we switched to the `NoTypes' return value.
20401         (Property.DefineMethod): use NoTypes here too.
20402
20403         This fixes the bug I introduced in my last batch of changes.
20404
20405 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20406
20407         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20408
20409         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20410         Enums since those are types too. 
20411
20412         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20413
20414         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20415         thanks to a call during the lookup process.
20416
20417 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20418
20419         * statement.cs (Foreach): Lots of work to accomodate a particular
20420         kind of foreach statement that I had not kept in mind.  It is
20421         possible to have foreachs on classes that provide a GetEnumerator
20422         method that return objects that implement the "pattern" for using
20423         a foreach, there is no need to support GetEnumerator
20424         specifically. 
20425
20426         This is needed to compile nant.
20427
20428         * decl.cs: Only report 114 if the member is not `Finalize' and if
20429         the warning level is at least 2.
20430
20431         * class.cs: Moved the compare function from Method to
20432         MethodSignature. 
20433
20434         (MethodSignature.InheritableMemberSignatureCompare): Add new
20435         filter function that is used to extract inheritable methods from a
20436         class. 
20437
20438         (Method.Define): Use the new `inheritable_method_signature_filter'
20439         delegate
20440
20441         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20442         command. 
20443
20444 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20445
20446         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20447
20448         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20449
20450         * expression.cs: Pass location information to
20451         ConvertImplicitStandard. 
20452
20453         * class.cs: Added debugging code to track return values from
20454         interfaces. 
20455
20456 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20457
20458         * expression.cs (Is.DoResolve): If either side of the `is' is an
20459         interface, do not flag the warning.
20460
20461         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20462         for interfaces
20463
20464         * report.cs: Allow for --fatal to be used with --probe.
20465
20466         * typemanager.cs (NoTypes): Move the definition for the empty Type
20467         array here. 
20468
20469         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20470         properties. 
20471         (TypeContainer.DefineProxy): New function used to proxy to parent
20472         implementations when implementing interfaces.
20473         (TypeContainer.ParentImplements): used to lookup if our parent
20474         implements a public function that is required by an interface.
20475         (TypeContainer.VerifyPendingMethods): Hook this up.
20476
20477         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20478         `modules' and `assemblies' arraylists into arrays.  We only grow
20479         these are the very early start up of the program, so this improves
20480         the speedof LookupType (nicely measured).
20481
20482         * expression.cs (MakeByteBlob): Replaced unsafe code with
20483         BitConverter, as suggested by Paolo.
20484
20485         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20486         folding of string concatenation, but if either side is a string,
20487         and the other is not, then return null, and let the runtime use
20488         the concatenation on the string plus the object (using
20489         `Object.ToString'). 
20490
20491 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20492
20493         Constant Folding has been implemented now.
20494
20495         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20496         the error instead on types that are not supported in one's
20497         complement. 
20498
20499         * constant.cs (Constant and all children): New set of functions to
20500         perform implict and explicit conversions.
20501
20502         * ecore.cs (EnumConstant): Implement the new functions to perform
20503         conversion by proxying to the child expression.
20504
20505         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20506         own separate setting that can not be turned off from the command
20507         line using --unchecked or --checked and is only controlled using
20508         the checked/unchecked statements and expressions.  This setting is
20509         used by the constant folder to flag errors.
20510
20511         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20512         ConstantCheckState as well.   
20513
20514         During Resolve, they also have to flag the state, because the
20515         constant folder runs completely in the Resolve phase.
20516
20517         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20518         well.
20519
20520 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20521
20522         * cfold.cs: New file, this file contains the constant folder.
20523
20524         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20525         argument to track whether we are using the resulting address to
20526         load or store a value and provide better error messages. 
20527
20528         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20529         new AddressOf arguments.
20530
20531         * statement.cs (Foreach.EmitCollectionForeach): Update
20532
20533         * expression.cs (Argument.Emit): Call AddressOf with proper
20534         arguments to track usage.
20535
20536         (New.DoEmit): Call AddressOf with new arguments.
20537
20538         (Unary.Emit): Adjust AddressOf call.
20539
20540 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20541
20542         * cs-parser.jay (member_access): Change the case for pre-defined types
20543         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20544         this suggestion.
20545
20546         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20547         a method body.
20548
20549         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20550         essentially like methods and apply attributes like MethodImplOptions to them too.
20551
20552         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20553         not being null.
20554
20555         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20556         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20557         is the DeclSpace.
20558
20559         * Update code everywhere accordingly.
20560
20561         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20562
20563         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20564
20565 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20566
20567         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20568         try performing lookups against those instead of jumping straight into using
20569         the 'using' clauses.
20570
20571         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20572
20573         (LookupType): Perform lookups in implicit parents too.
20574
20575         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20576         sequence as RootContext.LookupType. 
20577
20578         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20579         the various cases of namespace lookups into this method.
20580
20581 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20582
20583         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20584         in positional arguments)
20585
20586         * class.cs (Operator): Update the AllowedModifiers to contain
20587         extern. 
20588
20589         * cs-parser.jay: Update operator declaration to allow for the
20590         operator body to be empty.
20591
20592         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20593         values. 
20594
20595 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20596
20597         * class.cs (Method.Emit): Label parameters.
20598
20599         * driver.cs: Return 1 or 0 as the program exit code.
20600
20601 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20602
20603         * expression.cs: Special case the `null' object when trying to
20604         auto-compute the type, as anything can be explicitly converted to
20605         that. 
20606
20607         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20608         spotting this Paolo.
20609
20610         (Expression.ImplicitNumericConversion): Perform comparissions of
20611         the type using the underlying type in the case of an enumeration
20612         rather than using the enumeration type for the compare.
20613
20614         Cope with the underlying == type case, which is not possible to
20615         catch before. 
20616
20617         (Expression.ConvertNumericExplicit): Perform comparissions of
20618         the type using the underlying type in the case of an enumeration
20619         rather than using the enumeration type for the compare.
20620
20621         * driver.cs: If the user does not supply an extension, assume .exe
20622
20623         * cs-parser.jay (if_statement): Rewrote so that we can track the
20624         location for the if statement.
20625
20626         * expression.cs (Binary.ConstantFold): Only concat strings when
20627         the operation is "+", not everything ;-)
20628
20629         * statement.cs (Statement.EmitBoolExpression): Take a location
20630         argument. 
20631         (If, While, Do): Track location.
20632
20633         * expression.cs (Binary.ResolveOperator): In the object + string
20634         case, I was missing a call to ConvertImplicit
20635
20636 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20637
20638         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20639         Location arguments. Ensure we use RootContext.LookupType to do our work
20640         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20641
20642         * interface.cs (PopulateMethod): Handle the type of the parameter being
20643         null gracefully.
20644
20645         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20646         have a params method with no fixed arguments and a call is made with no
20647         arguments.
20648
20649 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20650
20651         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20652         the verbatim-string-literal
20653
20654         * support.cs (InternalParameters.ParameterModifier): handle null
20655         fixed parameters.
20656         (InternalParameters.ParameterType): ditto.
20657
20658         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20659         duplicating the name of the variable parameter.
20660         (GetParameterByName): Fix bug where we were not looking up array
20661         paramters if they were the only present (thanks Paolo!).
20662         (GetParameterInfo): We only have an empty set of types if both
20663         fixed and array are set to null.
20664         (GetParameterInfo-idx): Handle FixedParameter == null
20665
20666         * cs-parser.jay: Handle the case where there is no catch
20667         statements (missing null test).
20668
20669 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20670
20671         * driver.cs (MainDriver): Be conservative on our command line
20672         handling.
20673
20674         Catch DirectoryNotFoundException when calling GetFiles.
20675
20676         (SplitPathAndPattern): Used to split the input specification into
20677         a path and a pattern that we can feed to Directory.GetFiles.
20678
20679 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20680
20681         * statement.cs (Fixed): Implement the last case of the Fixed
20682         statement (string handling).
20683
20684         * expression.cs (StringPtr): New class used to return a char * to
20685         a string;  Used by the Fixed statement.
20686
20687         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20688
20689         * expression.cs (Binary.ResolveOperator): Remove redundant
20690         MemberLookup pn parent type.
20691         Optimize union call, we do not need a union if the types are the same.
20692         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20693         type.
20694
20695         Specialize the use of MemberLookup everywhere, instead of using
20696         the default settings. 
20697
20698         (StackAlloc): Implement stackalloc keyword.
20699
20700         * cs-parser.jay: Add rule to parse stackalloc.
20701
20702         * driver.cs: Handle /h, /help, /?
20703
20704         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20705         before we supported unsafe code.
20706
20707         * makefile: add --unsafe to the self compilation of mcs.
20708
20709 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20710
20711         * expression.cs (PointerArithmetic): New class that is used to
20712         perform pointer arithmetic.
20713         (Binary.Resolve): Handle pointer arithmetic
20714         Handle pointer comparission.
20715         (ArrayPtr): Utility expression class that is used to take the
20716         address of an array.
20717
20718         (ElementAccess): Implement array access for pointers
20719
20720         * statement.cs (Fixed): Implement fixed statement for arrays, we
20721         are missing one more case before we are done.
20722
20723         * expression.cs (Indirection): Implement EmitAssign and set the
20724         ExprClass to Variable.  This allows pointer dereferences to be
20725         treated as variables, and to have values assigned to them.
20726
20727         * ecore.cs (Expression.StoreFromPtr): New utility function to
20728         store values dereferencing.
20729
20730 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20731
20732         * expression.cs (Binary.ResolveOperator): Ensure that we are
20733         not trying to operate on a void type - this fixes the reported
20734         bug.
20735
20736         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20737         the parent implementation is sealed.
20738
20739         * ../errors/cs0239.cs : Add.
20740
20741         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20742
20743         * typemanager.cs (unverifiable_code_type): Corresponds to 
20744         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20745         which have unsafe code in them.
20746
20747         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20748         unsafe context.
20749
20750 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20751
20752         * cs-tokenizer.cs: Add support for @"litreal strings"
20753
20754         Make tokenizer accept pre-processor directives
20755         on any column (remove the old C-like limitation). 
20756
20757         * rootcontext.cs (EmitCode): Emit any global attributes.
20758         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20759
20760         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20761
20762         * cs-parser.jay: Add support for global attributes.  
20763
20764 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20765
20766         * expression.cs (Indirection): New helper class.  Unary will
20767         create Indirection classes to be able to implement the
20768         IMemoryLocation interface on it.
20769
20770 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20771
20772         * cs-parser.jay (fixed_statement): reference the right statement.
20773
20774         * statement.cs (Fixed.Emit): Finish implementing the fixed
20775         statement for the &x case.
20776
20777 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * class.cs (Property.Define, Method.Define): Remove newslot when
20780         `implementing'.  
20781
20782         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20783         wrong.  NewSlot should only be used if the `new' keyword is present.
20784
20785         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20786         locating our system dir.  Sorry about this.
20787
20788 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20789
20790         * driver.cs (GetSystemDir): Compute correctly the location of our
20791         system assemblies.  I was using the compiler directory instead of
20792         the library directory.
20793
20794 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20795
20796         * expression.cs (BetterFunction): Put back in what Miguel commented out
20797         since it is the correct fix. The problem is elsewhere ;-)
20798
20799         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20800         parameters of the parms method are themselves compatible or not !
20801
20802         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20803         to check that a class implements an interface before saying that an implicit
20804         conversion was allowed. Use ImplementsInterface to do the checking.
20805
20806 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20807
20808         * class.cs (Method.Define): Track whether we are an explicit
20809         implementation or not.  And only call DefineMethodOverride if we
20810         are an explicit implementation.
20811
20812         (Property.DefineMethod): Ditto.
20813
20814 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20815
20816         * expression.cs (BetterFunction): Catch hideous bug which was
20817          preventing us from detecting ambiguous calls due to implicit casts i.e
20818         cs0121.
20819
20820 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20821
20822         * support.cs (Pair): Remove un-needed method.  I figured why I was
20823         getting the error in cs-parser.jay, the variable in a foreach loop
20824         is readonly, and the compiler does not really treat this as a variable.
20825
20826         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20827         instead of EQUALS in grammar.  
20828
20829         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20830
20831         * expression.cs (Unary.DoResolve): Check whether the argument is
20832         managed or not.
20833
20834 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20835
20836         * support.cs: Api for Pair to set a value.  Despite the fact that
20837         the variables are public the MS C# compiler refuses to compile
20838         code that accesses the field if the variable is part of a foreach
20839         statement. 
20840
20841         * statement.cs (Fixed): Begin implementation of the fixed
20842         statement.
20843
20844         (Block.AddVariable): Return the VariableInfo on success and null
20845         on failure instead of true/false. 
20846
20847         * cs-parser.jay (foreach): Catch errors on variables already
20848         defined (we were ignoring this value before) and properly unwind
20849         the block hierarchy
20850
20851         (fixed_statement): grammar for the fixed statement.
20852
20853 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20854
20855         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20856         pointer types to be incretemented.
20857
20858         (SizeOf): Implement.
20859
20860         * cs-parser.jay (pointer_member_access): Implement
20861         expr->IDENTIFIER production.
20862
20863         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20864         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20865         on safe contexts.
20866
20867         (Unary): Implement indirection.
20868
20869         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20870         use in non-unsafe context).
20871
20872         (SimpleName.DoResolve): Check for pointers in field access on safe
20873         contexts. 
20874
20875         (Expression.LoadFromPtr): Factor the load-indirect code in this
20876         function.  This was duplicated in UnboxCast and ParameterReference
20877
20878 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20879
20880         * expression.cs (ComposedCast): report an error if a pointer cast
20881         is used in a safe region.
20882
20883         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20884         pointer type casts in unsafe context.
20885
20886         * codegen.cs (EmitContext): Set up IsUnsafe.
20887
20888         * cs-parser.jay (non_expression_type): Add productions for pointer
20889         casts. 
20890
20891         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20892         code.  We should not use force into static mode if the method is
20893         not virtual.  Fixes bug in MIS
20894
20895         * statement.cs (Do.Emit, While.Emit, For.Emit,
20896         Statement.EmitBoolExpression): Add support to Do and While to
20897         propagate infinite loop as `I do return' semantics.
20898
20899         Improve the For case to also test for boolean constants.
20900
20901         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20902         to the list of attributes we can add.
20903
20904         Remove `EmitContext' argument.
20905
20906         * class.cs (Method.Define): Apply parameter attributes.
20907         (Constructor.Define): Apply parameter attributes.
20908         (MethodCore.LabelParameters): Move here the core of labeling
20909         parameters. 
20910
20911         * support.cs (ReflectionParameters.ParameterModifier,
20912         InternalParameters.ParameterModifier): Use IsByRef on the type and
20913         only return the OUT bit for these parameters instead of in/out/ref
20914         flags.
20915
20916         This is because I miss-understood things.  The ParameterInfo.IsIn
20917         and IsOut represent whether the parameter has the [In] and [Out]
20918         attributes set.  
20919
20920 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20921
20922         * ecore.cs (FieldExpr.Emit): Release temporaries.
20923
20924         * assign.cs (LocalTemporary.Release): new function.
20925
20926         * codegen.cs (EmitContext.GetTemporaryStorage,
20927         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20928         temporary storage.  Now we can "put back" localbuilders when we
20929         are done with them
20930
20931 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20932
20933         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20934         need to make a copy of the variable to generate verifiable code.
20935
20936 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20937
20938         * driver.cs: Compute dynamically the system directory.
20939
20940         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20941         Slower, but more generally useful.  Used by the abstract
20942         registering implementation. 
20943
20944         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20945         the rules for the special rule on Type/instances.  First check if
20946         we have the same name, and if so, try that special static path
20947         rather than the instance path.
20948
20949 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20950
20951         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20952         for, while and if.
20953
20954         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20955         Enum, ValueType, Delegate or Array for non-corlib compiles.
20956
20957         * cs-tokenizer.cs: Catch long identifiers (645)
20958
20959         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20960         piece of code.
20961
20962         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20963         fix, we were returning too early, so we were not registering
20964         pending methods from abstract classes.
20965
20966         Do not register pending methods if the class is abstract.
20967
20968         * expression.cs (Conditional.DoResolve): Report circular implicit
20969         conversions when we neecd to compute it for conditional
20970         expressions. 
20971
20972         (Is.DoResolve): If the expression is always of the provided type,
20973         flag warning 183.  If the expression can not ever be of the
20974         provided type flag warning 184.
20975
20976         * class.cs: Catch 169 as well.
20977
20978         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20979         read. 
20980
20981 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20982
20983         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20984
20985 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20986
20987         * interface.cs: (PopulateMethod): Check for pointers being defined
20988         only if the unsafe context is active.
20989         (PopulateProperty): ditto.
20990         (PopulateIndexer): ditto.
20991
20992         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20993         specified.  If pointers are present, make sure that they are
20994         present in an unsafe context.
20995         (Constructor, Constructor.Define): ditto.
20996         (Field, Field.Define): ditto.
20997         (Property, Property.Define): ditto.
20998         (Event, Event.Define): ditto.
20999
21000         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21001         hashtable if there are classes or structs defined.
21002
21003         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21004         code, as the constant resolution moved.
21005
21006         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21007         the metadata, so we can flag error 133. 
21008
21009         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21010         pointer is being declared in an unsafe context.
21011
21012 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21013
21014         * modifiers.cs (Modifiers.Check): Require a Location argument.
21015         Report error 227 for Unsafe use.
21016
21017         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21018
21019         * statement.cs (For.Emit): If the test is null, then report that
21020         we do `return', as we wont reach anything afterwards.
21021
21022         (Switch.SwitchGoverningType): Track the expression that matched
21023         the conversion.
21024
21025         * driver.cs: Allow negative numbers as an error code to flag.
21026
21027         * cs-parser.jay: Handle 1551.
21028
21029         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21030
21031 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21032
21033         * cs-parser.jay: Report 1518 (type declaration can only contain
21034         class, struct, interface, enum or delegate)
21035
21036         (switch_label): Report 1523 (keywords `case' or `default' must
21037         preced code)
21038
21039         (opt_switch_sections): Report 1522 (empty switch)
21040
21041         * driver.cs: Report 1515 (response file specified multiple times)
21042         Report 1516 (Source file specified multiple times).
21043
21044         * expression.cs (Argument.Resolve): Signal 1510
21045
21046         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21047         access not allowed in static code)
21048
21049 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21050
21051         * typemanager.cs (IsPointerType): Utility method which we are going
21052         to need a lot.
21053
21054         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21055         the object type, so we take care of that.
21056
21057         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21058
21059         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21060         added to non-params parameters :-)
21061
21062         * typemanager.cs (CSharpName): Include 'void' type too. 
21063
21064         (void_ptr_type): Include in the set of core types.
21065
21066         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21067         duplicating code.
21068
21069         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21070         an unsafe context.
21071
21072         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21073         completely forgotten about it.
21074
21075 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21076
21077         * cs-parser.jay (pointer_type): Add. This begins our implementation
21078         of parsing rules for unsafe code.
21079
21080         (unsafe_statement): Implement.
21081
21082         (embedded_statement): Modify to include the above.
21083
21084         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21085
21086         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21087         if the current context is an unsafe one.
21088
21089         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21090         are handled differently, we need separate rules for them.
21091
21092         (local_variable_declaration): Update to use local_variable_pointer_type
21093         to allow variable declarations of unmanaged pointer types.
21094
21095         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21096         in unsafe contexts.
21097
21098         * ../errors/cs0214.cs : Add.
21099
21100 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21101
21102         * makefile: remove 'response' file when cleaning.
21103
21104 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21105
21106         * cs-parser.jay: Report 1524.
21107
21108 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21109
21110         * typemanager.cs (RegisterMethod): drop checking if we have
21111         registered this from here
21112
21113 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21114
21115         * class.cs (Method.EmitDestructor): Implement calling our base
21116         destructor. 
21117
21118         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21119         value of InFinally.
21120
21121         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21122         this routine and will wrap the call in a try/catch block.  Deal
21123         with the case.
21124
21125 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21126
21127         * ecore.cs (Expression.MemberLookup): instead of taking a
21128         parameter `same_type' that was used to tell whether we could
21129         access private members we compute our containing type from the
21130         EmitContext.
21131
21132         (FieldExpr): Added partial support for volatile fields.  This does
21133         not work for volatile fields exposed from assemblies, as I can not
21134         figure out how to extract the modreq from it.
21135
21136         Updated all the source files to use this.
21137
21138         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21139         because it is referenced by MemberLookup very often. 
21140
21141 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21142
21143         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21144         TypeBuilder.GetCustomAttributes to retrieve what we need.
21145
21146         Get rid of redundant default_member_attr_type as this is the same as
21147         default_member_type which already exists.
21148
21149         * interface.cs, attribute.cs : Update accordingly.
21150
21151 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21152
21153         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21154         work for TYpeBuilders though.  Ravi, can you please fix this?
21155
21156         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21157
21158         * expression.cs (Argument.Emit): Handle the case of ref objects
21159         being passed to ref functions;  
21160
21161         (ParameterReference.EmitLoad): Loads the content of the pointer
21162         without dereferencing.
21163
21164 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21165
21166         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21167
21168 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21169
21170         * class.cs (Indexer.DefineMethod): Incorporate the interface
21171         type in the name of the method if we are doing explicit interface
21172         implementation.
21173
21174         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21175
21176         (BetterConversion): Fix extremely trivial bug where we were referring to
21177         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21178         again !
21179
21180         * ../errors/bug16.cs : Add although we have fixed it.
21181
21182 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21183
21184         * expression.cs (BaseIndexer): Begin implementation.
21185
21186         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21187
21188         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21189         production directly to remove a shift/reduce, and implement
21190         explicit interface implementation.
21191
21192         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21193         after a floating point suffix.
21194
21195         * expression.cs (DoNumericPromotions): Improved the conversion for
21196         uint/uint.  If we have a constant, we avoid doing a typecast to a
21197         larger type.
21198
21199         * class.cs (Indexer): Implement explicit interface implementation
21200         for indexers.
21201
21202 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21203
21204         * class.cs: make the default instance constructor public and hidebysig.
21205
21206 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21207
21208         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21209         so we can call it from elsewhere.
21210
21211         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21212         we emit it internally if the class has a defined indexer; otherwise the user
21213         emits it by decorating the class definition with the DefaultMemberAttribute.
21214
21215         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21216         attribute is not used on a type which defines an indexer.
21217
21218         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21219         character when we skip whitespace.
21220
21221         * ../errors/cs0646.cs : Add.
21222
21223 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21224
21225         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21226         again. 
21227
21228         * makefile: Add practical target `mcs3.exe' which builds the third
21229         generation compiler. 
21230
21231         * expression.cs (New): Fix structures constructor calling.
21232
21233         * class.cs (Property, Method, Indexer): Emit Final flag on the
21234         method if we are an interface implementation and we are not
21235         abstract. 
21236
21237         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21238         whether this property is referencing a `base' method.
21239
21240         * expression.cs (Invocation.EmitCall): take an extra argument:
21241         is_base, this is used to determine whether the `call' or
21242         `callvirt' opcode should be used.
21243
21244
21245         * delegate.cs: update EmitCall.
21246
21247         * class.cs (Method.Define): Set NewSlot for the cases where we are
21248         not implementing an interface method.
21249
21250         (Property.Define): ditto.
21251
21252 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21253
21254         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21255         'r'.  Allows mcs to parse itself fully.
21256
21257 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21258
21259         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21260         of the number of initializers that require the InitializeArray method.
21261
21262         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21263         update the above field where necessary.
21264
21265         (MakeByteBlob): Update accordingly.
21266
21267         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21268         greater than 2.
21269
21270         (EmitDynamicInitializers): Update in accordance with the new optimization.
21271
21272         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21273         same OpCode applies.
21274
21275         * cs-parser.jay : Fix some glaring errors I introduced.
21276
21277 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21278
21279         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21280         so that we can check for name clashes there too.
21281
21282         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21283         for interface indexers.
21284
21285         * interfaces.cs (Define): Emit the default member attribute.
21286
21287         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21288         variable was being referred to while setting the value ;-)
21289
21290 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21291
21292         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21293         byte-by-byte information when we know the data is zero.
21294
21295         Make the block always a multiple of 4, because
21296         DefineInitializedData has a bug.
21297
21298         * assign.cs: Fix, we should assign from the temporary, not from
21299         the source. 
21300
21301         * expression.cs (MakeByteBlob): Fix my incorrect code.
21302
21303 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21304
21305         * typemanager.cs (EnumToUnderlying): This function is used to get
21306         the underlying type from an enumeration, because it does not
21307         always work. 
21308
21309         * constant.cs: Use the I4_S form for values between -128 and 127.
21310
21311         * statement.cs (Block.LookupLabel): Looks up a label.
21312         (Block): Drop support for labeled blocks.
21313
21314         (LabeledStatement): New kind of statement that represents a label
21315         only.
21316
21317         (Goto): Finally implement this bad boy.
21318
21319         * cs-parser.jay: Update to reflect new mechanism to implement
21320         labels.
21321
21322 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21323
21324         * codegen.cs (EmitContext.This): a codegen property that keeps the
21325         a single instance of this instead of creating many different this
21326         instances. 
21327
21328         * delegate.cs (Delegate.DoResolve): Update to use the property;
21329
21330         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21331
21332         * expression.cs (BaseAccess.DoResolve): Ditto.
21333
21334 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21335
21336         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21337         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21338
21339         (InitCoreTypes): Update accordingly.
21340
21341         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21342         so we can quickly store the state.
21343
21344         (ApplyAttributes): Set the correct implementation flags
21345         for InternalCall methods.
21346
21347 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21348
21349         * expression.cs (EmitCall): if a method is not virtual, then do
21350         not use callvirt on it.
21351
21352         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21353         user defined stuff) requires the use of stobj, which takes an
21354         address on the stack instead of an array and an index.  So emit
21355         the Ldelema operation for it.
21356
21357         (EmitStoreOpcode): Use stobj for valuetypes.
21358
21359         (UnaryMutator.EmitCode): Use the right 1 value depending on
21360         whether we are dealing with int64/uint64, float or doubles.
21361
21362         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21363         constructors that I implemented last night.
21364
21365         (Constructor.IsDefault): Fix to work properly for static
21366         constructors.
21367
21368         * cs-parser.jay (CheckDef): report method signature errors.
21369         Update error number 103 to be 132.
21370
21371         * decl.cs: New AdditionResult enumeration value: MethodExists.
21372         Although we do this check for methods later on in the semantic
21373         analysis, catching repeated default constructors is so easy that
21374         we catch these here. 
21375
21376         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21377         promotions code.
21378
21379         (ParameterReference.EmitAssign, Emit): handle
21380         bools as bytes.
21381
21382         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21383         (ArrayAccess.EmitStoreOpcode): ditto.
21384
21385         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21386
21387         * expression.cs (MakeByteBlob): Complete all the missing types
21388         (uint, short, ushort, byte, sbyte)
21389
21390         * class.cs: Only init instance field initializers on instance
21391         constructors. 
21392
21393         Rename `constructors' to instance_constructors. 
21394
21395         (TypeContainer.AddConstructor): Only add constructors to the list
21396         if it is not static.
21397
21398         Make sure that we handle default_static_constructor independently
21399         everywhere where we handle instance_constructors
21400
21401 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21402
21403         * class.cs: Do not lookup or create a base initializer for a
21404         static constructor.
21405
21406         (ConstructorInitializer.Resolve): use the proper type to lookup
21407         for constructors.
21408
21409         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21410
21411         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21412         in DeclSpace. 
21413
21414         * decl.cs: CloseType is now an virtual method, the default
21415         implementation just closes this type.
21416
21417 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21418
21419         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21420         to PreserveSig by default. Also emit HideBySig on such methods.
21421
21422         Basically, set the defaults to standard values.
21423
21424         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21425         argument, if candidate is better, it can't be worse than the best !
21426
21427         (Invocation): Re-write bits to differentiate between methods being
21428         applicable in their expanded form and their normal form - for params
21429         methods of course.
21430
21431         Get rid of use_standard everywhere as only standard conversions are allowed
21432         in overload resolution. 
21433
21434         More spec conformance.
21435
21436 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21437
21438         * driver.cs: Add --timestamp, to see where the compiler spends
21439         most of its time.
21440
21441         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21442         `this' in static code.
21443
21444         (SimpleName.DoResolve): Implement in terms of a helper function
21445         that allows static-references to be passed upstream to
21446         MemberAccess.
21447
21448         (Expression.ResolveWithSimpleName): Resolve specially simple
21449         names when called by MemberAccess to implement the special
21450         semantics. 
21451
21452         (Expression.ImplicitReferenceConversion): Handle conversions from
21453         Null to reference types before others, as Null's type is
21454         System.Object. 
21455
21456         * expression.cs (Invocation.EmitCall): Handle the special case of
21457         calling methods declared on a reference type from a ValueType
21458         (Base classes System.Object and System.Enum)
21459
21460         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21461         the left hand side is a TypeExpr, not on every enumeration. 
21462
21463         (Binary.Resolve): If types are reference types, then do a cast to
21464         object on operators != and == of both arguments.
21465
21466         * typemanager.cs (FindMembers): Extract instance and static
21467         members if requested.
21468
21469         * interface.cs (PopulateProperty): Use void_type instead of null
21470         as the return type for the setter method.
21471
21472         (PopulateIndexer): ditto.
21473
21474 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21475
21476         * support.cs (ReflectionParameters): Fix minor bug where we
21477         were examining the wrong parameter for the ParamArray attribute.
21478
21479         Cope with requests for the type of the parameter at position
21480         greater than the params parameter's. We now return the element
21481         type of the params array as that makes more sense.
21482
21483         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21484         accordingly as we no longer have to extract the element type
21485         ourselves.
21486
21487         (Invocation.OverloadResolve): Update.
21488
21489 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21490
21491         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21492         against IEnumerator, test whether the return value is a descendant
21493         of the IEnumerator interface.
21494
21495         * class.cs (Indexer.Define): Use an auxiliary method to implement
21496         the other bits of the method definition.  Begin support for
21497         explicit interface implementation.
21498
21499         (Property.DefineMethod): Use TypeManager.void_type instead of null
21500         for an empty return value.
21501
21502 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21503
21504         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21505         dealing with a FieldExpr which is composed of a FieldBuilder, in
21506         the code path we did extract the constant, but we should have
21507         obtained the underlying value to be able to cast it (otherwise we
21508         end up in an infinite loop, this is what Ravi was running into).
21509
21510         (ArrayCreation.UpdateIndices): Arrays might be empty.
21511
21512         (MemberAccess.ResolveMemberAccess): Add support for section
21513         14.5.4.1 that deals with the special case of E.I when E is a type
21514         and something else, that I can be a reference to a static member.
21515
21516         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21517         handle a particular array type to create byte blobs, it is just
21518         something we dont generate byteblobs for.
21519
21520         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21521         arguments. 
21522
21523         * location.cs (Push): remove the key from the hashtable that we
21524         are about to add.   This happens for empty files.
21525
21526         * driver.cs: Dispose files after we have parsed them.
21527
21528         (tokenize): new function that only runs the tokenizer on its
21529         input, for speed testing.
21530
21531 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21532
21533         * class.cs (Event.Define): Define the private field only if there
21534         are no accessors defined.
21535
21536         * expression.cs (ResolveMemberAccess): If there is no associated
21537         field with the event, that means we have an event defined with its
21538         own accessors and we should flag error cs0070 since transforming
21539         ourselves into a field is not valid in that case.
21540
21541         * ecore.cs (SimpleName.DoResolve): Same as above.
21542
21543         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21544         and charset to sane values.
21545
21546 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21547
21548         * assign.cs (DoResolve): Perform check on events only if they 
21549         are being accessed outside the declaring type.
21550
21551         * cs-parser.jay (event_declarations): Update rules to correctly
21552         set the type of the implicit parameter etc.
21553
21554         (add_accessor, remove_accessor): Set current local parameters.
21555
21556         * expression.cs (Binary): For delegate addition and subtraction,
21557         cast the return value from the method into the appropriate delegate
21558         type.
21559
21560 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21561
21562         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21563         of these as the workaround is unnecessary.
21564
21565         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21566         delegate data - none of that is needed at all.
21567
21568         Re-write bits to extract the instance expression and the delegate method
21569         correctly.
21570
21571         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21572         on delegates too.
21573
21574         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21575         of attaching attributes instead of duplicating code everywhere.
21576
21577         * everywhere : Update code to do attribute emission using the above method.
21578
21579 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21580
21581         * expression.cs (IsParamsMethodApplicable): if there are not
21582         parameters, return immediately.
21583
21584         * ecore.cs: The 0 literal can be implicity converted to an enum
21585         type. 
21586
21587         (SimpleName.DoResolve): First lookup the type, then lookup the
21588         members. 
21589
21590         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21591         want to get its address.  If the InstanceExpression is not
21592         addressable, store the result in a temporary variable, then get
21593         the address of it.
21594
21595         * codegen.cs: Only display 219 errors on warning level or above. 
21596
21597         * expression.cs (ArrayAccess): Make it implement the
21598         IMemoryLocation interface.
21599
21600         (Binary.DoResolve): handle the operator == (object a, object b)
21601         and operator != (object a, object b) without incurring into a
21602         BoxedCast (because 5 != o should never be performed).
21603
21604         Handle binary enumerator operators.
21605
21606         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21607         value type, otherwise use Ldelem_ref.
21608
21609         Use precomputed names;
21610
21611         (AddressOf): Implement address of
21612
21613         * cs-parser.jay (labeled_statement): Fix recursive block
21614         addition by reworking the production.
21615
21616         * expression.cs (New.DoEmit): New has a special case:
21617                 
21618                  If we are dealing with a ValueType, we have a few
21619                  situations to deal with:
21620                 
21621                     * The target of New is a ValueType variable, that is
21622                       easy, we just pass this as the variable reference
21623                 
21624                     * The target of New is being passed as an argument,
21625                       to a boxing operation or a function that takes a
21626                       ValueType.
21627                 
21628                       In this case, we need to create a temporary variable
21629                       that is the argument of New.
21630
21631
21632 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21633
21634         * rootcontext.cs (LookupType): Check that current_type is not null before
21635         going about looking at nested types.
21636
21637         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21638         not implement the IAssignMethod interface any more.
21639
21640         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21641         where we tranform them into FieldExprs if they are being resolved from within
21642         the declaring type.
21643
21644         * ecore.cs (SimpleName.DoResolve): Do the same here.
21645
21646         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21647
21648         * ../errors/bug10.cs : Add.
21649
21650         * ../errors/cs0070.cs : Add.
21651
21652         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21653
21654         * assign.cs : Get rid of EventIsLocal everywhere.
21655
21656 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21657
21658         * ecore.cs (ConvertIntLiteral): finished the implementation.
21659
21660         * statement.cs (SwitchLabel): Convert the value we are using as a
21661         key before looking up the table.
21662
21663 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21664
21665         * codegen.cs (EmitTopBlock): Require a Location argument now.
21666
21667         * cs-parser.jay (constructor_declarator): We need to setup
21668         current_local_parameters before we parse the
21669         opt_constructor_initializer, to allow the variables to be bound
21670         to the constructor arguments.
21671
21672         * rootcontext.cs (LookupType): First lookup nested classes in our
21673         class and our parents before we go looking outside our class.
21674
21675         * expression.cs (ConstantFold): Extract/debox the values at the
21676         beginnning. 
21677
21678         * rootcontext.cs (EmitCode): Resolve the constants first before we
21679         resolve the types.  This is not really needed, but it helps debugging.
21680
21681         * statement.cs: report location.
21682
21683         * cs-parser.jay: pass location to throw statement.
21684
21685         * driver.cs: Small bug fix.
21686
21687         * report.cs: Updated format to be 4-zero filled digits.
21688
21689 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21690
21691         * expression.cs (CheckIndices): Fix minor bug where the wrong
21692         variable was being referred to ;-)
21693
21694         (DoEmit): Do not call EmitStaticInitializers when the 
21695         underlying type is System.Object.
21696
21697 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21698
21699         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21700         and do the usual workaround for SRE.
21701
21702         * class.cs (MyEventBuilder.EventType): New member to get at the type
21703         of the event, quickly.
21704
21705         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21706
21707         * assign.cs (Assign.DoResolve): Handle the case when the target
21708         is an EventExpr and perform the necessary checks.
21709
21710         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21711         interface.
21712
21713         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21714
21715         (EventExpr): Set the type in the constructor itself since we 
21716         are meant to be born fully resolved.
21717
21718         (EventExpr.Define): Revert code I wrote earlier.
21719                 
21720         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21721         instance expression is null. The instance expression is a This in that case
21722         or a null, depending on whether it is a static method or not.
21723
21724         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21725         refers to more than one method.
21726
21727         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21728         and accordingly flag errors.
21729
21730 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21731
21732         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21733
21734 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21735
21736         * location.cs (ToString): Provide useful rutine.
21737
21738 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21739
21740         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21741         objects, return the actual integral boxed.
21742
21743         * statement.cs (SwitchLabel): define an ILLabel for each
21744         SwitchLabel. 
21745
21746         (Switch.CheckSwitch): If the value is a Literal, extract
21747         the underlying literal.
21748
21749         Also in the unused hashtable we had, add the SwitchLabel so we can
21750         quickly look this value up.
21751
21752         * constant.cs: Implement a bunch of new constants.  Rewrite
21753         Literal based on this.  Made changes everywhere to adapt to this.
21754
21755         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21756         dereferencing array only once, and also copes with enumrations.
21757
21758         bytes are two bytes wide, not one.
21759
21760         (Cast): Perform constant conversions.
21761
21762         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21763         wrappers to the literals here.
21764
21765         * expression.cs (DoNumericPromotions): long literals can converted
21766         to ulong implicity (this is taken care of elsewhere, but I was
21767         missing this spot).
21768
21769         * ecore.cs (Expression.Literalize): Make the return type Literal,
21770         to improve type checking.
21771
21772         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21773
21774 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21775
21776         * literal.cs: Revert code from ravi that checked the bounds.  The
21777         bounds are sane by the definition of the type itself. 
21778
21779         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21780         need to actually look up in our parent hierarchy for interfaces
21781         implemented. 
21782
21783         * const.cs: Use the underlying type for enumerations
21784
21785         * delegate.cs: Compute the basename for the delegate creation,
21786         that should fix the delegate test case, and restore the correct
21787         Type Lookup semantics in rootcontext
21788
21789         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21790         referencing a nested type with the Reflection API is using the "+"
21791         sign. 
21792
21793         * cs-parser.jay: Do not require EOF token at the end.
21794
21795 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21796
21797         * rootcontext.cs (LookupType): Concatenate type names with
21798         a '.' instead of a '+' The test suite passes again.
21799
21800         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21801         field of the enumeration.
21802
21803         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21804         the case when the member is an EventExpr.
21805
21806         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21807         static has an associated instance expression.
21808
21809         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21810
21811         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21812
21813         * class.cs (Event.Define): Register event and perform appropriate checks
21814         for error #111.
21815
21816         We define the Add and Remove methods even if the use provides none because
21817         in that case, we provide default implementations ourselves.
21818
21819         Define a private field of the type of the event. This is done by the CSC compiler
21820         and we should be doing it too ;-)
21821
21822         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21823         More methods we use in code we generate.
21824
21825         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21826         is important.
21827
21828         (InitCoreTypes): Update accordingly for the above.
21829
21830         * class.cs (Event.Emit): Generate code for default accessors that we provide
21831
21832         (EmitDefaultMethod): Do the job in the above.
21833
21834         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21835         appropriate place.
21836
21837 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21838
21839         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21840         builders even if we were missing one.
21841
21842         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21843         pass the Basename as our class name instead of the Name.  The
21844         basename will be correctly composed for us.
21845
21846         * parameter.cs (Paramters): Now takes a Location argument.
21847
21848         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21849         make all the code call directly LookupType in RootContext and take
21850         this chance to pass the Location information everywhere.
21851
21852         * Everywhere: pass Location information.
21853
21854 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21855
21856         * class.cs (Constructor.Define): Updated way of detecting the
21857         length of the parameters.
21858
21859         (TypeContainer.DefineType): Use basename as the type name for
21860         nested types.
21861
21862         (TypeContainer.Define): Do not recursively define types here, as
21863         definition is taken care in order by the RootContext.
21864
21865         * tree.cs: Keep track of namespaces in a per-file basis.
21866
21867         * parameter.cs (Parameter.ComputeSignature): Update to use
21868         DeclSpace. 
21869
21870         (Parameters.GetSignature): ditto.
21871
21872         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21873         instead of a TypeContainer.
21874
21875         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21876         resolve names.  Because we need to be resolve in our context, not
21877         our parents.
21878
21879         * driver.cs: Implement response files.
21880
21881         * class.cs (TypeContainer.DefineType): If we are defined, do not
21882         redefine ourselves.
21883
21884         (Event.Emit): Emit the code for add/remove handlers.
21885         (Event.Define): Save the MethodBuilders for add/remove.
21886
21887         * typemanager.cs: Use pair here too.
21888
21889         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21890         DictionaryEntry requires the first argument to be non-null.  
21891
21892         (enum_declaration): Compute full name for registering the
21893         enumeration.
21894
21895         (delegate_declaration): Instead of using
21896         formal_parameter_list, use opt_formal_parameter_list as the list
21897         can be empty.
21898
21899         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21900         (EventParsing): New property that controls whether `add' and
21901         `remove' are returned as tokens or identifiers (for events);
21902
21903 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21904
21905         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21906         use MyEventBuilder only and let it wrap the real builder for us.
21907
21908         (MyEventBuilder): Revamp constructor etc.
21909
21910         Implement all operations that we perform on EventBuilder in precisely the same
21911         way here too.
21912
21913         (FindMembers): Update to use the EventBuilder member.
21914
21915         (Event.Emit): Update accordingly.
21916
21917 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21918
21919         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21920         by calling the appropriate methods.
21921
21922         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21923         useful.
21924
21925         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21926
21927 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21928
21929         * delegate.cs (Delegate.Populate): Check that the return type
21930         and various parameters types are indeed accessible.
21931
21932         * class.cs (Constructor.Define): Same here.
21933
21934         (Field.Define): Ditto.
21935
21936         (Event.Define): Ditto.
21937
21938         (Operator.Define): Check that the underlying Method defined itself
21939         correctly - so it's MethodBuilder should not be null.
21940
21941         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21942         expression happens to be null.
21943
21944         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21945         members but as of now we don't seem to be able to do anything really useful with it.
21946
21947         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21948         not the EventBuilder.
21949
21950 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21951
21952         * cs-tokenizer.cs: Add support for defines.
21953         Add support for #if, #elif, #else, #endif
21954
21955         (eval_var): evaluates a variable.
21956         (eval): stubbed for evaluating functions.
21957
21958         * cs-parser.jay: Pass the defines information
21959
21960         * driver.cs: Add --define command line option.
21961
21962         * decl.cs: Move MemberCore here.
21963
21964         Make it the base class for DeclSpace.  This allows us to catch and
21965         report 108 and 109 for everything now.
21966
21967         * class.cs (TypeContainer.Define): Extract all the members
21968         before populating and emit the warning 108 (new keyword required
21969         to override) instead of having each member implement this.
21970
21971         (MemberCore.Define): New abstract method, we will be using this in
21972         the warning reporting engine in Populate.
21973
21974         (Operator.Define): Adjust to new MemberCore protocol. 
21975
21976         * const.cs (Const): This does not derive from Expression, it is a
21977         temporary object we use to create fields, it is a MemberCore. 
21978
21979         * class.cs (Method.Define): Allow the entry point to be in a
21980         specific class.
21981
21982         * driver.cs: Rewrite the argument handler to clean it up a bit.
21983
21984         * rootcontext.cs: Made it just an auxiliary namespace feature by
21985         making everything static.
21986
21987         * driver.cs: Adapt code to use RootContext type name instead of
21988         instance variable.
21989
21990         * delegate.cs: Remove RootContext argument.
21991
21992         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21993         argument. 
21994
21995         * class.cs (Event.Define): The lookup can fail.
21996
21997         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21998
21999         * expression.cs: Resolve the this instance before invoking the code.
22000
22001 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22002
22003         * cs-parser.jay: Add a production in element_access that allows
22004         the thing to become a "type" reference.  This way we can parse
22005         things like "(string [])" as a type.
22006
22007         Note that this still does not handle the more complex rules of
22008         casts. 
22009
22010
22011         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22012
22013         * ecore.cs: (CopyNewMethods): new utility function used to
22014         assemble the list of methods from running FindMembers.
22015
22016         (MemberLookup): Rework FindMembers so that 
22017
22018 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22019
22020         * class.cs (TypeContainer): Remove Delegates who fail to be
22021         defined.
22022
22023         * delegate.cs (Populate): Verify that we dont get null return
22024         values.   TODO: Check for AsAccessible.
22025
22026         * cs-parser.jay: Use basename to emit error 574 (destructor should
22027         have the same name as container class), not the full name.
22028
22029         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22030         possible representation.  
22031
22032         Also implements integer type suffixes U and L.
22033
22034 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22035
22036         * expression.cs (ArrayCreation.DoResolve): We need to do the
22037         argument resolution *always*.
22038
22039         * decl.cs: Make this hold the namespace.  Hold the root context as
22040         well.
22041         (LookupType): Move here.
22042
22043         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22044
22045         * location.cs (Row, Name): Fixed the code, it was always returning
22046         references to the first file.
22047
22048         * interface.cs: Register properties defined through interfaces.
22049
22050         * driver.cs: Add support for globbing on the command line
22051
22052         * class.cs (Field): Make it derive from MemberCore as well.
22053         (Event): ditto.
22054
22055 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22056
22057         * class.cs (Event::Define): Check that the type of the event is a delegate
22058         type else flag error #66.
22059
22060         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22061         same.
22062
22063         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22064         values of EntryPoint, CharSet etc etc.
22065
22066         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22067
22068         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22069         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22070         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22071         which needs this to do its work.
22072
22073         * ../errors/cs0066.cs : Add.
22074
22075 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22076
22077         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22078         helper functions.
22079
22080         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22081         clears out the parameters field.
22082         (MemberSignatureCompare): Cleanup
22083
22084         (MemberCore): New base class used to share code between MethodCore
22085         and Property.
22086
22087         (RegisterRequiredImplementations) BindingFlags.Public requires
22088         either BindingFlags.Instace or Static.  Use instance here.
22089
22090         (Property): Refactored code to cope better with the full spec.
22091
22092         * parameter.cs (GetParameterInfo): Return an empty array instead
22093         of null on error.
22094
22095         * class.cs (Property): Abstract or extern properties have no bodies.
22096
22097         * parameter.cs (GetParameterInfo): return a zero-sized array.
22098
22099         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22100         method modifier validation to the typecontainer so we can reuse
22101         this on properties.
22102
22103         (MethodCore.ParameterTypes): return an empty sized array of types.
22104
22105         (Property.Define): Test property modifier validity.
22106
22107         Add tests for sealed/override too.
22108
22109         (Method.Emit): abstract or extern methods have no bodies.
22110
22111 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22112
22113         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22114         thing.
22115
22116         (Method::Define, ::Emit): Modify accordingly.
22117
22118         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22119
22120         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22121
22122         * makefile: Pass in /unsafe.
22123
22124 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22125
22126         * class.cs (MakeKey): Kill routine.
22127
22128         * class.cs (TypeContainer.Define): Correctly define explicit
22129         method implementations (they require the full interface name plus
22130         the method name).
22131
22132         * typemanager.cs: Deply the PtrHashtable here and stop using the
22133         lame keys.  Things work so much better.
22134
22135         This of course broke everyone who depended on `RegisterMethod' to
22136         do the `test for existance' test.  This has to be done elsewhere.
22137
22138         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22139         the object stupid Equals method (because, that like fails all over
22140         the place).  We still do not use it.
22141
22142         * class.cs (TypeContainer.SetRequiredInterface,
22143         TypeContainer.RequireMethods): Killed these two routines and moved
22144         all the functionality to RegisterRequiredImplementations.
22145
22146         (TypeContainer.RegisterRequiredImplementations): This routine now
22147         registers all the implementations required in an array for the
22148         interfaces and abstract methods.  We use an array of structures
22149         which can be computed ahead of time to reduce memory usage and we
22150         also assume that lookups are cheap as most classes will not
22151         implement too many interfaces.
22152
22153         We also avoid creating too many MethodSignatures.
22154
22155         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22156         clear the "pending" bit if we find that there are problems with
22157         the declaration.
22158
22159         (TypeContainer.VerifyPendingMethods): Update to report errors of
22160         methods that look like implementations but are not.
22161
22162         (TypeContainer.Define): Add support for explicit interface method
22163         implementation. 
22164
22165 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22166
22167         * typemanager.cs: Keep track of the parameters here instead of
22168         being a feature of the TypeContainer.
22169
22170         * class.cs: Drop the registration of parameters here, as
22171         InterfaceMethods are also interface declarations.
22172
22173         * delegate.cs: Register methods with the TypeManager not only with
22174         the TypeContainer.  This code was buggy.
22175
22176         * interface.cs: Full registation here.
22177
22178 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22179
22180         * expression.cs: Remove reducer for binary expressions, it can not
22181         be done this way.
22182
22183         * const.cs: Put here the code that used to go into constant.cs
22184
22185         * constant.cs: Put here the code for constants, this is a new base
22186         class for Literals.
22187
22188         * literal.cs: Make Literal derive from Constant.
22189
22190 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22191
22192         * statement.cs (Return.Emit): Report error 157 if the user
22193         attempts to return from a finally block.
22194
22195         (Return.Emit): Instead of emitting a return, jump to the end of
22196         the function.
22197
22198         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22199         LocalBuilder to store the result of the function.  ReturnLabel is
22200         the target where we jump.
22201
22202
22203 2001-12-09  Radek Doulik  <rodo@ximian.com>
22204
22205         * cs-parser.jay: remember alias in current namespace
22206
22207         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22208         namespaces
22209
22210         * class.cs (LookupAlias): lookup alias in my_namespace
22211
22212         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22213         aliases hashtable
22214         (LookupAlias): lookup alias in this and if needed in parent
22215         namespaces
22216
22217 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22218
22219         * support.cs: 
22220
22221         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22222         making things static.  I need this to avoid passing the
22223         TypeContainer when calling ParameterType.
22224
22225         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22226         that did string manipulation to compute the type and then call
22227         GetType.  Use Parameter.ParameterType instead.
22228
22229         * cs-tokenizer.cs: Consume the suffix for floating values.
22230
22231         * expression.cs (ParameterReference): figure out whether this is a
22232         reference parameter or not.  Kill an extra variable by computing
22233         the arg_idx during emission.
22234
22235         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22236         function that returns whether a parameter is an out/ref value or not.
22237
22238         (Parameter.ParameterType): The type of the parameter (base,
22239         without ref/out applied).
22240
22241         (Parameter.Resolve): Perform resolution here.
22242         (Parameter.ExternalType): The full type (with ref/out applied).
22243
22244         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22245         support for expressions on the using statement.
22246
22247 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22248
22249         * statement.cs (Using.EmitLocalVariableDecls): Split the
22250         localvariable handling of the using statement.
22251
22252         (Block.EmitMeta): Keep track of variable count across blocks.  We
22253         were reusing slots on separate branches of blocks.
22254
22255         (Try.Emit): Emit the general code block, we were not emitting it. 
22256
22257         Check the type of the declaration to be an IDisposable or
22258         something that can be implicity converted to it. 
22259
22260         Emit conversions if required.
22261
22262         * ecore.cs (EmptyExpression): New utility class.
22263         (Expression.ImplicitConversionExists): New utility function.
22264
22265 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22266
22267         * statement.cs (Using): Implement.
22268
22269         * expression.cs (LocalVariableReference): Support read only variables.
22270
22271         * statement.cs: Remove the explicit emit for the Leave opcode.
22272         (VariableInfo): Add a readonly field.
22273
22274 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22275
22276         * ecore.cs (ConvCast): new class used to encapsulate the various
22277         explicit integer conversions that works in both checked and
22278         unchecked contexts.
22279
22280         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22281         properly generate the overflow opcodes.
22282
22283 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22284
22285         * statement.cs: The correct type for the EmptyExpression is the
22286         element_type, not the variable type.  Ravi pointed this out.
22287
22288 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22289
22290         * class.cs (Method::Define): Handle PInvoke methods specially
22291         by using DefinePInvokeMethod instead of the usual one.
22292
22293         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22294         above to do the task of extracting information and defining the method.
22295
22296 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22297
22298         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22299         of the condition for string type.
22300
22301         (Emit): Move that here. 
22302
22303         (ArrayCreation::CheckIndices): Keep string literals in their expression
22304         form.
22305
22306         (EmitDynamicInitializers): Handle strings appropriately.
22307
22308 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22309
22310         * codegen.cs (EmitContext): Replace multiple variables with a
22311         single pointer to the current Switch statement.
22312
22313         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22314         EmitContext.
22315
22316 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22317
22318         * statement.cs 
22319
22320         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22321         default'.
22322
22323         (Foreach.Emit): Foreach on arrays was not setting
22324         up the loop variables (for break/continue).
22325
22326         (GotoCase): Semi-implented.
22327
22328 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22329
22330         * attribute.cs (CheckAttribute): Handle system attributes by using
22331         Attribute.GetAttributes to examine information we need.
22332
22333         (GetValidPlaces): Same here.
22334
22335         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22336
22337         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22338
22339         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22340
22341         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22342
22343         (Method::Emit): Handle the case when we are a PInvoke method.
22344
22345 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22346
22347         * expression.cs: Use ResolveWithSimpleName on compound names.
22348
22349 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22350
22351         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22352         before trying to reduce it.
22353
22354         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22355
22356         * constant.cs (LookupConstantValue): Implement.
22357
22358         (EmitConstant): Use the above in emitting the constant.
22359
22360         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22361         that are user-defined by doing a LookupConstantValue on them.
22362
22363         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22364         too, like above.
22365
22366 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22367
22368         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22369
22370         (BaseAccess.DoResolve): Implement.
22371
22372         (MemberAccess.DoResolve): Split this routine into a
22373         ResolveMemberAccess routine that can be used independently
22374
22375 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22376
22377         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22378         As that share bits of the implementation.  Is returns a boolean,
22379         while As returns the Type that is being probed.
22380
22381 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22382
22383         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22384         instead of a Literal - much easier.
22385
22386         (EnumInTransit): Remove - utterly useless :-)
22387
22388         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22389
22390         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22391
22392         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22393         chain when we have no associated expression.
22394
22395 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22396
22397         * constant.cs (Define): Use Location while reporting the errror.
22398
22399         Also emit a warning when 'new' is used and there is no inherited
22400         member to hide.
22401
22402         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22403         populated.
22404
22405         (LookupEnumValue): Implement to lookup an enum member's value and define it
22406         if necessary.
22407
22408         (Populate): Re-write accordingly to use the above routine.
22409
22410 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22411
22412         * expression.cs (This): Fix prototype for DoResolveLValue to
22413         override the base class DoResolveLValue.
22414
22415         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22416         declarations) 
22417
22418         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22419         (we need to load the address of the field here).  This fixes
22420         test-22. 
22421
22422         (FieldExpr.DoResolveLValue): Call the DoResolve
22423         function to initialize the Instance expression.
22424
22425         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22426         correctly the GetEnumerator operation on a value type.
22427
22428         * cs-parser.jay: Add more simple parsing error catches.
22429
22430         * statement.cs (Switch): Add support for string switches.
22431         Handle null specially.
22432
22433         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22434
22435 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22436
22437         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22438
22439         (declare_local_constant): New helper function.
22440
22441         * statement.cs (AddConstant): Keep a separate record of constants
22442
22443         (IsConstant): Implement to determine if a variable is a constant.
22444
22445         (GetConstantExpression): Implement.
22446
22447         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22448
22449         * statement.cs (IsVariableDefined): Re-write.
22450
22451 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22452
22453         * class.cs (TypeContainer::FindMembers): Look for constants
22454         in the case when we are looking for MemberTypes.Field
22455
22456         * expression.cs (MemberAccess::DoResolve): Check that in the
22457         case we are a FieldExpr and a Literal, we are not being accessed
22458         by an instance reference.
22459
22460         * cs-parser.jay (local_constant_declaration): Implement.
22461
22462         (declaration_statement): Implement for constant declarations.
22463
22464 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22465
22466         * statement.cs (Switch): Catch double defaults.
22467
22468         (Switch): More work on the switch() statement
22469         implementation.  It works for integral values now, need to finish
22470         string support.
22471
22472
22473 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22474
22475         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22476         integer literals into other integer literals.  To be used by
22477         switch. 
22478
22479 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22480
22481         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22482         some memory.
22483
22484         (EmitDynamicInitializers): Cope with the above since we extract data
22485         directly from ArrayData now.
22486
22487         (ExpectInitializers): Keep track of whether initializers are mandatory
22488         or not.
22489
22490         (Bounds): Make it a hashtable to prevent the same dimension being 
22491         recorded for every element in that dimension.
22492
22493         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22494         from being found.
22495
22496         Also fix bug which was causing the indices to be emitted in the reverse
22497         order.
22498
22499 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22500
22501         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22502         unfinished.  They do not work, because the underlying code is
22503         sloppy.
22504
22505 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22506
22507         * cs-parser.jay: Remove bogus fixme.
22508
22509         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22510         on Switch statement.
22511
22512 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22513
22514         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22515         the same. 
22516
22517         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22518         parameter. Apparently, any expression is allowed. 
22519
22520         (ValidateInitializers): Update accordingly.
22521
22522         (CheckIndices): Fix some tricky bugs thanks to recursion.
22523
22524         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22525         I was being completely brain-dead.
22526
22527         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22528         and re-write acordingly.
22529
22530         (DelegateInvocation): Re-write accordingly.
22531
22532         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22533
22534         (MakeByteBlob): Handle types more correctly.
22535
22536         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22537         initialization from expressions but it is incomplete because I am a complete
22538         Dodo :-|
22539
22540 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22541
22542         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22543         on If.  Basically, we have to return `true' (ie, we do return to
22544         our caller) only if both branches of the if return.
22545
22546         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22547         short-circuit operators, handle them as short circuit operators. 
22548
22549         (Cast.DoResolve): Resolve type.
22550         (Cast.Cast): Take an expression as the target type.
22551
22552         * cs-parser.jay (cast_expression): Remove old hack that only
22553         allowed a limited set of types to be handled.  Now we take a
22554         unary_expression and we resolve to a type during semantic
22555         analysis.
22556
22557         Use the grammar productions from Rhys to handle casts (this is
22558         not complete like Rhys syntax yet, we fail to handle that corner
22559         case that C# has regarding (-x), but we will get there.
22560
22561 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22562
22563         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22564         field which is an array type.
22565
22566         * cs-parser.jay (declare_local_variables): Support array initialization too.
22567
22568         * typemanager.cs (MakeKey): Implement.
22569
22570         (everywhere): Use the above appropriately.
22571
22572         * cs-parser.jay (for_statement): Update for array initialization while
22573         declaring variables.
22574
22575         * ecore.cs : The error message was correct, it's the variable's names that
22576         were misleading ;-) Make the code more readable.
22577
22578         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22579         the correct type etc.
22580
22581         (ConvertExplicit): Handle Enum types by examining the underlying type.
22582
22583 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22584
22585         * parameter.cs (GetCallingConvention): Always return
22586         CallingConventions.Standard for now.
22587
22588 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22589
22590         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22591         and `r' after calling DoNumericPromotions.
22592
22593         * ecore.cs: Fix error message (the types were in the wrong order).
22594
22595         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22596         BindingFlags.Instance as well 
22597
22598         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22599         implicit int literal conversion in an empty cast so that we
22600         propagate the right type upstream.
22601
22602         (UnboxCast): new class used to unbox value types.
22603         (Expression.ConvertExplicit): Add explicit type conversions done
22604         by unboxing.
22605
22606         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22607         the target type before applying the implicit LongLiterals to ULong
22608         literal cast.
22609
22610 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22611
22612         * cs-parser.jay (for_statement): Reworked the way For works: now
22613         we declare manually any variables that are introduced in
22614         for_initializer to solve the problem of having out-of-band code
22615         emition (that is what got for broken).
22616
22617         (declaration_statement): Perform the actual variable declaration
22618         that used to be done in local_variable_declaration here.
22619
22620         (local_variable_declaration): Do not declare anything, just pass
22621         the information on a DictionaryEntry
22622
22623 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22624
22625         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22626         re-write of the logic to now make it recursive.
22627
22628         (UpdateIndices): Re-write accordingly.
22629
22630         Store element data in a separate ArrayData list in the above methods.
22631
22632         (MakeByteBlob): Implement to dump the array data into a byte array.
22633
22634 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22635
22636         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22637         into CheckIndices.
22638
22639         * constant.cs (Define): Implement.
22640
22641         (EmitConstant): Re-write fully.
22642
22643         Pass in location info.
22644
22645         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22646         respectively.
22647
22648         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22649         DictionaryEntry since we need location info too.
22650
22651         (constant_declaration): Update accordingly.
22652
22653         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22654         code into another method : UpdateIndices.
22655
22656 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22657
22658         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22659         some type checking etc.
22660
22661 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22662
22663         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22664         bits to provide dimension info if the user skips doing that.
22665
22666         Update second constructor to store the rank correctly.
22667
22668 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22669
22670         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22671         and try to implement.
22672
22673         * ../errors/cs0150.cs : Add.
22674
22675         * ../errors/cs0178.cs : Add.
22676
22677 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22678
22679         * statement.cs: Implement foreach on multi-dimensional arrays. 
22680
22681         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22682         name of the params argument.
22683
22684         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22685         initializing the array.
22686
22687         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22688         we can use this elsewhere.
22689
22690         * statement.cs: Finish implementation of foreach for single
22691         dimension arrays.
22692
22693         * cs-parser.jay: Use an out-of-band stack to pass information
22694         around, I wonder why I need this.
22695
22696         foreach_block: Make the new foreach_block the current_block.
22697
22698         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22699         function used to return a static Parameters structure.  Used for
22700         empty parameters, as those are created very frequently.
22701
22702         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22703
22704 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22705
22706         * interface.cs : Default modifier is private, not public. The
22707         make verify test passes again.
22708
22709 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22710
22711         * support.cs (ReflectionParameters): Fix logic to determine
22712         whether the last parameter is a params one. Test 9 passes again.
22713
22714         * delegate.cs (Populate): Register the builders we define with
22715         RegisterParameterForBuilder. Test 19 passes again.
22716
22717         * cs-parser.jay (property_declaration): Reference $6 instead
22718         of $$ to get at the location.
22719
22720         (indexer_declaration): Similar stuff.
22721
22722         (attribute): Ditto.
22723
22724         * class.cs (Property): Register parameters for the Get and Set methods
22725         if they exist. Test 23 passes again.
22726
22727         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22728         call to EmitArguments as we are sure there aren't any params arguments. 
22729         Test 32 passes again.
22730
22731         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22732         IndexOutOfRangeException. 
22733
22734         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22735         Test 33 now passes again.
22736
22737 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22738
22739         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22740         broke a bunch of things.  Will have to come up with a better way
22741         of tracking locations.
22742
22743         * statement.cs: Implemented foreach for single dimension arrays.
22744
22745 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22746
22747         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22748         an error.  This removes the lookup from the critical path.
22749
22750         * cs-parser.jay: Removed use of temporary_loc, which is completely
22751         broken. 
22752
22753 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22754
22755         * support.cs (ReflectionParameters.ParameterModifier): Report
22756         whether the argument is a PARAMS argument or not.
22757
22758         * class.cs: Set the attribute `ParamArrayAttribute' on the
22759         parameter argument.
22760
22761         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22762         and cons_param_array_attribute (ConstructorInfo for
22763         ParamArrayAttribute)., 
22764
22765         * codegen.cs: Emit the return using the `Return' statement, that
22766         way we can report the error correctly for missing return values. 
22767
22768         * class.cs (Method.Emit): Clean up.
22769
22770         * expression.cs (Argument.Resolve): Take another argument: the
22771         location where this argument is used.  Notice that this is not
22772         part of the "Argument" class as to reduce the size of the
22773         structure (we know the approximate location anyways).
22774
22775         Test if the argument is a variable-reference, if not, then
22776         complain with a 206.
22777
22778         (Argument.Emit): Emit addresses of variables.
22779
22780         (Argument.FullDesc): Simplify.
22781
22782         (Invocation.DoResolve): Update for Argument.Resolve.
22783
22784         (ElementAccess.DoResolve): ditto.
22785
22786         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22787         method should be virtual, as this method is always virtual.
22788
22789         (NewDelegate.DoResolve): Update for Argument.Resolve.
22790
22791         * class.cs (ConstructorInitializer.DoResolve): ditto.
22792
22793         * attribute.cs (Attribute.Resolve): ditto.
22794
22795 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22796
22797         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22798
22799         * expression.cs (ParameterReference): Drop IStackStorage and implement
22800         IAssignMethod instead. 
22801
22802         (LocalVariableReference): ditto.
22803
22804         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22805         IAssignMethod instead. 
22806
22807 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22808
22809         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22810         enumerations that are used in heavily used structures derive from
22811         byte in a laughable and pathetic attempt to reduce memory usage.
22812         This is the kind of pre-optimzations that you should not do at
22813         home without adult supervision.
22814
22815         * expression.cs (UnaryMutator): New class, used to handle ++ and
22816         -- separatedly from the other unary operators.  Cleans up the
22817         code, and kills the ExpressionStatement dependency in Unary.
22818
22819         (Unary): Removed `method' and `Arguments' from this class, making
22820         it smaller, and moving it all to SimpleCall, so I can reuse this
22821         code in other locations and avoid creating a lot of transient data
22822         strucutres when not required.
22823
22824         * cs-parser.jay: Adjust for new changes.
22825
22826 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22827
22828         * enum.cs (Enum.Populate): If there is a failure during
22829         definition, return
22830
22831         * cs-parser.jay (opt_enum_base): we used to catch type errors
22832         here, but this is really incorrect.  The type error should be
22833         catched during semantic analysis.
22834
22835 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22836
22837         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22838         current_local_parameters as expected since I, in my stupidity, had forgotten
22839         to do this :-)
22840
22841         * attribute.cs (GetValidPlaces): Fix stupid bug.
22842
22843         * class.cs (Method::Emit): Perform check on applicability of attributes.
22844
22845         (Constructor::Emit): Ditto.
22846
22847         (Field::Emit): Ditto.
22848
22849         (Field.Location): Store location information.
22850
22851         (Property, Event, Indexer, Operator): Ditto.
22852
22853         * cs-parser.jay (field_declaration): Pass in location for each field.
22854
22855         * ../errors/cs0592.cs : Add.
22856
22857 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22858
22859         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22860
22861         (InitCoreTypes): Update accordingly.
22862
22863         (RegisterAttrType, LookupAttr): Implement.
22864
22865         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22866         info about the same.
22867
22868         (Resolve): Update to populate the above as necessary.
22869
22870         (Error592): Helper.
22871
22872         (GetValidPlaces): Helper to the above.
22873
22874         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22875
22876         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22877
22878 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22879
22880         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22881
22882         * ../errors/cs0617.cs : Add.
22883
22884 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22885
22886         * enum.cs (Emit): Rename to Populate to be more consistent with what
22887         we expect it to do and when exactly it is called.
22888
22889         * class.cs, rootcontext.cs : Update accordingly.
22890
22891         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22892         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22893
22894         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22895
22896         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22897         of a fieldinfo using the above, when dealing with a FieldBuilder.
22898
22899 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22900
22901         * ../errors/cs0031.cs : Add.
22902
22903         * ../errors/cs1008.cs : Add.
22904
22905         * ../errrors/cs0543.cs : Add.
22906
22907         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22908         enum type.
22909
22910         (FindMembers): Implement.
22911
22912         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22913         enums and delegates too.
22914
22915         (enum_types): Rename to builder_to_enum.
22916
22917         (delegate_types): Rename to builder_to_delegate.
22918
22919         * delegate.cs (FindMembers): Implement.
22920
22921 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22922
22923         * typemanager.cs (IsEnumType): Implement.
22924
22925         * enum.cs (Emit): Re-write parts to account for the underlying type
22926         better and perform checking etc.
22927
22928         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22929         of the underlying type.
22930
22931         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22932         value
22933
22934         * enum.cs (error31): Helper to report error #31.
22935
22936         * cs-parser.jay (enum_declaration): Store location of each member too.
22937
22938         * enum.cs (member_to_location): New hashtable. 
22939
22940         (AddEnumMember): Update location hashtable.
22941
22942         (Emit): Use the location of each member while reporting errors.
22943
22944 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22945
22946         * cs-parser.jay: A for_initializer if is a
22947         local_variable_declaration really ammount to have an implicit
22948         block with the variable declaration and no initializer for for.
22949
22950         * statement.cs (For.Emit): Cope with null initializers.
22951
22952         This fixes the infinite loop on for initializers.
22953
22954 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22955
22956         * enum.cs: More cleanup.
22957
22958         * ecore.cs: Remove dead code.
22959
22960         * class.cs (Property.Emit): More simplification.
22961         (Event.Emit): ditto.
22962
22963         Reworked to have less levels of indentation.
22964
22965 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22966
22967         * class.cs (Property): Emit attributes.
22968
22969         (Field): Ditto.
22970
22971         (Event): Ditto.
22972
22973         (Indexer): Ditto.
22974
22975         (Operator): Ditto.
22976
22977         * enum.cs (Emit): Ditto.
22978
22979         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22980         Enums too.
22981
22982         * class.cs (Field, Event, etc.): Move attribute generation into the
22983         Emit method everywhere.
22984
22985         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22986         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22987         as we had no way of defining nested enums !
22988
22989         * rootcontext.cs : Adjust code accordingly.
22990
22991         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22992
22993 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22994
22995         * expression.cs (EvalConstantExpression): Move into ecore.cs
22996
22997         * enum.cs (Enum): Rename some members and make them public and readonly
22998         according to our convention.
22999
23000         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23001         nothing else.
23002
23003         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23004
23005         (Enum::Emit): Write a simple version for now which doesn't try to compute
23006         expressions. I shall modify this to be more robust in just a while.
23007
23008         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23009
23010         (TypeContainer::CloseType): Create the Enum types too.
23011
23012         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23013
23014         * expression.cs (EvalConstantExpression): Get rid of completely.
23015
23016         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23017         user-defined values and other cases.
23018
23019         (IsValidEnumLiteral): Helper function.
23020
23021         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23022         out there in the case we had a literal FieldExpr.
23023
23024         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23025
23026         (Literalize): Revamp a bit to take two arguments.
23027
23028         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23029
23030 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23031
23032         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23033
23034         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23035
23036         (Resolve): Use the above to ensure we have proper initializers.
23037
23038 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23039
23040         * expression.cs (Expression::EvalConstantExpression): New method to 
23041         evaluate constant expressions.
23042
23043         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23044
23045 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23046
23047         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23048         in an array.
23049
23050         (Binary.ResolveOperator): Handle operator != (object a, object b)
23051         and operator == (object a, object b);
23052
23053         (Binary.DoNumericPromotions): Indicate whether the numeric
23054         promotion was possible.
23055
23056         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23057         Implement.  
23058
23059         Made the ArrayAccess implement interface IAssignMethod instead of
23060         IStackStore as the order in which arguments are passed reflects
23061         this.
23062
23063         * assign.cs: Instead of using expr.ExprClass to select the way of
23064         assinging, probe for the IStackStore/IAssignMethod interfaces.
23065
23066         * typemanager.cs: Load InitializeArray definition.
23067
23068         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23069         static data that can be used to initialize arrays. 
23070
23071 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23072
23073         * expression.cs: Handle operator== and operator!= for booleans.
23074
23075         (Conditioal.Reduce): Implement reducer for the ?: operator.
23076
23077         (Conditional.Resolve): Implement dead code elimination.
23078
23079         (Binary.Resolve): Catch string literals and return a new
23080         concatenated string.
23081
23082         (Unary.Reduce): Implement reduction of unary expressions.
23083
23084         * ecore.cs: Split out the expression core handling here.
23085
23086         (Expression.Reduce): New method used to perform constant folding
23087         and CSE.  This is needed to support constant-expressions. 
23088
23089         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23090         targets, and optimize for !x.
23091
23092 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23093
23094         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23095         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23096         set custom atttributes.
23097
23098         * literal.cs (Literal::GetValue): New abstract method to return the actual
23099         value of the literal, cast as an object.
23100
23101         (*Literal): Implement GetValue method.
23102
23103         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23104         expressions to the arraylist but objects of type Argument.
23105
23106         * class.cs (TypeContainer::Emit): Emit our attributes too.
23107
23108         (Method::Emit, Constructor::Emit): Ditto.
23109
23110         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23111         to be ignoring earlier.
23112
23113 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23114
23115         * attribute.cs (AttributeSection::Define): Implement to do the business
23116         of constructing a CustomAttributeBuilder.
23117
23118         (Attribute): New trivial class. Increases readability of code.  
23119
23120         * cs-parser.jay : Update accordingly.
23121
23122         (positional_argument_list, named_argument_list, named_argument): New rules
23123
23124         (attribute_arguments): Use the above so that we are more correct.
23125
23126 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23127
23128         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23129         to perform all checks for a method with a params parameter.
23130
23131         (Invocation::OverloadResolve): Update to use the above method and therefore
23132         cope correctly with params method invocations.
23133
23134         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23135         params too.
23136
23137         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23138         constructors in our parent too because we can't afford to miss out on 
23139         protected ones ;-)
23140
23141         * attribute.cs (AttributeSection): New name for the class Attribute
23142
23143         Other trivial changes to improve readability.
23144
23145         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23146         use the new class names.
23147
23148 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23149
23150         * class.cs (Method::Define): Complete definition for params types too
23151
23152         (Indexer::Define): Ditto.
23153
23154         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23155         Cope everywhere with a request for info about the array parameter.
23156
23157 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23158
23159         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23160
23161         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23162         local_variable_type to extract the string corresponding to the type.
23163
23164         (local_variable_type): Fixup the action to use the new helper method.
23165
23166         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23167         go.
23168
23169         * expression.cs : Clean out code which uses the above.
23170
23171 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23172
23173         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23174         and bale out if necessary by returning a false.
23175
23176         (RegisterProperty): Ditto.
23177
23178         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23179         and print out appropriate error messages.
23180
23181         * interface.cs (everywhere): Ditto.
23182
23183         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23184         location to constructor.
23185
23186         * class.cs (Property, Event, Indexer): Update accordingly.
23187
23188         * ../errors/cs111.cs : Added.
23189
23190         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23191         of a method, as laid down by the spec.
23192
23193         (Invocation::OverloadResolve): Use the above method.
23194
23195 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23196
23197         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23198         now take a TypeContainer and a Parameters object.
23199
23200         (ParameterData): Modify return type of ParameterModifier method to be 
23201         Parameter.Modifier and not a string.
23202
23203         (ReflectionParameters, InternalParameters): Update accordingly.
23204
23205         * expression.cs (Argument::GetParameterModifier): Same here.
23206
23207         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23208         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23209         symbol in it at all so maybe this is only for now.
23210
23211 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23212
23213         * support.cs (InternalParameters): Constructor now takes an extra argument 
23214         which is the actual Parameters class.
23215
23216         (ParameterDesc): Update to provide info on ref/out modifiers.
23217
23218         * class.cs (everywhere): Update call to InternalParameters to pass in
23219         the second argument too.
23220
23221         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23222         to return the modifier info [ref/out etc]
23223
23224         (InternalParameters, ReflectionParameters): Implement the above.
23225
23226         * expression.cs (Argument::ParameterModifier): Similar function to return
23227         info about the argument's modifiers.
23228
23229         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23230         too.
23231
23232         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23233         a new SetFormalParameters object which we pass to InternalParameters.
23234
23235 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23236
23237         * expression.cs (NewArray): Merge into the ArrayCreation class.
23238
23239 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23240
23241         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23242         NewUserdefinedArray into one as there wasn't much of a use in having
23243         two separate ones.
23244
23245         * expression.cs (Argument): Change field's name to ArgType from Type.
23246
23247         (Type): New readonly property which returns the proper type, taking into 
23248         account ref/out modifiers.
23249
23250         (everywhere): Adjust code accordingly for the above.
23251
23252         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23253         whether we are emitting for a ref or out parameter.
23254
23255         * expression.cs (Argument::Emit): Use the above field to set the state.
23256
23257         (LocalVariableReference::Emit): Update to honour the flag and emit the
23258         right stuff.
23259
23260         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23261
23262         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23263
23264         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23265
23266         (ReflectionParameters, InternalParameters): Implement the above method.
23267
23268         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23269         reporting errors.
23270
23271         (Invocation::FullMethodDesc): Ditto. 
23272
23273 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23274
23275         * cs-parser.jay: Add extra production for the second form of array
23276         creation. 
23277
23278         * expression.cs (ArrayCreation): Update to reflect the above
23279         change. 
23280
23281         * Small changes to prepare for Array initialization.
23282
23283 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23284
23285         * typemanager.cs (ImplementsInterface): interface might be null;
23286         Deal with this problem;
23287
23288         Also, we do store negative hits on the cache (null values), so use
23289         this instead of calling t.GetInterfaces on the type everytime.
23290
23291 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23292
23293         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23294
23295         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23296         split functionality out into different classes.
23297
23298         (New::FormArrayType): Move into NewBuiltinArray.
23299
23300         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23301         quite useless.
23302
23303         (NewBuiltinArray): New class to handle creation of built-in arrays.
23304
23305         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23306         account creation of one-dimensional arrays.
23307
23308         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23309
23310         (NewUserdefinedArray::DoResolve): Implement.
23311
23312         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23313
23314         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23315         we maintain inside the TypeManager. This is necessary to perform lookups on the
23316         module builder.
23317
23318         (LookupType): Update to perform GetType on the module builders too.     
23319
23320         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23321
23322         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23323
23324 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23325
23326         * expression.cs (New::DoResolve): Implement guts of array creation.
23327
23328         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23329
23330 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23331
23332         * expression.cs: Fix bug I introduced lsat night that broke
23333         Delegates. 
23334
23335         (Expression.Resolve): Report a 246 error (can not resolve name)
23336         if we find a SimpleName in the stream.
23337
23338         (Expression.ResolveLValue): Ditto.
23339
23340         (Expression.ResolveWithSimpleName): This function is a variant of
23341         ResolveName, this one allows SimpleNames to be returned without a
23342         warning.  The only consumer of SimpleNames is MemberAccess
23343
23344 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23345
23346         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23347         might arrive here.  I have my doubts that this is correct.
23348
23349         * statement.cs (Lock): Implement lock statement.
23350
23351         * cs-parser.jay: Small fixes to support `lock' and `using'
23352
23353         * cs-tokenizer.cs: Remove extra space
23354
23355         * driver.cs: New flag --checked, allows to turn on integer math
23356         checking. 
23357
23358         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23359         Threading.Monitor.Exit 
23360
23361 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23362
23363         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23364         Expression Class to be IndexerAccess.
23365
23366         Notice that Indexer::DoResolve sets the eclass to Value.
23367
23368 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23369
23370         * class.cs (TypeContainer::Emit): Emit code for indexers.
23371
23372         * assign.cs (IAssignMethod): New interface implemented by Indexers
23373         and Properties for handling assignment.
23374
23375         (Assign::Emit): Simplify and reuse code. 
23376
23377         * expression.cs (IndexerAccess, PropertyExpr): Implement
23378         IAssignMethod, clean up old code. 
23379
23380 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23381
23382         * typemanager.cs (ImplementsInterface): New method to determine if a type
23383         implements a given interface. Provides a nice cache too.
23384
23385         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23386         method.
23387
23388         (ConvertReferenceExplicit): Ditto.
23389
23390         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23391         various methods, with correct names etc.
23392
23393         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23394         Operator.UnaryNegation.
23395
23396         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23397         we have a unary plus or minus operator.
23398
23399         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23400         UnaryMinus.
23401
23402         * everywhere : update accordingly.
23403
23404         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23405         respectively.
23406
23407         * class.cs (Method::Define): For the case where we are implementing a method
23408         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23409         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23410
23411 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23412
23413         * interface.cs (FindMembers): Implement to work around S.R.E
23414         lameness.
23415
23416         * typemanager.cs (IsInterfaceType): Implement.
23417
23418         (FindMembers): Update to handle interface types too.
23419
23420         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23421         use IsAssignableFrom as that is not correct - it doesn't work.
23422
23423         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23424         and accordingly override EmitStatement.
23425
23426         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23427         using the correct logic :-)
23428
23429 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23430
23431         * ../errors/cs-11.cs : Add to demonstrate error -11 
23432
23433 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23434
23435         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23436         then pass this as a hint to ResolveLValue.
23437
23438         * expression.cs (FieldExpr): Add Location information
23439
23440         (FieldExpr::LValueResolve): Report assignment to readonly
23441         variable. 
23442
23443         (Expression::ExprClassFromMemberInfo): Pass location information.
23444
23445         (Expression::ResolveLValue): Add new method that resolves an
23446         LValue. 
23447
23448         (Expression::DoResolveLValue): Default invocation calls
23449         DoResolve. 
23450
23451         (Indexers): New class used to keep track of indexers in a given
23452         Type. 
23453
23454         (IStackStore): Renamed from LValue, as it did not really describe
23455         what this did.  Also ResolveLValue is gone from this interface and
23456         now is part of Expression.
23457
23458         (ElementAccess): Depending on the element access type
23459
23460         * typemanager.cs: Add `indexer_name_type' as a Core type
23461         (System.Runtime.CompilerServices.IndexerNameAttribute)
23462
23463         * statement.cs (Goto): Take a location.
23464
23465 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23466
23467         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23468         if two delegates are compatible.
23469
23470         (NewDelegate::DoResolve): Update to take care of the case when
23471         we instantiate a delegate from another delegate.
23472
23473         * typemanager.cs (FindMembers): Don't even try to look up members
23474         of Delegate types for now.
23475
23476 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23477
23478         * delegate.cs (NewDelegate): New class to take care of delegate
23479         instantiation.
23480
23481         * expression.cs (New): Split the delegate related code out into 
23482         the NewDelegate class.
23483
23484         * delegate.cs (DelegateInvocation): New class to handle delegate 
23485         invocation.
23486
23487         * expression.cs (Invocation): Split out delegate related code into
23488         the DelegateInvocation class.
23489
23490 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23491
23492         * expression.cs (New::DoResolve): Implement delegate creation fully
23493         and according to the spec.
23494
23495         (New::DoEmit): Update to handle delegates differently.
23496
23497         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23498         because of which we were printing out arguments in reverse order !
23499
23500         * delegate.cs (VerifyMethod): Implement to check if the given method
23501         matches the delegate.
23502
23503         (FullDelegateDesc): Implement.
23504
23505         (VerifyApplicability): Implement.
23506
23507         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23508         delegate invocations too.
23509
23510         (Invocation::Emit): Ditto.
23511
23512         * ../errors/cs1593.cs : Added.
23513
23514         * ../errors/cs1594.cs : Added.
23515
23516         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23517
23518 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23519
23520         * typemanager.cs (intptr_type): Core type for System.IntPtr
23521
23522         (InitCoreTypes): Update for the same.
23523
23524         (iasyncresult_type, asynccallback_type): Ditto.
23525
23526         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23527         correct.
23528
23529         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23530         too.
23531
23532         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23533         the builders for the 4 members of a delegate type :-)
23534
23535         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23536         type.
23537
23538         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23539
23540         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23541
23542 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23543
23544         * statement.cs (Break::Emit): Implement.   
23545         (Continue::Emit): Implement.
23546
23547         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23548         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23549         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23550         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23551         end loop
23552
23553         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23554         properties that track the label for the current loop (begin of the
23555         loop and end of the loop).
23556
23557 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23558
23559         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23560         use of emitting anything at all.
23561
23562         * class.cs, rootcontext.cs : Get rid of calls to the same.
23563
23564         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23565
23566         (Populate): Define the constructor correctly and set the implementation
23567         attributes.
23568
23569         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23570         have been defined.
23571
23572         (AddDelegateType): Implement.
23573
23574         (IsDelegateType): Implement helper method.
23575
23576         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23577
23578         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23579         and accordingly handle it.
23580
23581         * delegate.cs (Populate): Take TypeContainer argument.
23582         Implement bits to define the Invoke method. However, I still haven't figured out
23583         how to take care of the native int bit :-(
23584
23585         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23586         Qualify the name of the delegate, not its return type !
23587
23588         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23589         conversion.
23590
23591         (StandardConversionExists): Checking for array types turns out to be recursive.
23592
23593         (ConvertReferenceExplicit): Implement array conversion.
23594
23595         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23596
23597 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23598
23599         * cs-parser.jay (delegate_declaration): Store the fully qualified
23600         name as it is a type declaration.
23601
23602         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23603         readonly.
23604
23605         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23606         as TypeContainer::DefineType.
23607
23608         (Populate): Method in which all the definition of the various methods (Invoke)
23609         etc is done.
23610
23611         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23612         see.
23613
23614         (CloseDelegate): Finally creates the delegate.
23615
23616         * class.cs (TypeContainer::DefineType): Update to define delegates.
23617         (Populate, Emit and CloseType): Do the same thing here too.
23618
23619         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23620         delegates in all these operations.
23621
23622 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23623
23624         * expression.cs: LocalTemporary: a new expression used to
23625         reference a temporary that has been created.
23626
23627         * assign.cs: Handle PropertyAccess back here, so that we can
23628         provide the proper semantic access to properties.
23629
23630         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23631         a few more explicit conversions. 
23632
23633         * modifiers.cs: `NEW' modifier maps to HideBySig.
23634
23635         * expression.cs (PropertyExpr): Make this into an
23636         ExpressionStatement, and support the EmitStatement code path. 
23637
23638         Perform get/set error checking, clean up the interface.
23639
23640         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23641         them into toplevel access objects.
23642
23643 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23644
23645         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23646         SRE.
23647
23648         * typemanager.cs: Keep track here of our PropertyBuilders again to
23649         work around lameness in SRE.
23650
23651 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23652
23653         * expression.cs (LValue::LValueResolve): New method in the
23654         interface, used to perform a second resolution pass for LValues. 
23655
23656         (This::DoResolve): Catch the use of this in static methods.
23657
23658         (This::LValueResolve): Implement.
23659
23660         (This::Store): Remove warning, assigning to `this' in structures
23661         is 
23662
23663         (Invocation::Emit): Deal with invocation of
23664         methods on value types.  We need to pass the address to structure
23665         methods rather than the object itself.  (The equivalent code to
23666         emit "this" for structures leaves the entire structure on the
23667         stack instead of a pointer to it). 
23668
23669         (ParameterReference::DoResolve): Compute the real index for the
23670         argument based on whether the method takes or not a `this' pointer
23671         (ie, the method is static).
23672
23673         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23674         value types returned from functions when we need to invoke a
23675         method on the sturcture.
23676
23677
23678 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23679
23680         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23681         defining the type in the Modulebuilder or Typebuilder. This is to take
23682         care of nested types which need to be defined on the TypeBuilder using
23683         DefineNestedMethod.
23684
23685         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23686         methods in RootContext, only ported to be part of TypeContainer.
23687
23688         (TypeContainer::GetInterfaceOrClass): Ditto.
23689
23690         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23691
23692         * interface.cs (Interface::DefineInterface): New method. Does exactly
23693         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23694         too.
23695
23696         (Interface::GetInterfaces): Move from RootContext here and port.
23697
23698         (Interface::GetInterfaceByName): Same here.
23699
23700         * rootcontext.cs (ResolveTree): Re-write.
23701
23702         (PopulateTypes): Re-write.
23703
23704         * class.cs (TypeContainer::Populate): Populate nested types too.
23705         (TypeContainer::Emit): Emit nested members too.
23706
23707         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23708         instead just use the name argument passed in as it is already fully
23709         qualified.
23710
23711         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23712         to TypeContainer mapping to see if a type is user-defined.
23713
23714         * class.cs (TypeContainer::CloseType): Implement. 
23715
23716         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23717         the default constructor.
23718
23719         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23720         twice.
23721
23722         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23723
23724         * interface.cs (CloseType): Create the type here.
23725
23726         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23727         the hierarchy.
23728
23729         Remove all the methods which are now in TypeContainer.
23730
23731 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23732
23733         * delegate.cs (Define): Re-write bits to define the delegate
23734         correctly.
23735
23736 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23737
23738         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23739
23740         * expression.cs (ImplicitReferenceConversion): handle null as well
23741         as a source to convert to any reference type.
23742
23743         * statement.cs (Return): Perform any implicit conversions to
23744         expected return type.  
23745
23746         Validate use of return statement.  
23747
23748         * codegen.cs (EmitContext): Pass the expected return type here.
23749
23750         * class.cs (Method, Constructor, Property): Pass expected return
23751         type to EmitContext.
23752
23753 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23754
23755         * expression.cs: Make DoResolve take an EmitContext instead of a
23756         TypeContainer.
23757
23758         Replaced `l' and `location' for `loc', for consistency.
23759
23760         (Error, Warning): Remove unneeded Tc argument.
23761
23762         * assign.cs, literal.cs, constant.cs: Update to new calling
23763         convention. 
23764
23765         * codegen.cs: EmitContext now contains a flag indicating whether
23766         code is being generated in a static method or not.
23767
23768         * cs-parser.jay: DecomposeQI, new function that replaces the old
23769         QualifiedIdentifier.  Now we always decompose the assembled
23770         strings from qualified_identifier productions into a group of
23771         memberaccesses.
23772
23773 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23774
23775         * rootcontext.cs: Deal with field-less struct types correctly now
23776         by passing the size option to Define Type.
23777
23778         * class.cs: Removed hack that created one static field. 
23779
23780 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23781
23782         * statement.cs: Moved most of the code generation here. 
23783
23784 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23785
23786         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23787         seem very right.
23788
23789         (ElementAccess): Remove useless bits for now - keep checks as the spec
23790         says.
23791
23792 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23793
23794         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23795         and start performing checks according to the spec.
23796
23797 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23798
23799         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23800         rank_specifiers instead.
23801
23802         (rank_specifiers): Change the order in which the rank specifiers are stored
23803
23804         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23805
23806         * expression.cs (ElementAccess): Implement the LValue interface too.
23807
23808 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23809
23810         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23811         except that user defined conversions are not included.
23812
23813         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23814         perform the conversion of the return type, if necessary.
23815
23816         (New::DoResolve): Check whether we are creating an array or an object
23817         and accordingly do the needful.
23818
23819         (New::Emit): Same here.
23820
23821         (New::DoResolve): Implement guts of array creation.
23822
23823         (New::FormLookupType): Helper function.
23824
23825 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23826
23827         * codegen.cs: Removed most of the code generation here, and move the
23828         corresponding code generation bits to the statement classes. 
23829
23830         Added support for try/catch/finalize and throw.
23831
23832         * cs-parser.jay: Added support for try/catch/finalize.
23833
23834         * class.cs: Catch static methods having the flags override,
23835         virtual or abstract.
23836
23837         * expression.cs (UserCast): This user cast was not really doing
23838         what it was supposed to do.  Which is to be born in fully resolved
23839         state.  Parts of the resolution were being performed at Emit time! 
23840
23841         Fixed this code.
23842
23843 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23844
23845         * expression.cs: Implicity convert the result from UserCast.
23846
23847 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23848
23849         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23850         prevented it from working correctly. 
23851
23852         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23853         merely ConvertImplicit.
23854
23855 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23856
23857         * typemanager.cs: Make the LookupTypeContainer function static,
23858         and not per-instance.  
23859
23860         * class.cs: Make static FindMembers (the one that takes a Type
23861         argument). 
23862
23863         * codegen.cs: Add EmitForeach here.
23864
23865         * cs-parser.jay: Make foreach a toplevel object instead of the
23866         inline expansion, as we need to perform semantic analysis on it. 
23867
23868 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23869
23870         * expression.cs (Expression::ImplicitUserConversion): Rename to
23871         UserDefinedConversion.
23872
23873         (Expression::UserDefinedConversion): Take an extra argument specifying 
23874         whether we look for explicit user conversions too.
23875
23876         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23877
23878         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23879
23880         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23881         with the appropriate arguments.
23882
23883         * cs-parser.jay (cast_expression): Record location too.
23884
23885         * expression.cs (Cast): Record location info.
23886
23887         (Expression::ConvertExplicit): Take location argument.
23888
23889         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23890         to determine if we are doing explicit conversions.
23891
23892         (UserCast::Emit): Update accordingly.
23893
23894         (Expression::ConvertExplicit): Report an error if everything fails.
23895
23896         * ../errors/cs0030.cs : Add.
23897
23898 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23899
23900         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23901         virtual and newslot bits. 
23902
23903         * class.cs (TypeContainer::RegisterRequiredImplementations):
23904         Record methods we need.
23905
23906         (TypeContainer::MakeKey): Helper function to make keys for
23907         MethodBases, since the Methodbase key is useless.
23908
23909         (TypeContainer::Populate): Call RegisterRequiredImplementations
23910         before defining the methods.   
23911
23912         Create a mapping for method_builders_to_methods ahead of time
23913         instead of inside a tight loop.
23914
23915         (::RequireMethods):  Accept an object as the data to set into the
23916         hashtable so we can report interface vs abstract method mismatch.
23917
23918 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23919
23920         * report.cs: Make all of it static.
23921
23922         * rootcontext.cs: Drop object_type and value_type computations, as
23923         we have those in the TypeManager anyways.
23924
23925         Drop report instance variable too, now it is a global.
23926
23927         * driver.cs: Use try/catch on command line handling.
23928
23929         Add --probe option to debug the error reporting system with a test
23930         suite. 
23931
23932         * report.cs: Add support for exiting program when a probe
23933         condition is reached.
23934
23935 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23936
23937         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23938         we do a forcible conversion regardless of type, to check if 
23939         ForceConversion returns a null.
23940
23941         (Binary::error19): Use location to report error.
23942
23943         (Unary::error23): Use location here too.
23944
23945         * ../errors/cs0019.cs : Check in.
23946
23947         * ../errors/cs0023.cs : Check in.
23948
23949         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23950         case of a non-null MethodInfo object with a length of 0 !
23951
23952         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23953         an applicable member - according to the spec :-)
23954         Also fix logic to find members in base types.
23955
23956         (Unary::ResolveOperator): Same here.
23957
23958         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23959         as I was getting thoroughly confused between this and error19 :-)
23960
23961         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23962         (::FindMostEncompassedType): Implement.
23963         (::FindMostEncompassingType): Implement.
23964         (::StandardConversionExists): Implement.
23965
23966         (UserImplicitCast): Re-vamp. We now need info about most specific
23967         source and target types so that we can do the necessary conversions.
23968
23969         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23970         mathematical union with no duplicates.
23971
23972 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23973
23974         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23975         in order from base classes to child classes, so that we can in
23976         child classes look up in our parent for method names and
23977         attributes (required for handling abstract, virtual, new, override
23978         constructs: we need to instrospect our base class, and if we dont
23979         populate the classes in order, the introspection might be
23980         incorrect.  For example, a method could query its parent before
23981         the parent has any methods and would determine that the parent has
23982         no abstract methods (while it could have had them)).
23983
23984         (RootContext::CreateType): Record the order in which we define the
23985         classes.
23986
23987 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23988
23989         * class.cs (TypeContainer::Populate): Also method definitions can
23990         fail now, keep track of this.
23991
23992         (TypeContainer::FindMembers): Implement support for
23993         DeclaredOnly/noDeclaredOnly flag.
23994
23995         (Constructor::Emit) Return the ConstructorBuilder.
23996
23997         (Method::Emit) Return the MethodBuilder. 
23998         Check for abstract or virtual methods to be public.
23999
24000         * rootcontext.cs (RootContext::CreateType): Register all the
24001         abstract methods required for the class to be complete and the
24002         interface methods that must be implemented. 
24003
24004         * cs-parser.jay: Report error 501 (method requires body if it is
24005         not marked abstract or extern).
24006
24007         * expression.cs (TypeOf::Emit): Implement.
24008
24009         * typemanager.cs: runtime_handle_type, new global type.
24010
24011         * class.cs (Property::Emit): Generate code for properties.
24012
24013 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24014
24015         * expression.cs (Unary::ResolveOperator): Find operators on base type
24016         too - we now conform exactly to the spec.
24017
24018         (Binary::ResolveOperator): Same here.
24019
24020         * class.cs (Operator::Define): Fix minor quirk in the tests.
24021
24022         * ../errors/cs0215.cs : Added.
24023
24024         * ../errors/cs0556.cs : Added.
24025
24026         * ../errors/cs0555.cs : Added.
24027
24028 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24029
24030         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24031         single integer which is really efficient
24032
24033 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24034
24035         *  expression.cs (Expression::ImplicitUserConversion): Use location
24036         even in the case when we are examining True operators.
24037  
24038         * class.cs (Operator::Define): Perform extensive checks to conform
24039         with the rules for operator overloading in the spec.
24040
24041         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24042         some of the other conversions mentioned in the spec.
24043
24044         * typemanager.cs (array_type): New static member for the System.Array built-in
24045         type.
24046
24047         (cloneable_interface): For System.ICloneable interface.
24048
24049         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24050         we start resolving the tree and populating types.
24051
24052         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24053  
24054 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24055
24056         * expression.cs (Expression::ExprClassFromMemberInfo,
24057         Expression::Literalize): Create literal expressions from
24058         FieldInfos which are literals.
24059
24060         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24061         type casts, because they were wrong.  The test suite in tests
24062         caught these ones.
24063
24064         (ImplicitNumericConversion): ushort to ulong requires a widening
24065         cast. 
24066
24067         Int32 constant to long requires widening cast as well.
24068
24069         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24070         for integers because the type on the stack is not i4.
24071
24072 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24073
24074         * expression.cs (report118): require location argument. 
24075
24076         * parameter.cs: Do not dereference potential null value.
24077
24078         * class.cs: Catch methods that lack the `new' keyword when
24079         overriding a name.  Report warnings when `new' is used without
24080         anything being there to override.
24081
24082         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24083
24084         * class.cs: Only add constructor to hashtable if it is non-null
24085         (as now constructors can fail on define).
24086
24087         (TypeManager, Class, Struct): Take location arguments.
24088
24089         Catch field instance initialization in structs as errors.
24090
24091         accepting_filter: a new filter for FindMembers that is static so
24092         that we dont create an instance per invocation.
24093
24094         (Constructor::Define): Catch errors where a struct constructor is
24095         parameterless 
24096
24097         * cs-parser.jay: Pass location information for various new
24098         constructs. 
24099
24100         * delegate.cs (Delegate): take a location argument.
24101
24102         * driver.cs: Do not call EmitCode if there were problesm in the
24103         Definition of the types, as many Builders wont be there. 
24104
24105         * decl.cs (Decl::Decl): Require a location argument.
24106
24107         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24108         into integers, and find the most appropiate integer for it.
24109
24110         * literal.cs: Implement ULongLiteral.
24111
24112         * rootcontext.cs: Provide better information about the location of
24113         failure when CreateType fails.
24114
24115 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24116
24117         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24118         as well.
24119
24120         * expression.cs (Binary::CheckShiftArguments): Add missing type
24121         computation.
24122         (Binary::ResolveOperator): Add type to the logical and and logical
24123         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24124         before.
24125
24126         (Binary::DoNumericPromotions): In the case where either argument
24127         is ulong (and most signed types combined with ulong cause an
24128         error) perform implicit integer constant conversions as well.
24129
24130 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24131
24132         * expression.cs (UserImplicitCast): Method should always be
24133         non-null. 
24134         (Invocation::BetterConversion): Simplified test for IntLiteral.
24135
24136         (Expression::ImplicitNumericConversion): Split this routine out.
24137         Put the code that performs implicit constant integer conversions
24138         here. 
24139
24140         (Expression::Resolve): Become a wrapper around DoResolve so we can
24141         check eclass and type being set after resolve.
24142
24143         (Invocation::Badness): Remove this dead function
24144
24145         (Binary::ResolveOperator): Do not compute the expensive argumnets
24146         unless we have a union for it.
24147
24148         (Probe::Emit): Is needs to do an isinst and then
24149         compare against null.
24150
24151         (::CanConvert): Added Location argument.  If the Location argument
24152         is null (Location.Null), then we do not report errors.  This is
24153         used by the `probe' mechanism of the Explicit conversion.  We do
24154         not want to generate an error for something that the user
24155         explicitly requested to be casted.  But the pipeline for an
24156         explicit cast first tests for potential implicit casts.
24157
24158         So for now, if the Location is null, it means `Probe only' to
24159         avoid adding another argument.   Might have to revise this
24160         strategy later.
24161
24162         (ClassCast): New class used to type cast objects into arbitrary
24163         classes (used in Explicit Reference Conversions).
24164
24165         Implement `as' as well.
24166
24167         Reverted all the patches from Ravi below: they were broken:
24168
24169                 * The use of `level' as a mechanism to stop recursive
24170                   invocations is wrong.  That was there just to catch the
24171                   bug with a strack trace but not as a way of addressing
24172                   the problem.
24173
24174                   To fix the problem we have to *understand* what is going
24175                   on and the interactions and come up with a plan, not
24176                   just get things going.
24177
24178                 * The use of the type conversion cache that I proposed
24179                   last night had an open topic: How does this work across
24180                   protection domains.  A user defined conversion might not
24181                   be public in the location where we are applying the
24182                   conversion, a different conversion might be selected
24183                   (ie, private A->B (better) but public B->A (worse),
24184                   inside A, A->B applies, but outside it, B->A will
24185                   apply).
24186
24187                 * On top of that (ie, even if the above is solved),
24188                   conversions in a cache need to be abstract.  Ie, `To
24189                   convert from an Int to a Short use an OpcodeCast', not
24190                   `To convert from an Int to a Short use the OpcodeCast on
24191                   the variable 5' (which is what this patch was doing).
24192
24193 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24194
24195         * expression.cs (Invocation::ConversionExists): Re-write to use
24196         the conversion cache
24197
24198         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24199         cache all conversions done, not just user-defined ones.
24200
24201         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24202         to determine if a conversion exists instead of acutually trying to 
24203         perform the conversion. It's faster too.
24204
24205         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24206         and only then attempt the implicit conversion.
24207
24208 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24209
24210         * expression.cs (ConvertImplicit): Use a cache for conversions
24211         already found. Check level of recursion and bail out if necessary.
24212
24213 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24214
24215         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24216         Export standard methods that we expect for string operations.
24217
24218         * statement.cs (Block::UsageWarning): Track usage of variables and
24219         report the errors for not used variables.
24220
24221         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24222         operator. 
24223
24224 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24225
24226         * codegen.cs: remove unnneded code 
24227
24228         * expression.cs: Removed BuiltinTypeAccess class
24229
24230         Fix the order in which implicit conversions are
24231         done.  
24232
24233         The previous fixed dropped support for boxed conversions (adding a
24234         test to the test suite now)
24235
24236         (UserImplicitCast::CanConvert): Remove test for source being null,
24237         that code is broken.  We should not feed a null to begin with, if
24238         we do, then we should track the bug where the problem originates
24239         and not try to cover it up here.
24240
24241         Return a resolved expression of type UserImplicitCast on success
24242         rather than true/false.  Ravi: this is what I was talking about,
24243         the pattern is to use a static method as a "constructor" for
24244         objects. 
24245
24246         Also, do not create arguments until the very last minute,
24247         otherwise we always create the arguments even for lookups that
24248         will never be performed. 
24249
24250         (UserImplicitCast::Resolve): Eliminate, objects of type
24251         UserImplicitCast are born in a fully resolved state. 
24252
24253         * typemanager.cs (InitCoreTypes): Init also value_type
24254         (System.ValueType). 
24255
24256         * expression.cs (Cast::Resolve): First resolve the child expression.
24257
24258         (LValue): Add new method AddressOf to be used by
24259         the `&' operator.  
24260
24261         Change the argument of Store to take an EmitContext instead of an
24262         ILGenerator, because things like FieldExpr need to be able to call
24263         their children expression to generate the instance code. 
24264
24265         (Expression::Error, Expression::Warning): Sugar functions for
24266         reporting errors.
24267
24268         (Expression::MemberLookup): Accept a TypeContainer instead of a
24269         Report as the first argument.
24270
24271         (Expression::ResolvePrimary): Killed.  I still want to improve
24272         this as currently the code is just not right.
24273
24274         (Expression::ResolveMemberAccess): Simplify, but it is still
24275         wrong. 
24276
24277         (Unary::Resolve): Catch errors in AddressOf operators.
24278
24279         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24280         index to a byte for the short-version, or the compiler will choose
24281         the wrong Emit call, which generates the wrong data.
24282
24283         (ParameterReference::Emit, ::Store): same.
24284
24285         (FieldExpr::AddressOf): Implement.
24286
24287         * typemanager.cs: TypeManager: made public variable instead of
24288         property.
24289
24290         * driver.cs: document --fatal.
24291
24292         * report.cs (ErrorMessage, WarningMessage): new names for the old
24293         Error and Warning classes.
24294
24295         * cs-parser.jay (member_access): Turn built-in access to types
24296         into a normal simplename
24297
24298 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24299
24300         * expression.cs (Invocation::BetterConversion): Fix to cope
24301         with q being null, since this was introducing a bug.
24302
24303         * expression.cs (ConvertImplicit): Do built-in conversions first.
24304
24305 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24306
24307         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24308
24309 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24310
24311         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24312         I had introduced long ago (what's new ?).
24313
24314         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24315         the work of all the checking. 
24316         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24317         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24318
24319         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24320         that is the right way. 
24321
24322         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24323         overloading resolution. Use everywhere instead of cutting and pasting code.
24324
24325         (Binary::ResolveOperator): Use MakeUnionSet.
24326
24327         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24328         we have to convert to bool types. Not complete yet.
24329
24330 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24331
24332         * typemanager.cs (TypeManager::CSharpName): support ushort.
24333
24334         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24335         to provide an expression that performsn an implicit constant int
24336         conversion (section 6.1.6).
24337         (Expression::ConvertImplicitRequired): Reworked to include
24338         implicit constant expression conversions.
24339
24340         (Expression::ConvertNumericExplicit): Finished.
24341
24342         (Invocation::Emit): If InstanceExpression is null, then it means
24343         that we perform a call on this.
24344
24345 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24346
24347         * expression.cs (Unary::Emit): Remove some dead code.
24348         (Probe): Implement Resolve and Emit for `is'.
24349         (Expression::ConvertImplicitRequired): Attempt to do constant
24350         expression conversions here.  Maybe should be moved to
24351         ConvertImplicit, but I am not sure.
24352         (Expression::ImplicitLongConstantConversionPossible,
24353         Expression::ImplicitIntConstantConversionPossible): New functions
24354         that tell whether is it possible to apply an implicit constant
24355         expression conversion.
24356
24357         (ConvertNumericExplicit): Started work on explicit numeric
24358         conversions.
24359
24360         * cs-parser.jay: Update operator constants.
24361
24362         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24363         (Parameters::GetSignature): Hook up VerifyArgs here.
24364         (Parameters::VerifyArgs): Verifies that no two arguments have the
24365         same name. 
24366
24367         * class.cs (Operator): Update the operator names to reflect the
24368         ones that the spec expects (as we are just stringizing the
24369         operator names).
24370
24371         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24372         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24373         previous usage did only work for our methods.
24374         (Expression::ConvertImplicit): Handle decimal implicit numeric
24375         conversions as well.
24376         (Expression::InternalTypeConstructor): Used to invoke constructors
24377         on internal types for default promotions.
24378
24379         (Unary::Emit): Implement special handling for the pre/post
24380         increment/decrement for overloaded operators, as they need to have
24381         the same semantics as the other operators.
24382
24383         (Binary::ResolveOperator): ditto.
24384         (Invocation::ConversionExists): ditto.
24385         (UserImplicitCast::Resolve): ditto.
24386
24387 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24388
24389         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24390         operator, return after emitting body. Regression tests pass again !
24391
24392         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24393         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24394         (Invocation::OverloadResolve): Ditto.
24395         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24396
24397         * everywhere : update calls to the above methods accordingly.
24398
24399 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24400
24401         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24402
24403         * expression.cs (ExpressionStatement): New base class used for
24404         expressions that can appear in statements, so that we can provide
24405         an alternate path to generate expression that do not leave a value
24406         on the stack.
24407
24408         (Expression::Emit, and all the derivatives): We no longer return
24409         whether a value is left on the stack or not.  Every expression
24410         after being emitted leaves a single value on the stack.
24411
24412         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24413         facilties of ExpressionStatement if possible.
24414
24415         * cs-parser.jay: Update statement_expression.
24416
24417 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24418
24419         * driver.cs: Change the wording of message
24420
24421 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24422
24423         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24424         the type of the expression to the return type of the method if
24425         we have an overloaded operator match ! The regression tests pass again !
24426         (Unary::ResolveOperator): Ditto.
24427
24428         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24429         to find "op_Implicit", not "implicit" ;-)
24430         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24431         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24432
24433         * everywhere : Correct calls to the above accordingly.
24434
24435         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24436         (ConvertImplicit): Do user-defined conversion if it exists.
24437
24438 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24439
24440         * assign.cs: track location.
24441         (Resolve): Use implicit conversions on assignment.
24442
24443         * literal.cs: Oops.  Not good, Emit of short access values should
24444         pass (Bytes) or the wrong argument will be selected.
24445
24446         * expression.cs (Unary::Emit): Emit code for -expr.
24447
24448         (Unary::ResolveOperator): Handle `Substract' for non-constants
24449         (substract from zero from the non-constants).
24450         Deal with Doubles as well. 
24451
24452         (Expression::ConvertImplicitRequired): New routine that reports an
24453         error if no implicit conversion exists. 
24454
24455         (Invocation::OverloadResolve): Store the converted implicit
24456         expressions if we make them
24457
24458 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24459
24460         * class.cs (ConstructorInitializer): Take a Location argument.
24461         (ConstructorBaseInitializer): Same here.
24462         (ConstructorThisInitializer): Same here.
24463
24464         * cs-parser.jay : Update all calls accordingly.
24465
24466         * expression.cs (Unary, Binary, New): Take location argument.
24467         Update accordingly everywhere.
24468
24469         * cs-parser.jay : Update all calls to the above to take a location
24470         argument.
24471
24472         * class.cs : Ditto.
24473
24474 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24475
24476         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24477         (Invocation::BetterConversion): Same here
24478         (Invocation::ConversionExists): Ditto.
24479
24480         (Invocation::ConversionExists): Implement.
24481
24482 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24483
24484         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24485         Also take an additional TypeContainer argument.
24486
24487         * All over : Pass in TypeContainer as argument to OverloadResolve.
24488
24489         * typemanager.cs (CSharpName): Update to check for the string type and return
24490         that too.
24491
24492         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24493         a given method.
24494
24495 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24496
24497         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24498         (Invocation::BetterFunction): Implement.
24499         (Invocation::BetterConversion): Implement.
24500         (Invocation::ConversionExists): Skeleton, no implementation yet.
24501
24502         Okay, things work fine !
24503
24504 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24505
24506         * typemanager.cs: declare and load enum_type, delegate_type and
24507         void_type. 
24508
24509         * expression.cs (Expression::Emit): Now emit returns a value that
24510         tells whether a value is left on the stack or not.  This strategy
24511         might be reveted tomorrow with a mechanism that would address
24512         multiple assignments.
24513         (Expression::report118): Utility routine to report mismatches on
24514         the ExprClass.
24515
24516         (Unary::Report23): Report impossible type/operator combination
24517         utility function.
24518
24519         (Unary::IsIncrementableNumber): Whether the type can be
24520         incremented or decremented with add.
24521         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24522         complemented. 
24523         (Unary::ResolveOperator): Implement ++, !, ~,
24524
24525         (Invocation::Emit): Deal with new Emit convetion.
24526
24527         * All Expression derivatives: Updated their Emit method to return
24528         whether they leave values on the stack or not.
24529
24530         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24531         stack for expressions that are statements. 
24532
24533 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24534
24535         * expression.cs (LValue): New interface.  Must be implemented by
24536         LValue objects.
24537         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24538         LValue interface.
24539
24540         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24541         interface for generating code, simplifies the code.
24542
24543 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24544
24545         * expression.cs (everywhere): Comment out return statements in ::Resolve
24546         methods to avoid the warnings.
24547
24548 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24549
24550         * driver.cs (parse): Report error 2001 if we can not open the
24551         source file.
24552
24553         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24554         not resolve it.
24555
24556         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24557         object. 
24558
24559         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24560         otherwise nested blocks end up with the same index.
24561
24562         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24563
24564         * expression.cs:  Instead of having FIXMEs in the Resolve
24565         functions, throw exceptions so it is obvious that we are facing a
24566         bug. 
24567
24568         * cs-parser.jay (invocation_expression): Pass Location information.
24569
24570         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24571         Use a basename for those routines because .NET does not like paths
24572         on them. 
24573
24574         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24575         already defined.
24576
24577 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24578
24579         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24580         are loading the correct data types (throws an exception if not).
24581         (TypeManager::InitCoreTypes): Use CoreLookupType
24582
24583         * expression.cs (Unary::ResolveOperator): return the child
24584         expression for expressions which are just +expr.
24585         (Unary::ResolveOperator): Return negative literals for -LITERAL
24586         expressions (otherwise they are Unary {Literal}).
24587         (Invocation::Badness): Take into account `Implicit constant
24588         expression conversions'.
24589
24590         * literal.cs (LongLiteral): Implement long literal class.
24591         (IntLiteral): export the `Value' of the intliteral. 
24592
24593 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24594
24595         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24596
24597         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24598         instead of 'Operator'
24599
24600         * expression.cs (Binary::ResolveOperator): Update accordingly.
24601         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24602         and 'Minus'
24603
24604         * cs-parser.jay (unary_expression): Update to use the new names.
24605
24606         * gen-treedump.cs (GetUnary): Same here.
24607
24608         * expression.cs (Unary::Resolve): Implement.
24609         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24610         operators are found instead of making noise ;-)
24611         (Unary::ResolveOperator): New method to do precisely the same thing which
24612         Binary::ResolveOperator does for Binary expressions.
24613         (Unary.method, .Arguments): Add.
24614         (Unary::OperName): Implement.   
24615         (Unary::ForceConversion): Copy and Paste !
24616
24617         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24618         a unary operator.
24619
24620         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24621         for the inbuilt operators. Only overloading works for now ;-)
24622
24623 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24624
24625         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24626         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24627
24628         * expression.cs (This::Emit): Implement. 
24629         (This::Resolve): Implement.
24630         (TypeOf:Resolve): Implement.
24631         (Expression::ResolveSimpleName): Add an implicit this to instance
24632         field references. 
24633         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24634         Bind instance variable to Field expressions.
24635         (FieldExpr::Instance): New field used to track the expression that
24636         represents the object instance.
24637         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24638         binding 
24639         (FieldExpr::Emit): Implement.
24640
24641         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24642         the last instruction contains a return opcode to avoid generating
24643         the last `ret' instruction (this generates correct code, and it is
24644         nice to pass the peverify output).
24645
24646         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24647         initializer for static and instance variables.
24648         (Constructor::Emit): Allow initializer to be null in the case of
24649         static constructors.  Only emit initializer for instance
24650         constructors. 
24651
24652         (TypeContainer::FindMembers): Return a null array if there are no
24653         matches.
24654
24655         Also fix the code for the MemberTypes.Method branch, as it was not
24656         scanning that for operators (or tried to access null variables before).
24657
24658         * assign.cs (Assign::Emit): Handle instance and static fields. 
24659
24660         * TODO: Updated.
24661
24662         * driver.cs: Stop compilation if there are parse errors.
24663
24664         * cs-parser.jay (constructor_declaration): Provide default base
24665         initializer for non-static constructors.
24666         (constructor_declarator): Do not provide a default base
24667         initializers if none was specified.
24668         Catch the fact that constructors should not have parameters.
24669
24670         * class.cs: Do not emit parent class initializers for static
24671         constructors, that should be flagged as an error.
24672
24673 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24674
24675         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24676         Move back code into TypeContainer::Populate.
24677
24678 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24679
24680         * class.cs (TypeContainer::AddConstructor): Fix the check to
24681         compare against Name, not Basename. 
24682         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24683
24684         * cs-parser.jay : Update accordingly.
24685
24686         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24687         for methods, don't forget to look into the operators too.
24688         (RegisterMethodBuilder): Helper method to take care of this for
24689         methods, constructors and operators.
24690         (Operator::Define): Completely revamp.
24691         (Operator.OperatorMethod, MethodName): New fields.
24692         (TypeContainer::Populate): Move the registering of builders into
24693         RegisterMethodBuilder.
24694         (Operator::Emit): Re-write.
24695
24696         * expression.cs (Binary::Emit): Comment out code path to emit method
24697         invocation stuff for the case when we have a user defined operator. I am
24698         just not able to get it right !
24699
24700 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24701
24702         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24703         argument. 
24704
24705         (Expression::MemberLookup): Provide a version that allows to
24706         specify the MemberTypes and BindingFlags. 
24707
24708         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24709         so it was not fetching variable information from outer blocks.
24710
24711         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24712         Beforefieldinit as it was buggy.
24713
24714         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24715         that Ravi put here.  
24716
24717         * class.cs (Constructor::Emit): Only emit if block is not null.
24718         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24719         deal with this by semantically definining it as if the user had
24720         done it.
24721
24722         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24723         constructors as we now "emit" them at a higher level.
24724
24725         (TypeContainer::DefineDefaultConstructor): Used to define the
24726         default constructors if none was provided.
24727
24728         (ConstructorInitializer): Add methods Resolve and Emit. 
24729
24730         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24731
24732 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24733
24734         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24735         the default constructor builder with our hashtable for methodbuilders
24736         to methodcores.
24737
24738         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24739         and argument_count is 0 in which case we have a match.
24740         (Binary::ResolveOperator): More null checking and miscellaneous coding
24741         style cleanup.
24742
24743 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24744
24745         * rootcontext.cs (IsNameSpace): Compare against null.
24746
24747         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24748
24749         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24750         and Unary::Operator.
24751
24752         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24753         accordingly.
24754
24755         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24756         we have overloaded operators.
24757         (Binary::ResolveOperator): Implement the part which does the operator overload
24758         resolution.
24759
24760         * class.cs (Operator::Emit): Implement.
24761         (TypeContainer::Emit): Emit the operators we have too.
24762
24763         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24764         the case when we have a user-defined operator.
24765
24766 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24767
24768         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24769
24770 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24771
24772         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24773         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24774         (Constructor::Emit): Implement.
24775         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24776         if we have no work to do. 
24777         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24778         Emit method.
24779
24780         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24781         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24782
24783         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24784         of parent.parent.
24785
24786 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24787
24788         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24789         in the source.
24790         (Tree::RecordNamespace): Method to do what the name says ;-)
24791         (Tree::Namespaces): Property to get at the namespaces hashtable.
24792
24793         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24794         keep track.
24795
24796         * rootcontext.cs (IsNamespace): Fixed it :-)
24797
24798 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24799
24800         * class.cs (TypeContainer::FindMembers): Add support for
24801         constructors. 
24802         (MethodCore): New class that encapsulates both the shared aspects
24803         of a Constructor and a Method.  
24804         (Method, Constructor): Factored pieces into MethodCore.
24805
24806         * driver.cs: Added --fatal which makes errors throw exceptions.
24807         Load System assembly as well as part of the standard library.
24808
24809         * report.cs: Allow throwing exceptions on errors for debugging.
24810
24811         * modifiers.cs: Do not use `parent', instead use the real type
24812         container to evaluate permission settings.
24813
24814         * class.cs: Put Ravi's patch back in.  He is right, and we will
24815         have to cope with the
24816
24817 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24818
24819         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24820         FamORAssem, not FamANDAssem.
24821
24822 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24823
24824         * driver.cs: Added --parse option that only parses its input files
24825         and terminates.
24826
24827         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24828         incorrect.  IsTopLevel is not used to tell whether an object is
24829         root_types or not (that can be achieved by testing this ==
24830         root_types).  But to see if this is a top-level *class* (not
24831         necessarly our "toplevel" container). 
24832
24833 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24834
24835         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24836         parent instead of a direct call to GetType.
24837
24838 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24839
24840         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24841         Modifiers.TypeAttr. This should just be a call to that method.
24842
24843         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24844         object so that we can determine if we are top-level or not.
24845
24846         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24847         TypeContainer too.
24848
24849         * enum.cs (Enum::Define): Ditto.
24850
24851         * modifiers.cs (FieldAttr): Re-write.
24852
24853         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24854         (TypeContainer::HaveStaticConstructor): New property to provide access
24855         to precisely that info.
24856
24857         * modifiers.cs (MethodAttr): Re-write.
24858         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24859
24860         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24861         of top-level types as claimed.
24862
24863 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24864
24865         * expression.cs (MemberLookup): Fruitless attempt to lookup
24866         constructors.  Maybe I need to emit default constructors?  That
24867         might be it (currently .NET emits this for me automatically).
24868         (Invocation::OverloadResolve): Cope with Arguments == null.
24869         (Invocation::EmitArguments): new function, shared by the new
24870         constructor and us.
24871         (Invocation::Emit): Handle static and instance methods.  Emit
24872         proper call instruction for virtual or non-virtual invocations.
24873         (New::Emit): Implement.
24874         (New::Resolve): Implement.
24875         (MemberAccess:Resolve): Implement.
24876         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24877         to track instances.
24878         (FieldExpr::Resolve): Set type.
24879
24880         * support.cs: Handle empty arguments.
24881                 
24882         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24883         SimpleLookup): Auxiliary routines to help parse a qualifier
24884         identifier.  
24885
24886         Update qualifier_identifier rule.
24887
24888         * codegen.cs: Removed debugging messages.
24889
24890         * class.cs: Make this a global thing, this acts just as a "key" to
24891         objects that we might have around.
24892
24893         (Populate): Only initialize method_builders_to_methods once.
24894
24895         * expression.cs (PropertyExpr): Initialize type from the
24896         PropertyType. 
24897
24898         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24899         Resolve pattern.  Attempt to implicitly convert value to boolean.
24900         Emit code.
24901
24902         * expression.cs: Set the type for the int32/int32 argument case.
24903         (Binary::ResolveOperator): Set the return type to boolean for
24904         comparission operators
24905
24906         * typemanager.cs: Remove debugging print code.
24907
24908         (Invocation::Resolve): resolve type.
24909
24910         * class.cs: Allocate a MemberInfo of the correct size, as the code
24911         elsewhere depends on the test to reflect the correct contents.
24912
24913         (Method::) Keep track of parameters, due to System.Reflection holes
24914
24915         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24916         mapping here.
24917
24918         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24919         of the exact size and return that.
24920
24921         (Class::LookupMethodByBuilder): New function that maps
24922         MethodBuilders to its methods.  Required to locate the information
24923         on methods because System.Reflection bit us again.
24924
24925         * support.cs: New file, contains an interface ParameterData and
24926         two implementations: ReflectionParameters and InternalParameters
24927         used to access Parameter information.  We will need to grow this
24928         as required.
24929
24930         * expression.cs (Invocation::GetParameterData): implement a cache
24931         and a wrapper around the ParameterData creation for methods. 
24932         (Invocation::OverloadResolve): Use new code.
24933
24934 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24935
24936         * class.cs (TypeContainer::EmitField): Remove and move into 
24937         (Field::Define): here and modify accordingly.
24938         (Field.FieldBuilder): New member.
24939         (TypeContainer::Populate): Update accordingly.
24940         (TypeContainer::FindMembers): Implement.
24941
24942 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24943
24944         * statement.cs: (VariableInfo::VariableType): New field to be
24945         initialized with the full type once it is resolved. 
24946
24947 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24948
24949         * parameter.cs (GetParameterInfo): Use a type cache to compute
24950         things only once, and to reuse this information
24951
24952         * expression.cs (LocalVariableReference::Emit): Implement.
24953         (OpcodeCast::Emit): fix.
24954
24955         (ParameterReference::Resolve): Implement.
24956         (ParameterReference::Emit): Implement.
24957
24958         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24959         that are expressions need to stay as Expressions.
24960
24961         * typemanager.cs (CSharpName): Returns the C# name of a type if
24962         possible. 
24963
24964         * expression.cs (Expression::ConvertImplicit): New function that
24965         implements implicit type conversions.
24966
24967         (Expression::ImplicitReferenceConversion): Implements implicit
24968         reference conversions.
24969
24970         (EmptyCast): New type for transparent casts.
24971
24972         (OpcodeCast): New type for casts of types that are performed with
24973         a sequence of bytecodes.
24974
24975         (BoxedCast): New type used for casting value types into reference
24976         types.  Emits a box opcode.
24977
24978         (Binary::DoNumericPromotions): Implements numeric promotions of
24979         and computation of the Binary::Type.
24980
24981         (Binary::EmitBranchable): Optimization.
24982
24983         (Binary::Emit): Implement code emission for expressions.
24984
24985         * typemanager.cs (TypeManager): Added two new core types: sbyte
24986         and byte.
24987
24988 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24989
24990         * class.cs (TypeContainer::FindMembers): Method which does exactly
24991         what Type.FindMembers does, only we don't have to use reflection. No
24992         implementation yet.
24993
24994         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24995         typecontainer objects as we need to get at them.
24996         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24997
24998         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24999         typecontainer object.
25000
25001         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25002         of just a Report object.
25003
25004 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25005
25006         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25007         "remove_"
25008         (TypeContainer::Populate): Now define the delegates of the type too.
25009         (TypeContainer.Delegates): Property to access the list of delegates defined
25010         in the type.
25011
25012         * delegates.cs (Delegate::Define): Implement partially.
25013
25014         * modifiers.cs (TypeAttr): Handle more flags.
25015
25016 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25017
25018         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25019         and not <=
25020         (Operator::Define): Re-write logic to get types by using the LookupType method
25021         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25022         (Indexer::Define): Ditto.
25023         (Event::Define): Ditto.
25024         (Property::Define): Ditto.
25025
25026 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25027
25028         * class.cs (TypeContainer::Populate): Now define operators too. 
25029         (TypeContainer.Operators): New property to access the list of operators
25030         in a type.
25031         (Operator.OperatorMethodBuilder): New member to hold the method builder
25032         for the operator we are defining.
25033         (Operator::Define): Implement.
25034
25035 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25036
25037         * class.cs (Event::Define): Make the prefixes of the accessor methods
25038         addOn_ and removeOn_ 
25039
25040         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25041         of the location being passed in too. Ideally, this should go later since all
25042         error reporting should be done through the Report object.
25043
25044         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25045         (Populate): Iterate thru the indexers we have and define them too.
25046         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25047         for the get and set accessors.
25048         (Indexer::Define): Implement.
25049
25050 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25051
25052         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25053         my previous implementation, did not work.
25054
25055         * typemanager.cs: Add a couple of missing types (the longs).
25056
25057         * literal.cs: Use TypeManager.bool_type instead of getting it.
25058
25059         * expression.cs (EventExpr): New kind of expressions.
25060         (Expressio::ExprClassFromMemberInfo): finish
25061
25062 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25063
25064         * assign.cs: Emit stores to static fields differently.
25065
25066 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25067
25068         * Merge in changes and adjust code to tackle conflicts. Backed out my
25069         code in Assign::Resolve ;-) 
25070
25071 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25072
25073         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25074         instead Report.Error and also pass in the location.
25075         (CSharpParser::Lexer): New readonly property to return the reference
25076         to the Tokenizer object.
25077         (declare_local_variables): Use Report.Error with location instead of plain 
25078         old error.
25079         (CheckDef): Ditto.
25080
25081         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25082         (Operator.CheckBinaryOperator): Ditto.
25083
25084         * cs-parser.jay (operator_declarator): Update accordingly.
25085
25086         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25087         (CheckBinaryOperator): Same here.
25088
25089         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25090         on the name without any prefixes of namespace names etc. This is because we
25091         already might have something already fully qualified like 
25092         'System.Console.WriteLine'
25093
25094         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25095
25096 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25097
25098         * cs-tokenizer.cs (location): Return a string which also contains
25099         the file name.
25100
25101         * expression.cs (ElementAccess): New class for expressions of the
25102         type 'element access.'
25103         (BaseAccess): New class for expressions of the type 'base access.'
25104         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25105         respectively.
25106
25107         * cs-parser.jay (element_access): Implement action.
25108         (base_access): Implement actions.
25109         (checked_expression, unchecked_expression): Implement.
25110
25111         * cs-parser.jay (local_variable_type): Correct and implement.
25112         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25113
25114         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25115
25116         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25117         name and the specifiers.
25118
25119         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25120
25121         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25122         making them all public ;-)
25123
25124         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25125         class anyways.
25126
25127 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25128
25129         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25130         PropertyExprs.
25131         (FieldExpr, PropertyExprs): New resolved expressions.
25132         (SimpleName::MemberStaticCheck): Perform static checks for access
25133         to non-static fields on static methods. Maybe this should be
25134         generalized for MemberAccesses. 
25135         (SimpleName::ResolveSimpleName): More work on simple name
25136         resolution. 
25137
25138         * cs-parser.jay (primary_expression/qualified_identifier): track
25139         the parameter index.
25140
25141         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25142         (EmitContext::EmitBoolExpression): Chain to expression generation
25143         instead of temporary hack.
25144         (::EmitStatementExpression): Put generic expression code generation.
25145
25146         * assign.cs (Assign::Emit): Implement variable assignments to
25147         local variables, parameters and fields.
25148
25149 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25150
25151         * statement.cs (Block::GetVariableInfo): New method, returns the
25152         VariableInfo for a variable name in a block.
25153         (Block::GetVariableType): Implement in terms of GetVariableInfo
25154
25155         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25156         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25157
25158 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25159
25160         * cs-parser.jay (operator_declaration): Continue on my quest : update
25161         to take attributes argument.
25162         (event_declaration): Ditto.
25163         (enum_declaration): Ditto.
25164         (indexer_declaration): Ditto.
25165
25166         * class.cs (Operator::Operator): Update constructor accordingly.
25167         (Event::Event): Ditto.
25168
25169         * delegate.cs (Delegate::Delegate): Same here.
25170
25171         * enum.cs (Enum::Enum): Same here.
25172
25173 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25174
25175         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25176
25177         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25178
25179         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25180         being passed around as an arraylist.
25181         (Attributes::AddAttribute): Method to add attribute sections.
25182
25183         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25184         (struct_declaration): Update accordingly.
25185         (constant_declaration): Update.
25186         (field_declaration): Update.
25187         (method_header): Update.
25188         (fixed_parameter): Update.
25189         (parameter_array): Ditto.
25190         (property_declaration): Ditto.
25191         (destructor_declaration): Ditto.
25192
25193         * class.cs (Struct::Struct): Update constructors accordingly.
25194         (Class::Class): Ditto.
25195         (Field::Field): Ditto.
25196         (Method::Method): Ditto.
25197         (Property::Property): Ditto.
25198         (TypeContainer::OptAttribute): update property's return type.
25199
25200         * interface.cs (Interface.opt_attributes): New member.
25201         (Interface::Interface): Update to take the extra Attributes argument.
25202
25203         * parameter.cs (Parameter::Parameter): Ditto.
25204
25205         * constant.cs (Constant::Constant): Ditto.
25206
25207         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25208         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25209         the attributes as a parameter.
25210         (InterfaceProperty): Update constructor call.
25211         (InterfaceEvent): Ditto.
25212         (InterfaceMethod): Ditto.
25213         (InterfaceIndexer): Ditto.
25214
25215         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25216         pass the attributes too.
25217         (interface_event_declaration): Ditto.
25218         (interface_property_declaration): Ditto.
25219         (interface_method_declaration): Ditto.
25220         (interface_declaration): Ditto.
25221
25222 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25223
25224         * class.cs (Method::Define): Track the "static Main" definition to
25225         create an entry point. 
25226
25227         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25228         EntryPoint if we find it. 
25229
25230         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25231         (EmitContext::ig): Make this variable public.
25232
25233         * driver.cs: Make the default output file be the first file name
25234         with the .exe extension.  
25235
25236         Detect empty compilations
25237
25238         Handle various kinds of output targets.  Handle --target and
25239         rename -t to --dumper.
25240
25241         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25242         methods inherited from Expression return now an Expression.  This
25243         will is used during the tree rewriting as we resolve them during
25244         semantic analysis.
25245
25246         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25247         the spec.  Missing entirely is the information about
25248         accessability of elements of it.
25249
25250         (Expression::ExprClassFromMemberInfo): New constructor for
25251         Expressions that creates a fully initialized Expression based on
25252         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25253         a Type.
25254
25255         (Invocation::Resolve): Begin implementing resolution of invocations.
25256
25257         * literal.cs (StringLiteral):  Implement Emit.
25258
25259 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25260
25261         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25262         member.
25263
25264 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25265
25266         * cs-parser.jay (attribute_arguments): Implement actions.
25267         (attribute): Fix bug in production. Implement action.
25268         (attribute_list): Implement.
25269         (attribute_target): Implement.
25270         (attribute_target_specifier, opt_target_specifier): Implement
25271         (CheckAttributeTarget): New method to check if the attribute target
25272         is valid.
25273         (attribute_section): Implement.
25274         (opt_attributes): Implement.
25275
25276         * attribute.cs : New file to handle attributes.
25277         (Attribute): Class to hold attribute info.
25278
25279         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25280         (attribute_section): Modify production to use 2 different rules to 
25281         achieve the same thing. 1 s/r conflict down !
25282         Clean out commented, useless, non-reducing dimension_separator rules.
25283
25284         * class.cs (TypeContainer.attributes): New member to hold list
25285         of attributes for a type.
25286         (Struct::Struct): Modify to take one more argument, the attribute list.
25287         (Class::Class): Ditto.
25288         (Field::Field): Ditto.
25289         (Method::Method): Ditto.
25290         (Property::Property): Ditto.
25291
25292         * cs-parser.jay (struct_declaration): Update constructor call to
25293         pass in the attributes too.
25294         (class_declaration): Ditto.
25295         (constant_declaration): Ditto.
25296         (field_declaration): Ditto.
25297         (method_header): Ditto.
25298         (fixed_parameter): Ditto.
25299         (parameter_array): Ditto.
25300         (property_declaration): Ditto.
25301
25302         * constant.cs (Constant::Constant): Update constructor similarly.
25303         Use System.Collections.
25304
25305         * parameter.cs (Parameter::Parameter): Update as above.
25306
25307 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25308
25309         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25310         (TypeContainer.delegates): New member to hold list of delegates.
25311
25312         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25313         this time as I seem to be on crack ;-)
25314
25315 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25316
25317         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25318         tell whether an identifier represents a namespace.
25319
25320         * expression.cs (NamespaceExpr): A namespace expression, used only
25321         temporarly during expression resolution.
25322         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25323         utility functions to resolve names on expressions.
25324
25325 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25326
25327         * codegen.cs: Add hook for StatementExpressions. 
25328
25329         * class.cs: Fix inverted test for static flag in methods.
25330
25331 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25332
25333         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25334         to make it coincide with MS' number.
25335         (Operator::CheckBinaryOperator): Ditto.
25336
25337         * ../errors/errors.txt : Remove error numbers added earlier.
25338
25339         * ../errors/cs1019.cs : Test case for error # 1019
25340
25341         * ../errros/cs1020.cs : Test case for error # 1020
25342
25343         * cs-parser.jay : Clean out commented cruft.
25344         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25345         used anywhere - non-reducing rule.
25346         (namespace_declarations): Non-reducing rule - comment out.
25347
25348         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25349         with TypeContainer::AddEnum.
25350
25351         * delegate.cs : New file for delegate handling classes.
25352         (Delegate): Class for declaring delegates.
25353
25354         * makefile : Update.
25355
25356         * cs-parser.jay (delegate_declaration): Implement.
25357
25358 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25359
25360         * class.cs (Event::Define): Implement.
25361         (Event.EventBuilder): New member.
25362
25363         * class.cs (TypeContainer::Populate): Update to define all enums and events
25364         we have.
25365         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25366         readonly fields for all these cases ?
25367
25368 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25369
25370         * class.cs (Property): Revamp to use the convention of making fields readonly.
25371         Accordingly modify code elsewhere.
25372
25373         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25374         the Define method of the Property class.
25375
25376         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25377         trivial bug.
25378         (TypeContainer::Populate): Update to define all the properties we have. Also
25379         define all enumerations.
25380
25381         * enum.cs (Define): Implement.
25382
25383 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25384
25385         * cs-parser.jay (overloadable_operator): The semantic value is an
25386         enum of the Operator class.
25387         (operator_declarator): Implement actions.
25388         (operator_declaration): Implement.
25389
25390         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25391         validity of definitions.
25392         (Operator::CheckBinaryOperator): Static method to check for binary operators
25393         (TypeContainer::AddOperator): New method to add an operator to a type.
25394
25395         * cs-parser.jay (indexer_declaration): Added line to actually call the
25396         AddIndexer method so it gets added ;-)
25397
25398         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25399         already taken care of by the MS compiler ?  
25400
25401 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25402
25403         * class.cs (Operator): New class for operator declarations.
25404         (Operator::OpType): Enum for the various operators.
25405
25406 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25407
25408         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25409         ostensibly handle this in semantic analysis.
25410
25411         * cs-parser.jay (general_catch_clause): Comment out
25412         (specific_catch_clauses, specific_catch_clause): Ditto.
25413         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25414         (catch_args, opt_catch_args): New productions.
25415         (catch_clause): Rewrite to use the new productions above
25416         (catch_clauses): Modify accordingly.
25417         (opt_catch_clauses): New production to use in try_statement
25418         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25419         and re-write the code in the actions to extract the specific and
25420         general catch clauses by being a little smart ;-)
25421
25422         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25423         Hooray, try and catch statements parse fine !
25424
25425 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25426
25427         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25428         string from the hashtable of variables.
25429
25430         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25431         I end up making that mistake ;-)
25432         (catch_clauses): Fixed gross error which made Key and Value of the 
25433         DictionaryEntry the same : $1 !!
25434
25435 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25436
25437         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25438
25439         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25440         when the add and remove accessors are specified. 
25441
25442 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25443
25444         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25445         information about indexer_declarator.
25446         (indexer_declarator): Implement actions.
25447         (parsing_indexer): New local boolean used to keep track of whether
25448         we are parsing indexers or properties. This is necessary because 
25449         implicit_parameters come into picture even for the get accessor in the 
25450         case of an indexer.
25451         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25452
25453         * class.cs (Indexer): New class for indexer declarations.
25454         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25455         (TypeContainer::indexers): New member to hold list of indexers for the
25456         type.
25457
25458 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25459
25460         * cs-parser.jay (add_accessor_declaration): Implement action.
25461         (remove_accessor_declaration): Implement action.
25462         (event_accessors_declaration): Implement
25463         (variable_declarators): swap statements for first rule - trivial.
25464
25465         * class.cs (Event): New class to hold information about event
25466         declarations.
25467         (TypeContainer::AddEvent): New method to add an event to a type
25468         (TypeContainer::events): New member to hold list of events.
25469
25470         * cs-parser.jay (event_declaration): Implement actions.
25471
25472 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25473
25474         * cs-parser.jay (dim_separators): Implement. Make it a string
25475         concatenating all the commas together, just as they appear.
25476         (opt_dim_separators): Modify accordingly
25477         (rank_specifiers): Update accordingly. Basically do the same
25478         thing - instead, collect the brackets here.
25479         (opt_rank_sepcifiers): Modify accordingly.
25480         (array_type): Modify to actually return the complete type string
25481         instead of ignoring the rank_specifiers.
25482         (expression_list): Implement to collect the expressions
25483         (variable_initializer): Implement. We make it a list of expressions
25484         essentially so that we can handle the array_initializer case neatly too.
25485         (variable_initializer_list): Implement.
25486         (array_initializer): Make it a list of variable_initializers
25487         (opt_array_initializer): Modify accordingly.
25488
25489         * expression.cs (New::NType): Add enumeration to help us
25490         keep track of whether we have an object/delegate creation
25491         or an array creation.
25492         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25493         members to hold data about array creation.
25494         (New:New): Modify to update NewType
25495         (New:New): New Overloaded contructor for the array creation
25496         case.
25497
25498         * cs-parser.jay (array_creation_expression): Implement to call
25499         the overloaded New constructor.
25500
25501 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25502
25503         * class.cs (TypeContainer::Constructors): Return member
25504         constructors instead of returning null.
25505
25506 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25507
25508         * typemanager.cs (InitCoreTypes): Initialize the various core
25509         types after we have populated the type manager with the user
25510         defined types (this distinction will be important later while
25511         compiling corlib.dll)
25512
25513         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25514         on Expression Classification.  Now all expressions have a method
25515         `Resolve' and a method `Emit'.
25516
25517         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25518         generation from working.     Also add some temporary debugging
25519         code. 
25520
25521 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25522
25523         * codegen.cs: Lots of code generation pieces.  This is only the
25524         beginning, will continue tomorrow with more touches of polish.  We
25525         handle the fundamentals of if, while, do, for, return.  Others are
25526         trickier and I need to start working on invocations soon.
25527
25528         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25529         s.InitStatement. 
25530
25531         * codegen.cs (EmitContext): New struct, used during code
25532         emission to keep a context.   Most of the code generation will be
25533         here. 
25534
25535         * cs-parser.jay: Add embedded blocks to the list of statements of
25536         this block.  So code generation proceeds in a top down fashion.
25537
25538 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25539
25540         * statement.cs: Add support for multiple child blocks.
25541
25542 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25543
25544         * codegen.cs (EmitCode): New function, will emit the code for a
25545         Block of code given a TypeContainer and its ILGenerator. 
25546
25547         * statement.cs (Block): Standard public readonly optimization.
25548         (Block::Block constructors): Link children. 
25549         (Block::Child): Child Linker.
25550         (Block::EmitVariables): Emits IL variable declarations.
25551
25552         * class.cs: Drop support for MethodGroups here, delay until
25553         Semantic Analysis.
25554         (Method::): Applied the same simplification that I did before, and
25555         move from Properties to public readonly fields.
25556         (Method::ParameterTypes): Returns the parameter types for the
25557         function, and implements a cache that will be useful later when I
25558         do error checking and the semantic analysis on the methods is
25559         performed.
25560         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25561         and made a method, optional argument tells whether this is a class
25562         or a structure to apply the `has-this' bit.
25563         (Method::GetCallingConvention): Implement, returns the calling
25564         convention. 
25565         (Method::Define): Defines the type, a second pass is performed
25566         later to populate the methods.
25567
25568         (Constructor::ParameterTypes): implement a cache similar to the
25569         one on Method::ParameterTypes, useful later when we do semantic
25570         analysis. 
25571
25572         (TypeContainer::EmitMethod):  New method.  Emits methods.
25573
25574         * expression.cs: Removed MethodGroup class from here.
25575
25576         * parameter.cs (Parameters::GetCallingConvention): new method.
25577
25578 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25579
25580         * class.cs (TypeContainer::Populate): Drop RootContext from the
25581         argument. 
25582
25583         (Constructor::CallingConvention): Returns the calling convention.
25584         (Constructor::ParameterTypes): Returns the constructor parameter
25585         types. 
25586
25587         (TypeContainer::AddConstructor): Keep track of default constructor
25588         and the default static constructor.
25589
25590         (Constructor::) Another class that starts using `public readonly'
25591         instead of properties. 
25592
25593         (Constructor::IsDefault): Whether this is a default constructor. 
25594
25595         (Field::) use readonly public fields instead of properties also.
25596
25597         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25598         track of static constructors;  If none is used, turn on
25599         BeforeFieldInit in the TypeAttributes. 
25600
25601         * cs-parser.jay (opt_argument_list): now the return can be null
25602         for the cases where there are no arguments. 
25603
25604         (constructor_declarator): If there is no implicit `base' or
25605         `this', then invoke the default parent constructor. 
25606
25607         * modifiers.cs (MethodAttr): New static function maps a set of
25608         modifiers flags into a MethodAttributes enum
25609         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25610         MethodAttr, TypeAttr to represent the various mappings where the
25611         modifiers are used.
25612         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25613
25614 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25615
25616         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25617         method arguments.
25618
25619         * interface.cs (PopulateIndexer): Implemented the code generator
25620         for interface indexers.
25621
25622 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25623
25624         * interface.cs (InterfaceMemberBase): Now we track the new status
25625         here.  
25626
25627         (PopulateProperty): Implement property population.  Woohoo!  Got
25628         Methods and Properties going today. 
25629
25630         Removed all the properties for interfaces, and replaced them with
25631         `public readonly' fields. 
25632
25633 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25634
25635         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25636         initialize their hashtables/arraylists only when they are needed
25637         instead of doing this always.
25638
25639         * parameter.cs: Handle refs and out parameters.
25640
25641         * cs-parser.jay: Use an ArrayList to construct the arguments
25642         instead of the ParameterCollection, and then cast that to a
25643         Parameter[] array.
25644
25645         * parameter.cs: Drop the use of ParameterCollection and use
25646         instead arrays of Parameters.
25647
25648         (GetParameterInfo): Use the Type, not the Name when resolving
25649         types. 
25650
25651 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25652
25653         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25654         and instead use public readonly fields.
25655
25656         * class.cs: Put back walking code for type containers.
25657
25658 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25659
25660         * class.cs (MakeConstant): Code to define constants.
25661
25662         * rootcontext.cs (LookupType): New function.  Used to locate types 
25663
25664
25665 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25666
25667         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25668         this System.Reflection code is.  Kudos to Microsoft
25669
25670         * typemanager.cs: Implement a type cache and avoid loading all
25671         types at boot time.  Wrap in LookupType the internals.  This made
25672         the compiler so much faster.  Wow.  I rule!
25673
25674         * driver.cs: Make sure we always load mscorlib first (for
25675         debugging purposes, nothing really important).
25676
25677         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25678         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25679
25680         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25681         on namespaces that have been imported using the `using' keyword.
25682
25683         * class.cs (TypeContainer::TypeAttr): Virtualize.
25684         (Class::TypeAttr): Return attributes suitable for this bad boy.
25685         (Struct::TypeAttr): ditto.
25686         Handle nested classes.
25687         (TypeContainer::) Remove all the type visiting code, it is now
25688         replaced with the rootcontext.cs code
25689
25690         * rootcontext.cs (GetClassBases): Added support for structs. 
25691
25692 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25693
25694         * interface.cs, statement.cs, class.cs, parameter.cs,
25695         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25696         Drop use of TypeRefs, and use strings instead.
25697
25698 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25699
25700         * rootcontext.cs: 
25701
25702         * class.cs (Struct::Struct): set the SEALED flags after
25703         checking the modifiers.
25704         (TypeContainer::TypeAttr): new property, returns the
25705         TypeAttributes for a class.  
25706
25707         * cs-parser.jay (type_list): Oops, list production was creating a
25708         new list of base types.
25709
25710         * rootcontext.cs (StdLib): New property.
25711         (GetInterfaceTypeByName): returns an interface by type name, and
25712         encapsulates error handling here.
25713         (GetInterfaces): simplified.
25714         (ResolveTree): Encapsulated all the tree resolution here.
25715         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25716         types. 
25717
25718         * driver.cs: Add support for --nostdlib, to avoid loading the
25719         default assemblies.
25720         (Main): Do not put tree resolution here. 
25721
25722         * rootcontext.cs: Beginning of the class resolution.
25723
25724 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25725
25726         * rootcontext.cs: Provide better error reporting. 
25727
25728         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25729
25730         * rootcontext.cs (CreateInterface): Handle the case where there
25731         are no parent interfaces.
25732
25733         (CloseTypes): Routine to flush types at the end.
25734         (CreateInterface): Track types.
25735         (GetInterfaces): Returns an array of Types from the list of
25736         defined interfaces.
25737
25738         * typemanager.c (AddUserType): Mechanism to track user types (puts
25739         the type on the global type hash, and allows us to close it at the
25740         end). 
25741
25742 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25743
25744         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25745         RecordInterface instead.
25746
25747         * cs-parser.jay: Updated to reflect changes above.
25748
25749         * decl.cs (Definition): Keep track of the TypeBuilder type that
25750         represents this type here.  Not sure we will use it in the long
25751         run, but wont hurt for now.
25752
25753         * driver.cs: Smaller changes to accomodate the new code.
25754
25755         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25756         when done. 
25757
25758         * rootcontext.cs (CreateInterface):  New method, used to create
25759         the System.TypeBuilder type for interfaces.
25760         (ResolveInterfaces): new entry point to resolve the interface
25761         hierarchy. 
25762         (CodeGen): Property, used to keep track of the code generator.
25763
25764 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25765
25766         * cs-parser.jay: Add a second production for delegate_declaration
25767         with `VOID'.
25768
25769         (enum_body): Put an opt_comma here instead of putting it on
25770         enum_body or enum_member_declarations so we can handle trailing
25771         commas on enumeration members.  Gets rid of a shift/reduce.
25772
25773         (type_list): Need a COMMA in the middle.
25774
25775         (indexer_declaration): Tell tokenizer to recognize get/set
25776
25777         * Remove old targets.
25778
25779         * Re-add the parser target.
25780
25781 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25782
25783         * cs-parser.jay: Add precendence rules for a number of operators
25784         ot reduce the number of shift/reduce conflicts in the grammar.
25785
25786 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25787
25788         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25789         and put it here.
25790
25791         Get rid of old crufty code.
25792
25793         * rootcontext.cs: Use this to keep track of the parsed
25794         representation and the defined types available to the program. 
25795
25796         * gen-treedump.cs: adjust for new convention.
25797
25798         * type.cs: Split out the type manager, and the assembly builder
25799         from here. 
25800
25801         * typemanager.cs: the type manager will live here now.
25802
25803         * cil-codegen.cs: And the code generator here. 
25804
25805 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25806
25807         * makefile: Fixed up for easy making.
25808
25809 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25810
25811         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25812         the 
25813
25814         (unary_expression): Expand pre_increment_expression and
25815         post_decrement_expression to reduce a shift/reduce.
25816
25817 2001-07-11  Simon Cozens
25818
25819         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25820
25821         Improve allow_keyword_as_indent name.
25822
25823 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25824
25825         * Adjustments for Beta2. 
25826
25827 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25828
25829         * decl.cs: Added `Define' abstract method.
25830         (InTransit): new property, used to catch recursive definitions. 
25831
25832         * interface.cs: Implement `Define'. 
25833
25834         * modifiers.cs: Map Modifiers.constants to
25835         System.Reflection.TypeAttribute flags.
25836
25837         * class.cs: Keep track of types and user-defined types.
25838         (BuilderInit): New method for creating an assembly
25839         (ResolveType): New function to launch the resolution process, only
25840         used by interfaces for now.
25841
25842         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25843         that are inserted into the name space. 
25844
25845 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25846
25847         * ARGH.  I have screwed up my tree so many times due to the use of
25848         rsync rather than using CVS.  Going to fix this at once. 
25849
25850         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25851         load types.
25852
25853 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25854
25855         * Experiment successful: Use System.Type rather that our own
25856         version of Type.  
25857
25858 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25859
25860         * cs-parser.jay: Removed nsAliases from here.
25861
25862         Use new namespaces, handle `using XXX;' 
25863
25864         * namespace.cs: Reimplemented namespace handling, use a recursive
25865         definition of the class.  Now we can keep track of using clauses
25866         and catch invalid using clauses.
25867
25868 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25869
25870         * gen-treedump.cs: Adapted for all the renaming.
25871
25872         * expression.cs (Expression): this class now has a Type property
25873         which returns an expression Type.
25874
25875         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25876         `Type', as this has a different meaning now in the base
25877
25878 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25879
25880         * interface.cs, class.cs: Removed from all the sources the
25881         references to signature computation, as we can not do method
25882         signature computation during the parsing time, as we are not
25883         trying to solve at that point distinguishing:
25884
25885         class X {
25886                 void a (Blah x) {}
25887                 void a (NS.Blah x) {}
25888         }
25889
25890         Which depending on the context might be valid or not, as we do not
25891         know if Blah is the same thing as NS.Blah at that point.
25892
25893         * Redid everything so the code uses TypeRefs now instead of
25894         Types.  TypeRefs are just temporary type placeholders, that need
25895         to be resolved.  They initially have a pointer to a string and the
25896         current scope in which they are used.  This is used later by the
25897         compiler to resolve the reference to an actual Type. 
25898
25899         * DeclSpace is no longer a CIR.Type, and neither are
25900         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25901         are all DeclSpaces, but no Types. 
25902
25903         * type.cs (TypeRefManager): This implements the TypeRef manager,
25904         which keeps track of all the types that need to be resolved after
25905         the parsing has finished. 
25906
25907 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25908
25909         * ARGH.  We are going to have to store `foreach' as a class rather
25910         than resolving it, as we need to verify error 1579 after name
25911         resolution.   *OR* we could keep a flag that says `This request to
25912         IEnumerator comes from a foreach statement' which we can then use
25913         to generate the error.
25914
25915 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25916
25917         * class.cs (TypeContainer.AddMethod): we now add methods to the
25918         MethodGroup instead of the method hashtable.  
25919
25920         * expression.cs: Add MethodGroup abstraction, which gets us one
25921         step closer to the specification in the way we handle method
25922         declarations.  
25923
25924         * cs-parser.jay (primary_expression): qualified_identifier now
25925         tried to match up an identifier to a local variable reference or
25926         to a parameter reference.
25927
25928         current_local_parameters is now a parser global variable that
25929         points to the current parameters for the block, used during name
25930         lookup.
25931
25932         (property_declaration): Now creates an implicit `value' argument to
25933         the set accessor.
25934
25935 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25936
25937         * parameter.cs: Do not use `param' arguments as part of the
25938         signature, per the spec.
25939
25940 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25941
25942         * decl.cs: Base class for classes, structs and interfaces.  This
25943         is the "Declaration Space" 
25944
25945         * cs-parser.jay: Use CheckDef for checking declaration errors
25946         instead of having one on each function.
25947
25948         * class.cs: Factor out some code for handling error handling in
25949         accordance to the "Declarations" section in the "Basic Concepts"
25950         chapter in the ECMA C# spec.
25951
25952         * interface.cs: Make all interface member classes derive from
25953         InterfaceMemberBase.
25954
25955 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25956
25957         * Many things: all interfaces are parsed and generated in
25958         gen-treedump.  Support for member variables, constructors,
25959         destructors, properties, constants is there.
25960
25961         Beginning of the IL backend, but very little done, just there for
25962         testing purposes. 
25963
25964 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25965
25966         * cs-parser.jay: Fix labeled statement.
25967
25968         * cs-tokenizer.cs (escape): Escape " and ' always.
25969         ref_line, ref_name: keep track of the line/filename as instructed
25970         by #line by the compiler.
25971         Parse #line.
25972
25973 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25974
25975         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25976         to match the values in System.CodeDOM.
25977
25978         Divid renamed to Divide.
25979
25980         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25981         statements. 
25982         (Statements.set): remove.
25983
25984         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25985         statements. 
25986
25987         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25988         falseStatements always have valid values. 
25989
25990         * cs-parser.jay: Use System.CodeDOM now.
25991