In mcs:
[mono.git] / mcs / gmcs / ChangeLog
1 2006-05-03  Raja R Harinath  <rharinath@novell.com>
2
3         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
4         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
5         always true at the only non-recursive entry point.
6         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7         FlowBranchingBreakable.
8         (FlowBranchingLoop): Remove.
9         * statement.cs (Return.DoResolve): Update to changes.
10
11         Fix #76471, #76665
12         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
13         (FlowBranching.CreateBranching): Handle it: create a
14         FlowBranchingContinuable.
15         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
16         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
17         except that it handles the 'continue' command.
18         (FlowBranching.UsageVector.MergeOrigins): Rename from
19         MergeBreakOrigins.
20         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
21         except that it overrides AddContinueOrigin.
22         (FlowBranchingException): Override AddContinueOrigin, similar to
23         AddBreakOrigin.
24         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
25         Create a new branching around the embedded statement.
26         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
27         control flow after the embedded statement.
28         (Continue.Resolve): Move all error checking to AddContinueOrigin.
29
30         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
31         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
32         FlowBranchingBreakable.
33         (FlowBranchingSwitch): Remove.
34
35         Fix test-503.cs
36         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
37         error reporting to ...
38         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
39         Rename from 'AddBreakVector'.  Add new location argument.  Return
40         a bool indicating whether the 'break' crosses an unwind-protect.
41         (FlowBranchingException.AddBreakOrigin): Add.
42         (FlowBranchingException.Merge): Propagate 'break's to surrounding
43         flowbranching after updating with the effects of the 'finally'
44         clause.
45         (FlowBranchingBreakable): New common base class for
46         FlowBranchingLoop and FlowBranchingSwitch.
47
48         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
49         embedded statement.
50         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
51
52 2006-05-02  Raja R Harinath  <rharinath@novell.com>
53
54         * statement.cs (Do.Resolve): If the loop is infinite, set the
55         barrier.
56         (While.Resolve, For.Resolve): Set a barrier after the embedded
57         statement.  There's no direct control flow that goes from the end
58         of the embedded statement to the end of the loop.
59         * flowanalysis.cs (FlowBranching.Infinite): Remove.
60         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
61         above ensure that the reachability is correctly computed.
62
63         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
64         (UsageVector.MergeBreakOrigins): If the current path is
65         unreachable, treat it as if all parameters/locals are initialized.
66         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
67         infinite loops before merging-in break origins.
68
69         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
70         (Reachability.Reachable): Split part into ...
71         (Reachability.Unreachable): ... this.  Simplify.
72         (Reachability.IsUnreachable): Use 'Unreachable' instead.
73
74         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
75         (Reachability.SetThrowsSometimes): Likewise.
76         (FlowBranchingBlock.MergeTopBlock): Don't compare against
77         TriState.Always, use corresponding property.
78         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
79         (Block.Resolve): Likewise.  Remove some redundant checks.
80
81 2006-05-02  Raja R Harinath  <harinath@gmail.com>
82
83         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
84         (Reachability.Meet): Don't bother checking AlwaysThrows --
85         barrier is always set.
86         (FlowBranchingBlock.Merge): Likewise.
87
88 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
89
90         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
91         defined, so it's references should also compile only for NET_2_0
92         (as occurs in mcs version)
93
94 2006-05-01  Raja R Harinath  <harinath@gmail.com>
95
96         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
97         checks for unreachable.
98
99 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
100
101         A fix for #77980
102         *flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
103
104         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
105         whether field is really assigned.
106
107 2006-04-30  Raja R Harinath  <harinath@gmail.com>
108
109         * flowanalysis.cs (Reachability): Make 4-argument constructor
110         private.
111         (Reachability.Meet): Rename from 'And'.  Remove static variant.
112         (Reachability.Always): Rename from the highly misleading
113         'Reachability.Never'.
114         (FlowBranching.Merge): Update to changes.  Mark an impossible
115         situation with a 'throw'.
116         (*): Update to changes.
117
118 2006-04-29  Raja R Harinath  <harinath@gmail.com>
119
120         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
121         Remove 'Undefined'.
122         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
123         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
124         (*): Update to changes.
125         * statement.cs: Update to changes.
126
127 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
128
129         A fix for #78049
130         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
131
132 2006-04-28  Raja R Harinath  <harinath@gmail.com>
133
134         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
135         dummy UsageVector.
136
137         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
138         argument to two arguments: an usage-vector and a bool.  Move call
139         to FlowBranching.Merge () ...
140         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
141
142         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
143         handling of loop and switch reachability to ...
144         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
145
146 2006-04-27  Raja R Harinath  <harinath@gmail.com>
147
148         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
149         handling to FlowBranchingLoop.InLoop.
150         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
151
152 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
153
154         A fix for #78115
155         anonymous.cs.cs (AnonymousMethod.DoResolve): Moved the check whether
156         anonymous method  is allowed from AnonymousContainer here.
157
158         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
159
160 2006-04-24  Raja R Harinath  <rharinath@novell.com>
161
162         Fix #78156
163         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
164
165 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
166
167         A fix for #49011.
168         constant.cs (FloatConstant.Reduce): Add range checking for checked context.
169         (DoubleConstant.Reduce): Ditto.
170
171 2006-04-23  Raja R Harinath  <rharinath@novell.com>
172
173         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
174         Remove 'lvalue_right_side' argument.  Move parts to ...
175         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
176         (LocalVariable.DoResolveLValue): ... these.
177
178 2006-04-21  Raja R Harinath  <rharinath@novell.com>
179
180         Fix cs1655.cs
181         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
182         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
183         (LocalVariableReference.DoResolveBase): Use it to implement new
184         CS1655 check.
185         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
186         (Argument.Resolve): Simplify.  Move CS1510 check ...
187         * ecore.cs (Expression.ResolveLValue): ... here.
188         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
189         (PropertyExpr.DoResolveLValue): Likewise.
190         (FieldExpr.Report_AssignToReadonly): Likewise.
191         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
192         LValueMemberAccess or LValueMemberOutAccess on instance depending
193         on it.
194         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
195         DoResolve as appropriate.
196
197 2006-04-20  Raja R Harinath  <rharinath@novell.com>
198
199         Fix #75800
200         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
201         implicit conversions on 'out' and 'ref' arguments.
202
203         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
204         improve clarity.  Remove dead code.
205
206         Fix #66031
207         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
208         (Catch.Resolve): Resolve VarBlock if it exists.
209
210 2006-04-19  Miguel de Icaza  <miguel@novell.com>
211
212         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
213         twice, this was some residual code, the enumerator was emitted
214         properly in the two branche of if later.
215
216         Fixes #78031
217         
218         Thanks to Martin for finding the source of the problem
219         
220 2006-04-19  Raja R Harinath  <rharinath@novell.com>
221
222         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
223         cast is never an lvalue.
224         (Cast.DoResolve, Cast.ResolveRest): Combine.
225         (Argument.Emit): Simplify slightly.  Move 'Expr is
226         IMemoryLocation' check ...
227         (Argument.Resolve): ... here.
228         (Argument.Error_LValueRequired): Remove.  Inline into only user.
229
230         Simplifications.  Fix cs0191-2.cs
231         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
232         CS1649 and CS1651 to ...
233         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
234         the actual selection of the error code and message to a lookup
235         table.  Add a dummy return value to simplify callsites.
236         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
237         readonly fields of other instances of the same type.  Move CS0197
238         warning from ...
239         * expression.cs (Argument.Resolve): ... here.  Simplify code.
240         Ensure that ec.InRefOutArgumentResolving is only set during LValue
241         resolution of an out or ref argument.  The code simplification
242         above uses this invariant.
243
244 2006-04-18  Raja R Harinath  <rharinath@novell.com>
245
246         Possibly fix #77752.  Fix cs1690-[4-7].cs.
247         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
248         CheckMarshallByRefAccess.  Drop parameter.
249         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
250         warning.
251         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
252         InstanceExpression.
253         * report.cs (AllWarnings): Add CS1690.
254         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
255         for ref access too.
256         (LocalVariableReference.DoResolveBase): Update.
257
258 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
259
260         class.cs (MethodOrOperator): Moved common parts from method class.
261         detect obsolete attributes.
262         (Method.Define): Simplified as it reuses code from base.
263         (Constructor.ValidAttributeTargets): Fixed issue found during
264         refactoring.
265         (Destructor.ValidAttributeTargets): Fixed issue found during
266         refactoring.
267         (Operator): Finished refactoring set off by #78020. Operator class is now
268         ordinary method class.
269
270         * anonymous.cs: Updated.
271
272 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
273
274         (Constructor.Emit): Don't emit the attributes twice.
275
276 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
277
278         class.cs (Operator.Emit): Extracted code from MethodData to correctly
279         detect obsolete attributes.
280         (Method.CreateEmitContext): Moved to MethodOrOperator.
281
282 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
283
284         A fix for #78048.
285         class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
286         customized exception to make crash detection easier.
287         (MethodOrOperator): Started to work on new base class for methods and
288         operators.
289         (Method): Derives from MethodOrOperator.
290         (Constructor.Emit): Emits its own attributes.
291         (AbstractPropertyEventMethod.Emit): Ditto.
292         (Operator): Derives from MethodOrOperator, will refactor fully in extra
293         patch.
294         (Operator.Emit): It's temporary more tricky than should be.
295         
296         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
297
298         * report.cs (InternalErrorException): Add ctor with inner exception.
299
300 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
301
302         A fix for #76744.
303         ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
304         only not visible.
305
306 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
307
308         A fix for #77916.
309         expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
310         array.
311
312 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
313
314         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
315         attribute is present and Guid not.
316         (Interface.ApplyAttributeBuilder): Ditto.
317
318         * attribute.cs: Add error message.
319
320 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
321
322         A fix for #78020.
323
324         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
325         sources (it's composite) so hold them in extra array as they are used in
326         Emit phase only. It worked in the previous versions by mistake.
327         (Attribute.Emit): Emit attribute for more owners when exist.
328
329         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
330         it has now different behaviour.
331
332 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
333
334         * constant.cs (Constant.IsDefaultInitializer): New method.
335
336         * class.cs: Updated.
337
338         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
339         re-initialize default values. It saves KBs almost for every assembly.
340         Thanks Zoltan for the idea.
341         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
342         (ArrayCreation.DoResolve): Resolve only once.
343         (ArrayCreation.Emit): Emit static initializer only when it is faster.
344         (ArrayCreation.GetAttributableValue): Cope with optimized values.
345
346 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
347
348         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
349         From #77961.
350
351 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
352
353         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
354         in an embedded statement too.
355
356 2006-04-01  Raja R Harinath  <rharinath@novell.com>
357
358         Fix #77929
359         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
360         testing.
361
362         Fix #77958
363         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
364
365         Fix #77962
366         * report.cs (SymbolRelatedToPreviousError): Drop generic type
367         arguments before checking whether a type is reflected or not.
368
369         Fix #77954
370         * expression.cs (Invocation.IsApplicable): Ensure a generic method
371         definition doesn't take part in overload resolution.
372         (Invocation.IsParamsMethodApplicable): Likewise.
373         (Invocation.OverloadResolve): When replacing a reflected override
374         method with its base definition, ensure that type arguments are
375         applied.
376
377 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
378
379         A fix for #77966.
380
381         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
382         was not specified.
383
384         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
385
386 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
387
388         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
389         phase.
390
391         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
392         LocalTemporary change.
393
394         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
395         TypeContainer.
396         (ClassOrStruct.DefineFieldInitializers): Implemented static field
397         initializers optimization.
398         (ClassOrStruct.TypeAttr): Moved from modifiers.
399         (Constructor.CheckBase): Don't crash when static ctor has parameters.
400         (FieldBase.ResolveInitializer): Resolves initializer.
401         (FieldBase.HasDefaultInitializer): New property.
402
403         * cs-parser.jay: Removed message.
404
405         * expression.cs (CompilerGeneratedThis): New specialization.
406
407         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
408
409 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
410
411         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
412
413 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
414
415         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
416         be now EnumConstants only.
417
418 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
419
420         * attribute.cs, driver.cs: Reset more caches.
421
422 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
423
424         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
425
426 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
427
428         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
429         for easier reuse. Updated all overrides.
430         (IntegralConstant): New base class for all integral constants.
431         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
432         of the constant range, report custom error.
433         (UIntConstant.Reduce): Fixed uint conversion.
434
435         * ecore.cs, literal.cs: Reduce updates.
436
437 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
438
439         A fix for #75813.
440
441         * class.cs (Constructor.Define): Removed extra if for default ctors.
442         A patch from Atsushi Enomoto.
443
444 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
445
446         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
447         GetAttributableValue.
448
449         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
450         when required.
451
452         * convert.cs (ImplicitConversionRequired): Error message moved to
453         DoubleLiteral.
454
455         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
456         automatic implicit conversion of an output value.
457         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
458
459         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
460         conversion.
461         (TypeOf.GetAttributableValue): Add extra handling for object type.
462
463         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
464         special error message.
465
466 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
467
468         * class.cs (Constructor.Emit): Don't crash when struct ctor is
469         InternalCall.
470         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
471         compatible with MS runtime.
472
473 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
474
475         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
476         attribute arguments here.
477
478         * class.cs (Indexer.Define): The check was moved to attribute class.
479
480 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
481
482         * expression.cs (StringConcat.Append): Reverted back to no warning state.
483
484 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
485
486         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
487
488         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
489         the blocks too.
490
491 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
492
493         * doc-bootstrap.cs : fix build.
494
495 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
496
497         * expression.cs (StringConcat.Append): Issue a warning when empty string
498         is going to append.
499
500 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
501
502         * assign.cs (CompoundAssign.ResolveSource): Removed.
503
504         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
505         clean up.
506
507         * class.cs (TypeContainer.FindMethods): Removed.
508         (TypeContainer.CheckMemberUsage): Made static.
509
510         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
511
512         * constant.cs (CheckRange): Removed unused type argument.
513         (CheckUnsigned): Removed unused type argument.
514
515         * cs-parser.jay: Updated after MemberAccess clean up.
516         Uses Length for empty string test.
517
518         * cs-tokenizer.cs: Uses Length for empty string test.
519         (IsCastToken): Made static.
520         (is_hex): Made static.
521         (real_type_suffix): Made static.
522
523         * decl.cs (SetupCache): Made static.
524         (OnGenerateDocComment): Removed unused ds argument.
525
526         * delegate.cs (VerifyDelegate): Removed unused argument.
527
528         * doc.cs: Uses Length for empty string test.
529
530         * driver.cs: Uses Length for empty string test.
531
532         * enum.cs (IsValidEnumType): Made static
533
534         * expression.cs (EnumLiftUp): Removed unused argument.
535         (ResolveMethodGroup): Ditto.
536         (BetterConversion): Ditto.
537         (GetVarargsTypes): Ditto.
538         (UpdateIndices): Ditto.
539         (ValidateInitializers): Ditto.
540         (MemberAccess.ctor): Ditto.
541         (GetIndexersForType): Ditto.
542
543         * flowanalysis.cs: (MergeFinally): Removed unused argument.
544
545         * iterators.cs: Updated after MemberAccess clean up.
546
547         * location.cs: Uses Length for empty string test.
548
549         * namespace.cs: Uses Length for empty string test.
550
551          * report.cs (CheckWarningCode): Made static.
552
553         * statement.cs (LabeledStatement): Removed unused argument.
554
555         * typemanager.cs (FilterNone): Removed.
556
557 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
558
559         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
560         obsolete.
561
562         * class.cs: Updated.
563
564 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
565
566         * cs-parser.jay.cs: __arglist is not allowed for delegates.
567
568 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
569
570         A fix for #77816.
571
572         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
573         host container.
574         (AnonymousMethod.ImplicitStandardConversionExists): New method.
575         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
576         Add more error reporting; Fixed issue with params.
577
578         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
579
580         * cs-parser.jay: AnonymousMethod requires host container.
581
582         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
583
584 2006-03-18  Raja R Harinath  <harinath@gmail.com>
585
586         * class.cs: Change 'TypeContainer ds' constructor argument to
587         'DeclSpace parent'.  Some classes were missed below due to
588         different naming convention.
589
590         * class.cs (MemberCore.Parent): Delete.  This makes the
591         ParentContainer changes below enforceable by the compiler.
592
593         Treat pointers to enclosing declaration space as 'DeclSpace', not
594         'TypeContainer'.
595         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
596         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
597
598         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
599         of TypeContainer.
600         (Block.AddThisVariable): Likewise.
601         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
602         (AbstractPropertyEventMethod.Emit): Likewise.
603         (AbstractPropertyEventMethod.EmitMethod): Likewise.
604         (GetMethod.Define, SetMethod.Define): Likewise.
605         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
606         (DelegateMethod.EmitMethod): Likewise.
607
608         Fix regression test-partial-13.cs.
609         Rationalize use of PartialContainer.  Ensure that the partial
610         class semantics can be tied to type-correctness, i.e., any
611         violation will cause a compile error.
612         * class.cs, const.cs: Access all fields that belong to class
613         TypeContainer via ParentContainer.  Arguments of EmitContexts and
614         Resolve()-like functions still use 'Parent'.
615
616         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
617         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
618         (PropertyMethod.CheckModifiers): Remove unused argument.
619         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
620         DeclSpace.
621
622 2006-03-28  Raja R Harinath  <rharinath@novell.com>
623
624         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
625
626 2006-03-17  Raja R Harinath  <harinath@gmail.com>
627
628         Make semantics of PartialContainer simpler.
629         * decl.cs (DeclSpace.IsPartial): Remove.
630         * class.cs (TypeContainer.IsPartial): Likewise.
631         (TypeContainer..ctor): Set PartialContainer to point to self.
632         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
633         (TypeContainer.FindNestedType): Likewise.
634         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
635
636 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
637
638         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
639
640 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
641
642         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
643         classes.
644
645 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
646
647         * class.cs (Operator.Define): An error for base conversion was not
648         reported correctly.
649
650 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
651
652         A fix for #77593, #77574.
653
654         * class.cs (MethodCore.CheckBase): Another if for operator.
655
656 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
657
658         A fix for #77822.
659
660         * expression.cs (VerifyArgumentsCompat): Reverted to double error
661         reporting, it's more tricky than I thought.
662
663 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
664
665         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
666         were not resolved
667
668         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
669         (DelegateCreation.ImplicitStandardConversionExists): New method for just
670         conversion test.
671         
672         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
673         not needed.
674
675 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
676
677         A fix for #77353.
678
679         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
680         (Event.Define): ditto
681         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
682
683         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
684         Removed redundant code and set NewSlot for Invoke method too.
685
686         * parameter.cs (Parameters.ctor): Add custom, type ctor.
687         (Parameters.MergeGenerated): New method. Use this method when you merge
688         compiler generated argument with user arguments.
689
690 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
691
692         * attribute.cs (ResolveAsTypeTerminal): Removed.
693
694         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
695         specialization for predefined types; 30% speed up.
696         Finally placed obsolete check to right place.
697         (Expression.ResolveType): Removed.
698
699         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
700         Updated after ResolveType was removed.
701
702         * expression.cs (Cast.ctor): Check void cast.
703         (Binary.ResolveAsTypeTerminal): Is never type.
704         (Conditional.ResolveAsTypeTerminal): Is never type.
705
706         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
707
708 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
709
710         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
711
712 2006-03-23  Martin Baulig  <martin@ximian.com>
713
714         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
715         type check if either of the types is an open generic type.
716
717 2006-03-23  Martin Baulig  <martin@ximian.com>
718
719         * convert.cs
720         (Convert.ExplicitTypeParameterConversion): New method; implement
721         explicit type parameter conversions.
722
723 2006-03-23  Martin Baulig  <martin@ximian.com>
724
725         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
726         blindly allow all conversions if we do not have any constraints.
727
728 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
729
730         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
731         these two separated members to simplify the code.
732         (Attribute.Resolve): Refactored to use new fields and methods.
733         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
734         implemented obsolete attribute checking.
735         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
736         implemented obsolete checking again. It look line never ending quest ;-)
737         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
738
739         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
740
741         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
742
743         *class.cs (Property.Define): Add RegisterProperty call.
744
745         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
746         argument groups (only 2).
747
748         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
749         encoding expression to arguments.
750         (Expression.ExprClassToResolveFlags): Just turned to property.
751
752         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
753         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
754         optimized as well as implemented support for zero-length attributes.
755
756         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
757         Add caching of PropertyInfo's.
758
759 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
760
761         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
762         error multiple times.
763
764 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
765
766         New partial class implementation.
767         A fix for #77027, #77029, #77403
768
769         * attribute.cs (Attributable): Made attributes protected.
770
771         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
772         the replacements of ClassPart and PartialContainer.
773         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
774         (TypeContainer.AddInterface): Ditto.
775         (TypeContainer.AddPartial): The main method for partial classes. It checks
776         for errors and merges ModFlags and attributes. At the end class is added to
777         partial_parts list.
778         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
779         required here.
780         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
781         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
782         from the rest of partial classes.
783         (TypeContainer.GetClassBases): Simplified.
784         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
785         DefineType.
786         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
787         (TypeContainer.HasExplicitLayout): Uses Flags now.
788         (PartialContainer): Removed.
789         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
790         (StaticClass): Was merged with Class.
791         (Class.GetClassBases): class and static class bases are verified here.
792         (Class.TypeAttr): Added static attributes when class is static.
793         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
794         (MemberBase): In some cases we need to call parent container for partial
795         class. It should be eliminated but it's not easy now.
796
797         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
798
799         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
800         partial classed to accumulate class comments.
801         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
802
803         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
804
805         * driver.cs (MainDriver): Tree.GetDecl was removed.
806
807         * modifiers.cs (Modifiers): Add partial modifier.
808
809         * tree.cs (Tree.decl): Removed.
810         (RootTypes): Started to use this class more often for root types
811         specializations.
812
813 2006-03-23  Raja R Harinath  <rharinath@novell.com>
814
815         * generic.cs (TypeParameter.UpdateConstraints): Update
816         'constraints' if null.
817
818 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
819
820         A fix for #77615
821
822         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
823         external interface does not have an attribute.
824
825 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
826
827         Another prerequisites for new partial classs implementation.
828         
829         * attribute.cs (Attribute.Equal): Implemented.
830         (Attribute.Emit): Changed as attributes can be applied more than twice.
831         (Attributes.Emit): Check for duplicate attributes here.
832
833         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
834         as a parameter, clean-up.
835
836 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
837
838         A fix for #77485
839
840         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
841         contains obsolete attribute check which can in some cases look for base
842         type of current class which is not initialized yet.
843         (TypeContainer.BaseType): Replacement of ptype.
844
845         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
846
847 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
848
849         First of prerequisites for new partial classs implemention.
850         
851         * attribute.cs (Attributable): Extended by ResolveContext;
852         Attributes finally have correct context for resolving in all cases.
853         (AttachTo): Attribute owner is assigned here.
854
855         * codegen.cs (IResolveContext): Introduce new interface to hold
856         all information needed in resolving phase.
857         (EmitContext): Implements IResolveContext; more clean-up needed here.
858         
859         * decl.cs (MemberCore): Implemented IResolveContext.
860
861         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
862         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
863         parameter.cs, statement.cs, tree.cs, typemanager.cs:
864         Refactored to use new IResolveContext instead of EmitContext; cleanup
865
866 2006-03-22  Raja R Harinath  <rharinath@novell.com>
867
868         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
869         mcs to keep code differences small.
870         * attribute.cs (Attribute.GetParameterDefaultValue): New.
871         * typemanager.cs (parameter_default_value_attribute_type): New.
872         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
873         CS1908 check.
874
875 2006-03-22  Martin Baulig  <martin@ximian.com>
876
877         * generic.cs
878         (Nullable.NullableLiteral): Derive from `NullLiteral'.
879
880         * convert.cs
881         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
882         instead of the normal `NullLiteral'.
883
884 2006-03-21  Martin Baulig  <martin@ximian.com>
885
886         Fix #77583.
887         * generic.cs (TypeManager.InferType): If `pt' is a generic
888         parameter, don't check whether `pt == at'.
889
890 2006-03-20  Raja R Harinath  <rharinath@novell.com>
891
892         Fix #77852
893         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
894         (TypeParameter.Resolve): Update to change.
895         (ConstraintChecker.CheckConstraints): Resolve type-argument
896         constraints before use.
897
898 2006-03-16  Martin Baulig  <martin@ximian.com>
899
900         * generic.cs
901         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
902         and don't have any instance constructors, also lookup in the base class.
903         (TypeManager.IsNullableValueType): New public method.
904
905         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
906         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
907         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
908
909         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
910         instead of just TypeManager.IsNullableType() to determine whether
911         a lifted operator exists.
912         (UnaryMutator.DoResolve): Likewise.
913         (Conditional.DoResolve): Likewise.
914         (Binary.DoResolve): A lifted operator only exists if both operands
915         are valuetypes and at least one of them is a nullable type.
916
917 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
918
919         * iterator.cs : yield break is allowed in try statement which has
920           catch clauses. Fixed bug #77767.
921
922 2006-03-12  Martin Baulig  <martin@ximian.com>
923
924         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
925         private IsSignatureEqual() to compare types; see the comment in
926         that method; fixes #77674.
927
928 2006-03-10  Raja R Harinath  <rharinath@novell.com>
929
930         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
931         (Expression.ResolveAsTypeTerminal): Likewise.
932         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
933         * expression.cs, generic.cs, iterators.cs: Likewise.
934         * parameter.cs, statement.cs, typemanager.cs: Likewise.
935
936 2006-03-09  Martin Baulig  <martin@ximian.com>
937
938         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
939         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
940
941 2006-03-09  Martin Baulig  <martin@ximian.com>
942
943         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
944         `prepared' flag is set.
945
946         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
947         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
948         issues; see gtest-254.cs.
949
950 2006-03-07  Martin Baulig  <martin@ximian.com>
951
952         * generic.cs (TypeManager.InferType): Allow infering
953         `IEnumerable<T>' with an array of T; see gtest-251.cs.
954
955 2006-03-06  Martin Baulig  <martin@ximian.com>
956
957         * generic.cs
958         (TypeManager.InferType): Fix gtest-250.cs.
959
960         * typemanager.cs
961         (TypeManager.IsSubclassOf): Also check the base class.
962
963         * expression.cs
964         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
965         fixes gtest-249.cs.
966
967 2006-03-01  Raja R Harinath  <rharinath@novell.com>
968
969         Fix #77679.
970         * expression.cs (ParameterReference.DoResolveBase): Change return
971         type to bool.
972         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
973         Update.
974
975         Fix #77628.
976         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
977
978         Fix #77642.
979         * typemanager.cs (GetFullNameSignature): Don't nullref on
980         protected accessors.
981
982 2006-02-16  Martin Baulig  <martin@ximian.com>
983
984         * generic.cs
985         (TypeManager.GetGenericFieldDefinition): New public method; use it
986         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
987
988 2006-02-14  Martin Baulig  <martin@ximian.com>
989
990         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
991
992 2006-02-14  Martin Baulig  <martin@ximian.com>
993
994         * generic.cs
995         (TypeManager.DropGenericMethodArguments): New public method; don't
996         use GetGenericMethodDefinition() on something which is not a
997         generic method.
998
999 2006-02-14  Martin Baulig  <martin@ximian.com>
1000
1001         * generic.cs
1002         (ConstraintChecker.CheckConstraints): If a type parameter has the
1003         `struct' constraint, the type must be a non-nullable valuetype.
1004
1005 2006-02-10  Martin Baulig  <martin@ximian.com>
1006
1007         * typemanager.cs
1008         (TypeManager.IsOverride): Make this work for instantiated methods
1009         in a generic class; fixes #77509.
1010         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1011         rather than calling it directly; fixes #77488.  
1012
1013 2006-02-08  Martin Baulig  <martin@ximian.com>
1014
1015         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1016         reporting into CheckConstraint() so we can use the correctly
1017         instantiated type.
1018
1019 2006-02-08  Martin Baulig  <martin@ximian.com>
1020
1021         * expression.cs (BaseAccess): Add support for generic methods.
1022
1023         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1024         the new MethodGroupExpr.
1025
1026 2006-02-07  Martin Baulig  <martin@ximian.com>
1027
1028         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1029         also reference types; fixes #77483.
1030
1031 2006-02-07  Martin Baulig  <martin@ximian.com>
1032
1033         * generic.cs
1034         (TypeManager.IsGenericMethod): We now return whether something is
1035         an instantiated generic method (and not a generic method def).
1036         (TypeManager.IsGenericMethodDefinition): New public method.
1037
1038         * typemanager.cs
1039         (TypeManager.CSharpSignature): Only include type arguments for
1040         "real" generic methods, not for any instantiated method.
1041         (TypeManager.GetMethodName): Likewise, but also allow generic
1042         method definitions here.
1043
1044 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1045
1046         * codegen.cs (EmitScopeInitFromBlock): check here the
1047         capture_context, there is no need to make two calls to the
1048         EmitContext. 
1049
1050         * anonymous.cs: Add some debugging messages that might help me
1051         track other instances of this problem in the future (the
1052         regression of test 467).
1053
1054         * cs-parser.jay: track the variable block, as we need to initalize
1055         any captured variables declared in this block for the "catch"
1056         portion of the "Try" statement.
1057
1058         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1059         scope initialization for captured variables. 
1060
1061         Also, move the emit for the variables after the block location has
1062         been marked.
1063
1064 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1065
1066        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1067         
1068 2006-02-06  Martin Baulig  <martin@ximian.com>
1069
1070         * class.cs (TypeContainer.DefineType): If we're a struct, pass
1071         `TypeManager.value_type' as parent type to
1072         ModuleBuilder.DefineType().  Fixes #77358.      
1073
1074 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1075
1076         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1077         commit yesterday, the initialization for the roots is necessary.
1078         What is not necessary is the scope activation.
1079
1080 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1081
1082         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1083         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1084         CS0206 checks.
1085         (Argument.Resolve): Remove CS0206 checks.
1086
1087 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1088
1089         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1090         scopes for all the roots, the scopes will now be emitted when the
1091         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1092
1093         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1094         code.  This reduces a lot of existing cruft.
1095         
1096         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1097         that the ScopeInfo is generated as we enter the scope, not at the
1098         time of use, which is what we used to do before.
1099
1100         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1101         every time a Block is about to be emitted if we have a
1102         CaptureContext. 
1103
1104 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1105
1106         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1107         attribute for mscorlib too.
1108
1109         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1110         (Reset): Update.
1111         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1112
1113         * typemanager.cs (cons_param_array_attribute): Make private.
1114         (Reset): Set it to null.
1115         (InitCoreHelpers): Don't initialize it.
1116         (ConsParamArrayAttribute): New.  Initialize it as needed.
1117         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1118
1119 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1120
1121         * expression.cs: There might be errors reported during the
1122         selection of applicable methods.  If there are errors, do not
1123         continue execution as it will lead the compiler to crash.
1124
1125 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1126
1127         * expression.cs: Member access is not allowed on anonymous
1128         methods.  Fixes #77402.
1129
1130 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1131
1132         Fix #77401
1133         * cs-parser.jay (VariableDeclaration): Don't set
1134         current_array_type to null.
1135         (field_declaration, event_declaration, declaration_statement):
1136         Set it to null here.
1137
1138 2006-01-29  Raja R Harinath  <harinath@gmail.com>
1139
1140         Fix part of #77397
1141         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1142
1143 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1144
1145         * typemanager.cs (GenericParameterPosition): New.
1146         * doc.cs: Use it.
1147
1148 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1149
1150         * doc.cs : To process "include" elements, first we should create
1151           another list than XmlNodeList, because it could result in node
1152           removal, which could result in that the XmlNodeList gives up
1153           yielding next node.
1154
1155 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1156
1157         * expression.cs: Introduce an error report that we were not
1158         catching before.   Gonzalo ran into it.
1159
1160 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1161
1162         A fix for bug: #76957
1163         
1164         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1165         ComputeMethodHost before creating the method, this is a new
1166         requirement. 
1167
1168         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1169         that this method references (RegisterScope).  The actual scope
1170         where the method is hosted is computed with the ComputeMethodHost
1171         before we create the method.
1172
1173         Moved the Deepest routine here.
1174
1175         (AnonymousContainer.ComputeMethodHost): New routine used to
1176         compute the proper ScopeInfo that will host the anonymous method.
1177
1178         (ScopeInfo): Deal with multiple roots.  The problem was that we
1179         did not have a unique root where all ScopeInfos could be hanged
1180         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1181         of roots.  
1182
1183         Remove AdjustMethodScope which is now computed at the end.  Remove
1184         LinkScope which did a partial link, instead link all ScopeInfos
1185         before code generation from the new "LinkScopes" routine. 
1186
1187         Simplify all the Add* routines as they no longer need to maintain
1188         the tree, they just need to record that they are using variables
1189         from a ScopeInfo.
1190
1191         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1192         routines to produce the forest of ScopeInfo trees.
1193
1194         * class.cs (TypeContainer.AppendMethod): This is just like
1195         AddMethod, but ensures that an interface implementation method
1196         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1197         methods, but at the end.
1198
1199         We use this functionality to ensure that the generated MoveNext
1200         method in the iterator class is resolved/emitted before the
1201         enumerator methods created.   
1202
1203         This is required because the MoveNext method computes the right
1204         ScopeInfo for the method.  And the other methods will eventually
1205         need to resolve and fetch information computed from the anonymous
1206         method. 
1207
1208         
1209 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1210
1211         Improve implementation of section 14.4.2.2 (Better function member).
1212         * expression.cs (Invocation.MoreSpecific): Compare all type
1213         arguments before deciding if one type is more specific than
1214         another.  Handle array types too.  Return the more specific type.
1215         (Invocation.BetterFunction): Add more tie-breaking rules from
1216         section 14.4.2.2.  Perform "more specific" check after
1217         other tie-breaking rules.  Compare all parameter types before
1218         choosing the "more specific" method.
1219
1220 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1221             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1222
1223         Fix rest of #76995.
1224         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1225         the 'aliases' hash.
1226         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1227         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1228
1229 2006-01-18  Martin Baulig  <martin@ximian.com>
1230
1231         * class.cs (TypeContainer.AddToMemberContainer): Use
1232         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1233         fixes #77124.
1234
1235 2006-01-18  Martin Baulig  <martin@ximian.com>
1236
1237         Fix #76417: a generic class may now have methods which may unify
1238         for some type parameter substitutions.
1239
1240         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1241         for methods which may unify anymore.
1242
1243         * expression.cs (Invocation.MoreSpecific): New private static
1244         method; checks whether one method is more specific than another
1245         according to 14.4.2.2 of the spec.
1246         (Invocation.BetterFunction): Implement the tie-breaking rules from
1247         14.4.2.2 of the spec: if two methods unify for some type parameter
1248         substitution, we need to pick the more specific one.
1249
1250 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1251
1252         Fix #76656, cs0231-2.cs.
1253         * cs-parser.jay (formal_parameter_list): Make error case catch
1254         more issues.
1255         (parenthesized_expression_0): Add CS1026 check.
1256         (invocation_expression): Remove unused { $$ = lexer.Location }.
1257
1258 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1259
1260         Fix #76824.
1261         * cs-parser.jay (statement_expression): Don't list out the
1262         individual statement-expressions.  Convert syntax error into
1263         CS0201 check.
1264
1265 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1266
1267         Fix #76874.
1268         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1269         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1270         CheckIntermediateModification.
1271         (FieldExpr.DoResolve): Add new two-argument version that
1272         allows us to resolve the InstanceExpression as an lvalue.
1273         The one-argument variant is now just a wrapper.
1274         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1275         Resolve the lhs as an lvalue if the it has a value type.
1276         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1277         from Assign.DoResolve.
1278         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1279         resolved as an lvalue.
1280         (PropertyExpr.DoResolve): Update.
1281         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1282         has a value type.  Move CS1612 check here from
1283         CheckIntermediateModification.
1284         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1285         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1286         'right_side' of a ResolveLValue on an 'out' argument.
1287         (EmptyExpression.LValueMemberAccess): New.  Used as the
1288         'right_side' of a propagated ResolveLValue on a value type.
1289         (LocalVariableReference.DoResolveBase): Recognize
1290         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1291         Add CS1654 check.
1292         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1293         EmptyExpression.Null.
1294
1295 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1296
1297         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1298           Type.IsGenericParameter(). Fixed bug #77183.
1299         * doc.cs : it is now identical to doc.cs in mcs.
1300
1301 2006-01-16  Martin Baulig  <martin@ximian.com>
1302
1303         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1304
1305 2006-01-16  Martin Baulig  <martin@ximian.com>
1306
1307         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1308         ctors; fixes #77250.
1309
1310 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1311
1312         This fixes the problem where we used ldfld instead of ldflda to
1313         load the "THIS" pointer on captured parameters, when THIS is a
1314         value type.  See bug #77205.
1315         
1316         * iterators.cs (CapturedThisReference.Emit): Pass false to
1317         EmitThis (we do not need the address).
1318
1319         * codegen.cs (EmitThis): it needs to know whether we need the
1320         address of `this' or not.  This is used by value types.  
1321
1322         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1323         every other call passes false.
1324
1325 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1326
1327         Fix #77221.
1328         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1329         GetOverride.
1330         * expression.cs (Invocation.OverloadResolve): Update.
1331         (Invocation.DoResolve): Avoid double resolution of invocation.
1332
1333 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1334
1335         Fix #77180.
1336         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1337         unary negation of floating point types as 0-expr; negation cannot
1338         overflow in floating point types.
1339
1340         Fix #77204.
1341         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1342         on operands of 'void' type.
1343
1344         Fix #77200.
1345         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1346         and ExclusiveOr for boolean constants too.
1347
1348 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1349
1350         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1351
1352 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1353
1354         * cs-tokenizer.cs (Position): New class used to save and restore
1355         the position state in the tokenizer.  Before this patch the save
1356         and restore was not complete enough so the line and columns would
1357         start to drift and the debugger and stack traces will get the
1358         wrong data.
1359
1360 2006-01-10  Martin Baulig  <martin@ximian.com>
1361
1362         * generic.cs
1363         (TypeParameter.InflateConstraints): New public method.
1364
1365         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1366         constraints; fixes #77042.
1367
1368 2006-01-10  Martin Baulig  <martin@ximian.com>
1369
1370         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1371         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1372         #77061. 
1373
1374 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1375
1376         Fix #75636.
1377         * expression.cs (Invocation.OverloadResolve): Replace reflected
1378         override methods with their base virtual methods, rather than
1379         skipping over them.
1380         * typemanager.cs (TypeManager.GetOverride): New.
1381
1382 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1383
1384         * driver.cs: Report the case of no source files and no -out:
1385         argument provided.
1386
1387 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1388
1389         Fix #77035.
1390         * expression.cs (ComposedCast.GetSignatureForError): Define.
1391
1392 2006-01-05  Jb Evain  <jbevain@gmail.com>
1393
1394         * class.cs (Property.Define, Indexer.Define): do not tag the
1395         properties as SpecialName | RTSpecialName.
1396
1397 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1398
1399         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1400         doing a low-level comparission of parameter types.  It was lacking
1401         a check for __argslist. 
1402
1403 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1404
1405         * expression.cs (ParameterReference.DoResolveBase): Allow
1406         reference parameters if they are local to this block. 
1407
1408         This allows the ref and out parameters of a delegate to be used in
1409         an anonymous method, for example:
1410
1411         delegate void set (out int x);
1412
1413         set s = delegate (out int x){
1414                 x = 0;
1415         };
1416
1417         This is used by functionality introduced late in the C# language.
1418         
1419         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1420         method that take ref and out parameters. 
1421
1422         Fixes #77119 which was a late change in the spec.
1423
1424 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1425
1426         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1427         parent if its the same scope.  Fixes #77060.
1428
1429 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1430
1431         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1432
1433 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1434
1435         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1436         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1437         that doesn't contain the full public key. This is a update of the
1438         friend assemblies in .Net 2.0 release.
1439         
1440 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1441
1442         Fix #76995
1443
1444         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1445         ListDictionary, to contain the ExternAliasEntry entries (in
1446         addition to the NamespaceEntry.aliases hashtable). This field is
1447         shared between the original entry and its doppelganger (bodyless 
1448         copy of it).
1449         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1450         extern_aliases field.
1451         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1452         lookup in extern_aliases.
1453
1454 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1455
1456         Fix #77006.
1457         * class.cs (TypeContainer.Mark_HasEquals): New.
1458         (TypeContainer.Mark_HasGetHashCode): New.
1459         (ClassPart): Override them.
1460         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1461
1462         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1463         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1464         DeclSpace.
1465
1466         Fix #77008.
1467         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1468         'parent' argument to the base constructor.
1469
1470         Remove all mention of TypeContainer from decl.cs.
1471         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1472         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1473         (DeclSpace.DeclSpace): Likewise.
1474         (DeclSpace.DefineMembers): Remove unused argument.
1475         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1476         debugging check -- we don't care if the debug code throws an
1477         InvalidCastException instead of an InternalErrorException.
1478         * class.cs (TypeContainer.DefineMembers): Update to changes.
1479         (TypeContainer.DoDefineMembers): Likewise.
1480         (TypeContainer.GetMethods): Likewise.
1481         (PropertyMember.Define): Likewise.
1482         (MemberBase.Parent): New property that forwards to
1483         MemberCore.Parent, but ensures that we get a TypeContainer.
1484         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1485         (RootContext.PopulateTypes): Likewise.  Remove special case code
1486         for !RootContext.StdLib: DefineMembers is idempotent.
1487
1488 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1489
1490         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1491
1492 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1493
1494         * doc.cs : The search for referenced namespace was insufficient to
1495           get global one as it used to do. Fixed bug #76965.
1496
1497 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1498
1499         * doc.cs : check name in cref in the last phase that whether it is
1500           namespace or not.
1501
1502 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1503
1504         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1505           Mono.C5.
1506
1507 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1508
1509         * doc.cs : so it turned out that we cannot skip override check for 
1510           interface members. Fixed bug #76954.
1511
1512 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1513
1514         * cs-tokenizer.cs : fixed bug #75984:
1515           - #warning and #error should not be handled when the source line
1516             is disabled.
1517           - #line is not checked strictly when the source line is disabled.
1518           - #define and #undef is on the other hand checked strictly at any
1519             state.
1520
1521 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1522
1523         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1524           CS1027 report.
1525
1526 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1527
1528         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1529
1530         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1531         nested types.
1532
1533 2005-12-14  Martin Baulig  <martin@ximian.com>
1534
1535         * typemanager.cs (TypeManager.GetFullName): Make this public;
1536         `Type.Fullname' now never returns null.
1537
1538         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1539         explicit interface implementations; we're now using the same
1540         naming convention than csc does.
1541
1542 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1543
1544         * convert.cs (ExplicitConversionCore): Check the return value from
1545         ExplicitConversionCore which can return null on failure.  Fixes #76914
1546
1547 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1548
1549         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1550         instead of IsGenericInstance.
1551         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1552         code that's now covered by the more general test.
1553         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1554
1555         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1556         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1557         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1558         * generic.cs, report.cs, typemanager.cs: Likewise.
1559
1560 2005-12-08  Martin Baulig  <martin@ximian.com>
1561
1562         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1563
1564         * typemanager.cs (TypeManager.CSharpSignature): Include type
1565         arguments in the signature of a generic method.
1566
1567 2005-12-07  Martin Baulig  <martin@ximian.com>
1568
1569         Add support for custom attributes on type parameters.
1570
1571         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1572
1573         * generic.cs (TypeParameterName): New public class; we use this
1574         instead of a `string' to store the name of a type parameter, so we
1575         can also have `Attributes'.
1576         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1577         array instead of a `string[]' array.
1578         (TypeParameter.ctor): We now also take an `Attributes' argument.
1579         (TypeParameter.EmitAttributes): New public method; emit our
1580         `OptAttributes' here.
1581         (GenericMethod.EmitAttributes): New public method; emit the custom
1582         attributes on all our type parameters.
1583
1584         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1585         our type parameters.
1586         (MethodData.Define): If we're a generic method, call
1587         EmitAttributes() on it.
1588
1589 2005-12-07  Martin Baulig  <martin@ximian.com>
1590
1591         * generic.cs
1592         (ConstraintChecker): New public abstract class; move the
1593         constraint checking here from `ConstructedType' and also do
1594         constraint checking for generic methods here.
1595
1596         * expression.cs (Invocation.OverloadResolve): Use
1597         ConstraintChecker.CheckConstraints() if we resolved to a generic
1598         method.  Fix #76806.
1599
1600 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1601
1602         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1603
1604         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1605         event initializers.
1606         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1607         (FieldBase.Initializer): Initializer is now optional.
1608         (EventField.Define): Only event field can have initializer.
1609
1610         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1611
1612         * const.cs (Const): Reuse initializer.
1613
1614         * cs-parser.jay: Updated after FieldBase changes.
1615         Added current_array_type to simplify array initializers.
1616
1617         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1618
1619         * expression.cs, iterators.cs: Updated.
1620
1621         * namespace.cs (NamespaceEntry): Made UsingFound private.
1622
1623 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1624
1625         * parameterCollection.cs: Obsolete, removed.
1626         * parser.cs: Obsolete, removed.
1627
1628 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1629
1630         Fix #76849.
1631         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1632
1633         * enum.cs (Enum.Define): Set obsolete context here.
1634
1635 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1636
1637         * doc.cs :
1638           - FindDocumentedMember() now expects 1) paramList as null
1639             when "we don't have to check the number of parameters" and
1640             2) Type.EmptyTypes when "there is no arguments".
1641           - Introduced FoundMember struct to hold the exact type which was
1642             used to find the documented member (the above change broke
1643             test-xml-044; it might be better just to use DeclaringType than
1644             what MS does, like this change does, but it depends on usage.)
1645
1646 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1647
1648         * doc.cs : documented member might be from DeclaringType for nested
1649           types. Fixed bug #76782.
1650
1651 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1652
1653         * anonymous.cs: Have the param code handle leaving copies on the
1654         stack etc. Allows anonymous params to take part in the assignment
1655         code (++, +=, etc). Fixes bug #76550
1656
1657         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1658         it down to the anon code.
1659
1660         * iterators.cs: Use dummy var here
1661
1662         * codegen.cs: Handle new vars
1663
1664 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1665
1666         Fix #76849.
1667         * class.cs (MethodData.Define): Set proper Obsolete context.
1668
1669         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1670         obsolete context.
1671         (FieldExpr.DoResolve): Ditto.
1672
1673 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1674
1675         Fix #76849.
1676         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1677         parent is not obsolete.
1678
1679 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1680
1681         * doc.cs : (FindDocumentedMember) find parameterless members first
1682           and get CS0419 in the early stage. Fixed first case of bug #76727.
1683
1684 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1685
1686         Fix #76859.
1687         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1688         no error was reported.
1689
1690         *expression.cs (Binary.DoResolve): left can be null.
1691
1692 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1693
1694         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1695         abstract method and all overrides.
1696         * support.cs (ParameterData.GenericConstraints): Delete.
1697         (ReflectionParameters.type_params): Delete.
1698         (ReflectionParameters.ReflectionParameters): Make private.
1699         (ReflectionParameters.GetConstaints): New factory method.
1700         * generic.cs (TypeParameterDefineType): Use it.
1701         (TypeManager.GetTypeParameterConstraints): Likewise.
1702
1703 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1704
1705         Fix #76783.
1706         * class.cs (MethodData.Emit): Parameters should be labeled first.
1707
1708 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1709
1710         Fix #76761.
1711         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1712
1713 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1714
1715         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1716
1717         * class.cs (MethodCore): Parameter clean up.
1718         (IMethodData): Added ParameterInfo.
1719         (MethodData): Parameter clean up.
1720         (Indexer.Define): Parameter clean up.
1721
1722         * anonymous.cs,
1723         * codegen.cs,
1724         * cs-parser.jay,
1725         * decl.cs,
1726         * doc.cs,
1727         * ecore.cs,
1728         * flowanalysis.cs,
1729         * iterators.cs,
1730         * pending.cs,
1731         * statement.cs,
1732         * typemanager.cs: Parameter clean up.
1733
1734         * delegate.cs (Define): Get rid of duplicated code.
1735
1736         * expression.cs (ParameterReference): Removed useless parameters
1737         and simplified.
1738         (Invocation): Ditto.
1739
1740         * parameter.cs (ParamsParameter): New class, params specialization.
1741         (ArglistParameter): Attemp to separate arglist.
1742         (Parameter): Refactored to be reusable and faster.
1743         (Parameter.Modifier): Made understandable.
1744         (Parameters): Changed to be used as a class for `this' assembly
1745         parameters. Refactored to use new specialized classes.
1746
1747         * support.cs (ParameterData): Added Types property.
1748         (InternalParameters): Deleted.
1749
1750 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1751
1752         * doc.cs : the previous patch does not actually fix the bug.
1753           PropertyInfo override check is now implemented and really fixed it.
1754         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1755
1756 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1757
1758         * doc.cs : apply "override filter" also to properties.
1759           Fixed bug #76730.
1760
1761 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1762
1763         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1764           no need to check overrides. For classes, omit those results from 
1765           interfaces since they must exist in the class. Fixed bug #76726.
1766
1767 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1768
1769         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1770           with different parameters. Fixed the second problem in #76685.
1771
1772 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1773
1774         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1775           get expected 'protected' access in CheckValidFamilyAccess()).
1776           Fixed bug #76692.
1777
1778 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1779
1780         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1781           Fixed bug #76705.  CS1569 was incorrectly commented out.
1782
1783 2005-11-23  Martin Baulig  <martin@ximian.com>
1784
1785         * generic.cs (Constraints.Define): Removed.
1786         (TypeParameter.DefineConstraints): Removed.
1787         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1788         on the GenericTypeParameterBuilder here.
1789
1790 2005-11-23  Martin Baulig  <martin@ximian.com>
1791
1792         * typemanager.cs (TypeManager.GetProperty): Make this public.
1793
1794         * generic.cs (Nullable.NullableInfo.ctor): Use
1795         TypeManager.GetProperty() rather than using reflection directly.
1796
1797 2005-11-17  Martin Baulig  <martin@ximian.com>
1798
1799         * expression.cs (Indexers.GetIndexersForType): Added support for
1800         generic parameters; fixes #76587.
1801
1802 2005-11-17  Martin Baulig  <martin@ximian.com>
1803
1804         * anonymous.cs
1805         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1806         inherit the scope from our parent.  Fixes #76653.
1807
1808 2005-11-15  Martin Baulig  <martin@ximian.com>
1809
1810         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1811         instead of `ScopeTypeBuilder' to refer to the "current" type.
1812         (AnonymousMethod.CreateScopeType): Correctly create the helper
1813         class if we're inside a generic type definition.
1814
1815 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1816
1817         * doc.cs : use Invocation.IsOverride() to do real override check.
1818         * expression.cs : made Invocation.IsOverride() internal.
1819
1820 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1821
1822         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1823           TypeBuilder.FindMembers() and filter overriden base members out.
1824           Fixed bug #76990.
1825
1826 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1827
1828         * doc.cs : ref/out parameters are represented as '@' (instead of
1829           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1830
1831 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1832
1833         * doc.cs : when there was no '.' in cref to methods in doc comment,
1834           then parameters were missing in the output. Fixed bug #76691.
1835
1836 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1837
1838         * driver.cs : don't output docs when there is an error.
1839           Fixed bug #76693.
1840
1841 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1842
1843         * doc.cs :
1844           Now it should detect indexers. Fixed primary concern in bug #76685.
1845           Fixed CS0419 message to not show the identical member signature in
1846           the message.
1847
1848 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1849
1850         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1851           instead of Type.FindMembers() since it does not handle events.
1852           Fixed bug #71604.
1853
1854 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1855
1856         * codegen.cs: Fixed typo (speficied -> specified).
1857
1858 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1859
1860         Fix #76369.
1861         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1862
1863 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1864
1865         * attribute.cs: Changed error message.
1866
1867         * cs-tokenizer.cs: One more check.
1868
1869 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1870
1871         * statement.cs (Block.Resolve): Ignore empty statement.
1872
1873 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1874
1875         * report.cs: Made error/warning methods more strict to avoid
1876         their misuse.
1877
1878         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1879         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1880         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1881         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1882
1883 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1884
1885         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1886         Use the more explicit AssemblyName.FullName instead of 
1887         AssemblyName.Name to report errors.
1888         
1889 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1890
1891         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1892         with mcs.
1893
1894 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1895
1896         * class.cs,
1897         * convert.cs,
1898         * cs-parser.jay,
1899         * decl.cs,
1900         * enum.cs,
1901         * expression.cs,
1902         * generic.cs,
1903         * pending.cs,
1904         * report.cs: Fixed error reporting and typos.
1905
1906         * generic.cs (TypeParameter.GetSignatureForError): New method.
1907         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1908
1909         * typemanager.cs (GetFullName): Refactored.
1910
1911 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1912
1913         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1914         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1915
1916         * class.cs (TypeContainer.IsComImport): New property.
1917         (Constructor.Define): Create proper ctor for ComImport types.
1918
1919         * expression.cs (New.CheckComImport): Fixed.
1920
1921 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1922
1923         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1924         that a parameter has been captured does not mean that we do not
1925         have to do the rest of the processing.  This fixes the second part
1926         of #76592.  If there was another anonymous method capturing
1927         values in the past, the Scope would never be set for the second
1928         method that captured the same parameter.
1929
1930         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1931         properly manipulate the stack.   Second part of fix for #76592.
1932
1933         * expression.cs (New): Add support for invoking "new" on
1934         interfaces that have been flagged with the ComImport attribute and
1935         the CoClass.  Fixes #76637 
1936
1937         * statement.cs (Try.DoEmit): When a variable is captured, do not
1938         try to emit the vi.LocalBuilder variable as it has been captured.
1939         Create a temporary variable and store the results on the
1940         FieldBuilder.  Fixes #76642
1941
1942 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1943
1944         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1945
1946         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1947
1948         * expression.cs (Binary.DoResolve): Added && optimalization.
1949     
1950         * typemanager.cs (AddUserType): Removed useless argument.
1951
1952 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1953
1954         * statement.cs (Block.variables): Uses ListDictionary.
1955
1956 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1957
1958         Fix #75969.
1959         * class.cs (PartialContainer.EmitType): Customized to emit
1960         security attributes.
1961         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1962         for partial classes.
1963
1964 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1965
1966         Fix #76599.
1967         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1968         access has to be fixed.
1969         
1970         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1971
1972 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1973
1974         Fix #76590.
1975         * ecore.cs (NullCast.Reduce): Implemented.
1976
1977         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1978         constant type.
1979         
1980         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1981         properly.
1982         (Foreach.Resolve): Catch null properly.
1983
1984 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1985  
1986         * cs-tokenizer.cs: Warning text fix.
1987
1988         * driver.cs: AllWarningNumbers exposed on public interface.
1989
1990         * report.cs (): Reviewed warning numbers.
1991         (IsValidWarning): Use binary search.
1992
1993 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1994  
1995         * driver.cs: Implemeted resource visibility.
1996         (Resources): New class for code sharing between /res: and
1997         /linkres:
1998  
1999 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2000
2001         decl.cs (CurrentTypeParameters): Fixed to be public.
2002
2003 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2004
2005         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2006
2007 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2008
2009         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2010
2011 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
2012
2013         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2014
2015 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2016
2017         Add friend assembly access support.
2018         * typemanager.cs: assembly_internals_vis_attrs
2019         cache for friend assembly access. 
2020         (TypeManager.IsFriendAssembly): New method for
2021         checking friend assembly access.
2022         (TypeManager.Error_FriendAccessNameNotMatching): New
2023         helper method.
2024         (TypeManager.CompareKeyTokens): Likewise.
2025         (TypeManager.Filter): Handle friend accessible
2026         members.
2027
2028         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2029         friend accessible types.
2030
2031         * ecore.cs (Expression.IsAccessorAccessible): Handle
2032         friend accessible properties.
2033
2034         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2035         accessible types.
2036         
2037 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2038
2039         Fix #76568.
2040         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2041         folding.
2042         
2043         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2044         contants only.
2045         
2046         * ecore.cs (NullCast): Child is contant only.
2047         
2048         * literal.cs (NullLiteral.Reduce): null can be converted to any
2049         reference type.
2050
2051 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2052
2053         * driver.cs: Use Encoding.Default as default code page instead
2054           of ISO-28591.
2055
2056 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2057
2058         Fix #76085.
2059         * expression.cs (Invocation.Error_InvalidArguments): Handle
2060         __arglist parameters.
2061         (Invocation.VerifyArgumentsCompat): Likewise.
2062         * support.cs (ReflectionParameters.GetSignatureForError): Print
2063         __arglist parameters.
2064         (InternalParamters.GetSignatureForError): Likewise.
2065         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2066
2067 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2068
2069         * attribute.cs (GetPropertyValue): Made public.
2070
2071         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2072         Resolve.
2073         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2074         attribute.
2075         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2076         is not defined.
2077         
2078         * driver.cs: Reflect method name change.
2079         
2080         * statement.cs (Try.Resolve): Warn when try has both general
2081         exception handlers.
2082         
2083         * typemanager.cs: runtime_compatibility_attr_type new predefined
2084         type.
2085
2086 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2087
2088         Fix #76419.
2089         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2090         treat it as an empty parameter list.
2091
2092 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2093
2094         Fix #76271.     
2095         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2096         ResolveAsTypeStep silent.
2097         * statement.cs (Block.AddConstant): Mark block as used.
2098         (Block.ResolveMeta): Avoid piling on error messages
2099         if a constant initializer resolution fails.
2100
2101 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2102
2103         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2104         Remove.
2105         (NamespaceEntry.VerifyAllUsing): New.
2106         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2107         behaviour.  Delegates actual resolution of alias to ...
2108         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2109         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2110         Update.
2111         * driver.cs (Driver.MainDriver): Update.
2112         
2113         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2114         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2115         property.
2116         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2117         Remove.
2118         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2119         RootNamespace.DefineNamespacesForAll.
2120
2121 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2122
2123         * typemanager.cs (assemblies, external_aliases, modules)
2124         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2125         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2126         overhead.  Move resposibility ...
2127         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2128         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2129
2130 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2131
2132         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2133         cached_namespaces.  Improve usage.
2134         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2135         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2136         Move from GlobalRootNamespace and simplify.
2137         (RootNamespace.Global): Make instance variable.
2138         (RootNamespace.RootNamespace): Add "alias name" parameter.
2139         (GlobalRootNamespace): Simplify drastically.
2140         (Namespace.Lookup): Don't use GetNamespace.
2141         * typemanager.cs (GetRootNamespace): Rename from
2142         ComputeNamespaceForAlias.
2143         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2144
2145 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2146
2147         * anonymous.cs (AnonymousContainer): Don't crash when container
2148         doesn't exist.
2149
2150 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2151
2152         * expression.cs (Binary.DoResolve): Warn when comparing same
2153         values.
2154
2155 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2156
2157         Fix #76486.
2158         * expression.cs (Binary.DoResolve): It looks like there are no
2159         convetsion rules in enum context.
2160
2161 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2162
2163         Add support for extern alias qualifiers.
2164         * typemanager.cs: Move some LookupTypeReflection code
2165         to namespace.cs, to have cleaner code. Added some methods
2166         to help us keep track of the extern aliased references.
2167         * driver.cs: Add suport for extern alias assemblies on command
2168         line and check for their warnings/errors. Also keep track of the
2169         extern aliased assemblies.
2170         * namespace.cs: Move the global functionality of Namespace
2171         to GlobalRootNamespace/RootNamespace. Now the global namespace
2172         is GlobalRootNamespace.Globa. Also the code moved from 
2173         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2174         Finally added LocalAliasEntry (AliasEntry before) and
2175         ExternAliasEntry, to handle alias statements.
2176         * cs-parser.jay: Add support in the grammar for extern alias
2177         statement.
2178         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2179         Update callings to Namespace (now in GlobalRootNamespace).
2180
2181 2005-10-25  Martin Baulig  <martin@ximian.com>
2182
2183         * convert.cs (ImplicitTypeParameterConversion): Make base
2184         interfaces actually work; fixes #76557.
2185
2186 2005-10-25  Martin Baulig  <martin@ximian.com>
2187
2188         * generic.cs
2189         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2190         all the type parameters; fixes #76551.
2191
2192 2005-10-25  Martin Baulig  <martin@ximian.com>
2193
2194         Fix #76472.
2195
2196         * generic.cs
2197         (GenericMethod.ctor): Added `Expression return_type' and
2198         `Parameters parameters' arguments.
2199         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2200         parameter and return types to check their constraints if they're
2201         generic types.
2202
2203         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2204         boolean field.
2205
2206         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2207         constraints of a generic type if `ec.ResolvingGenericMethod'.
2208
2209         * class.cs (MethodCore.DoDefineParameters): Set
2210         `ec.ResolvingGenericMethod' if we're a generic method.
2211         (MemberBase.MemberType): Likewise.
2212
2213 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2214
2215         * typemanager.cs (TypeManager): Added 
2216         TypeManager.internals_visible_attr_type to cache
2217         S.R.CompilerServices.InternalsVisibleToAttribute.
2218
2219         * codegen.cs (AssemblyClass): Added checks for 
2220         InternalsVisibleToAttribute in new method 
2221         CheckInternalsVisibleAttribute () and also cache the
2222         AssemblyName in AssemblyClass.Name.
2223         
2224 2005-10-24  Martin Baulig  <martin@ximian.com>
2225
2226         * typemanager.cs
2227         (TypeManager.ExpandInterfaces): Added overloaded version which
2228         just takes a `Type[]' array.
2229
2230         * generic.cs
2231         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2232         just use the interfaces which were explicitly specified and not
2233         the interfaces they inherit.  Fixes #76482.
2234         (TypeParameter.FindMembers): Expand the interfaces here.
2235
2236 2005-10-21  Martin Baulig  <martin@ximian.com>
2237
2238         * generic.cs
2239         (Constraints.Resolve): Also resolve the actual types here.
2240         (Constraints.ResolveTypes): Just check the constraints here.
2241         Fixes #76363; see gtest-218.cs.
2242
2243 2005-10-21  Martin Baulig  <martin@ximian.com>
2244
2245         * convert.cs
2246         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2247         instead of a `BoxedCast'; fixes gtest-217.cs.
2248
2249 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2250
2251         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2252           1) "new()" is specified as generic parameter constraint and 2) the
2253           type is TypeBuilder and 3) the type is abstract even if it has a
2254           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2255
2256 2005-10-20  Martin Baulig  <martin@ximian.com>
2257
2258         * generic.cs
2259         (GenericConstraints.TypeParameter): New public property.
2260         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2261         (TypeParameter.DeclSpace): New public property.
2262         (TypeParameter.DefineType): Inflate the constraints if our
2263         `DeclSpace' is an `Iterator'.   
2264
2265 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2266
2267         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2268           GenericMethod argument to compare methods' generic type arguments.
2269           Fixed bug #76382.
2270
2271 2005-10-19  Martin Baulig  <martin@ximian.com>
2272
2273         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2274         not ResolveType() when resolving the base type, so we're not
2275         checking the constraints here.
2276         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2277         if we have any.
2278
2279 2005-10-19  Martin Baulig  <martin@ximian.com>
2280
2281         * generic.cs (ConstructedType.CheckConstraints): Committing
2282         untested fix for #76441.
2283
2284 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2285
2286         Fix #76371.
2287         * class.cs (TypeContainer.DefineType): Move updating of
2288         topological sort earlier in the code.
2289         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2290
2291 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2292
2293         Fix #76273.
2294         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2295         
2296         * constant.cs (Constant.TryReduce): Moved from Cast class.
2297         (Reduce): Made little bit more OO and fixed missing conversions.
2298         
2299         * ecore.cs (Reduce): Implemented.
2300         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2301         
2302         * literal.cs (Reduce): Implemented.
2303         
2304         * class.cs: Reverted Miguel's wrong commit.
2305
2306 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2307
2308         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2309
2310 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2311
2312         * cs-parser.jay, expression.cs : CS0214 was missing error location
2313           for constants. Fixed bug #76404.
2314
2315 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2316
2317         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2318         InstanceExpression.
2319         (PropertyExpr.EmitCall): Likewise.
2320         * expression.cs (Invocation.EmitArguments): Handle case where
2321         arguments == null.
2322         (Invocation.EmitCall): Avoid allocating temporary variable if
2323         there are no arguments.
2324
2325 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2326
2327         Fix #76370.
2328         * convert.cs (ExplicitConversionCore): Fixed object->enum
2329         conversion.
2330
2331 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2332
2333         Fix #76323.
2334         * convert.cs (ImplicitConversionStandard): Move conversion of
2335         void* to arbitrary pointer types ...
2336         (ExplicitConversionStandard): .. here.
2337         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2338         error to always print typenames.
2339
2340 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2341
2342         * convert.cs (GetConversionOperator): Rename from
2343         GetConversionOperators.  Move operator selection code from ...
2344         (UserDefinedConversion): ... here.
2345
2346 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2347
2348         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2349         conversion.
2350
2351 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2352
2353         * assign.cs (Assign.DoResolve): Error method changed.
2354
2355         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2356         
2357         * const.cs (ResolveValue): Reset in_transit immediately.
2358         
2359         * constant.cs: Error method changed.
2360         
2361         * convert.cs: Removed useless location parameter.
2362         (ExplicitNumericConversion): Don't do double enum check.
2363         (ExplicitConversionCore): Renamed from ExplicitConversion.
2364         (ExplicitUnsafe): Extracted from ExplicitConversion.
2365         (ExplicitConversion): Uses for error reporting.
2366         
2367         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2368         error messages.
2369         (ResolveBoolean): Uses common error method.
2370         (CastToDecimal): Get rid of ec.
2371         (CastFromDecimal): Optimized.
2372         (ConvCast): Get rid of ec.
2373         
2374         * enum.cs (ResolveValue): Reset in_transit immediately.
2375         (Emit): Return after first error.
2376         
2377         * expression.cs: Convert changes.
2378         
2379         * literal.cs: Error method changed.
2380         
2381         * statement.cs: Error method changed.
2382
2383 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2384
2385         Fix gtest-131.cs and gtest-211.cs.
2386         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2387         Only emit code for a label if it is used.  Unreachable code can
2388         violate ECMA evaluation stack invariants.
2389
2390 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2391
2392         * anonymous.cs: Implemented ExprClassName.
2393         
2394         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2395         delegate.
2396         
2397         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2398         check.
2399         
2400         * class.cs (StaticClass.DefineContainerMembers): Report protected
2401         members as error.
2402         
2403         * codegen.cs: if(ed) PRODUCTION.
2404         
2405         * convert.cs (Error_CannotImplicitConversion): Better error
2406         distinction.
2407         
2408         * cs-parser.jay: More error checks.
2409         
2410         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2411         
2412         * driver.cs (CSCParseOption): Enabled wrong option check.
2413         
2414         * ecore.cs (Expression.ExprClassName): Turned to property.
2415         (MemberExpr.CheckIntermediateModification): For checking boxed
2416         value types     modification.
2417         
2418         * statement.cs (Fixed.Resolve): Expression type must be
2419         convertible to fixed type.
2420         (CollectionForeach.GetEnumeratorFilter,TryType):
2421         Small refactoring for easier error checking.
2422
2423 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2424
2425         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2426         attributes.
2427         
2428         * class.cs (GeneratedBaseInitializer): New class for customization
2429         compiler generated initializers.
2430         (MemberBase.DoDefine): Check Obsolete attribute here.
2431         (FieldMember.DoDefine): Ditto.
2432         
2433         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2434         constants.
2435         
2436         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2437         (MemberCore.GetObsoleteAttribute): Removed argument.
2438         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2439         (MemberCore.CheckObsoleteType): New helper.
2440         
2441         * delegate.cs,
2442         * enum.cs,
2443         * statement.cs: Updates after MemberCore changes.
2444         
2445         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2446         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2447         
2448         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2449         obsolete attribute for compiler construct.
2450         (As.DoResolve): Cache result.
2451         
2452         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2453
2454 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2455
2456         * expression.cs (Probe): instead of having a "Type probe_type"
2457         keep the extra information as a TypeExpr probe_type_expr since the
2458         "As" operator needs to perform some type checks.
2459
2460         * (As.DoResolve): If the type is a type parameter, ensure that it
2461         is constrained by a class.
2462
2463 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2464
2465         * statement.cs (Lock): Use the TemporaryVariable class instead of
2466         manually using local variables as those do not work when variables
2467         are captured.
2468
2469         * ecore.cs: Moved the TemporaryVariable class from being a nested
2470         class inside Foreach to be a public class that can be employed in
2471         other places. 
2472
2473 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2474
2475         * cs-parser.jay: interface_accessors replaced by
2476         accessor_declarations.
2477
2478         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2479         location.
2480         
2481         * statement.cs (GotoCase.Resolve): Convert null constant to
2482         null case.
2483         (SwitchLabel.ResolveAndReduce): Ditto.
2484         (SwitchLabel.NullStringCase): Custom null stamp.
2485         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2486         
2487         typemanager.cs (CSharpSignature): Don't skip first argument
2488         for full names.
2489
2490 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2491
2492         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2493         expression.cs, iterators.cs, literal.cs: Store constants and
2494         literals location.
2495         
2496         * class.cs (MemberBase.ShortName): Pass location.
2497         
2498         * cs-parser.jay: Some location fixes.
2499         
2500         * ecore.cs (Expression.Location): Made virtual.
2501
2502 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2503
2504         Fix #72930.
2505         * const.cs (Const.ResolveValue): Check for assigning non-null
2506         value to reference type.
2507
2508 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2509
2510         Fix #76133.
2511         * expression.cs (This.VerifyFixed): In a value type T, the type of
2512         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2513         value type R, 'this' is treated as a value parameter.
2514
2515 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2516
2517         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2518         if the underlying types are the same, otherwise we need to produce
2519         code that will do the proper cast.
2520
2521         This was exposed by Marek's constant rewrite which produced
2522         invalid code for the call site:
2523
2524         enum X : long { a }
2525         void Method (X v) {}
2526
2527         Method ((X) 5)
2528
2529         This fixes test-49.cs
2530
2531 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2532
2533         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2534           Type/Object should be allowed as well. Fixed bug #75968.
2535
2536 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2537
2538         * expression.cs : (Binary.DoResolve): when one is enum constant and
2539           another is constant 0, then return enum one *as enum type*.
2540           Fixed bug 74846.
2541
2542 2005-10-04  Martin Baulig  <martin@ximian.com>
2543
2544         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2545         `SetMemberIsUsed()' work for generics, too.
2546
2547 2005-10-04  Martin Baulig  <martin@ximian.com>
2548
2549         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2550         for corlib.  Fixes #75691.
2551
2552 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2553
2554         Fix #76255.
2555         * driver.cs: Fix compilation files with full root path.
2556
2557 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2558
2559         * report.cs (SymbolRelatedToPreviousError): Format the output so
2560         it does not use an open parenthesis that is never closed. 
2561
2562         * driver.cs: Follow coding guidelines
2563
2564 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2565
2566         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2567
2568         * location.cs (InEmacs): in this mode, do not report column
2569         location as it confuses Emacs.
2570
2571 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2572
2573         * support.cs (SeekableStreamReader.Position): Don't error out when
2574         the requested position is just beyond the end of the current
2575         buffered data.
2576
2577 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2578
2579         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2580         try to keep in sync with the byte count of the underlying Stream.
2581         However, this limits us to a window size of 2048 characters: i.e.,
2582         the maximum lookahead of our lexer/parser can be 2048 characters.
2583
2584 2005-09-22  Martin Baulig  <martin@ximian.com>
2585
2586         * driver.cs: Removed a debugging FIXME.
2587
2588 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2589
2590         * cs-parser.jay (type_arguments): Add CS1644 check.
2591         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2592
2593 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2594
2595         * Makefile (PROGRAM): Make profile specific.
2596         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2597         the current directory.
2598
2599         Fix test-455.cs.
2600         * expression.cs (Invocation.EmitCall): Remove optimization on
2601         this_call since it doesn't handle 'this' being a value type.
2602
2603 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2604
2605         * driver.cs: Ensure file handles are closed after parsing
2606
2607 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2608
2609         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2610         if the underlying types are the same, otherwise we need to produce
2611         code that will do the proper cast.
2612
2613         This was exposed by Marek's constant rewrite which produced
2614         invalid code for the call site:
2615
2616         enum X : long { a }
2617         void Method (X v) {}
2618
2619         Method ((X) 5)
2620
2621         This fixes test-49.cs
2622
2623 2005-09-05  Martin Baulig  <martin@ximian.com>
2624
2625         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2626         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2627
2628         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2629
2630 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2631
2632         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2633           to be a pointer type due to the spec 25.2, so check if declaring
2634           type is generic type definition. Fixed bug #75772.
2635
2636 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2637
2638         Fixed bug #75957.
2639         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2640           both types are not defined by methods.
2641         * expression.cs : (Invocation.IsApplicable): it should work when
2642           the argument type is equal to the parameter type, not only when
2643           ImplicitConversionExists() returns true.
2644
2645 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2646
2647         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2648         internal.
2649
2650         Fix #75941.
2651         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2652         flow-branching for LocalVariableReferences in case we were invoked
2653         from a MemberAccess.
2654         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2655         Carved out of ...
2656         (LocalVariableReference.DoResolveBase): ... this.
2657         (MemberAccess.Resolve): Do the check that was disabled during
2658         SimpleNameResolve.
2659
2660 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2661
2662         * class.cs :
2663           (PartialContainer.Create): check abstract/sealed/static strictly
2664           but abstract/sealed can exist only at one side. Fixed bug #75883.
2665
2666 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2667
2668         Fix #75945.
2669         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2670         specified, don't default to UnmanagedType.I4.
2671
2672 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2673
2674         * expression.cs : conditional operator should check possibly
2675           incorrect assign expression. Fixed bug #75946.
2676
2677 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2678
2679         Fix #75934.
2680         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2681         (ScopeInfo.EmitScopeType): Use it to construct field names from
2682         names of captured locals.
2683
2684         Fix #75929.
2685         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2686         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2687         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2688         (ExplicitConversion): Remove enum cases already handled by
2689         implicit conversion.  Move implicit conversion check to the beginning.
2690         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2691         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2692         Don't treat System.Enum as a struct.
2693
2694 2005-08-30  Jb Evain  <jbevain@gmail.com>
2695
2696         * attribute.cs: handles as expression in parameters.
2697
2698 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2699
2700         Fix #75802.
2701         * class.cs (TypeContainer.VerifyClsName): Don't use a
2702         PartialContainer when verifying CLS compliance.
2703         (AbstractPropertyEventMethod): Set Parent here, ...
2704         (PropertyMethod): ... not here.
2705
2706 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2707
2708         * attribute.cs : escaped attribute name should not be allowed to be
2709           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2710
2711 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2712
2713         Fix #75927.
2714         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2715         when converting a long constant to unsigned long.
2716         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2717         detect where IsApplicable and VerifyArgumentsCompat disagree.
2718
2719 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2720         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2721
2722         Fix #75848.
2723         * class.cs (TypeContainer.CanElideInitializer): New helper.
2724         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2725         can safely emitting the initializer of a field.
2726
2727 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2728
2729         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2730           allowed inside a switch (without loop). Fixed bug #75433.
2731
2732 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2733
2734         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2735         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2736
2737 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2738
2739         * driver.cs : kinda reverting the default encoding changes (not exact 
2740           revert since I noticed that "codepage:reset" might not work fine).
2741
2742 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2743
2744         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2745           Location. Now getter and setter store location correctly.
2746           (errors/cs0111-12.cs now reports the expected location.)
2747
2748 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2749
2750         * driver.cs : Use default encoding on the environment.
2751           Removed (now that) extra parameter for SeekableStreamReader.
2752         * support.cs : (SeekableStreamReader) third .ctor() argument for
2753           StreamReader is not required (always true). preamble size could
2754           be acquired in simpler and safe way.
2755
2756 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2757
2758         * cs-parser.jay: report CS0642 at warning level 3
2759           and report CS0642 for an if else statement also
2760           fixes bug #74745. Patch by John Luke (and a bit
2761           modified by me).
2762           Removed extra CS0642 warning check for "while",
2763           "for" and "fixed".
2764         * statement.cs: In Block.Resolve(), CS0642 check
2765           is reimplemented to check a sequence of an empty
2766           statement and a block.
2767
2768           Both fix bug #66777.
2769
2770 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2771
2772         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2773         detection until I fix it.
2774         
2775         * cs-tokenizer.cs: Changed error message.
2776         
2777         * cs-parser.jay: Fixed 2 error locations.
2778         
2779         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2780         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2781         properties.
2782         
2783         * enum.cs (GetSignatureForError): Fixed.
2784         
2785         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2786         method detection.
2787         
2788         * class.cs,
2789         * typemanager.cs (RegisterProperty): Removed.
2790         
2791         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2792
2793 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2794
2795         Fix #75874.
2796         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2797         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2798
2799 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2800
2801         * expression.cs : tiny fix is required for not warning positive ulong.
2802           See test-441.cs.
2803
2804 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2805
2806         * expression.cs : add CS0652 check for constant and integral
2807           expression. Fixed bug #53974.
2808
2809 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2810
2811         * expression.cs : in DoNumericPromotions(), check if there is implicit
2812           conversion overload for string (to check CS0034). Fixed bug #52492.
2813
2814 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2815
2816         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2817
2818 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2819
2820         * ecore.cs : report location when it is *not* Null.
2821
2822 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2823
2824         * codegen.cs,
2825           ecore.cs,
2826           flowanalysis.cs,
2827           expression.cs:
2828           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2829           correctly. Fixed bug #75721.
2830
2831 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2832
2833         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2834         loop that performs 'min (pos, char_count)'.
2835
2836         Fix #75862.
2837         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2838         converted value in Operator.OnesComplement.
2839
2840 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2841
2842         * anonymous.cs: If the anon method is pulled into a helper class,
2843         it needs to be `internal' not `private'. Fixes runtime behavior on
2844         msft. bug #75704
2845
2846 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2847
2848         Fix #75803
2849         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2850         is a partial class.
2851
2852 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2853
2854         The big constants rewrite
2855         Fix #75746, #75685 and more
2856         As a side effect saved 1MB for MWF ;-)
2857         
2858         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2859         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2860         enum based for corlib compilation.
2861         
2862         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2863         subtractions.
2864         
2865         * class.cs (FixedField.Define): Use ResolveAsConstant.
2866         
2867         * const.cs (IConstant): Interface constants and enums.
2868         (Const.ResolveValue): New method for constant resolvning.
2869         (ExternalConstant): Constants from imported assemblies.
2870         
2871         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2872         conversion; like enums.
2873         (Constant.ToType): Converts this constant to different type.
2874         (Constant.Increment): Adds 1.
2875         
2876         * convert.cs (ImplicitConversionRequired): Simplified.
2877         
2878         * cs-parser.jay: Create EnumMember directly.
2879         
2880         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2881         
2882         * doc.cs (GenerateEnumDocComment): Removed.
2883         
2884         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2885         (ConvertIntLiteral): Removed.
2886         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2887         
2888         * enum.cs (EnumMember): Implement IConstant.
2889         (Enum.IsValidEnumConstant): Removed.
2890         (Enum.GetNextDefaultValue): Removed.
2891         (Enum.FindMembers): Updated.
2892         (Enum.GenerateDocComment): Iterate enum members.
2893         
2894         * expression.cs (Cast.TryReduce): Handle enums correctly.
2895         (New.Constantify): Made public.
2896         (MemberAccess.DoResolve): Removed contant specific if(s).
2897         
2898         * literal.cs (NullLiteral): Implement new abstract methods.
2899         
2900         * statement.cs (GotoCase.Resolve): Use new constant methods.
2901         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2902         
2903         * typemanager.cs (LookupEnum): Removed.
2904         (IsEnumType): Fixed to work with corlib.
2905         (RegisterConstant): Removed.
2906         (LookupConstant): Removed.
2907         (GetConstant): Changed to work with IConstant.
2908
2909 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2910
2911         * location.cs : Fixed overflown (>255) column number.
2912
2913 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2914
2915         First cut of the qualified-alias-member feature.
2916         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2917         token.
2918         * cs-parser.jay (DOUBLE_COLON): New token.
2919         (namespace_or_type_name): Add rule for recognizing
2920         qualified-alias-members.
2921         (primary_expression): Likewise.
2922         (element_access): Allow QualifiedAliasMember as a possible
2923         type-bearing expression.
2924         (local_variable_type, local_variable_pointer_type): Likewise.
2925         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2926         aliases in the current and enclosing namespace declarations.
2927         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2928         * decl.cs (MemberName.is_double_colon): New.
2929         (MemberName.MemberName): Add new constructor for alias-member.
2930         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2931         * expression.cs (QualifiedAliasMember): New expression type.
2932
2933 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2934
2935         * location.cs : it borked when no argument was specified.
2936
2937 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2938
2939         * location.cs : tiny ToString() format fix.
2940
2941 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2942
2943         * statement.cs : oops, it was missing.
2944
2945 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2946
2947         A set of fixes for precise line/column location.
2948
2949         * location.cs :
2950           "token" field now holds a file/line "delta", a line number offset 
2951           from the segment, and a column number. See also:
2952           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2953           December/009508.html
2954           Removed static IsNull. Use instance IsNull property instead.
2955         * cs-tokenizer.cs :
2956           For some tokens it stores Location. For Identifier it stores
2957           LocatedToken which is a pair of string name and location.
2958           Column numbers are adjusted only at getChar().
2959         * report.cs :
2960           Use Location.ToString() for reporting (it now contains column).
2961         * cs-parser.jay :
2962           Largely modified to use LocatedToken instead of
2963           string (IDENTIFIER), and to acquire Location from some tokens.
2964         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2965           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2966           codegen.cs :
2967           Now MemberName holds Location. DeclSpace.ctor() receives Location
2968           as a parameter. Removed extra parameters to all derived classes.
2969           Replaced Location.IsNull() with instance property.
2970         * assign.cs, expression.cs :
2971           Added .ctor() overload that omits Location.
2972         * attribute.cs :
2973           Added "nameEscaped" flag that indicates the identifier was escaped
2974           in the source file. This fixes bug #57047.
2975
2976 2005-09-02  Martin Baulig  <martin@ximian.com>
2977
2978         * class.cs: Make CS3005 a warning, not an error.
2979
2980 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2981
2982         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2983         New method, looking for lo-case imported cls type.
2984
2985         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2986         here.
2987
2988         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2989
2990         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2991
2992         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2993         all_imported_types.
2994         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2995
2996         Optimized to save 3.5 MB for SWF compilation.
2997
2998 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2999
3000         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3001         (PartialContainer.Create): Moved logic AddToContainer.
3002         (PartialContainer.MarkForDuplicationCheck): Shares name.
3003         
3004         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3005         place.
3006         
3007         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3008         initialization.
3009         (Namespace.GetSignatureForError): New method.
3010         
3011         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3012         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3013
3014 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3015
3016         Fix #75669.
3017         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3018         member lookup rather than qualifier_type, since qualifier_type can
3019         be null.
3020
3021 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3022
3023         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3024         enum member.
3025
3026 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3027
3028         * statement.cs: Copy the local exception into the exception
3029         captured local.  Fixes 75674
3030
3031 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3032
3033         Fix #75658.
3034         * expression.cs (Invocation.OverloadResolve): Don't report error
3035         CS1501 if error CS1502 has been reported.
3036         (New.DoResolve): Delegate CS1501 reporting to
3037         Invocation.OverloadResolve.
3038
3039         Fix #75656.
3040         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3041         invariant-meaning-in-block property in an enclosing block if
3042         necessary.
3043
3044 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3045
3046         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3047         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3048         (Switch.CheckSwitch): Just save 50kb for SWF.
3049
3050 2005-07-27  Martin Baulig  <martin@ximian.com>
3051
3052         * anonymous.cs (CaptureContext.AddField): Added
3053         `AnonymousContainer am' argument; compute its toplevel scope if
3054         it's not already computed.  Fixes #75649.
3055
3056 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3057
3058         Fix #75628.
3059         * class.cs (Constructor.Emit): Reset block to null if the block
3060         resolve fails.
3061
3062 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3063
3064         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3065
3066 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3067
3068         * class.cs (MethodData.Define): Check whether accessor implementing
3069         interface is public.
3070
3071         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3072
3073 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3074
3075         Fix #57245
3076         * namespace.cs (LookupType): Moved same type check to...
3077         
3078         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3079         with the same name.
3080
3081 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3082
3083         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3084         already found a typebuilder.
3085         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3086         MemberNames, not strings.
3087
3088         * const.cs (Error_ExpressionMustBeConst): 
3089         Rename from Error_EpressionMustBeConst.
3090         * const.cs, class.cs, statement.cd: Update.
3091
3092 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3093
3094         Fix #65573
3095
3096         * const.cs (Const.LookupConstantValue): Report missing contant expression
3097         everytime.
3098         (Error_EpressionMustBeConstant): Only one error method.
3099
3100         * class.cs, statement.c: Updated.
3101
3102 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3103
3104         * statement.cs (Block.Flags): Add back HasVarargs.
3105         (Block.flags): Make protected.
3106         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3107
3108         * typemanager.cs (types, typecontainers, user_types): Remove.
3109         (UserTypes, TypeContainers): Likewise.
3110         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3111         (CleanUp, Reset): Update.
3112         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3113         (GetNestedType): Use Type.GetNestedType.
3114         (CoreLookupType): Take two arguments, the namespace and the
3115         basename of the type.  Update to use the Namespace.Lookup
3116         mechanism.
3117         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3118         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3119         string concatenation and substring matches.
3120         * class.cs, enum.cs, delegate.cs: Update to changes.
3121
3122 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3123
3124         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3125         Expression and made virtual.
3126
3127         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3128         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3129
3130         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3131
3132         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3133         error message.
3134
3135         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3136         change.
3137
3138 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3139
3140         Fix #57707
3141         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3142         AssemblyCultureAttribute is not used on executable.
3143
3144         * rootcontext.cs,
3145         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3146
3147 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3148
3149         Fix #60638.
3150         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3151         New.  Reports CS0252/CS0253.
3152         Mostly taken from preliminary patch by Duncak Mak.
3153         (Binary.DoResolveOperator): Store results of operator lookup.
3154         Use them to detect if we need to warn about unintended reference
3155         comparisons.
3156
3157 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3158
3159         Fix #72969.
3160         * namespace.cs (Namespace.Lookup): Add back location parameter.
3161         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3162         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3163
3164         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3165         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3166         (Namespace.LookupType): ... this.
3167         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3168         of namespaces.
3169         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3170         purported to handle pointers.
3171         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3172         CoreLookupType.
3173
3174 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3175
3176         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3177         type as namespace.
3178
3179 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3180
3181         * namespace.cs (Namespace.Lookup): Drop location parameter.
3182         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3183         (NamespaceEntry.Lookup): ... this.
3184         (NamespaceEntry.Error_AmbiguousTypeReference):
3185         Move here from DeclSpace.
3186         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3187         names ...
3188         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3189         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3190         Move to NamespaceEntry.
3191         * delegate.cs, expression.cs: Update to changes.
3192
3193 2005-08-31  Martin Baulig  <martin@ximian.com>
3194
3195         Committing a patch from Atsushi Enomoto for #75850.
3196
3197         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3198         Prefer a generic enumerator over a non-generic one.
3199
3200 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3201
3202         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3203         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3204
3205 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3206
3207         * driver.cs : reverting default encoding change as well as mcs.
3208
3209 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3210
3211         * driver.cs, support.cs : merged r48826.
3212           Marek Safer wrote:
3213           > could you integrate your mcs changes to gmcs otherwise
3214           > gmcs cannot compile some files.
3215
3216 2005-08-20  Martin Baulig  <martin@ximian.com>
3217
3218         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3219         scope if we don't already have it.
3220
3221         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3222         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3223         fixes #75867.
3224
3225 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3226
3227         * statement.cs: Copy the local exception into the exception
3228         captured local.  Fixes 75674
3229
3230 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3231
3232         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3233         type as namespace.
3234
3235 2005-08-12  Martin Baulig  <martin@ximian.com>
3236
3237         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3238         for nested types here to avoid hitting the cache too early.
3239
3240 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3241
3242         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3243         an error. 
3244
3245 2005-08-03  Martin Baulig  <martin@ximian.com>
3246
3247         Make iterators in generic methods work; see gtest-191.cs.
3248
3249         * generic.cs
3250         (Constraints.Resolve): Protect against being called twice.
3251
3252         * class.cs
3253         (TypeContainer.GetClassBases): Make this `protected virtual'.
3254
3255         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3256         (Iterator.GetClassBases): Override this and compute the base
3257         classes here.
3258         (Iterator.DefineNestedTypes): If we're a generic method, all our
3259         method type parameters become class type parameters on the proxy
3260         class.
3261
3262         * statement.cs
3263         (ToplevelBlock.Parameters): Make this a property, not a field.
3264         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3265
3266 2005-08-03  Martin Baulig  <martin@ximian.com>
3267
3268         * typemanager.cs (TypeManager.IsSubclassOf): Use
3269         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3270         (TypeManager.GetFullName_recursed): Improved.
3271
3272 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3273
3274         Fix #75417
3275         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3276         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3277         invocation_type == mi.DeclaringType, since the first one also checks
3278         other condition used by generic instances.
3279         
3280 2005-07-27  Martin Baulig  <martin@ximian.com>
3281
3282         * anonymous.cs (CaptureContext.AddField): Added
3283         `AnonymousContainer am' argument; compute its toplevel scope if
3284         it's not already computed.  Fixes #75649.
3285
3286 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3287
3288         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3289         CheckAttributeType and refactored.
3290         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3291         ResolveAsTypeTerminal error handling.
3292         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3293         handling.
3294         (GetSignatureForError): Print errors in same way.
3295
3296         * class.cs,
3297         * codegen.cs: Reflect attribute GetSignatureForError change.
3298
3299         * ecore.cs,
3300         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3301
3302         * namespace.cs (UsingEntry): Refactored to make fields private.
3303
3304         * assign.cs,
3305         statement.cs: Error_UnexpectedKind has extra parameter.
3306
3307 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3308
3309         * ecore.cs (IAlias): Remove.
3310         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3311         that implement the interface.
3312         * namespace.cs (Namespace): Likewise.
3313         (Namespace.declspaces): Renamed from 'defined_names'.
3314         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3315         DeclSpace instead of an IAlias.
3316         * tree.cs (Tree.AddDecl): Update.
3317
3318 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3319
3320         * statement.cs (Block.Flags); Remove HasVarargs.
3321         (Block.HasVarargs): Move to ToplevelBlock.
3322         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3323         (Block.Variables): Make protected.  Initialize variable hashtable
3324         if necessary.
3325         (Block.AddVariable): Update.
3326         (Block.Resolve): Update to changes.
3327         (ToplevelBlock.HasVarargs): New boolean.
3328         (ToplevelBlock.ThisVariable): Move here from Block.
3329         (ToplevelBlock.AddThisVariable): Likewise.
3330         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3331         * expression.cs (This.ResolveBase): Update to changes.
3332         (ArglistAccess.DoResolve): Likewise.
3333
3334 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3335
3336         Fix #75321
3337         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3338
3339         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3340         not used and not used & assigned.
3341         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3342
3343 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3344
3345         Fix #75053
3346         * expression.cs (Is.DoResolve): null is never provided type.
3347
3348 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3349
3350         Fix #52496
3351         * cs-parser.jay: Less strict event error rule to catch more errors.
3352
3353 2005-07-11  Martin Baulig  <martin@ximian.com>
3354
3355         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3356         for the constructor constraint: we do not only have to check
3357         whether the class has a public constructor, but also ensure that
3358         it's parameterless.  Fixes #75492.
3359
3360 2005-07-11  Martin Baulig  <martin@ximian.com>
3361
3362         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3363         between type parameters if they either have the reference type
3364         constraint or the class constraint.
3365
3366 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3367
3368         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3369
3370 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3371
3372         Fix #74975
3373         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3374         (ExtractSecurityPermissionSet): Cope with self referencing security
3375         attributes properly.
3376
3377         * driver.cs (SetOutputFile): Made public property OutputFile.
3378
3379 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3380
3381         Fix #75486.
3382         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3383         has_nonstatic_fields.  Make into a FieldBase pointer.
3384         (TypeContainer.AddField): Add CS0282 check.
3385         (TypeContainer.EmitType): Update.
3386
3387 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3388
3389         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3390         compare if they start with __.
3391
3392 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3393
3394         * statement.cs (Switch.SwitchGoverningType): Only look at
3395         UserCasts that don't need implicit standard conversions to one of
3396         the allowed switch types (Fixes test-322.cs).
3397         (LocalInfo.Resolve): Re-enable sanity-test.
3398
3399 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3400
3401         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3402         
3403         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3404         
3405         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3406
3407 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3408
3409         Fix #75472.
3410         * ecore.cs (SimpleName.GetSignatureForError): Add.
3411         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3412         (MemberAccess.GetSignatureForError): Add.
3413
3414 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3415  
3416         The big error and warning messages review.
3417         
3418         * anonymous.cs,
3419         * assign.cs,
3420         * attribute.cs,
3421         * class.cs,
3422         * codegen.cs,
3423         * convert.cs,
3424         * cs-parser.jay,
3425         * cs-tokenizer.cs,
3426         * decl.cs,
3427         * delegate.cs,
3428         * doc.cs,
3429         * driver.cs,
3430         * ecore.cs,
3431         * enum.cs,
3432         * expression.cs,
3433         * flowanalysis.cs,
3434         * iterators.cs,
3435         * literal.cs,
3436         * location.cs,
3437         * modifiers.cs,
3438         * namespace.cs,
3439         * parameter.cs,
3440         * pending.cs,
3441         * report.cs,
3442         * rootcontext.cs,
3443         * statement.cs,
3444         * support.cs,
3445         * tree.cs,
3446         * typemanager.cs: Updated.
3447         
3448         * class.cs: (MethodCore.SetYields): Moved here to share.
3449         (PropertyMethod.Define): Moved iterator setup here.
3450         
3451         * iterators.cs: Add orig_method to have full access to parent
3452         container.
3453
3454 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3455
3456         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3457         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3458         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3459         variable of struct type.
3460         * expression.cs (Unary.ResolveOperator): Update to change.
3461         (Indirection.VerifyFixed): Likewise.
3462         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3463         (ParameterReference.VerifyFixed): Value parameters are fixed.
3464         (This.VerifyFixed): Treat 'this' as a value parameter.
3465         * statement.cs (LocalInfo.IsFixed): Remove.
3466
3467 2005-07-01  Martin Baulig  <martin@ximian.com>
3468
3469         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3470         `ec.EmitThis ()' to get the correct scope.
3471
3472 2005-07-01  Martin Baulig  <martin@ximian.com>
3473
3474         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3475         instance is a ParameterReference; fixes #75299.
3476
3477 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3478
3479         Fix #75412.
3480         * expression.cs (Indexers.map): Remove.
3481         (Indexers.Append): Filter out inaccessible setters and getters.
3482         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3483
3484         Fix #75283.
3485         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3486         Refactored from ...
3487         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3488         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3489         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3490         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3491
3492 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3493
3494         Fix #75322
3495         * class.cs (FieldBase.GetInitializerExpression): One more field
3496         for backup.
3497
3498 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3499
3500         * pending.cs: Do not define a proxy if the base method is virtual,
3501         it will be picked up by the runtime (bug 75270).
3502
3503 2005-07-08  Martin Baulig  <martin@ximian.com>
3504
3505         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3506         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3507
3508 2005-07-07  Martin Baulig  <martin@ximian.com>
3509
3510         * generic.cs (ConstructedType.CheckConstraint): Use
3511         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3512         called recursively; fixes #75329.
3513
3514 2005-07-06  Martin Baulig  <martin@ximian.com>
3515
3516         * generic.cs (TypeManager.InferTypeArguments): Added support for
3517         anonymous methods; fixes #75461.
3518
3519 2005-07-01  Martin Baulig  <martin@ximian.com>
3520
3521         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3522         `ec.EmitThis ()' to get the correct scope.
3523
3524 2005-07-01  Martin Baulig  <martin@ximian.com>
3525
3526         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3527         instance is `This'; fixes #75299.
3528
3529 2005-06-30  Martin Baulig  <martin@ximian.com>
3530
3531         * class.cs (Indexer): Implement IIteratorContainer; added support
3532         for iterators in indexers.
3533
3534         * codegen.cs
3535         (EmitContext.CurrentIterator): Make this a property, not a field.
3536
3537         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3538
3539 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3540
3541         * pending.cs: Do not define a proxy if the base method is virtual,
3542         it will be picked up by the runtime (bug 75270).
3543
3544 2005-06-28  Martin Baulig  <martin@ximian.com>
3545
3546         * cs-parser.jay (interface_method_declaration): Avoid a
3547         reduce/reduce conflict by moving some of the code into a separate
3548         `interface_method_declaration_body' rule; fixes #75368.
3549
3550 2005-06-28  Martin Baulig  <martin@ximian.com>
3551
3552         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3553         array check after the check for TypeBuilder's.
3554
3555 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3556
3557         * convert.cs (FindMostEncompassedType): Add two trivial special
3558         cases (number_of_types == 0 || number_of_types == 1).
3559         (FindMostEncompasingType): Likewise.
3560
3561 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3562
3563         Some cleanups preparing for the fix of #75283.
3564         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3565         error testing.
3566         (EventExpr.InstanceResolve): Likewise.
3567         (EventExpr.DoResolve): Remove redundant checks.
3568
3569 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3570
3571         * class.cs: Small fix.
3572
3573 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3574
3575         Fix #75160.
3576         * class.cs (GetPartialBases): Fix return value check of
3577         part.GetClassBases.
3578
3579 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3580
3581         Ensure that partial classes are registered in their enclosing
3582         namespace.  Initial part of fix of #75160.
3583         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3584         Register declspace with namespace here, not in
3585         DeclSpace.RecordDecl.
3586         * cs-parser.jay: Pass namespace to RecordDecl.
3587         * class.cs (PartialContainer.Create): Likewise.
3588         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3589         called.
3590         * decl.cs (Declspace.RecordDecl): Remove.
3591         * namespace.cs (NamespaceEntry.DefineName): Remove.
3592
3593 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3594
3595         * rootcontext.cs: Reset TargetExt as well.
3596
3597 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3598
3599         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3600         -langversion:ISO-1.
3601
3602 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3603
3604         Fix #75080, cs0119.cs.
3605         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3606         of ...
3607         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3608         allowing ExprClass.Type and ExprClass.Namespace for
3609         ResolveFlags.VariableOrValue.
3610         (Expression.Resolve) [1-argument variant]: Change default resolve
3611         flags based on language version.
3612         (Expression.Error_UnexpectedKind): Use a simple string array
3613         rather than an ArrayList.
3614         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3615         not ExprClass.Type.
3616         (TypeOfVoid.DoResolve): Likewise.
3617         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3618         flags argument -- it always has the same value.
3619
3620 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3621
3622         Fix #75081.
3623         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3624         Use it in the error message.
3625         * assign.cs, expression.cs, statement.cs: Update.
3626
3627 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3628
3629         Fix #75088.
3630         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3631         the "almostMatchedMember" case too.
3632         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3633         that failed the accessibility checks to 'almost_match'.
3634
3635 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3636
3637         * attribute.cs: Use internal MethodBuilder methods to set
3638         ExactSpelling and SetLastError on PInvoke methods, instead
3639         of passing them via charset.  Fixes #75060.
3640
3641 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3642
3643         * parameter.cs (Parameter): Remove TODO comment.
3644         (Parameter.DefineParameter): Remove Location parameter.
3645         (Parameters.LabelParameters): Likewise.
3646         * class.cs (Constructor.Emit): Update to change.
3647         (MethodData.Emit): Likewise.
3648         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3649         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3650
3651 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3652
3653         * parameter.cs,
3654           Removed Parameters.Location and added Parameter.Location instead.
3655           Removed Location parameter from Emit() and GetSignature().
3656         * anonymous.cs,
3657           class.cs,
3658           cs-parser.jay,
3659           delegate.cs,
3660           iterators.cs,
3661           statement.cs :
3662           Modified all related calls.
3663
3664 2005-06-21  Martin Baulig  <martin@ximian.com>
3665
3666         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3667         left-hand side is not a nullable type; fixes #75328.
3668
3669 2005-06-21  Martin Baulig  <martin@ximian.com>
3670
3671         * typemanager.cs
3672         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3673         (TypeManager.GetFullNameSignature): Likewise.
3674
3675         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3676         `source.FullName' and `target.FullName' to check whether there are
3677         two conflicting definitions.
3678
3679 2005-06-21  Martin Baulig  <martin@ximian.com>
3680
3681         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3682         a BoxedCast - also for reference types - to be compatible with csc.
3683
3684 2005-06-21  Martin Baulig  <martin@ximian.com>
3685
3686         * expression.cs (MemberAccess.DoResolve): Add support for nested
3687         types in a generic instance; fixes #75320.
3688
3689 2005-06-20  Martin Baulig  <martin@ximian.com>
3690
3691         * generic.cs (TypeManager.InferType): Also walk the class
3692         hierarchy for generic instances; fixes #75261.
3693
3694 2005-06-17  Martin Baulig  <martin@ximian.com>
3695
3696         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3697         to make things work for corlib.
3698
3699 2005-06-15  Martin Baulig  <martin@ximian.com>
3700
3701         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3702         obsolete `SecurityAction' values.
3703
3704 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3705
3706         * rootcontext.cs: Reset TargetExt as well.
3707         
3708 2005-06-09  Martin Baulig  <martin@ximian.com>
3709
3710         * delegate.cs (Delegate.VerifyMethod): Added
3711         `MethodGroupExpr old_mg' argument; inherit its
3712         `HasTypeParameters'; fix #75085.
3713
3714 2005-06-09  Martin Baulig  <martin@ximian.com>
3715
3716         * expression.cs (Invocation.OverloadResolve): Correctly handle
3717         generic methods for the SetMemberIsUsed(); fix #75064.
3718
3719 2005-06-09  Martin Baulig  <martin@ximian.com>
3720
3721         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3722         fixes #75062.
3723
3724 2005-06-08  Martin Baulig  <martin@ximian.com>
3725
3726         * cs-parser.jay (nullable_type_or_conditional): If we put the
3727         nullable back and our `type' is a `ComposedCast', remove the
3728         nullable from it.  Fixes #75156.
3729
3730         * expression.cs (ComposedCast.RemoveNullable): New public method.
3731
3732 2005-06-08  Martin Baulig  <martin@ximian.com>
3733
3734         The big Iterators rewrite :-)
3735
3736         * iterators.cs: Rewrite this to use the anonymous methods framework.
3737
3738         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3739         before the TypeContainers; see 2test-21.cs.
3740
3741         * class.cs
3742         (TypeContainer.DefineType): Don't create a new EmitContext if we
3743         already have one (this only happens if we're an Iterator).
3744         (TypeContainer.Define): Also call Define() on all our iterators.
3745         (Method.CreateEmitContext): Added support for iterators.
3746
3747         * anonymous.cs
3748         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3749         (AnonymousContainer.CreateMethodHost): Moved here from
3750         AnonymousMethod and made abstract.
3751         (AnonymousContainer.CreateScopeType): New abstract method.
3752         (AnonymousContainer.IsIterator): New public property.
3753         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3754         get the ScopeTypeBuilder rather than manually defining it here. 
3755         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3756         iterators here.
3757
3758         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3759         before RootContext.DefineTypes().
3760
3761         * codegen.cs (EmitContext.RemapToProxy): Removed.
3762         (EmitContext.CurrentAnonymousMethod): Changed type from
3763         AnonymousMethod -> AnonymousContainer.
3764         (EmitContext.ResolveTopBlock): Protect from being called twice.
3765         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3766         (EmitContext.EmitThis): Removed the iterators hacks; use the
3767         anonymous methods framework for that.
3768
3769         * statement.cs
3770         (ToplevelBlock.Container): Make this a property, not a field.
3771         (ToplevelBlock.ReParent): New public method; move the
3772         ToplevelBlock into a new container.
3773         (Foreach.TemporaryVariable): Simplify.
3774
3775 2005-06-05  Martin Baulig  <martin@ximian.com>
3776
3777         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3778         (Block.AddTemporaryVariable): New public method; creates a new
3779         `LocalInfo' for a temporary variable.
3780         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3781         variables here.
3782         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3783         non-iterator variables.
3784
3785 2005-06-05  Martin Baulig  <martin@ximian.com>
3786
3787         * statement.cs (Foreach.TemporaryVariable): Create the
3788         LocalBuilder in the Emit phase and not in Resolve since in some
3789         situations, we don't have an ILGenerator during Resolve; see
3790         2test-19.cs for an example.
3791
3792 2005-06-04  Martin Baulig  <martin@ximian.com>
3793
3794         The big Foreach rewrite - Part II.
3795
3796         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3797         with `PropertyInfo ienumerator_getcurrent'.
3798
3799         * codegen.cs (VariableStorage): Removed.
3800
3801         * statement.cs
3802         (Foreach): Derive from Statement, not ExceptionStatement.
3803         (Foreach.CollectionForeach): New nested class.  Moved all the code
3804         dealing with collection foreach here.
3805         (Foreach.ForeachHelperMethods): Removed.
3806         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3807
3808 2005-05-23  Martin Baulig  <martin@ximian.com>
3809
3810         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3811         don't need to.  Fix #75014.
3812
3813 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3814
3815         Improve user-defined conversion handling.
3816         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3817         applicable operators.
3818         (AddConversionOperators): New.  Helper for GetConversionOperators.
3819         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3820         there is only one most encompassed/encompassing type.
3821         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3822         "applicable operator" handling.
3823         (UserConversion): Move cache here from GetConversionOperators.
3824         Directly cache the chosen operator, rather than the whole
3825         MethodGroup.
3826         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3827         case.  Allow conversion of decimal to sbyte and byte too.
3828         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3829         New static methods.  Used to avoid allocating EmptyExpressions in
3830         convert.cs.
3831
3832 2005-05-24  Duncan Mak  <duncan@novell.com>
3833
3834         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3835         another class, used in Convert.ExplicitNumericConversion.
3836         (CastToDecimal): New class, similar to above, but casts to
3837         System.Decimal, used in Convert.ImplicitNumericConversion and also
3838         in explicit convesion from double/float to decimal.
3839
3840         * convert.cs (ImplicitNumericConversion): Handle implicit
3841         conversions to System.Decimal.
3842         (ExplicitNumericConversion): handle explicit conversions to
3843         System.Decimal.
3844
3845         This fixes #68711.
3846         
3847 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3848
3849         * typemanager.cs: Do not throw an exception in the TypeBuilder
3850         case, we take care of it on the TypeCode.
3851
3852 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3853         
3854         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3855         is back.
3856         
3857         * cs-parser.jay: Catch more lexical errors.
3858         
3859         * report.cs: Add one more Error method.
3860         
3861         * rootcontext.cs,
3862         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3863
3864 2005-05-20  Martin Baulig  <martin@ximian.com>
3865
3866         * class.cs (TypeContainer.CircularDepException): Removed.
3867         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3868         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3869         (CS0146) and interface (CS0529) dependencies here.
3870
3871 2005-05-20  Martin Baulig  <martin@ximian.com>
3872
3873         * expression.cs (New.DoResolve): Move the CS0712 check above the
3874         CS0144 check; otherwise it can never be reached.
3875
3876 2005-05-20  Martin Baulig  <martin@ximian.com>
3877
3878         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3879
3880 2005-05-20  Martin Baulig  <martin@ximian.com>
3881
3882         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3883
3884         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3885
3886 2005-05-19  Martin Baulig  <martin@ximian.com>
3887
3888         * delegate.cs
3889         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3890         to disable error reporting.
3891
3892         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3893         here since we don't want to report an error; see the new test-336.cs.
3894
3895 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3896
3897         * statement.cs (ToplevelBlock.GetParameterReference)
3898         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3899         Move here from class Block.
3900         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3901         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3902
3903 2005-05-18  Martin Baulig  <martin@ximian.com>
3904
3905         Fix #74978.
3906
3907         * flowanalysis.cs
3908         (FlowBranching.Reachability): Add non-static public And() and Or()
3909         methods.
3910         (FlowBranchingSwitch): New class; do the `break_origins' thing
3911         like in FlowBranchingLoop.
3912         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3913         reachability, not just locals and parameters.
3914         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3915         switch; MergeBreakOrigins() now takes care of that.
3916
3917 2005-05-18  Martin Baulig  <martin@ximian.com>
3918
3919         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3920         a loop and may leave it, reset the barrier; fixes #74974.
3921
3922 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3923
3924         Fix test-382.cs.  Emit values of decimal constants.
3925         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3926         Carved out of ...
3927         (TypeContainer.AddField): ... this.
3928         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3929         with initializers to include 'Const's.
3930         (ClassPart.RegisterFieldForInitialization): Forward to
3931         PartialContainer.
3932         * const.cs (Const.Const): Pass initializer to base class.
3933         (Const.Define): In case of decimal constants, register them for
3934         initialization in a static constructor.
3935
3936 2005-05-14  Martin Baulig  <martin@ximian.com>
3937
3938         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3939         do not call ResolveUnreachable() on unreachable statements in
3940         here, see the comment in the source code.
3941
3942 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3943
3944         Fix #74934.
3945         * expression.cs (BinaryResolveOperator): If one of the operands of
3946         an equality comparison is 'null' and the other is a pointer type,
3947         convert the null to a NullPointer.
3948         * convert.cs (ImplicitReferenceConversion): If the expression is a
3949         NullLiteral and the target type is a pointer type, return a
3950         NullPointer instead.
3951         (ImplicitConversionStandard): Likewise.
3952
3953 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3954         
3955         * cs-parser.jay: Set readonly context based on special constructs.
3956         
3957         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3958         readonly variable error handling.
3959         
3960         * rootcontext.cs (EmitCode): Don't verify members when error
3961         occurred.
3962         
3963         * statement.cs (LocalInfo): Add reaodnly context information.
3964         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3965
3966 2005-05-17  Martin Baulig  <martin@ximian.com>
3967
3968         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3969         #70970. 
3970
3971 2005-05-13  Martin Baulig  <martin@ximian.com>
3972
3973         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3974         handle unreachable blocks.
3975
3976 2005-05-13  Martin Baulig  <martin@ximian.com>
3977
3978         * class.cs
3979         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3980         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3981         #74905. 
3982
3983 2005-05-13  Martin Baulig  <martin@ximian.com>
3984
3985         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3986         instance variable, not a local.  Fix #74873.
3987         (Block.ResolveUnreachable): Set it to true here.
3988
3989 2005-05-12  Martin Baulig  <martin@ximian.com>
3990
3991         * cs-parser.jay (property_declaration): Pass the `current_class',
3992         not the `current_container' to Property's .ctor.  Fixes #74912.
3993
3994 2005-05-11  Martin Baulig  <martin@ximian.com>
3995
3996         * typemanager.cs (Closure): Copy this from MCS and merge all the
3997         GMCS-specific changes into it.
3998
3999 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4000
4001         Fix #74920.
4002         * typemanager.cs (unmanaged_enclosing_types): New.
4003         (IsUnmanagedType): Avoid infloops by using
4004         'unmanaged_enclosing_types' to talk with recursive invocations.
4005
4006 2005-05-11  Duncan Mak  <duncan@novell.com>
4007
4008         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4009         continuing to process for 'arg'.
4010         (handle_preprocessing_directive): Check the argument of the #endif
4011         directive and report error CS1025 if there are any trailing
4012         characters.
4013
4014         According to the C# spec, having even whitespace after the #endif
4015         directive is illegal; however, because we call arg.TrimEnd ()
4016         beforehand, we have the same behavior as csc, allowing whitespace
4017         after the directive.
4018
4019         Fixes #74892.
4020
4021 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4022
4023         Fix #74863.
4024         
4025         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4026         (Constructor.GetObsoleteAttribute): Implemented correctly.
4027
4028 2005-05-10  Martin Baulig  <martin@ximian.com>
4029
4030         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4031         resolve the type; fixes #74864.
4032         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4033         in DoResolve(); fixes #74862.
4034
4035 2005-05-10  Martin Baulig  <martin@ximian.com>
4036
4037         * support.cs (ReflectionParameters.ParameterModifier): Use
4038         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4039         and `ParameterAttributes.In'.  Fixes #74884.
4040
4041 2005-05-10  Martin Baulig  <martin@ximian.com>
4042
4043         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4044         the cache if we're just looking for `MemberTypes.NestedType' in a
4045         generic instance.
4046
4047         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4048         constraints if we're still resolving the type tree.
4049         (Expression.MemberLookup): If we're resolving the type tree, only
4050         look for `MemberTypes.NestedType' since we're only interested in
4051         getting types.
4052
4053         * class.cs (TypeContainer.DefineType): Don't resolve the type
4054         parameters here; do this later in ResolveType() after the type
4055         tree has been resolved.
4056         (TypeContainer.ResolveType): New public method; this is called
4057         after the type tree is resolved and before the types are being
4058         populated.  We resolve the generic constraints here.
4059         (TypeContainer.DoDefineMember): Check the constraints on our base
4060         class and interfaces.
4061
4062         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4063         set the `ResolvingTypeTree' flag on the EmitContext.
4064
4065         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4066
4067 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4068
4069         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4070         
4071         * expression.cs (Argument.GetParameterModifier): Turned to property.
4072         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4073         
4074         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4075         its C# equivalent.
4076         
4077 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4078
4079         Fix #74852.
4080         * decl.cs (MemberCache.AddMethods): Register override methods,
4081         rather than non-override methods.
4082         * typemanager.cs (RegisterOverride): New.
4083         (IsOverride): Update.
4084
4085 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4086
4087         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4088
4089 2005-05-06  Martin Baulig  <martin@ximian.com>
4090
4091         * attribute.cs
4092         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4093         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4094
4095 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4096
4097         Fix #73105.
4098         
4099         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4100         recursive declaration.
4101         
4102         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4103         
4104 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4105
4106         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4107         
4108         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4109
4110 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4111
4112         Fix #74797.
4113         * decl.cs (DeclSpace.FamilyAccessible): 
4114         Use TypeManager.IsNestedFamilyAccessible.
4115
4116         Fix reopened #64812.
4117         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4118         internal'.
4119
4120 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4121             Abin Thomas  <projectmonokochi@rediffmail.com>
4122             Anoob V E  <projectmonokochi@rediffmail.com>
4123             Harilal P R  <projectmonokochi@rediffmail.com>
4124
4125         Fix #64812.
4126         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4127         allow access to all static members.
4128
4129 2005-05-04  Martin Baulig  <martin@ximian.com>
4130
4131         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4132
4133 2005-05-04  Martin Baulig  <martin@ximian.com>
4134
4135         Fix #74655.
4136
4137         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4138         section at the end; make things work if `default' is not the last
4139         section.        
4140
4141 2005-05-04  Martin Baulig  <martin@ximian.com>
4142
4143         Fix #70400.
4144
4145         * statement.cs (Switch): Replaced the `got_default' field with a
4146         `default_section' one.
4147         (Switch.CheckSwitch): Set `default_section' here.
4148         (Switch.Resolve): If we're a constant switch and the constant is
4149         not found, use the default section.
4150
4151 2005-05-03  Martin Baulig  <martin@ximian.com>
4152
4153         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4154
4155         * statement.cs (Foreach.ArrayForeach): New nested class.
4156         (Foreach.TemporaryVariable): New nested class.
4157         (Foreach.EmitArrayForeach): Removed; this is now in the new
4158         ArrayForeach class.
4159
4160 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4161
4162         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4163         more conservative.
4164         (VerifyPendingMethods): Revert change below.
4165
4166         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4167         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4168         that used to trigger warning -28.  Remove warning -28.
4169         * expression.cs (Invocation.OverloadResolve): Use
4170         TypeManager.IsOverride to distinguish override methods.
4171
4172         Fix #74773.
4173         * pending.cs (VerifyPendingMethods): If a base type implements the
4174         requested interface, don't bother checking individual methods of
4175         the base type.  As a side-effect, this prevents the creation of
4176         unnecessary proxies.
4177
4178 2005-05-02  Martin Baulig  <martin@ximian.com>
4179
4180         Fix #70182.
4181
4182         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4183         Also `And' the locals if the old vector is null.
4184         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4185         null; in this case we basically reset all the variables.        
4186
4187 2005-05-02  Martin Baulig  <martin@ximian.com>
4188
4189         Fix #74529.
4190
4191         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4192         Added `FlowBranching branching' argument; always `and' the
4193         variables instead of `or'ing them unless we're an infinite loop.
4194
4195         * statement.cs (While.Resolve): Create a new sibling unless we're
4196         infinite.       
4197
4198 2005-05-02  Martin Baulig  <martin@ximian.com>
4199
4200         Fix #70140.
4201
4202         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4203         arguments; use it instead of creating a new TopLevelBlock.
4204         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4205         our ConstructorInitializer.
4206
4207         * statement.cs
4208         (TopLevelBlock.TopLevelBranching): New public property.
4209         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4210         and create our `TopLevelBranching'.
4211
4212         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4213         anonymous method host, use `block.TopLevelBranching' rather than
4214         creating a new branching.
4215
4216 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4217
4218         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4219         a ScopeInfo, if any of the current children is a child of the new
4220         entry, move those children there.
4221
4222 2005-04-30  Martin Baulig  <martin@ximian.com>
4223
4224         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4225         at the beginning of a SwitchSection.  Fix #73335.
4226
4227 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4228
4229         Fix #74378
4230         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4231         
4232         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4233         (FieldExpr.DoResolve): Obsolete members are ignored for field
4234         initializers.
4235         
4236 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4237
4238         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4239         of arrays detection.
4240
4241         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4242         verification.
4243         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4244
4245         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4246         arrays report.
4247
4248 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4249
4250         * cs-parser.jay: Use the prefered version of -unsafe in error
4251         message.
4252
4253 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4254
4255         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4256         circumstances.
4257
4258 2005-04-20  John Luke  <john.luke@gmail.com>
4259
4260         * driver.cs: fix typo in error message, --outout to --output
4261
4262 2005-04-30  Martin Baulig  <martin@ximian.com>
4263
4264         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4265         handle the .NET 2.x security attributes.
4266
4267 2005-04-30  Martin Baulig  <martin@ximian.com>
4268
4269         * typemanager.cs
4270         (TypeManager.ExpandInterfaces): Don't add things twice.
4271
4272         * class.cs
4273         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4274
4275 2005-04-29  Martin Baulig  <martin@ximian.com>
4276
4277         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4278
4279         * anonymous.cs: Added support for anonymous generic methods.
4280
4281 2005-04-29  Martin Baulig  <martin@ximian.com>
4282
4283         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4284         generic instances.
4285
4286 2005-04-29  Martin Baulig  <martin@ximian.com>
4287
4288         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4289
4290         * expression.cs (New.DoResolve): Fix the CS0304 check.
4291
4292 2005-04-29  Martin Baulig  <martin@ximian.com>
4293
4294         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4295         naming schema.
4296
4297         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4298         explicit interface implementation, compare the interface types.
4299         (MethodData.Define): Use the new naming scheme from the latest
4300         .NET 2.x beta2.
4301         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4302
4303         * decl.cs (MemberName.GetMemberName): Removed.
4304         (MemberName.MethodName, FullName): New properties.
4305
4306 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4307
4308         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4309
4310 2005-04-22  Martin Baulig  <martin@ximian.com>
4311
4312         * generic.cs (GenericMethod): Create the EmitContext in the
4313         `Define()'; in `Define(MethodBuilder)', create the type parameters
4314         before calling `Define()'.  Fixes #73933.
4315
4316 2005-04-22  Martin Baulig  <martin@ximian.com>
4317
4318         * generic.cs
4319         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4320         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4321
4322         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4323         ConstructedType, check its constraints.
4324
4325 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4326
4327         * codegen.cs (InRefOutArgumentResolving): New field.
4328         
4329         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4330         fields outside contructor.
4331         
4332         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4333         
4334 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4335
4336         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4337         parameter code was not completed ever, so it was not as up-to-date
4338         as local variables.  Must finish it.
4339
4340         The bug fix was to compare the Toplevel of the block, not the
4341         current block.  Thanks for Ben for pointing this out. 
4342
4343 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4344
4345         * decl.cs (AddMethods): Use the declaring type of the problem
4346         method to determine if we want to squash a warning.
4347
4348 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4349
4350         * attribute.cs: Removed debug output.
4351
4352         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4353         
4354         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4355         Report.Stderr.
4356         
4357 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4358
4359         Fix #74481.
4360         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4361         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4362         all null comparisons against reference types.
4363
4364 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4365
4366         Fix# 74565
4367         * class.cs (TypeContainer.CircularDepException) New nested
4368         exception class.
4369         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4370         (TypeContainer.DefineType): Removed error, reset InTransit before
4371         exit.
4372         (Class.DefineType): Throw exception when is in Transit.
4373         Catch exception and report error.
4374         (Struct.DefineType): Throw exception when is in Transit.
4375         Catch exception and report error.
4376         (Interface.DefineType): Throw exception when is in Transit.
4377         Catch exception and report error.
4378
4379         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4380         handle nested exception handlers.
4381
4382         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4383         a catch.
4384
4385         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4386         InFinally and InCatch storage.
4387
4388         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4389         (Catch.Resolve): Set and Restore ec.InCatch.
4390         (Try.Resolve): Set and Restore ec.InFinally.
4391         (Try.HasCatch): True when try has catch.
4392
4393 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4394
4395         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4396           for the same event member, so exclude such cases from warning 419.
4397           Fixed bug #74633.
4398
4399 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4400
4401         * expression.cs (Binary.ResolveOperator): Apply patch from John
4402         Luke to fix bug 59864: operators &, | and ^ on enumerations
4403         require that the same enum type on both sides.
4404
4405         * driver.cs: Add warnings to old flag usage, this is to assist
4406         people who produce Makefiles and hope that the Makefiles will be
4407         used on Windows.
4408
4409         * class.cs (TypeContainer.EmitType): Moved the definition of the
4410         special $PRIVATE$ field from the resolve phase to the Emit phase.
4411         During resolve we do not know if we are a struct with
4412         HasExplicitLayout, we know this only after the attributes for the
4413         type are emitted.
4414
4415         Set the FieldOffset to zero on the dummy field that we create for
4416         the class.   Fixes 74590.
4417
4418 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4419
4420         Fix #73834.
4421         * ecore.cs (PropertyExpr.resolved): New.
4422         (DoResolve): Use it to handle a case of double resolution here.
4423         Handle a case of identical-name-and-type-name.
4424         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4425         resolution by storing the results of expression resolution back
4426         into the "probes" array.
4427
4428 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4429
4430         Fix cs0208-7.cs and cs0208-8.cs.
4431         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4432         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4433         error reporting to point out the reason a struct is not unmanaged.
4434
4435 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4436
4437         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4438           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4439
4440 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4441
4442         Fix #74528.
4443         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4444         IdenticalNameAndTypeName here.
4445         (EventExpr.InstanceResolve): Likewise.
4446
4447 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4448
4449         C# 2.0 DefaultCharSetAttribute implementation
4450         
4451         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4452         which allows us to set GlobalNamespace for every resolve.
4453         (Attribute.ResolveArguments): Cut from Resolve.
4454         (Attribute.GetCharSetValue): Returns CharSet named argument.
4455         (Attribute.DefinePInvokeMethod): Gets default charset from
4456         module settings.
4457         (GlobalAttribute.ResolveAsTypeStep): Override.
4458         (GlobalAttribute.ResolveArguments): Override.
4459         
4460         * class.cs (TypeAttr): Is protected.
4461         
4462         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4463         (ModuleClass.DefaultCharSetType): New memeber.
4464         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4465         
4466         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4467         charset from module.
4468         
4469         * delegate.cs (TypeAttr): Override.
4470         (Delegate.DefineType): Use this TypeAttr.
4471         
4472         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4473         at very early stage (before types are defined) to resolve model
4474         module attributes. It will probably not work with corlib but it
4475         should be ok.
4476         
4477         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4478         charset from module.
4479         
4480         * typemanager.cs (default_charset_type): New type.
4481
4482 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4483
4484         * decl.cs (MemberCache.AddMethods): Don't warn if
4485         System.Object.Finalize has buggy MethodAttributes.
4486
4487         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4488         removed below.
4489
4490 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4491
4492         * doc.cs : detect ambiguous reference to overloaded members.
4493           Fixed bug #71603. MS 1.1 csc does not detect it.
4494
4495 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4496
4497         * doc.cs : delegates must not be referenced with parameters.
4498           Fixed bug #71605.
4499
4500 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4501
4502         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4503
4504 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4505
4506         * driver.cs (MainDriver): Stop processing if the CLS stage found
4507         errors. 
4508
4509         (CompilerCallableEntryPoint.InvokeCompiler): Always
4510         reset after execution;   Take a TextWriter argument for the
4511         output.
4512
4513         * report.cs: Use the error stream instead of hardcoding stderr. 
4514
4515 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4516
4517         * class.cs: Reduce code paths to test, too small of an
4518         optimization to make it worth the extra testing.  Always perform
4519         it. 
4520
4521 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4522
4523         Fix #74510.
4524         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4525         operators that had errors reported on them.
4526
4527 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4528
4529         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4530         argument types.
4531         (Attribute.Resolve): Add named argument type checking.
4532         
4533         * class.cs (FixedField.Define): Use IsPrimitiveType
4534         
4535         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4536         
4537         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4538         unsafe parameter types.
4539         
4540         * statement.cs (Using.ResolveExpression): Add better error description.
4541         
4542         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4543         
4544 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4545
4546         Fix #74484.
4547         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4548         AttributeUsageAttribute in the emitcontext of the attribute class,
4549         not in the emitcontext of the attributable entity it was attached to.
4550         * cs-parser.jay: Use 'current_class', not 'current_container',
4551         when creating a GlobalAttribute.
4552
4553 2005-04-08  Alp Toker  <alp@atoker.com>
4554
4555         * pending.cs: The fix to #58413 failed to compile methods implementing
4556         interfaces with/without params modifiers and vice versa, even though
4557         params modifiers aren't part of the signature. Make the modifier check
4558         less strict as in csc.
4559
4560 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4561             Anoob V E  <projectmonokochi@rediffmail.com>
4562             Harilal P R  <projectmonokochi@rediffmail.com>
4563
4564         Fix #58413.
4565         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4566         modifiers of pending methods.
4567         (PendingImplementation.PendingImplementation): Initialize it.
4568         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4569         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4570         with ParameterData.  Add check for modifiers.
4571         * class.cs (MethodData.Define): Update to changes.
4572
4573 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4574
4575         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4576
4577 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4578
4579         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4580         property.
4581         
4582         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4583         
4584         * rootcontext.cs,
4585         * typemanager.cs: Registered RequiredAttributeAttribute.
4586         
4587 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4588
4589         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4590         Warning CS0169 is back at level 3.
4591         (IMethodData.SetMemberIsUsed): New method.
4592         
4593         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4594         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4595         
4596         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4597
4598         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4599         contants.
4600         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4601         is used.
4602         
4603         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4604         is used.
4605         
4606         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4607         to avoid the problems with nested types.
4608
4609 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4610             Anoob V.E  <projectmonokochi@rediffmail.com>
4611             Harilal P.R  <projectmonokochi@rediffmail.com>
4612             Raja R Harinath  <rharinath@novell.com>
4613
4614         Fix #73820.
4615         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4616         attribute.
4617         * typemanager (GetConstructor): Make public.
4618
4619 2005-04-05  John Luke  <john.luke@gmail.com>
4620             Raja R Harinath  <rharinath@novell.com>
4621
4622         Fix #62232.
4623         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4624         struct too.  Return false quicker in a few cases.
4625         (VerifyUnManaged): Use it.
4626
4627 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4628
4629         Fix #74041.
4630         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4631         not 'unreachable_seen'.
4632
4633 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4634
4635         * attribute.cs (Attribute.GetValue): Removed unused.
4636         
4637         * codegen.cs (CodeGen.TrimExt): Removed unused.
4638         
4639         * cs-parser.jay (output): Removed unused.
4640         
4641         * cs-tokenizer.cs (hex_digits): Removed unused.
4642         
4643         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4644         
4645         * expression.cs (Indirection.LoadExprValue): Removed unused.
4646         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4647         
4648         * iterators.cs (Iterator.param_types): Removed unused.
4649         
4650         * statement.cs (Goto.block): Removed unused.
4651         (ToplevelBlock.did): Removed unused.
4652         (Switch.ResolveConstantSwitch): Removed unused.
4653
4654 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4655
4656         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4657         resetting thingy.
4658
4659 2005-04-19  Martin Baulig  <martin@ximian.com>
4660
4661         Merged r42462 from MCS and made it work for GMCS.
4662
4663         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4664
4665         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4666
4667 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4668
4669         Fix #74232 and cs0208-3.cs.
4670         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4671         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4672         unmanaged type.  Don't use FieldBuilders when 't' is a
4673         TypeBuilder.  Use ModFlags and MemberType fields.
4674         * class.cs (MemberBase.member_type): Rename from MemberType.
4675         (MemberBase.MemberType): New property.  Determines member_type on
4676         demand.
4677         (MemberBase.DoDefine): Don't initialize MemberType here.
4678         (FieldMember.Define): Likewise.
4679
4680 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4681
4682         Fix #74241
4683         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4684         Attributes are emitted there.
4685         
4686 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4687
4688         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4689         keyword in 'partial enum' too.
4690         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4691         is not allowed).
4692         Report from Kamil Skalski <nazgul@omega.pl>.
4693
4694         Fix #74309.
4695         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4696         have partial containers too.
4697
4698         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4699         in block' checks to Block.CheckInvariantMeaningInBlock.
4700         * statement.cs (Block.GetKnownVariableInfo): Make private.
4701         (Block.IsVariableUsedInChildBlock): Remove.
4702         (Block.IsVariableUsedInBlock): Likewise.
4703         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4704         conflicting declaration.
4705         (Block.AddVariable): Make error messages less long-winded and more
4706         specific.  Show location of conflicting declaration.
4707         * parameter.cs (Parameters.Location): New readonly property.
4708
4709 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4710
4711         Clean up semantics of invoking ResolveMemberAccess.
4712         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4713         can have an instance, ensure that we pass in a non-TypeExpression
4714         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4715         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4716         argument.  Update to changes and simplify.
4717         (FieldExpr.Emitinstance): Remove CS0120 check.
4718         (PropertyExpr.EmitInstance): Likewise.
4719         * expression.cs (Argument.Resolve): Likewise.
4720         (Invocation.DoResolve): Update to changes in semantics of
4721         InstanceExpression.
4722
4723 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4724
4725         Fix #74241
4726         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4727         customization.
4728         
4729         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4730
4731 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4732
4733         Fix difference in behaviour with commandline invocation.
4734         * driver.cs (Driver.Reset): New.
4735         (CompilerCallableEntryPoint): Call it.
4736
4737         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4738         variable" warnings if the boolean expression failed to resolve.
4739
4740 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4741
4742         * attribute.cs: Fix the union of several permissions when some of them
4743         are unrestricted (so the result isn't an unrestricted permission set).
4744         Fix #74036.
4745
4746 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4747
4748         * ecore.cs (MemberExpr): New class.  Convert from interface
4749         IMemberExpr.
4750         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4751         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4752         error checks.
4753         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4754         (MethodGroupExpr.IsExplicitImpl): Remove.
4755         (Expression.GetFieldFromEvent): Remove.
4756         (SimpleName.MemberStaticCheck): Remove.
4757         (SimpleName.DoSimpleNameResolve): Update to changes.
4758         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4759         (MemberAccess.IdenticalNameAndTypeName): Remove.
4760         (MemberAccess.error176): Move to MemberExpr.
4761         (MemberAccess.DoResolve): Update to changes.
4762         (BaseAccess.DoResolve): Likewise.
4763
4764 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4765
4766         C# 2.0 Conditional attribute class implementation
4767         
4768         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4769         Analyzes class whether it has attribute which has ConditionalAttribute
4770         and its condition is not defined.
4771         
4772         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4773         (Class.IsExcluded): New method. Search for at least one defined
4774         condition in ConditionalAttribute of attribute class.
4775
4776 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4777
4778         * ecore.cs (PropertyExpr): Derive from Expression, not
4779         ExpressionStatement.
4780         (PropertyExpr.EmitStatement): Remove.
4781
4782 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4783
4784         Fix #74060.
4785         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4786         internal field "value__" of an enum be private.  The examples for
4787         "value__" that I found on MSDN all used FieldAttributes.Private.
4788
4789         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4790         Don't mention IL method attribute names.
4791
4792         Fix #47991.  Remove a TODO.
4793         * statement.cs (Block.Toplevel): Make into a field.
4794         (Block.Parameters): Move into ToplevelBlock.
4795         (Block.known_variables): Rename from child_variable_names.
4796         (Block.Block): Remove variants that take Parameters.  Initialize
4797         'Toplevel' with the immediately surrounding toplevel block.
4798         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4799         LocalInfo parameter.
4800         (Block.GetKnownVariableInfo): New.
4801         (Block.IsVariableNameUsedInChildBlock): Update.
4802         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4803         the block, even though it may not be in scope.
4804         (Block.AddVariable): Remove Parameters parameter.  Use
4805         Toplevel.Parameters instead.
4806         (Block.AddConstant): Remove Parameters parameter.
4807         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4808         (Block.IsParamaterReference): Likewise.
4809         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4810         (ToplevelBlock.Parameters): New.  Moved from Block.
4811         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4812         initialize Parameters to a non-null value.
4813         * cs-parser.jay: Update to changes.
4814         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4815         simple names that mean different things in the same block.  Use
4816         Block.IsVariableNameUsedInBlock.
4817
4818 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4819
4820         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4821
4822 2005-03-26  Raja R Harinath  <harinath@acm.org>
4823
4824         Fix #73038.
4825         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4826         fails to resolve, ensure that the LHS is still resolved as an
4827         lvalue.
4828
4829 2005-03-25  Raja R Harinath  <harinath@acm.org>
4830
4831         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4832         ec.ContainerType.
4833         (Enum.current_ec): Remove.
4834         (Enum.LookupEnumValue): Remove EmitContext argument.
4835         Just uses the one created during DefineType.
4836         (Enum.FindMembers): Update.
4837         * expression.cs (MemberAccess.DoResolve): Update.
4838
4839 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4840
4841         * assign.cs (Assign.DoResolve): Check for CS1717 when
4842         source and target are same (uses Equals).
4843
4844         * expression.cs (LocalVariableReference, ParameterReference,
4845         This): Implemented Equals, GetHashCode.
4846
4847         * statement.cs (Block.GetParameterReference): Removed useless
4848         local variable.
4849
4850 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4851
4852         Fix cs0128.cs
4853         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4854         blocks before deciding whether the error is cs0136 or cs0128.
4855
4856         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4857         (using_alias_directive, using_namespace_directive): Pass
4858         MemberName, not an expression to Namespace.UsingAlias and
4859         Namespace.Using.
4860         (MakeName): Use the MemberName of the namespace.
4861         * namespace.cs (Namespace.MemberName): New.
4862         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4863         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4864         Likewise.
4865         * decl.cs (MemberName.Name): Make readonly.
4866         (MemberName.FromDotted): New "constructor".
4867         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4868         (MemberCore.Name): Compute from MemberName on demand.
4869         (MemberCore.SetMemberName): Provide a way to change the
4870         MemberName.
4871         (MemberCore.AddToContainer): Don't take a fullname parameter.
4872         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4873         fully qualified name of the container to the member name.
4874         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4875         only if the type is a member of the root container.
4876         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4877         MemberName.Left rather than searching for an embedded ".".
4878         (PartialContainer.CreatePart): Update to changes in RootContext.
4879         (MemberBase.ShortName): Turn into a property.  Use
4880         MemberCore.SetMemberName.
4881         (MemberBase.ExplicitInterfaceName): Remove.
4882         (MemberBase.UpdateMemberName): Remove.
4883         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4884         (PropertyBase.SetMemberName): New override.
4885         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4886         (Tree.GetDecl): New.
4887         (Tree.AllDecls): Rename from Decls.
4888         * attribute.cs, enum.cs, report.cs: Update to changes.
4889         * driver.cs (MainDriver): Use MemberName.FromDotted on
4890         RootContext.MainClass.
4891
4892 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4893
4894         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4895         checks.
4896
4897         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4898
4899 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4900
4901         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4902         property accessor modifiers.
4903
4904         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4905         fixed buffer attribute (CS1716).
4906         (PropertyMethod.HasCustomAccessModifier): When property accessor
4907         has custom modifier.
4908
4909         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4910         modifiers.
4911         (PropertyExpr.DoResolveLValue): Add CS0272.
4912
4913 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4914
4915         * convert.cs: When converting to a pointer, use the proper Conv.U
4916         or Conv.I depending on the source data type.
4917
4918         * cs-tokenizer.cs: Make the size for large decimal constants,
4919         fixes #72957.
4920
4921 2005-03-17  Martin Baulig  <martin@ximian.com>
4922
4923         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4924         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4925
4926 2005-03-17  Martin Baulig  <martin@ximian.com>
4927
4928         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4929         to bool so we can return an error condition.
4930         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4931         returned an error.
4932
4933 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4934
4935         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4936         attributes.
4937
4938 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4939
4940         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4941         Refactor to avoid traversing the list of assemblies, and to avoid
4942         string concatenation.
4943         * typemanager.cs (guid_attr_type): Remove.
4944         (negative_hits, pointers, references): Remove hashes.
4945         (type_hash): New.
4946         (GetConstructedType): New.  Uses type_hash to handle constructed
4947         types (arrays, references, pointers).
4948         (GetReferenceType, GetPointerType): Use it.
4949         (GetNestedType): New.  Uses type_hash to handle nested types of
4950         reflected types.
4951         (LookupType, LookupTypeDirect): Remove.
4952         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4953         'types' hash and LookupTypeReflection directly.
4954         (params_string, params_object): Use GetConstructedType.
4955         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4956         top-level types.
4957         (Namespace.Lookup): Use cached_types.
4958         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4959         provided by old TypeManager.LookupType.
4960         * rootcontext.cs (MakeFQN): Remove.
4961         * decl.cs (DeclSpace.MakeFQN): Likewise.
4962         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4963         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4964         TypeManager.GetConstructedType.
4965         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4966
4967 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4968
4969         * cs-parser.jay: Fix build.
4970
4971 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4972
4973         * class.cs (TypeContainer.CircularDepException) New nested
4974         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4975
4976         * cs-parser.jay: Reports CS1527 for any namespace element.
4977
4978         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4979         Added CS0407.
4980
4981         * expression.cs (ParameterReference.IsAssigned): Changed error to
4982         CS0269.
4983         (Error_WrongNumArguments): Moved CS0245 detection here.
4984
4985         * statement.cs (Return.Resolve): Add CS1622 report.
4986
4987 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4988
4989         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4990
4991 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4992
4993         * attribute.cs expression.cs: Get rid of some allocations.
4994
4995 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4996
4997         * doc.cs : just eliminate the latest change.
4998
4999 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5000
5001         * doc.cs : commented out the latest change. It breaks xml-030.cs
5002
5003 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5004
5005         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5006           fail. So invoke CreateType() in FindDocumentedType().
5007
5008 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5009
5010         * cs-tokenizer.cs : added IsKeyword().
5011         * doc.cs : Detect keyword incorrectly used as identifier.
5012           Allow identifiers prefixed by @.
5013
5014 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5015
5016         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5017         It caused exception in namespace resolving (again!).
5018         
5019         * class.cs (Class.ctor): Removed exit.
5020         (PropertyMethod.ctor): ditto.
5021         
5022         * codegen.cs (Codegen.Reset): Reset static data.
5023         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5024         
5025         * cs-tokenizer.cs (Cleanup): Removed.
5026         
5027         * driver.cs (GetSystemDir): Rewrote to one line command.
5028         It caused problem with unloaded dynamic modules.
5029         (UnixParseOption): Removed Exit.
5030         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5031         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5032         Now can be mcs used as library.
5033         
5034         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5035         empty location.
5036         
5037         * location.cs (Reset): Reset static data.
5038         
5039         * namespace.cs (Reset): Reset static data.
5040         
5041         * report.cs (Report.Reset): Reset static data.
5042         
5043         * rootcontext.cs (RootContext.Reset): Reset static data.
5044         
5045         * tree.cs (RootTypes.ctor): Use Location.Null
5046         
5047         * typemanager.cs (TypeManager.Reset): Reset static data.
5048         (CoreLookupType): Removed Exit.
5049         (TypeHandle.Reset): Reset static data.
5050         
5051 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5052
5053         Fix #73516.
5054         * typemanager.cs (ComputeNamespaces): Import namespaces from
5055         referenced modules too.
5056
5057 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5058
5059         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5060         than '.'.
5061
5062 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5063
5064         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5065         enclosing DeclSpace.  This ensures that a name-lookup populates
5066         more caches and there are fewer 'TypeExpression's.  Carve out
5067         nested type lookup into ...
5068         (LookupNestedTypeInHierarchy): ... this.
5069
5070 2005-04-15  Martin Baulig  <martin@ximian.com>
5071
5072         Merged r41590 from MCS and make it work in the generics land.
5073
5074         * generic.cs (TypeParameter.UpdateConstraints): Removed the
5075         `check' argument.
5076
5077         * class.cs (PartialContainer.UpdateConstraints): Removed.
5078         (PartialContainer.CheckConstraints): Removed.
5079         (PartialContainer.SetParameterInfo): Store the constraints here.
5080         (PartialContainer.DefineTypeParameters): New public method;
5081         resolve the type parameter's constraints here.  Note that the
5082         PartialContainer doesn't have an EmitContext anymore, so we must
5083         do this in the ClassPart.
5084
5085 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5086
5087         Clean up a few partial-class semantics.  
5088         Fixes test-357.cs and cs1618-2.cs.
5089         * cs-parser.jay (struct_declaration): Use 'current_class' as
5090         parent of newly-created struct.  Remove call to Register ().
5091         Use 'pop_current_class' to complete handing the current struct.
5092         (interface_declaration): Likewise.
5093         (class_declaration): Likewise.
5094         (enum_declaration): Use 'current_class' as parent of newly created
5095         enum.
5096         (delegate_declaration): Likewise.
5097         (pop_current_class): New function.  This is used to handle closing
5098         up the 'current_class' and 'current_container', and pointing them
5099         to the enclosing class/container.
5100         (CSharpParser): Initialize 'current_class' too.
5101         * decl.cs (MemberCore): Add check for invariant: a partial
5102         container is not a parsed entity, and thus does not enclose any
5103         parsed members.
5104         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5105         (DeclSpace.BaseTypeExpr): Use it.
5106         (DeclSpace.LookupType): Add check for invariant.
5107         * class.cs (TypeContainer): Add check for invariant: a nested
5108         class should have the same NamespaceEntry as its enclosing class.
5109         (TypeContainer.EmitFieldInitializers): Make virtual.
5110         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5111         MemberCore.
5112         (TypeContainer.Register): Remove.
5113         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5114         null.  Use TypeResolveEmitContext for resolving base types and
5115         interfaces.  Move initialization of Parts.TypeBuilder here from
5116         ...
5117         (TypeContainer.DefineNestedTypes): ... here.
5118         (PartialContainer): Take a Namespace not a NamespaceEntry.
5119         (PartialContainer.Create): Don't use Register.  Call the
5120         appropriate Add... function directly.
5121         (ClassPart): Take both the PartialContainer and the enclosing
5122         class as constructor arguments.
5123         (ClassPart.EmitFieldInitializers): Override.
5124         (ClassPart.PartFindNestedTypes): Remove.
5125         (FieldBase.GetInitializerExpression): Resolve the initializer
5126         expression in the emit context of the enclosing class.
5127         * tree.cs (RootTypes): Remove Register ().
5128         
5129 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5130
5131         * cs-parser.jay: Removed CS0134.
5132         
5133         * driver.cs: Removed CS1901.
5134         
5135         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5136         for predefined types.
5137
5138 2005-03-07  Duncan Mak  <duncan@novell.com>
5139
5140         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5141         well. Fixes bug #73454.
5142
5143 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5144
5145         * cs-tokenizer.cs (xtoken): Add CS1035.
5146         
5147         * class.cs (MethodData.Define): Add CS0683.
5148         (FieldMember.ctor): Add CS0681.
5149
5150 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5151
5152         * ecore.cs (SimpleName.DoResolve): Rename from
5153         SimpleName.DoResolveAllowStatic.
5154         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5155         Pass 'intermediate' flag to MemberStaticCheck.
5156         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5157         of "intermediate" lookups via MemberAccess.
5158         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5159         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5160
5161 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5162
5163         Fix #73394.
5164         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5165         slipped in because of variable names that are identical to a
5166         builtin type's BCL equivalent ('string String;', 'int Int32;').
5167         (PropertyExpr.EmitInstance): Likewise.
5168
5169 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5170
5171         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5172         
5173         * report.cs (warning_ignore_table): Made public.
5174
5175 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5176
5177         Fix #73282.
5178         * class.cs (MethodData.Emit): Pass 'container' to
5179         container.GetObsoleteAttribute instead of 'container.Parent'.
5180
5181 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5182
5183         * cs-parser.jay: Add 1534 error test.
5184
5185         * iterators.cs (Yield.CheckContext): Add error 1629.
5186         (Iterator.ctor): Save unsafe modifier.
5187         (MoveNextMethod.DoEmit): Restore unsafe context.
5188
5189         * namespace.cs (UsingAlias): Better error message.
5190
5191 2005-03-03  Dan Winship  <danw@novell.com>
5192
5193         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5194         the warning message [#73219]
5195
5196 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5197
5198         Fix compile with MCS 1.0.0.0.
5199         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5200         w_restore to not depend on string constant folding.
5201
5202 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5203
5204         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5205         CS0246 check to users who passed 'silent = false'.
5206         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5207         check.
5208         (SimpleName.SimpleNameResolve): Update.
5209         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5210         (MemberAccess.IdenticalNameAndTypeName): Update.
5211         * doc.cs (FindDocumentedTypeNonArray): Update.
5212
5213 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5214
5215         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5216         * parameters.cs (ComputeAndDefineParameters): Remove.
5217         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5218         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5219         Use GetParameterInfo.
5220
5221 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5222
5223         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5224
5225 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5226
5227         Unify DeclSpace.LookupType and DeclSpace.FindType.
5228         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5229         is in charge of defining nested types on demand.
5230         (DeclSpace.LookupType): Use it when the current_type is a
5231         TypeBuilder.  Use LookupTypeDirect for reflected types.
5232         (DeclSpace.FindType): Remove.
5233         (DeclSpace.LookupInterfaceOrClass): Likewise.
5234         (DeclSpace.DefineTypeAndParents): Likewise.
5235         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5236         DeclSpace.LookupType.
5237         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5238         * typemanager.cs (LookupType): Simplify.
5239         (AddUserType): Remove type from negative_hits.
5240         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5241         * class.cs (TypeContainer.FindMembers): Move handling of nested
5242         types ...
5243         (TypeContainer.FindMembers_NestedTypes): ... here.
5244         (TypeContainer.FindNestedType): Implement override.
5245         (ClassPart.FindNestedType): Delegate to PartialContainer.
5246         (ClassPart.PartFindNestedType): Looks up the nested types of the
5247         part alone.
5248
5249 2005-04-14  Martin Baulig  <martin@ximian.com>
5250
5251         * generic.cs (ConstructedType): Moved all the type lookup and
5252         nested class logic into SimpleName.
5253         (ConstructedType.ResolveConstructedType): Our underlying type is
5254         already fully resolved; all the type lookup stuff is in
5255         SimpleName.
5256
5257         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5258         constructed types here instead of in ConstructedType.
5259
5260         * decl.cs (MemberName.GetTypeExpression): Always create a
5261         SimpleName, not a ConstructedType.
5262         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5263
5264 2005-03-02  Martin Baulig  <martin@ximian.com>
5265
5266         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5267         static constructor in static classes.
5268
5269 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5270
5271         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5272         sizeParamIndex is not specified.
5273
5274 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5275
5276         Fix #73117
5277         * report.cs (WarningMessage.IsEnabled): Missing null check.
5278
5279 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5280
5281         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5282         in the fields and not in the properties.
5283
5284 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5285
5286         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5287         fields as well.
5288
5289 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5290
5291         * attribute.cs: Small refactoring (improved robustness).
5292         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5293         (ValidateGuid): Removed.
5294         (Resolve): Removed referenced to above mentioned.
5295         (GetAttributeUsage): Made private and changed to work without
5296         class assistance.
5297         (GetIndexerAttributeValue): Don't crash.
5298         (GetConditionalAttributeValue): Ditto.
5299         (GetClsCompliantAttributeValue): Ditto.
5300         (ExtractSecurityPermissionSet): All attributes exceptions are
5301         error 648.
5302         (GetPropertyValue): New helper.
5303         (GetMethodImplOptions): New method.
5304         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5305         some missing properties.
5306         
5307         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5308         (Method.ApplyAttributeBuilder): Updated.
5309         
5310         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5311         exception.
5312
5313 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5314
5315         Fix #73052.
5316         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5317         non-simple types (array, pointer, reference).
5318
5319 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5320
5321         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5322
5323         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5324         for operators.
5325         (Method.CheckBase): Catch wrong destructor here.
5326         (MethodData.Define): Add errors 550, 668.
5327
5328         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5329
5330         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5331
5332         * pending.cs (VerifyPendingMethods): Add error 551.
5333
5334         * typemanager.cs (CSharpName): Next error report helper.
5335
5336 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5337
5338         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5339         attributes. Removed useless attribute double check.
5340         It saves almost 2MBs for corlib.
5341
5342 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5343
5344         Fix #72924.
5345         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5346         called twice in case of error.
5347
5348 2005-02-23  Chris Toshok  <toshok@ximian.com>
5349
5350         Fix compiler portions of #72827.
5351         * statement.cs (Block.Emit): call Begin/EndScope on the
5352         EmitContext instead of the ILGenerator.
5353
5354         * codegen.cs (EmitContext.BeginScope): new method, call
5355         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5356         we have one.)
5357         (EmitContext.BeginScope): same, but EndScope and CloseScope
5358
5359         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5360         offset and call the superclass's OpenScope(int) with it.
5361         (SymbolWriter.CloseScope): get the current il
5362         offset and call superclass's CloseScope(int) with it.
5363
5364 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5365
5366         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5367         CS1677 for out and ref as well.
5368
5369         * class.cs (Method.Define): Add error CS1599 detection.
5370         
5371         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5372         
5373         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5374         
5375         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5376         
5377         * support.cs.cs (ModifierDesc): New helper method.
5378
5379 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5380             Abin Thomas  <projectmonokochi@rediffmail.com>
5381             Anoob V E  <projectmonokochi@rediffmail.com>
5382             Harilal P R  <projectmonokochi@rediffmail.com>
5383
5384         Fix #57851, #72718.
5385         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5386         MemberLookup (used for error reporting) actually returns a result.
5387         Fix error report number (122, not 112).
5388
5389 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5390             Anoob V E  <projectmonokochi@rediffmail.com>
5391             Harilal P R  <projectmonokochi@rediffmail.com>
5392
5393         Fix #71134.
5394         * pending.cs (PendingImplementation.GetAbstractMethods):
5395         Find NonPublic members too.
5396
5397 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5398
5399         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5400         Fixed error 217.
5401         
5402         * class.cs (MethodCore.CheckMethodAgainstBase):
5403         Add error 239 report.
5404
5405 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5406
5407         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5408         
5409         * class.cs (Operator.Define): Add error 217 report.
5410         
5411 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5412
5413         Fix #68955.
5414         * expression.cs (Invocation.IsApplicable): Make public.
5415         (Invocation.IsParamsMethodApplicable): Likewise.
5416         * delegate.cs (Delegate.VerifyApplicability): Don't use
5417         Invocation.VerifyArgumentCompat for parameter applicability
5418         testing.  Use Invocation.IsApplicable and
5419         Invocation.IsParamsMethodApplicable.
5420
5421 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5422
5423         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5424         
5425         * class.cs (Operator.Define): Add error 217 report.
5426         
5427 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5428
5429         * namespace.cs (UsingEntry.Resolve): Undo change below.
5430
5431 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5432
5433         Fix #72756.
5434         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5435         disable the error message when the extended MemberLookup also
5436         fails.
5437         (Expression.MemberLookupFinal): Update.
5438         (SimpleName.DoSimpleNameResolve): Update.
5439         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5440         Don't use MemberLookupFinal.
5441         (New.DoResolve): Update.
5442         (BaseAccess.CommonResolve): Update.
5443
5444 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5445
5446         Fix #72732.
5447         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5448         occured previously, don't resolve again.
5449
5450 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5451
5452         Fix #69949
5453         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5454         argument. Call ResolveAttributeUsage for unresolved.
5455         when types doesn't match ctor arguments.
5456         
5457         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5458         for nested attribute classes.
5459         (Class.attribute_usage): Removed.
5460         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5461         for attribute class.
5462         
5463         * ecore.cs (IsAttribute): Removed.
5464         
5465         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5466         
5467         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5468         now normal types.
5469         (attribute_types): Removed.
5470         (EmitCode): Global attributes are emited as the latest.
5471
5472 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5473
5474         * class.cs (EmitFieldInitializers): Don't emit field initializer
5475         for default values when optimilization is on.
5476         
5477         * constant.cs (Constant.IsDefaultValue): New property.
5478         
5479         * driver.cs: Add /optimize handling.
5480         
5481         * constant.cs,
5482         * ecore.cs,
5483         * literal.cs: Implement new IsDefaultValue property.
5484         
5485         * rootcontext.cs (Optimize): New field, holds /optimize option.
5486
5487 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5488
5489         Fix crasher in re-opened #72347.
5490         * namespace.cs (Namespace.Lookup): Return null if
5491         DeclSpace.DefineType returns null.
5492
5493         Fix #72678.
5494         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5495
5496 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5497
5498         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5499         now returns null if it cannot resolve to an lvalue.
5500         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5501         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5502         returned null.  Remove check for SimpleName.
5503         (EventExpr.DoResolveLValue): New.
5504         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5505         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5506         error from ...
5507         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5508         avoid CS0131 error.
5509         (Unary.ResolveOperator): Move CS0211 check ...
5510         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5511         CS0131 error.
5512         (Unary.DoResolveLValue): Simplify.
5513         (AddressOf.DoResolveLValue): New.
5514         (ArrayAccess.DoResolveLValue): New.
5515
5516 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5517
5518         * attribute.cs (Attribute.Resolve): Add arguments casting for
5519         when types doesn't match ctor arguments.
5520
5521 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5522
5523         Fix parts of #63202.
5524         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5525         lookup of operator in base type.  Ensure that all checks happen
5526         when the operator resolves to an "op_..." method.
5527
5528 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5529
5530         Fix #71992.
5531         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5532         'ignore_cs0104' parameter.  Pass it to ...
5533         (NamespaceEntry.Lookup): ... this.
5534         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5535         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5536         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5537         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5538         Update.  Request that cs0104 errors be ignored.
5539         (ComposedCast.ResolveAsTypeStep): Update.
5540
5541 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5542
5543         Fix #59209.
5544         * expression.cs (Invocation.BetterFunction): Remove support for
5545         comparing virtual functions and their overrides.
5546         (Invocation.IsOverride): New.
5547         (Invocation.OverloadResolve): Don't consider 'override' functions
5548         during candidate selection.  Store them in a lookaside list.
5549         If the selected method is a 'virtual' function, use the list to
5550         find any overrides that are closer to the LHS type.
5551
5552 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5553
5554         * expression.cs (New.DoResolve): Add complex core type reduction.
5555         (New.Constantify): Converts complex core type syntax like 'new int ()'
5556         to simple constant.
5557         
5558 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5559
5560         * decl.cs (EntryType.EntryType): New constructor to create an
5561         updated copy of a cache entry.
5562         (MemberCache.AddMethods): Use it.
5563         (MemberCache.ClearDeclaredOnly): Remove.
5564         (MemberCache.MemberCache): Update.
5565
5566 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5567
5568         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5569         variable.  This one is represents the actual low-level declaration
5570         of the method, as opposed to the semantic level `IsStatic'.   
5571
5572         An anonymous method which is hosted into a static method might be
5573         actually an instance method.  IsStatic would reflect the
5574         container, while MethodIsStatic represents the actual code
5575         generated.
5576
5577         * expression.cs (ParameterReference): Use the new MethodIsStatic
5578         instead of IsStatic.
5579
5580         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5581         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5582         set on the current EmitContext. 
5583
5584         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5585         resolve our casted expression as an LValue.  This triggers the
5586         proper LValue processing that is later required by Assign.
5587
5588         This fixes 72347.
5589
5590         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5591
5592 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5593
5594         C# 2.0 Fixed buffer implementation
5595
5596         * anonymous.cs: Update after RegisterHelperClass renaming.
5597
5598         * attribute.cs (AttributeTester.fixed_buffer_cache):
5599         Cache of external fixed buffers.
5600         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5601         implementation if field is fixed buffer else null.
5602
5603         * class.cs
5604         (TypeContainer.AddField): Accept FieldMember instead of Field.
5605         (FieldBase.IsFieldClsCompliant): Extracted code from
5606         VerifyClsCompliance descendant customization.
5607         (FixedField): New class handles fixed buffer fields.
5608         (FixedFieldExternal): Keeps information about imported fixed
5609         buffer.
5610         (IFixedField): Make access to internal or external fixed buffer
5611         same.
5612
5613         * cs-parser.jay: Add fixed buffer parsing.
5614
5615         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5616         buffer.
5617
5618         * expression.cs (Indirection): Extended implementation to accept
5619         fixed buffer field.
5620         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5621         (ElementAccess.MakePointerAccess): Get type as parameter.
5622         (DoResolve): Add fixed buffer field expression conversion.
5623         (DoResolveLValue): Ditto.
5624         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5625         (ArrayPtr): Derives from FixedBufferPtr.
5626         (ArrayPtr.Emit): Add extra emit for array elements.
5627
5628         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5629
5630         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5631         for compiler generated types.
5632         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5633
5634         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5635         and consume less memory.
5636         (Fixed.Resolve): Add fixed buffer case.
5637
5638         * typemanager.cs (compiler_generated_attr_ctor,
5639         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5640         (HasElementType): Add our own implementation to work on every
5641         runtime.
5642
5643 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5644
5645         * anonymous.cs (CaptureContext): Track whether `this' has been
5646         referenced.   
5647
5648         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5649         only captured `this' if it was implicitly done (instance
5650         methods/variables were used). 
5651
5652         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5653         `this' must be captured.
5654
5655 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5656  
5657         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5658         is null it means that there has been no need to capture anything,
5659         so we just create a sibling.
5660
5661         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5662
5663         Just a partial fix.  The other half is fairly elusive.
5664         
5665 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5666
5667         Fix #52586, cs0121-4.cs.
5668         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5669         and return a hashtable.
5670         (MemberCache.ClearDeclaredOnly): New.
5671         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5672         the method_hash of a base type too.
5673         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5674         type methods.  Overwrite entries with the same MethodHandle so
5675         that the ReflectedType is correct.  The process leaves in base
5676         virtual functions and their overrides as distinct entries.
5677         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5678         matters since it was boxed in a ArrayList before.
5679         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5680         modifier.
5681         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5682         case of a virtual function and its override (choose the overload
5683         as better).
5684         (Invocation.OverloadResolve): Avoid 'override' members during
5685         'applicable_type' calculation.
5686
5687 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5688
5689         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5690         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5691         GetTypeHandle.  It is possible for a reflected type to derive from
5692         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5693         System.Array during mscorlib compilation).
5694         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5695         contain a method_hash, don't create one either.  Don't create a
5696         deep copy of the base cache's method_hash.
5697         (MemberCache.SetupCache): Rename back from DeepCopy.
5698         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5699         already initialized.  If we see an override function, add its
5700         underlying base virtual function to the member_hash too.
5701
5702 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5703
5704         Combine two near-redundant caches.
5705         * typemanager.cs (method_params): Rename from method_internal_params.
5706         (TypeManager.GetParameterData): New.  Replace
5707         Invocation.GetParameterData.
5708         (TypeManager.LookupParametersByBuilder): Remove.
5709         * expression.cs (Invocation.method_parameter_cache): Remove.
5710         (Invocation.GetParameterData): Remove.
5711         Update to changes.
5712         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5713         Update to changes.
5714
5715 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5716
5717         Fix #72015.
5718         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5719         TypeManager.multicast_delegate_type is null, resolve it by looking
5720         up "System.MulticastDelegate".
5721         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5722
5723 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5724             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5725             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5726
5727         Fix cs0164.cs.
5728         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5729         (LabeledStatement.AddReference): New.  Set 'referenced'.
5730         (Goto.Resolve): Use it.
5731
5732 2005-02-05  John Luke  <john.luke@gmail.com>
5733
5734         * driver.cs: remove duplicate -doc line in Usage ()
5735
5736 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5737
5738         * location.cs (Location.AddFile): Fix CS2002 error report.
5739
5740 2005-02-02  Martin Baulig  <martin@ximian.com>
5741
5742         * delegate.cs (Delegate.DefineType): Report an internal error if
5743         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5744         details.        
5745
5746 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5747
5748         Fix a crasher in a variant of #31984.
5749         * const.cs (Constant.CheckBase): New override that defers the
5750         new-or-override check in case the base type hasn't been populated
5751         yet.
5752         (Constant.Define): Ensure the new-or-override check is performed.
5753
5754 2005-02-01  Duncan Mak  <duncan@ximian.com>
5755
5756         * const.cs (LookupConstantValue): Check that `ce' is not null
5757         before calling GetValue ().
5758
5759 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5760
5761         Fix test-334.cs (#69519).
5762         * cs-parser.jay (using_alias_directive): Pass in an expression to
5763         NamespaceEntry.UsingAlias.
5764         (using_namespace_directive): Pass in an expression to
5765         NamespaceEntry.Using.
5766         (namespace_name): Don't flatten to a string.
5767         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5768         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5769         ResolveAsTypeStep.
5770         (NamespaceEntry.UsingEntry): Likewise.
5771         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5772         changes.
5773         (NamespaceEntry.LookupForUsing): Remove.
5774         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5775         names.
5776         (NamespaceEntry.Lookup): Remove support for dotted names.
5777
5778 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5779
5780         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5781         split into two.
5782         (NamespaceEntry.ImplicitParent): Compute on demand.
5783         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5784         parallels the current.
5785         (NamespaceEntry.LookupForUsing): Use it.
5786         (NamespaceEntry.Lookup): If the current namespace-entry is
5787         implicit, don't search aliases and using tables.
5788
5789 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5790
5791         Fix #31984.
5792         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5793         BaseCache here.
5794         (TypeContainer.BaseCache): Compute on demand.
5795         (TypeContainer.FindMembers): Define constants and types if they're
5796         not already created.
5797         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5798         check.
5799         * const.cs (Constant.Define): Make idempotent.
5800
5801 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5802
5803         * pending.cs: Produce better code (no nops produced by using Ldarg
5804         + value).
5805         
5806         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5807         i - 1' it should be arg + 1.
5808
5809         Fixes bug #71819.
5810
5811 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5812
5813         * attribute.cs (Attribute.CheckAttributeType): Make private
5814         non-virtual.
5815         (Attribute.ResolveType): Make virtual.
5816         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5817         handling of RootContext.Tree.Types.
5818
5819 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5820
5821         Update attribute-handling to use the SimpleName/MemberAccess
5822         mechanisms.
5823         * cs-parser.jay (attribute): Pass in an expression to the
5824         constructors of Attribute and GlobalAttribute.
5825         * attribute.cs (Attribute): Take an expression for the name.
5826         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5827         passed in attribute name expression.
5828         (Attribute.CheckAttributeType): Use it.
5829         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5830         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5831         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5832         argument to prevent error messages if the lookup fails.
5833
5834 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5835
5836         * expression.cs (Indirection): Implemented IVariable interface
5837         to support indirection in AddressOf operator.
5838         (PointerArithmetic.Emit): Add optimalization for case where
5839         result can be precomputed.
5840
5841 2005-01-26  Martin Baulig  <martin@ximian.com>
5842
5843         * class.cs (TypeContainer.AttributeTargets): Return the correct
5844         AttributeTargets depending on our `Kind' instead of throwing an
5845         exception; fixes #71632.
5846
5847 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5848
5849         Fix #71257
5850         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5851         constant members.
5852
5853 2005-03-17  Martin Baulig  <martin@ximian.com>
5854
5855         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5856         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5857
5858 2005-03-17  Martin Baulig  <martin@ximian.com>
5859
5860         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5861         to bool so we can return an error condition.
5862         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5863         returned an error.
5864
5865 2005-03-17  Martin Baulig  <martin@ximian.com>
5866
5867         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5868
5869         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5870         converting from an array-type of T to `IEnumerable<T>'.
5871
5872 2005-03-16  Martin Baulig  <martin@ximian.com>
5873
5874         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5875         (Nullable.LiftedUnaryMutator): New public class.
5876
5877         * expression.cs (UnaryMutator.DoResolve): Added support for
5878         Nullable Types.
5879
5880 2005-03-14  Martin Baulig  <martin@ximian.com>
5881
5882         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5883
5884 2005-03-14  Martin Baulig  <martin@ximian.com>
5885
5886         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5887         the comparision operators `<', `>', `<=' and `>='.
5888
5889 2005-03-13  Martin Baulig  <martin@ximian.com>
5890
5891         * generic.cs
5892         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5893         avoid confusion with the `NullLiteral'.
5894         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5895
5896 2005-03-13  Martin Baulig  <martin@ximian.com>
5897
5898         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5899         comparing arbitrary types with the null literal.
5900
5901 2005-03-13  Martin Baulig  <martin@ximian.com>
5902
5903         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5904         boolean operators '&&', '||', '&' and '|'.
5905         (Nullable.OperatorTrueOrFalse): New public class.
5906
5907         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5908         instead of a `StaticCallExpr'; added support for nullables.
5909
5910 2005-03-10  Martin Baulig  <martin@ximian.com>
5911
5912         * expression.cs
5913         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5914         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5915
5916 2005-03-07  Martin Baulig  <martin@ximian.com>
5917
5918         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5919         it work if `expr' is not an IMemoryLocation.
5920         (Nullable.Lifted): Implement IMemoryLocation.
5921         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5922         target type.
5923
5924 2005-03-05  Martin Baulig  <martin@ximian.com>
5925
5926         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5927         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5928         (Nullable): Added support for lifted unary and binary operators.
5929
5930         * expression.cs (Unary.DoResolve): Added support for nullable types.
5931         (Binary.DoResolve): Likewise.
5932         (Conditional.DoResolve): Likewise.
5933
5934 2005-03-02  Martin Baulig  <martin@ximian.com>
5935
5936         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5937
5938         * class.cs (ClassPart.SetParameterInfo): Override this.
5939         (PartialContainer.SetParameterInfo): Override this.
5940         (TypeContainer.CheckConstraints): New protected method.
5941         (PartialContainer.CheckConstraints): Override this and check
5942         whether the same contraints were specified in all parts of a
5943         partial generic type definition.
5944         (PartialContainer.UpdateConstraints): New public method.
5945
5946         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5947
5948 2005-03-02  Martin Baulig  <martin@ximian.com>
5949
5950         Committing a patch from Carlos Alberto Cortez to fix #72887.
5951
5952         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5953         casts from `T []' to `int []'.
5954
5955 2005-03-02  Martin Baulig  <martin@ximian.com>
5956
5957         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5958
5959         * expression.cs (Binary.ResolveOperator): When resolving a
5960         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5961         `=='.  Fixes #71866.  See gen-127.cs.
5962
5963 2005-03-02  Martin Baulig  <martin@ximian.com>
5964
5965         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5966         static constructor in static classes.
5967
5968 2005-03-02  Martin Baulig  <martin@ximian.com>
5969
5970         * generic.cs
5971         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5972         (Nullable.LiftedConversion): Added support for user-defined
5973         conversions.
5974
5975         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5976
5977         * cs-parser.jay: Use ComposedCast everywhere instead of
5978         NullableType, so we don't need to check for NullableType
5979         everywhere.
5980         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5981         case where we'll be resolved into a `parenthesized_expression_0'
5982         afterwards.
5983
5984         * convert.cs
5985         (Convert.UserDefinedConversion): Added nullable conversions.
5986
5987 2005-02-28  Martin Baulig  <martin@ximian.com>
5988
5989         * generic.cs (TypeManager.IsNullableType): New static method.
5990         (Nullable): New abstract class.
5991         (Nullable.NullLiteral): New public class.
5992         (Nullable.LiftedConversion): New public class.
5993
5994         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5995         `builtin_types opt_nullable'.
5996
5997         * convert.cs
5998         (Convert.ImplicitConversionStandard): Added nullable conversions.
5999         (Convert.ExplicitConversionStandard): Likewise.
6000         (Convert.ExplicitConversion): Likewise.
6001
6002 2005-02-26  Martin Baulig  <martin@ximian.com>
6003
6004         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6005         begin with a "?", for instance "?[]".  Don't do a type lookup if
6006         `dim' is empty.
6007
6008 2005-02-25  Martin Baulig  <martin@ximian.com>
6009
6010         The first part of Nullable Types :-)
6011
6012         * generic.cs (NullableType): New public class.
6013         (NullCoalescingOperator): New public class.
6014         (TypeArguments.Resolve): Add a CS0306 check.
6015
6016         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6017         (opt_nullable): New rule.
6018         (type): Added `opt_nullable' to `namespace_or_type_name',
6019         `builtin_types' and `pointer_type'.
6020         (array_type): Added `opt_nullable'.
6021         (opt_rank_specifier_or_nullable): New rule; this is the
6022         combination of `opt_rank_specifier' and `opt_nullable'.
6023         (opt_error): New rule; catch errors here.
6024         (nullable_type_or_conditional): New rule; we use this to check for
6025         nullable and still detect the conditional operator.
6026         (local_variable_type): Use `opt_rank_specifier_or_nullable'
6027         instead `opt_rank_specifier'.
6028
6029         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6030         for nullables.
6031
6032 2005-02-24  Martin Baulig  <martin@ximian.com>
6033
6034         * README, README.Changes: Removed; they're old and obsolete.
6035
6036 2005-02-22  Martin Baulig  <martin@ximian.com>
6037
6038         * generic.cs (TypeParameter.Resolve): If resolving the constraints
6039         returned an error, set `constraints' to null to avoid a crash
6040         later on.
6041         (TypeParameter.ResolveType): Likewise.
6042
6043 2005-02-22  Martin Baulig  <martin@ximian.com>
6044
6045         * generic.cs
6046         (Constraints.ResolveTypes): Protect against being called twice.
6047         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6048         (TypeParameter.ResolveType): New public method; calls
6049         constraints.ResolveTypes().
6050         (TypeParameter.DefineType): Moved constraints.ResolveType() out
6051         into the new ResolveType().
6052         (GenericMethod.Define): Call ResolveType() on all our
6053         TypeParameter's.        
6054
6055 2005-02-21  Martin Baulig  <martin@ximian.com>
6056
6057         * generic.cs
6058         (TypeManager.generic_nullable_type): New static public field.
6059         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6060
6061         * rootcontext.cs
6062         (RootContext.ResolveCore): Resolve "System.Nullable`1".
6063
6064 2005-02-15  Martin Baulig  <martin@ximian.com>
6065
6066         * generic.cs (ConstructedType.Constraints): Correctly check
6067         constraints if the argument type is a type parameter; fixes
6068         #72326. 
6069
6070 2005-02-02  Martin Baulig  <martin@ximian.com>
6071
6072         * delegate.cs (Delegate.DefineType): Report an internal error if
6073         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6074         details.        
6075
6076 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6077
6078         * pending.cs: Produce better code (no nops produced by using Ldarg
6079         + value).
6080         
6081         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6082         i - 1' it should be arg + 1.
6083
6084         Fixes bug #71819.
6085         
6086 2005-01-26  Martin Baulig  <martin@ximian.com>
6087
6088         * cs-parser.jay (indexer_declarator): Don't report an error if we
6089         have type parameters since we can be an explicit interface
6090         implementation; fixes #71449.
6091
6092 2005-01-26  Martin Baulig  <martin@ximian.com>
6093
6094         * class.cs (TypeContainer.AttributeTargets): Return the correct
6095         AttributeTargets depending on our `Kind' instead of throwing an
6096         exception; fixes #71632.
6097
6098 2005-01-26  Martin Baulig  <martin@ximian.com>
6099
6100         * delegate.cs (Delegate.DefineType): Correctly define our type
6101         parameters.  Fixes #71483.
6102
6103 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6104
6105         Fix #71602.
6106         * expression.cs (MemberAccess.DoResolve): Don't complain with
6107         cs0572 when the LHS of a member access has identical name and type
6108         name.
6109
6110 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6111
6112         Fix #71651, #71675
6113         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6114         CreatePermission.
6115         Create custom PermissionSet only for PermissionSetAttribute.
6116
6117 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6118
6119         Fix #71649
6120         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6121         delegates in static class.
6122
6123 2005-01-24  Martin Baulig  <martin@ximian.com>
6124
6125         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6126         merging an implicit block, just use its reachability.
6127
6128         * statement.cs (Block.Resolve): Make the unreachable code check
6129         work wrt. implicit blocks; see test-337 from #63842.
6130
6131 2005-01-21  Alp Toker  <alp@atoker.com>
6132  
6133         * cs-parser.jay: destructor_declaration's container is PartialContainer
6134         not Class when partial types are used, so use Kind prop instead of
6135         'is'.
6136         
6137 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6138
6139         * cs-parser.jay: Improve error reporting when an interface
6140         declares new types.
6141
6142 2005-01-20  Dick Porter  <dick@ximian.com>
6143
6144         * support.cs: SeekableStreamReader fix from Sandor Dobos
6145         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6146         chars are read.  Fixes bug 70369.
6147
6148 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6149
6150         * cs-parser.jay (catch_clause): Simplify current_block handling
6151         somewhat.
6152
6153 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6154
6155         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6156         code with ImplicitStandardConversion to handle the implicit
6157         conversion of method groups into valid delegate invocations. 
6158
6159         The problem is that in parameter handling we were using this code
6160         path.  Fixes bug #64698
6161
6162 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6163
6164         * cs-parser.jay: Fix several infelicities.
6165         - Avoid assigning to the parser value stack.  Code like 
6166           '$3 = null' is unclean.  Synthesize a value for the code block
6167           instead. 
6168         - Avoid using oob_stack for storing location information.  Use ...
6169         (_mark_): ... this.  New (empty) rule.  Saves the current location
6170         in $$.
6171         (foreach_statement): Avoid using oob_stack for current_block
6172         handling.  Use technique used in for_statement and
6173         using_statement.  Synthesize a value for the code block to store
6174         additional intermediate information.
6175
6176 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6177
6178         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6179         of a different type is only allowed to private fields of a
6180         containing type, not on fields of a base class.
6181
6182         See test-174.cs and error cs0122-9.cs
6183
6184 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6185
6186         Fix test-335.cs (bug #58126).
6187         * cs-parser.jay (argument): Split out non-expression parts of the
6188         rule into 'non_simple_argument'.
6189         (invocation_expression): Support parenthesized invocations with
6190         multiple arguments, and with single non-simple arguments.
6191
6192 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6193
6194         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6195         places.
6196
6197 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6198
6199         Fix cs0038-1.cs, cs1640-6.cs.
6200         * ecore.cs (Expression.Resolve): Remove special-case for
6201         SimpleName in error-handling.
6202         (Expression.almostMatchedMembers): Relax access permission to
6203         protected.
6204         (Expression.MemberLookupFailed): Handle duplicates in
6205         almostMatchedMembers list.
6206         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6207         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6208         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6209         overload if the passed in MemberInfo is a MethodBase.
6210
6211 2005-01-25  Martin Baulig  <martin@ximian.com>
6212
6213         * doc.cs
6214         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6215
6216 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6217
6218         Fix #70749
6219         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6220         for non-CAS & merge permission sets properly.
6221
6222 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6223
6224         Improve standard-compliance of simple name and member access 
6225         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6226         * ecore.cs (FullNamedExpression): New abstract base class 
6227         for Namespaces and TypeExpressions.
6228         (ResolveFlags.SimpleName): Remove.
6229         (SimpleName): Remove support for dotted names.
6230         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6231         DeclSpace.FindType and DeclSpace.LookupType.
6232         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6233         (Expression.ExprClassName): Make member function.
6234         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6235         a namespace.  Remove creation of dotted "SimpleName"s.
6236         (MemberAccess.DoResolve): Likewise.
6237         * decl.cs (DeclSpace.Cache): Make private.
6238         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6239         (DeclSpace.FindType): Update.
6240         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6241         FullNamedExpression.
6242         * namespace.cs (Namespace): Derive from FullNamedExpression
6243         so that it can be part of expression resolution.
6244         (Namespace.Lookup): Return an FullNamedExpression.
6245         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6246         namespace.
6247         * rootcontext.cs (NamespaceLookup): Remove.
6248         (LookupType): Move to DeclSpace.
6249         * attribute.cs (CheckAttributeType): Update.
6250         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6251         (FindDocumentedTypeNonArray): Likewise.
6252
6253 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6254
6255         Fix cs0509.cs, cs1632.cs.
6256         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6257         is the same as IsInterface.
6258         (TypeContainer.GetClassBases): Likewise.
6259         * statement.cs (LabeledStatement.ig): New field.
6260         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6261         label.
6262         (LabeledStatement.DoEmit): Check that the label was created with
6263         the same ILGenerator.
6264
6265 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6266
6267         Fix #71058
6268         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6269         accessors to its properties.
6270
6271         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6272         from accessors to property.
6273         
6274 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6275
6276         Fix #70722
6277         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6278         only for overrides.
6279         
6280 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6281
6282         * attribute.cs: Check for null and empty strings.  
6283
6284         I have lost another battle to Paolo.
6285
6286 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6287
6288         Fix #70942
6289         * class.cs (PropertyMethod): Set Parent field in ctors.
6290         (SetMethod.InternalParameters): Add unsafe switch hack.
6291         Override MarkForDuplicationCheck where it is appropriate.
6292
6293         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6294         It says whether container allows members with the same name.
6295         Base default is no.
6296         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6297         Removed is_method parameter.
6298
6299 2005-01-06  Duncan Mak  <duncan@ximian.com>
6300
6301         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6302         because the previous change led to incorrect reporting of CS1032
6303         ("Cannot define/undefine preprocessor symbols after first token in
6304         file"). Instead of using `tokens_seen' as the only flag that
6305         triggers CS1040, introduce `comments_seen'. This new flag is used
6306         to signify having seen comments on the current line, so it is
6307         unset after a newline.
6308
6309 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6310
6311         * doc.cs : When searching for a type, find nested type too.
6312           This fixes bug #71040.
6313
6314 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6315
6316         * doc.cs :
6317           - Warn missing member comment on those classes which also does not
6318             have doc comments. Fixed bug #71041.
6319           - Don't warn missing doc comment on default constructor.
6320             Fixed bug #71042.
6321
6322 2005-01-06  Duncan Mak  <duncan@ximian.com>
6323
6324         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6325         comments, set `tokens_seen' to true. This allows us to detect
6326         misplaced preprocessor directives (i.e. not at the beginning of
6327         the a line, nor after whitespaces). In that case, report error
6328         CS1040. This fixes bug #56460.
6329
6330         * cs-parser.jay (interface_member_declaration): Add checks for
6331         IsExplicitImpl, and report CS0541 error if an interface member is
6332         defined as an explicit interface declaration.
6333
6334 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6335
6336         Fix #70817
6337         * class.cs (PropertyMethod): Set Parent field in ctors.
6338         (SetMethod.InternalParameters): Add unsafe switch hack.
6339         
6340         * decl.cs (MemberCore.Parent): Cannot be readonly.
6341
6342 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6343
6344         * decl.cs (DeclSpace.ResolveType): Remove.
6345         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6346         Merge in code from ...
6347         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6348         * class.cs, enum.cs: Update to changes.
6349
6350 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6351
6352         * anonymous.cs: Ensure that we init the scope of our parent if it
6353         has not been initialized yet.
6354
6355 2004-12-30  Duncan Mak  <duncan@ximian.com>
6356
6357         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6358         if field.FieldBuilder is null. Fixes #70758.
6359
6360         * convert.cs: Fixed some typos and updated some of the comments.
6361         (ImplicitStandardConversionExists):
6362         (TryImplicitIntConversion): If `target_type' is an interface and
6363         the type of `ic' implements this interface, return true or a new
6364         BoxedCast instead of null. This fixes #70468.
6365
6366 2004-12-29  Duncan Mak  <duncan@ximian.com>
6367
6368         * expression.cs (Argument.Emit): Check that Expr is
6369         IMemoryLocation before casting to it, and report CS1510 otherwise.
6370
6371         This fixes #70402.
6372
6373 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6374
6375         * statement.cs (Block.ThisVariable): remove the recursion here, to
6376         make the --profile more sane.
6377
6378 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6379
6380         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6381         assembly, by JB Evain.
6382
6383 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6384
6385         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6386           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6387         "parent" refers to enclosing type/class.  "base" refers to superclass.
6388
6389 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6390
6391         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6392         Ensure that we only have GlobalAttributes.
6393         * attribute.cs (Attribute.Emit): Make non-virtual.
6394         (GlobalAttribute.Emit): Remove.
6395         (Attribute.Resolve): Make virtual.
6396         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6397         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6398         the argument. Don't create one.
6399         (Attribute.GetObsoleteAttribute): Likewise.
6400         (Attribute.GetClsCompliantAttributeValue): Likewise.
6401         * class.cs, decl.cs: Update to changes.
6402
6403 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6404
6405         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6406         
6407         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6408         
6409         * statement.cs (Foreach.Resolve): Add error 186 report.
6410
6411 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6412
6413         * expression.cs (Conditional.DoResolve): Add warning 429.
6414         
6415         * statement.cs (If.Resolve): Add warning 665.
6416
6417 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6418
6419         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6420         except when in the parser, and in GlobalAttribute.
6421         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6422         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6423         RootContext.Tree.Types.NamespaceEntry once work is done.
6424         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6425         and resets RootContext.Tree.Types.NamespaceEntry.
6426
6427 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6428
6429         * cs-parser.jay: Don't create a block for every variable.
6430
6431 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6432
6433         * location.cs: Provide extra information.
6434
6435         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6436         variables from the captured environment, it is the ldarg_0.
6437
6438 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6439
6440         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6441         find a conclusion.
6442         
6443         * class.cs: Changed warning level for 169 to avoid developer
6444         displeasure from warning flooding. It will be changed back when they
6445         fix most of current BCL warnings.
6446         
6447         * RootContext.cs: Pushed default WarningLevel to 3.
6448         
6449         * statement.cs: Removed unused variable.
6450
6451 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6452
6453         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6454         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6455         Add error 502 report.
6456         (StaticClass.DefineType): Add error 441 report.
6457         (Class.AllowedModifiersProp): New virtual property as temporary
6458         extension to AllowedModifiers.
6459         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6460         to share implementation with StaticClass and don't call virtual
6461         methods from ctor.
6462         
6463         * driver.cs (MainDriver): Add error 1558 test.
6464
6465         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6466         report. Moved error 36 test here.
6467
6468         * statement.cs (Throw.Resolve): Add error 724 report.
6469
6470         * typemanager.cs: Add out_attribute_type core type.
6471         
6472 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6473
6474         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6475         3018 report.
6476         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6477
6478         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6479         3017 report.
6480         
6481         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6482
6483         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6484         Add error 3023 report.
6485         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6486
6487         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6488         implementation.
6489
6490 2004-12-12  John Luke  <john.luke@gmail.com>
6491
6492         * driver.cs (AddArgs): take -- into account when
6493         adding arguments, fixes bug 65710 
6494
6495 2004-12-12  Martin Baulig  <martin@ximian.com>
6496
6497         * expression.cs (Unary.TryReduceNegative): Added support for
6498         SByteConstant and ByteConstant.
6499         (Unary.Reduce): Check error values from TryReduceNegative().
6500
6501 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6502
6503         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6504         and report exception as error 182.
6505
6506 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6507
6508         * driver.cs (Main): Fix message when there are warnings.
6509
6510 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6511
6512         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6513
6514 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6515
6516         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6517         Reduced number of warnings.
6518         
6519         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6520
6521 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6522
6523         * driver.cs: Removed message.
6524
6525         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6526
6527 2004-12-08    <vargaz@freemail.hu>
6528
6529         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6530
6531 2004-12-08  Martin Baulig  <martin@ximian.com>
6532
6533         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6534         instead of a CS3002 for properties and indexer.
6535
6536 2004-12-08  Martin Baulig  <martin@ximian.com>
6537
6538         * decl.cs (MemberName.ToString): Make this work again.
6539
6540 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6541
6542         * attribute.cs (Resolve): Add error 591 detection.
6543
6544         * class.cs (FieldMember.Define): Add error 1547 detection.
6545         (Indexer.Define): Add error 620 detection.
6546         (Operator.Define): Add error 590 detection.
6547
6548         * ecore.cs: Missing argument for error 79.
6549
6550         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6551         detection.
6552
6553 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6554
6555         Fix #70106
6556         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6557         only.
6558
6559 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6560
6561         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6562           Some operator comments were suppressed.
6563         * doc.cs : Implicit/explicit operator name in doc comments are like
6564           "op_Explicit(type)~returnType", so added suffix handling.
6565
6566 2005-01-21  Alp Toker  <alp@atoker.com>
6567
6568         * cs-parser.jay: destructor_declaration's container is PartialContainer
6569         not Class when partial types are used, so use Kind prop instead of 'is'.
6570
6571 2004-12-12  Martin Baulig  <martin@ximian.com>
6572
6573         * expression.cs (Unary.TryReduceNegative): Added support for
6574         SByteConstant and ByteConstant.
6575         (Unary.Reduce): Check error values from TryReduceNegative().
6576
6577 2004-12-11  Martin Baulig  <martin@ximian.com>
6578
6579         * support.cs (ReflectionParameters.ParameterName): If we have a
6580         `gpd', call `ParameterName' on it.
6581
6582         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6583
6584         * pending.cs (PendingImplementation.DefineProxy): Call
6585         DefineParameter() for all of the MethodBuilder's arguments.
6586
6587 2004-12-09  Martin Baulig  <martin@ximian.com>
6588
6589         * doc.cs (DocUtil): Make this a static class.
6590
6591 2004-12-09  Martin Baulig  <martin@ximian.com>
6592
6593         * expression.cs (Invocation.InferType): Moved the type inference
6594         implementation into TypeManager.
6595
6596         * generics.cs (TypeManager): Moved the type inference
6597         implementation here.
6598
6599 2004-12-09  Martin Baulig  <martin@ximian.com>
6600
6601         * typemanager.cs (TypeManager): Make this a partial class.
6602
6603         * generics.cs
6604         (TypeManager): Move the generics part of `TypeManager' here.
6605
6606 2004-12-08  Martin Baulig  <martin@ximian.com>
6607
6608         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6609         instead of a CS3002 for properties and indexer.  Added CS3024
6610         check for generic interfaces.
6611
6612         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6613         instances are not CLS-compliant.
6614
6615 2004-12-08  Martin Baulig  <martin@ximian.com>
6616
6617         * cs-parser.jay
6618         (void_pointer_expression): New rule for `void*', `void**' etc.
6619         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6620
6621 2004-12-08  Martin Baulig  <martin@ximian.com>
6622
6623         * expression.cs (Invocation.InferType): Removed the hack for
6624         MethodCore.MayUnify().  
6625
6626         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6627         this actually work.
6628
6629         * class.cs (MethodCore.MayUnify): Use
6630         TypeManager.MayBecomeEqualGenericTypes().       
6631
6632 2004-12-08  Martin Baulig  <martin@ximian.com>
6633
6634         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6635         parameter, box it.  Fixes #69233.
6636
6637 2004-12-08  Martin Baulig  <martin@ximian.com>
6638
6639         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6640         have the ctor constraint.  Fixes #68326.
6641
6642 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6643
6644         * cs-parser.jay : interface comment was not consumed because of
6645           extra opt_semicolon before doc handling.
6646
6647 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6648
6649         Fix test-327.cs, test-328.cs, and put in early infrastructure
6650         for eventually fixing #52697.
6651         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6652         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6653         from other methods.
6654         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6655         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6656         (VerifyUsing, error246): Update.
6657         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6658         'NamespaceEntry.LookupNamespaceOrType'.
6659
6660 2004-12-07  Martin Baulig  <martin@ximian.com>
6661
6662         * driver.cs: Call it "BETA SOFTWARE" :-)
6663
6664 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6665
6666         Fix crash on cs0657-17.cs.
6667         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6668         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6669         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6670         the case where the NamespaceEntry gets overwritten.
6671
6672 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6673
6674         Fixed #69195, #56821
6675         * ecore.cs (ResolveBoolean): Tiny refactoring.
6676
6677         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6678         of right expression resolving when left is false constant and
6679         operator is LogicalAnd OR true constant and operator is LogicalOr.
6680
6681         * statement.cs (ResolveUnreachable): Always reports warning.
6682
6683 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6684
6685         * class.cs: Distinguish between 1721 and 1722 (just a little help
6686         for the programmer).
6687
6688 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6689
6690         * delegate.cs: Only allow this on new versions of the language. 
6691
6692 2004-12-02  Duncan Mak  <duncan@ximian.com>
6693
6694         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6695         Expression class.
6696         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6697         here as a static method. Take an additional bool out parameter
6698         `must_do_cs1540_check' for signaling to InstanceResolve.
6699         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6700         member field from PropertyExpr class and made it an argument of
6701         the method instead.
6702         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6703         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6704         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6705         and `remove_accessor' as well as InstanceResolve: report CS0122
6706         where applicable.
6707
6708         Fixes #70129.
6709
6710 2004-12-07  Martin Baulig  <martin@ximian.com>
6711
6712         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6713         and CS0692 where appropriate.
6714
6715 2004-12-06  Martin Baulig  <martin@ximian.com>
6716
6717         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6718         IsDuplicateImplementation() and improved it.
6719
6720         * expression.cs (Invocation.InferTypeArguments): Added
6721         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6722         and removed the "ref" modifier from `infered_types'.
6723
6724         * decl.cs (MemberName.ToString): Removed the exception.
6725
6726 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6727
6728         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6729           comments are allowed.
6730
6731 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6732
6733         * delegate.cs: Add checks for subtypes in paramaters and return values
6734         in VerifyMethod () to add support for Covariance/Contravariance
6735         in delegates.
6736         
6737 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6738
6739         * report.cs: Remove extra closing parenthesis.
6740
6741         * convert.cs (Error_CannotImplicitConversion): If the name of the
6742         types are the same, provide some extra information.
6743
6744 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6745
6746         Fix bug #70102
6747         * attribute.cs (Resolve): Improved implementation of params
6748         attribute arguments.
6749
6750         * support.cs (ParameterData): Add HasParams to be faster.
6751
6752 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6753
6754         all things are for /doc support:
6755
6756         * doc.cs: new file that supports XML documentation generation.
6757         * mcs.exe.sources: added doc.cs.
6758         * driver.cs:
6759           Handle /doc command line option.
6760           Report error 2006 instead of 5 for missing file name for /doc.
6761           Generate XML documentation when required, after type resolution.
6762         * cs-tokenizer.cs:
6763           Added support for picking up documentation (/// and /** ... */),
6764           including a new XmlCommentState enumeration.
6765         * cs-parser.jay:
6766           Added lines to fill Documentation element for field, constant,
6767           property, indexer, method, constructor, destructor, operator, event
6768           and class, struct, interface, delegate, enum.
6769           Added lines to warn incorrect comment.
6770         * rootcontext.cs :
6771           Added Documentation field (passed only when /doc was specified).
6772         * decl.cs:
6773           Added DocComment, DocCommentHeader, GenerateDocComment() and
6774           OnGenerateDocComment() and some supporting private members for
6775           /doc feature to MemberCore.
6776         * class.cs:
6777           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6778         * delegate.cs:
6779           Added overriden DocCommentHeader.
6780         * enum.cs:
6781           Added overriden DocCommentHeader and GenerateDocComment().
6782
6783 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6784
6785         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6786         unwrapping the enumeration values, chain to
6787         DoConstantNumericPromotions again, so we can promote things to the
6788         fundamental types (takes care of enums that are bytes, sbytes).
6789
6790         Fixes bug #62054.
6791
6792 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6793
6794         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6795         Fix long-standing bug in type-lookup.  Use FindType instead of
6796         LookupType when ec.ResolvingTypeTree.
6797         (Attribute.ResolveType, Attribute.Resolve)
6798         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6799         Update to changes.
6800         (Attributes.Search): Remove internal version.  Update.
6801         (Attributes.SearchMulti): Update.
6802         (Attributes.GetClsCompliantAttribute): Remove.
6803         (Attributes.GetIndexerNameAttribute): Remove.
6804         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6805         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6806         * class.cs (Indexer.Define): Likewise.
6807
6808 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6809
6810         Fix bug #68790
6811         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6812         MarshallByReference members access.
6813
6814         * expression.cs: Use CheckMarshallByRefAccess;
6815         Better error CS0197 message.
6816
6817         * report.cs: Print whole related error message.
6818
6819 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6820
6821         * class (GetClassBases): Better error 60 report.
6822         (EventProperty): Disabled warning 67 detection.
6823
6824 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6825
6826         Fix bug #60324
6827         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6828
6829         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6830         precise values.
6831
6832 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6833
6834         Fix bug #49488
6835         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6836
6837         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6838
6839 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6840
6841         * attribute.cs (Attribute.Resolve): Refine error reporting and
6842         report a cs0117 if the identifier does not exist, to distinguish
6843         from 0617 which is a miss-use of the actual identifier.
6844
6845         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6846         between cs0070 and cs0079.
6847
6848         * class.cs (MemberBase.DoDefine): When reporting a wrong
6849         accessibility level, we use MethodCore to compare instead of
6850         Method (this was a regression in some refactoring effort).
6851
6852         So now we correctly report cs0056 again.
6853
6854         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6855         testing the target_type (which was known to be object_type) and
6856         not the source type (which is anonymous_method).
6857
6858         Fixed reporting of error cs1660.
6859
6860         * expression.cs (UserCast.Source): Expose the underlying cast.
6861
6862         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6863         allowed types to find a match to int32 first (most common).
6864
6865         In addition, it ignores any ImplicitUserConversions that did an
6866         internal implicit conversion (as the switch statement allows only
6867         one integral conversion to exist).
6868
6869         * class.cs (PartialContainer.Create): rename `name' to
6870         `member_name' for clarity.  Then replace the string calls with a
6871         call to MemberName.GetPartialName, as now using
6872         MemberName.ToString is an error (this is due to the side effects
6873         it had, that were fixed in the past).
6874
6875         This will restore the error reporting on a number of partial class
6876         errors that were missusing this (and getting an exception as a
6877         results, which is now just a plain textual warning, because
6878         yyparse debug output would crash otherwise).
6879
6880 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6881
6882         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6883
6884 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6885
6886         * rootcontext.cs (LookupType): Make sure to cache lookups that
6887         don't give us a negative result. This saves about 5% of corlib
6888         compilation time.
6889
6890 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6891
6892         * report.cs (AbstractMessage.Print): messages are sent to stderr
6893
6894         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6895         non-interface in the list of interfaces (at this point, either
6896         parent was properly set, or a base class is being listed in the
6897         interfaces section).
6898
6899         This flags error 1722, and resolves the crash from bug 69259.
6900
6901 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6902
6903         * statement.cs (Using.EmitExpressionFinally): make this work right
6904         for valuetypes. Fixes 69926.
6905
6906 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6907
6908         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6909         converted to an enum" here, before we try to change the underlying
6910         type.  This code exists, but it is a different code path than the
6911         one used while encoding constants.
6912
6913         (ImplicitReferenceConversionExists): In addition, resynchronized
6914         the code here, so it matches the same code in
6915         ImplicitReferenceConversionExists for the `from any class-type S
6916         to any interface-type T'.       
6917
6918 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6919
6920         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6921
6922 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6923
6924         * cs-parser.jay: Use verbosity accordingly. 
6925
6926 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6927
6928         * expression.cs (Unary.ResolveOperator): Do not report warning;
6929         AddressOf reads from variable.
6930         
6931         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6932
6933 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6934
6935         Fix bug #69462
6936
6937         * attribute.cs (Attributable): Removed CheckTargets.
6938         (Attributes.Emit): Explicit attribute targets are tested here.
6939
6940         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6941         not enabled for interfaces.
6942
6943         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6944         (GetAssemblyName): Ouch next bug there.
6945
6946 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6947
6948         * expression.cs: Error 275 added.
6949         
6950 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6951
6952         Fix bug #69177 (Implemented decimal constant support)
6953
6954         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6955         (BinaryFold): Add DecimalConstant.
6956
6957         * const.cs (Define): Decimal constant 
6958         (is not constant.
6959         (ChangeType): Add decimal type handling.
6960         (LookupConstantValue): Don't set value for decimal type but
6961         emit DecimalConstantAttribute. Needed for constant optimization.
6962
6963         * constant.cs (ToDecimal): New method.
6964         (ConvertToDecimal): New method.
6965         (IntConstant): Implemented ConvertToDecimal.
6966         (DecimalConstant.Emit): Emit optimized version for decimals in
6967         int range.
6968
6969         * expression.cs (ResolveOperator): Changed order of constant
6970         reduction to work correctly with native types which have
6971         overloaded operators.
6972         (ResolveMemberAccess): Extract constant value from attribute
6973         for decimal type.
6974
6975         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6976
6977         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6978         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6979         (ChangeType): Decimal is special.
6980         (TypeToCoreType): Add decimal type.
6981
6982 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6983
6984         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6985         decimal types.
6986
6987 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6988
6989         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6990         test cs1667-5.cs.
6991
6992 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6993
6994         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6995
6996         * pending.cs (PendingImplementation): Grab only interfaces.
6997
6998 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6999
7000         * statement.cs (ForeachHelperMethods): Add location member and
7001         error 202 detection.
7002
7003 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7004
7005         * expression.cs (DoResolveBase): Fixed wrong warning for out
7006         variables.
7007
7008 2004-12-04  Martin Baulig  <martin@ximian.com>
7009
7010         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7011         to check whether the conversion is ok.
7012
7013         * typemanager.cs (TypeManager.GetTypeArguments): Just return
7014         `Type.EmptyTypes' if we're not a generic TypeContainer.
7015
7016 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7017
7018         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7019         old bug: when converting from the null literal to a pointer,
7020         return an EmptyCast, not the NullLiteral.
7021
7022         This fixes #69921, the recent null_type changes probably made this
7023         bug more prominent.
7024
7025 2004-12-03  Martin Baulig  <martin@ximian.com>
7026
7027         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7028         method as our child, call AnonymousMethod.Compatible() on it.
7029
7030 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7031
7032         * class.cs (FieldBase): Use an unused bit field from the field to
7033         encode the `has_offset' property from the FieldMember.  This saves
7034         a couple of Ks on bootstrap compilation.
7035
7036         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7037         method as our child, return the AnonymousMethod resolved
7038         expression.
7039
7040         * expression.cs (New.DoResolve): Allow return values from
7041         NewDelegate to also include AnonymousMethods.
7042
7043         Fixes #70150.
7044
7045 2004-11-29  Raja R Harinath  <rharinath@novell.com>
7046
7047         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7048         cs1648 report.
7049         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7050         System.Runtime.InteropServices._Exception, since it's a base
7051         interface of the core type System.Exception in the net_2_0 profile.
7052
7053 2004-11-27  Martin Baulig  <martin@ximian.com>
7054
7055         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7056
7057 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7058
7059         * Makefile: Convert to use executable.make.
7060         * gmcs.exe.sources: New.
7061
7062 2004-11-25  Martin Baulig  <martin@ximian.com>
7063
7064         * expression.cs (Invocation.InferType): Added support for byref types.
7065
7066 2004-11-25  Martin Baulig  <martin@ximian.com>
7067
7068         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7069         in TypeManager.TypeToCoreType().
7070
7071 2004-11-25  Martin Baulig  <martin@ximian.com>
7072
7073         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7074         "Dispose" method from the `current_type'.
7075         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7076         DoDefineMembers() instead of using the MethodBuilder; this is
7077         required for generic iterators.
7078
7079         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7080
7081 2004-11-24  Martin Baulig  <martin@ximian.com>
7082
7083         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7084
7085 2004-11-20  Martin Baulig  <martin@ximian.com>
7086
7087         * expression.cs (Invocation.InferType): Correctly infer generic
7088         instances; see gen-103.cs.
7089         (Invocation.InferTypeArguments): If a generic method doesn't have
7090         any unbound type parameters, we don't need to infer anything.
7091
7092 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7093
7094         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7095
7096 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7097
7098         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7099         (TypeHandle.GetMemberCache): New.
7100         (TypeHandle.TypeHandle): Update.
7101         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7102         (TypeManager.LookupParentInterfacesCache):
7103         Rename from LookupInterfaceCache.  Optimize slightly.
7104         (TypeManager.MemberLookup_FindMembers): Update.
7105         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7106         multi-type variant.
7107         (AddCacheContents): Rename from AddHashtable.
7108         * class.cs (TypeContainer.parent_container): Remove.
7109         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7110         (TypeContainer.DoDefineMembers): Don't initialize it.
7111         Update to name changes.
7112         
7113 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7114
7115         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7116         that factors the code to check access modifiers on override.  
7117
7118         (PropertyBase): Use the code here.
7119
7120         Patch from Lluis S'anchez, fixes bug #69361.
7121
7122 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7123
7124         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7125         routine that is used to report the use of a captured variable
7126         whose address has been taken.
7127
7128         There are two checks: one when variables are being captured and
7129         the other check is when the address of a variable is taken. 
7130         
7131         (because an anonymous methods might be resolved before *or* after
7132         the address has been taken) and 
7133
7134         * expression.cs (Conditional.DoResolve): Remove the special
7135         casing that Martin added to trueExpr and falseExpr being both
7136         NullLiteral.  We get the right behavior now just by introducing
7137         the null_type into the compiler. 
7138
7139         * convert.cs (ExplicitConversion): Change the code to use
7140         null_type instead of testing `expr is NullLiteral'.
7141         (ImplicitConversionStandard): use null_type too.
7142         (ImplicitReferenceConversionExists): use null_type too.
7143         (ImplicitReferenceConversion): use null_type too.
7144
7145         * literal.cs: The type of `NullLiteral' is now null_type instead
7146         of object_type. 
7147         (Resolve): Set the type here.
7148
7149         * typemanager.cs: Introduce null_type.
7150
7151 2004-11-18  Martin Baulig  <martin@ximian.com>
7152
7153         * rootcontext.cs
7154         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7155
7156 2004-11-18  Martin Baulig  <martin@ximian.com>
7157
7158         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7159
7160 2004-11-18  Martin Baulig  <martin@ximian.com>
7161
7162         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7163         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7164         call ResolveConstructedType() on it to resolve it without checking
7165         constraints.
7166         (Constraints.ResolveTypes): Check them here.
7167         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7168         but don't check constraints.
7169         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7170         check constraints here.
7171         (ConstructedType.ResolveConstructedType): New public method.  This
7172         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7173         resolve ourselves without checking constraints.
7174
7175         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7176
7177 2004-11-18  Martin Baulig  <martin@ximian.com>
7178
7179         * decl.cs
7180         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7181
7182         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7183
7184 2004-11-18  Martin Baulig  <martin@ximian.com>
7185
7186         * ecore.cs (TypeExpr.ResolveType): Removed.
7187         (Expression.ResolveAsTypeTerminal): We always return a fully
7188         resolved `TypeExpr', so we can just access its `Type'.
7189
7190         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7191
7192 2004-11-17  Martin Baulig  <martin@ximian.com>
7193
7194         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7195         sure we don't return any unresolved TypeExpr's.
7196         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7197         a `TypeExpr'.
7198         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7199
7200         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7201         unresolved `ConstructedType's.
7202
7203 2004-11-17  Martin Baulig  <martin@ximian.com>
7204
7205         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7206
7207 2004-11-17  Martin Baulig  <martin@ximian.com>
7208
7209         * ecore.cs
7210         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7211
7212         * decl.cs (DeclSpace.ResolveType): Removed.
7213         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7214
7215 2004-11-17  Martin Baulig  <martin@ximian.com>
7216
7217         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7218         direction, like FindMembers() does.  Fixes #69546, testcase is in
7219         test-315.cs.    
7220
7221 2004-11-16  Martin Baulig  <martin@ximian.com>
7222
7223         This is based on a patch from Marek Safar, see bug #69082.
7224         Fixes bugs #63705 and #67130.
7225
7226         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7227         method; create a MemberCache for an interface type and cache the
7228         result.
7229
7230         * decl.cs (IMemberContainer.ParentContainer): Removed.
7231         (IMemberContainer.ParentCache): New property.
7232         (MemberCache.SetupCacheForInterface): Removed.
7233         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7234         to create a cache for an interface's "parent".
7235
7236         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7237         interfaces too.
7238
7239 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7240
7241         * statement.cs: Avoid adding bools to a hashtable.
7242
7243 2004-11-15  Martin Baulig  <martin@ximian.com>
7244
7245         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7246
7247 2004-11-11  Martin Baulig  <martin@ximian.com>
7248
7249         * typemanager.cs (TypeManager.GetMethodName): New method.
7250
7251         * class.cs (MethodData.Define): Include the generic arity in the
7252         name of an explicit interface; also add it to the method name.
7253
7254         * pending.cs (PendingImplementation.InterfaceMethod): The method
7255         name now includes the generic arity.
7256
7257 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7258
7259         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7260         calling an unsafe method from a safe location.
7261
7262 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7263
7264         Fix #69167
7265         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7266
7267 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7268
7269         * namespace.cs (VerifyUsing): use GetPartialName instead of
7270         ToString. 
7271
7272 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7273
7274         * statement.cs (Return.Resolve): Fix regression in typo: if
7275         `in_exc', we have to request a NeedReturnLabel, this was a typo
7276         introduced in the anonymous method check-in.  Fixes #69131.
7277
7278         * Indexers were using the ShortName when defining themselves,
7279         causing a regression in the compiler bootstrap when applying the
7280         patch from 2004-11-02 (first part), now they use their full name
7281         and the bug is gone.
7282
7283 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7284
7285         * driver.cs: Strip the path from the names of embedded resources. Fixes
7286         #68519.
7287
7288 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7289
7290         Fix error message regression: cs0104-2.cs.
7291         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7292         (AliasEntry.Resolve): Update.
7293         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7294         'silent' flag.
7295         (RootContext.LookupType): Update.
7296
7297 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7298
7299         * cs-parser.jay: Add support for handling accessor modifiers
7300         * class: Add support port accessor modifiers and error checking,
7301         define PropertyMethod.Define as virtual (not abstract anymore)
7302         * ecore.cs: Add checking for proeprties access with access modifiers
7303         * iterators.cs: Modify Accessor constructor call based in the modified
7304         constructor
7305 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7306
7307         * expression.cs (StringConcat): Handle being called twice,
7308         as when we have a concat in a field init with more than two
7309         ctors in the class
7310
7311 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7312
7313         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7314         special case explicit implementations, we should always produce
7315         the .property or .event declaration.
7316         
7317         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7318         since it will not return correct data if people use this
7319         unresolved in the presence of using statements (see test-313).
7320
7321         * class.cs (MethodData.Define): If we are an explicit interface
7322         implementation, set the method name to the full name of the
7323         interface plus the name of the method.  
7324
7325         Notice that using the method.MethodName.GetFullName() does not
7326         work, as it will only contain the name as declared on the source
7327         file (it can be a shorthand in the presence of using statements)
7328         and not the fully qualifed type name, for example:
7329
7330         using System;
7331
7332         class D : ICloneable {
7333                 object ICloneable.Clone ()  {
7334                 }
7335         }
7336
7337         Would produce a method called `ICloneable.Clone' instead of
7338         `System.ICloneable.Clone'.
7339
7340         * namespace.cs (Alias.Resolve): Use GetPartialName.
7341         
7342 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7343
7344         * cs-parser.jay: Add error 1055 report.
7345
7346 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7347
7348         * assign.cs (Assign.DoResolve): Only do the transform of
7349         assignment into a New if the types are compatible, if not, fall
7350         through and let the implicit code deal with the errors and with
7351         the necessary conversions. 
7352
7353 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7354
7355         * cs-parser.jay: Add error 1031 report.
7356
7357         * cs-tokenizer.cs: Add location for error 1038.
7358
7359 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7360
7361         * cs-parser.jay: Add error 1016 report.
7362
7363 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7364
7365         * cs-parser.jay: Add errors 1575,1611 report.
7366
7367 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7368
7369         * cs-parser.jay: Add error 1001 report.
7370
7371 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7372
7373         Fix #68850
7374         * attribute.cs (GetMarshal): Add method argument for
7375         caller identification.
7376
7377         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7378         agument for GetMarshal and RuntimeMissingSupport.
7379
7380 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7381
7382         * attribute.cs (ExtractSecurityPermissionSet): Removed
7383         TypeManager.code_access_permission_type.
7384
7385         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7386
7387 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7388
7389         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7390         for obsolete use of a variable here.   Fixes regression on errors
7391         cs0619-25 and cs0619-26.
7392
7393 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7394
7395         Fix #62358, implemented security attribute encoding.
7396
7397         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7398         Tests permitted SecurityAction for assembly or other types.
7399         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7400         data from SecurityPermissionAttribute to PermisionSet class.
7401
7402         * class.cs (ApplyAttributeBuilder): Added special handling
7403         for System.Security.Permissions.SecurityAttribute based types.
7404
7405         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7406         special handling for System.Security.Permissions.SecurityAttribute
7407         based types.
7408
7409         * enum.cs (ApplyAttributeBuilder): Added special handling
7410         for System.Security.Permissions.SecurityAttribute based types.
7411
7412         * parameter.cs (ApplyAttributeBuilder): Added special handling
7413         for System.Security.Permissions.SecurityAttribute based types.
7414
7415         * rootcontext.cs: Next 2 core types.
7416
7417         * typemanager.cs (TypeManager.security_permission_attr_type):
7418         Built in type for the SecurityPermission Attribute.
7419         (code_access_permission_type): Build in type.
7420
7421 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7422
7423         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7424         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7425         all of this information into
7426         EmitContext.EmitCapturedVariableInstance.
7427         
7428         * codegen.cs (EmitCapturedVariableInstance): move here the
7429         funcionality of emitting an ldarg.0 in the presence of a
7430         remapping.   This centralizes the instance emit code.
7431
7432         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7433         then emit a load of this: it means that we have reached the
7434         topmost ScopeInfo: the one that contains the pointer to the
7435         instance of the class hosting the anonymous method.
7436
7437         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7438         captures to the topmost CaptureContext.
7439
7440 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7441
7442         * expression.cs (LocalVariableReference): Move the knowledge about
7443         the iterators into codegen's EmitCapturedVariableInstance.
7444
7445 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7446
7447         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7448         all code paths return a value from an anonymous method (it is the
7449         same as the 161 error, but for anonymous methods).
7450
7451 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7452
7453         The introduction of anonymous methods in the compiler changed
7454         various ways of doing things in the compiler.  The most
7455         significant one is the hard split between the resolution phase
7456         and the emission phases of the compiler.
7457
7458         For instance, routines that referenced local variables no
7459         longer can safely create temporary variables during the
7460         resolution phase: they must do so from the emission phase,
7461         since the variable might have been "captured", hence access to
7462         it can not be done with the local-variable operations from the runtime.
7463         
7464         * statement.cs 
7465
7466         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7467         is a toplevel block.
7468
7469         (ToplevelBlock): A new kind of Block, these are the blocks that
7470         are created by the parser for all toplevel method bodies.  These
7471         include methods, accessors and anonymous methods.
7472
7473         These contain some extra information not found in regular blocks:
7474         A pointer to an optional CaptureContext (for tracking captured
7475         local variables and parameters).  A pointer to the parent
7476         ToplevelBlock.
7477         
7478         (Return.Resolve): Catch missmatches when returning a value from an
7479         anonymous method (error 1662).
7480         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7481         phase.
7482
7483         (Break.Resolve): ditto.
7484
7485         (SwitchLabel): instead of defining the labels during the
7486         resolution phase, we now turned the public ILLabel and ILLabelCode
7487         labels into methods called GetILLabelCode() and GetILLabel() that
7488         only define the label during the Emit phase.
7489
7490         (GotoCase): Track the SwitchLabel instead of the computed label
7491         (its contained therein).  Emit the code by using
7492         SwitchLabel.GetILLabelCode ().
7493
7494         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7495         whether the Local has been captured or not.
7496
7497         (LocalInfo.IsCaptured): New property, used to tell whether the
7498         local has been captured.
7499         
7500         * anonymous.cs: Vastly updated to contain the anonymous method
7501         support.
7502
7503         The main classes here are: CaptureContext which tracks any
7504         captured information for a toplevel block and ScopeInfo used to
7505         track the activation frames for various local variables.   
7506
7507         Each toplevel block has an optional capture context associated
7508         with it.  When a method contains an anonymous method both the
7509         toplevel method and the anonymous method will create a capture
7510         context.   When variables or parameters are captured, they are
7511         recorded on the CaptureContext that owns them, for example:
7512
7513         void Demo () {
7514              int a;
7515              MyDelegate d = delegate {
7516                  a = 1;
7517              }
7518         }
7519
7520         Here `a' will be recorded as captured on the toplevel
7521         CapturedContext, the inner captured context will not have anything
7522         (it will only have data if local variables or parameters from it
7523         are captured in a nested anonymous method.
7524
7525         The ScopeInfo is used to track the activation frames for local
7526         variables, for example:
7527
7528         for (int i = 0; i < 10; i++)
7529                 for (int j = 0; j < 10; j++){
7530                    MyDelegate d = delegate {
7531                         call (i, j);
7532                    }
7533                 }
7534
7535         At runtime this captures a single captured variable `i', but it
7536         captures 10 different versions of the variable `j'.  The variable
7537         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7538         recorded on a child.  
7539
7540         The toplevel ScopeInfo will also track information like the `this'
7541         pointer if instance variables were referenced (this is necessary
7542         as the anonymous method lives inside a nested class in the host
7543         type of the method). 
7544
7545         (AnonymousMethod): Expanded to track the Toplevel, implement
7546         `AnonymousMethod.Compatible' to tell whether an anonymous method
7547         can be converted to a target delegate type. 
7548
7549         The routine now also produces the anonymous method content
7550
7551         (AnonymousDelegate): A helper class that derives from
7552         DelegateCreation, this is used to generate the code necessary to
7553         produce the delegate for the anonymous method that was created. 
7554
7555         * assign.cs: API adjustments for new changes in
7556         Convert.ImplicitStandardConversionExists.
7557
7558         * class.cs: Adjustments to cope with the fact that now toplevel
7559         blocks are of type `ToplevelBlock'. 
7560
7561         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7562         insteda of standard blocks.
7563
7564         Flag errors if params arguments are passed to anonymous methods.
7565
7566         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7567         `CurrentAnonymousMethod' which points to the current Anonymous
7568         Method.  The variable points to the AnonymousMethod class that
7569         holds the code being compiled.  It is set in the new EmitContext
7570         created for the anonymous method.
7571
7572         (EmitContext.Phase): Introduce a variable and an enumeration to
7573         assist in enforcing some rules about when and where we are allowed
7574         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7575         only one that enfonces this right now).
7576
7577         (EmitContext.HaveCaptureInfo): new helper method that returns
7578         whether we have a CapturedContext initialized.
7579
7580         (EmitContext.CaptureVariable): New method used to register that a
7581         LocalInfo must be flagged for capturing. 
7582
7583         (EmitContext.CapturedParameter): New method used to register that a
7584         parameters must be flagged for capturing. 
7585         
7586         (EmitContext.CapturedField): New method used to register that a
7587         field must be flagged for capturing. 
7588
7589         (EmitContext.HaveCapturedVariables,
7590         EmitContext.HaveCapturedFields): Return whether there are captured
7591         variables or fields. 
7592
7593         (EmitContext.EmitMethodHostInstance): This is used to emit the
7594         instance for the anonymous method.  The instance might be null
7595         (static methods), this (for anonymous methods that capture nothing
7596         and happen to live side-by-side with the current method body) or a
7597         more complicated expression if the method has a CaptureContext.
7598
7599         (EmitContext.EmitTopBlock): Routine that drives the emission of
7600         code: it will first resolve the top block, then emit any metadata
7601         and then emit the code.  The split is done so that we can extract
7602         any anonymous methods and flag any captured variables/parameters.
7603         
7604         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7605         during this phase, the ILGenerator should not be used as labels
7606         and local variables declared here might not be accessible to any
7607         code that is part of an anonymous method.  
7608
7609         Exceptions to this include the temporary variables that are
7610         created by some statements internally for holding temporary
7611         variables. 
7612         
7613         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7614         metadata for a cb
7615
7616         (EmitContext.TemporaryReturn): This method is typically called
7617         from the Emit phase, and its the only place where we allow the
7618         ReturnLabel to be defined other than the EmitMeta.  The reason is
7619         that otherwise we would have to duplicate a lot of logic in the
7620         Resolve phases of various methods that today is on the Emit
7621         phase. 
7622
7623         (EmitContext.NeedReturnLabel): This no longer creates the label,
7624         as the ILGenerator is not valid during the resolve phase.
7625
7626         (EmitContext.EmitThis): Extended the knowledge in this class to
7627         work in anonymous methods in addition to iterators. 
7628
7629         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7630         code is necessary on the stack to access the instance to a local
7631         variable (the variable will be accessed as a field).
7632
7633         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7634         EmitContext.EmitAddressOfParameter): Routines to support
7635         parameters (not completed at this point). 
7636         
7637         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7638         will also remove the parameters.
7639
7640         * convert.cs (Convert): Define a `ConstantEC' which points to a
7641         null.  This is just to prefity some code that uses
7642         ImplicitStandardConversion code and do not have an EmitContext
7643         handy.
7644
7645         The idea is to flag explicitly that at that point in time, it is
7646         known that the conversion will not trigger the delegate checking
7647         code in implicit conversions (which requires a valid
7648         EmitContext). 
7649
7650         Everywhere: pass new EmitContext parameter since
7651         ImplicitStandardConversionExists now requires it to check for
7652         anonymous method conversions. 
7653
7654         (Convert.ImplicitStandardConversionExists): If the type of an
7655         expression is the anonymous_method_type, and the type is a
7656         delegate, we invoke the AnonymousMethod.Compatible method to check
7657         whether an implicit conversion is possible. 
7658
7659         (Convert.ImplicitConversionStandard): Only do implicit method
7660         group conversions if the language level is not ISO_1.
7661
7662         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7663         MethodInfo for the Invoke method.  used by Delegate and
7664         AnonymousDelegate.
7665
7666         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7667         method conversions if the target type is a delegate.
7668
7669         Removed extra debugging nops.
7670
7671         (LocalVariableReference): Turn the `local_info' into a public
7672         field. 
7673
7674         Add `prepared' field, the same hack used for FieldExprs to cope
7675         with composed assignments, as Local variables do not necessarily
7676         operate purely on the stack as they used to: they can be captured
7677         fields. 
7678
7679         Add `temp' for a temporary result, like fields.
7680
7681         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7682
7683         It now copes with Local variables that are captured and emits the
7684         proper instance variable to load it from a field in the captured
7685         case. 
7686
7687         (ParameterReference.DoResolveBase): During the resolve phase,
7688         capture parameters if we are in an anonymous method.
7689
7690         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7691         anonymous method, use the EmitContext helper routines to emit the
7692         parameter reference.
7693
7694         * iterators.cs: Set RemapToProxy to true/false during the
7695         EmitDispose class.
7696
7697         * parameters.cs (GetParameterByName): New helper method. 
7698
7699         * typemanager.cs (anonymous_method_type) a new type that
7700         represents an anonyous method.  This is always an internal type,
7701         used as a fencepost to test against the anonymous-methodness of an
7702         expression. 
7703         
7704 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7705
7706         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7707         561 report.
7708         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7709
7710 2004-11-10  Martin Baulig  <martin@ximian.com>
7711
7712         * expression.cs (Invocation.BetterFunction): If two methods have
7713         equal parameter types, but only one of them is generic, the
7714         non-generic one wins.
7715         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7716         instance; just use `Type.IsValueType' to determine whether
7717         something is a struct or not.
7718         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7719         so we can be called multiple times.
7720
7721 2004-11-10  Martin Baulig  <martin@ximian.com>
7722
7723         * generic.cs (TypeParameter.DefineConstraints): New public method.
7724         (TypeParameter.CheckAccessLevel): Override this and return true.
7725         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7726         override ResolveType() anymore.
7727         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7728
7729 2004-11-10  Martin Baulig  <martin@ximian.com>
7730
7731         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7732         call DeclSpace.ResolveNestedType() on it.
7733
7734 2004-11-10  Martin Baulig  <martin@ximian.com>
7735
7736         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7737         non-null, call ParameterModifier() on it.
7738
7739 2004-11-10  Martin Baulig  <martin@ximian.com>
7740
7741         * iterators.cs
7742         (Iterators): Added `current_type' and `this_type' fields.
7743         (Iterators.DefineIterator): Create a new EmitContext and store it
7744         in `ec'; compute `this_type'.
7745
7746 2004-11-10  Martin Baulig  <martin@ximian.com>
7747
7748         * typemanager.cs
7749         (TypeManager.IsPrivateAccessible): New public method.
7750         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7751
7752 2004-11-10  Martin Baulig  <martin@ximian.com>
7753
7754         * class.cs (TypeContainer.DefineType): Call
7755         TypeBuilder.DefineGenericParameters() before resolving the type
7756         parameters.
7757         (MethodData.parent_method): New protected field.
7758         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7759         (MethodData.Define): Compute `parent_method'.
7760
7761         * decl.cs
7762         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7763         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7764         (DeclSpace.ec): New protected field; store the EmitContext here.
7765         (DeclSpace.EmitContext): New public property.
7766         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7767         (DeclSpace.ResolveNestedType): New public method.
7768         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7769         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7770         (DeclSpace.FamilyAccessible): Likewise.
7771         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7772         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7773         EmitContext.
7774
7775         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7776         field.
7777
7778         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7779         (Enum.Emit): Don't create a new EmitContext.
7780
7781 2004-10-18  Martin Baulig  <martin@ximian.com>
7782
7783         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7784         `Type' directly, but call ResolveType() on it.
7785         (Catch.Resolve): Likewise.
7786         (Foreach.Resolve): Likewise.
7787
7788 2004-10-18  Martin Baulig  <martin@ximian.com>
7789
7790         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7791         `Type' directly, but call ResolveType() on it.
7792         (Probe.DoResolve): Likewise.
7793         (ArrayCreation.LookupType): Likewise.
7794         (TypeOf.DoResolve): Likewise.
7795         (SizeOf.DoResolve): Likewise.
7796
7797 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7798
7799         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7800         the ResolveType.
7801
7802 2004-10-17  John Luke  <john.luke@gmail.com>
7803
7804         * class.cs (Operator.GetSignatureForError): use CSharpName
7805
7806         * parameter.cs (Parameter.GetSignatureForError): Returns
7807         correct name even if was not defined.
7808
7809 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7810
7811         Fix #65816.
7812         * class.cs (TypeContainer.EmitContext): New property.
7813         (DefineNestedTypes): Create an emitcontext for each part.
7814         (MethodCore.DoDefineParameters): Use container's emitcontext.
7815         Pass type array to InternalParameters.
7816         (MemberBase.DoDefine): Use container's emitcontext.
7817         (FieldMember.Define): Likewise.
7818         (Event.Define): Likewise.
7819         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7820         Pass type array to InternalParameters.
7821         (SetIndexerMethod.GetParameterInfo): Likewise.
7822         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7823         * delegate.cs (Define): Pass emitcontext to
7824         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7825         array to InternalParameters.
7826         * expression.cs (ParameterReference.DoResolveBase): Pass
7827         emitcontext to GetParameterInfo.
7828         (ComposedCast.DoResolveAsTypeStep): Remove check on
7829         ec.ResolvingTypeTree.
7830         * parameter.cs (Parameter.Resolve): Change argument to
7831         EmitContext.  Use ResolveAsTypeTerminal.
7832         (Parameter.GetSignature): Change argument to EmitContext.
7833         (Parameters.ComputeSignature): Likewise.
7834         (Parameters.ComputeParameterTypes): Likewise.
7835         (Parameters.GetParameterInfo): Likewise.
7836         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7837         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7838         * support.cs (InternalParameters..ctor): Remove variant that takes
7839         a DeclSpace.
7840         * typemanager.cs (system_intptr_expr): New.
7841         (InitExpressionTypes): Initialize it.
7842
7843 2004-10-12  Chris Toshok  <toshok@ximian.com>
7844
7845         * cs-parser.jay: fix location for try_statement and catch_clause.
7846
7847 2004-10-18  Martin Baulig  <martin@ximian.com>
7848
7849         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7850         `Type' directly, but call ResolveType() on it.
7851         (MemberBase.DoDefine): Likewise.
7852
7853         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7854         `Type' directly, but call ResolveType() on it.
7855         (ComposedCast.DoResolveAsTypeStep): Likewise.
7856
7857         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7858         `Type' directly, but call ResolveType() on it.
7859
7860 2004-10-17  John Luke  <john.luke@gmail.com>
7861
7862         * class.cs (Operator.GetSignatureForError): use CSharpName
7863
7864         * parameter.cs (Parameter.GetSignatureForError): Returns
7865         correct name even if was not defined.
7866
7867 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7868
7869         Fix #65816.
7870         * class.cs (TypeContainer.EmitContext): New property.
7871         (DefineNestedTypes): Create an emitcontext for each part.
7872         (MethodCore.DoDefineParameters): Use container's emitcontext.
7873         Pass type array to InternalParameters.
7874         (MemberBase.DoDefine): Use container's emitcontext.
7875         (FieldMember.Define): Likewise.
7876         (Event.Define): Likewise.
7877         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7878         Pass type array to InternalParameters.
7879         (SetIndexerMethod.GetParameterInfo): Likewise.
7880         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7881         * delegate.cs (Define): Pass emitcontext to
7882         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7883         array to InternalParameters.
7884         * expression.cs (ParameterReference.DoResolveBase): Pass
7885         emitcontext to GetParameterInfo.
7886         (ComposedCast.DoResolveAsTypeStep): Remove check on
7887         ec.ResolvingTypeTree.
7888         * parameter.cs (Parameter.Resolve): Change argument to
7889         EmitContext.  Use ResolveAsTypeTerminal.
7890         (Parameter.GetSignature): Change argument to EmitContext.
7891         (Parameters.ComputeSignature): Likewise.
7892         (Parameters.ComputeParameterTypes): Likewise.
7893         (Parameters.GetParameterInfo): Likewise.
7894         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7895         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7896         * support.cs (InternalParameters..ctor): Remove variant that takes
7897         a DeclSpace.
7898         * typemanager.cs (system_intptr_expr): New.
7899         (InitExpressionTypes): Initialize it.
7900
7901 2004-10-12  Chris Toshok  <toshok@ximian.com>
7902
7903         * cs-parser.jay: fix location for try_statement and catch_clause.
7904
7905 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7906
7907         More DeclSpace.ResolveType avoidance.
7908         * decl.cs (MemberCore.InUnsafe): New property.
7909         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7910         with newly created EmitContext.
7911         (FieldMember.Define): Likewise.
7912         * delegate.cs (Delegate.Define): Likewise.
7913         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7914         only if normal name-lookup fails.
7915         (TypeExpr.DoResolve): Enable error-checking.
7916         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7917         (SizeOf.DoResolve): Likewise.
7918         (ComposedCast.DoResolveAsTypeStep): Likewise.
7919         (StackAlloc.DoResolve): Likewise.
7920         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7921         (Block.Unsafe): New property.
7922         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7923         (Unsafe): Set 'unsafe' flag of contained block.
7924         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7925         (Fixed.Resolve): Likewise.
7926         (Catch.Resolve): Likewise.
7927         (Using.ResolveLocalVariableDecls): Likewise.
7928         (Foreach.Resolve): Likewise.
7929
7930 2004-10-05  John Luke <john.luke@gmail.com>
7931
7932         * cs-parser.jay: add location to error CS0175
7933
7934 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7935
7936         * ecore.cs (Expression.Constantity): Add support for turning null
7937         into a constant.
7938
7939         * const.cs (Const.Define): Allow constants to be reference types
7940         as long as the value is Null.
7941
7942 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7943
7944         * namespace.cs (NamespaceEntry.Using): No matter which warning
7945         level is set, check if this namespace name has already been added.
7946
7947 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7948
7949         * expression.cs: reftype [!=]= null should always use br[true,false].
7950         # 67410
7951
7952 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7953
7954         Fix #67108
7955         * attribute.cs: Enum conversion moved to 
7956         GetAttributeArgumentExpression to be applied to the all
7957         expressions.
7958
7959 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7960
7961         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7962         * class.c (TypeContainer.DefineType): Flag error if
7963         base types aren't accessible due to access permissions.
7964         * decl.cs (DeclSpace.ResolveType): Move logic to
7965         Expression.ResolveAsTypeTerminal.
7966         (DeclSpace.ResolveTypeExpr): Thin layer over
7967         Expression.ResolveAsTypeTerminal.
7968         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7969         Refactor code into NestedAccess.  Use it.
7970         (DeclSpace.NestedAccess): New.
7971         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7972         argument to silence errors.  Check access permissions.
7973         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7974         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7975         (Cast.DoResolve): Likewise.
7976         (New.DoResolve): Likewise.
7977         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7978         (TypeOf.DoResolve): Likewise.
7979
7980         * expression.cs (Invocation.BetterConversion): Return the Type of
7981         the better conversion.  Implement section 14.4.2.3 more faithfully.
7982         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7983         section 14.4.2.2 explicit.
7984         (Invocation.OverloadResolve): Update.
7985         (Invocation): Remove is_base field.
7986         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7987         (Invocation.Emit): Likewise.
7988
7989 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7990
7991         * cs-parser.jay: Reverted 642 warning fix.
7992
7993 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7994
7995         Fix bug #66615
7996         * decl.cs (FindMemberWithSameName): Indexer can have more than
7997         1 argument.
7998
7999 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8000
8001         * expression.cs (LocalVariableReference.DoResolveLValue):
8002         Do not report warning 219 for out values.
8003         (EmptyExpression.Null): New member to avoid extra allocations.
8004
8005 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8006
8007         * cs-parser.jay: Fix wrong warning 642 report.
8008
8009         * cs-tokenizer.cs (CheckNextToken): New helper;
8010         Inspect next character if is same as expected.
8011
8012 2004-09-23  Martin Baulig  <martin@ximian.com>
8013
8014         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8015         (Convert.ImplicitReferenceConversionExists): Likewise.
8016
8017 2004-11-09  Raja R Harinath  <rharinath@novell.com>
8018
8019         * Makefile (DISTFILES): Comment out a few missing files.
8020
8021 2004-10-29  Raja R Harinath  <rharinath@novell.com>
8022
8023         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8024         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
8025         (gmcs.exe): Invoke bootstrap-libs.
8026         (clean-local): Clean the net_2_0_bootstrap profile too.
8027         (PROGRAM_INSTALL_DIR): New.
8028         (install-local): Use it.
8029
8030 2004-10-13  Martin Baulig  <martin@ximian.com>
8031
8032         * generic.cs (TypeManager.InflatedConstraints): New nested class.
8033         (TypeParameter.DefineType): If we're a method type parameter and
8034         that method is overriding something, "inflate" its constraints.
8035
8036 2004-10-12  Martin Baulig  <martin@ximian.com>
8037
8038         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8039         and have type arguments, create and resolve a ConstructedType.
8040
8041 2004-10-12  Martin Baulig  <martin@ximian.com>
8042
8043         * decl.cs (MemberCache.FindMemberToOverride): Use
8044         TypeManager.IsEqual() to compare the parameters and Type.Equals()
8045         to compare the invocationType.
8046
8047         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8048         When comparing two type parameters, only do the signature-only
8049         comparision for method type parameters.
8050
8051 2004-10-11  Martin Baulig  <martin@ximian.com>
8052
8053         * report.cs: Don't make --fatal abort on warnings, we have
8054         -warnaserror for that.
8055
8056 2004-10-11  Martin Baulig  <martin@ximian.com>
8057
8058         * typemanager.cs
8059         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8060         (TypeManager.IsEqual): Call ourself recursively instead of using
8061         Type.IsEqual(). 
8062
8063 2004-10-11  Martin Baulig  <martin@ximian.com>
8064
8065         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8066         on our own type parameters, not on the ones we inherit from a containing
8067         class.
8068
8069         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8070         the comparision.
8071
8072         * generic.cs (TypeParameter.Define): We may only be called once.
8073
8074         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8075         instead of TypeManager.IsEqual().
8076
8077 2004-09-28  Martin Baulig  <martin@ximian.com>
8078
8079         * generic.cs
8080         (GenericConstraints.EffectiveBaseClass): New public property.
8081         (TypeParameter.GenericConstraints): New public property.
8082         (ConstructedType.CheckConstraints): Improved.
8083
8084         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8085         (Convert.TypeParameterConversion): New private method; use this in
8086         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8087         for all conversions related to type parameters.
8088
8089 2004-09-24  Martin Baulig  <martin@ximian.com>
8090
8091         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8092         type parameter conversions for type parameters which are known to
8093         be reference types.
8094
8095 2004-09-24  Martin Baulig  <martin@ximian.com>
8096
8097         * generic.cs (GenericConstraints): Added `IsReferenceType' and
8098         `IsValueType' properties.
8099
8100         * support.cs (ReflectionConstraints): Use
8101         Type.GetGenericParameterConstraints() instead of the old hack.
8102
8103 2004-09-24  Martin Baulig  <martin@ximian.com>
8104
8105         * generic.cs (GenericConstraints): Moved here and made it an
8106         abstract class.
8107
8108         * support.cs (GenericConstraints): Moved to generic.cs.
8109
8110 2004-09-24  Martin Baulig  <martin@ximian.com>
8111
8112         * support.cs
8113         (ReflectionConstraints): Un-nested this class and made it public.
8114
8115         * typemanager.cs
8116         (TypeManager.GetTypeParameterConstraints): New public method.
8117         (TypeManager.HasConstructorConstraint): Use the attributes.
8118
8119 2004-09-24  Martin Baulig  <martin@ximian.com>
8120
8121         * support.cs (GenericConstraints): Replaced `HasConstructor',
8122         `IsReferenceType' and `IsValueType' with `Attributes'.
8123         (ReflectionParameters.ReflectionConstraints): Removed the Create()
8124         method and made the .ctor public.
8125
8126         * generic.cs (Constraints.Attributes): New public property.
8127         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8128         `IsReferenceType' -> `HasReferenceTypeConstraint' and
8129         `IsValueType' -> `HasValueTypeConstraint'.
8130
8131 2004-09-23  Martin Baulig  <martin@ximian.com>
8132
8133         * generic.cs (Constraints): Reflect latest runtime changes.
8134
8135 2004-09-23  Martin Baulig  <martin@ximian.com>
8136
8137         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8138         (Convert.ImplicitReferenceConversionExists): Likewise.
8139
8140 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8141
8142         * class.cs (Operator.Define): Add error 448 and 559 report.
8143         
8144 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8145
8146         * class.cs (MemberBase.IsTypePermitted): New protected
8147         method for checking error CS0610.
8148
8149 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8150
8151         * class.cs (TypeContainer.HasExplicitLayout): New property
8152         Returns whether container has StructLayout attribute set Explicit.
8153         (FieldMember): New abstract class for consts and fields.
8154         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8155         (Field): Reuse FieldMember.
8156
8157         * const.cs (Const): Reuse FieldMember.
8158
8159         * rootcontext.cs: EmitConstants call moved to class.
8160
8161 2004-09-22  Martin Baulig  <martin@ximian.com>
8162
8163         Marek and me just fixed one of our oldest bugs: #28562 :-)
8164
8165         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8166
8167         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8168         we're an EnumConstant, just return that.
8169         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8170         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8171         to get the value which'll actually be written into the attribute.
8172         However, we have to use GetValue() to access the attribute's value
8173         in the compiler.        
8174
8175 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8176
8177         * constant.cs (Constant.IsNegative): New abstract property
8178         IsNegative.
8179
8180         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8181         (StackAlloc.DoResolve): Reused IsNegative.
8182
8183 2004-09-22  Martin Baulig  <martin@ximian.com>
8184
8185         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8186         public method; like LookupTypeContainer, but also works for
8187         generic instances.
8188
8189         * report.cs (Report.SymbolRelatedToPreviousError): Use
8190         TypeManager.LookupGenericTypeContainer().       
8191
8192 2004-09-22  Martin Baulig  <martin@ximian.com>
8193
8194         Thanks to Peter Sestoft for this bug report.
8195
8196         * expression.cs (Conditional): If both the `trueExpr' and the
8197         `falseExpr' is a NullLiteral, return a NullLiteral.
8198
8199 2004-09-22  Martin Baulig  <martin@ximian.com>
8200
8201         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8202         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8203         for the "get_Current" call.
8204
8205 2004-09-21  Martin Baulig  <martin@ximian.com>
8206
8207         * convert.cs (Convert.ImplicitReferenceConversion): When
8208         converting to an interface type, first check whether we're
8209         converting from a reference type.
8210
8211 2004-09-14  Martin Baulig  <martin@ximian.com>
8212
8213         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8214
8215 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8216
8217         Fixed bug #61902
8218         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8219         called and is obsolete then this member suppress message
8220         when call is inside next [Obsolete] method or type.
8221
8222         * expression.cs: Use TestObsoleteMethodUsage member.
8223
8224 2004-09-14  Martin Baulig  <martin@ximian.com>
8225
8226         * genericparser.cs: Removed.
8227
8228 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8229
8230         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8231
8232 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8233
8234         * attribute.cs (Attribute.Resolve): Add error 653 report.
8235
8236         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8237         report.
8238         (Method.ApplyAttributeBuilder): Add error 685 report.
8239         (Operator.Define): Add error 564 report.
8240
8241         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8242
8243         * expression.cs (Invocation.DoResolve): Add error
8244         245 and 250 report.
8245
8246         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8247         error 674 report.
8248
8249 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8250
8251         * class.cs (ConstructorInitializer.Resolve):
8252         Wrong error number (515->516).
8253
8254 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8255
8256         * class.cs (Indexer.Define): Add error 631 report.
8257
8258 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8259
8260         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8261
8262 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8263
8264         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8265
8266 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8267
8268         * cs-parser.jay: Added error CS0241 report.
8269
8270 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8271
8272         * cs-parser.jay (fixed_statement): Introduce a scope for the
8273         declaration in the 'fixed' statement.
8274
8275 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8276
8277         * cs-parser.jay: Added CS0230 error report.
8278
8279 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8280
8281         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8282
8283 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8284
8285         * expression.cs (Argument.Resolve): Added error CS0192 and
8286         CS0199 report.
8287
8288 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8289
8290         C# 2.0 #pragma warning feature
8291
8292         * cs-tokenizer.cs (PreProcessPragma): New method; 
8293         Handles #pragma directive.
8294
8295         * report.cs (WarningRegions): New class; Support
8296         class for #pragma warning directive. It tests whether
8297         warning is enabled for a given line.
8298
8299 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8300
8301         * const.cs: Add more descriptive error report, tahnks to
8302         Sebastien. 
8303
8304 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8305
8306         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8307
8308 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8309
8310         * expression.cs: Apply patch from Ben: Remove dead code from
8311         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8312         as that code just threw an exception anwyays.
8313
8314         * const.cs: Remove the call to the turnintoconstant, for details
8315         see bug: #63144
8316         
8317         * literal.cs: The type of the null-literal is the null type;  So
8318         we use a placeholder type (literal.cs:System.Null, defined here)
8319         for it.
8320
8321         * expression.cs (Conditional.DoResolve): Remove some old code that
8322         is no longer needed, conversions have been fixed.
8323
8324         (ArrayCreationExpression.DoResolve): Return false if we fail to
8325         resolve the inner expression.
8326
8327 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8328
8329         Fix test-290.cs.
8330         * cs-parser.jay (delegate_declaration): Record a delegate
8331         declaration as a type declaration.
8332         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8333
8334 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8335
8336         * parameter.cs: Do not crash if the type can not be resolved. 
8337
8338         * expression.cs: Report errors with unsafe pointers, fixes #64896
8339
8340 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8341
8342         * expression.cs: Pointer arith always needs to do a conv.i
8343         if the operand is a long. fix 65320
8344
8345 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8346
8347         Fixed cs0619-37.cs, cs0619-38.cs
8348
8349         * enum.cs (GetObsoleteAttribute): Removed.
8350
8351         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8352         on Enum member is double staged. The first is tested member
8353         and then enum.
8354
8355 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8356
8357         Fixed #56986, #63631, #65231
8358
8359         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8360         adds member to name container.
8361         (TypeContainer.AddToTypeContainer): New method, adds type to
8362         name container.
8363         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8364         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8365         AddOperator): Simplified by reusing AddToMemberContainer.
8366         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8367         instead of field.
8368         (Method.CheckForDuplications): Fixed implementation to test all
8369         possibilities.
8370         (MemberBase): Detection whether member is explicit interface
8371         implementation is now in constructor.
8372         (MemberBase.UpdateMemberName): Handles IndexerName.
8373         (Accessor): Changed to keep also location information.
8374         (AbstractPropertyEventMethod): Is derived from MemberCore.
8375         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8376         will be emited or not.
8377         (PropertyBase.AreAccessorsDuplicateImplementation):
8378         Tests whether accessors are not in collision with some method.
8379         (Operator): Is derived from MethodCore to simplify common
8380         operations.
8381
8382         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8383         must be performed.
8384         (DeclSpace.AddToContainer): Adds the member to defined_names
8385         table. It tests for duplications and enclosing name conflicts.
8386
8387         * enum.cs (EnumMember): Clean up to reuse the base structures
8388
8389 2004-09-03  Martin Baulig  <martin@ximian.com>
8390
8391         Merged latest changes into gmcs.  Please keep this comment in
8392         here, it makes it easier for me to see what changed in MCS since
8393         the last time I merged.
8394
8395 2004-09-03  Martin Baulig  <martin@ximian.com>
8396
8397         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8398         into TypeContainer, to make partial classes work again.
8399
8400 2004-09-03  Martin Baulig  <martin@ximian.com>
8401
8402         * rootcontext.cs (RootContext.V2): Removed.
8403
8404 2004-03-23  Martin Baulig  <martin@ximian.com>
8405
8406         * expression.cs (Invocation.OverloadResolve): Added `bool
8407         may_fail' argument and use it instead of the Location.IsNull() hack.
8408
8409 2004-09-09  Martin Baulig  <martin@ximian.com>
8410
8411         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8412
8413 2004-09-09  Martin Baulig  <martin@ximian.com>
8414
8415         * generic.cs (TypeParameter.DefineType): Added support for
8416         explicit interface methods.
8417
8418 2004-09-09  Martin Baulig  <martin@ximian.com>
8419
8420         * README.Changes: New document.  Started to list important changes
8421         between MCS and GMCS here.
8422
8423 2004-09-08  Martin Baulig  <martin@ximian.com>
8424
8425         * class.cs
8426         (TypeContainer.CheckRecursiveDefinition): New protected method.
8427         (TypeContainer.DefineType): Move the CS0146 check into
8428         CheckRecursiveDefinition().     
8429
8430 2004-09-06  Martin Baulig  <martin@ximian.com>
8431
8432         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8433         types for the constructor constraint.
8434
8435 2004-09-03  Martin Baulig  <martin@ximian.com>
8436
8437         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8438         into TypeContainer, to make partial classes work again.
8439
8440 2004-09-03  Martin Baulig  <martin@ximian.com>
8441
8442         * rootcontext.cs (RootContext.V2): Removed.
8443
8444 2004-03-23  Martin Baulig  <martin@ximian.com>
8445
8446         * expression.cs (Invocation.OverloadResolve): Added `bool
8447         may_fail' argument and use it instead of the Location.IsNull() hack.
8448
8449 2004-09-03  Martin Baulig  <martin@ximian.com>
8450
8451         Merged latest changes into gmcs.  Please keep this comment in
8452         here, it makes it easier for me to see what changed in MCS since
8453         the last time I merged.
8454
8455 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8456
8457         Fix #61128.
8458         * expression.cs (BetterConversion): Don't allow either conversion 
8459         to be null.  Remove redundant implicit conversion test when 'q ==
8460         null' -- when this function is invoked, we already know that the
8461         implicit conversion exists.
8462         (BetterFunction): Assume that 'best' is non-null.  Remove
8463         redundant reimplementation of IsApplicable when 'best' is null.
8464         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8465         number of arguments.
8466         (IsAncestralType): Extract from OverloadResolve.
8467         (OverloadResolve): Make robust to the MethodGroupExpr being
8468         unsorted.  Implement all the logic of Section 14.5.5.1, and
8469         support overloading of methods from multiple applicable types.
8470         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8471
8472         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8473         (RealError, Warning): Append type of report to related symbol.
8474
8475 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8476
8477         * enum.cs: Fixed CLS-Compliance checks for enum members.
8478         Error tests cs3008-8.cs, cs3014-8.cs
8479
8480 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8481
8482         Fixed bug #62342, #63102
8483         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8484         like ImplementMethod.
8485
8486 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8487
8488         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8489         Fixed bug #65170.
8490
8491 2004-09-02  Martin Baulig  <martin@ximian.com>
8492
8493         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8494         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8495         on the MethodBase.
8496
8497 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8498
8499         C# 2.0 Static classes implemented
8500
8501         * class.cs (TypeContainer): instance_constructors,
8502         initialized_fields, initialized_static_fields,
8503         default_constructor, base_inteface_types are protected to be
8504         accessible from StaticClass.
8505         (TypeContainer.DefineDefaultConstructor): New virtual method
8506         for custom default constructor generating
8507         (StaticClass): New class to handle "Static classes" feature.
8508
8509         * cs-parser.jay: Handle static keyword on class like instance
8510         of StaticClass.
8511
8512         * driver.cs: Added "/langversion" command line switch with two
8513         options (iso-1, default).
8514
8515 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8516
8517         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8518
8519 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8520
8521         * delegate.cs: Style.
8522
8523 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8524
8525         * delegate.cs: Add seperate instance expr field for miguel.
8526
8527 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8528
8529         * PointerArithmetic (Resolve): make sure we are not doing
8530         pointer arith on void*. Also, make sure we are resolved
8531         by not setting eclass until resolve.
8532
8533         All callers: Make sure that PointerArithmetic gets resolved.
8534
8535 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8536
8537         * ArrayCreation (LookupType): If the type does not resolve 
8538         to an array, give an error.
8539
8540 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8541
8542         * statement.cs (Try.Resolve): Fixed bug #64222
8543
8544 2004-08-27  Martin Baulig  <martin@ximian.com>
8545
8546         * class.cs
8547         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8548         crash here.     
8549
8550 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8551
8552         * ecore.cs (Constantify): Get underlying type via
8553         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8554         Windows in special cases.
8555
8556 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8557
8558         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8559         for obtaining also private methods.
8560         (GetRemoveMethod): Used GetRemoveMethod (true)
8561         for obtaining also private methods.
8562
8563 2004-09-02  Martin Baulig  <martin@ximian.com>
8564
8565         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8566         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8567         on the MethodBase.
8568
8569 2004-08-27  Martin Baulig  <martin@ximian.com>
8570
8571         * class.cs
8572         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8573         crash here.     
8574
8575 2004-08-25  Martin Baulig  <martin@ximian.com>
8576
8577         * support.cs (ReflectionParameters..ctor): If this is a generic
8578         method, retrieve and store its type parameters.
8579         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8580         (ReflectionParameters.GenericConstraints): The argument specifies
8581         the type parameter, not the method parameter.
8582         (InternalParameters.GenericConstraints): Likewise.
8583
8584         * generic.cs (TypeParameter.DefineType): Correctly handle
8585         constraints wrt. generic methods in interfaces and their
8586         implementations.        
8587
8588 2004-08-24  Martin Baulig  <martin@ximian.com>
8589
8590         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8591         (Constraints.IsSubclassOf): New internal method.
8592
8593         * typemanager.cs (TypeManager.FindMembers): Added special support
8594         for GenericTypeParameterBuilder's.      
8595         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8596         type parameters.
8597
8598 2004-08-24  Martin Baulig  <martin@ximian.com>
8599
8600         * typemanager.cs
8601         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8602         this for accessibility checks.
8603         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8604         IsNestedFamilyAccessible.
8605         (TypeManager.IsSubclassOf): New method, do what the name actually
8606         says.   
8607
8608 2004-08-24  Martin Baulig  <martin@ximian.com>
8609
8610         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8611         as a SimpleName, include the generic arity.
8612
8613 2004-08-24  Martin Baulig  <martin@ximian.com>
8614
8615         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8616         MethodAttributes.HideBySig for operators.
8617
8618 2004-08-23  Martin Baulig  <martin@ximian.com>
8619
8620         Back to the old error reporting system :-)
8621
8622         * report.cs (Message): Removed.
8623         (Report.MessageData, ErrorData, WarningData): Removed.
8624         (Report.Error, Warning): Back to the old system.
8625
8626 2004-08-23  Martin Baulig  <martin@ximian.com>
8627
8628         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8629
8630         * class.cs (TypeContainer.ParentContainer): New public virtual
8631         method; replaces the explicit interface implementation.
8632         (ClassPart.ParentContainer): Override.
8633
8634 2004-08-23  Martin Baulig  <martin@ximian.com>
8635
8636         * statement.cs (Switch): Added support for constant switches; see
8637         #59428 or test-285.cs.
8638
8639 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8640
8641         Fixed bug #62740.
8642         * statement.cs (GetEnumeratorFilter): Removed useless
8643         logic because C# specs is strict. GetEnumerator must be
8644         public.
8645
8646 2004-08-22  Martin Baulig  <martin@ximian.com>
8647
8648         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8649         a switch and may break, reset the barrier.  Fixes #59867.
8650
8651 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8652
8653         CLS-Compliance speed up (~5% for corlib)
8654
8655         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8656         New method. Tests container for CLS-Compliant names
8657
8658         * class.cs (TypeContainer.VerifyClsName): New method.
8659         Checks whether container name is CLS Compliant.
8660         (Constructor): Implements IMethodData.
8661
8662         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8663         low-case table for CLS Compliance test.
8664         (MemberCache.VerifyClsParameterConflict): New method.
8665         Checks method parameters for CS3006 error.
8666
8667         * enum.cs (EnumMember): Is derived from MemberCore.
8668         (Enum.VerifyClsName): Optimized for better performance.
8669
8670 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8671
8672         * report.cs: Renamed Error_T to Error and changed all
8673         references.
8674
8675 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8676
8677         * class.cs (TypeContainer.IndexerArrayList): New inner class
8678         container for indexers.
8679         (TypeContainer.DefaultIndexerName): New constant for default
8680         indexer name. Replaced all "Item" with this constant.
8681         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8682
8683         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8684         DefaultMemberAttribute constructor.
8685
8686 2004-08-05  Martin Baulig  <martin@ximian.com>
8687
8688         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8689         Fix bug #59429.
8690
8691 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8692
8693         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8694         multi platforms problem.
8695
8696         * compiler.csproj: Included shared files.
8697
8698 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8699
8700         Fix bug 60333, 55971 in the more general way
8701         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8702         Added arg_type argument for constant conversion.
8703         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8704
8705 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8706
8707         Fix bug #59760
8708         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8709         OperatorArrayList, MethodCoreArrayList for typecontainer
8710         containers. Changed class member types to these new types.
8711         (MethodArrayList.DefineMembers): Added test for CS0659.
8712
8713 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8714
8715         * cfold.cs: Synchronize the folding with the code in expression.cs
8716         Binary.DoNumericPromotions for uint operands.
8717
8718         * attribute.cs: Revert patch from Raja, it introduced a regression
8719         while building Blam-1.2.1 (hard to isolate a test case).
8720
8721 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8722
8723         Fix for #55382
8724         * class.cs:
8725         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8726         name collision.
8727         (MethodCore.parent_method): New member. The method we're overriding
8728         if this is an override method.
8729         (MethodCore.CheckBase): Moved from Method class and made common.
8730         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8731         private.
8732         (MethodCore.CheckForDuplications): New abstract method. For custom
8733         member duplication search in a container
8734         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8735         method and its return type.
8736         (Event.conflict_symbol): New member. Symbol with same name in the
8737         parent class.
8738
8739         * decl.cs:
8740         (MemberCache.FindMemberWithSameName): New method. The method
8741         is looking for conflict with inherited symbols.
8742
8743 2004-08-04  Martin Baulig  <martin@ximian.com>
8744
8745         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8746
8747         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8748
8749 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8750
8751         * report.cs (Message): New enum for better error, warning reference in
8752         the code.
8753         (MessageData): New inner abstract class. It generally handles printing of
8754         error and warning messages.
8755         Removed unused Error, Warning, Message methods.
8756
8757 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8758
8759         Fix for cs0592-8.cs test
8760         * attribute.cs
8761         (Attributable.ValidAttributeTargets): Made public.
8762         (Attribute.ExplicitTarget): New member for explicit target value.
8763         (Attribute.CheckTargets): Now we translate explicit attribute
8764         target to Target here.
8765
8766 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8767
8768         * ecore.cs (MethodGroupExpr): new IsBase property.
8769
8770         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8771
8772         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8773         rather than an instance expr.
8774
8775         (DelegateCreation.Emit): Use the method group rather than
8776         the instance expression. Also, if you have base.Foo as the
8777         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8778
8779         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8780
8781         (NewDelegate.DoResolve): Only check for the existance of Invoke
8782         if the method is going to be needed. Use MethodGroupExpr.
8783
8784         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8785
8786         * expression.cs: For pointer arith., make sure to use
8787         the size of the type, not the size of the pointer to
8788         the type.
8789
8790 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8791
8792         Fix for #60722
8793         * class.cs (Class): Added error CS0502 test.
8794
8795 2004-08-03  John Luke  <jluke@cfl.rr.com>
8796             Raja R Harinath  <rharinath@novell.com>
8797
8798         Fix for #60997.
8799         * attribute.cs (Attribute.complained_before): New flag.
8800         (Attribute.ResolveType, Attribute.Resolve),
8801         (Attribute.DefinePInvokeMethod): Set it.
8802         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8803         
8804 2004-08-03  Martin Baulig  <martin@ximian.com>
8805
8806         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8807         use a user-defined operator; we still need to do numeric
8808         promotions in case one argument is a builtin type and the other
8809         one has an implicit conversion to that type.  Fixes #62322.
8810
8811 2004-08-18  Martin Baulig  <martin@ximian.com>
8812
8813         * class.cs (Method.Define): Use the correct method name when
8814         creating the MethodBuilder for a generic method.
8815
8816 2004-08-17  Martin Baulig  <martin@ximian.com>
8817
8818         * generic.cs (Constraints): Support type parameter constraints.
8819
8820 2004-08-16  Martin Baulig  <martin@ximian.com>
8821
8822         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8823         (Token.GENERIC_DIMENSION): New token; this is returned if we
8824         encounter an unbound generic type in a typeof() expression.
8825
8826         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8827         this token is only generated while parsing a typeof() expression.
8828         (typeof_expression): Removed the old unbound_type hack.
8829
8830         * generic.cs (TypeArguments.IsUnbound): New public property.
8831
8832         * decl.cs (MemberName): Added support for unbound types.
8833
8834 2004-08-14  Martin Baulig  <martin@ximian.com>
8835
8836         * typemanager.cs
8837         (TypeManager.IsEqualGenericInstance): New static method.
8838         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8839         just used to check accessibility, so follow the rules of 26.1.6.        
8840
8841         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8842         ConstructedType instead of a TypeExpression if we have type arguments.
8843
8844         * cs-parser.jay (typeof_expression): Support unbound generic types.
8845
8846         * ecore.cs (UnboundTypeExpression): New public class.
8847
8848 2004-08-12  Martin Baulig  <martin@ximian.com>
8849
8850         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8851         TypeManager.IsEqual() rather than `=='.
8852
8853         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8854         generic instances as well.
8855
8856 2004-08-12  Martin Baulig  <martin@ximian.com>
8857
8858         * expression.cs (Invocation.InferType): We can only infer method
8859         type parameters.  Fixes #62647.
8860
8861 2004-08-11  Martin Baulig  <martin@ximian.com>
8862
8863         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8864         before resolving the base classes.
8865
8866 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8867
8868         * Makefile: install .mdb file too.
8869
8870 2004-08-05  Martin Baulig  <martin@ximian.com>
8871
8872         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8873         initializer, the current type is just the TypeBuilder, not the
8874         instantiated generic type.
8875         (FieldExpr.IsFieldInitializer): New public property.
8876
8877 2004-08-04  Martin Baulig  <martin@ximian.com>
8878
8879         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8880
8881         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8882
8883 2004-08-03  Martin Baulig  <martin@ximian.com>
8884
8885         * class.cs (MethodData.Define): If we're an explicit
8886         implementation, remove the generic arity from the type name.
8887
8888 2004-08-03  Martin Baulig  <martin@ximian.com>
8889
8890         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8891         use a user-defined operator; we still need to do numeric
8892         promotions in case one argument is a builtin type and the other
8893         one has an implicit conversion to that type.  Fixes #62322.
8894
8895 2004-08-02  Martin Baulig  <martin@ximian.com>
8896
8897         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8898         `TypeExpr[]' array.
8899         (TypeContainer.GetClassBases): Return the unexpanded list of
8900         interfaces; we expand them later.
8901         (TypeContainer.DefineType): After creating the TypeBuilder, call
8902         TypeManager.ExpandInterfaces() to get an expanded and resolved
8903         list of interfaces.
8904
8905         * ecore.cs (TypeExpr.GetInterfaces): Removed
8906
8907         * generics.cs (Constraints.InterfaceConstraints): Remove.
8908         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8909         register the interface constraints.
8910
8911         * typemanager.cs
8912         (TypeManager.AddUserType): Removed the `ifaces' argument.
8913         (TypeManager.AddTypeParameter): Likewise.
8914         (TypeManager.AddUserInterface): Removed, was unused.
8915         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8916         `TypeExpr[]' array for the interfaces.
8917         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8918         has been defined, returns a list of the resolved interfaces types.
8919         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8920         (TypeManager.GetExplicitInterfaces): Likewise.  
8921
8922 2004-08-02  Martin Baulig  <martin@ximian.com>
8923
8924         * expression.cs (Invocation.EmitCall): If we're invoking a method
8925         on a type parameter, use the new `Constrained' prefix opcode.
8926
8927 2004-08-02  Martin Baulig  <martin@ximian.com>
8928
8929         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8930         (LocalInfo.IsThis): New public property.
8931         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8932
8933 2004-08-01  Martin Baulig  <martin@ximian.com>
8934
8935         * class.cs (TypeContainer.GetClassBases): Don't set the default
8936         here since we may get called from GetPartialBases().
8937         (TypeContainer.DefineType): If GetClassBases() didn't return a
8938         parent, use the default one.
8939
8940 2004-07-30  Martin Baulig  <martin@ximian.com>
8941
8942         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8943
8944         * class.cs (SourceMethod): New public class, derive from the
8945         symbol writer's ISourceMethod.
8946         (Method): Use the new symbol writer API.
8947
8948         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8949         as argument and use the new symbol writer.
8950
8951         * location.cs
8952         (SourceFile): Implement the symbol writer's ISourceFile.
8953         (Location.SymbolDocument): Removed.
8954         (Location.SourceFile): New public property.
8955
8956         * symbolwriter.cs: Use the new symbol writer API.
8957
8958 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8959
8960         * Makefile (install-local): Remove.  Functionality moved to
8961         executable.make.
8962
8963 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8964
8965         * Makefile: Install mcs.exe.config file together with mcs.exe.
8966         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8967         correct runtime version.
8968         
8969 2004-07-25  Martin Baulig  <martin@ximian.com>
8970
8971         * class.cs
8972         (TypeContainer.RegisterOrder): Removed, this was unused.
8973         (TypeContainer, interface_order): Removed.
8974         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8975         TypeContainer as argument since we can also be called with a
8976         `PartialContainer' for a partial class/struct/interface.
8977         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8978         of checking whether we're an `Interface' - we could be a
8979         `PartialContainer'.
8980         (PartialContainer.Register): Override; call
8981         AddClass()/AddStruct()/AddInterface() on our parent.
8982
8983         * cs-parser.jay (interface_member_declaration): Add things to the
8984         `current_container', not the `current_class'.
8985
8986         * rootcontext.cs (RegisterOrder): The overloaded version which
8987         takes an `Interface' was unused, removed.
8988
8989         * typemanager.cs (TypeManager.LookupInterface): Return a
8990         `TypeContainer', not an `Interface'.
8991         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8992         contain a `PartialContainer' for an interface, so check it's
8993         `Kind' to figure out what it is.
8994
8995 2004-07-25  Martin Baulig  <martin@ximian.com>
8996
8997         * class.cs (Class.DefaultTypeAttributes): New public constant.
8998         (Struct.DefaultTypeAttributes): Likewise.
8999         (Interface.DefaultTypeAttributes): Likewise.
9000         (PartialContainer.TypeAttr): Override this and add the
9001         DefaultTypeAttributes.
9002
9003 2004-07-25  Martin Baulig  <martin@ximian.com>
9004
9005         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9006         we can just use the `Parent' field instead.
9007
9008 2004-07-25  Martin Baulig  <martin@ximian.com>
9009
9010         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9011
9012 2004-07-25  Martin Baulig  <martin@ximian.com>
9013
9014         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9015         our parts before defining any methods.
9016         (TypeContainer.VerifyImplements): Make this virtual.
9017         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9018         on our PartialContainer.
9019
9020 2004-07-25  Martin Baulig  <martin@ximian.com>
9021
9022         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9023
9024         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9025         argument, we can just use the `Parent' field instead.
9026
9027         * class.cs
9028         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9029         (MemberBase.DoDefine): Likewise.
9030
9031 2004-07-24  Martin Baulig  <martin@ximian.com>
9032
9033         * decl.cs (MemberCore.Parent): New public field.
9034         (DeclSpace.Parent): Moved to MemberCore.
9035
9036         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9037         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9038         parent's .ctor.
9039         (FieldBase, Field, Operator): Likewise.
9040         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9041         (EventField, Event): Likewise.
9042
9043 2004-07-23  Martin Baulig  <martin@ximian.com>
9044
9045         * class.cs (PartialContainer): New public class.
9046         (ClassPart): New public class.
9047         (TypeContainer): Added support for partial classes.
9048         (TypeContainer.GetClassBases): Splitted some of the functionality
9049         out into GetNormalBases() and GetPartialBases().
9050
9051         * cs-tokenizer.cs (Token.PARTIAL): New token.
9052         (Tokenizer.consume_identifier): Added some hacks to recognize
9053         `partial', but only if it's immediately followed by `class',
9054         `struct' or `interface'.
9055
9056         * cs-parser.jay: Added support for partial clases.
9057
9058 2004-07-23  Martin Baulig  <martin@ximian.com>
9059
9060         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9061         a `DeclSpace' and also made it readonly.
9062         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9063         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9064         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9065
9066         * cs-parser.jay: Pass the `current_class', not the
9067         `current_container' (at the moment, this is still the same thing)
9068         to a new Method, Property, Event, Indexer or Constructor.
9069
9070 2004-07-23  Martin Baulig  <martin@ximian.com>
9071
9072         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9073         and removed the `current_interface' one.
9074         (struct_declaration, class_declaration, interface_declaration):
9075         Set `current_class' to the newly created class/struct/interface;
9076         set their `Bases' and call Register() before parsing their body.
9077
9078 2004-07-23  Martin Baulig  <martin@ximian.com>
9079
9080         * class.cs (Kind): New public enum.
9081         (TypeContainer): Made this class abstract.
9082         (TypeContainer.Kind): New public readonly field.
9083         (TypeContainer.CheckDef): New public method; moved here from
9084         cs-parser.jay.
9085         (TypeContainer.Register): New public abstract method.
9086         (TypeContainer.GetPendingImplementations): New public abstract
9087         method.
9088         (TypeContainer.GetClassBases): Removed the `is_class' and
9089         `is_iface' parameters.
9090         (TypeContainer.DefineNestedTypes): Formerly known as
9091         DoDefineType().
9092         (ClassOrStruct): Made this class abstract.
9093
9094         * tree.cs (RootTypes): New public type. 
9095
9096 2004-07-20  Martin Baulig  <martin@ximian.com>
9097
9098         * tree.cs (Tree.RecordNamespace): Removed.
9099         (Tree.Namespaces): Removed.
9100
9101         * rootcontext.cs (RootContext.IsNamespace): Removed.
9102
9103         * cs-parser.jay (namespace_declaration): Just create a new
9104         NamespaceEntry here.
9105
9106 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
9107
9108         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9109         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9110         entry to make sure it runs in the correct runtime version.
9111         
9112 2004-07-18  Martin Baulig  <martin@ximian.com>
9113
9114         * generic.cs (ConstructedType.CheckConstraints): Improved
9115         constraints checking.
9116
9117 2004-07-18  Martin Baulig  <martin@ximian.com>
9118
9119         * expression.cs (Invocation.BetterMethod): Call
9120         TypeManager.TypeToCoreType() on all types and removed my previous
9121         hack; we're already doig the right thing here.
9122
9123 2004-07-17  Martin Baulig  <martin@ximian.com>
9124
9125         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9126
9127 2004-07-16  Martin Baulig  <martin@ximian.com>
9128
9129         * iterators.cs: Added generics support.
9130
9131 2004-07-16  Martin Baulig  <martin@ximian.com>
9132
9133         * iterators.cs: Rewrote this.  We're now using one single Proxy
9134         class for both the IEnumerable and the IEnumerator interface and
9135         `Iterator' derives from Class so we can use the high-level API.
9136
9137         * class.cs (TypeContainer.AddIterator): New method.
9138         (TypeContainer.DoDefineType): New protected virtual method, which
9139         is called from DefineType().
9140         (TypeContainer.DoDefineMembers): Call DefineType() and
9141         DefineMembers() on all our iterators.
9142         (TypeContainer.Emit): Call Emit() on all our iterators.
9143         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9144
9145         * codegen.cs (EmitContext.CurrentIterator): New public field.
9146
9147 2004-07-15  Martin Baulig  <martin@ximian.com>
9148
9149         * typemanager.cs
9150         (TypeManager.not_supported_exception_type): New type.   
9151
9152 2004-07-14  Martin Baulig  <martin@ximian.com>
9153
9154         * typemanager.cs
9155         (TypeManager.generic_ienumerable_type): New type.
9156         (TypeManager.generic_ienumerator_type): New type.
9157
9158         * rootcontext.cs
9159         (RootContext.interfaces_first_stage): Added
9160         "System.Collections.Generic.IEnumerator`1" and
9161         "System.Collections.Generic.IEnumerable`1".     
9162
9163 2004-07-14  Martin Baulig  <martin@ximian.com>
9164
9165         * iterators.cs: Use real error numbers.
9166
9167 2004-07-14  Martin Baulig  <martin@ximian.com>
9168
9169         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9170         requires this to be a System.Collection.IEnumerable and not a
9171         class implementing that interface.
9172         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9173
9174 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9175
9176         * class.cs: Fixed previous fix, it broke some error tests.
9177
9178 2004-07-12  Martin Baulig  <martin@ximian.com>
9179
9180         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9181         Fixes #61293.
9182
9183 2004-07-14  Martin Baulig  <martin@ximian.com>
9184
9185         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9186         an exclamation mark (!) for the generic arity to reflect the
9187         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9188
9189 2004-07-13  Martin Baulig  <martin@ximian.com>
9190
9191         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9192         specifiers being part of a type argument.
9193
9194 2004-07-13  Martin Baulig  <martin@ximian.com>
9195
9196         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9197         name for generic types.
9198
9199 2004-07-13  Martin Baulig  <martin@ximian.com>
9200
9201         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9202         bit to fix #60119.
9203
9204 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9205
9206         * assign.cs (LocalTemporary): Add new argument: is_address,If
9207         `is_address' is true, then the value that we store is the address
9208         to the real value, and not the value itself.
9209         
9210         * ecore.cs (PropertyExpr): use the new local temporary
9211         stuff to allow us to handle X.Y += z (where X is a struct)
9212
9213 2004-07-08  Martin Baulig  <martin@ximian.com>
9214
9215         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9216         not always return, just like we're doing in Using.Resolve().
9217
9218 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9219
9220         * cs-parser.jay (fixed_statement): flag this as Pinned.
9221
9222 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9223
9224         * typemanager.cs (TypeManager): Removed MakePinned method, this
9225         mechanism is replaced with the .NET 2.x compatible mechanism of
9226         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9227
9228         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9229         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9230         `IsFixed' property which has a different meaning.
9231
9232 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9233
9234         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9235         visible from inside a nested class, not just the names of the
9236         immediately enclosing class.
9237         Fix for bug #60730.
9238
9239 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9240
9241         * expression.cs (BetterConversion): Remove buggy special-case
9242         handling of "implicit constant expression conversions".  At this
9243         point, we already know that the conversion is possible -- we're
9244         only checking to see which is better.
9245
9246 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9247
9248         * cs-parser.jay: Added error CS0210 test.
9249
9250 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9251
9252         * cs-parser.jay: Added error CS0134 test.
9253
9254 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9255
9256         Fix bug #52507
9257         * cs-parser.jay: Added error CS0145 test.
9258
9259 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9260
9261         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9262
9263 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9264         
9265         * expression.cs (StackAlloc.Resolve): The argument may not
9266         be a constant; deal with this case.
9267         
9268 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9269
9270         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9271         GetIndexerAttributeValue.
9272         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9273
9274         * class.cs (Indexer.Define): Added error tests for CS0415,
9275         CS0609.
9276
9277 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9278
9279         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9280         property code.
9281
9282 2004-06-23  Martin Baulig  <martin@ximian.com>
9283
9284         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9285         neither return nor throw, reset the barrier as well.  Fixes #60457.
9286
9287 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9288
9289         * class.cs : EventAttributes is now set to None by default.
9290           This fixes bug #60459.
9291
9292 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9293
9294         Fix bug #60219
9295         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9296         Don't throw exception but return null (it's sufficient now).
9297
9298 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9299
9300         * typemanager.cs (GetArgumentTypes): Faster implementation.
9301
9302 2004-06-18  Martin Baulig  <martin@ximian.com>
9303
9304         * attribute.cs (Attribute.Resolve): Check whether we're an
9305         EmptyCast which a Constant child.  Fixes #60333.
9306
9307 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9308
9309         * statement.cs (EmitCollectionForeach): Account for the fact that
9310         not all valuetypes are in areas which we can take the address of.
9311         For these variables, we store to a temporary variable. Also, make
9312         sure that we dont emit a `callvirt' on a valuetype method.
9313
9314 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9315
9316         * expression.cs (StackAlloc.DoReSolve): Added test for
9317         negative parameter (CS0247).
9318
9319 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9320
9321         Fix bug #59792
9322         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9323
9324 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9325
9326         Fix bug #59781
9327         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9328         ulong.
9329
9330 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9331
9332         Fix bug #58254 & cs1555.cs, cs1556.cs
9333         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9334
9335 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9336
9337         * cs-parser.jay: Added error CS1669 test for indexers.
9338
9339 2004-06-18  Martin Baulig  <martin@ximian.com>
9340
9341         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9342         argument.  Fixes #60441.
9343
9344 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9345         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9346         The name needs to have the actual name of the method in order
9347         for other tests (such as the one in OverloadResolve for Invoke
9348         on a delegate) to work. As well, it does not really help
9349         error reporting because the method group had multiple methods.
9350         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9351         Make profiling work.
9352         
9353 2004-06-13  Martin Baulig  <martin@ximian.com>
9354
9355         * cs-parser.jay: Don't allow generic attributes.
9356
9357 2004-06-13  Martin Baulig  <martin@ximian.com>
9358
9359         * class.cs (MemberBase.DoDefineBase): New protected method.
9360         (MemberBase.DoDefine): Compute the `flags' in the new
9361         DoDefineBase() which must be called first.
9362         (Method.Define): Call DoDefineBase() first so we have the flags
9363         when defining the generic method.
9364
9365         * cs-parser.jay (interface_method_declaration): Support generic methods.
9366
9367 2004-06-13  Martin Baulig  <martin@ximian.com>
9368
9369         * decl.cs (TypeName): Removed.
9370         (MemberName): Removed TypeName and MemberNow; now we just have
9371         MemberName.
9372
9373         * cs-parser.jay: Don't distinguish between type arguments and type
9374         parameters in the grammar and simplified the rules a bit.  The
9375         reduce/reduce conflicts are now gone (except the one we inherited
9376         from mcs).
9377
9378 2004-06-11  Martin Baulig  <martin@ximian.com>
9379
9380         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9381         call this twice: for params and varargs methods.
9382
9383 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9384
9385         * class.cs:
9386         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9387
9388 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9389
9390         * attribute.cs (Attribute.GetValidTargets): Made public.
9391
9392         * class.cs: 
9393         (AbstractPropertyEventMethod): New class for better code sharing.
9394         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9395         CS1667 report.
9396         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9397
9398 2004-06-09  Martin Baulig  <martin@ximian.com>
9399
9400         * cs-parser.jay: Removed a reduce/reduce conflict.
9401
9402 2004-06-03  Martin Baulig  <martin@ximian.com>
9403
9404         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9405         GetSimpleName() and return a SimpleName.
9406
9407         * ecore.cs (SimpleName.Arguments): New public field.
9408         (SimpleName): Added overloaded ctor which takes an additional
9409         TypeArguments argument.
9410         (SimpleName.SimpleNameResolve): Added support for generic methods.
9411         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9412         formerly in MemberAccess.DoResolve(), but we also need it in
9413         SimpleNameResolve().
9414
9415         * expression.cs (MemberAccess.DoResolve): Use the new
9416         MethodGroupExpr.ResolveGeneric().       
9417
9418 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9419
9420         * decl.cs: If possible, use lookuptypedirect here. We can only do
9421         this if there is no `.' after the namespace. Avoids using
9422         LookupType, which does lots of slow processing.
9423         (FindNestedType) New method, does what it says :-).
9424         * namespace.cs: use LookupTypeDirect.
9425         * rootcontext.cs: use membercache, if possible.
9426         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9427
9428 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9429
9430         * expression.cs:
9431         According to the spec, 
9432
9433         In a member access of the form E.I, if E is a single identifier,
9434         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9435         field, property, localvariable, or parameter with the same type as
9436         the meaning of E as a type-name (§3.8), then both possible
9437         meanings of E are permitted.
9438
9439         We did not check that E as a simple-name had the same type as E as
9440         a type name.
9441
9442         This trivial check gives us 5-7% on bootstrap time.
9443
9444 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9445
9446         * expression.cs (Invocation.OverloadResolve): Avoid the
9447         use of hashtables and boxing here by allocating on demand.
9448
9449 2004-05-30  Martin Baulig  <martin@ximian.com>
9450
9451         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9452         we're doing a silent lookup.  Don't try to lookup nested types in
9453         TypeManager.object_type (thanks to Ben Maurer).
9454
9455 2004-05-30  Martin Baulig  <martin@ximian.com>
9456
9457         Committing a patch from Ben Maurer.
9458
9459         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9460
9461 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9462
9463         * convert.cs: add a trivial cache for overload operator resolution.
9464
9465 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9466
9467         * attribute.cs
9468         (AttributeTester.GetObsoleteAttribute): Returns instance of
9469         ObsoleteAttribute when type is obsolete.
9470
9471         * class.cs
9472         (TypeContainer.VerifyObsoleteAttribute): Override.
9473         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9474         (MethodCode.VerifyObsoleteAttribute): Override.
9475         (MemberBase.VerifyObsoleteAttribute): Override.
9476
9477         * decl.cs
9478         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9479         and report proper error.
9480
9481         *delegate.cs
9482         (Delegate.VerifyObsoleteAttribute): Override.
9483
9484         * ecore.cs
9485         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9486         and report proper error.
9487         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9488
9489         * enum.cs
9490         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9491         and enum member.
9492
9493         * expression.cs
9494         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9495         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9496         Added test for ObsoleteAttribute.
9497
9498         * statement.cs
9499         (Catch): Derived from Statement.
9500
9501 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9502
9503         * decl.cs: If possible, use lookuptypedirect here. We can only do
9504         this if there is no `.' after the namespace. Avoids using
9505         LookupType, which does lots of slow processing.
9506         (FindNestedType) New method, does what it says :-).
9507         * namespace.cs: use LookupTypeDirect.
9508         * rootcontext.cs: use membercache, if possible.
9509         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9510
9511 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9512
9513         * expression.cs:
9514         According to the spec, 
9515
9516         In a member access of the form E.I, if E is a single identifier,
9517         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9518         field, property, localvariable, or parameter with the same type as
9519         the meaning of E as a type-name (§3.8), then both possible
9520         meanings of E are permitted.
9521
9522         We did not check that E as a simple-name had the same type as E as
9523         a type name.
9524
9525         This trivial check gives us 5-7% on bootstrap time.
9526
9527 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9528
9529         Fixed bug #59071 & cs0160.cs
9530         * statement.cs (Try.Resolve): Check here whether order of catch
9531         clauses matches their dependencies.
9532
9533 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9534
9535         Fixed bug #58624
9536         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9537         unsafe type.
9538
9539 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9540
9541         * expression.cs (Invocation.OverloadResolve): Avoid the
9542         use of hashtables and boxing here by allocating on demand.
9543
9544 2004-05-30  Martin Baulig  <martin@ximian.com>
9545
9546         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9547         we're doing a silent lookup.  Don't try to lookup nested types in
9548         TypeManager.object_type (thanks to Ben Maurer).
9549
9550 2004-05-30  Martin Baulig  <martin@ximian.com>
9551
9552         Committing a patch from Ben Maurer.
9553
9554         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9555
9556 2004-05-29  Martin Baulig  <martin@ximian.com>
9557
9558         * class.cs (IMethodData.ShouldIgnore): New method.
9559
9560         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9561         `Location' argument, we don't need it anywhere.  Use
9562         `IMethodData.ShouldIgnore ()' instead of
9563         `MethodData.GetMethodFlags ()'.
9564         (TypeManager.AddMethod): Removed.
9565         (TypeManager.AddMethod2): Renamed to AddMethod.
9566
9567 2004-05-29  Martin Baulig  <martin@ximian.com>
9568
9569         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9570
9571         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9572         converting from a class type S to an interface type and we already
9573         have an object on the stack, don't box it again.  Fixes #52578.
9574
9575 2004-05-29  Martin Baulig  <martin@ximian.com>
9576
9577         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9578         Added support for `params' parameters.  Fixes #59267.
9579
9580 2004-05-29  Martin Baulig  <martin@ximian.com>
9581
9582         * literal.cs (NullPointer): Provide a private .ctor which sets
9583         `type' to TypeManager.object_type.  Fixes #59048.
9584
9585 2004-05-29  Martin Baulig  <martin@ximian.com>
9586
9587         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9588         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9589
9590         * ecore.cs (EventExpr.instance_expr): Make the field private.
9591
9592 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9593
9594         Fixed bug #50080 & cs0214-2.cs
9595         * expression.cs (Cast.DoResolve): Check unsafe context here.
9596         
9597         * statement.cs (Resolve.DoResolve): Likewise.
9598
9599 2004-05-26  Martin Baulig  <martin@ximian.com>
9600
9601         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9602
9603         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9604         (RootContext.LookupType): Pass down the `silent' flag.
9605
9606 2004-05-25  Martin Baulig  <martin@ximian.com>
9607
9608         * expression.cs
9609         (MethodGroupExpr.IdenticalTypeName): New public property.
9610         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9611         expression actually refers to a type.
9612
9613 2004-05-25  Martin Baulig  <martin@ximian.com>
9614
9615         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9616         for #56176 and made it actually work.
9617
9618 2004-05-25  Martin Baulig  <martin@ximian.com>
9619
9620         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9621         (FieldExpr, PropertyExpr): Override and implement
9622         CacheTemporaries.  Fixes #52279.
9623
9624 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9625
9626         * location.cs: In the new compiler listing a file twice is a
9627         warning, not an error.
9628
9629 2004-05-24  Martin Baulig  <martin@ximian.com>
9630
9631         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9632         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9633
9634 2004-05-24  Martin Baulig  <martin@ximian.com>
9635
9636         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9637         walking the `using' list.  Fixes #53921.
9638
9639 2004-05-24  Martin Baulig  <martin@ximian.com>
9640
9641         * const.cs (Const.LookupConstantValue): Added support for
9642         EmptyCast's; fixes #55251.
9643
9644 2004-05-24  Martin Baulig  <martin@ximian.com>
9645
9646         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9647         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9648         which does the CS0135 check.  The reason is that we first need to
9649         check whether the variable actually exists.
9650
9651 2004-05-24  Martin Baulig  <martin@ximian.com>
9652
9653         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9654         than RootContext.LookupType() to find the explicit interface
9655         type.  Fixes #58584.
9656
9657 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9658
9659         * Makefile: Simplify.  Use executable.make.
9660         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9661
9662 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9663
9664         * decl.cs:
9665         * enum.cs:
9666         Use the invariant culture when doing String.Compare for CLS case
9667         sensitivity.
9668         
9669 2004-05-23  Martin Baulig  <martin@ximian.com>
9670
9671         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9672         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9673
9674         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9675
9676 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9677
9678         * class.cs (MemberBase.Define): Reuse MemberType member for 
9679         resolved type. Other methods can use it too.
9680
9681 2004-05-23  Martin Baulig  <martin@ximian.com>
9682
9683         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9684         the variable also exists in the current block (otherwise, we need
9685         to report a CS0103).  Fixes #58670.
9686
9687 2004-05-23  Martin Baulig  <martin@ximian.com>
9688
9689         * flowanalysis.cs (Reachability.Reachable): Compute this
9690         on-the-fly rather than storing it as a field.
9691
9692 2004-05-23  Martin Baulig  <martin@ximian.com>
9693
9694         * flowanalysis.cs (Reachability.And): Manually compute the
9695         resulting `barrier' from the reachability.      
9696        
9697 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9698
9699         Fix bug #57835
9700         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9701         instance of ObsoleteAttribute when symbol is obsolete.
9702
9703         * class.cs
9704         (IMethodData): Extended interface for ObsoleteAttribute support.
9705
9706 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9707
9708         * attribute.cs: Fix bug #55970
9709
9710 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9711
9712         Fix bug #52705
9713         * attribute.cs
9714         (GetObsoleteAttribute): New method. Creates the instance of
9715         ObsoleteAttribute.
9716         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9717         ObsoleteAttribute when member is obsolete.
9718         (AttributeTester.Report_ObsoleteMessage): Common method for
9719         Obsolete error/warning reporting.
9720
9721         * class.cs
9722         (TypeContainer.base_classs_type): New member for storing parent type.
9723
9724         * decl.cs
9725         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9726         for this MemberCore.
9727
9728 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9729
9730         * attribute.cs, const.cs: Fix bug #58590
9731
9732 2004-05-21  Martin Baulig  <martin@ximian.com>
9733
9734         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9735         out parameters if the end of the method is unreachable.  Fixes
9736         #58098. 
9737
9738 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9739
9740         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9741         Hari was right, why extra method.
9742
9743 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9744
9745         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9746
9747 2004-05-20  Martin Baulig  <martin@ximian.com>
9748
9749         * delegate.cs: Convert this file to Unix mode - like the original
9750         version in mcs is.
9751
9752 2004-05-20  Martin Baulig  <martin@ximian.com>
9753
9754         * attribute.cs: Convert this file to Unix mode - like the original
9755         version in mcs is.
9756
9757 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9758
9759        Fix bug #58688 (MCS does not report error when the same attribute
9760        is assigned twice)
9761
9762        * attribute.cs (Attribute.Emit): Distinction between null and default.
9763
9764 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9765
9766        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9767        of a top-level attribute without an attribute target.
9768        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9769        Make non-static.
9770        (Attribute.Conditional_GetConditionName), 
9771        (Attribute.Obsolete_GetObsoleteMessage): Update.
9772        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9773        part of ScanForIndexerName.
9774        (Attribute.CanIgnoreInvalidAttribute): New function.
9775        (Attribute.ScanForIndexerName): Move to ...
9776        (Attributes.ScanForIndexerName): ... here.
9777        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9778        (Attributes.Search): New internal variant that can choose not to
9779        complain if types aren't resolved.  The original signature now
9780        complains.
9781        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9782        complaints suppressed.
9783        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9784        only if it not useful.
9785        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9786        top-level for attributes that are shared between the assembly
9787        and a top-level class.
9788        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9789        * class.cs: Update to reflect changes.
9790        (DefineIndexers): Fuse loops.
9791        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9792        a couple more variants of attribute names.
9793
9794 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9795
9796         Fix bug #52585 (Implemented explicit attribute declaration)
9797
9798         * attribute.cs:
9799         (Attributable.ValidAttributeTargets): New abstract method. It gets
9800         list of valid attribute targets for explicit target declaration.
9801         (Attribute.Target): It holds target itself.
9802         (AttributeSection): Removed.
9803         (Attribute.CheckTargets): New method. It checks whether attribute
9804         target is valid for the current element.
9805
9806         * class.cs:
9807         (EventProperty): New class. For events that are declared like
9808         property (with add and remove accessors).
9809         (EventField): New class. For events that are declared like field.
9810         class.cs
9811
9812         * cs-parser.jay: Implemented explicit attribute target declaration.
9813
9814         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9815         Override ValidAttributeTargets.
9816
9817         * parameter.cs:
9818         (ReturnParameter): Class for applying custom attributes on 
9819         the return type.
9820         (ParameterAtribute): New class. Class for applying custom
9821         attributes on the parameter type.
9822
9823 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9824
9825         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9826         definitions. 
9827
9828         (Method): Allow UNSAFE here.
9829
9830         * modifiers.cs: Support unsafe reporting.
9831
9832 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9833
9834         * decl.cs: Fix bug #58478.
9835
9836 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9837
9838         * statement.cs: When checking for unreachable code on an EmptyStatement,
9839         set the location. Fixes bug #58488.
9840
9841 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9842
9843         * driver.cs: Add -pkg handling.
9844
9845         From Gonzalo: UseShelLExecute=false
9846
9847 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9848
9849         * attribute.cs:
9850         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9851         for attribute.
9852         (Attribute.IsClsCompliaceRequired): Moved to base for better
9853         accesibility.
9854         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9855         when attribute is AttributeUsageAttribute.
9856         (Attribute.GetValidTargets): Simplified.
9857         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9858         attribute for this type.
9859         (Attribute.ApplyAttributes): Method renamed to Emit and make
9860         non-static.
9861         (GlobalAttributeSection): New class for special handling of global
9862         attributes (assembly, module).
9863         (AttributeSection.Emit): New method.
9864
9865         * class.cs: Implemented Attributable abstract methods.
9866         (MethodCore.LabelParameters): Moved to Parameter class.
9867         (Accessor): Is back simple class.
9868         (PropertyMethod): Implemented Attributable abstract class.
9869         (DelegateMethod): Implemented Attributable abstract class.
9870         (Event): New constructor for disctintion between normal Event
9871         and Event with accessors.
9872
9873         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9874
9875         * codegen.cs, const.cs, decl.cs, delegate.cs:
9876         (CommonAssemblyModulClass): Implemented Attributable abstract class
9877         and simplified.
9878
9879         * enum.cs: Implement IAttributeSupport interface.
9880         (EnumMember): New class for emum members. Implemented Attributable
9881         abstract class
9882
9883         * parameter.cs:
9884         (ParameterBase): Is abstract.
9885         (ReturnParameter): New class for easier [return:] attribute handling.
9886
9887         * typemanager.cs: Removed builder_to_attr.
9888
9889 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9890
9891         Fix bug #57151.
9892         * attribute.cs (Attribute.GetPositionalValue): New function.
9893         * class.cs (TypeContainer.VerifyMembers): New function.
9894         (TypeContainer.Emit): Use it.
9895         (ClassOrStruct): New base class for Class and Struct.
9896         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9897         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9898         class.
9899         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9900         then each non-static field should have a FieldOffset attribute.
9901         Otherwise, none of the fields should have a FieldOffset attribute.
9902         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9903         and FieldOffset attributes.
9904         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9905         (TypeManager.field_offset_attribute_type): New core types.
9906         (TypeManager.InitCoreTypes): Initialize them.
9907
9908 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9909
9910         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9911         Return correct type.
9912         From bug #58270.
9913
9914 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9915
9916         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9917         be implicitly converted to ulong.
9918         
9919         * expression.cs: The logic for allowing operator &, | and ^ worked
9920         was wrong, it worked before because we did not report an error in
9921         an else branch.  Fixes 57895.
9922
9923         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9924         allow volatile fields to be reference types.
9925
9926 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9927
9928         * driver.cs: Add support for /debug-
9929
9930 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9931
9932         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9933         Add a 'complain' parameter to silence errors.
9934         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9935         silently overlooked type-resolutions.
9936         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9937         to reflect changes.
9938         (Attributes.Search): New function.
9939         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9940         (Attributes.GetAttributeFullName): Remove hack.
9941         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9942         Update to reflect changes.
9943         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9944         Use Attributes.Search instead of nested loops.
9945
9946 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9947
9948         * decl.cs:
9949         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9950         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9951         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9952
9953         * report.cs: (Report.Warning): Renamed to Warning_T because of
9954         parameter collision.
9955
9956 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9957
9958         * expression.cs (MemberAccess.ResolveMemberAccess):
9959         Exit with non-zero status after Report.Error.
9960         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9961         Likewise.
9962         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9963
9964 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9965
9966         * support.cs: Don't hang when the file is empty.
9967
9968 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9969
9970         * support.cs: In SeekableStreamReader, compute the preamble size of the
9971           underlying stream. Position changes should take into account that initial
9972           count of bytes.
9973
9974 2004-05-03  Todd Berman  <tberman@sevenl.net>
9975
9976         * driver.cs: remove unused GetSysVersion function.
9977
9978 2004-05-03  Todd Berman  <tberman@sevenl.net>
9979
9980         * driver.cs: Remove the hack from saturday, as well as the hack
9981         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9982         link_paths to get that bit proper.
9983
9984 2004-05-01  Todd Berman  <tberman@sevenl.net>
9985
9986         * driver.cs: Try a LoadFrom before a Load, this checks the current
9987         path. This is currently a bug in mono that is be fixed, however, this
9988         provides a workaround for now. This will be removed when the bug
9989         is fixed.
9990
9991 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9992
9993         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9994         incomplete key pairs (#57941).
9995
9996 2004-05-01  Todd Berman  <tberman@sevenl.net>
9997
9998         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9999         from the GAC
10000
10001 2004-04-30  Jackson Harper  <jackson@ximian.com>
10002
10003         * codegen.cs: Open keys readonly.
10004         
10005 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10006
10007         * typemanager.cs: don't report cyclic struct layout when a struct
10008         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10009         which has 2 Pango.Rectangle fields.
10010
10011 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10012
10013         * expression.cs: Handle IntPtr comparisons with IL code
10014         rather than a method call.
10015
10016 2004-04-29  Martin Baulig  <martin@ximian.com>
10017
10018         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10019         the list of PropertyInfo's in class hierarchy and find the
10020         accessor.  Fixes #56013.
10021
10022 2004-04-29  Martin Baulig  <martin@ximian.com>
10023
10024         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10025
10026 2004-04-29  Martin Baulig  <martin@ximian.com>
10027
10028         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10029
10030         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10031
10032 2004-04-29  Martin Baulig  <martin@ximian.com>
10033
10034         * class.cs (ConstructorInitializer.Resolve): Check whether the
10035         parent .ctor is accessible.  Fixes #52146.
10036
10037 2004-04-29  Martin Baulig  <martin@ximian.com>
10038
10039         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10040
10041         * statement.cs (Using.EmitLocalVariableDecls): Use
10042         TypeManager.idisposable_type, not typeof (IDisposable).
10043         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10044
10045 2004-04-29  Martin Baulig  <martin@ximian.com>
10046
10047         * class.cs (Event.Define): Don't emit the field and don't set
10048         RTSpecialName and SpecialName for events on interfaces.  Fixes
10049         #57703. 
10050
10051 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10052
10053         Refactor Attribute.ApplyAttributes.
10054         * attribute.cs (Attributable): New base class for objects that can
10055         have Attributes applied on them.
10056         (Attribute): Make AttributeUsage fields public.
10057         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10058         (Attribute.IsInternalCall): New property.
10059         (Attribute.UsageAttr): Convert to a public read-only property.
10060         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10061         (Attribute.ResolveType, Attribute.Resolve)
10062         (Attribute.ScanForIndexerName): Update to reflect changes.
10063         (Attribute.CheckAttributeTarget): Re-format.
10064         (Attribute.ApplyAttributes): Refactor, to various
10065         Attributable.ApplyAttributeBuilder methods.
10066         * decl.cs (MemberCore): Make Attributable.
10067         * class.cs (Accessor): Make Attributable.
10068         (MethodData.ApplyAttributes): Use proper attribute types, not
10069         attribute names.
10070         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10071         (TypeContainer.ApplyAttributeBuilder)
10072         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10073         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10074         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10075         (Operator.ApplyAttributeBuilder): New factored-out methods.
10076         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10077         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10078         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10079         * parameter.cs (ParameterBase): New Attributable base class
10080         that can also represent Return types.
10081         (Parameter): Update to the changes.
10082
10083 2004-04-29  Jackson Harper  <jackson@ximian.com>
10084
10085         * driver.cs: Prefer the corlib system version when looking for
10086         assemblies in the GAC. This is still a hack, but its a better hack
10087         now.
10088         
10089 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10090
10091         * decl.cs, enum.cs: Improved error 3005 reporting.
10092   
10093         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10094         (related_symbols): New private member for list of symbols
10095         related to reported error/warning.
10096         
10097         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10098
10099 2004-04-29  Martin Baulig  <martin@ximian.com>
10100
10101         * ecore.cs (Expression.Constantify): If we're an enum and
10102         TypeManager.TypeToCoreType() doesn't give us another type, use
10103         t.UnderlyingSystemType.  Fixes #56178.  
10104
10105 2004-04-29  Martin Baulig  <martin@ximian.com>
10106
10107         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10108         interfaces and for each interface, only add members directly
10109         declared in that interface.  Fixes #53255.
10110
10111 2004-04-28  Martin Baulig  <martin@ximian.com>
10112
10113         * expression.cs (ConditionalLogicalOperator): Use a temporary
10114         variable for `left' to avoid that we evaluate it more than once;
10115         bug #52588.
10116
10117 2004-04-28  Martin Baulig  <martin@ximian.com>
10118
10119         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10120         `void[]' (CS1547).
10121
10122 2004-04-28  Martin Baulig  <martin@ximian.com>
10123
10124         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10125         void (CS1547).
10126
10127         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10128         whether the type is not void (CS1547).
10129
10130 2004-04-28  Martin Baulig  <martin@ximian.com>
10131
10132         * expression.cs (Unary.DoResolveLValue): Override this and report
10133         CS0131 for anything but Operator.Indirection.
10134
10135 2004-04-28  Martin Baulig  <martin@ximian.com>
10136
10137         Committing a patch from Ben Maurer; see bug #50820.
10138
10139         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10140         check for classes.
10141
10142         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10143         classes.        
10144
10145 2004-04-28  Martin Baulig  <martin@ximian.com>
10146
10147         Committing a patch from Ben Maurer; see bug #50820.
10148
10149         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10150         check for classes.
10151
10152         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10153         classes.        
10154
10155 2004-04-28  Martin Baulig  <martin@ximian.com>
10156
10157         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10158         (Block.AddLabel): Call DoLookupLabel() to only search in the
10159         current block.
10160
10161 2004-04-28  Martin Baulig  <martin@ximian.com>
10162
10163         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10164         comparing StringConstants and NullLiterals in Equality and Inequality.
10165
10166 2004-04-28  Jackson Harper  <jackson@ximian.com>
10167
10168         * driver.cs: Attempt to load referenced assemblies from the
10169         GAC. This is the quick and dirty version of this method that
10170         doesnt take into account versions and just takes the first
10171         canidate found. Will be good enough for now as we will not have more
10172         then one version installed into the GAC until I update this method.
10173
10174 2004-04-28  Martin Baulig  <martin@ximian.com>
10175
10176         * typemanager.cs (TypeManager.CheckStructCycles): New public
10177         static method to check for cycles in the struct layout.
10178
10179         * rootcontext.cs (RootContext.PopulateTypes): Call
10180         TypeManager.CheckStructCycles() for each TypeContainer.
10181         [Note: We only need to visit each type once.]
10182
10183 2004-04-28  Martin Baulig  <martin@ximian.com>
10184
10185         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10186
10187         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10188         success and added `out object value'.  Use a `bool resolved' field
10189         to check whether we've already been called rather than
10190         `ConstantValue != null' since this breaks for NullLiterals.
10191
10192 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10193
10194         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10195         setting of this flag, since the 'set' method may be non-public.
10196
10197 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10198
10199         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10200         check on current_vector.Block.
10201
10202 2004-04-27  Martin Baulig  <martin@ximian.com>
10203
10204         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10205         a field initializer.  Fixes #56459.
10206
10207 2004-04-27  Martin Baulig  <martin@ximian.com>
10208
10209         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10210         we're not attempting to use an indexer.  Fixes #52154.
10211
10212 2004-04-27  Martin Baulig  <martin@ximian.com>
10213
10214         * statement.cs (Return): Don't create a return label if we don't
10215         need it; reverts my change from January 20th.  Thanks to Ben
10216         Maurer for this.
10217
10218 2004-04-27  Martin Baulig  <martin@ximian.com>
10219
10220         According to the spec, `goto' can only leave a nested scope, but
10221         never enter it.
10222
10223         * statement.cs (Block.LookupLabel): Only lookup in the current
10224         block, don't recurse into parent or child blocks.
10225         (Block.AddLabel): Check in parent and child blocks, report
10226         CS0140/CS0158 if we find a duplicate.
10227         (Block): Removed this indexer for label lookups.
10228         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10229         this already does the error reporting for us.
10230
10231         * flowanalysis.cs
10232         (FlowBranching.UsageVector.Block): New public variable; may be null.
10233         (FlowBranching.CreateSibling): Added `Block' argument.
10234         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10235         label for the target of a `goto' and check whether we're not
10236         leaving a `finally'.
10237
10238 2004-04-27  Martin Baulig  <martin@ximian.com>
10239
10240         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10241         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10242         just for returns).
10243
10244 2004-04-27  Martin Baulig  <martin@ximian.com>
10245
10246         * statement.cs (Block.AddLabel): Also check for implicit blocks
10247         and added a CS0158 check.
10248
10249 2004-04-27  Martin Baulig  <martin@ximian.com>
10250
10251         * flowanalysis.cs (FlowBranchingLoop): New class.
10252         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10253         UsageVector's instead of an ArrayList.
10254         (FlowBranching.Label): Likewise.
10255         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10256         (FlowBranching.AddBreakVector): New method.
10257
10258 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10259
10260         * attribute.cs: Small regression fix: only convert the type if we
10261         the type is different, fixes System.Drawing build.
10262
10263 2004-04-27  Martin Baulig  <martin@ximian.com>
10264
10265         * attribute.cs (Attribute.Resolve): If we have a constant value
10266         for a named field or property, implicity convert it to the correct
10267         type.
10268
10269 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10270
10271         * statement.cs (Block.Block): Implicit blocks share
10272         'child_variable_names' fields with parent blocks.
10273         (Block.AddChildVariableNames): Remove.
10274         (Block.AddVariable): Mark variable as "used by a child block" in
10275         every surrounding block.
10276         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10277         been used in a child block, complain about violation of "Invariant
10278         meaning in blocks" rule.
10279         * cs-parser.jay (declare_local_variables): Don't use
10280         AddChildVariableNames.
10281         (foreach_statement): Don't create an implicit block: 'foreach'
10282         introduces a scope.
10283
10284 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10285
10286         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10287         converting from 0L to ulong.  Fixes 57522.
10288
10289 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10290
10291         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10292         derived class hides via 'new' keyword field from base class (test-242.cs).
10293         TODO: Handle this in the more general way.
10294         
10295         * class.cs (CheckBase): Ditto.
10296
10297 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10298
10299         * decl.cs (caching_flags): New member for storing cached values
10300         as bit flags.
10301         (MemberCore.Flags): New enum where bit flags for caching_flags
10302         are defined.
10303         (MemberCore.cls_compliance): Moved to caching_flags.
10304         (DeclSpace.Created): Moved to caching_flags.
10305
10306         * class.cs: Use caching_flags instead of DeclSpace.Created
10307         
10308 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10309
10310         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10311         if we are only a derived class, not a nested class.
10312
10313         * typemanager.cs: Same as above, but do this at the MemberLookup
10314         level (used by field and methods, properties are handled in
10315         PropertyExpr).   Allow for the qualified access if we are a nested
10316         method. 
10317
10318 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10319
10320         * class.cs: Refactoring.
10321         (IMethodData): New inteface; Holds links to parent members
10322         to avoid member duplication (reduced memory allocation).
10323         (Method): Implemented IMethodData interface.
10324         (PropertyBase): New inner classes for get/set methods.
10325         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10326         (Event): New inner classes for add/remove methods.
10327         (Event.DelegateMethod): Implemented IMethodData interface.
10328
10329         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10330         EmitContext (related to class.cs refactoring).
10331
10332 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10333
10334         * delegate.cs (Delegate.VerifyApplicability): If the number of
10335         arguments are the same as the number of parameters, first try to
10336         verify applicability ignoring  any 'params' modifier on the last
10337         parameter.
10338         Fixes #56442.
10339
10340 2004-04-08  Martin Baulig  <martin@ximian.com>
10341
10342         Merged latest changes into gmcs.  Please keep this comment in
10343         here, it makes it easier for me to see what changed in MCS since
10344         the last time I merged.
10345
10346 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10347
10348         * class.cs (TypeContainer.AddIndexer): Use
10349         'ExplicitInterfaceName' to determine if interface name was
10350         explicitly specified.  'InterfaceType' is not initialized at this time.
10351         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10352         Indexers array is already in the required order.  Initialize
10353         'IndexerName' only if there are normal indexers.
10354         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10355         (TypeContainer.Emit): Emit DefaultMember attribute only if
10356         IndexerName is initialized.
10357         Fixes #56300.
10358
10359 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10360
10361         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10362         Fixes #57007
10363
10364 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10365
10366         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10367         attributes.
10368         Fix for #56456.
10369
10370         * attribute.cs (Attribute.Resolve): Check for duplicate named
10371         attributes.
10372         Fix for #56463.
10373
10374 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * iterators.cs (MarkYield): track whether we are in an exception,
10377         and generate code accordingly.  Use a temporary value to store the
10378         result for our state.
10379
10380         I had ignored a bit the interaction of try/catch with iterators
10381         since their behavior was not entirely obvious, but now it is
10382         possible to verify that our behavior is the same as MS .NET 2.0
10383
10384         Fixes 54814
10385
10386 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10387
10388         * iterators.cs: Avoid creating temporaries if there is no work to
10389         do. 
10390
10391         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10392         Enumerations, use TypeManager.EnumToUnderlying and call
10393         recursively. 
10394
10395         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10396         bug #57013
10397
10398         (This.Emit): Use EmitContext.EmitThis to emit our
10399         instance variable.
10400
10401         (This.EmitAssign): Ditto.
10402
10403         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10404         codepaths, we will move all the functionality into
10405         Mono.CSharp.This 
10406
10407         (FieldExpr.EmitAssign): Ditto.
10408
10409         This fixes several hidden bugs that I uncovered while doing a code
10410         review of this today.
10411
10412         * codegen.cs (EmitThis): reworked so the semantics are more clear
10413         and also support value types "this" instances.
10414
10415         * iterators.cs: Changed so that for iterators in value types, we
10416         do not pass the value type as a parameter.  
10417
10418         Initialization of the enumerator helpers is now done in the caller
10419         instead of passing the parameters to the constructors and having
10420         the constructor set the fields.
10421
10422         The fields have now `assembly' visibility instead of private.
10423
10424 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * expression.cs (Argument.Resolve): Check if fields passed as ref
10427         or out are contained in a MarshalByRefObject.
10428
10429         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10430         another compiler type.
10431
10432 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10433
10434         * class.cs (Indexer.Define): use the new name checking method.
10435         Also, return false on an error.
10436         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10437         (is_identifier_[start/part]_character): make static.
10438
10439 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10440
10441         * expression.cs (Binary.ResolveOperator): Do no append strings
10442         twice: since we can be invoked more than once (array evaluation)
10443         on the same concatenation, take care of this here.  Based on a fix
10444         from Ben (bug #56454)
10445
10446 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10447
10448         * codegen.cs: Fix another case where CS1548 must be reported (when 
10449         delay-sign isn't specified and no private is available #56564). Fix
10450         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10451         error when MCS is used on the MS runtime and we need to delay-sign 
10452         (which seems unsupported by AssemblyBuilder - see #56621).
10453
10454 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10455
10456         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10457         (TypeManager.ComputeNamespaces): Faster implementation for
10458         Microsoft runtime.
10459
10460         * compiler.csproj: Updated AssemblyName to mcs.
10461
10462 2004-05-11  Jackson Harper  <jackson@ximian.com>
10463
10464         * Makefile: Preserve MONO_PATH
10465         
10466 2004-05-11  Jackson Harper  <jackson@ximian.com>
10467
10468         * Makefile: Use mono and mcs to build gmcs
10469         
10470 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10471
10472         * codegen.cs: Add patch from Robert Shade
10473         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10474         sync with mcs.
10475
10476 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10477
10478         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10479         incomplete key pairs (#57941).
10480
10481 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10482
10483         * codegen.cs: Fix another case where CS1548 must be reported (when 
10484         delay-sign isn't specified and no private is available #56564). Fix
10485         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10486         error when MCS is used on the MS runtime and we need to delay-sign 
10487         (which seems unsupported by AssemblyBuilder - see #56621).
10488
10489 2004-04-29  Jackson Harper  <jackson@ximian.com>
10490
10491         * Makefile: Set MONO_PATH to use the bootstrap corlib
10492         * driver.cs: Check the GAC for referenced assemblies.
10493                 
10494 2004-04-29  Martin Baulig  <martin@ximian.com>
10495
10496         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10497
10498 2004-04-07  Martin Baulig  <martin@ximian.com>
10499
10500         * expression.cs (Binary.ResolveOperator): Added special case for
10501         Equality/Inequality between a type parameter and a null literal.
10502
10503 2004-04-07  Martin Baulig  <martin@ximian.com>
10504
10505         * convert.cs: Check null literal -> type parameter conversions.
10506
10507 2004-04-07  Martin Baulig  <martin@ximian.com>
10508
10509         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10510         `class' and `struct' constraints.
10511
10512 2004-04-07  Martin Baulig  <martin@ximian.com>
10513
10514         * generic.cs (SpecialConstraint): New public enum.
10515         (Constraints.Resolve): Added support for the `class' and `struct'
10516         constraints.
10517
10518         * cs-parser.jay (type_parameter_constraint): Added support for the
10519         `class' and `struct' constraints.
10520
10521 2004-04-07  Martin Baulig  <martin@ximian.com>
10522
10523         * support.cs (GenericConstraints): Replaced `Types' by
10524         `ClassConstraint' and `InterfaceConstraints'; added
10525         `HasClassConstraint'.   
10526
10527 2004-04-07  Martin Baulig  <martin@ximian.com>
10528
10529         * generic.cs
10530         (Constraints.InterfaceConstraints): New public property.
10531         (Constraints.Types): Make this property public
10532         (TypeParameter): Implement IMemberContainer.
10533         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10534         instead of a TypeBuilder/MethodBuilder; pass the interface
10535         constraints to TypeManager.AddTypeParameter().
10536         (TypeParameter.DefineType): Just take an EmitContext and no
10537         TypeBuilder/MethodBuilder.  Use the new public API.
10538
10539         * typemanager.cs (TypeManager.AddTypeParameter): Added
10540         `TypeExpr[]' argument; add the interfaces to the
10541         `builder_to_ifaces' hash.
10542         (TypeManager.LookupMemberContainer): For
10543         GenericTypeParameterBuilders, get the TypeParameter from the
10544         `builder_to_type_param'.
10545         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10546         the TypeParameter and call FindMembers on it.
10547
10548 2004-04-07  Martin Baulig  <martin@ximian.com>
10549
10550         * class.cs
10551         (MethodCore.GenericMethod): Moved this field here from Method.
10552         (MethodCore.IsDuplicateImplementation): Take the number of type
10553         parameters into account if we're a generic method.
10554
10555         * expression.cs (Invocation.InferTypeArguments): Don't return true
10556         if `arguments' is null; we still need to check whether we actually
10557         don't need to infer anything in this case.
10558         (MemberAccess): Merged the functionality from GenericMemberAccess
10559         into this class.
10560
10561         * generic.cs (GenericMemberAccess): Removed.
10562
10563 2004-04-05  Martin Baulig  <martin@ximian.com>
10564
10565         * decl.cs (MemberCore): For generic classes, interfaces and
10566         structs, `Name' now includes the number of type parameters
10567         ("Stack!1.Node!1").
10568         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10569         encode the number of type arguments in the type name.
10570
10571         * expression.cs (Expression.MemberLookup): Removed the
10572         `num_type_args' argument; we now encode the number of type
10573         arguments in the type name.
10574
10575         * ecore.cs (SimpleName): Encode the number of type arguments in
10576         the type name itself.
10577
10578         * generic.cs (ConstructedType): Likewise.
10579
10580         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10581         `MemberName'; we now include the number of type parameters in the
10582         type name.
10583
10584         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10585         (TypeManager.MemberLookup): Removed the
10586         `num_type_args' argument; we now encode the number of type
10587         arguments in the type name.     
10588
10589 2004-04-03  Martin Baulig  <martin@ximian.com>
10590
10591         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10592         (MemberCore.MemberName): Moved here from MemberBase.
10593         (DeclSpace.SetParameterInfo): Just take the constraints as an
10594         ArrayList; we already have the type parameters in our
10595         `MemberName'; also do the CS0080 reporting here.
10596
10597         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10598         `IDENTIFIER opt_type_parameter_list'; when constructing our
10599         `MemberName', it'll already include our type parameters.
10600         (class_declaration, interface_declaration): Likewise.
10601         (delegate_declaration): Likewise.
10602         (MakeName): Take a MemberName and return a MemberName.
10603         The following two changes are required to avoid shift/reduce conflicts:
10604         (member_name): Don't include a TypeName anymore; ie. this is now
10605         just 'IDENTIFIER opt_type_parameter_list'.
10606         (property_declaration, event_declaration): Use a
10607         `namespace_or_type_name' instead of a `member_name'.            
10608
10609 2004-04-03  Martin Baulig  <martin@ximian.com>
10610
10611         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10612         `MemberName' class.
10613         (TypeName): Formerly known as MemberName.
10614
10615         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10616         instead of a `MemberName'.
10617
10618         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10619         (member_name): New rule; create a MemberName.
10620
10621 2004-04-02  Martin Baulig  <martin@ximian.com>
10622
10623         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10624         (CS0305 and CS0308).
10625
10626 2004-04-02  Martin Baulig  <martin@ximian.com>
10627
10628         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10629         support for nested types.
10630
10631 2004-04-02  Martin Baulig  <martin@ximian.com>
10632
10633         * ecore.cs (IAlias): New public interface.
10634         (TypeExpr, TypeExpression): Implement IAlias.
10635         (TypeAliasExpression): New public class.
10636
10637         * namespace.cs (Namespace): Implement IAlias.
10638         (Namespace.Lookup): Return an IAlias instead on an object.
10639         (Namespace.DefineName): Take an IAlias instead of an object.
10640         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10641         an object.
10642         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10643         Expression.
10644         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10645         object.
10646         (NamespaceEntry.Lookup): Likewise.
10647
10648         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10649         instead of a Type.      
10650
10651         * decl.cs (DeclSpace): Implement IAlias.
10652         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10653
10654         * generic.cs (ConstructedType): Improved error checking.
10655
10656 2004-04-02  Martin Baulig  <martin@ximian.com>
10657
10658         * convert.cs: Added type parameter conversions.
10659
10660         * ecore.cs
10661         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10662         (ClassCast.Emit): If the source type is a type parameter, box it.
10663         If the target type is a type parameter, emit an `unbox.any'
10664         instead of a `classcast'.1      
10665
10666 2004-04-01  Martin Baulig  <martin@ximian.com>
10667
10668         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10669
10670 2004-04-01  Martin Baulig  <martin@ximian.com>
10671
10672         * generic.cs (ConstructedType.CheckConstraints): Use
10673         Convert.ImplicitStandardConversionExists(); user-defined implicit
10674         conversions are not allowed according to the spec.
10675
10676 2004-03-30  Martin Baulig  <martin@ximian.com>
10677
10678         * expression.cs (New): Added support for type parameters.
10679
10680         * typemanager.cs
10681         (TypeManager.activator_type): New public static field.
10682         (TypeManager.activator_create_instance): Likewise.
10683
10684 2004-03-30  Martin Baulig  <martin@ximian.com>
10685
10686         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10687         public method.
10688
10689 2004-03-30  Martin Baulig  <martin@ximian.com>
10690
10691         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10692         the spec here: the argument type must be convertible to the
10693         constraints.
10694
10695 2004-03-30  Martin Baulig  <martin@ximian.com>
10696
10697         * generic.cs
10698         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10699         TypeManager.AddTypeParameter().
10700         (ConstructedType.CheckConstraints): Re-enable this and actually
10701         check whether we have a constructor constraint.
10702
10703         * typemanager.cs
10704         (TypeManager.builder_to_type_param): New static field.
10705         (TypeManager.AddTypeParameter): New static method.
10706         (TypeManager.LookupTypeParameter): New public method.
10707
10708 2004-03-30  Martin Baulig  <martin@ximian.com>
10709
10710         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10711         the new API to actually define the constructor constraint.
10712
10713         * typemanager.cs
10714         (TypeManager.new_constraint_attr_type): New static field.
10715         (TypeManager.InitCoreTypes): Initialize it.
10716
10717 2004-03-30  Martin Baulig  <martin@ximian.com>
10718
10719         * generic.cs (Constraints): Completed error checking, use correct
10720         error numbers.
10721
10722 2004-03-29  Martin Baulig  <martin@ximian.com>
10723
10724         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10725
10726         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10727         public version which takes a `ParameterData pd' instead of an
10728         `ArrayList args'.
10729
10730 2004-03-29  Martin Baulig  <martin@ximian.com>
10731
10732         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10733         not a MethodInfo.       
10734
10735 2004-03-29  Martin Baulig  <martin@ximian.com>
10736
10737         * expression.cs (Argument.ResolveMethodGroup): If we're a
10738         ConstructedType, call GetMemberAccess() on it.  
10739
10740 2004-03-29  Martin Baulig  <martin@ximian.com>
10741
10742         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10743         (MethodCore.CheckGenericOverride): When overriding a generic
10744         method, check whether the constraints match.
10745
10746         * support.cs (GenericConstraints): New public interface.
10747         (ParameterData.GenericConstraints): New public method.
10748
10749         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10750         method parameter and compute our constraints if appropriate.
10751         (Parameter.GenericConstraints): New public property.
10752
10753         * generic.cs (Constraints): Implement GenericConstraints.
10754
10755 2004-03-29  Martin Baulig  <martin@ximian.com>
10756
10757         * decl.cs (MemberCache.FindMemberToOverride): Use
10758         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10759
10760 2004-03-29  Martin Baulig  <martin@ximian.com>
10761
10762         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10763
10764 2004-03-29  Martin Baulig  <martin@ximian.com>
10765
10766         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10767         not allowed on non-generic declarations").
10768
10769 2004-03-29  Martin Baulig  <martin@ximian.com>
10770
10771         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10772         public version of this method.
10773
10774         * class.cs (MethodCore.IsDuplicateImplementation): Use
10775         Invocation.InferTypeArguments() to check this.
10776
10777 2004-03-29  Martin Baulig  <martin@ximian.com>
10778
10779         * convert.cs: Use TypeManager.IsDelegateType() instead of
10780         comparing types correctly.
10781
10782 2004-03-29  Martin Baulig  <martin@ximian.com>
10783
10784         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10785         types directly to make it work for generic instances.
10786
10787         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10788
10789 2004-03-29  Martin Baulig  <martin@ximian.com>
10790
10791         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10792         support for arrays.     
10793
10794 2004-03-24  Martin Baulig  <martin@ximian.com>
10795
10796         * decl.cs (DeclSpace.FindType): Also use
10797         TypeManager.CheckGeneric() for types from the using clauses.
10798
10799 2004-03-23  Martin Baulig  <martin@ximian.com>
10800
10801         * expression.cs (Invocation.OverloadResolve): Added `bool
10802         may_fail' argument and use it instead of the Location.IsNull() hack.
10803
10804 2004-03-23  Martin Baulig  <martin@ximian.com>
10805
10806         * expression.cs (Invocation.InferType): Use correct type inference
10807         rules here.     
10808
10809 2004-03-23  Martin Baulig  <martin@ximian.com>
10810
10811         * ecore.cs (MethodGroupExpr.Name): Use
10812         TypeManager.CSharpSignature() instead of just the name.
10813
10814         * expression.cs (Invocation.OverloadResolve): Provide better error
10815         reporting.
10816         (Invocation.DoResolve): OverloadResolve() never returns null
10817         without reporting an error, so removed the error -6 reporting here.
10818
10819 2004-03-23  Martin Baulig  <martin@ximian.com>
10820
10821         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10822         generic methods.
10823
10824         * cs-parser.jay (delegate_declaration): Support generic delegates.
10825
10826         * delegate.cs: Support generic delegates.
10827
10828 2004-03-22  Martin Baulig  <martin@ximian.com>
10829
10830         * expression.cs (Invocation.InferParamsTypeArguments): New static
10831         method; does type inference for params arguments.
10832
10833 2004-03-21  Martin Baulig  <martin@ximian.com>
10834
10835         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10836         method; checks whether a method is a generic method.    
10837
10838         * expression.cs (Invocation.InferTypeArguments): New static method;
10839         infer type arguments for generic method invocation.
10840
10841         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10842         property; we set this to true if we're resolving a generic method
10843         invocation and the user specified type arguments, ie. we're not
10844         doing type inference.
10845
10846 2004-03-20  Martin Baulig  <martin@ximian.com>
10847
10848         * class.cs (MethodData.DeclaringType): New public property.
10849         (MethodData.Define): Set DeclaringType here.
10850         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10851         instead of OperatorMethodBuilder.DeclaringType.
10852
10853 2004-03-20  Martin Baulig  <martin@ximian.com>
10854
10855         * cs-tokenizer.cs (xtoken): Return a special
10856         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10857
10858         * cs-parser.jay (default_value_expression): Switch to the new
10859         syntax (14.5.13).
10860
10861 2004-03-19  Martin Baulig  <martin@ximian.com>
10862
10863         * decl.cs (MemberName): New class.  We use this to "construct"
10864         namespace_or_type_name's.
10865
10866         * generics.cs (TypeArguments.GetDeclarations): New public method;
10867         returns the type arguments as a string[] and reports a CS0081 if
10868         one of them is not an identifier.
10869
10870         * class.cs (MemberBase): The .ctor now takes the name as a
10871         MemberName instead of a string.
10872         (MemberBase.ExplicitInterfaceName): Changed type from string to
10873         Expression.
10874         (MemberBase.DoDefine): If we're an explicit implementation, the
10875         InterfaceType may be a generic instance.
10876
10877         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10878         (namespace_name): Call MemberName.GetName () to transform the
10879         MemberName into a string and ensure we don't have any type
10880         arguments.
10881         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10882         MemberName into an expression.
10883         (method_header): Use namespace_or_type_name instead of member_name.     
10884
10885 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10886
10887         * rootcontext.cs: Add new types to the boot resolution.
10888
10889         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10890         MulticastDelegate is not allowed.
10891
10892         * typemanager.cs: Add new types to lookup: System.TypedReference
10893         and ArgIterator.
10894
10895         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10896         check for TypedReference or ArgIterator, they are not allowed. 
10897
10898         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10899         makes us properly catch 1510 in some conditions (see bug 56016 for
10900         details). 
10901
10902 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10903
10904         * CryptoConvert.cs: update from corlib version
10905         with endian fixes.
10906
10907 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10908
10909         * class.cs (Indexer.Define): Check indexername declaration
10910
10911 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10912
10913         * attribute.cs (IsClsCompliant): Fixed problem with handling
10914         all three states (compliant, not-compliant, undetected).
10915
10916 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10917
10918         * attribute.cs (Attribute): Location is now public.
10919         (Resolve): Store resolved arguments (pos_values) in attribute class.
10920         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10921         (GetClsCompliantAttributeValue): New method that gets
10922         CLSCompliantAttribute value.
10923         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10924         if exists else null.
10925         (AttributeTester): New class for CLS-Compliant verification routines.
10926
10927         * class.cs (Emit): Add CLS-Compliant verification.
10928         (Method.GetSignatureForError): Implemented.
10929         (Constructor.GetSignatureForError): Implemented
10930         (Constructor.HasCompliantArgs): Returns if constructor has
10931         CLS-Compliant arguments.
10932         (Constructor.Emit): Override.
10933         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10934         is needed to test only parameters.
10935         (FieldBase.GetSignatureForError): Implemented.
10936         (TypeContainer): New member for storing base interfaces.
10937         (TypeContainer.FindMembers): Search in base interfaces too.
10938
10939         * codegen.cs (GetClsComplianceAttribute): New method that gets
10940         assembly or module CLSCompliantAttribute value.
10941         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10942         for assembly.
10943         (ModuleClass.Emit): Add error 3012 test.
10944
10945         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10946
10947         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10948         state for all decl types.
10949         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10950         if CLS-Compliant tests are required.
10951         (IsClsCompliaceRequired): New method. Analyze whether code
10952         must be CLS-Compliant.
10953         (IsExposedFromAssembly): New method. Returns true when MemberCore
10954         is exposed from assembly.
10955         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10956         value or gets cached value.
10957         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10958         is explicitly marked with CLSCompliantAttribute.
10959         (IsIdentifierClsCompliant): New abstract method. This method is
10960         used to testing error 3005.
10961         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10962         for identifier and parameters CLS-Compliant testing.
10963         (VerifyClsCompliance): New method. The main virtual method for
10964         CLS-Compliant verifications.
10965         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10966         null. I don't know why is null (too many public members !).
10967         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10968         and get value of first CLSCompliantAttribute that found.
10969
10970         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10971         (VerifyClsCompliance): Override and add extra tests.
10972
10973         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10974         clscheck- disable CLS-Compliant verification event if assembly is has
10975         CLSCompliantAttribute(true).
10976
10977         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10978         ApllyAttribute is now called in emit section as in the other cases.
10979         Possible future Emit integration.
10980         (IsIdentifierClsCompliant): New override.
10981         (VerifyClsCompliance): New override.
10982         (GetEnumeratorName): Returns full enum name.
10983
10984         * parameter.cs (GetSignatureForError): Implemented.
10985
10986         * report.cs (WarningData): New struct for Warning message information.
10987         (LocationOfPreviousError): New method.
10988         (Warning): New method. Reports warning based on the warning table.
10989         (Error_T): New method. Reports error based on the error table.
10990
10991         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10992         verifications are done here.
10993
10994         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10995
10996         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10997         CLSCompliantAttribute.
10998         (all_imported_types): New member holds all imported types from other
10999         assemblies.
11000         (LoadAllImportedTypes): New method fills static table with exported types
11001         from all referenced assemblies.
11002         (Modules): New property returns all assembly modules.
11003
11004 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11005
11006         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11007         throwing a parser error.
11008
11009         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11010         which removes the hardcoded get_/set_ prefixes for properties, as
11011         IL allows for the properties to be named something else.  
11012
11013         Bug #56013
11014
11015         * expression.cs: Do not override operand before we know if it is
11016         non-null.  Fix 56207
11017
11018 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11019
11020         * typemanager.cs: support for pinned variables.
11021
11022 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11023
11024         * decl.cs, typemanager.cs: Avoid using an arraylist
11025         as a buffer if there is only one result set.
11026
11027 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11028
11029         * expression.cs: Make sure you cant call a static method
11030         with an instance expression, bug #56174.
11031
11032 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11033
11034         * class.cs (IsDuplicateImplementation): Improve error reporting to
11035         flag 663 (method only differs in parameter modifier).
11036
11037         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11038         in preprocessor directives.
11039
11040         * location.cs (LookupFile): Allow for the empty path.
11041
11042         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11043         better approach for some of that patch, but its failing with the
11044         CharSet enumeration.  For now try/catch will do.
11045
11046         * typemanager.cs: Do not crash if a struct does not have fields.
11047         Fixes 56150.
11048
11049 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11050
11051         * expression.cs: cs0213, cant fix a fixed expression.
11052         fixes 50231.
11053
11054 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11055
11056         * cs-parser.jay: detect invalid embeded statements gracefully.
11057         bug #51113.
11058
11059 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11060
11061         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11062         As a regex:
11063         s/
11064         the invocation type may not be a subclass of the tye of the item/
11065         The type of the item must be a subclass of the invocation item.
11066         /g
11067
11068         Fixes bug #50820.
11069
11070 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11071
11072         * attribute.cs: Added methods to get a string and a bool from an
11073         attribute. Required to information from AssemblyKeyFileAttribute,
11074         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11075         * codegen.cs: Modified AssemblyName creation to include support for
11076         strongnames. Catch additional exceptions to report them as CS1548.
11077         * compiler.csproj: Updated include CryptoConvert.cs.
11078         * compiler.csproj.user: Removed file - user specific configuration.
11079         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11080         Mono.Security assembly. The original class is maintained and tested in
11081         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11082         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11083         like CSC 8.0 (C# v2) supports.
11084         * Makefile: Added CryptoConvert.cs to mcs sources.
11085         * rootcontext.cs: Added new options for strongnames.
11086
11087 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11088
11089         * driver.cs: For --expect-error, report error code `2'
11090         if the program compiled with no errors, error code `1' if
11091         it compiled with an error other than the one expected.
11092
11093 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11094
11095         * compiler.csproj: Updated for Visual Studio .NET 2003.
11096         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11097         * compiler.sln: Updated for Visual Studio .NET 2003.
11098
11099 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11100
11101         * expression.cs: Fix bug #47234. We basically need to apply the
11102         rule that we prefer the conversion of null to a reference type
11103         when faced with a conversion to 'object' (csc behaviour).
11104
11105 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11106
11107         * statement.cs: Shorter form for foreach, eliminates
11108         a local variable. r=Martin.
11109
11110 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11111
11112         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11113         checks if we can use brtrue/brfalse to test for 0.
11114         * expression.cs: use the above in the test for using brtrue/brfalse.
11115         cleanup code a bit.
11116
11117 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11118
11119         * expression.cs: Rewrite string concat stuff. Benefits:
11120
11121         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11122         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11123         rather than a concat chain.
11124
11125         * typemanager.cs: Add lookups for more concat overloads.
11126
11127 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11128
11129         * expression.cs: Emit shorter il code for array init.
11130
11131         newarr
11132         dup
11133         // set 1
11134
11135         // set 2
11136
11137         newarr
11138         stloc.x
11139
11140         ldloc.x
11141         // set 1
11142
11143         ldloc.x
11144         // set 2
11145
11146 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11147
11148         * statement.cs: Before, two switch blocks would be merged if the
11149         total size of the blocks (end_item - begin_item + 1) was less than
11150         two times the combined sizes of the blocks.
11151
11152         Now, it will only merge if after the merge at least half of the
11153         slots are filled.
11154
11155         fixes 55885.
11156
11157 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11158
11159         * class.cs : csc build fix for GetMethods(). See bug #52503.
11160
11161 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11162
11163         * expression.cs: Make sure fp comparisons work with NaN.
11164         This fixes bug #54303. Mig approved this patch a long
11165         time ago, but we were not able to test b/c the runtime
11166         had a related bug.
11167
11168 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11169
11170         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11171
11172 2004-03-19  Martin Baulig  <martin@ximian.com>
11173
11174         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11175         two overloads may unify for some type parameter substitutions and
11176         report a CS0408 if appropriate.
11177
11178 2004-03-19  Martin Baulig  <martin@ximian.com>
11179
11180         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11181         error here and not in our caller.
11182
11183 2004-03-19  Martin Baulig  <martin@ximian.com>
11184
11185         * interface.cs: Completely killed this file.
11186         (Interface): We're now a TypeContainer and live in class.cs.
11187
11188         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11189         argument; we're now also called for interfaces.
11190         (TypeContainer.DefineMembers): Allow this method being called
11191         multiple times.
11192         (TypeContainer.GetMethods): New public method; formerly known as
11193         Interface.GetMethod().  This is used by PendingImplementation.
11194         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11195         it's now private and non-static.
11196         (Interface): Moved this here; it's now implemented similar to
11197         Class and Struct.
11198         (Method, Property, Event, Indexer): Added `bool is_interface'
11199         argument to their .ctor's.
11200         (MemberBase.IsInterface): New public field.
11201
11202         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11203         instances instead of InterfaceMethod, InterfaceProperty, etc.
11204         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11205         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11206
11207 2004-03-19  Martin Baulig  <martin@ximian.com>
11208
11209         * class.cs (MethodCore.IsDuplicateImplementation): New private
11210         method which does the CS0111 checking.
11211         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11212         Use IsDuplicateImplementation().
11213
11214 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11215
11216         * decl.cs (FindMemberToOverride): New method to find the correct
11217         method or property to override in the base class.
11218         * class.cs
11219             - Make Method/Property use the above method to find the
11220               version in the base class.
11221             - Remove the InheritableMemberSignatureCompare as it is now
11222               dead code.
11223
11224         This patch makes large code bases much faster to compile, as it is
11225         O(n) rather than O(n^2) to do this validation.
11226
11227         Also, it fixes bug 52458 which is that nested classes are not
11228         taken into account when finding the base class member.
11229
11230         Reviewed/Approved by Martin.
11231
11232 2004-03-17  Martin Baulig  <martin@ximian.com>
11233
11234         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11235         of type arguments into account; use the `real_num_type_args'
11236         approach like in DoResolveAsTypeStep().
11237
11238         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11239         nested types.
11240
11241 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11242
11243         * interface.cs: In all interface classes removed redundant
11244         member initialization.
11245
11246 2004-03-16  Martin Baulig  <martin@ximian.com>
11247
11248         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11249
11250 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11251
11252         * decl.cs (DefineTypeAndParents): New helper method to define a
11253         type's containers before the type itself is defined;  This is a
11254         bug exposed by the recent changes to Windows.Forms when an
11255         implemented interface was defined inside a class that had not been
11256         built yet.   
11257
11258         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11259
11260         (Check): Loop correctly to report errors modifiers
11261         (UNSAFE was not in the loop, since it was the same as TOP).
11262
11263         * interface.cs: Every interface member now takes a ModFlags,
11264         instead of a "is_new" bool, which we set on the base MemberCore. 
11265
11266         Every place where we called "UnsafeOk" in the interface, now we
11267         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11268         the unsafe settings from the member declaration instead of the
11269         container interface. 
11270
11271         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11272
11273         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11274         `set_indexer_name' to the pending bits (one per type).
11275
11276         We fixed a bug today that was picking the wrong method to
11277         override, since for properties the existing InterfaceMethod code
11278         basically ignored the method name.  Now we make sure that the
11279         method name is one of the valid indexer names.
11280
11281 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11282  
11283         * support.cs (SeekableStreamReader): Keep track of stream byte
11284         positions and don't mix them with character offsets to the buffer.
11285
11286         Patch from Gustavo Giráldez
11287
11288 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11289
11290         * interface.cs (InterfaceSetGetBase): Removed double member
11291         initialization, base class does it as well.
11292
11293 2004-03-13  Martin Baulig  <martin@ximian.com>
11294
11295         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11296         when compiling corlib.
11297
11298 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11299
11300         * convert.cs (ExplicitConversion): We were reporting an error on
11301         certain conversions (object_type source to a value type, when the
11302         expression was `null') before we had a chance to pass it through
11303         the user defined conversions.
11304
11305         * driver.cs: Replace / and \ in resource specifications to dots.
11306         Fixes 50752
11307
11308         * class.cs: Add check for duplicate operators.  Fixes 52477
11309
11310 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11313         that are in the middle of the statements, not only at the end.
11314         Fixes #54987
11315
11316         * class.cs (TypeContainer.AddField): No longer set the
11317         `HaveStaticConstructor' flag, now we call it
11318         `UserDefineStaticConstructor' to diferentiate the slightly
11319         semantic difference.
11320
11321         The situation is that we were not adding BeforeFieldInit (from
11322         Modifiers.TypeAttr) to classes that could have it.
11323         BeforeFieldInit should be set to classes that have no static
11324         constructor. 
11325
11326         See:
11327
11328         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11329
11330         And most importantly Zoltan's comment:
11331
11332         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11333
11334         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11335          before its static fields are used', i.e. initialization does not need
11336          to be triggered by the first access to the type. Setting this flag
11337          helps the JIT to compile better code, since it can run the static
11338          constructor at JIT time, and does not need to generate code to call it
11339          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11340          this flag for lots of classes like String. 
11341          
11342          csc sets this flag if the type does not have an explicit static 
11343          constructor. The reasoning seems to be that if there are only static
11344          initalizers for a type, and no static constructor, then the programmer
11345          does not care when this initialization happens, so beforefieldinit
11346          can be used.
11347          
11348          This bug prevents the AOT compiler from being usable, since it 
11349          generates so many calls to mono_runtime_class_init that the AOT code
11350          is much slower than the JITted code. The JITted code is faster, 
11351          because it does not generate these calls if the vtable is type is
11352          already initialized, which is true in the majority of cases. But the
11353          AOT compiler can't do this."
11354
11355 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11356
11357         * class.cs (MethodData.Emit): Refactor the code so symbolic
11358         information is generated for destructors;  For some reasons we
11359         were taking a code path that did not generate symbolic information
11360         before. 
11361
11362 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11363
11364         * class.cs: Create a Constructor.CheckBase method that
11365         takes care of all validation type code. The method
11366         contains some code that was moved from Define.
11367
11368         It also includes new code that checks for duplicate ctors.
11369         This fixes bug #55148.
11370
11371 2004-03-09  Joshua Tauberer <tauberer@for.net>
11372
11373         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11374         a { ... }-style array creation invokes EmitStaticInitializers
11375         which is not good for reference-type arrays.  String, decimal
11376         and now null constants (NullCast) are not counted toward
11377         static initializers.
11378
11379 2004-03-05  Martin Baulig  <martin@ximian.com>
11380
11381         * location.cs (SourceFile.HasLineDirective): New public field;
11382         specifies whether the file contains or is referenced by a "#line"
11383         directive.
11384         (Location.DefineSymbolDocuments): Ignore source files which
11385         either contain or are referenced by a "#line" directive.        
11386
11387 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11388
11389         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11390         direct access to our parent, so check the method inline there.
11391
11392 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11393
11394         * expression.cs (Invocation.EmitCall): Miguel's last commit
11395         caused a regression. If you had:
11396
11397             T t = null;
11398             t.Foo ();
11399
11400         In Foo the implict this would be null.
11401
11402 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11403
11404         * expression.cs (Invocation.EmitCall): If the method is not
11405         virtual, do not emit a CallVirt to it, use Call.
11406
11407         * typemanager.cs (GetFullNameSignature): Improve the method to
11408         cope with ".ctor" and replace it with the type name.
11409
11410         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11411         as an argument the ConstructorBuilder where it is being defined,
11412         to catch the recursive constructor invocations.
11413
11414 2004-03-16  Martin Baulig  <martin@ximian.com>
11415
11416         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11417         ConstructedType, call ResolveType() on it to get the type rather
11418         than just using `expr.Type'.
11419
11420 2004-03-16  Martin Baulig  <martin@ximian.com>
11421
11422         * generics.cs (ConstructedType.GetMemberAccess): Take the
11423         EmitContext instead on the TypeExpr and use
11424         ec.TypeContainer.CurrentType/ec.ContainerType.
11425
11426 2004-03-16  Martin Baulig  <martin@ximian.com>
11427
11428         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11429         parameters before aliases.
11430
11431 2004-03-16  Martin Baulig  <martin@ximian.com>
11432
11433         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11434         New oublic function; checks whether two generic instances may become
11435         equal under some instantiations (26.3.1).
11436
11437         * class.cs (TypeContainer.Define): Call
11438         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11439         error.
11440
11441 2004-03-16  Martin Baulig  <martin@ximian.com>
11442
11443         * class.cs (TypeContainer.GetClassBases): Moved
11444         Error_TypeParameterAsBase() here and also check whether the base
11445         class is not an attribute.
11446
11447 2004-03-16  Martin Baulig  <martin@ximian.com>
11448
11449         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11450
11451 2004-03-16  Martin Baulig  <martin@ximian.com>
11452
11453         * class.cs (Error_TypeParameterAsBase): Use correct error number
11454         here (CS0689).  
11455
11456 2004-03-16  Martin Baulig  <martin@ximian.com>
11457
11458         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11459         for generics.
11460
11461         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11462         error reporting.
11463
11464 2004-03-15  Martin Baulig  <martin@ximian.com>
11465
11466         * typemanager.cs (TypeManager.GetFullName): New public method.
11467         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11468         argument; only return members with the correct number of type
11469         arguments.
11470         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11471         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11472         whether the number of type arguments matches.
11473
11474         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11475         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11476
11477         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11478         field; it's set by the protected .ctor when we're actually a
11479         GenericMemberAccess.
11480         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11481         arguments and pass it to MemberLookupFinal ().
11482
11483         * ecore.cs (Expression.MemberLookup): Added `int
11484         num_type_arguments' argument; only return members with the correct
11485         number of type arguments.
11486         (Expression.MemberLookupFailed): Check whether the MemberLookup
11487         failed because we did not have the correct number of type
11488         arguments; report CS0305 in this case.
11489
11490         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11491         `e.ResolveAsTypeTerminal()' already did so.
11492
11493 2004-03-15  Martin Baulig  <martin@ximian.com>
11494
11495         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11496         we're a ConstructedType; in this case, the caller must report an
11497         error (for instance CS0131).
11498
11499         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11500         (TypeArguments.Resolve): Actually report errors here.
11501
11502 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11503
11504         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11505         `set_indexer_name' to the pending bits (one per type).
11506
11507         We fixed a bug today that was picking the wrong method to
11508         override, since for properties the existing InterfaceMethod code
11509         basically ignored the method name.  Now we make sure that the
11510         method name is one of the valid indexer names.
11511
11512 2004-03-15  Martin Baulig  <martin@ximian.com>
11513
11514         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11515         for generic instances.
11516
11517 2004-03-13  Martin Baulig  <martin@ximian.com>
11518
11519         * class.cs (TypeContainer.DefineType): Call
11520         TypeManager.AddUserType() immediately after creating the
11521         TypeBuilder; pass all type parameters when creating the
11522         CurrentType.
11523
11524         * decl.cs (DeclSpace.FindNestedType): New public method.
11525         (DeclSpace.FindType): Added `int num_type_args' argument; only
11526         return types with the correct number of type parameters.
11527         (DeclSpace.CountTypeParams): New public property.
11528
11529         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11530         the number of type parameters; defaults to zero.
11531
11532         * generic.cs (TypeArguments.Count): New public property.
11533         (ConstructedType.DoResolveAsTypeStep): First call
11534         ds.FindNestedType() to find out whether we're nested in the
11535         current generic type; in this case, we inherit all type parameters
11536         from the current class.
11537
11538         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11539         num_type_args' argument.
11540         (RootContext.LookupType): Added overloaded version which takes the
11541         number of type arguments; only return types with the correct
11542         number of type arguments.
11543
11544         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11545         checks whether `Type t' has `int num_type_args'.
11546
11547 2004-03-13  Martin Baulig  <martin@ximian.com>
11548
11549         * generic.cs (GenericMethod.DefineType): New method; calls
11550         DefineType() on all the type parameters.
11551
11552         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11553         (MethodData.Define): If we're a generic method, call
11554         GenericMethod.DefineType() to define the type parameters.       
11555
11556 2004-03-10  Martin Baulig  <martin@ximian.com>
11557
11558         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11559         instead of IsAssignableFrom.    
11560
11561 2004-03-10  Martin Baulig  <martin@ximian.com>
11562
11563         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11564
11565         * support.cs (ParameterData.HasArrayParameter): New property.
11566         (ReflectionParameters.ctor): Take a MethodBase instead of a
11567         ParameterInfo[].  If we have any type parameters, get the generic
11568         method definition and ask it whether we have variable arguments.
11569
11570 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11571
11572         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11573         routines to check if a type is an enumerable/enumerator allow
11574         classes that implement the IEnumerable or IEnumerator interfaces.
11575
11576         * class.cs (Property, Operator): Implement IIteratorContainer, and
11577         implement SetYields.
11578
11579         (Property.Define): Do the block swapping for get_methods in the
11580         context of iterators.   We need to check if Properties also
11581         include indexers or not.
11582
11583         (Operator): Assign the Block before invoking the
11584         OperatorMethod.Define, so we can trigger the Iterator code
11585         replacement. 
11586
11587         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11588         Property and Operator classes are not created when we parse the
11589         declarator but until we have the block completed, so we use a
11590         singleton SimpleIteratorContainer.Simple to flag whether the
11591         SetYields has been invoked.
11592
11593         We propagate this setting then to the Property or the Operator to
11594         allow the `yield' to function.
11595
11596 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11597
11598         * codegen.cs: Implemented attribute support for modules.
11599         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11600         Assembly/Module functionality.
11601
11602         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11603         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11604         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11605
11606 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11607
11608         * interface.cs (FindMembers): The operation is performed on all base
11609         interfaces and not only on the first. It is required for future CLS Compliance patch.
11610
11611 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11612
11613         * statement.cs, codegen.cs:
11614         This patch deals with patterns such as:
11615
11616         public class List : IEnumerable {
11617
11618                 public MyEnumerator GetEnumerator () {
11619                         return new MyEnumerator(this);
11620                 }
11621
11622                 IEnumerator IEnumerable.GetEnumerator () {
11623                         ...
11624                 }
11625                 
11626                 public struct MyEnumerator : IEnumerator {
11627                         ...
11628                 }
11629         }
11630
11631         Before, there were a few things we did wrong:
11632         1) we would emit callvirt on a struct, which is illegal
11633         2) we emited ldarg when we needed to emit ldarga
11634         3) we would mistakenly call the interface methods on an enumerator
11635         type that derived from IEnumerator and was in another assembly. For example:
11636
11637         public class MyEnumerator : IEnumerator
11638
11639         Would have the interface methods called, even if there were public impls of the
11640         method. In a struct, this lead to invalid IL code.
11641
11642 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11643
11644         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11645           renamed to Emit.
11646
11647         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11648
11649 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11650
11651         * cs-parser.jay: Fix small regression: we were not testing V2
11652         compiler features correctly.
11653
11654         * interface.cs: If the emit context is null, then create one
11655
11656 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11657
11658         * decl.cs (GetSignatureForError): New virtual method to get full name
11659           for error messages.
11660
11661         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11662           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11663
11664         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11665           Duplicated members and code in these classes has been removed.
11666           Better encapsulation in these classes.
11667
11668 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11669
11670         * assign.cs (Assign.DoResolve): When dealing with compound
11671         assignments, there is a new rule in ECMA C# 2.4 (might have been
11672         there before, but it is documented here) that states that in:
11673
11674         a op= b;
11675
11676         If b is of type int, and the `op' is a shift-operator, then the
11677         above is evaluated as:
11678
11679         a = (int) a op b 
11680
11681         * expression.cs (Binary.ResolveOperator): Instead of testing for
11682         int/uint/long/ulong, try to implicitly convert to any of those
11683         types and use that in pointer arithmetic.
11684
11685         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11686         method to print information for from the type, not from the
11687         null-method we were given.
11688
11689 2004-02-01  Duncan Mak  <duncan@ximian.com>
11690
11691         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11692         parsing for cmd, fixes bug #53694.
11693
11694 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11695
11696         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11697         in the member name duplication tests. Property and operator name duplication
11698         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11699
11700 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11701
11702         * interface.cs (PopulateMethod): Fixed crash when interface method
11703         returns not existing type (error test cs0246-3.cs).
11704
11705 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11706
11707         * cs-parser.jay (interface_accessors): Re-write actions to also
11708         store attributes attached to get and set methods. Fix spelling
11709         while at it.
11710
11711         (inteface_property_declaration): Modify accordingly.
11712
11713         (InterfaceAccessorInfo): New helper class to store information to pass
11714         around between rules that use interface_accessors.
11715
11716         * interface.cs (Emit): Apply attributes on the get and set
11717         accessors of properties and indexers too.
11718
11719         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11720         right MethodBuilder when applying attributes to the get and set accessors.
11721
11722 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11723
11724         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11725
11726 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11727
11728         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11729
11730 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11731
11732         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11733         changes that treat `yield' specially when present before `break'
11734         or `return' tokens.
11735
11736         * cs-tokenizer.cs: yield is no longer a keyword.
11737
11738 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11739
11740         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11741         setting for default constructors.
11742         For default constructors are almost every time set wrong Modifier. The
11743         generated IL code has been alright. But inside mcs this values was
11744         wrong and this was reason why several of my CLS Compliance tests
11745         failed.
11746
11747 2004-02-27  Martin Baulig  <martin@ximian.com>
11748
11749         * generics.cs (ConstructedType.ResolveType): Make the nested type
11750         stuff actually work.
11751
11752 2004-02-25  Martin Baulig  <martin@ximian.com>
11753
11754         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11755         property; returns the type parameters just from the current type,
11756         ie. with the ones from outer classes.
11757         (DeclSpace.LookupGeneric): First search in the current class, then
11758         in outer classes.
11759         (DeclSpace.initialize_type_params): When hiding a type parameter
11760         from an outer class, put it into the `type_param_list' anyways.
11761
11762         * expression.cs (MemberAccess.expr): Made this field protected.
11763
11764         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11765         the type parameters from the current class.
11766
11767         * generic.cs (ConstructedType.ResolveType): Support nested generic
11768         types by taking the type parameters which we inherit from outer
11769         classes into account.
11770         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11771         support for nested generic types.
11772
11773 2004-02-23  Martin Baulig  <martin@ximian.com>
11774
11775         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11776         field and check whether we're nested inside a generic type.
11777         (DeclSpace.ResolveType): If we're resolving to a generic type
11778         definition, create a ConstructedType and return its resolved type.
11779         (DeclSpace.initialize_type_params): New private method;
11780         initializes the `type_param_list' field from the type parameters
11781         from this and all enclosing classes.
11782         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11783         we're already initialized.
11784
11785 2004-02-23  Martin Baulig  <martin@ximian.com>
11786
11787         * class.cs (Method.Define): Create the generic method before
11788         calling DoDefine().
11789         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11790         the TypeContainer one); we use this for generic methods.
11791
11792         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11793         parent's TypeBuilder.
11794
11795 2004-02-18  Martin Baulig  <martin@ximian.com>
11796
11797         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11798         to check for equality.
11799
11800 2004-02-05  Martin Baulig  <martin@ximian.com>
11801
11802         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11803         `ec.TypeContainer.CurrentType', use it instead of
11804         `ec.ContainerType' to check whether we're in the type's ctor.
11805
11806 2004-01-29  Martin Baulig  <martin@ximian.com>
11807
11808         * expression.cs (Invocation.DoResolve): If we're a
11809         `ConstructedType', then we're actually a generic method, so
11810         rewrite the expr as a GenericMemberAccess.
11811
11812         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11813         here; manually parse it into a string.
11814
11815 2004-01-28  Martin Baulig  <martin@ximian.com>
11816
11817         * typemanager.cs (TypeManager.IsEqual): New static method.
11818         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11819         check for equality instead of using `=='.
11820
11821 2004-01-26  Martin Baulig  <martin@ximian.com>
11822
11823         * decl.cs (DeclSpace.CurrentType): New public field.
11824
11825         * expression.cs (This.ResolveBase): If we have an
11826         `ec.TypeContainer.CurrentType', use it instead of
11827         `ec.ContainerType'.
11828
11829         * class.cs (TypeContainer.DefineType): If we're a generic type,
11830         create the `CurrentType' (unresolved).
11831         (TypeContainer.GenericType): New private field.
11832         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11833         it and store it in `GenericType' before creating the MemberCache.
11834         (TypeContainer.GetMembers): If we have a `GenericType', call
11835         TypeManager.FindMembers() on it.
11836
11837         * interface.cs (Interface.GenericType): New private field.
11838         (Interface.DefineType): If we're a generic type, create the
11839         `CurrentType' (unresolved).
11840         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11841         and store it in `GenericType' before creating the MemberCache.
11842         (Interface.GetMembers): If we have a `GenericType', call
11843         TypeManager.FindMembers() on it.
11844
11845 2004-01-22  Martin Baulig  <martin@ximian.com>
11846
11847         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11848         not a QualifiedIdentifier.  This is what `type_name_expression'
11849         was previously doing.
11850         (type_name_expression): Removed; the code is now in
11851         `namespace_or_type_name'.
11852         (qualified_identifier): Removed, use `namespace_or_type_name'
11853         instead.
11854         (QualifiedIdentifier): Removed this class.      
11855
11856 2004-01-22  Martin Baulig  <martin@ximian.com>
11857
11858         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11859         not a string as alias name.
11860
11861 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11862
11863         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11864         #52730 bug, and instead compute correctly the need to use a
11865         temporary variable when requesting an address based on the
11866         static/instace modified of the field and the constructor.
11867  
11868 2004-01-21  Martin Baulig  <martin@ximian.com>
11869
11870         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11871         class and namespace before looking up aliases.  Fixes #52517.
11872
11873 2004-01-21  Martin Baulig  <martin@ximian.com>
11874
11875         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11876         assinged in a 'try'; fixes exception4.cs.
11877
11878 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11879         * class.cs : Implemented parameter-less constructor for TypeContainer
11880
11881         * decl.cs: Attributes are now stored here. New property OptAttributes
11882
11883         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11884
11885         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11886
11887 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11888
11889         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11890           (CSharpSignature): New method for indexer and property signature.
11891
11892 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11893
11894         * pending.cs (IsVirtualFilter): Faster implementation.
11895
11896 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11897
11898         * typemanager.cs: Avoid inclusion of same assembly more than once.
11899
11900 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11901
11902         * cs-parser.jay: Fixed problem where the last assembly attribute
11903           has been applied also to following declaration (class, struct, etc.)
11904           
11905 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11906
11907         * class.cs: Added error CS0538, CS0539 reporting.
11908         Fixed crash on Microsoft runtime when field type is void.
11909
11910         * cs-parser.jay: Added error CS0537 reporting.
11911
11912         * pending.cs: Added error CS0535 reporting.
11913         Improved error report for errors CS0536, CS0534.
11914
11915 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11916
11917         Merge a few bits from the Anonymous Method MCS tree.
11918
11919         * statement.cs (ToplevelBlock): New class for toplevel methods,
11920         will hold anonymous methods, lifted variables.
11921
11922         * cs-parser.jay: Create toplevel blocks for delegates and for
11923         regular blocks of code. 
11924
11925 2004-01-20  Martin Baulig  <martin@ximian.com>
11926
11927         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11928         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11929         and `NeedExplicitReturn'; added `IsLastStatement'.
11930         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11931         have a `ReturnLabel' or we're not unreachable.
11932
11933         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11934         child's reachability; don't just override ours with it.  Fixes
11935         #58058 (lluis's example).
11936         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11937         InFinally(), InLoop(), InSwitch() and
11938         BreakCrossesTryCatchBoundary() methods.
11939
11940         * statement.cs (Return): Do all error checking in Resolve().
11941         Unless we are the last statement in a top-level block, always
11942         create a return label and jump to it.
11943         (Break, Continue): Do all error checking in Resolve(); also make
11944         sure we aren't leaving a `finally'.
11945         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11946         statement in a top-level block.
11947         (Block.Flags): Added `IsDestructor'.
11948         (Block.IsDestructor): New public property.
11949
11950 2004-01-20  Martin Baulig  <martin@ximian.com>
11951
11952         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11953
11954 2004-01-20  Martin Baulig  <martin@ximian.com>
11955
11956         * statement.cs (Statement.ResolveUnreachable): New public method.
11957         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11958         (Block.Resolve): Resolve unreachable statements.
11959
11960 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11961
11962         * expression.cs: We need to fix the case where we do
11963         not have a temp variable here.
11964
11965         * assign.cs: Only expression compound assignments need
11966         temporary variables.
11967
11968 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11969
11970         * flowanalysis.cs: Reduce memory allocation in a few ways:
11971           - A block with no variables should not allocate a bit
11972             vector for itself.
11973           - A method with no out parameters does not need any tracking
11974             for assignment of the parameters, so we need not allocate
11975             any data for it.
11976           - The arrays:
11977                 public readonly Type[] VariableTypes;
11978                 public readonly string[] VariableNames;
11979             Are redundant. The data is already stored in the variable
11980             map, so we need not allocate another array for it.
11981           - We need to add alot of checks for if (params | locals) == null
11982             due to the first two changes.
11983
11984 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11985
11986         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11987         implement IMemoryLocation, we store a copy on a local variable and
11988         take the address of it.  Patch from Benjamin Jemlich
11989
11990         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11991         to use a special "type_name_expression" rule which reduces the
11992         number of "QualifiedIdentifier" classes created, and instead
11993         directly creates MemberAccess expressions.
11994
11995 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11996
11997         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11998         that fixes #52853.  Null literal assignment to ValueType
11999
12000         * class.cs (MethodData.Emit): Instead of checking the name of the
12001         method to determine if its a destructor, create a new derived
12002         class from Method called Destructor, and test for that.  
12003
12004         * cs-parser.jay: Create a Destructor object instead of a Method.  
12005
12006         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12007
12008         Fixes: 52933
12009
12010 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12011
12012         * expression.cs (Binary.ResolveOperator): Perform an implicit
12013         conversion from MethodGroups to their delegate types on the
12014         Addition operation.
12015
12016         * delegate.cs: Introduce a new class DelegateCreation that is the
12017         base class for `NewDelegate' and `ImplicitDelegateCreation',
12018         factor some code in here.
12019
12020         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12021         conversion from MethodGroups to compatible delegate types. 
12022
12023         * ecore.cs (Expression.Resolve): Do not flag error 654
12024         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12025         we allow conversions from MethodGroups to delegate types now.
12026
12027         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12028         assignments in v2 either.
12029
12030 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12031
12032         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12033         static read-only fields in ctors.
12034
12035         Applied patch from Benjamin Jemlich 
12036
12037         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12038
12039 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12040
12041         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12042         here to return true, as they can be used like this:
12043
12044                 (XXX) int.MEMBER ()
12045
12046         Fixed 49836 and all the other dups
12047
12048 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12049
12050         * driver.cs: Implement /win32res and /win32icon.
12051
12052 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12053
12054         * cs-parser.jay: Add a rule to improve error handling for the
12055         common mistake of placing modifiers after the type.
12056
12057 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12058
12059         * cs-parser.jay (interface_event_declaration): Catch
12060         initialization of events on interfaces, and report cs0068
12061
12062         * cs-parser.jay (interface_event_declaration): Catch
12063         initialization of events. 
12064
12065         * ecore.cs: Better report missing constructors.
12066
12067         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12068         the error reporting done in the wrong place.  Fix.
12069
12070         * expression.cs (Binary.ResolveOperator): Catch the 
12071         operator + (E x, E y) error earlier, and later allow for implicit
12072         conversions in operator +/- (E e, U x) from U to the underlying
12073         type of E.
12074
12075         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12076         52596, if the container class is abstract, the default constructor
12077         is protected otherwise its public (before, we were always public).
12078
12079         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12080         fixed statement.
12081
12082         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12083         Jemlich that fixes bug #52597, MCS was generating invalid code for
12084         idisposable structs.   Thanks to Ben for following up with this
12085         bug as well.
12086
12087 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12088
12089         * driver.cs: Allow assemblies without code to be generated, fixes
12090         52230.
12091
12092 2004-01-07  Nick Drochak <ndrochak@gol.com>
12093
12094         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12095
12096 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12097
12098         * cs-parser.jay: Add rules to improve error reporting if fields or
12099         methods are declared at the namespace level (error 116)
12100
12101         * Add rules to catch event add/remove
12102
12103 2004-01-04  David Sheldon <dave-mono@earth.li>
12104
12105   * expression.cs: Added matching ")" to error message for 
12106   CS0077
12107
12108 2004-01-03 Todd Berman <tberman@gentoo.org>
12109
12110         * ecore.cs, attribute.cs:
12111         Applying fix from #52429.
12112
12113 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12114
12115         * ecore.cs, expression.cs, statement.cs:
12116         Total rewrite of how we handle branching. We
12117         now handle complex boolean expressions with fewer
12118         jumps. As well if (x == 0) no longer emits a ceq.
12119
12120         if (x is Foo) is much faster now, because we generate
12121         better code.
12122
12123         Overall, we get a pretty big improvement on our benchmark
12124         tests. The code we generate is smaller and more readable.
12125
12126         I did a full two-stage bootstrap. The patch was reviewed
12127         by Martin and Miguel.
12128
12129 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12130
12131         * cs-parser.jay: Make primary_expression not take a QI.
12132         we dont need this because the member_access rule covers
12133         us here. So we replace the rule with just IDENTIFIER.
12134
12135         This has two good effects. First, we remove a s/r conflict.
12136         Second, we allocate many fewer QualifiedIdentifier objects.
12137
12138 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12139
12140         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12141         set the correct information via SRE. This prevents
12142         hanging on the MS runtime. Fixes #29374.
12143
12144 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12145
12146         * convert.cs: correctly handle conversions to value types
12147         from Enum and ValueType as unboxing conversions.
12148
12149         Fixes bug #52569. Patch by Benjamin Jemlich.
12150
12151 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12152
12153         * expression.cs (BetterConversion): Prefer int -> uint
12154         over int -> ulong (csc's behaviour). This fixed bug #52046.
12155
12156 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12157
12158         * decl.cs (MemberCache.FindMembers): now returns a
12159         MemberInfo [].
12160
12161         * typemanager.cs: In general, go with with ^^.
12162         (CopyNewMethods): take an IList.
12163         (RealMemberLookup): Only allocate an arraylist
12164         if we copy from two sets of methods.
12165
12166         This change basically does two things:
12167         1) Fewer array lists allocated due to CopyNewMethods.
12168         2) the explicit cast in MemberList costed ALOT.
12169
12170 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12171
12172         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12173         a hashtable to avoid needless string allocations when an identifier is
12174         used more than once (the common case).
12175
12176 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12177
12178         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12179         is broken, it will not return anything. So, we
12180         have to use the information we have in mcs to
12181         do the task.
12182
12183         * typemanager.cs: Add a cache for GetInterfaces,
12184         since this will now be used more often (due to ^^)
12185
12186         (GetExplicitInterfaces) New method that gets the
12187         declared, not effective, interfaces on a type
12188         builder (eg, if you have interface IFoo, interface
12189         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12190         { IBar }.
12191
12192         This patch makes MCS able to bootstrap itself on
12193         Windows again.
12194
12195 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12196
12197         * expression.cs: Remove the Nop's that Miguel put
12198         in by mistake.
12199
12200 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12201
12202         * report.cs, codegen.cs: Give the real stack trace to
12203         the error when an exception is thrown.
12204
12205 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12206
12207         * decl.cs: only allocate hashtables for ifaces if 
12208         it is an iface!
12209
12210 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12211
12212         * expression.cs: fix the error from cs0121-2.cs
12213         (a parent interface has two child interfaces that
12214         have a function with the same name and 0 params
12215         and the function is called through the parent).
12216
12217 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12218
12219         * class.cs, rootcontext.cs, typmanager.cs: do not
12220         leak pointers.
12221
12222 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12223
12224         * codegen.cs: remove stack for the ec flow branching.
12225         It is already a linked list, so no need.
12226
12227 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12228
12229         * Makefile: Allow custom profiler here.
12230
12231 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12232
12233         * typemanager.cs (LookupType):
12234           - Use a static char [], because split takes
12235             a param array for args, so it was allocating
12236             every time.
12237           - Do not store true in a hashtable, it boxes.
12238
12239 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12240
12241         * flowanalysis.cs: bytify common enums.
12242
12243 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12244
12245         * modifiers.cs: Add a new set of flags for the
12246         flags allowed on explicit interface impls.
12247         * cs-parser.jay: catch the use of modifiers in
12248         interfaces correctly.
12249         * class.cs: catch private void IFoo.Blah ().
12250
12251         All related to bug #50572.
12252
12253 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12254
12255         * decl.cs: Rewrite the consistant accessability checking.
12256         Accessability is not linear, it must be implemented in
12257         a tableish way. Fixes #49704.
12258
12259 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12260
12261         * expression.cs: Handle negation in a checked context.
12262         We must use subtraction from zero. Fixes #38674.
12263
12264 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12265
12266         * class.cs: Ignore static void main in DLLs.
12267         * rootcontext.cs: Handle the target type here,
12268         since we are have to access it from class.cs
12269         * driver.cs: account for the above.
12270
12271 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12272
12273         * report.cs: Give line numbers and files if available.
12274
12275 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12276
12277         * driver.cs: Implement /addmodule.
12278
12279         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12280         ModuleBuilders.
12281
12282 2003-12-20  Martin Baulig  <martin@ximian.com>
12283
12284         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12285         (FieldBase.IsAssigned): Removed this field.
12286         (FieldBase.SetAssigned): New public method.
12287         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12288
12289 2003-12-20  Martin Baulig  <martin@ximian.com>
12290
12291         * expression.cs (LocalVariableReference.DoResolve): Don't set
12292         `vi.Used' if we're called from DoResolveLValue().
12293
12294         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12295         returns the usage vector it just merged into the current one -
12296         pass this one to UsageWarning().
12297         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12298         of the `EmitContext', don't call this recursively on our children.
12299
12300 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12301
12302         * driver.cs: Implement /target:module.
12303
12304 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12305
12306         * support.cs (CharArrayHashtable): New helper class.
12307
12308         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12309         char arrays, not strings, so we can avoid creating a string in
12310         consume_identifier if the identifier is a keyword.
12311
12312 2003-12-16  Martin Baulig  <martin@ximian.com>
12313
12314         * statement.cs (LocalInfo.Assigned): Removed this property.
12315         (LocalInfo.Flags): Removed `Assigned'.
12316         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12317         and uses flow analysis.
12318         (Block.UsageWarning): Made this method private.
12319         (Block.Resolve): Call UsageWarning() if appropriate.
12320
12321         * expression.cs (LocalVariableReference.DoResolve): Always set
12322         LocalInfo.Used here.
12323
12324 2003-12-13  Martin Baulig  <martin@ximian.com>
12325
12326         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12327         any value here; we're now using flow analysis to figure out
12328         whether a statement/block returns a value.
12329
12330 2003-12-13  Martin Baulig  <martin@ximian.com>
12331
12332         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12333         working again.
12334         (FlowBranching.MergeFinally): Don't call
12335         `branching.CheckOutParameters()' here, this is called in
12336         MergeTopBlock().
12337         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12338         when adding the `finally' vector.       
12339
12340 2003-12-13  Martin Baulig  <martin@ximian.com>
12341
12342         * flowanalysis.cs
12343         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12344         actually work and also fix #48962.
12345
12346 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12347
12348         * decl.cs: Do not check System.Object for nested types,
12349         since we know it does not have any. Big bang for buck:
12350
12351         BEFORE:
12352            Run 1:   8.35 seconds
12353            Run 2:   8.32 seconds
12354            corlib:  17.99 seconds
12355         AFTER:
12356            Run 1:   8.17 seconds
12357            Run 2:   8.17 seconds
12358            corlib:  17.39 seconds
12359
12360 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12361
12362         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12363         time we are returning 0 members, so we save alot here.
12364
12365 2003-12-11  Martin Baulig  <martin@ximian.com>
12366
12367         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12368         `MergeChild()', also just take the `FlowBranching' as argument;
12369         call Merge() on it and return the result.
12370         (FlowBranching.Merge): We don't need to do anything if we just
12371         have one sibling.
12372
12373 2003-12-11  Martin Baulig  <martin@ximian.com>
12374
12375         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12376         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12377         Maurer for this idea.
12378
12379 2003-12-11  Martin Baulig  <martin@ximian.com>
12380
12381         * flowanalysis.cs (MergeResult): This class is now gone; we now
12382         use the `UsageVector' for this.  The reason for this is that if a
12383         branching just has one sibling, we don't need to "merge" them at
12384         all - that's the next step to do.
12385         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12386         `MergeResult'.
12387
12388 2003-12-11  Martin Baulig  <martin@ximian.com>
12389
12390         Reworked flow analyis and made it more precise and bug-free.  The
12391         most important change is that we're now using a special `Reachability'
12392         class instead of having "magic" meanings of `FlowReturns'.  I'll
12393         do some more cleanups and optimizations and also add some more
12394         documentation this week.
12395
12396         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12397         largely reworked this class.
12398         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12399         the new `Reachability' class instead of having "magic" values here.
12400         (FlowBranching): We're now using an instance of `Reachability'
12401         instead of having separate `Returns', `Breaks' etc. fields.
12402
12403         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12404         based on flow analysis; ignore the return value of block.Emit ().
12405
12406 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12407
12408         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12409         if they are private.
12410
12411 2003-12-09  Martin Baulig  <martin@ximian.com>
12412
12413         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12414         call them directly on the UsageVector.
12415
12416 2003-12-09  Martin Baulig  <martin@ximian.com>
12417
12418         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12419         Changed return type from `FlowReturns' to `Reachability'.
12420
12421 2003-12-09  Martin Baulig  <martin@ximian.com>
12422
12423         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12424         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12425         `Reachable' fields with a single `Reachability' one.
12426
12427 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12428
12429         * class.cs (FindMembers): Remove foreach's.
12430
12431         Bootstrap times:
12432
12433         BEFORE
12434                 Run 1:   8.74 seconds
12435                 Run 2:   8.71 seconds
12436
12437         AFTER
12438                 Run 1:   8.64 seconds
12439                 Run 2:   8.58 seconds
12440
12441
12442 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12443
12444         * cs-parser.jay:
12445         * gen-treedump.cs:
12446         * statement.cs:
12447         This patch does a few things:
12448                 1. EmptyStatement is now a singleton, so it is never reallocated.
12449                 2. All blah is EmptyStatement constructs have been changed to
12450                    blah == EmptyStatement.Value, which is much faster and valid
12451                    now that EmptyStatement is a singleton.
12452                 3. When resolving a block, rather than allocating a new array for
12453                    the non-empty statements, empty statements are replaced with
12454                    EmptyStatement.Value
12455                 4. Some recursive functions have been made non-recursive.
12456         Mainly the performance impact is from (3), however (1) and (2) are needed for
12457         this to work. (4) does not make a big difference in normal situations, however
12458         it makes the profile look saner.
12459
12460         Bootstrap times:
12461
12462         BEFORE
12463         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12464         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12465         Total memory allocated: 56397 KB
12466
12467         AFTER
12468         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12469         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12470         Total memory allocated: 55666 KB
12471
12472 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12473
12474         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12475         than the hashtable in a hashtable version
12476
12477         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12478         we always end up concating a string. This results in a huge perf
12479         loss, because many strings have to be tracked by the GC. In this
12480         patch, we first use a hashtable that works with two keys, so that
12481         the strings do not need to be concat'ed.
12482
12483         Bootstrap times:
12484         BEFORE
12485                 Run 1:   8.74 seconds
12486                 Run 2:   8.71 seconds
12487
12488         AFTER
12489                 Run 1:   8.65 seconds
12490                 Run 2:   8.56 seconds
12491
12492 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12493
12494         * Makefile: Add a new target `do-time' that does a quick and simple
12495         profile, leaving easy to parse output.
12496
12497 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12498
12499         * codegen.cs (Init): Create the dynamic assembly with 
12500         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12501
12502 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12503
12504         * support.cs: Make the PtrHashtable use only one
12505         instance of its comparer.
12506
12507 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12508
12509         * typemanager.cs: Fix lookup of GetNamespaces.
12510
12511 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12512
12513         * expression.cs: Removed redundant line.
12514
12515         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12516         ArrayLists, use for loops with bounds.  
12517
12518         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12519         arraylist.
12520
12521         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12522         arraylists, use for loop with bounds.
12523
12524         The above three changes give us a 0.071 second performance
12525         improvement out of 3.294 seconds down to 3.223.  On my machine
12526         the above changes reduced the memory usage by 1,387 KB during
12527         compiler bootstrap.
12528
12529         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12530         QualifiedIdentifiers.  Before we created a new string through
12531         concatenation, and mostly later on, the result would be
12532         manipulated by DecomposeQI through string manipulation.
12533
12534         This reduced the compiler memory usage for bootstrapping from
12535         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12536         compile times in 0.05 seconds.
12537
12538 2003-11-28  Dick Porter  <dick@ximian.com>
12539
12540         * support.cs: Do string compares with the Invariant culture.
12541
12542         * rootcontext.cs: 
12543         * gen-treedump.cs: 
12544         * expression.cs: 
12545         * driver.cs: 
12546         * decl.cs: 
12547         * codegen.cs: 
12548         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12549         the comparison is done with the Invariant culture.
12550
12551 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12552
12553         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12554         GetEnumerator method.
12555
12556         (ProbeCollectionType): Iterate starting at the most specific type
12557         upwards looking for a GetEnumerator
12558
12559         * expression.cs: Shift count can be up to 31 for int/uint and 63
12560         for long/ulong.
12561
12562 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12563
12564         * statement.cs (Block.LookupLabel): Also look for the label on the
12565         children blocks.  Use a hash table to keep track of visited
12566         nodes. 
12567
12568         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12569         we actually did transform the other operand, otherwise fall back
12570         to the common codepath that casts to long.
12571
12572         * cs-tokenizer.cs: Use the same code pattern as the int case.
12573         Maybe I should do the parsing myself, and avoid depending on the
12574         Parse routines to get this done.
12575
12576 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12577
12578         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12579         which fixes bug 51347.  This time test it.
12580
12581         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12582         attributes for example can not tell the difference between these.
12583         The difference was only a syntax feature of the language. 
12584
12585         * attribute.cs: Apply attributes to delegates.
12586
12587         * delegate.cs: Call the apply attributes method.
12588
12589 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12590
12591         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12592         comparing 0 vs Byte.MinValue, not the value
12593
12594         (ImplicitConversionRequired): When reporting a conversion error,
12595         use error 31 to print out the constant error instead of the
12596         simpler 29.
12597
12598         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12599         which fixes bug 51347.
12600
12601 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12602
12603         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12604         which fixes the -warnaserror command line option.
12605
12606 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12607
12608         * cfold.cs (DoNumericPromotions): During constant folding of
12609         additions on UIntConstant, special case intconstants with
12610         IntConstants like we do on the expression binary operator. 
12611
12612 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12613
12614         * convert.cs (ImplicitReferenceConversion): We were missing a case
12615         (System.Enum are not value types or class types, so we need to
12616         classify them separatedly).
12617
12618         * driver.cs: We do not support error 2007.
12619
12620 2003-11-12 Jackson Harper <jackson@ximian.com>
12621
12622         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12623         system directory. Also use the full file name so users can
12624         libraries names mscorlib-o-tron.dll in a non system dir.
12625         
12626 2004-01-04  David Sheldon <dave-mono@earth.li>
12627
12628         * expression.cs: Added matching ")" to error message for CS0077.
12629
12630 2003-12-19  Martin Baulig  <martin@ximian.com>
12631
12632         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12633         static method; see documentation in the method.
12634         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12635
12636         * convert.cs (Convert.ImplicitReferenceConversion,
12637         Convert.ImplicitReferenceConversionExists): Add support for
12638         generic type declarations; see gen-36.cs.
12639
12640 2003-12-19  Martin Baulig  <martin@ximian.com>
12641
12642         * pending.cs (Pending.InterfaceMethod): Use
12643         `Type.IsAssignableFrom()' instead of `=='.
12644
12645 2003-12-18  Martin Baulig  <martin@ximian.com>
12646
12647         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12648         byref types first.
12649
12650         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12651         `expr_type.Equals (target_type)' instead of `=='.
12652
12653 2003-12-08  Martin Baulig  <martin@ximian.com>
12654
12655         * generics.cs (Constraints.Types): Removed.
12656         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12657         to Type's.
12658         (Constraints.ResolveTypes): New public method; resolves the
12659         TypeExpr's to Type's.
12660         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12661         longer takes the constraints.
12662         (TypeParameter.DefineMethod): Likewise.
12663         (TypeParameter.DefineType): New public method.  Calls
12664         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12665         the constraints.
12666
12667 2003-12-08  Martin Baulig  <martin@ximian.com>
12668
12669         * convert.cs (Convert.ImplicitConversionStandard): Use
12670         `expr_type.Equals (target_type)' instead of `=='.
12671
12672 2003-12-08  Martin Baulig  <martin@ximian.com>
12673
12674         * typemanager.cs (TypeManager.GetReferenceType): Call
12675         `Type.MakeByRefType ()'.
12676
12677 2003-12-08  Martin Baulig  <martin@ximian.com>
12678
12679         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12680         just has some special meaning in some situations.  For instance,
12681         it is allowed to use `where' as the name of a variable etc.
12682
12683 2003-12-04  Martin Baulig  <martin@ximian.com>
12684
12685         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12686         `Type.MakeArrayType()' for array types.
12687
12688 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12689
12690         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12691         debugging message.
12692
12693         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12694         corlib to compile.
12695
12696 2003-11-16  Martin Baulig  <martin@ximian.com>
12697
12698         * codegen.cs (EmitContext.IsGeneric): Removed.
12699
12700         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12701         ResolveGeneric() on the DeclSpace.
12702
12703 2003-11-16  Martin Baulig  <martin@ximian.com>
12704
12705         * generic.cs (TypeArguments.Resolve):
12706         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12707         `ResolveType()' on it to get the Type.
12708
12709 2003-11-15  Martin Baulig  <martin@ximian.com>
12710
12711         * generic.cs (ConstructedType.GetInterfaces): Override this.
12712
12713 2003-11-14  Martin Baulig  <martin@ximian.com>
12714
12715         * interface.cs (Interface.DefineType): Define all type parameters
12716         before adding the interfaces we inherit.
12717
12718 2003-11-11  Martin Baulig  <martin@ximian.com>
12719
12720         * generic.cs (ConstructedType.ResolveType): Always call
12721         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12722
12723 2003-11-10  Martin Baulig  <martin@ximian.com>
12724
12725         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12726         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12727         calling `ResolveType()' on them, directly assign their `Type'.
12728
12729 2003-11-08  Martin Baulig  <martin@ximian.com>
12730
12731         * generic.cs (ConstructedType): Override `IsClass' etc.
12732
12733 2003-11-08  Martin Baulig  <martin@ximian.com>
12734
12735         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12736         return value and the `out parent' parameter.
12737         (TypeContainer.DefineType): Moved the CS0644 check into
12738         GetClassBases().  Don't pass the interface types to the
12739         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12740         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12741
12742         * ecore.cs (TypeExpr.IsAttribute): New property.
12743         (TypeExpr.GetInterfaces): New method.
12744
12745         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12746         TypeExpr instead of a Type.
12747         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12748         (Interface.DefineType): Don't pass the interface types to the
12749         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12750         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12751
12752         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12753         instead of a `Type[]'.
12754         (TypeManager.RegisterBuilder): Likewise.
12755         (TypeManager.AddUserInterface): Likewise.
12756         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12757         `Type[]' and also return a `TypeExpr[]'.
12758         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12759
12760 2003-11-08  Martin Baulig  <martin@ximian.com>
12761
12762         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12763         Expression.     
12764
12765 2003-11-08  Martin Baulig  <martin@ximian.com>
12766
12767         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12768         TypeManager.ResolveExpressionTypes().
12769
12770         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12771         instead of an Expression.
12772         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12773         (TypeExpression): New public class; formerly known as `TypeExpr'.
12774
12775         * expression.cs (ComposedCast): Derive from TypeExpr.
12776
12777         * typemanager.cs (TypeManager.system_*_expr): These are now
12778         TypExpr's instead of Expression's.
12779         (TypeManager.ResolveExpressionTypes): New public static function;
12780         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12781         of them.        
12782
12783 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12784
12785         * expression.cs (New.DoResolve): Do not dereference value that
12786         might be a null return.
12787
12788         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12789         sure that the constant value has the right type.  Fixes an
12790         unreported bug, similar to 50425.
12791
12792         * const.cs (Const.LookupConstantValue): Call
12793         ImplicitStandardConversionExists before doing a conversion to
12794         avoid havng the TypeManager.ChangeType do conversions.
12795
12796         Reduced the number of casts used
12797
12798         (Const.ChangeType): New routine to enable reuse of the constant
12799         type changing code from statement.
12800
12801         * typemanager.cs (ChangeType): Move common initialization to
12802         static global variables.
12803
12804         Fixes #50425.
12805
12806         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12807         every value type to go through, even if it was void.  Fix that. 
12808
12809         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12810         character of the define, and the is_identifier_part_character for
12811         the rest of the string.
12812
12813 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12814
12815         * expression.cs (UnaryMutator.EmitCode): When I updated
12816         LocalVariableReference.DoResolve, I overdid it, and dropped an
12817         optimization done on local variable references.
12818
12819 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12820
12821         * ecore.cs: Convert the return from Ldlen into an int.
12822
12823 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12824
12825         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12826         the accessibility, this is a special case for toplevel non-public
12827         classes (internal for instance).
12828
12829 2003-10-20  Nick Drochak <ndrochak@gol.com>
12830
12831         * ecore.cs: Fix typo and build.  Needed another right paren.
12832
12833 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12834
12835         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12836         `internal' case regular and protected, but not allowing protected
12837         to be evaluated later.  Bug 49840
12838
12839 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12840
12841         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12842         to kb.Nlast, and not the kb.nFirst to isolate the switch
12843         statement.
12844
12845         Extract the underlying type, so enumerations of long/ulong are
12846         treated like long/ulong.
12847
12848 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12849
12850         * expression.cs (New): Overload the meaning of RequestedType to
12851         track the possible creation of the NewDelegate type, since
12852         DoResolve is invoked more than once for new constructors on field
12853         initialization.
12854
12855         See bugs: #48800 and #37014
12856
12857         * cs-parser.jay (declare_local_constants): Take an arraylist
12858         instead of a single constant.
12859
12860         (local_constant_declaration): It should take a
12861         constant_declarators, not a constant_declarator.  Fixes 49487
12862
12863         * convert.cs: Fix error report.
12864
12865 2003-10-13 Jackson Harper <jackson@ximian.com>
12866
12867         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12868         bug #49611
12869         
12870 2003-11-03  Martin Baulig  <martin@ximian.com>
12871
12872         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12873         `out bool has_type_arg'; if set, we need to pass the type to
12874         ig.Emit().
12875         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12876         Stelem_Any/Ldelem_Any for generic parameters.   
12877
12878 2003-11-02  Martin Baulig  <martin@ximian.com>
12879
12880         * expression.cs (Invocation.EmitCall): Use
12881         `TypeManager.IsValueType()' to check whether it's a value type.
12882         Don't set `struct_call' when calling a method on a type parameter.
12883
12884 2003-11-02  Martin Baulig  <martin@ximian.com>
12885
12886         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12887         and removed the TypeBuilder argument.
12888
12889         * typemanager.cs (TypeManager.IsValueType): Return
12890         `t.IsGenericParameter || t.IsValueType'.
12891
12892 2003-10-25  Martin Baulig  <martin@ximian.com>
12893
12894         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12895         call ConstructedType.Resolve() on it.
12896
12897         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12898
12899 2003-10-25  Martin Baulig  <martin@ximian.com>
12900
12901         * class.cs (TypeContainer.GetClassBases): Changed
12902         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12903         CS8214 reporting here.
12904         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12905         instead of a `Type' for our parent.  In case of a recursive
12906         declaration (see tests/gen-23.cs for an example), our parent is a
12907         ConstructedType and it doesn't have its type set.  So, first
12908         create our own TypeBuilder, then call constructed.Resolve() to get
12909         the parent's type and finally TypeBuilder.SetParent() it.
12910
12911         * ecore.cs (TypeExpr.Name): New public virtual property.
12912
12913         * generic.cs
12914         (ConstructedType): We're now a TypeExpr and not just an Expression.
12915         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12916         arguments here; this is done later.
12917         (ConstructedType.Resolve): New public method to resolve the type
12918         arguments and bind them.
12919
12920 2003-10-21  Martin Baulig  <martin@ximian.com>
12921
12922         * convert.cs: Use `TypeManager.IsValueType' instead of
12923         'type.IsValueType' everywhere.
12924
12925         * typemanager.cs (TypeManager.IsValueType): Return true for type
12926         parameters.  The reason for this is that we need to box a type
12927         parameter when converting it to a reference type.
12928
12929         * cs-parser.jay: Added support for default value expressions.
12930
12931         * generics.cs (DefaultValueExpression): New public class.       
12932
12933 2003-10-17  Martin Baulig  <martin@ximian.com>
12934
12935         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12936         TypeContainer so we can also use this for Interfaces.
12937         (TypeParameter.Resolve): Likewise.
12938
12939         * interface.cs (Interface.DefineType): Added support for generic
12940         interfaces.
12941
12942         * cs-parser.jay: Added support for generic structs and interfaces.
12943
12944 2003-10-17  Martin Baulig  <martin@ximian.com>
12945
12946         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12947         call generic methods :-)
12948
12949 2003-10-16  Martin Baulig  <martin@ximian.com>
12950
12951         * cs-parser.jay (namespace_or_type_name): Only create a
12952         GenericMemberAccess if we actually have type arguments.
12953
12954 2003-10-13  Martin Baulig  <martin@ximian.com>
12955
12956         * class.cs (Method.Define): If we're a generic method, call
12957         TypeBuilder.DefineGenericMethod () before resolving
12958         the parameters.
12959         (MethodData): Added .ctor which takes an additional MethodBuilder
12960         argument; this is used for generic methods.
12961         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12962         we already have a MethodBuilder.
12963
12964 2003-10-10  Martin Baulig  <martin@ximian.com>
12965
12966         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12967         instead of a `DeclSpace'.  This is used for generic methods.
12968
12969         * cs-parser.jay (method_header): Added support for generic
12970         methods; create a `GenericMethod' instance and pass it to the
12971         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12972         parameters and locals.
12973
12974         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12975         since we already have the location.  Check whether we're a generic
12976         type declaration or a generic method and create the correct type
12977         parameter.
12978
12979         * generic.cs (TypeParameter.DefineMethod): New public method.
12980         (GenericMethod): New public class; derives from DeclSpace and is
12981         used for generic methods.       
12982
12983 2003-10-09  Martin Baulig  <martin@ximian.com>
12984
12985         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12986         to the .ctor.
12987         (MethodCore.DoDefineParameters): Removed the TypeContainer
12988         argument; use the DeclSpace which was passed to the .ctor instead.
12989         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12990         TypeContainer; we only need a DeclSpace here.
12991
12992 2003-10-09  Martin Baulig  <martin@ximian.com>
12993
12994         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12995         to the .ctor.
12996         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12997         EmitContext's .ctor.    
12998
12999 2003-10-09  Martin Baulig  <martin@ximian.com>
13000
13001         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13002         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13003         AsAccessible(), moved them as well.
13004
13005         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13006
13007 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13008
13009         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13010         generation for >=, as spotted by Paolo, bug 48679.  
13011         Patch from David Waite.
13012
13013         * cs-tokenizer.cs: Add handling for #pragma.
13014
13015         * cs-parser.jay: Allow for both yield and yield return in the
13016         syntax.  The anti-cobolization of C# fight will go on!
13017
13018         * class.cs (TypeBuilder.DefineType): Catch error condition here
13019         (Parent.DefineType erroring out and returning null).
13020
13021         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13022         coping with enumerations variables, we were mistakenly processing
13023         them as a regular value type instead of built-in types.  Fixes the
13024         bug #48063
13025
13026         * typemanager.cs (IsBuiltinOrEnum): New method.
13027
13028 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13029
13030         * cs-parser.jay: Upgrade: yield now needs the return clause.
13031
13032 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13033
13034         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13035
13036 2003-09-29  Martin Baulig  <martin@ximian.com>
13037
13038         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13039         inflated generic methods.
13040
13041         * generics.cs (ConstructedType): Distinguish between open and
13042         closed constructed types; correctly resolve the arguments.
13043
13044 2003-09-22  Martin Baulig  <martin@ximian.com>
13045
13046         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13047         all type arguments meet their constraints.
13048
13049 2003-09-19  Martin Baulig  <martin@ximian.com>
13050
13051         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13052         `MemberCache parent' argument.  Normally, an interface doesn't
13053         have a parent type except System.Object, but we use this in gmcs
13054         for generic type parameters.
13055
13056 2003-09-18  Martin Baulig  <martin@ximian.com>
13057
13058         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13059         on `type.IsInterface'; don't check whether the type has a parent
13060         to determine whether it's an interface.
13061
13062 2003-09-17  Martin Baulig  <martin@ximian.com>
13063
13064         * generic.cs (ConstructedType.ToString): Always use `name' as the
13065         type name.
13066
13067 2003-09-15  Martin Baulig  <martin@ximian.com>
13068
13069         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13070
13071         * generic.cs (Constraints.Resolve): New public method; this is
13072         called to resolve the constraint types and to check whether all
13073         the constraints are correct.
13074         (Constraints.Types): New public property.
13075         (TypeParameter.Resolve): New public method; resolves all the
13076         type's constraints.
13077
13078         * class.cs (TypeContainer.DefineType): Call
13079         TypeParameter.Resolve() before actually defining the type.
13080
13081 2003-09-15  Martin Baulig  <martin@ximian.com>
13082
13083         * class.cs (TypeContainer.DefineType): Added an error flag to
13084         avoid reporting duplicate CS0146's ("class definition is
13085         circular.").
13086
13087         * driver.cs (Driver.MainDriver): Abort if
13088         RootContext.ResolveTree() reported any errors.
13089
13090 2003-09-07  Martin Baulig  <martin@ximian.com>
13091
13092         * report.cs (Error, Warning): Added overloaded versions which take
13093         a `params object[] args' and call String.Format().
13094
13095 2003-09-07  Martin Baulig  <martin@ximian.com>
13096
13097         * decl.cs (DeclSpace..ctor): Don't call
13098         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13099         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13100         (DeclSpace.RecordDecl): New method.
13101
13102         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13103
13104 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13105
13106         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13107         value attributes to be applied to ParameterBuilders.
13108
13109         * class.cs (MethodCore.LabelParameters): Make static and more
13110         generic so that it can be used from other places - like interface
13111         methods, for instance.
13112
13113         * interface.cs (Interface.Emit): Call LabelParameters before
13114         emitting attributes on the InterfaceMethod.
13115
13116 2003-09-07  Martin Baulig  <martin@ximian.com>
13117
13118         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13119         if the number of type parameters doesn't match.
13120
13121 2003-09-04  Martin Baulig  <martin@ximian.com>
13122
13123         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13124         for arrays of generic type params (ie. `!0[]').
13125
13126 2003-09-04  Martin Baulig  <martin@ximian.com>
13127
13128         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13129         for the moment.
13130
13131 2003-09-04  Martin Baulig  <martin@ximian.com>
13132
13133         * decl.cs (DeclSpace.LookupGeneric): New method.
13134         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13135         moment.
13136
13137         * generic.cs (TypeParameterExpr): Take a TypeParameter as
13138         argument, not just a string.
13139         (TypeParameter.Define): New public method; this is called to
13140         actually define the generic parameter; after this, you can use the
13141         new `Type' property to get the type.
13142
13143 2003-09-04  Martin Baulig  <martin@ximian.com>
13144
13145         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13146         is now an ArrayList; initialize the result of the `TypeParameters'
13147         property here.
13148         (DeclSpace.GetGenericData): Removed.
13149         (DeclSpace.LookupGeneric): Temporarily removed; we need to
13150         implement this in a different way.
13151         (DeclSpace.GetTypeParameters): Removed; there's now a
13152         `TypeParameters' property.
13153         (DeclSpace.TypeParameters): New public property.
13154
13155         * generic.cs (Constraints): Make this class public.
13156         (TypeParameter): New public class.
13157
13158 2003-09-04  Martin Baulig  <martin@ximian.com>
13159
13160         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13161         generic parameters.
13162
13163         * class.cs (TypeContainer.DefineType): Call
13164         TypeBuilder.DefineGenericParameter () on all generic parameters if
13165         this is a generic type.
13166
13167 2003-08-28  Martin Baulig  <martin@ximian.com>
13168
13169         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13170         sample-stack.il".
13171
13172         * sample-hello.cs: Compile this with gmcs: "gmcs
13173         /r:sample-stack.dll sample-hello.cs".
13174
13175 2003-08-28  Martin Baulig  <martin@ximian.com>
13176
13177         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13178         the parameters to the generic type.
13179
13180 2003-08-28  Martin Baulig  <martin@ximian.com>
13181
13182         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13183
13184 2003-08-28  Martin Baulig  <martin@ximian.com>
13185
13186         * cs-parser.jay (opt_type_argument_list): Use
13187         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13188         (primary_expression): Replace `qualified_identifier' with `type_name'.
13189         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13190
13191         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13192         parser to check whether it is syntactically a type parameter list;
13193         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13194         this case.
13195
13196 2003-08-26  Martin Baulig  <martin@ximian.com>
13197
13198         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13199         resolving aliases; fixes #47927.
13200
13201 2003-08-26  Martin Baulig  <martin@ximian.com>
13202
13203         * statement.cs (Using.DoResolve): This is internally emitting a
13204         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13205         do not always return.  Fixes #47681.
13206
13207 2003-08-26  Martin Baulig  <martin@ximian.com>
13208
13209         * decl.cs (MemberCore): Moved WarningNotHiding(),
13210         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13211         into MemberBase.
13212         (AdditionResult): Make this nested in DeclSpace.
13213         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13214         argument; call NamespaceEntry.Define() unless we're nested in a
13215         class or struct.
13216
13217         * namespace.cs (Namespace.DefineName): New public function.  This
13218         is called from DeclSpace's .ctor to add 
13219         (Namespace.Lookup): Include DeclSpaces in the lookup.
13220
13221         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13222
13223         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13224
13225 2003-08-25  Martin Baulig  <martin@ximian.com>
13226
13227         * convert.cs (Convert.ExplicitReferenceConversion): When
13228         converting from an interface type to a class, unbox if the target
13229         type is a struct type.  Fixes #47822.
13230
13231 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13232
13233         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13234         #47854.
13235
13236 2003-08-22  Martin Baulig  <martin@ximian.com>
13237
13238         * class.cs (TypeManager.DefineType): When defining a nested type,
13239         call DefineType() on our parent; fixes #47801.
13240
13241 2003-08-22  Martin Baulig  <martin@ximian.com>
13242
13243         * class.cs (MethodData.Define): While checking if a method is an
13244         interface implementation, improve the test a bit more to fix #47654.
13245
13246 2003-08-22  Martin Baulig  <martin@ximian.com>
13247
13248         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13249         correctly; fixes #47722.
13250
13251 2003-08-22  Martin Baulig  <martin@ximian.com>
13252
13253         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13254         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13255
13256         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13257
13258 2003-08-22  Martin Baulig  <martin@ximian.com>
13259
13260         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13261         can only be assigned in static constructors.  Fixes #47161.
13262
13263 2003-08-22  Martin Baulig  <martin@ximian.com>
13264
13265         Rewrote and improved the flow analysis code.
13266
13267         * flowbranching.cs (FlowBranching): Make this class abstract.
13268         (FlowBranching.CreateBranching): New static function to create a
13269         new flow branching.
13270         (FlowBranchingBlock, FlowBranchingException): New classes.
13271         (FlowBranching.UsageVector.Type): New public readonly field.
13272         (FlowBranching.UsageVector.Breaks): Removed the setter.
13273         (FlowBranching.UsageVector.Returns): Removed the setter.
13274         (FlowBranching.UsageVector): Added Break(), Return(),
13275         NeverReachable() and Throw() methods to modify the reachability.
13276         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13277         done by FlowBranching.Merge().
13278         (FlowBranching.UsageVector.MergeChild): New method; merges the
13279         merge result into the current vector.
13280         (FlowBranching.Merge): New abstract method to merge a branching.
13281
13282 2003-08-12  Martin Baulig  <martin@ximian.com>
13283
13284         * expression.cs (Indirection.CacheTemporaries): Create the
13285         LocalTemporary with the pointer type, not its element type.
13286
13287 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13288
13289         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13290         token was a keyword or not.
13291
13292         Add `error' options where an IDENTIFIER was expected;  Provide
13293         CheckToken and CheckIdentifierToken convenience error reporting
13294         functions. 
13295
13296         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13297
13298         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13299         NameSpaceEntry NameSpaceEntry.
13300
13301         (LookupInterfaceOrClass): Avoid creating a full qualified name
13302         from namespace and name: avoid doing lookups when we know the
13303         namespace is non-existant.   Use new Tree.LookupByNamespace which
13304         looks up DeclSpaces based on their namespace, name pair.
13305
13306         * driver.cs: Provide a new `parser verbose' to display the
13307         exception thrown during parsing.  This is turned off by default
13308         now, so the output of a failure from mcs is more graceful.
13309
13310         * namespace.cs: Track all the namespaces defined in a hashtable
13311         for quick lookup.
13312
13313         (IsNamespace): New method
13314
13315 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13316
13317         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13318         we know that we need to concatenate (full typename can never be
13319         null). 
13320
13321         * class.cs: ditto.
13322
13323         * statement.cs: Use a bitfield;  Do not initialize to null things
13324         which are done by the constructor by default.
13325
13326         * cs-parser.jay: bug fix, parameter was 4, not 3.
13327
13328         * expression.cs: Just use the property;
13329
13330         * statement.cs: No need for GetVariableInfo method.
13331
13332 2003-08-08  Martin Baulig  <martin@ximian.com>
13333
13334         * flowanalysis.cs (FlowReturns): This is now nested in the
13335         `FlowBranching' class.
13336         (MyBitVector): Moved this here from statement.cs.
13337         (FlowBranching.SiblingType): New enum type.
13338         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13339
13340 2003-08-07  Martin Baulig  <martin@ximian.com>
13341
13342         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13343         `FlowBranching' class and called `BranchingType'.
13344
13345 2003-08-07  Martin Baulig  <martin@ximian.com>
13346
13347         * flowanalysis.cs: Moved all the control flow analysis code into
13348         its own file.
13349
13350 2003-08-07  Martin Baulig  <martin@ximian.com>
13351
13352         * assign.cs (Assign.DoResolve): `target' must either be an
13353         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13354         #37319.
13355
13356 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13357
13358         * expression.cs (BinaryMethod): This kind of expression is created by the
13359         Binary class if it determines that the operator has to be handled
13360         by a method.
13361
13362         (BinaryDelegate): This kind of expression is created if we are
13363         dealing with a + or - operator on delegates.
13364
13365         (Binary): remove method, argumetns, and DelegateOperator: when
13366         dealing with methods, 
13367
13368         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13369
13370         * statement.cs (Block): use bitfields for the three extra booleans
13371         we had in use.   Remove unused topblock parameter.
13372
13373         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13374
13375         * assign.cs: Drop extra unneeded tests.
13376
13377 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13378
13379         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13380
13381         * statement.cs (Foreach): Use VariableStorage instead of
13382         LocalBuilders.   
13383
13384         * codegen.cs (VariableStorage): New class used by clients that
13385         require a variable stored: locals or fields for variables that
13386         need to live across yield.
13387
13388         Maybe provide a convenience api for EmitThis+EmitLoad?
13389
13390         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13391         these bad boys.
13392
13393 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13394
13395         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13396         RemapParameterLValue): New methods that are used to turn a
13397         precomputed FieldInfo into an expression like this:
13398
13399                 instance.FieldInfo
13400
13401         The idea is to use this instead of making LocalVariableReference
13402         have more than one meaning.
13403
13404         * cs-parser.jay: Add error production to BASE.
13405
13406         * ecore.cs: Deal with TypeManager.GetField returning null, which
13407         is now a valid return value.
13408
13409         (FieldExprNoAddress): New expression for Fields whose address can
13410         not be taken.
13411
13412         * expression.cs (LocalVariableReference): During the resolve
13413         phases, create new expressions if we are in a remapping context.
13414         Remove code that dealt with remapping here.
13415
13416         (ParameterReference): same.
13417
13418         (ProxyInstance): New expression, like the `This' expression, but
13419         it is born fully resolved.  We know what we are doing, so remove
13420         the errors that are targeted to user-provided uses of `this'.
13421
13422         * statement.cs (Foreach): our variable is now stored as an
13423         Expression;  During resolution, follow the protocol, dont just
13424         assume it will return this.
13425
13426 2003-08-06  Martin Baulig  <martin@ximian.com>
13427
13428         * support.cs (SeekableStreamReader.cs): New public class.
13429
13430         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13431         SeekableStreamReader instead of the normal StreamReader.
13432
13433 2003-08-04  Martin Baulig  <martin@ximian.com>
13434
13435         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13436         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13437         deambiguate casts and delegate invocations.
13438         (parenthesized_expression): Use the new tokens to ensure this is
13439         not a cast of method invocation.
13440
13441         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13442         when reading a `)' and Deambiguate_CloseParens () was previously
13443         called.
13444
13445         * expression.cs (ParenthesizedExpression): New class.  This is
13446         just used for the CS0075 test.
13447         (Binary.DoResolve): Check for CS0075.   
13448
13449 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13450
13451         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13452         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13453         reference comparison.
13454
13455         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13456         examine the ReturnType for equality - this is necessary in the
13457         cases of implicit and explicit operators whose signature also
13458         includes the return type.
13459
13460 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13461
13462         * namespace.cs: Cache the result of the namespace computation,
13463         instead of computing it every time.
13464
13465 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13466
13467         * decl.cs: Use a global arraylist that we reuse over invocations
13468         to avoid excesive memory consumption.  Reduces memory usage on an
13469         mcs compile by one meg (45 average).
13470
13471         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13472         private, work around that.
13473
13474 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13475
13476         * literal.cs (IntLiteral): Define Zero and One static literals. 
13477
13478         * cs-parser.jay (integer_literal): use static literals to reduce
13479         memory usage for the most used literals (0, 1 and -1).  211kb
13480         reduced in memory usage.
13481
13482         Replace all calls to `new ArrayList' with `new
13483         ArrayList(4)' which is a good average number for most allocations,
13484         and also requires only 16 bytes of memory for its buffer by
13485         default. 
13486
13487         This reduced MCS memory usage in seven megabytes for the RSS after
13488         bootstrapping.
13489
13490 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13491
13492         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13493         handle params methods the correct way by forming only one
13494         applicable set with params and normal methods in them. Earlier we
13495         were looking at params methods only if we found no normal methods
13496         which was not the correct thing to do.
13497
13498         (Invocation.BetterFunction): Take separate arguments indicating
13499         when candidate and the best method are params methods in their
13500         expanded form.
13501
13502         This fixes bugs #43367 and #46199.
13503
13504         * attribute.cs: Documentation updates.
13505
13506         (CheckAttribute): Rename to CheckAttributeTarget.
13507         (GetValidPlaces): Rename to GetValidTargets.
13508
13509         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13510         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13511
13512         Fixes bug #44468.
13513
13514 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13515
13516         * codegen.cs: Compute IsGeneric correctly.
13517
13518         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13519         resolution. 
13520
13521         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13522         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13523         regressions, and I was chasing more bugs than I required.
13524
13525         * interface.cs: Use expressions for base type names (like classes
13526         and structs have been doing for a while now), and resolve that.
13527         This patch should probably go into head as well.
13528
13529         This makes it one less user of FindType.
13530
13531 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13532
13533         This compiler can not self host currently.  Need to fix that.
13534         
13535         * Makefile: compile to `gmcs.exe'
13536
13537         * driver.cs: Turn on v2 by default on gmcs.
13538
13539         * generic.cs (ConstructedType): Does no longer take a container
13540         type argument;  That will be taken care of later.
13541
13542         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13543         Use SimpleName to resolve for now, so we can continue the work on
13544         the parser, until we get Type.GetType that understands generics.
13545
13546         (ConstructedType.ToString): Implement
13547
13548         (TypeArguments.Resolve): Resolve the child expressions as types. 
13549         
13550         * cs-parser.jay: Rename interface_constraints to
13551         type_parameter_constraints
13552
13553         (namespace_or_type_name): Only use constructed types for the basic
13554         construction, we will deal with identifier<...> later.
13555
13556         (type/type_name): No longer call DecomposeQI, as
13557         namespace_or_type_name is always decoded now.
13558         
13559 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13560
13561         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13562         closely: we eliminate methods in base types when we have an
13563         applicable method in a top-level type.
13564
13565         Please see section 14.5.5.1 for an exact description of what goes
13566         on. 
13567
13568         This fixes bug #45127 and a host of other related to corlib compilation.
13569
13570         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13571         array is the method corresponding to the top-level type (this is
13572         because of the changes made to icall.c) so we change this
13573         accordingly.
13574
13575         (MethodGroupExpr.Name): This too.
13576
13577         * typemanager.cs (GetElementType): New method which does the right
13578         thing when compiling corlib. 
13579
13580         * everywhere: Make use of the above in the relevant places.
13581
13582 2003-07-22  Martin Baulig  <martin@ximian.com>
13583
13584         * cs-parser.jay (invocation_expression): Moved
13585         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13586         `cast_expression', but create a InvocationOrCast which later
13587         resolves to either an Invocation or a Cast.
13588
13589         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13590         method; call this before EmitStatement() to make sure that this
13591         expression can be used as a statement.
13592
13593         * expression.cs (InvocationOrCast): New class; resolves to either
13594         an Invocation or a Cast.
13595
13596         * statement.cs (StatementExpression): Call ResolveStatement() on
13597         the ExpressionStatement before emitting it.
13598
13599 2003-07-21  Martin Baulig  <martin@ximian.com>
13600
13601         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13602         `ref' and `out' attributes match; fixes #46220.
13603         (MemberAccess.ResolveMemberAccess): You can't reference a type
13604         through an expression; fixes #33180.
13605         (Indexers.GetIndexersForType): Don't return the indexers from
13606         interfaces the class implements; fixes #46502.
13607
13608 2003-07-21  Martin Baulig  <martin@ximian.com>
13609
13610         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13611         CS0661 checks; fixes bug #30442.
13612
13613 2003-07-21  Martin Baulig  <martin@ximian.com>
13614
13615         * decl.cs (AdditionResult): Added `Error'.
13616
13617         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13618
13619         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13620         cs0031.cs actually work.
13621
13622  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13623  
13624         * cs-parser.jay (namespace_name): do not use
13625         namespace_or_type_name, use qualified_identifier, because
13626         namespace_or_type_name will soon return a composed expression
13627         instead of a string.
13628  
13629         (namespace_or_type_name): Instead of returning a string, now this
13630         production returns an expression.
13631  
13632         * codegen.cs (EmitContext): Setup IsGeneric property based on
13633         whether our DeclSpace is generic, our the method is generic.
13634  
13635         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13636         the method is generic.
13637  
13638         * cs-parser.jay (type_arguments, opt_type_argument_list,
13639         type_parameters, type_parameter_list, opt_type_parameter_list,
13640         type_parameter,, opt_type_parameter_constraints_clauses,
13641         type_parameter_constraints_clauses,
13642         type_parameter_constraint_clause, type_parameter_constraint,
13643         interface_constraints): Add new production
13644  
13645         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13646         DeclSpace is generic or not.
13647  
13648         (DeclSpace.SetParameterInfo): New routine, used to set the
13649         parameter info for a type.
13650  
13651         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13652         returns a GenericTypeExpr
13653  
13654         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13655         generic, lookup the generic argument.
13656  
13657         * attribute.cs: Do not allow TypeParameterExpressions in
13658         Attributes.
13659  
13660         * class.cs: Do not allow the Main method to be defined in a
13661         Generic container.
13662  
13663         * expression.cs (SizeOf): Do not allow generic types to be used as
13664         arguments to sizeof.
13665  
13666         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13667         it: whether a type is generic or not.  Only works for types we are
13668         currently building for now.
13669         
13670 2003-07-20  Martin Baulig  <martin@ximian.com>
13671
13672         * namespace.cs: Fixed that bug which caused a crash when compiling
13673         the debugger's GUI.
13674
13675 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13676
13677         * typemanager.cs (LookupTypeReflection): Never expose types which
13678         are NotPublic, NestedPrivate, NestedAssembly, or
13679         NestedFamANDAssem.  We used to return these, and later do a check
13680         that would report a meaningful error, but the problem is that we
13681         would not get the real match, if there was a name override.
13682
13683 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13684
13685         * namespace.cs (Namespace, Name): Do not compute the namespace
13686         name dynamically, compute it in the constructor.  This reduced
13687         memory usage by 1697 KB.
13688
13689         * driver.cs: Use --pause to pause at the end.
13690
13691 2003-07-17  Peter Williams  <peter@newton.cx>
13692
13693         * Makefile: Change the name of the test target so that it doesn't
13694         conflict with the recursive test target.
13695
13696 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13697
13698         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13699         AddressOf): Do not use EmitThis, that was wrong, use the actual
13700         this pointer.
13701
13702 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13703
13704         * class.cs (MethodData.Define): While checking if a method is an
13705         interface implementation, improve the test: If we are not public
13706         (use new test here: use the computed MethodAttributes directly,
13707         instead of the parsed modifier flags) check if the `implementing'
13708         method comes from an interface or not.
13709
13710         * pending.cs (VerifyPendingMethods): Slightly better error
13711         message.
13712
13713         * makefile: add test target that does the mcs bootstrap.
13714
13715 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13716
13717         * interface.cs (Define): Do nothing here since there are no
13718         members to populate etc. Move the attribute emission out of here
13719         since this was just totally the wrong place to put it. Attribute
13720         application happens during the 'Emit' phase, not in the 'Define'
13721         phase.
13722
13723         (Emit): Add this method and move the attribute emission here
13724
13725         * rootcontext.cs (EmitCode): Call the Emit method on interface
13726         types too.
13727
13728 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13729
13730         * expression.cs (OverloadResolve): Report error only if Location
13731         is not 'Null' which means that there was a probe going on.
13732
13733 2003-07-14  Martin Baulig  <martin@ximian.com>
13734
13735         * expression.cs (ConditionalLogicalOperator): New public class to
13736         implement user defined conditional logical operators.
13737         This is section 14.11.2 in the spec and bug #40505.
13738
13739 2003-07-14  Martin Baulig  <martin@ximian.com>
13740
13741         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13742
13743 2003-07-14  Martin Baulig  <martin@ximian.com>
13744
13745         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13746
13747         * ecore.cs (IVariable.VerifyFixed): New interface method.
13748
13749         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13750         operator, check whether the variable is actually fixed.  Fixes bug
13751         #36055.  Set a variable definitely assigned when taking its
13752         address as required by the spec.
13753
13754         * statement.cs (LocalInfo.IsFixed): New field.
13755         (LocalInfo.MakePinned): Set `IsFixed' to true.
13756
13757 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13758
13759         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13760         for .ctors, ensure that we only ask for members declared in the
13761         attribute type (BindingFlags.DeclaredOnly).
13762
13763         Fixes bug #43632.
13764
13765         * expression.cs (Error_WrongNumArguments): Report error 1501
13766         correctly the way CSC does.
13767
13768 2003-07-13  Martin Baulig  <martin@ximian.com>
13769
13770         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13771         lookup on the fully qualified name, to make things like "X.X" work
13772         where "X.X" is a fully qualified type name, but we also have a
13773         namespace "X" in the using list.  Fixes #41975.
13774
13775 2003-07-13  Martin Baulig  <martin@ximian.com>
13776
13777         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13778         function. If we're a CompoundAssign, we need to create an embedded
13779         CompoundAssign, not an embedded Assign.
13780         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13781         Fixes #45854.
13782
13783 2003-07-13  Martin Baulig  <martin@ximian.com>
13784
13785         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13786         work to fix bug #46088.
13787
13788 2003-07-13  Ravi Pratap <ravi@ximian.com>
13789
13790         * class.cs (Operator.Emit): Do not emit attributes here - it is
13791         taken care of by the Method class that we delegate too. This takes
13792         care of bug #45876.
13793
13794 2003-07-10  Martin Baulig  <martin@ximian.com>
13795
13796         * expression.cs (TypeOfVoid): New class.
13797         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13798
13799 2003-07-10  Martin Baulig  <martin@ximian.com>
13800
13801         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13802         bug #35957.
13803
13804 2003-07-10  Martin Baulig  <martin@ximian.com>
13805
13806         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13807         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13808
13809         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13810
13811         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13812
13813 2003-07-10  Martin Baulig  <martin@ximian.com>
13814
13815         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13816         of decimal.  Fixes #42850.
13817
13818         NOTE: I also fixed the created byte blob, but this doesn't work on
13819         the MS runtime and csc never produces any byte blobs for decimal
13820         arrays.
13821
13822 2003-07-10  Martin Baulig  <martin@ximian.com>
13823
13824         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13825         structs; fixes #32068.
13826         (Block.AddChildVariableNames): Fixed #44302.
13827
13828 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13829
13830         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13831
13832 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13833
13834         * attribute.cs: And this test is onger needed.
13835
13836 2003-07-08  Martin Baulig  <martin@ximian.com>
13837
13838         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13839         inaccessible types.  Fixes #36313.
13840
13841         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13842
13843         * namespace.cs (NamespaceEntry): Create implicit entries for all
13844         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13845         implicit entries for N1.N2 and N1.
13846
13847 2003-07-08  Martin Baulig  <martin@ximian.com>
13848
13849         Rewrote the handling of namespaces to fix a lot of the issues
13850         wrt. `using' aliases etc.
13851
13852         * namespace.cs (Namespace): Splitted this class into a
13853         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13854
13855         * typemanager.cs (TypeManager.IsNamespace): Removed.
13856         (TypeManager.ComputeNamespaces): Only compute namespaces from
13857         loaded assemblies here, not the namespaces from the assembly we're
13858         currently compiling.
13859
13860 2003-07-08  Martin Baulig  <martin@ximian.com>
13861
13862         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13863
13864 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13865
13866         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13867         already fixed it.  
13868
13869         I thought about the memory savings here, but LookupTypeReflection
13870         is used under already very constrained scenarios.  Compiling
13871         corlib or mcs only exposes one hit, so it would not really reduce
13872         any memory consumption.
13873
13874 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13875
13876         * typemanager.cs: fixes bug #45889 by only adding public types from
13877         other assemblies to the list of known types.
13878
13879 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13880
13881         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13882         on the type we resolved.
13883
13884 2003-07-05  Martin Baulig  <martin@ximian.com>
13885
13886         * pending.cs (PendingImplementation.ParentImplements): Don't
13887         create the proxy if the parent is abstract.
13888
13889         * class.cs (TypeContainer.DefineIndexers): Process explicit
13890         interface implementations first.  Fixes #37714.
13891
13892 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13893
13894         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13895         defined recursively;  but since we modify the input parameters
13896         (left is set to `this' temporarily), we reset this value if the
13897         left_is_explicit is false, which gives the original semantics to
13898         the code.  
13899
13900         * literal.cs (NullPointer): new class used to represent a null
13901         literal in a pointer context.
13902
13903         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13904         type is a pointer, use a NullPointer object instead of a
13905         NullLiteral.   Closes 43687
13906
13907         (ExplicitConversion): Convert pointer values using
13908         the conv opcode to the proper type.
13909
13910         * ecore.cs (New): change ValueTypeVariable property into a method,
13911         that returns whether the valuetype is suitable for being used.
13912
13913         * expression.cs (Binary.DoNumericPromotions): Only return if we
13914         the int constant was a valid uint, and we can return both left and
13915         right as uints.  If not, we continue processing, to trigger the
13916         type conversion.  This fixes 39018.
13917
13918         * statement.cs (Block.EmitMeta): During constant resolution, set
13919         the CurrentBlock property on the emitcontext, so that we resolve
13920         constants propertly.
13921
13922 2003-07-02  Martin Baulig  <martin@ximian.com>
13923
13924         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13925         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13926
13927         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13928         than emitting it here.
13929
13930         * statement.cs: Fixed some more flow analysis bugs.
13931
13932 2003-07-02  Martin Baulig  <martin@ximian.com>
13933
13934         * class.cs (MethodData.Define): When implementing interface
13935         methods, set Final unless we're Virtual.
13936
13937         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13938         check work for interface methods.
13939
13940 2003-07-01  Martin Baulig  <martin@ximian.com>
13941
13942         * ecore.cs (EmitContext.This): Replaced this property with a
13943         GetThis() method which takes a Location argument.  This ensures
13944         that we get the correct error location for a CS0188.
13945
13946 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13947
13948         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13949         ImplicitStandardConversion.
13950
13951         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13952
13953 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13954
13955         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13956         optimization.
13957
13958 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13959
13960         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13961         constructors.
13962
13963         (MethodData.Define): Turn off initlocals for unsafe methods.
13964
13965 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13966
13967         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13968         complete;  Fixes #37521.
13969
13970         * delegate.cs: Use Modifiers.TypeAttr to compute the
13971         TypeAttributes, instead of rolling our own.  This makes the flags
13972         correct for the delegates.
13973
13974 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13975
13976         * class.cs (Constructor.Define): Set the private flag for static
13977         constructors as well.
13978
13979         * cs-parser.jay (statement_expression): Set the return value to
13980         null, to avoid a crash when we catch an error.
13981
13982 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13983
13984         * cs-parser.jay: Applied patch from Jackson that adds support for
13985         extern and unsafe modifiers to destructor declarations.
13986
13987         * expression.cs: Report error 21 if the user is trying to index a
13988         System.Array.
13989
13990         * driver.cs: Add an error message, suggested by the bug report.
13991
13992         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13993         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13994
13995 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13996
13997         * namespace.cs: Add some information to reduce FAQs.
13998
13999 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14000
14001         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14002         underlying enumeration types.  Fixes #43915.
14003
14004         * expression.cs: Treat ushort/short as legal values to be used in
14005         bitwise operations.
14006
14007 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14008
14009         * delegate.cs: transfer custom attributes for paramenters from
14010         the delegate declaration to Invoke and BeginInvoke.
14011
14012 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14013
14014         * attribute.cs: handle custom marshalers and emit marshal info
14015         for fields, too.
14016
14017 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14018
14019         * makefile.gnu: Added anonymous.cs to the compiler sources.
14020
14021 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14022
14023         * iterators.cs: Change the name of the proxy class to include two
14024         underscores.
14025
14026         * cs-parser.jay: Update grammar to include anonymous methods.
14027
14028         * anonymous.cs: new file.
14029
14030 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14031
14032         * class.cs (Field.Define): Add missing test for pointers and
14033         safety. 
14034
14035 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14036
14037         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14038         we use the stobj opcode.
14039
14040         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14041         since it wasn't the correct fix. 
14042
14043         It still is puzzling that we are required to use stobj for IntPtr
14044         which seems to be a ValueType.
14045
14046 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14047
14048         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14049         during regular simple name resolution.   Now, the trick is that
14050         instead of returning for processing the simplename, we do a
14051         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14052         contextual lookup type).   If a match is found, return that, if
14053         not, return for further composition.
14054
14055         This fixes long-standing 30485.
14056
14057         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14058         using the address to initialize an object, do an Stobj instead of
14059         using the regular Stelem.
14060
14061         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14062         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14063         Because if we are a BaseIndexerAccess that value will be true.
14064         Fixes 43643.
14065
14066         * statement.cs (GotoCase.Resolve): Return after reporting an
14067         error, do not attempt to continue. 
14068
14069         * expression.cs (PointerArithmetic.Emit): If our operand is a
14070         long, convert our constants to match the operand before
14071         multiplying.  Convert to I type before adding.   Fixes 43670.
14072
14073 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14074
14075         * enum.cs (ImplicitConversionExists) : Rename to
14076         ImplicitEnumConversionExists to remove ambiguity. 
14077
14078         * ecore.cs (NullCast): New type of cast expression class which
14079         basically is very similar to EmptyCast with the difference being
14080         it still is a constant since it is used only to cast a null to
14081         something else
14082         (eg. (string) null)
14083
14084         * convert.cs (ImplicitReferenceConversion): When casting a null
14085         literal, we return a NullCast.
14086
14087         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14088         should be around anymore.
14089
14090         The renaming (reported was slightly wrong). Corrections:
14091
14092         ConvertImplicitStandard -> ImplicitConversionStandard
14093         ConvertExplicitStandard -> ExplicitConversionStandard
14094
14095         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14096         before passing them in !
14097
14098         * convert.cs (ImplicitConversionStandard): When comparing for
14099         equal expr and target types, ensure that expr is not a
14100         NullLiteral.
14101
14102         In general, we must not be checking (expr_type ==
14103         target_type) in the top level conversion methods
14104         (ImplicitConversion, ExplicitConversion etc). This checking is
14105         done in the methods that they delegate to.
14106
14107 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14108
14109         * convert.cs: Move Error_CannotConvertType,
14110         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14111         ImplicitNumericConversion, ImplicitConversionExists,
14112         ImplicitUserConversionExists, StandardConversionExists,
14113         FindMostEncompassedType, FindMostSpecificSource,
14114         FindMostSpecificTarget, ImplicitUserConversion,
14115         ExplicitUserConversion, GetConversionOperators,
14116         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14117         TryImplicitIntConversion, Error_CannotConvertImplicit,
14118         ConvertImplicitRequired, ConvertNumericExplicit,
14119         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14120         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14121         its own file.
14122
14123         Perform the following renames:
14124
14125         StandardConversionExists -> ImplicitStandardConversionExists
14126         ConvertImplicit -> ImplicitConversion
14127         ConvertImplicitStandard -> ImplicitStandardConversion
14128         TryImplicitIntConversion -> ImplicitIntConversion
14129         ConvertImplicitRequired -> ImplicitConversionRequired
14130         ConvertNumericExplicit -> ExplicitNumericConversion
14131         ConvertReferenceExplicit -> ExplicitReferenceConversion
14132         ConvertExplicit -> ExplicitConversion
14133         ConvertExplicitStandard -> ExplicitStandardConversion
14134
14135 2003-05-19  Martin Baulig  <martin@ximian.com>
14136
14137         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14138         (TypeInfo): Added support for structs having structs as fields.
14139
14140         * ecore.cs (FieldExpr): Implement IVariable.
14141         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14142         VariableInfo for the field.
14143
14144 2003-05-18  Martin Baulig  <martin@ximian.com>
14145
14146         * expression.cs (This.DoResolve): Report a CS0027 if we're
14147         emitting a field initializer.
14148
14149 2003-05-18  Martin Baulig  <martin@ximian.com>
14150
14151         * expression.cs (This.ResolveBase): New public function.
14152         (This.DoResolve): Check for CS0188.
14153
14154         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14155         This.Resolve().
14156
14157         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14158         `instance_expression' to null if we don't have any non-static
14159         methods.
14160
14161 2003-05-18  Martin Baulig  <martin@ximian.com>
14162
14163         Reworked the way how local variables and parameters are handled by
14164         the flow analysis code.
14165
14166         * statement.cs (TypeInfo, VariableMap): New public classes.
14167         (VariableInfo): New public class.  This is now responsible for
14168         checking whether a variable has been assigned.  It is used for
14169         parameters and local variables.
14170         (Block.EmitMeta): Take the InternalParameters as argument; compute
14171         the layout of the flow vectors here.
14172         (Block.LocalMap, Block.ParameterMap): New public properties.
14173         (FlowBranching): The .ctor doesn't get the InternalParameters
14174         anymore since Block.EmitMeta() now computes the layout of the flow
14175         vector.
14176         (MyStructInfo): This class is now known as `StructInfo' and nested
14177         in `TypeInfo'; we don't access this directly anymore.
14178
14179         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14180         property and removed IsAssigned(), IsFieldAssigned(),
14181         SetAssigned() and SetFieldAssigned(); we now call them on the
14182         VariableInfo so we don't need to duplicate this code everywhere.
14183
14184         * expression.cs (ParameterReference): Added `Block block' argument
14185         to the .ctor.
14186         (LocalVariableReference, ParameterReference, This): The new
14187         VariableInfo class is now responsible for all the definite
14188         assignment stuff.
14189
14190         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14191         IsParameterAssigned, SetParameterAssigned): Removed.
14192
14193 2003-05-18  Martin Baulig  <martin@ximian.com>
14194
14195         * typemanager.cs (InitCoreTypes): Try calling
14196         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14197         the 3-args-version.  Corlib now also needs our `void_type'.
14198         (GetMethod): Added overloaded version which takes an optional
14199         `bool report_errors' to allow lookups of optional methods.
14200
14201 2003-05-12  Martin Baulig  <martin@ximian.com>
14202
14203         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14204         only used for locals and not for parameters.
14205
14206 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14207
14208         * support.cs (InternalParameters.ParameterType): Return the
14209         ExternalType of the parameter.
14210
14211         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14212         they were unused.
14213
14214 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14215
14216         * class.cs (MethodData.Define): Do not set the `newslot' on
14217         interface members, if they are also flagged as "override".
14218
14219         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14220         better code for ++i and i++.  This only works for static fields
14221         and local variables.
14222
14223         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14224         want to pull the DeclSpace out of the builder_to_declspace instead
14225         of the TypeBuilder (like in TypeContainer.FindMembers).
14226
14227         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14228         instead of LookupTypeContainer.  Fixes the crash on .NET for
14229         looking up interface members.
14230
14231         * const.cs: Create our own emit context during the Definition
14232         stage, so that constants are evaluated in the proper context, when
14233         a recursive definition happens.
14234
14235 2003-05-11  Martin Baulig  <martin@ximian.com>
14236
14237         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14238         new block for a switch section.
14239         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14240         the adding/lookup in the switch block.  Fixes #39828.
14241
14242 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14243
14244         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14245         functionality: I needed to convert the data after I had performed
14246         the add/sub operation into the operands type size.
14247
14248         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14249         pass the type for the box operation, otherwise the resulting
14250         object would have been of type object.
14251
14252         (BoxedCast): Add constructor to specify the type to box as.
14253
14254 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14255
14256         * iterators.cs: I was reusing the `count' variable inadvertently,
14257         take steps to not allow this to happen.
14258
14259 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14260
14261         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14262         by creating an array at the point where the params starts and
14263         putting all those arguments there, then adjusting the size of the
14264         array.
14265
14266 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14267
14268         * expression.cs (New.AddressOf): Implement interface
14269         IMemoryLocation.  This is used when the `new' operator is used in
14270         the context of an invocation to a method on a value type.
14271
14272         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14273         example. 
14274
14275         * namespace.cs: Also check the using aliases here.
14276
14277         * driver.cs: Move the test for using validity after the types have
14278         been entered, so we do a single pass that also includes the using
14279         aliases. 
14280
14281         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14282         in the regular case.   CreateSiblingForFinally is doing extra
14283         error checking.
14284
14285         * attribute.cs (GetAttributeArgumentExpression): Store the result
14286         on an out value, and use the return value to indicate failure
14287         instead of using null (which is a valid return for Constant.GetValue).
14288
14289         * statement.cs: Perform the analysis flow for the increment
14290         portion after the statement, because this will be the real flow of
14291         execution.  Fixes #42385
14292
14293         * codegen.cs (EmitContext.EmitArgument,
14294         EmitContext.EmitStoreArgument): New helper functions when the
14295         RemapToProxy flag is set.
14296
14297         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14298         function.
14299
14300         Add support for remapping parameters. 
14301
14302         * iterators.cs: Propagate parameter values;  Store parameter
14303         values in the proxy classes.
14304
14305 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14306
14307         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14308         need a proxy reference;  I do not know what I was thinking
14309
14310         * cs-parser.jay (constructor_initializer): catch another error,
14311         and display nice message.
14312
14313         (field_declaration): catch void field declaration
14314         to flag a better error. 
14315
14316         * class.cs (MemberBase.CheckBase): Report an error instead of a
14317         warning if a new protected member is declared in a struct. 
14318         (Field.Define): catch the error of readonly/volatile.
14319
14320         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14321
14322         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14323         volatile variable is taken
14324
14325 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14326
14327         * statement.cs (Fixed.Resolve): Report an error if we are not in
14328         an unsafe context.
14329
14330 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14331
14332         * typemanager.cs: reuse the code that handles type clashes for
14333         delegates and enumerations.
14334
14335         * class.cs (Report28): Always report.
14336
14337         * expression.cs (EncodeAsAttribute): Allow nulls here.
14338
14339 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14340
14341         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14342         the functionality for testing whether an expression is valid for
14343         an attribute here.  Also handle the case of arrays of elements
14344         being stored. 
14345
14346         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14347         encoding a linear array into an array of objects that are suitable
14348         to be passed to an CustomAttributeBuilder.
14349
14350         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14351
14352         * ecore.cs: (FieldExpr): Handle field remapping here.
14353
14354         * iteratators.cs: Pass the instance variable (if the method is an
14355         instance method) to the constructors, so we can access the field
14356         variables on the class.
14357
14358         TODO: Test this with structs.  I think the THIS variable on
14359         structs might have to be a pointer, and not a refenrece
14360
14361 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14362
14363         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14364         local variables to fields in a proxy class.
14365
14366         * iterators.cs (PopulateProxy): Rename our internal fields to
14367         <XXX>.  
14368         Create a <THIS> field if we are an instance method, so we can
14369         reference our parent container variables.
14370         (MapVariable): Called back from the EmitContext code to enter a
14371         new variable to field mapping into the proxy class (we just create
14372         a FieldBuilder).
14373
14374         * expression.cs
14375         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14376         for using the remapped locals to fields.
14377
14378         I placed the code here, because that gives the same semantics to
14379         local variables, and only changes the Emit code.
14380
14381         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14382         statements inside iterators.
14383         (VariableInfo): Add a FieldBuilder for the cases when we are
14384         remapping local variables to fields in a proxy class
14385
14386         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14387         current_block != null.
14388
14389         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14390         not cope with strings, as it has been moved to the
14391         TableSwitchEmit.  Fixed bug in switch generation.
14392
14393         * expression.cs (New.DoResolve): Provide more context for the user
14394         when reporting an error.
14395
14396         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14397         pointers. 
14398
14399         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14400         check the permissions for it.  Note than in a type-resolution
14401         context the check was already present in DeclSpace.ResolveType,
14402         but was missing from the MemberAccess.
14403
14404         (ArrayCreation.CheckIndices): warn if the user has
14405         more nested levels of expressions, but there are no more
14406         dimensions specified.  Avoids crash on bug 41906.
14407
14408 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14409
14410         * statement.cs (Block): replace Implicit bool, for a generic
14411         flags.   
14412         New flag: `Unchecked'.  This is used during the EmitMeta phase
14413         (which is out-of-line with the regular Resolve/Emit process for a
14414         statement, as this is done ahead of time, but still gets a chance
14415         to call constant resolve).
14416
14417         (Block.Flags): new enum for adding a new flag.
14418
14419         (Block.EmitMeta): track the state of unchecked.
14420
14421         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14422         to enable constant resolution to work there as well.
14423
14424 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14425
14426         * typemanager.cs (ienumerable_type): Also look up
14427         System.Collections.IEnumerable. 
14428
14429 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14430
14431         TODO: Test more than one conditional per method.
14432
14433         * class.cs (Indexer.Define): Report the location where the user is
14434         referencing the unsupported feature.
14435
14436         (MethodData): Overload the use of `conditionals' to
14437         minimize the creation of needless ArrayLists.   This saves roughly
14438         212kb on my machine.
14439
14440         (Method): Implement the new IIteratorContainer interface.
14441         (Method.SetYields): Implement the method by setting the ModFlags
14442         to contain METHOD_YIELDS.
14443
14444         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14445         which just got set to null.
14446
14447         * iterators.cs: New file.
14448
14449         (Yield, YieldBreak): New statements.
14450
14451         * statement.cs (Return.Resolve): Flag an error if we are used in
14452         an iterator method.
14453
14454         * codegen.cs (InIterator): New flag set if the code is being
14455         compiled in an iterator method.
14456
14457         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14458         internal modifier, and we just use it to avoid adding extra
14459         fields, as this is seldom used.  
14460
14461         * cs-parser.jay: Add yield_statement (yield and yield break).
14462
14463         * driver.cs: New flag -v2 to turn on version 2 features. 
14464
14465         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14466         hashtable when v2 is enabled.
14467
14468 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14469
14470         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14471         there is already a namespace defined with this name.
14472
14473         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14474         people upgraded their corlibs.
14475
14476         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14477         always use fully qualified types, no need to use the compiler
14478         front end.
14479
14480         (TypeManager.IsNamespace): Use binarysearch.
14481
14482         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14483         AddDelegate): I did not quite use the new IsValid API properly: I
14484         have to pass the short-name and the fullname.  I was passing only
14485         the basename instead of the fullname sometimes. 
14486
14487         (TypeContainer.DefineType): call NamespaceClash.
14488
14489         * interface.cs (Interface.DefineType): use NamespaceClash before
14490         defining the type.
14491
14492         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14493         defining the type.
14494
14495         * enum.cs: (Enum.DefineType): use NamespaceClash before
14496         defining the type.
14497
14498         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14499         speed increase.  First, use the negative_hits cache when we get a
14500         negative.  Second, add the type with its full original name
14501         instead of the new . and + encoded name (reflection uses + to
14502         separate type from a nested type).  Use LookupTypeReflection
14503         directly which bypasses the type->name hashtable (that we already
14504         know does not contain the type.
14505
14506         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14507         location/container type. 
14508
14509         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14510
14511 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14512
14513         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14514
14515         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14516         method is being referenced in the method group from a static
14517         context, and report error 120 if so.
14518
14519         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14520         Error118. 
14521
14522         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14523         is created, we create the A namespace).
14524
14525         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14526         Fixes #41591
14527
14528 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14529
14530         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14531         invocation to ModuleBuilder.GetType with the same values will
14532         return a new type instance, so we need to cache its return
14533         values. 
14534
14535         * expression.cs (Binary.ResolveOperator): Only allow the compare
14536         operators on enums if they are of the same type.
14537
14538         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14539         types of ValueType on their own case.  Before we were giving them
14540         the same treatment as objects.
14541
14542         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14543         fullname.  Short name is used to compare against container name.
14544         Fullname is used to check against defined namespace names.
14545
14546         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14547         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14548
14549         (Method.CheckBase): Call parent.
14550         (MemberBase.CheckBase): Check for protected members on sealed
14551         classes.
14552         (PropertyBase.CheckBase): Call parent.
14553         (Field.Define): Call parent.
14554
14555         * report.cs: Negative error codes are now mapped to 8000 - code,
14556         so that the display is render more nicely.
14557
14558         * typemanager.cs: Do not use try/catch, instead report a regular
14559         error. 
14560
14561         (GetPointerType, GetReferenceType): These methods provide
14562         mechanisms to obtain the T* and T& from a T.  We had the code
14563         previously scattered around the code base, and it also used
14564         TypeManager.LookupType that would go through plenty of caches.
14565         This one goes directly to the type source.
14566
14567         In some places we did the Type.GetType followed by
14568         ModuleBuilder.GetType, but not in others, so this unifies the
14569         processing as well.
14570
14571         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14572         statements now that we have namespace information.
14573
14574         * typemanager.cs (IsNamespace): New method, returns whether the
14575         string presented is a namespace or not.
14576
14577         (ComputeNamespaces): New public entry point, computes the list of
14578         available namespaces, using the GetNamespaces API call in Mono, or
14579         the slower version in MS.NET.   
14580
14581         Now before we start the semantic analysis phase, we have a
14582         complete list of namespaces including everything that the user has
14583         provided.
14584
14585         Deleted old code to cache namespaces in .nsc files.
14586
14587 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14588
14589         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14590         class/struct location definition Location for the implicit
14591         constructor location.
14592
14593         (Operator.Define): Use the location of the operator for the
14594         implicit Method definition.
14595
14596         (Constructor.Emit): use the constructor location for the implicit
14597         base initializer constructor.
14598
14599         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14600         and the Expression class now contains two new methods:
14601
14602         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14603         isolate type lookup from the rest of the resolution process.
14604
14605         Since we use Expressions to hold type definitions due to the way
14606         we parse the input we have historically overloaded Resolve to
14607         perform the Type lookups if a special flag is passed.  Now this is
14608         eliminated and two methods take their place. 
14609
14610         The differences in the two methods between xStep and xTerminal is
14611         that xStep is involved in our current lookup system that uses
14612         SimpleNames to compose a name, while xTerminal is used just to
14613         catch the case where the simplename lookup failed.
14614
14615 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14616
14617         * expression.cs (ResolveMemberAccess): Remove redundant code.
14618         TypeExpr expressions are always born fully resolved.
14619
14620         * interface.cs (PopulateMethod): Do not lookup the types twice.
14621         We were doing it once during SemanticAnalysis and once during
14622         PopulateMethod.
14623
14624         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14625         in local variable type definitions, were being returned as a
14626         SimpleName (we decomposed everything into a string), that is
14627         because primary_expression was being used instead of a type in the
14628         grammar (reduce/reduce conflicts).
14629
14630         The part that was wrong is that we converted the expression into a
14631         string (an oversimplification in one hand, compounded with primary
14632         expressions doing string concatenation).
14633
14634         So things like:
14635
14636         A.B.C [] x;
14637
14638         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14639         using clauses from working on this particular context.  And a type
14640         was being matched directly against "A.B.C[]".
14641
14642         We now use the correct approach, and allow for ComposedCast to be
14643         part of the unary expression.  So the "A.B.C []" become a composed
14644         cast of "A.B.C" (as a nested group of MemberAccess with a
14645         SimpleName at the end) plus the rank composition "[]". 
14646
14647         Also fixes 35567
14648
14649 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14650
14651         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14652         for the access level checking.
14653
14654         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14655         `TypeContainer container', because I kept getting confused when I
14656         was debugging this code.
14657
14658         * expression.cs (Indexers): Instead of tracking getters/setters,
14659         we now track them in parallel.  We create one arraylist less, but
14660         most importantly it is possible now for the LValue code to find a
14661         matching get for a set.
14662
14663         (IndexerAccess.DoResolveLValue): Update the code.
14664         GetIndexersForType has been modified already to extract all the
14665         indexers from a type.  The code assumed it did not.
14666
14667         Also make the code set the correct return type for the indexer.
14668         This was fixed a long time ago for properties, but was missing for
14669         indexers.  It used to be void_type.
14670
14671         (Binary.Emit): Test first for doubles instead of
14672         floats, as they are more common.
14673
14674         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14675         when dealing with floats and the <=, >= operators.  This fixes bug
14676         #39314 
14677
14678         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14679         to load the array value by emitting a load on the foreach variable
14680         type.  This was incorrect.  
14681
14682         We now emit the code to load an element using the the array
14683         variable type, and then we emit the conversion operator.
14684
14685         Fixed #40176
14686
14687 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14688
14689         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14690
14691 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14692
14693         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14694         test for protection before we test for signatures. 
14695
14696         (MethodSignature.ToString): implement.
14697
14698         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14699         to the case where we reduced into a LongConstant.
14700
14701         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14702         depend on whether the information is acurrate, because the
14703         Microsoft runtime will always claim that the array type is public,
14704         regardless of the real state.
14705
14706         If the type is a pointer, another problem happens: the type is
14707         reported as non-public in Microsoft.  
14708
14709         In both cases we have to call CheckAccessLevel recursively with
14710         the underlying type as the argument to be tested.
14711
14712 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14713
14714         * assign.cs (Assign.Emit): If we are dealing with a compound
14715         assignment expression, we should use the code path that stores the
14716         intermediate result in a temporary value.  This fixes #40903.
14717
14718         *expression.cs (Indirection.ToString): Provide ToString method for
14719         debugging. 
14720
14721 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14722
14723         * class.cs: Null out fields holding references to Block objects so
14724         they can be garbage collected.
14725
14726         * expression.cs (OverloadResolve): Remove unused local.
14727
14728 2003-04-07  Martin Baulig  <martin@ximian.com>
14729
14730         * codegen.cs (EmitContext.CurrentFile): New public field.
14731         (EmitContext.Mark): Use the CurrentFile to check whether the
14732         location is in the correct file.
14733         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14734
14735 2003-04-07  Martin Baulig  <martin@ximian.com>
14736
14737         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14738
14739         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14740         location.  [FIXME: The location argument which gets passed to this
14741         method is sometimes wrong!]
14742
14743 2003-04-07  Nick Drochak <ndrochak@gol.com>
14744
14745         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14746
14747 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14748
14749         * expression.cs (Indirection.EmitAssign): We were using the
14750         temporary, but returning immediately instead of continuing the
14751         EmitAssing flow.
14752
14753 2003-04-06  Martin Baulig  <martin@ximian.com>
14754
14755         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14756         if it's a nested child, but also deriving from the outer class.
14757         See test 190.cs.
14758
14759         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14760         nested child, but also deriving from the outer class.  See
14761         test-190.cs.
14762         (FilterWithClosure): We may access private members of the outer
14763         class if we're a nested child and deriving from the outer class.
14764         (RealMemberLookup): Only set `closure_private_ok' if the
14765         `original_bf' contained BindingFlags.NonPublic.
14766
14767 2003-04-05  Martin Baulig  <martin@ximian.com>
14768
14769         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14770         probe if its a type parameter, and if so, flag an error.
14771
14772         * decl.cs: Move here the SetParameterInfo code from class.cs.
14773         Handle IsGeneric here.
14774
14775         Handle a variety of errors in the parameter info definition.
14776
14777         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14778         type parameters here.
14779
14780         * cs-parser.jay (class_declaration): report errors for parameters
14781         here as well.
14782
14783 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14784
14785         * generic.cs: New file, contains support code for generics.
14786
14787         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14788         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14789
14790         Update parser for the above removals.
14791
14792         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14793         now taken care of in the parser.
14794
14795 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14796
14797         * class.cs (Event.Define): Do not allow abstract events to have
14798         initializers. 
14799
14800 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14801
14802         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14803         block in event declarations.
14804
14805         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14806         value type, get its address.
14807
14808         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14809         leaving a class on the stack instead of a boolean value (int
14810         0/1).  Change the code so we compare against null, and then the
14811         result against zero.
14812
14813         * class.cs (TypeContainer.GetClassBases): We were checking for the
14814         parent class being sealed too late.
14815
14816         * expression.cs (Binary.Emit): For <= and >= when dealing with
14817         floating point values, use cgt.un and clt.un instead of cgt and
14818         clt alone.
14819
14820 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14821
14822         * statement.cs: Apply the same optimization as MS: skip the 
14823         GetEnumerator returning an IEnumerator, and use the one returning a 
14824         CharEnumerator instead. This allows us to avoid the try-finally block 
14825         and the boxing.
14826
14827 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14828
14829         * cs-parser.jay: Attributes cannot be applied to
14830                          namespaces. Fixes #40473
14831
14832 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14833
14834         * class.cs:
14835         (Add*): check if the name is valid using the full name for constants,
14836         fields, properties and events.
14837
14838 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14839
14840         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14841         char constants to be part of the enumeration.
14842
14843         * expression.cs (Conditional.DoResolve): Add support for operator
14844         true. Implements the missing functionality from 14.12
14845
14846         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14847         operator true/false as required by the spec.
14848
14849         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14850         implicit conversion to boolean.
14851
14852         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14853         also one where the type implements `operator true'. 
14854
14855         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14856         get an expression that will invoke operator true based on an
14857         expression.  
14858
14859         (GetConversionOperators): Removed the hack that called op_True
14860         here.  
14861
14862         (Expression.ResolveBoolean): Move this from Statement.
14863
14864 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14865
14866         * ecore.cs (FieldExpr): do not allow initialization of initonly
14867         fields on derived classes
14868
14869 2003-03-13  Martin Baulig  <martin@ximian.com>
14870
14871         * statement.cs (Block.Emit): Call ig.BeginScope() and
14872         ig.EndScope() when compiling with debugging info; call
14873         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14874
14875 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14876
14877         * expression.cs (Indexers): Do not construct immediately, allow
14878         for new members to be appended as we go.  Fixes 38143
14879
14880 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14881
14882         * expression.cs: save/restore context when resolving an unchecked
14883         expression.
14884
14885 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14886
14887         * cfold.cs: Catch division by zero in modulus operator during
14888         constant folding.
14889
14890 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14891
14892         * interface.cs (Interface.DefineMembers): Avoid defining members
14893         twice. 
14894
14895 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14896
14897         * driver.cs: handle the +/- options for -noconfig
14898
14899         * statement.cs (Unckeched.Resolve): Also track the state of
14900         unchecked in the Resolve phase.
14901
14902 2003-02-27  Martin Baulig  <martin@ximian.com>
14903
14904         * ecore.cs (Expression.MemberLookup): Don't create a
14905         MethodGroupExpr for something which is not a method.  Fixes #38291.
14906
14907 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14908
14909         * class.cs (MemberBase.CheckParameters): Also check that the type
14910         is unmanaged if it is a pointer.
14911
14912         * expression.cs (SizeOf.Resolve): Add location information.
14913
14914         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14915         a managed type is declared.
14916
14917         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14918         parameter modifiers as well.  Fixes bug 38606
14919
14920         * class.cs: Very sad.  Am backing out the speed up changes
14921         introduced by the ArrayList -> Array in the TypeContainer, as they
14922         were not actually that much faster, and introduced a bug (no error
14923         reports on duplicated methods).
14924
14925         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14926         source first, this will guarantee that we have a valid expression
14927         before calling in lower levels functions that will require a
14928         resolved object.  Then use this original_source in the
14929         target.ResolveLValue instead of the original source that was
14930         passed to us.
14931
14932         Another change.  Use target.Resolve instead of LValueResolve.
14933         Although we are resolving for LValues, we will let the Assign code
14934         take care of that (it will be called again from Resolve).  This
14935         basically allows code like this:
14936
14937         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14938         class Y { void A (X x) { x [0] += o; }
14939
14940         The problem was that the indexer was trying to resolve for
14941         set_Item (idx, object o) and never finding one.  The real set_Item
14942         was set_Item (idx, X).  By delaying the process we get the right
14943         semantics. 
14944
14945         Fixes bug 36505
14946
14947 2003-02-23  Martin Baulig  <martin@ximian.com>
14948
14949         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14950         while calling DoEmit ().
14951
14952         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14953         source files; if you use the #line directive inside a method, the
14954         compiler stops emitting line numbers for the debugger until it
14955         reaches the end of the method or another #line directive which
14956         restores the original file.
14957
14958 2003-02-23  Martin Baulig  <martin@ximian.com>
14959
14960         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14961
14962 2003-02-23  Martin Baulig  <martin@ximian.com>
14963
14964         * statement.cs (Block.AddChildVariableNames): We need to call this
14965         recursively, not just for our immediate children.
14966
14967 2003-02-23  Martin Baulig  <martin@ximian.com>
14968
14969         * class.cs (Event.Define): Always make the field private, like csc does.
14970
14971         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14972         actually work, fixes bug #37521.
14973
14974 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14975
14976         * delegate.cs: When creating the various temporary "Parameters"
14977         classes, make sure that we call the ComputeAndDefineParameterTypes
14978         on those new parameters (just like we do with the formal ones), to
14979         allow them to be resolved in the context of the DeclSpace.
14980
14981         This fixes the bug that Dick observed in Bugzilla #38530.
14982
14983 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14984
14985         * expression.cs (ResolveMemberAccess): When resolving a constant,
14986         do not attempt to pull a constant if the value was not able to
14987         generate a valid constant.
14988
14989         * const.cs (LookupConstantValue): Do not report more errors than required.
14990
14991 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14992
14993         * expression.cs: fixes bug #38328.
14994
14995 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14996
14997         * class.cs: Changed all the various members that can be part of a
14998         class from being an ArrayList to be an Array of the right type.
14999         During the DefineType type_list, interface_list, delegate_list and
15000         enum_list are turned into types, interfaces, delegates and enums
15001         arrays.  
15002
15003         And during the member population, indexer_list, event_list,
15004         constant_list, field_list, instance_constructor_list, method_list,
15005         operator_list and property_list are turned into their real arrays.
15006
15007         Although we could probably perform this operation earlier, for
15008         good error reporting we need to keep the lists and remove the
15009         lists for longer than required.
15010
15011         This optimization was triggered by Paolo profiling the compiler
15012         speed on the output of `gen-sample-program.pl' perl script. 
15013
15014         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15015         not crash in methods like MemberLookupFailed that use this field.  
15016
15017         This problem arises when the compiler fails to resolve a type
15018         during interface type definition for example.
15019
15020 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15021
15022         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15023         inherit from System.Object, so we have to stop at null, not only
15024         when reaching System.Object.
15025
15026 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15027
15028         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15029         DeclaredOnly because the parent indexer might have had a different
15030         name, but did not loop until the top of the hierarchy was reached.
15031
15032         The problem this one fixes is 35492: when a class implemented an
15033         indexer from an interface, we were getting the interface method
15034         (which was abstract) and we were flagging an error (can not invoke
15035         abstract method).
15036
15037         This also keeps bug 33089 functioning, and test-148 functioning.
15038
15039         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15040         out if a method is special is to see if it is declared in a
15041         property or event, or whether it is one of the predefined operator
15042         names.   This should fix correctly #36804.
15043
15044 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15045
15046         The goal here is to remove the dependency on EmptyCast.Peel ().
15047         Killing it completely.
15048
15049         The problem is that currently in a number of places where
15050         constants are expected, we have to "probe" for an EmptyCast, and
15051         Peel, which is not the correct thing to do, as this will be
15052         repetitive and will likely lead to errors. 
15053
15054         The idea is to remove any EmptyCasts that are used in casts that
15055         can be reduced to constants, so we only have to cope with
15056         constants. 
15057
15058         This bug hunt was triggered by Bug 37363 and the desire to remove
15059         the duplicate pattern where we were "peeling" emptycasts to check
15060         whether they were constants.  Now constants will always be
15061         constants.
15062
15063         * ecore.cs: Use an enumconstant here instead of wrapping with
15064         EmptyCast.  
15065
15066         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15067         throwing me off.  By handling this we can get rid of a few hacks.
15068
15069         * statement.cs (Switch): Removed Peel() code.
15070
15071 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15072
15073         * class.cs: Location information for error 508
15074
15075         * expression.cs (New.DoResolve): Add a guard against double
15076         resolution of an expression.  
15077
15078         The New DoResolve might be called twice when initializing field
15079         expressions (see EmitFieldInitializers, the call to
15080         GetInitializerExpression will perform a resolve on the expression,
15081         and later the assign will trigger another resolution
15082
15083         This leads to bugs (#37014)
15084
15085         * delegate.cs: The signature for EndInvoke should contain any ref
15086         or out parameters as well.  We were not doing this in the past. 
15087
15088         * class.cs (Field.Define): Do not overwrite the type definition
15089         inside the `volatile' group.  Turns out that volatile enumerations
15090         were changing the type here to perform a validity test, which
15091         broke conversions. 
15092
15093 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15094
15095         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15096         and structs, we do not want to load the instance variable
15097
15098         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15099         enum_type has to be handled like an object reference (implicit
15100         conversions exists from this to object), but the regular IsClass
15101         and IsValueType tests will never return true for this one.
15102
15103         Also we use TypeManager.IsValueType instead of type.IsValueType,
15104         just for consistency with the rest of the code (this is only
15105         needed if we ever use the construct exposed by test-180.cs inside
15106         corlib, which we dont today).
15107
15108 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15109
15110         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15111         just InternalCall.
15112
15113 2003-02-09  Martin Baulig  <martin@ximian.com>
15114
15115         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15116         (Namespace.DefineNamespaces): New static public method; this is
15117         called when we're compiling with debugging to add all namespaces
15118         to the symbol file.
15119
15120         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15121         pass it to the Namespace's .ctor.
15122
15123         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15124         and MethodBase arguments; pass the namespace ID to the symwriter;
15125         pass the MethodBase instead of the token to the symwriter.
15126         (SymbolWriter.DefineNamespace): New method to add a namespace to
15127         the symbol file.
15128
15129 2003-02-09  Martin Baulig  <martin@ximian.com>
15130
15131         * symbolwriter.cs: New file.  This is a wrapper around
15132         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15133         methods here in near future.
15134
15135 2003-02-09  Martin Baulig  <martin@ximian.com>
15136
15137         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15138         ILGenerator.MarkSequencePoint() which are actually used by the
15139         symbol writer.
15140
15141 2003-02-09  Martin Baulig  <martin@ximian.com>
15142
15143         * location.cs (SourceFile): New public sealed class.  This
15144         contains the name and an index which is used in the location's token.
15145         (Location): Reserve an appropriate number of bits in the token for
15146         the source file instead of walking over that list, this gives us a
15147         really huge performance improvement when compiling with debugging.
15148
15149         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15150         `SourceFile' argument instead of a string.
15151         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15152         but don't parse/tokenize here, we need to generate the list of all
15153         source files before we do that.
15154         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15155         the files.
15156
15157         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15158         instead of a string.
15159
15160         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15161         of a string.
15162
15163 2003-02-09  Martin Baulig  <martin@ximian.com>
15164
15165         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15166         filename on `#line default'.
15167
15168 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15169
15170         * statement.cs: don't clear the pinned var when the fixed statement
15171         returns from the method (fixes bug#37752).
15172
15173 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15174
15175         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15176         to IsValueType.
15177
15178 2003-02-07  Martin Baulig  <martin@ximian.com>
15179
15180         * driver.cs: Removed the `--debug-args' command line argument.
15181
15182         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15183         automatically by the AsssemblyBuilder.
15184         (CodeGen.InitializeSymbolWriter): We don't need to call any
15185         initialization function on the symbol writer anymore.  This method
15186         doesn't take any arguments.
15187
15188 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15189
15190         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15191         from referenced assemblies as well.
15192
15193 2003-02-02  Martin Baulig  <martin@ximian.com>
15194
15195         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15196
15197 2003-02-02  Martin Baulig  <martin@ximian.com>
15198
15199         * class.cs (Constructor.Emit): Open the symbol writer before
15200         emitting the constructor initializer.
15201         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15202         single-stepping through constructor initializers.
15203
15204 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15205
15206         * class.cs: Handle error 549: do not allow virtual methods in
15207         sealed classes. 
15208
15209 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15210
15211         * decl.cs: Check access levels when resolving types
15212
15213 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15214
15215         * statement.cs: Add parameters and locals set in catch blocks that might 
15216         return to set vector
15217
15218 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15219
15220         * class.cs (Operator): Set the SpecialName flags for operators.
15221
15222         * expression.cs (Invocation.DoResolve): Only block calls to
15223         accessors and operators on SpecialName methods.
15224
15225         (Cast.TryReduce): Handle conversions from char constants.
15226
15227
15228 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15229
15230         * statement.cs: small memory and time optimization in FlowBranching.
15231
15232 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15233
15234         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15235         problem that the last fix but in the other sid (Set).
15236
15237         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15238         access when there is no indexer in the hierarchy.
15239
15240 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15241
15242         * class.cs: Combine some if statements.
15243
15244 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15245
15246         * driver.cs: fixed bug #37187.
15247
15248 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15249
15250         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15251         any indexer, it's needed to build a list with all the indexers in the
15252         hierarchy (AllGetters), else we have problems. Fixes #35653.
15253
15254 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15255
15256         * class.cs (MethodData.Define): It is wrong for an interface
15257         implementation to be static in both cases: explicit and implicit.
15258         We were only handling this in one case.
15259
15260         Improve the if situation there to not have negations.
15261
15262         * class.cs (Field.Define): Turns out that we do not need to check
15263         the unsafe bit on field definition, only on usage.  Remove the test.
15264
15265 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15266
15267         * driver.cs: use assembly.Location instead of Codebase (the latest
15268         patch made mcs fail when using MS assemblies).
15269
15270 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15271
15272         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15273         get the path to *corlib.dll.
15274
15275 2003-01-21  Nick Drochak <ndrochak@gol.com>
15276
15277         * cs-tokenizer.cs:
15278         * pending.cs:
15279         * typemanager.cs: Remove compiler warnings
15280
15281 2003-01-20  Duncan Mak  <duncan@ximian.com>
15282
15283         * AssemblyInfo.cs: Bump the version number to 0.19.
15284
15285 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15286
15287         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15288
15289 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15290
15291         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15292
15293 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15294
15295         * cs-parser.jay: Small fix: we were not comparing the constructor
15296         name correctly.   Thanks to Zoltan for the initial pointer.
15297
15298 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15299
15300         * cs-tokenizer.cs: Set file name when specified with #line
15301
15302 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15303
15304         * cs-parser.jay: Only perform the constructor checks here if we
15305         are named like the class;  This will help provider a better
15306         error.  The constructor path is taken when a type definition is
15307         not found, but most likely the user forgot to add the type, so
15308         report that rather than the constructor error.
15309
15310 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15311
15312         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15313         allocations.
15314
15315 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15316
15317         * cs-parser.jay: Add cleanup call.
15318
15319 2003-01-13  Duncan Mak  <duncan@ximian.com>
15320
15321         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15322         consistent with other methods.
15323
15324 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15325
15326         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15327
15328 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15329
15330         * attribute.cs: only set GuidAttr to true when we have a
15331         GuidAttribute.
15332
15333 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15334
15335         * ecore.cs:
15336         * expression.cs:
15337         * typemanager.cs: fixes to allow mcs compile corlib with the new
15338         Type.IsSubclassOf fix.
15339
15340 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15341
15342         * expression.cs (LocalVariableReference.DoResolve): Classify a
15343         constant as a value, not as a variable.   Also, set the type for
15344         the variable.
15345
15346         * cs-parser.jay (fixed_statement): take a type instead of a
15347         pointer_type, so we can produce a better error message later.
15348
15349         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15350         as an error.  
15351
15352         (For.DoEmit): Make inifinite loops have a
15353         non-conditional branch back.
15354
15355         (Fixed.DoEmit): First populate the pinned variables, then emit the
15356         statement, then clear the variables.  Before I was emitting the
15357         code once for each fixed piece.
15358
15359
15360 2003-01-08  Martin Baulig  <martin@ximian.com>
15361
15362         * statement.cs (FlowBranching.MergeChild): A break in a
15363         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15364
15365 2003-01-08  Martin Baulig  <martin@ximian.com>
15366
15367         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15368         lives in the same number space than `param_map'.  Fixes #36154.
15369
15370 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15371
15372         * cs-parser.jay (constructor_declaration): Set the
15373         Constructor.ModFlags before probing for it.  This makes the
15374         compiler report 514, 515 and 132 (the code was there, but got
15375         broken). 
15376
15377         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15378         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15379         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15380
15381 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15382
15383         * enum.cs: create the enum static fields using the enum type.
15384
15385 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15386
15387         * class.cs: don't try to create the ParamBuilder for the return
15388         type if it's not needed (and handle it breaking for the ms runtime
15389         anyway).
15390
15391 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15392
15393         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15394
15395 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15396
15397         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15398         the command.   This showed up while compiling the JANET source
15399         code, which used \r as its only newline separator.
15400
15401 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15402
15403         * class.cs (Method.Define): If we are an operator (because it
15404         reuses our code), then set the SpecialName and HideBySig.  #36128
15405
15406 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15407
15408         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15409         exception, report error 120 `object reference required'.
15410
15411         * driver.cs: Add --pause option, used during to measure the size
15412         of the process as it goes with --timestamp.
15413
15414         * expression.cs (Invocation.DoResolve): Do not allow methods with
15415         SpecialName to be invoked.
15416
15417 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15418
15419         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15420         number before adding it.
15421
15422 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15423
15424         * ecore.cs (StandardImplicitConversion): When in an unsafe
15425         context, we allow conversion between void * to any other pointer
15426         type. This fixes bug #35973.
15427
15428 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15429
15430         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15431         is not thrown when extensionless outputs are used 
15432
15433 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15434
15435         * rootcontext.cs: fixed compilation of corlib.
15436
15437 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15438
15439         * attribute.cs (Attributes.Contains): Add new method.
15440
15441         * class.cs (MethodCore.LabelParameters): if the parameter is an
15442         `out' parameter, check that no attribute `[In]' has been passed.
15443
15444         * enum.cs: Handle the `value__' name in an enumeration.
15445
15446 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15447
15448         * decl.cs: Added special case to allow overrides on "protected
15449         internal" methods
15450
15451 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15452
15453         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15454         since it makes much more sense.
15455
15456         (Attributes.ctor): Don't require a Location parameter.
15457
15458         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15459
15460         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15461         since we already have that information per attribute.
15462
15463         * everywhere : make appropriate changes.
15464
15465         * class.cs (LabelParameters): Write the code which actually
15466         applies attributes to the return type. We can't do this on the MS
15467         .NET runtime so we flag a warning in the case an exception is
15468         thrown.
15469
15470 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15471
15472         * const.cs: Handle implicit null conversions here too.
15473
15474 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15475
15476         * class.cs (MethodCore.LabelParameters): Remove the extra
15477         Type [] parameter since it is completely unnecessary. Instead
15478         pass in the method's attributes so that we can extract
15479         the "return" attribute.
15480
15481 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15482
15483         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15484         of ignoring it and letting the compile continue.
15485
15486         * typemanager.cs (ChangeType): use an extra argument to return an
15487         error condition instead of throwing an exception.
15488
15489 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15490
15491         * expression.cs (Unary.TryReduce): mimic the code for the regular
15492         code path.  Perform an implicit cast in the cases where we can
15493         implicitly convert to one of the integral types, and then reduce
15494         based on that constant.   This fixes bug #35483.
15495
15496 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15497
15498         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15499
15500 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15501
15502         * namespace.cs: fixed bug #35489.
15503
15504 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15505
15506         * class.cs: Remove some dead code.
15507
15508         * cs-parser.jay: Estimate the number of methods needed
15509         (RootContext.MethodCount);
15510
15511         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15512         numbers instead of StringBuilders.
15513
15514         * support.cs (PtrHashtable): Add constructor with initial size;
15515         We can now reduce reallocations of the method table.
15516
15517 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15518
15519         * attribute.cs (ApplyAttributes): Keep track of the emitted
15520         attributes on a per-target basis. This fixes bug #35413.
15521
15522 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15523
15524         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15525         default to the Windows 1252 encoding.
15526
15527         (UnixParseOption): Support version, thanks to Alp for the missing
15528         pointer. 
15529
15530         * AssemblyInfo.cs: Add nice assembly information.
15531
15532         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15533         (bug 35169).
15534
15535         * cs-parser.jay: Allow a trailing comma before the close bracked
15536         in the attribute_section production.
15537
15538         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15539         address of the instance was being taken, I will take this out,
15540         because we take the address of the object immediately here.
15541
15542 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15543
15544         * typemanager.cs (AreMultipleAllowed): Take care of the most
15545         obvious case where attribute type is not in the current assembly -
15546         stupid me ;-)
15547
15548 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15549
15550         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15551         definitions, instead of doing that afterwards.  
15552
15553         Also we use a nice little hack, depending on the constructor, we
15554         know if we are a "composed" name or a simple name.  Hence, we
15555         avoid the IndexOf test, and we avoid 
15556
15557         * codegen.cs: Add code to assist in a bug reporter to track down
15558         the source of a compiler crash. 
15559
15560 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15561
15562         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15563         types have been emitted for a given element and flag an error
15564         if something which does not have AllowMultiple set is used more
15565         than once.
15566
15567         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15568         attribute types and their corresponding AllowMultiple properties
15569
15570         (AreMultipleAllowed): Check the property for a given type.
15571
15572         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15573         property in the case we have a TypeContainer.
15574
15575         (Attributes.AddAttribute): Detect duplicates and just skip on
15576         adding them. This trivial fix catches a pretty gross error in our
15577         attribute emission - global attributes were being emitted twice!
15578
15579         Bugzilla bug #33187 is now fixed.
15580
15581 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15584         instead of pp_and).
15585
15586         * expression.cs (Binary.ResolveOperator): I can only use the
15587         Concat (string, string, string) and Concat (string, string,
15588         string, string) if the child is actually a concatenation of
15589         strings. 
15590
15591 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15592
15593         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15594         context where we need a 2-character lookahead.
15595
15596         * pending.cs (PendingImplementation): Rework so we can keep track
15597         of interface types all the time, and flag those which were
15598         implemented by parents as optional.
15599
15600 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15601
15602         * expression.cs (Binary.ResolveOperator): Use
15603         String.Concat(string,string,string) or
15604         String.Concat(string,string,string,string) when possible. 
15605
15606         * typemanager: More helper methods.
15607
15608
15609 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15610
15611         * pending.cs: remove the bogus return from GetMissingInterfaces()
15612         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15613
15614 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15615
15616         * namespace.cs: avoid duplicated 'using xxx' being added to
15617         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15618         when we get more than one 'using' statement for the same namespace.
15619         Report a CS0105 warning for it.
15620
15621 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15622
15623         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15624         of calling getChar/putback, uses internal knowledge of it.    
15625
15626         (xtoken): Reorder tokenizer so most common patterns are checked
15627         first.  This reduces the compilation time in another 5% (from 8.11s
15628         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15629
15630         The parsing time is 22% of the compilation in mcs, and from that
15631         64% is spent on the tokenization process.  
15632
15633         I tried using a binary search for keywords, but this is slower
15634         than the hashtable.  Another option would be to do a couple of
15635         things:
15636
15637                 * Not use a StringBuilder, instead use an array of chars,
15638                   with a set value.  Notice that this way we could catch
15639                   the 645 error without having to do it *afterwards*.
15640
15641                 * We could write a hand-parser to avoid the hashtable
15642                   compares altogether.
15643
15644         The identifier consumption process takes 37% of the tokenization
15645         time.  Another 15% is spent on is_number.  56% of the time spent
15646         on is_number is spent on Int64.Parse:
15647
15648                 * We could probably choose based on the string length to
15649                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15650                   computations. 
15651
15652         Another 3% is spend on wrapping `xtoken' in the `token' function.
15653
15654         Handle 0xa0 as whitespace (#34752)
15655
15656 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15657
15658         * typemanager.cs (IsCLRType): New routine to tell whether a type
15659         is one of the builtin types.  
15660
15661         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15662         typecode in more places instead of doing pointer comparissions.
15663         We could leverage some knowledge about the way the typecodes are
15664         laid out.
15665
15666         New code to cache namespaces in assemblies, it is currently not
15667         invoked, to be used soon.
15668
15669         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15670
15671         * expression.cs (Binary.ResolveOperator): specially handle
15672         strings, and do not perform user-defined operator overloading for
15673         built-in types.
15674
15675 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15676
15677         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15678         internalcall as it is a pretty simple operation;  Avoid whenever
15679         possible to call Char.IsLetter.
15680
15681         (consume_identifier): Cut by half the number of
15682         hashtable calls by merging the is_keyword and GetKeyword behavior.
15683
15684         Do not short-circuit, because if we do, we
15685         report errors (ie, #if false && true would produce an invalid
15686         directive error);
15687
15688
15689 2002-11-24  Martin Baulig  <martin@ximian.com>
15690
15691         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15692         check constant ranges and report a CS0221.  Fixes #33186.
15693
15694 2002-11-24  Martin Baulig  <martin@ximian.com>
15695
15696         * cs-parser.jay: Make this work for uninitialized variable
15697         declarations in the `for' initializer.  Fixes #32416.
15698
15699 2002-11-24  Martin Baulig  <martin@ximian.com>
15700
15701         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15702         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15703
15704 2002-11-24  Martin Baulig  <martin@ximian.com>
15705
15706         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15707         argument; if true, we also check for user-defined conversions.
15708         This is only needed if both arguments are of a user-defined type.
15709         Fixes #30443, added test-175.cs.
15710         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15711
15712         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15713
15714 2002-11-24  Martin Baulig  <martin@ximian.com>
15715
15716         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15717         function to get the store opcode.
15718         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15719         only emit the Ldelema if the store opcode is Stobj.  You must run
15720         both test-34 and test-167 to test this.  Fixes #34529.
15721
15722 2002-11-23  Martin Baulig  <martin@ximian.com>
15723
15724         * ecore.cs (Expression.MemberLookup): Added additional
15725         `qualifier_type' argument which is used when we're being called
15726         from MemberAccess.DoResolve() and null if we're called from a
15727         SimpleName lookup.
15728         (Expression.MemberLookupFailed): New method to report errors; this
15729         does the CS1540 check and reports the correct error message.
15730
15731         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15732         argument for the CS1540 check and redone the way how we're dealing
15733         with private members.  See the comment in the source code for details.
15734         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15735         `closure_start_type' to `closure_qualifier_type' and check whether
15736         it's not null.  It was not this filter being broken, it was just
15737         being called with the wrong arguments.
15738
15739         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15740         and pass it the correct `qualifier_type'; this also does the error
15741         handling for us.
15742
15743 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15744
15745         * expression.cs (Invocation.EmitParams): If the we are dealing
15746         with a non-built-in value type, load its address as well.
15747
15748         (ArrayCreation): Use a a pretty constant instead
15749         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15750         static initializers.  
15751
15752         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15753         because they are not really value types, just glorified integers. 
15754
15755         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15756
15757         * ecore.cs: Remove redundant code for enumerations, make them use
15758         the same code path as everything else, fixes the casting issue
15759         with enumerations in Windows.Forms.
15760
15761         * attribute.cs: Do only cast to string if it is a string, the
15762         validation happens later.
15763
15764         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15765         people upgrade their corlibs.
15766
15767         * ecore.cs: Oops, enumerations were not following the entire code path
15768
15769 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15770
15771         * typemanager.cs (FilterWithClosure): Commented out the test for
15772         1540 in typemanager.cs, as it has problems when accessing
15773         protected methods from a parent class (see test-174.cs). 
15774
15775         * attribute.cs (Attribute.ValidateGuid): new method.
15776         (Attribute.Resolve): Use above.
15777
15778 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15779
15780         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15781
15782         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15783         handling for enumerations, as we only needed the TypeContainer
15784         functionality to begin with (this is required for the fix below to
15785         work for enums that reference constants in a container class for
15786         example). 
15787
15788         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15789
15790         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15791         a valid TypeBuilder to perform lookups on.o
15792
15793         * class.cs (InheritableMemberSignatureCompare): Use true in the
15794         call to GetGetMethod and GetSetMethod, because we are comparing
15795         the signature, and we need to get the methods *even* if they are
15796         private. 
15797
15798         (PropertyBase.CheckBase): ditto.
15799
15800         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15801         GotoCase.Resolve): Use Peel on EmpytCasts.
15802
15803         * ecore.cs (EmptyCast): drop child, add Peel method.
15804
15805 2002-11-17  Martin Baulig  <martin@ximian.com>
15806
15807         * ecore.cs (EmptyCast.Child): New public property.
15808
15809         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15810         label resolved to an EmptyCast.  Fixes #34162.
15811         (GotoCase.Resolve): Likewise.
15812         (Block.EmitMeta): Likewise.
15813
15814 2002-11-17  Martin Baulig  <martin@ximian.com>
15815
15816         * expression.cs (Invocation.BetterConversion): Prefer int over
15817         uint; short over ushort; long over ulong for integer literals.
15818         Use ImplicitConversionExists instead of StandardConversionExists
15819         since we also need to check for user-defined implicit conversions.
15820         Fixes #34165.  Added test-173.cs.
15821
15822 2002-11-16  Martin Baulig  <martin@ximian.com>
15823
15824         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15825         with the `true' and `false' literals.  Fixes #33151.
15826
15827 2002-11-16  Martin Baulig  <martin@ximian.com>
15828
15829         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15830         October 22nd; don't do the cs1540 check for static members.
15831
15832         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15833         now using our own filter here and doing the cs1540 check again.
15834
15835 2002-11-16  Martin Baulig  <martin@ximian.com>
15836
15837         * support.cs (InternalParameters): Don't crash if we don't have
15838         any fixed parameters.  Fixes #33532.
15839
15840 2002-11-16  Martin Baulig  <martin@ximian.com>
15841
15842         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15843         when looking up static methods to make this work on Windows.
15844         Fixes #33773.
15845
15846 2002-11-16  Martin Baulig  <martin@ximian.com>
15847
15848         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15849         a setter rather than using PropertyInfo.CanWrite.
15850
15851 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15852
15853         * class.cs: Allow acces to block member by subclasses. Fixes build
15854         breaker.
15855
15856 2002-11-14  Martin Baulig  <martin@ximian.com>
15857
15858         * class.cs (Constructor.Emit): Added the extern/block check.
15859         Fixes bug #33678.
15860
15861 2002-11-14  Martin Baulig  <martin@ximian.com>
15862
15863         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15864         iteration while looking for indexers, this is needed because the
15865         indexer may have a different name in our base classes.  Fixed the
15866         error reporting (no indexers at all, not get accessor, no
15867         overloaded match).  Fixes bug #33089.
15868         (IndexerAccess.DoResolveLValue): Likewise.
15869
15870 2002-11-14  Martin Baulig  <martin@ximian.com>
15871
15872         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15873         indexers.  Fixes the first part of bug #33089.
15874         (MethodSignature.InheritableMemberSignatureCompare): Added support
15875         for properties.
15876
15877 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15878
15879         * attribute.cs (Attribute.Resolve): Catch the
15880         NullReferenceException and report it since it isn't supposed to
15881         happen. 
15882
15883 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15884
15885         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15886         LogicalOr and LogicalAnd that can benefit from recursively
15887         handling EmitBranchable.  The code now should be nice for Paolo.
15888
15889 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15890
15891         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15892         the Type lookups, as we perform quite a number of lookups on
15893         non-Types.  This can be removed once we can deterministically tell
15894         whether we have a type or a namespace in advance.
15895
15896         But this might require special hacks from our corlib.
15897
15898         * TODO: updated.
15899
15900         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15901         and double which avoids a conversion from an integer to a double.
15902
15903         * expression.cs: tiny optimization, avoid calling IsConstant,
15904         because it effectively performs the lookup twice.
15905
15906 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15907
15908         But a bogus return here to keep the semantics of the old code
15909         until the Mono runtime is fixed.
15910
15911         * pending.cs (GetMissingInterfaces): New method used to remove all
15912         the interfaces that are already implemented by our parent
15913         classes from the list of pending methods. 
15914
15915         * interface.cs: Add checks for calls after ResolveTypeExpr.
15916
15917 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15918
15919         * class.cs (Class.Emit): Report warning 67: event not used if the
15920         warning level is beyond 3.
15921
15922         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15923         being a NullLiteral.
15924
15925         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15926         specifiers. 
15927
15928         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15929         path that might fail if a type can not be resolved.
15930
15931         * expression.cs (Binary.Emit): Emit unsigned versions of the
15932         operators. 
15933
15934         * driver.cs: use error 5.
15935
15936 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15937
15938         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15939
15940 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * cs-parser.jay (switch_section): A beautiful patch from Martin
15943         Baulig that fixed 33094.
15944
15945 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15946
15947         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15948         Check whether the base is abstract and report an error if so.
15949
15950         * expression.cs (IndexerAccess.DoResolveLValue,
15951         IndexerAccess.DoResolve): ditto. 
15952
15953         (Invocation.DoResolve): ditto.
15954
15955         (Invocation.FullMethodDesc): Improve the report string.
15956
15957         * statement.cs (Block): Eliminate IsVariableDefined as it is
15958         basically just a wrapper for GetVariableInfo.
15959
15960         * ecore.cs (SimpleName): Use new 
15961
15962         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15963         type, as we return the actual parameter ref/unref state on a
15964         different call.
15965
15966 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * support.cs: Return proper flags REF/OUT fixing the previous
15969         commit.  
15970
15971         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15972         not used to mean `ref' but `ref or out' in ParameterReference
15973
15974         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15975         full type signature instead of calling TypeManger.CSharpName
15976         ourselves. 
15977
15978         * support.cs (InternalParameters.ParameterDesc): Do not compare
15979         directly to the modflags, because REF/OUT will actually be bitsets
15980         if set. 
15981
15982         * delegate.cs (VerifyMethod): Check also the modifiers.
15983
15984         * cs-tokenizer.cs: Fix bug where floating point values with an
15985         exponent where a sign was missing was ignored.
15986
15987         * driver.cs: Allow multiple assemblies to be specified in a single
15988         /r: argument
15989
15990 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15991
15992         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15993         because identifiers after a parenthesis would end up in this kind
15994         of production, and we needed to desamiguate it for having casts
15995         like:
15996
15997                 (UserDefinedType *) xxx
15998
15999 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16000
16001         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16002         we should set on the Bindingflags.NonPublic, but not turn on
16003         private_ok.  private_ok controls whether a Private member is
16004         returned (this is chekced on the filter routine), while the
16005         BindingFlags.NonPublic just controls whether private/protected
16006         will be allowed.   This fixes the problem part of the problem of
16007         private properties being allowed to be used in derived classes.
16008
16009         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16010         so we can call the children DoResolveLValue method (this will
16011         properly signal errors on lvalue assignments to base properties)
16012
16013         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16014         getter are null, and we have a property info, we know that this
16015         happened because the lookup failed, so we report an error 122 for
16016         protection level violation.
16017
16018         We also silently return if setter and getter are null in the
16019         resolve functions, this condition only happens if we have flagged
16020         the error before.  This is the other half of the problem. 
16021
16022         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16023         not have accessibility information, that is why we were returning
16024         true in the filter function in typemanager.cs.
16025
16026         To properly report 122 (property is inaccessible because of its
16027         protection level) correctly, we report this error in ResolveAccess
16028         by failing if both the setter and the getter are lacking (ie, the
16029         lookup failed). 
16030
16031         DoResolve and DoLResolve have been modified to check for both
16032         setter/getter being null and returning silently, the reason being
16033         that I did not want to put the knowledge about this error in upper
16034         layers, like:
16035
16036         int old = Report.Errors;
16037         x = new PropertyExpr (...);
16038         if (old != Report.Errors)
16039                 return null;
16040         else
16041                 return x;
16042
16043         So the property expr is returned, but it is invalid, so the error
16044         will be flagged during the resolve process. 
16045
16046         * class.cs: Remove InheritablePropertySignatureCompare from the
16047         class, as we no longer depend on the property signature to compute
16048         whether it is possible to implement a method or not.
16049
16050         The reason is that calling PropertyInfo.GetGetMethod will return
16051         null (in .NET, in Mono it works, and we should change this), in
16052         cases where the Get Method does not exist in that particular
16053         class.
16054
16055         So this code:
16056
16057         class X { public virtual int A { get { return 1; } } }
16058         class Y : X { }
16059         class Z : Y { public override int A { get { return 2; } } }
16060
16061         Would fail in Z because the parent (Y) would not have the property
16062         defined.  So we avoid this completely now (because the alternative
16063         fix was ugly and slow), and we now depend exclusively on the
16064         method names.
16065
16066         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16067         reference method, instead of using the property.
16068
16069         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16070         routines are gone now.
16071
16072         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16073         names, they were incorrectly named.
16074
16075         * cs-tokenizer.cs: Return are more gentle token on failure. 
16076
16077         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16078         had an out-of-sync index variable, which caused it to remove from
16079         the list of pending methods the wrong method sometimes.
16080
16081 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16082
16083         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16084         CanWrite, because those refer to this particular instance of the
16085         property, and do not take into account the fact that we can
16086         override single members of a property.
16087
16088         Constructor requires an EmitContext.  The resolution process does
16089         not happen here, but we need to compute the accessors before,
16090         because the resolution does not always happen for properties.
16091
16092         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16093         subclass, before we did not update this flag, but we did update
16094         bindingflags. 
16095
16096         (GetAccessors): Drop this routine, as it did not work in the
16097         presence of partially overwritten set/get methods. 
16098
16099         Notice that this broke the cs1540 detection, but that will require
16100         more thinking. 
16101
16102 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16103
16104         * class.cs:
16105         * codegen.cs:
16106         * driver.cs: issue a warning instead of an error if we don't support
16107         debugging for the platform. Also ignore a couple of errors that may
16108         arise when trying to write the symbols. Undo my previous patch.
16109
16110 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16111
16112         * driver.cs: ignore /debug switch except for Unix platforms.
16113
16114 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16115
16116         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16117
16118 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16119
16120         * driver.cs: Do not make mcs-debug conditional, so we do not break
16121         builds that use it.
16122
16123         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16124         review this patch.  But basically after all the children variables
16125         have been merged, the value of "Breaks" was not being set to
16126         new_breaks for Switch blocks.  I think that it should be set after
16127         it has executed.  Currently I set this to the value of new_breaks,
16128         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16129         conservative, but I do not understand this code very well.
16130
16131         I did not break anything in the build, so that is good ;-)
16132
16133         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16134
16135 2002-10-20  Mark Crichton  <crichton@gimp.org>
16136
16137         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16138
16139 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16140
16141         * cfold.cs: Fixed compile blocker.
16142
16143 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16144
16145         * driver.cs: I was chekcing the key, not the file.
16146
16147 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16148
16149         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16150         message that we were generating - we just need to silently return
16151         a null.
16152
16153 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16154
16155         * class.cs (Event.Define): Change my previous commit, as this
16156         breaks the debugger.  This is a temporary hack, as it seems like
16157         the compiler is generating events incorrectly to begin with.
16158
16159         * expression.cs (Binary.ResolveOperator): Added support for 
16160         "U operator - (E x, E y)"
16161
16162         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16163         y)".
16164
16165         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16166         init-only variables, but this path did not take into account that
16167         there might be also instance readonly variables.  Correct this
16168         problem. 
16169
16170         This fixes bug 32253
16171
16172         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16173         delegates as well.
16174
16175         * driver.cs: Change the extension for modules to `netmodule'
16176
16177         * cs-parser.jay: Improved slightly the location tracking for
16178         the debugger symbols.
16179
16180         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16181         modifiers that were specified instead of the hardcoded value
16182         (FamAndAssem).  This was basically ignoring the static modifier,
16183         and others.  Fixes 32429.
16184
16185         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16186         fixed a bug in the process (32476)
16187
16188         * expression.cs (ArrayAccess.EmitAssign): Patch from
16189         hwang_rob@yahoo.ca that fixes bug 31834.3
16190
16191 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16192
16193         * driver.cs: Make the module extension .netmodule.
16194
16195 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16196
16197         * driver.cs: Report an error if the resource file is not found
16198         instead of crashing.
16199
16200         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16201         false, like Emit does.
16202
16203 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16204
16205         * typemanager.cs: Remove unused private member.  Also reported mcs
16206         bug to report this as a warning like csc.
16207
16208 2002-10-15  Martin Baulig  <martin@gnome.org>
16209
16210         * statement.cs (Statement.Emit): Made this a virtual method; emits
16211         the line number info and calls DoEmit().
16212         (Statement.DoEmit): New protected abstract method, formerly knows
16213         as Statement.Emit().
16214
16215         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16216
16217 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16218
16219         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16220         have fixed a remaining problem: not every AddXXXX was adding a
16221         fully qualified name.  
16222
16223         Now everyone registers a fully qualified name in the DeclSpace as
16224         being defined instead of the partial name.  
16225
16226         Downsides: we are slower than we need to be due to the excess
16227         copies and the names being registered this way.  
16228
16229         The reason for this is that we currently depend (on the corlib
16230         bootstrap for instance) that types are fully qualified, because
16231         we dump all the types in the namespace, and we should really have
16232         types inserted into the proper namespace, so we can only store the
16233         basenames in the defined_names array.
16234
16235 2002-10-10  Martin Baulig  <martin@gnome.org>
16236
16237         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16238         from bug #31834, see the bug report for a testcase which is
16239         miscompiled.
16240
16241 2002-10-10  Martin Baulig  <martin@gnome.org>
16242
16243         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16244         flow analysis code for this.
16245
16246         * statement.cs (Do, While, For): Tell the flow analysis code about
16247         infinite loops.
16248         (FlowBranching.UsageVector): Added support for infinite loops.
16249         (Block.Resolve): Moved the dead code elimination here and use flow
16250         analysis to do it.
16251
16252 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16253
16254         * class.cs (Field.Define): Catch cycles on struct type
16255         definitions. 
16256
16257         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16258         fields if the fields are static.  We only need to check instance
16259         fields. 
16260
16261         * expression.cs (As.DoResolve): Test for reference type.
16262
16263         * statement.cs (Using.ResolveExpression): Use
16264         ConvertImplicitRequired, not ConvertImplicit which reports an
16265         error on failture
16266         (Using.ResolveLocalVariableDecls): ditto.
16267
16268         * expression.cs (Binary.ResolveOperator): Report errors in a few
16269         places where we had to.
16270
16271         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16272
16273 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16274
16275         * expression.cs: Use StoreFromPtr instead of extracting the type
16276         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16277
16278         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16279         an enumeration value to a System.Enum, but System.Enum is not a
16280         value type, but an class type, so we need to box.
16281
16282         (Expression.ConvertExplicit): One codepath could return
16283         errors but not flag them.  Fix this.  Fixes #31853
16284
16285         * parameter.cs (Resolve): Do not allow void as a parameter type.
16286
16287 2002-10-06  Martin Baulig  <martin@gnome.org>
16288
16289         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16290         if it's a class type and not a struct.  Fixes #31815.
16291
16292 2002-10-06  Martin Baulig  <martin@gnome.org>
16293
16294         * statement.cs: Reworked the flow analysis code a bit to make it
16295         usable for dead code elimination.
16296
16297 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16298
16299         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16300
16301 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16302
16303         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16304         to fix the test 165, will investigate deeper.
16305
16306 2002-10-04  Martin Baulig  <martin@gnome.org>
16307
16308         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16309         finally blocks actually work.
16310         (Try.Resolve): We don't need to create a sibling for `finally' if
16311         there is no finally block.
16312
16313 2002-10-04  Martin Baulig  <martin@gnome.org>
16314
16315         * class.cs (Constructor.Define): The default accessibility for a
16316         non-default constructor is private, not public.
16317
16318 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16319
16320         * class.cs (Constructor): Make AllowedModifiers public, add
16321         EXTERN.
16322
16323         * cs-parser.jay: Perform the modifiers test here, as the
16324         constructor for the Constructor class usually receives a zero
16325         because of the way we create it (first we create, later we
16326         customize, and we were never checking the modifiers).
16327
16328         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16329         is a version of LookupTypeReflection that includes the type-name
16330         cache.  This can be used as a fast path for functions that know
16331         the fully qualified name and are only calling into *.GetType() to
16332         obtain a composed type.
16333
16334         This is also used by TypeManager.LookupType during its type
16335         composition.
16336
16337         (LookupType): We now also track the real type name, as sometimes
16338         we can get a quey for the real type name from things like
16339         ComposedCast.  This fixes bug 31422.
16340
16341         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16342         complete type fullname, it does not have to go through the type
16343         resolution system to obtain the composed version of the type (for
16344         obtaining arrays or pointers).
16345
16346         (Conditional.Emit): Use the EmitBoolExpression to
16347         generate nicer code, as requested by Paolo.
16348
16349         (ArrayCreation.CheckIndices): Use the patch from
16350         hwang_rob@yahoo.ca to validate the array initializers. 
16351
16352 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16353
16354         * class.cs (ConstructorInitializer.Emit): simplify code by using
16355         Invocation.EmitCall, and at the same time, fix the bugs in calling
16356         parent constructors that took variable arguments. 
16357
16358         * ecore.cs (Expression.ConvertNumericExplicit,
16359         Expression.ImplicitNumericConversion): Remove the code that
16360         manually wrapped decimal (InternalTypeConstructor call is now gone
16361         as well).
16362
16363         * expression.cs (Cast.TryReduce): Also handle decimal types when
16364         trying to perform a constant fold on the type.
16365
16366         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16367
16368         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16369         that only turned off an error report, and did nothing else. 
16370
16371 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16372
16373         * driver.cs: Handle and ignore /fullpaths
16374
16375 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16376
16377         * expression.cs (Binary.ResolveOperator): Catch the case where
16378         DoNumericPromotions returns true, 
16379
16380         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16381
16382 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16383
16384         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16385         report error 70.
16386
16387 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16388
16389         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16390         conversion exists, but it is also required that the conversion be
16391         performed.  This manifested in "(Type64Enum) 2".  
16392
16393         * class.cs (TypeManager.AddMethod): The fix is not to change
16394         AddEnum, because that one was using a fully qualified name (every
16395         DeclSpace derivative does), but to change the AddMethod routine
16396         that was using an un-namespaced name.  This now correctly reports
16397         the duplicated name.
16398
16399         Revert patch until I can properly fix it.  The issue
16400         is that we have a shared Type space across all namespaces
16401         currently, which is wrong.
16402
16403         Options include making the Namespace a DeclSpace, and merge
16404         current_namespace/current_container in the parser.
16405
16406 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16407
16408         * cs-parser.jay: Improve error reporting when we get a different
16409         kind of expression in local_variable_type and
16410         local_variable_pointer_type. 
16411
16412         Propagate this to avoid missleading errors being reported.
16413
16414         * ecore.cs (ImplicitReferenceConversion): treat
16415         TypeManager.value_type as a target just like object_type.   As
16416         code like this:
16417
16418         ValueType v = 1;
16419
16420         Is valid, and needs to result in the int 1 being boxed before it
16421         is assigned to the value type v.
16422
16423         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16424         to validate the enumeration name.
16425
16426         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16427         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16428         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16429
16430         * ecore.cs (TryImplicitIntConversion): When doing an
16431         implicit-enumeration-conversion, check if the type is 64-bits and
16432         perform a conversion before passing to EnumConstant.
16433
16434 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16435
16436         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16437         report ambiguous type references.  Unlike the MS version, we
16438         report what the ambiguity is.   Innovation at work ;-)
16439
16440         (DeclSpace.FindType): Require a location argument to
16441         display when we display an ambiguous error.
16442
16443         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16444
16445         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16446
16447         * expression.cs (EmitDynamicInitializers): Apply patch from
16448         hwang_rob@yahoo.ca that fixes the order in which we emit our
16449         initializers. 
16450
16451 2002-09-21  Martin Baulig  <martin@gnome.org>
16452
16453         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16454         delegate takes no arguments.
16455
16456 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16457
16458         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16459         from integers.
16460
16461         * expression.cs: Extract the underlying type.
16462
16463         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16464
16465         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16466
16467 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16468
16469         * class.cs (TypeContainer.DefineType): We can not use the nice
16470         PackingSize with the size set to 1 DefineType method, because it
16471         will not allow us to define the interfaces that the struct
16472         implements.
16473
16474         This completes the fixing of bug 27287
16475
16476         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16477         means also structs.  This fixes part of the problem. 
16478         (Expresion.ImplicitReferenceConversionExists): ditto.
16479
16480         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16481         error if there were no errors reported during the type lookup
16482         process, to avoid duplicates or redundant errors.  Without this
16483         you would get an ambiguous errors plus a type not found.  We have
16484         beaten the user enough with the first error.  
16485
16486         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16487         reference. 
16488
16489         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16490         during the resolution process, stop the lookup, this avoids
16491         repeated error reports (same error twice).
16492
16493         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16494
16495         * typemanager.cs (LookupType): Redo the type lookup code to match
16496         the needs of System.Reflection.  
16497
16498         The issue is that System.Reflection requires references to nested
16499         types to begin with a "+" sign instead of a dot.  So toplevel
16500         types look like: "NameSpace.TopLevelClass", and nested ones look
16501         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16502         levels. 
16503
16504 2002-09-19  Martin Baulig  <martin@gnome.org>
16505
16506         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16507         says that a method always returns or always throws an exception,
16508         don't report the CS0161.
16509
16510         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16511         set `Returns = new_returns'.
16512
16513 2002-09-19  Martin Baulig  <martin@gnome.org>
16514
16515         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16516         to an enum constant, check for a CS0176.
16517
16518 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16519
16520         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16521         for operators that must be in pairs and report errors.
16522
16523         * ecore.cs (SimpleName.DoResolveType): During the initial type
16524         resolution process, when we define types recursively, we must
16525         check first for types in our current scope before we perform
16526         lookups in the enclosing scopes.
16527
16528         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16529
16530         (Invocation.VerifyArgumentsCompat): Call
16531         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16532         I thought we were supposed to always call this, but there are a
16533         few places in the code where we dont do it.
16534
16535 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16536
16537         * driver.cs: Add support in -linkres and -resource to specify the
16538         name of the identifier.
16539
16540 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * ecore.cs (StandardConversionExists): Sync with the conversion
16543         code: allow anything-* to void* conversions.
16544
16545         (FindMostSpecificSource): Use an Expression argument
16546         instead of a Type, because we might be handed over a Literal which
16547         gets a few more implicit conversions that plain types do not.  So
16548         this information was being lost.
16549
16550         Also, we drop the temporary type-holder expression when not
16551         required.
16552
16553 2002-09-17  Martin Baulig  <martin@gnome.org>
16554
16555         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16556         this is an explicit interface implementation.
16557
16558 2002-09-17  Martin Baulig  <martin@gnome.org>
16559
16560         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16561         different `IndexerName' attributes.
16562
16563         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16564         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16565         virtual CommonResolve().
16566
16567 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16568
16569         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16570         and convert that to the UnderlyingType.
16571
16572         * statement.cs (Foreach.Resolve): Indexers are just like variables
16573         or PropertyAccesses.
16574
16575         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16576         inside quoted strings, we were not doing this before.
16577
16578 2002-09-16  Martin Baulig  <martin@gnome.org>
16579
16580         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16581         resolve it.  This is needed for the definite assignment check of the
16582         instance expression, fixes bug #29846.
16583         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16584
16585 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16586
16587         * parameter.cs: Fix compile error.  Cannot reference static member
16588         from an instance object.  Is this an mcs bug?
16589
16590 2002-09-14  Martin Baulig  <martin@gnome.org>
16591
16592         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16593         multiple times.  Fixes bug #30295, added test-166.cs.
16594
16595 2002-09-14  Martin Baulig  <martin@gnome.org>
16596
16597         * statement.cs (Block.Emit): Don't emit unreachable code.
16598         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16599         `break' statements.
16600         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16601
16602 2002-09-14  Martin Baulig  <martin@gnome.org>
16603
16604         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16605         is set.
16606
16607 2002-09-14  Martin Baulig  <martin@gnome.org>
16608
16609         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16610         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16611         be false on the ms runtime.
16612
16613 2002-09-13  Martin Baulig  <martin@gnome.org>
16614
16615         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16616         the CS0038 error message.
16617
16618 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16619
16620         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16621         constant inside, return it.
16622
16623 2002-09-12  Martin Baulig  <martin@gnome.org>
16624
16625         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16626         implicit conversion can be done between enum types.
16627
16628         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16629         check whether an implicit conversion to the current enum's UnderlyingType
16630         exists and report an error if not.
16631
16632         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16633         without debugging support.
16634
16635         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16636         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16637
16638 2002-09-12  Martin Baulig  <martin@gnome.org>
16639
16640         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16641
16642         * ecore.cs (IMemberExpr.DeclaringType): New property.
16643         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16644         nonstatic member of an outer type (CS0038).
16645
16646 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16647
16648         * driver.cs: Activate the using-error detector at warning level
16649         4 (at least for MS-compatible APIs).
16650
16651         * namespace.cs (VerifyUsing): Small buglett fix.
16652
16653         * pending.cs (PendingImplementation): pass the container pointer. 
16654
16655         * interface.cs (GetMethods): Allow for recursive definition.  Long
16656         term, I would like to move every type to support recursive
16657         definitions, not the current ordering mechanism that we have right
16658         now.
16659
16660         The situation is this: Attributes are handled before interfaces,
16661         so we can apply attributes to interfaces.  But some attributes
16662         implement interfaces, we will now handle the simple cases
16663         (recursive definitions will just get an error).  
16664
16665         * parameter.cs: Only invalidate types at the end if we fail to
16666         lookup all types.  
16667
16668 2002-09-09  Martin Baulig  <martin@gnome.org>
16669
16670         * ecore.cs (PropertyExpr.Emit): Also check for
16671         TypeManager.system_int_array_get_length so this'll also work when
16672         compiling corlib.  Fixes #30003.
16673
16674 2002-09-09  Martin Baulig  <martin@gnome.org>
16675
16676         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16677         and throw an exception if we can't get the type's size.  Fixed #30040,
16678         added test-165.cs.
16679
16680 2002-09-09  Martin Baulig  <martin@gnome.org>
16681
16682         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16683
16684         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16685         context.  Fixes bug #30027.
16686
16687         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16688         virtual functions.  Fixes bug #30043, added test-164.cs.
16689
16690 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16691
16692         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16693
16694 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16695
16696         * driver.cs: Use an object to get the windows codepage since it's not a
16697         static property.
16698
16699 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * statement.cs (For.Emit): for infinite loops (test == null)
16702         return whether there is a break inside, not always "true".
16703
16704         * namespace.cs (UsingEntry): New struct to hold the name of the
16705         using definition, the location where it is defined, and whether it
16706         has been used in a successful type lookup.
16707
16708         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16709         strings.
16710
16711         * decl.cs: ditto.
16712
16713 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16714
16715         * attribute.cs : Fix incorrect code which relied on catching
16716         a NullReferenceException to detect a null being passed in
16717         where an object was expected.
16718
16719 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16720
16721         * statement.cs (Try): flag the catch variable as assigned
16722
16723         * expression.cs (Cast): Simplified by using ResolveType instead of
16724         manually resolving.
16725
16726         * statement.cs (Catch): Fix bug by using ResolveType.
16727
16728 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16729
16730         * expression.cs (BetterConversion): Special case for when we have
16731         a NullLiteral as the argument and we have to choose between string
16732         and object types - we choose string the way csc does.
16733
16734         * attribute.cs (Attribute.Resolve): Catch the
16735         NullReferenceException and report error #182 since the Mono
16736         runtime no more has the bug and having this exception raised means
16737         we tried to select a constructor which takes an object and is
16738         passed a null.
16739
16740 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16741
16742         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16743         message (1502, 1503) when we can't locate a method after overload
16744         resolution. This is much more informative and closes the bug
16745         Miguel reported.
16746
16747         * interface.cs (PopulateMethod): Return if there are no argument
16748         types. Fixes a NullReferenceException bug.
16749
16750         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16751         expressions too. Previously we were checking only in one place for
16752         positional arguments leaving out named arguments.
16753
16754         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16755         type to the enum type is not allowed. Remove code corresponding to
16756         that.
16757
16758         (ConvertNumericExplicit): Allow explicit conversions from
16759         the underlying type to enum type. This precisely follows the spec
16760         and closes a bug filed by Gonzalo.
16761
16762 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16763
16764         * compiler.csproj:
16765         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16766
16767 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16768
16769         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16770         it was important that we stored the right value after the
16771         reduction in `converted'.
16772
16773 2002-09-04  Martin Baulig  <martin@gnome.org>
16774
16775         * location.cs (Location.SymbolDocument): Use full pathnames for the
16776         source files.
16777
16778 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16781         of the expression resolve mechanism, because that will catch the
16782         SimpleName error failures.
16783
16784         (Conditional): If we can not resolve the
16785         expression, return, do not crash.
16786
16787 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16788
16789         * cs-tokenizer.cs:
16790         (location): display token name instead of its number.
16791
16792 2002-08-28  Martin Baulig  <martin@gnome.org>
16793
16794         * expression.cs (Binary.ResolveOperator): Don't silently return
16795         but return an error if an operator cannot be applied between two
16796         enum types.
16797
16798 2002-08-28  Martin Baulig  <martin@gnome.org>
16799
16800         * class.cs (Constructor.Define): Set the permission attributes
16801         correctly instead of making all constructors public.
16802
16803 2002-08-28  Martin Baulig  <martin@gnome.org>
16804
16805         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16806         for private members before reporting a CS0103; if we find anything,
16807         it's a CS0122.
16808
16809 2002-08-28  Martin Baulig  <martin@gnome.org>
16810
16811         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16812         to check whether `closure_start_type == closure_invocation_type',
16813         we also need to check whether `m.DeclaringType == closure_invocation_type'
16814         before bypassing the permission checks.  We might be accessing
16815         protected/private members from the base class.
16816         (TypeManager.RealMemberLookup): Only set private_ok if private
16817         members were requested via BindingFlags.NonPublic.
16818
16819         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16820
16821         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16822         MethodGroupExpr.IsExplicitImpl if appropriate.
16823         (Invocation.DoResolve): Don't report the CS0120 for explicit
16824         interface implementations.
16825
16826 2002-08-27  Martin Baulig  <martin@gnome.org>
16827
16828         * expression.cs (Invocation.DoResolve): If this is a static
16829         method and we don't have an InstanceExpression, we must report
16830         a CS0120.
16831
16832 2002-08-25  Martin Baulig  <martin@gnome.org>
16833
16834         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16835         `==' between a valuetype and an object.
16836
16837 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16838
16839         * ecore.cs (TypeExpr): Provide a ToString method.
16840
16841 2002-08-24  Martin Baulig  <martin@gnome.org>
16842
16843         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16844         now called proggie.dbg and it's a binary file.
16845
16846 2002-08-23  Martin Baulig  <martin@gnome.org>
16847
16848         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16849
16850 2002-08-23  Martin Baulig  <martin@gnome.org>
16851
16852         * struct.cs (MyStructInfo.ctor): Make this work with empty
16853         structs; it's not allowed to use foreach() on null.
16854
16855 2002-08-23  Martin Baulig  <martin@gnome.org>
16856
16857         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16858         writer the full pathname of the generated assembly.
16859
16860 2002-08-23  Martin Baulig  <martin@gnome.org>
16861
16862         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16863         A `finally' block never returns or breaks; improved handling of
16864         unreachable code.
16865
16866 2002-08-23  Martin Baulig  <martin@gnome.org>
16867
16868         * statement.cs (Throw.Resolve): Allow `throw null'.
16869
16870 2002-08-23  Martin Baulig  <martin@gnome.org>
16871
16872         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16873         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16874         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16875         MemberLookup would return a wrong event if this is an explicit
16876         interface implementation and the class has an event with the same
16877         name.
16878
16879 2002-08-23  Martin Baulig  <martin@gnome.org>
16880
16881         * statement.cs (Block.AddChildVariableNames): New public method.
16882         (Block.AddChildVariableName): Likewise.
16883         (Block.IsVariableNameUsedInChildBlock): Likewise.
16884         (Block.AddVariable): Check whether a variable name has already
16885         been used in a child block.
16886
16887         * cs-parser.jay (declare_local_variables): Mark all variable names
16888         from the current block as being used in a child block in the
16889         implicit block.
16890
16891 2002-08-23  Martin Baulig  <martin@gnome.org>
16892
16893         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16894         find the symbol writer.
16895
16896         * driver.cs: csc also allows the arguments to /define being
16897         separated by commas, not only by semicolons.
16898
16899 2002-08-23  Martin Baulig  <martin@gnome.org>
16900
16901         * interface.cs (Interface.GetMembers): Added static check for events.
16902
16903 2002-08-15  Martin Baulig  <martin@gnome.org>
16904
16905         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16906         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16907
16908         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16909         why the MethodData.EmitDestructor() change was necessary.
16910
16911 2002-08-20  Martin Baulig  <martin@gnome.org>
16912
16913         * class.cs (TypeContainer.FindMembers): Added static check for events.
16914
16915         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16916
16917         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16918         use Type.GetEvents(), not Type.FindMembers().
16919
16920 2002-08-20  Martin Baulig  <martin@gnome.org>
16921
16922         * decl.cs (MemberCache): Added a special method cache which will
16923         be used for method-only searched.  This ensures that a method
16924         search will return a MethodInfo with the correct ReflectedType for
16925         inherited methods.      
16926
16927 2002-08-20  Martin Baulig  <martin@gnome.org>
16928
16929         * decl.cs (DeclSpace.FindMembers): Made this public.
16930
16931 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16932
16933         * delegate.cs: fixed build on windows.
16934         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16935
16936 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16937
16938         * ecore.cs (StandardConversionExists): Return a false
16939         if we are trying to convert the void type to anything else
16940         since that is not allowed.
16941
16942         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16943         we flag error 70 in the event an event is trying to be accessed
16944         directly from outside the declaring type.
16945
16946 2002-08-20  Martin Baulig  <martin@gnome.org>
16947
16948         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16949         MemberCache from typemanager.cs to decl.cs.
16950
16951 2002-08-19  Martin Baulig  <martin@gnome.org>
16952
16953         * class.cs (TypeContainer): Implement IMemberContainer.
16954         (TypeContainer.DefineMembers): Create the MemberCache.
16955         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16956         return public members if BindingFlags.Public was given, check
16957         whether members are static.
16958
16959 2002-08-16  Martin Baulig  <martin@gnome.org>
16960
16961         * decl.cs (DeclSpace.Define): Splitted this in Define and
16962         DefineMembers.  DefineMembers is called first and initializes the
16963         MemberCache.
16964
16965         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16966         DefineMembers() on all our DeclSpaces.
16967
16968         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16969         but call DefineMembers() on all nested interfaces.  We call their
16970         Define() in our new Define() function.
16971
16972         * interface.cs (Interface): Implement IMemberContainer.
16973         (Interface.Define): Moved all code except the attribute stuf to
16974         DefineMembers().
16975         (Interface.DefineMembers): Initialize the member cache.
16976
16977         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16978         need this anymore since we can use MemberCache.FindMembers directly.
16979
16980 2002-08-19  Martin Baulig  <martin@gnome.org>
16981
16982         * typemanager.cs (MemberCache): When creating the cache for an
16983         interface type, add all inherited members.
16984         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16985         to `out bool used_cache' and documented it.
16986         (TypeManager.MemberLookup): If we already used the cache in the first
16987         iteration, we don't need to do the interfaces check.
16988
16989 2002-08-19  Martin Baulig  <martin@gnome.org>
16990
16991         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16992         here from IMemberFinder and don't implement this interface anymore.
16993         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16994
16995         * typemanager.cs (IMemberFinder): This interface is now only used by
16996         classes which actually support the member cache.
16997         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16998         since we only put DeclSpaces into this Hashtable.
16999         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17000         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17001
17002 2002-08-16  Martin Baulig  <martin@gnome.org>
17003
17004         * typemanager.cs (ICachingMemberFinder): Removed.
17005         (IMemberFinder.MemberCache): New property.
17006         (TypeManager.FindMembers): Merged this with RealFindMembers().
17007         This function will never be called from TypeManager.MemberLookup()
17008         so we can't use the cache here, just the IMemberFinder.
17009         (TypeManager.MemberLookup_FindMembers): Check whether the
17010         IMemberFinder has a MemberCache and call the cache's FindMembers
17011         function.
17012         (MemberCache): Rewrote larger parts of this yet another time and
17013         cleaned it up a bit.
17014
17015 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17016
17017         * driver.cs (LoadArgs): Support quoting.
17018
17019         (Usage): Show the CSC-like command line arguments.
17020
17021         Improved a few error messages.
17022
17023 2002-08-15  Martin Baulig  <martin@gnome.org>
17024
17025         * typemanager.cs (IMemberContainer.Type): New property.
17026         (IMemberContainer.IsInterface): New property.
17027
17028         The following changes are conditional to BROKEN_RUNTIME, which is
17029         defined at the top of the file.
17030
17031         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17032         class'es members, but add all members from TypeHandle.ObjectType
17033         if we're an interface.
17034         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17035         is the current type.
17036         (MemberCache.CacheEntry.Container): Removed this field.
17037         (TypeHandle.GetMembers): Include inherited members.
17038
17039 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17040
17041         * typemanager.cs: fixed compilation and added a comment on a field that
17042         is never used.
17043
17044 2002-08-15  Martin Baulig  <martin@gnome.org>
17045
17046         * class.cs (ConstructorInitializer.Resolve): In the
17047         Expression.MemberLookup call, use the queried_type as
17048         invocation_type.
17049
17050         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17051         declared' attribute, it's always true.
17052         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17053         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17054         temporary wrapper for FindMembers which tells MemberLookup whether
17055         members from the base classes are included in the return value.
17056         This will go away soon.
17057         (TypeManager.MemberLookup): Use this temporary hack here; once the
17058         new MemberCache is completed, we don't need to do the DeclaredOnly
17059         looping here anymore since the MemberCache will take care of this.
17060         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17061         (MemberCache): When creating the MemberCache for a class, get
17062         members from the current class and all its base classes.
17063         (MemberCache.CacheEntry.Container): New field.  This is a
17064         temporary hack until the Mono runtime is fixed to distinguish
17065         between ReflectedType and DeclaringType.  It allows us to use MCS
17066         with both the MS runtime and the unfixed Mono runtime without
17067         problems and without accecting performance.
17068         (MemberCache.SearchMembers): The DeclaredOnly looping from
17069         TypeManager.MemberLookup is now done here.      
17070
17071 2002-08-14  Martin Baulig  <martin@gnome.org>
17072
17073         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17074         Type.GetFields on dynamic types but get the fields from the
17075         corresponding TypeContainer.
17076         (MyStructInfo.GetStructInfo): Added check for enum types.
17077
17078         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17079         (MemberList.SyncRoot): Implemented.
17080         (TypeManager.FilterWithClosure): No need to check permissions if
17081         closure_start_type == closure_invocation_type, don't crash if
17082         closure_invocation_type is null.
17083
17084 2002-08-13  Martin Baulig  <martin@gnome.org>
17085
17086         Rewrote TypeContainer.FindMembers to use a member cache.  This
17087         gives us a speed increase of about 35% for the self-hosting MCS
17088         build and of about 15-20% for the class libs (both on GNU/Linux).
17089
17090         * report.cs (Timer): New class to get enhanced profiling.  This
17091         whole class is "TIMER" conditional since it remarkably slows down
17092         compilation speed.
17093
17094         * class.cs (MemberList): New class.  This is an IList wrapper
17095         which we're now using instead of passing MemberInfo[]'s around to
17096         avoid copying this array unnecessarily.
17097         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17098         (ICachingMemberFinder, IMemberContainer): New interface.
17099         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17100         has already been checked, otherwise use it for the name comparision.
17101         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17102         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17103         if possible.  Returns a MemberList, not a MemberInfo [].
17104         (TypeHandle): New class, implements IMemberContainer.  We create
17105         one instance of this class per type, it contains a MemberCache
17106         which is used to do the member lookups.
17107         (MemberCache): New class.  Each instance of this class contains
17108         all members of a type and a name-based hash table.
17109         (MemberCache.FindMembers): This is our new member lookup
17110         function.  First, it looks up all members of the requested name in
17111         the hash table.  Then, it walks this list and sorts out all
17112         applicable members and returns them.
17113
17114 2002-08-13  Martin Baulig  <martin@gnome.org>
17115
17116         In addition to a nice code cleanup, this gives us a performance
17117         increase of about 1.4% on GNU/Linux - not much, but it's already
17118         half a second for the self-hosting MCS compilation.
17119
17120         * typemanager.cs (IMemberFinder): New interface.  It is used by
17121         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17122         Enum, Delegate or Interface.
17123         (TypeManager.finder_to_member_finder): New PtrHashtable.
17124         (TypeManager.finder_to_container): Removed.
17125         (TypeManager.finder_to_delegate): Removed.
17126         (TypeManager.finder_to_interface): Removed.
17127         (TypeManager.finder_to_enum): Removed.
17128
17129         * interface.cs (Interface): Implement IMemberFinder.
17130
17131         * delegate.cs (Delegate): Implement IMemberFinder.
17132
17133         * enum.cs (Enum): Implement IMemberFinder.
17134
17135         * class.cs (TypeContainer): Implement IMemberFinder.
17136
17137 2002-08-12  Martin Baulig  <martin@gnome.org>
17138
17139         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17140
17141 2002-08-12  Martin Baulig  <martin@gnome.org>
17142
17143         * ecore.cs (ITypeExpression): New interface for expressions which
17144         resolve to a type.
17145         (TypeExpression): Renamed to TypeLookupExpression.
17146         (Expression.DoResolve): If we're doing a types-only lookup, the
17147         expression must implement the ITypeExpression interface and we
17148         call DoResolveType() on it.
17149         (SimpleName): Implement the new ITypeExpression interface.
17150         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17151         hack, the situation that we're only looking up types can't happen
17152         anymore when this method is called.  Moved the type lookup code to
17153         DoResolveType() and call it.
17154         (SimpleName.DoResolveType): This ITypeExpression interface method
17155         is now doing the types-only lookup.
17156         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17157         (ResolveFlags): Added MaskExprClass.
17158
17159         * expression.cs (MemberAccess): Implement the ITypeExpression
17160         interface.
17161         (MemberAccess.DoResolve): Added support for a types-only lookup
17162         when we're called via ITypeExpression.DoResolveType().
17163         (ComposedCast): Implement the ITypeExpression interface.
17164
17165         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17166         Expression.Resolve() with ResolveFlags.Type instead.
17167
17168 2002-08-12  Martin Baulig  <martin@gnome.org>
17169
17170         * interface.cs (Interface.Define): Apply attributes.
17171
17172         * attribute.cs (Attribute.ApplyAttributes): Added support for
17173         interface attributes.
17174
17175 2002-08-11  Martin Baulig  <martin@gnome.org>
17176
17177         * statement.cs (Block.Emit): Only check the "this" variable if we
17178         do not always throw an exception.
17179
17180         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17181         whether the property has a set accessor.
17182
17183 2002-08-11  Martin Baulig  <martin@gnome.org>
17184
17185         Added control flow analysis support for structs.
17186
17187         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17188         with control flow analysis turned off.
17189         (IVariable): New interface.
17190         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17191         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17192         (FieldExpr.DoResolve): Resolve the instance expression with flow
17193         analysis turned off and do the definite assignment check after the
17194         resolving when we know what the expression will resolve to.
17195
17196         * expression.cs (LocalVariableReference, ParameterReference):
17197         Implement the new IVariable interface, only call the flow analysis
17198         code if ec.DoFlowAnalysis is true.
17199         (This): Added constructor which takes a Block argument.  Implement
17200         the new IVariable interface.
17201         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17202         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17203         This does the definite assignment checks for struct members.
17204
17205         * class.cs (Constructor.Emit): If this is a non-static `struct'
17206         constructor which doesn't have any initializer, call
17207         Block.AddThisVariable() to tell the flow analysis code that all
17208         struct elements must be initialized before control returns from
17209         the constructor.
17210
17211         * statement.cs (MyStructInfo): New public class.
17212         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17213         argument to this indexer.  If non-zero, check an individual struct
17214         member, not the whole struct.
17215         (FlowBranching.CheckOutParameters): Check struct members.
17216         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17217         overloaded versions of these methods which take an additional
17218         `int field_idx' argument to check struct members.
17219         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17220         overloaded versions of these methods which take an additional
17221         `string field_name' argument to check struct member.s
17222         (VariableInfo): Implement the IVariable interface.
17223         (VariableInfo.StructInfo): New public property.  Returns the
17224         MyStructInfo instance of the variable if it's a struct or null.
17225         (Block.AddThisVariable): New public method.  This is called from
17226         Constructor.Emit() for non-static `struct' constructor which do
17227         not have any initializer.  It creates a special variable for the
17228         "this" instance variable which will be checked by the flow
17229         analysis code to ensure that all of the struct's fields are
17230         initialized before control returns from the constructor.
17231         (UsageVector): Added support for struct members.  If a
17232         variable/parameter is a struct with N members, we reserve a slot
17233         in the usage vector for each member.  A struct is considered fully
17234         initialized if either the struct itself (slot 0) or all its
17235         members are initialized.
17236
17237 2002-08-08  Martin Baulig  <martin@gnome.org>
17238
17239         * driver.cs (Driver.MainDriver): Only report an error CS5001
17240         if there were no compilation errors.
17241
17242         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17243         `UnsafeContext' property to determine whether the parent is in
17244         unsafe context rather than checking the parent's ModFlags:
17245         classes nested in an unsafe class are unsafe as well.
17246
17247 2002-08-08  Martin Baulig  <martin@gnome.org>
17248
17249         * statement.cs (UsageVector.MergeChildren): Distinguish between
17250         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17251         we return.  Added test17() and test18() to test-154.cs.
17252
17253 2002-08-08  Martin Baulig  <martin@gnome.org>
17254
17255         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17256         Family access, make sure the invoking type isn't a subclass of the
17257         queried type (that'd be a CS1540).
17258
17259         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17260         this method which takes an additional `Type invocation_type'.
17261
17262         * expression.cs (BaseAccess.DoResolve): Use the base type as
17263         invocation and query type.
17264         (MemberAccess.DoResolve): If the lookup failed and we're about to
17265         report a CS0122, try a lookup with the ec.ContainerType - if this
17266         succeeds, we must report a CS1540.
17267
17268 2002-08-08  Martin Baulig  <martin@gnome.org>
17269
17270         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17271         (MethodGroupExpr): Implement the IMemberExpr interface.
17272
17273         * expression (MemberAccess.ResolveMemberAccess): No need to have
17274         any special code for MethodGroupExprs anymore, they're now
17275         IMemberExprs.   
17276
17277 2002-08-08  Martin Baulig  <martin@gnome.org>
17278
17279         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17280         Family, FamANDAssem and FamORAssem permissions.
17281         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17282
17283 2002-08-08  Martin Baulig  <martin@gnome.org>
17284
17285         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17286         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17287         or loop block.
17288
17289 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17290
17291         * driver.cs: implemented /resource option to embed managed resources.
17292
17293 2002-08-07  Martin Baulig  <martin@gnome.org>
17294
17295         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17296         (FieldBase.HasFieldInitializer): New public property.
17297         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17298         returns the field initializer and makes sure it is only resolved once.
17299         (TypeContainer.EmitFieldInitializers): Call
17300         FieldBase.GetInitializerExpression to get the initializer, this ensures
17301         that it isn't resolved multiple times.
17302
17303         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17304         the resolving process (SimpleName/MemberLookup) that we're currently
17305         emitting a field initializer (which must not access any instance members,
17306         this is an error CS0236).
17307
17308         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17309         argument, if the `IsFieldInitializer' flag is set, we must report and
17310         error CS0236 and not an error CS0120.   
17311
17312 2002-08-07  Martin Baulig  <martin@gnome.org>
17313
17314         * ecore.cs (IMemberExpr): New public interface.
17315         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17316         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17317         if the expression is an IMemberExpr.
17318
17319         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17320         to be null, implicitly default to `this' if we're non-static in
17321         this case.  Simplified the code a lot by using the new IMemberExpr
17322         interface.  Also fixed bug #28176 here.
17323
17324 2002-08-06  Martin Baulig  <martin@gnome.org>
17325
17326         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17327         ParameterReferences during semantic analysis so that we can do a
17328         type-only search when resolving Cast, TypeOf and SizeOf.
17329         (block): Pass the `current_local_parameters' to the Block's
17330         constructor.
17331
17332         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17333         argument to the constructor.
17334         (ConstructorInitializer.Resolve): Create a temporary implicit
17335         block with the parameters.
17336
17337         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17338         references here if we aren't doing a type-only search.
17339
17340         * statement.cs (Block): Added constructor which takes a
17341         `Parameters parameters' argument.
17342         (Block.Parameters): New public property.
17343
17344         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17345         to `Parameters' and made it public readonly.
17346
17347 2002-08-06  Martin Baulig  <martin@gnome.org>
17348
17349         * ecore.cs (Expression.Warning): Made this public as well.
17350
17351         * report.cs (Report.Debug): Print the contents of collections.
17352
17353 2002-08-06  Martin Baulig  <martin@gnome.org>
17354
17355         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17356         used to tell Resolve() which kinds of expressions it may return.
17357         (Expression.Resolve): Added overloaded version of this method which
17358         takes a `ResolveFlags flags' argument.  This can be used to tell
17359         Resolve() which kinds of expressions it may return.  Reports a
17360         CS0118 on error.
17361         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17362         ResolveFlags.SimpleName.
17363         (Expression.Error118): Added overloaded version of this method which
17364         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17365         which kinds of expressions are allowed.
17366
17367         * expression.cs (Argument.ResolveMethodGroup): New public method.
17368         Resolves an argument, but allows a MethodGroup to be returned.
17369         This is used when invoking a delegate.
17370
17371         * TODO: Updated a bit.
17372
17373 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17374
17375         Fixed compilation with csc.
17376
17377         * ecore.cs: Expression.Error made public. Is this correct? Should
17378         Warning be made public too?
17379
17380         * expression.cs: use ea.Location instead of ea.loc.
17381         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17382
17383 2002-08-06  Martin Baulig  <martin@gnome.org>
17384
17385         * ecore.cs (Expression.loc): Moved the location here instead of
17386         duplicating it in all derived classes.
17387         (Expression.Location): New public property.
17388         (Expression.Error, Expression.Warning): Made them non-static and
17389         removed the location argument.
17390         (Expression.Warning): Added overloaded version which takes an
17391         `int level' argument.
17392         (Expression.Error118): Make this non-static and removed the
17393         expression and location arguments.
17394         (TypeExpr): Added location argument to the constructor.
17395
17396         * expression.cs (StaticCallExpr): Added location argument to
17397         the constructor.
17398         (Indirection, PointerArithmetic): Likewise.
17399         (CheckedExpr, UnCheckedExpr): Likewise.
17400         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17401         (StringPtr): Likewise.
17402
17403
17404 2002-08-05  Martin Baulig  <martin@gnome.org>
17405
17406         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17407
17408         * assign.cs (Assign.DoResolve): Check whether the source
17409         expression is a value or variable.
17410
17411         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17412         while resolving the corresponding blocks.
17413
17414         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17415         an error, don't silently return null.
17416
17417         * statement.cs (Block.AddVariable): Do the error reporting here
17418         and distinguish between CS0128 and CS0136.
17419         (Block.DoResolve): Report all unused labels (warning CS0164).
17420         (LabeledStatement): Pass the location to the constructor.
17421         (LabeledStatement.HasBeenReferenced): New property.
17422         (LabeledStatement.Resolve): Set it to true here.
17423
17424         * statement.cs (Return.Emit): Return success even after reporting
17425         a type mismatch error (CS0126 or CS0127), this is what csc does and
17426         it avoids confusing the users with any consecutive errors.
17427
17428 2002-08-05  Martin Baulig  <martin@gnome.org>
17429
17430         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17431
17432         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17433
17434         * expression.cs (MemberAccess.DoResolve): Silently return if an
17435         error has already been reported.
17436
17437         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17438         error has already been reported.
17439
17440 2002-08-05  Martin Baulig  <martin@gnome.org>
17441
17442         * statement.cs (UsageVector): Only initialize the `parameters'
17443         vector if we actually have any "out" parameters.
17444
17445 2002-08-05  Martin Baulig  <martin@gnome.org>
17446
17447         * expression.cs (Binary.ResolveOperator): When combining delegates,
17448         they must have the same type.
17449
17450 2002-08-05  Martin Baulig  <martin@gnome.org>
17451
17452         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17453         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17454         work with the ms runtime and we also don't need it: if we're a
17455         PropertyBuilder and not in the `indexer_arguments' hash, then we
17456         are a property and not an indexer.
17457
17458         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17459         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17460         since the latter one doesn't work with the ms runtime.
17461
17462 2002-08-03  Martin Baulig  <martin@gnome.org>
17463
17464         Fixed bugs #27998 and #22735.
17465
17466         * class.cs (Method.IsOperator): New public field.
17467         (Method.CheckBase): Report CS0111 if there's already a method
17468         with the same parameters in the current class.  Report CS0508 when
17469         attempting to change the return type of an inherited method.
17470         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17471         and it's not marked abstract or extern.
17472         (PropertyBase): New abstract base class for Property and Indexer.
17473         (PropertyBase.CheckBase): Moved here from Property and made it work
17474         for indexers.
17475         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17476         the same so we can reuse it there.
17477         (Property, Indexer): Derive from PropertyBase.
17478         (MethodSignature.inheritable_property_signature_filter): New delegate
17479         to find properties and indexers.
17480
17481         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17482         argument and improved error reporting.
17483
17484         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17485         EmptyReadOnlyParameters and made it a property.
17486
17487         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17488         version of this method which takes a `PropertyInfo indexer'.
17489         (TypeManager.RegisterIndexer): New method.
17490
17491         * class.cs: Added myself as author of this file :-)
17492
17493 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17494
17495         * class.cs: fixed compilation on windoze.
17496
17497 2002-08-03  Martin Baulig  <martin@gnome.org>
17498
17499         * interface.cs (Interface.GetInterfaceBases): Check whether all
17500         base interfaces are at least as accessible than the current one.
17501
17502         * class.cs (TypeContainer.GetClassBases): Check whether base types
17503         are at least as accessible than the current type.
17504         (TypeContainer.AsAccessible): Implemented and made non-static.
17505         (MemberBase.CheckParameters): Report errors if the accessibility
17506         checks fail.
17507
17508         * delegate.cs (Delegate.Delegate): The default visibility is
17509         internal for top-level types and private for nested types.
17510         (Delegate.Define): Report errors if the accessibility checks fail.
17511
17512         * enum.cs (Enum.Enum): The default visibility is internal for
17513         top-level types and private for nested types.
17514         (Enum.DefineType): Compute the correct visibility.
17515
17516         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17517         function which takes a `bool is_toplevel' instead of a TypeContainer.
17518
17519         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17520         builtin type.
17521
17522 2002-08-02  Martin Baulig  <martin@gnome.org>
17523
17524         * expression.cs (LocalVariableReferenc): Added constructor which
17525         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17526         (LocalVariableReference.IsReadOnly): New property.
17527         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17528         variable is readonly, use our own readonly flag to do this; you can
17529         use the new constructor to get a writable reference to a read-only
17530         variable.
17531
17532         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17533         reference to the local variable.
17534
17535 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17536
17537         * rootcontext.cs (ResolveCore): Also include System.Exception
17538
17539         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17540         we reach an EmptyStatement.
17541
17542         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17543         is also fine.
17544
17545         * expression.cs (Binary.ResolveOperator): Check error result in
17546         two places.
17547
17548         use brtrue/brfalse directly and avoid compares to null.
17549
17550 2002-08-02  Martin Baulig  <martin@gnome.org>
17551
17552         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17553         Fixes bug #28407, added test-155.cs.
17554
17555 2002-08-01  Martin Baulig  <martin@gnome.org>
17556
17557         * class.cs (Event.EmitDefaultMethod): Make this work with static
17558         events.  Fixes #28311, added verify-3.cs.
17559
17560 2002-08-01  Martin Baulig  <martin@gnome.org>
17561
17562         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17563         `is_disposable' fields.
17564         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17565         `hm.is_disposable' if we're using the collection pattern.
17566         (Foreach.EmitCollectionForeach): Use the correct type for the
17567         enumerator's local variable, only emit the try/finally block if
17568         necessary (fixes #27713).
17569
17570 2002-08-01  Martin Baulig  <martin@gnome.org>
17571
17572         * ecore.cs (Expression.report118): Renamed to Error118 and made
17573         it public static.
17574
17575         * statement.cs (Throw.Resolve): Check whether the expression is of
17576         the correct type (CS0118) and whether the type derives from
17577         System.Exception (CS0155).
17578         (Catch.Resolve): New method.  Do the type lookup here and check
17579         whether it derives from System.Exception (CS0155).
17580         (Catch.CatchType, Catch.IsGeneral): New public properties.
17581
17582         * typemanager.cs (TypeManager.exception_type): Added.
17583
17584 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17585
17586         * driver.cs: Updated About function.
17587
17588 2002-07-31  Martin Baulig  <martin@gnome.org>
17589
17590         Implemented Control Flow Analysis.
17591
17592         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17593         (EmitContext.CurrentBranching): Added.
17594         (EmitContext.StartFlowBranching): Added.
17595         (EmitContext.EndFlowBranching): Added.
17596         (EmitContext.KillFlowBranching): Added.
17597         (EmitContext.IsVariableAssigned): Added.
17598         (EmitContext.SetVariableAssigned): Added.
17599         (EmitContext.IsParameterAssigned): Added.
17600         (EmitContext.SetParameterAssigned): Added.
17601         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17602         Added control flow analysis stuff here.
17603
17604         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17605         resolve the expression as lvalue.
17606         (LocalVariableReference.DoResolve): Check whether the variable has
17607         already been assigned.
17608         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17609         the parameter as assigned here.
17610         (ParameterReference.DoResolve): Check whether the parameter has already
17611         been assigned.
17612         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17613         expression as lvalue.
17614
17615         * statement.cs (FlowBranching): New class for the flow analysis code.
17616         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17617         (LabeledStatement.IsDefined): New public property.
17618         (LabeledStatement.AddUsageVector): New public method to tell flow
17619         analyis that the label may be reached via a forward jump.
17620         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17621         flow analysis.
17622         (VariableInfo.Number): New public field.  This is used by flow analysis
17623         to number all locals of a block.
17624         (Block.CountVariables): New public property.  This is the number of
17625         local variables in this block (including the locals from all parent
17626         blocks).
17627         (Block.EmitMeta): Number all the variables.
17628
17629         * statement.cs: Added flow analysis support to all classes.
17630
17631 2002-07-31  Martin Baulig  <martin@gnome.org>
17632
17633         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17634         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17635         then use this argument.
17636
17637         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17638
17639         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17640         use this to specify /define options.
17641
17642 2002-07-29  Martin Baulig  <martin@gnome.org>
17643
17644         * statement.cs (Fixed): Moved all code that does variable lookups
17645         and resolvings from Emit to Resolve.
17646
17647         * statement.cs (For): Moved all code that does variable lookups
17648         and resolvings from Emit to Resolve.
17649
17650         * statement.cs (Using): Moved all code that does variable lookups
17651         and resolvings from Emit to Resolve.
17652
17653 2002-07-29  Martin Baulig  <martin@gnome.org>
17654
17655         * attribute.cs (Attribute.Resolve): Explicitly catch a
17656         System.NullReferenceException when creating the
17657         CustromAttributeBuilder and report a different warning message.
17658
17659 2002-07-29  Martin Baulig  <martin@gnome.org>
17660
17661         * support.cs (ParameterData.ParameterName): Added method to
17662         get the name of a parameter.
17663
17664         * typemanager.cs (TypeManager.IsValueType): New public method.
17665
17666 2002-07-29  Martin Baulig  <martin@gnome.org>
17667
17668         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17669         is a flag which specifies that it's either ref or out.
17670         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17671         the out parameter to `out Parameter.Modifier mod', also set the
17672         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17673
17674         * support.cs (InternalParameters.ParameterModifier): Distinguish
17675         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17676         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17677
17678         * expression.cs (Argument.GetParameterModifier): Distinguish
17679         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17680         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17681
17682 2002-07-29  Martin Baulig  <martin@gnome.org>
17683
17684         * expression.cs (ParameterReference.ParameterReference): Added
17685         `Location loc' argument to the constructor.
17686
17687         * cs-parser.jay: Pass location to ParameterReference.
17688
17689 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17690
17691         * statement.cs (Try): Initialize the location.
17692
17693         * cs-parser.jay: pass location to Try.
17694
17695         * expression.cs (Unary.Reduce): Change the prototype to return
17696         whether a constant fold could be performed or not.  The result is
17697         returned in an out parameters.  In the case of Indirection and
17698         AddressOf, we want to perform the full tests.
17699
17700 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17701
17702         * statement.cs (Statement.Emit): Flag dead code.
17703
17704 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17705
17706         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17707
17708 2002-07-27  Martin Baulig  <martin@gnome.org>
17709
17710         * class.cs (MethodData.Define): Put back call to
17711         TypeManager.AddMethod(), accidentally commented this out.
17712
17713         * report.cs (Debug): New public method to print debugging information,
17714         this is `[Conditional ("DEBUG")]'.
17715
17716 2002-07-26  Martin Baulig  <martin@gnome.org>
17717
17718         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17719         (switch_statement): Push the current_block to the switch_stack and
17720         pop it again when we're done with the switch.
17721         (switch_section): The new block is a child of the current_block.
17722         Fixes bug #24007, added test-152.cs.
17723
17724 2002-07-27  Martin Baulig  <martin@gnome.org>
17725
17726         * expression.cs (Invocation.EmitArguments): When calling a varargs
17727         function with only its fixed arguments, we need to pass an empty
17728         array.
17729
17730 2002-07-27  Martin Baulig  <martin@gnome.org>
17731
17732         Mono 0.13 has been released.
17733
17734 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17735
17736         * driver.cs: Rename --resource to --linkres, because that is what
17737         we do currently, we dont support --resource yet.
17738
17739         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17740
17741 2002-07-25  Martin Baulig  <martin@gnome.org>
17742
17743         * class.cs (MethodData): New public class.  This is a `method builder'
17744         class for a method or one accessor of a Property/Indexer/Event.
17745         (MethodData.GetMethodFlags): Moved here from MemberBase.
17746         (MethodData.ApplyAttributes): Likewise.
17747         (MethodData.ApplyObsoleteAttribute): Likewise.
17748         (MethodData.ApplyConditionalAttribute): Likewise.
17749         (MethodData.ApplyDllImportAttribute): Likewise.
17750         (MethodData.CheckAbstractAndExternal): Likewise.
17751         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17752         (MethodData.Emit): Formerly known as Method.Emit().
17753         (MemberBase): Moved everything which was specific to a single
17754         accessor/method to MethodData.
17755         (Method): Create a new MethodData and call Define() and Emit() on it.
17756         (Property, Indexer, Event): Create a new MethodData objects for each
17757         accessor and call Define() and Emit() on them.
17758
17759 2002-07-25  Martin Baulig  <martin@gnome.org>
17760
17761         Made MethodCore derive from MemberBase to reuse the code from there.
17762         MemberBase now also checks for attributes.
17763
17764         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17765         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17766         as virtual.
17767         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17768         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17769         (MemberBase.ApplyAttributes): New virtual method; applies the
17770         attributes to a method or accessor.
17771         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17772         (MemberBase.ApplyConditionalAttribute): Likewise.
17773         (MemberBase.ApplyDllImportAttribute): Likewise.
17774         (MemberBase.CheckAbstractAndExternal): Likewise.
17775         (MethodCore.ParameterTypes): This is now a property instead of a
17776         method, it's initialized from DoDefineParameters().
17777         (MethodCore.ParameterInfo): Removed the set accessor.
17778         (MethodCore.DoDefineParameters): New protected virtual method to
17779         initialize ParameterTypes and ParameterInfo.
17780         (Method.GetReturnType): We can now simply return the MemberType.
17781         (Method.GetMethodFlags): Override the MemberBase version and add
17782         the conditional flags.
17783         (Method.CheckBase): Moved some code from Define() here, call
17784         DoDefineParameters() here.
17785         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17786         here to avoid some larger code duplication.
17787         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17788         ensure that abstract and external accessors don't declare a body.
17789
17790         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17791         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17792         lookup in the attribute's parent classes, so we need to abort as soon
17793         as we found the first match.
17794         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17795         the attribute has no arguments.
17796
17797         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17798         of a Method.
17799
17800 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17801
17802         * cs-parser.jay: reverted previous patch.
17803
17804 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17805
17806         * cs-parser.jay: fixed bug #22119.
17807
17808 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17809
17810         * attribute.cs: fixed compilation. The error was:
17811         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17812         be assigned to before control leaves the current method."
17813         [FIXME:  Filed as bug #28186: MCS must report this error.]
17814
17815 2002-07-25  Martin Baulig  <martin@gnome.org>
17816
17817         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17818         method to pull the condition name ouf of a Conditional attribute.
17819         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17820         the obsolete message and error flag out of an Obsolete attribute.
17821
17822         * class.cs (Method.GetMethodFlags): New public method to get the
17823         TypeManager.MethodFlags for this method.
17824         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17825         private methods.
17826         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17827         if we're overriding a virtual function, set the new private variable
17828         `parent_method'; call the new TypeManager.AddMethod().
17829
17830         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17831         the MethodBuilder and the Method in a PtrHashtable.
17832         (TypeManager.builder_to_method): Added for this purpose.
17833         (TypeManager.MethodFlags): Added IsObsoleteError.
17834         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17835         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17836         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17837         the message from the attribute.
17838
17839 2002-07-24  Martin Baulig  <martin@gnome.org>
17840
17841         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17842         preprocessor directives, ensure that the argument to #define/#undef is
17843         exactly one identifier and that it's actually an identifier.
17844
17845         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17846         did not work ....
17847
17848 2002-07-24  Martin Baulig  <martin@gnome.org>
17849
17850         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17851         initialize it to TypeManager.object_type in the constructor.
17852         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17853         of the `hm.get_current' method if we're using the collection pattern.
17854         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17855         for the explicit conversion to make it work when we're using the collection
17856         pattern and the `Current' property has a different return type than `object'.
17857         Fixes #27713.
17858
17859 2002-07-24  Martin Baulig  <martin@gnome.org>
17860
17861         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17862         does not match, but don't report any errors.  This method is called in
17863         order for all methods in a MethodGroupExpr until a matching method is
17864         found, so we don't want to bail out if the first method doesn't match.
17865         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17866         matches, report the 123.  Fixes #28070.
17867
17868 2002-07-24  Martin Baulig  <martin@gnome.org>
17869
17870         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17871         TypeManager.TypeToCoreType() to the top of the method so the
17872         following equality checks will work.  Fixes #28107.
17873
17874 2002-07-24  Martin Baulig  <martin@gnome.org>
17875
17876         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17877         operand is of type uint, and the other operand is of type sbyte,
17878         short or int, the operands are converted to type long." -
17879         Actually do what this comment already told us.  Fixes bug #28106,
17880         added test-150.cs.
17881
17882 2002-07-24  Martin Baulig  <martin@gnome.org>
17883
17884         * class.cs (MethodBase): New abstract class.  This is now a base
17885         class for Property, Indexer and Event to avoid some code duplication
17886         in their Define() and DefineMethods() methods.
17887         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17888         generic methods for Define() and DefineMethods().
17889         (FieldBase): Derive from MemberBase, not MemberCore.
17890         (Property): Derive from MemberBase, not MemberCore.
17891         (Property.DefineMethod): Moved all the code from this method to the
17892         new MethodBase.DefineAccessor(), just call it with appropriate
17893         argumetnts.
17894         (Property.Define): Call the new Property.DoDefine(), this does some
17895         sanity checks and we don't need to duplicate the code everywhere.
17896         (Event): Derive from MemberBase, not MemberCore.
17897         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17898         accessors, this will also make them work with interface events.
17899         (Indexer): Derive from MemberBase, not MemberCore.
17900         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17901         (Indexer.Define): Use the new MethodBase functions.
17902
17903         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17904         argument to the constructor.
17905         (Interface.FindMembers): Added support for interface events.
17906         (Interface.PopluateEvent): Implemented.
17907
17908         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17909
17910 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17911
17912         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17913         but this is required to check for a method name being the same as
17914         the containing class.  
17915
17916         Handle this now.
17917
17918 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17919
17920         * interface.cs: initialize variable.
17921
17922 2002-07-23  Martin Baulig  <martin@gnome.org>
17923
17924         Implemented the IndexerName attribute in interfaces.
17925
17926         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17927         name if this is an explicit interface implementation.
17928         (Indexer.InterfaceIndexerName): New public variable.  If we're
17929         implementing an interface indexer, this is the IndexerName in that
17930         interface.  Otherwise, it's the IndexerName.
17931         (Indexer.DefineMethod): If we're implementing interface indexer,
17932         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17933         and Pending.ImplementIndexer methods.
17934         (Indexer.Define): Also define the PropertyBuilder if we're
17935         implementing an interface indexer and this is neither an explicit
17936         interface implementation nor do the IndexerName match the one in
17937         the interface.
17938
17939         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17940         If a method is defined here, then we always need to create a proxy
17941         for it.  This is used when implementing interface indexers.
17942         (Pending.IsInterfaceIndexer): New public method.
17943         (Pending.ImplementIndexer): New public method.
17944         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17945         This is used when implementing interface indexers to define a proxy
17946         if necessary.
17947         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17948         define a proxy if necessary.
17949
17950         * interface.cs (Interface.IndexerName): New public variable.
17951         (Interface.PopulateIndexer): Set the IndexerName.
17952         (Interface.DefineIndexers): New private method.  Populate all the
17953         indexers and make sure their IndexerNames match.
17954
17955         * typemanager.cs (IndexerPropertyName): Added support for interface
17956         indexers.
17957
17958 2002-07-22  Martin Baulig  <martin@gnome.org>
17959
17960         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17961         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17962         ret if HasReturnLabel.
17963         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17964         variables.
17965
17966         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17967         and set the ec.LoopBeginTryCatchLevel.
17968         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17969         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17970         the current ec.TryCatchLevel, the branch goes out of an exception
17971         block.  In this case, we need to use Leave and not Br.
17972
17973 2002-07-22  Martin Baulig  <martin@gnome.org>
17974
17975         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17976         block unless the block does not always return or it is contained in
17977         another try { ... } catch { ... } block.  Fixes bug #26506.
17978         Added verify-1.cs to the test suite.
17979
17980 2002-07-22  Martin Baulig  <martin@gnome.org>
17981
17982         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17983         then we do not always return.  Fixes bug #24985.
17984
17985 2002-07-22  Martin Baulig  <martin@gnome.org>
17986
17987         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17988         lookup on a per-class level; ie. walk up the class hierarchy until we
17989         found at least one applicable method, then choose the best among them.
17990         Fixes bug #24463 and test-29.cs.
17991
17992 2002-07-22  Martin Baulig  <martin@gnome.org>
17993
17994         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17995         return types of the methods.  The return type is not part of the
17996         signature and we must not check it to make the `new' modifier work.
17997         Fixes bug #27999, also added test-147.cs.
17998         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17999
18000         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18001         on the method's return type.
18002
18003 2002-07-21  Martin Baulig  <martin@gnome.org>
18004
18005         * assign.cs: Make this work if the rightmost source is a constant and
18006         we need to do an implicit type conversion.  Also adding a few more tests
18007         to test-38.cs which should have caught this.
18008
18009         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18010         target in the makefile for this.  The makefile.gnu is primarily intended
18011         for end-users who don't want to debug the compiler.
18012
18013 2002-07-21  Martin Baulig  <martin@gnome.org>
18014
18015         * assign.cs: Improved the Assign class so it can now handle embedded
18016         assignments (X = Y = Z = something).  As a side-effect this'll now also
18017         consume less local variables.  test-38.cs now passes with MCS, added
18018         a few new test cases to that test.
18019
18020 2002-07-20  Martin Baulig  <martin@gnome.org>
18021
18022         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18023         instructions.  Fixes bug #27977, also added test-146.cs.
18024
18025 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18026
18027         * cs-tokenizer.cs: fixed getHex ().
18028
18029 2002-07-19  Martin Baulig  <martin@gnome.org>
18030
18031         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18032         not Type.GetType() to lookup the array type.  This is needed when
18033         we're constructing an array of a user-defined type.
18034         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18035         single-dimensional arrays, but also for single-dimensial arrays of
18036         type decimal.
18037
18038 2002-07-19  Martin Baulig  <martin@gnome.org>
18039
18040         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18041         this function is called, it's not allowed to share LocalBuilders
18042         among ILGenerators.
18043
18044 2002-07-19  Martin Baulig  <martin@gnome.org>
18045
18046         * expression.cs (Argument.Resolve): Report an error 118 when trying
18047         to pass a type as argument.
18048
18049 2002-07-18  Martin Baulig  <martin@gnome.org>
18050
18051         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18052         Conv_R_Un for the signed `long' type.
18053
18054 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18055
18056         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18057         `expr' for the temporary result, as that will fail if we do
18058         multiple resolves on the same expression.
18059
18060 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18061
18062         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18063         ec.TypeContainer for looking up aliases. 
18064
18065         * class.cs (TypeContainer): Remove LookupAlias from here.
18066
18067         * decl.cs (DeclSpace); Move here.
18068
18069 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18070
18071         * class.cs (FindMembers): Only call filter if the constructor
18072         bulider is not null.
18073
18074         Also handle delegates in `NestedTypes' now.  Now we will perform
18075         type lookups using the standard resolution process.  This also
18076         fixes a bug.
18077
18078         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18079         This uses Expressions (the limited kind that can be parsed by the
18080         tree) instead of strings.
18081
18082         * expression.cs (ComposedCast.ToString): Implement, used to flag
18083         errors since now we have to render expressions.
18084
18085         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18086         FormArrayType. 
18087
18088         * ecore.cs (SimpleName.ToString): ditto.
18089
18090         * cs-parser.jay: Instead of using strings to assemble types, use
18091         Expressions to assemble the type (using SimpleName, ComposedCast,
18092         MemberAccess).  This should fix the type lookups in declarations,
18093         because we were using a different code path for this.
18094
18095         * statement.cs (Block.Resolve): Continue processing statements
18096         even when there is an error.
18097
18098 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18099
18100         * class.cs (Event.Define): Also remove the `remove' method from
18101         the list of pending items.
18102
18103         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18104         generate more compact code. 
18105
18106 2002-07-17  Martin Baulig  <martin@gnome.org>
18107
18108         * const.cs (Const.LookupConstantValue): Add support for constant
18109         `unchecked' and `checked' expressions.
18110         Also adding test case test-140.cs for this.
18111
18112 2002-07-17  Martin Baulig  <martin@gnome.org>
18113
18114         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18115         check whether mi.ReturnType implements the IEnumerator interface; the
18116         `==' and the IsAssignableFrom() will fail in this situation.
18117
18118 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18119
18120         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18121         here too.
18122
18123 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18124
18125         * expression.cs: fixed bug #27811.
18126
18127 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18128
18129         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18130         Molaro: when we are a ref, the value already contains a pointer
18131         value, do not take the address of it.
18132
18133 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18134         * removed mb-parser.jay and mb-tokenizer.cs
18135
18136 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18137
18138         * expression.cs: check against the building corlib void type.
18139
18140 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18141
18142         * ecore.cs: fix for valuetype static readonly fields: when 
18143         initializing them, we need their address, not the address of a copy.
18144
18145 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18146
18147         * typemanager.cs: register also enum_type in corlib.
18148
18149 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18150
18151         * class.cs: allow calling this (but not base) initializers in structs.
18152
18153 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18154
18155         * ecore.cs: make sure we compare against the building base types
18156         in GetTypeSize ().
18157
18158 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18159
18160         * typemanager.cs: fix TypeToCoreType() to handle void and object
18161         (corlib gets no more typerefs after this change).
18162
18163 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18164
18165         * expression.cs (ArrayCreation.EmitArrayArguments): use
18166         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18167
18168         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18169         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18170         array indexes, the runtime actually forbids them.
18171
18172         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18173         for array arguments here.
18174
18175         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18176         instead of the default for ValueTypes.
18177
18178         (New.DoEmit): Use IsValueType instead of
18179         IsSubclassOf (value_type)
18180         (New.DoResolve): ditto.
18181         (Invocation.EmitCall): ditto.
18182
18183         * assign.cs (Assign): ditto.
18184
18185         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18186         Statements *are* currently doing part of their resolution during
18187         Emit.  
18188
18189         Expressions do always resolve during resolve, but statements are
18190         only required to propagate resolution to their children.
18191
18192 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18193
18194         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18195
18196         (LoadAssembly): Do not add the dll if it is already specified
18197
18198         (MainDriver): Add the System directory to the link path at the end,
18199         after all the other -L arguments. 
18200
18201         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18202         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18203         ldelem.u1) and using the opposite for sbytes.
18204
18205         This fixes Digger, and we can finally run it.
18206
18207         * driver.cs (UnixParseOption): Move the option parsing here.  
18208         (CSCParseOption): Implement CSC-like parsing of options.
18209
18210         We now support both modes of operation, the old Unix way, and the
18211         new CSC-like way.  This should help those who wanted to make cross
18212         platform makefiles.
18213
18214         The only thing broken is that /r:, /reference: and /lib: are not
18215         implemented, because I want to make those have the same semantics
18216         as the CSC compiler has, and kill once and for all the confussion
18217         around this.   Will be doing this tomorrow.
18218
18219         * statement.cs (Unsafe.Resolve): The state is checked during
18220         resolve, not emit, so we have to set the flags for IsUnsfe here.
18221
18222 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18223
18224         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18225         not catch the Error_ObjectRefRequired in SimpleName (as it is
18226         possible to have a class/instance variable name that later gets
18227         deambiguated), we have to check this here.      
18228
18229 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18230
18231         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18232         make static and put into Expression.
18233
18234         (Event.Define): Register the private field of the event with the 
18235         TypeManager so that GetFieldFromEvent can get at it.
18236
18237         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18238         keep track of the private field associated with an event which
18239         has no accessors.
18240
18241         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18242         private field.
18243
18244         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18245
18246 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18247
18248         * expression.cs (Binary.EmitBranchable): this routine emits the
18249         Binary expression in a branchable context.  This basically means:
18250         we need to branch somewhere, not just get the value on the stack.
18251
18252         This works together with Statement.EmitBoolExpression.
18253
18254         * statement.cs (Statement.EmitBoolExpression): Use
18255         EmitBranchable. 
18256
18257 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18258
18259         * statement.cs (For): Reduce the number of jumps in loops.
18260
18261         (For): Implement loop inversion for the For statement.
18262
18263         (Break): We can be breaking out of a Try/Catch controlled section
18264         (foreach might have an implicit try/catch clause), so we need to
18265         use Leave instead of Br.
18266
18267         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18268         now).  If the instace expression supports IMemoryLocation, we use
18269         the AddressOf method from the IMemoryLocation to extract the
18270         address instead of emitting the instance.
18271
18272         This showed up with `This', as we were emitting the instance
18273         always (Emit) instead of the Address of This.  Particularly
18274         interesting when This is a value type, as we dont want the Emit
18275         effect (which was to load the object).
18276
18277 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18278
18279         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18280
18281         * statement.cs (Checked): Set the CheckedState during the resolve
18282         process too, as the ConvCast operations track the checked state on
18283         the resolve process, and not emit.
18284
18285         * cs-parser.jay (namespace_member_declaration): Flag that we have
18286         found a declaration when we do.  This is used to flag error 1529
18287
18288         * driver.cs: Report ok when we display the help only.
18289
18290 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18291
18292         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18293
18294 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18295
18296         * cs-tokenizer.cs (define): We also have to track locally the
18297         defines.  AllDefines is just used for the Conditional Attribute,
18298         but we also need the local defines for the current source code. 
18299
18300 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18301
18302         * statement.cs (While, For, Do): These loops can exit through a
18303         Break statement, use this information to tell whether the
18304         statement is the last piece of code.
18305
18306         (Break): Flag that we break.
18307
18308         * codegen.cs (EmitContexts): New `Breaks' state variable.
18309
18310 2002-07-03  Martin Baulig  <martin@gnome.org>
18311
18312         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18313         modifiers in method declarations in structs.  Otherwise, you won't
18314         be able to override things like Object.Equals().
18315
18316 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18317
18318         * class.cs (Method, Property, Indexer): Do not allow the public
18319         modifier to be used in explicit interface implementations.
18320
18321         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18322         override modifiers in method declarations in structs
18323
18324 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18325
18326         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18327         integer or real overflow, report an error
18328
18329 2002-07-02  Martin Baulig  <martin@gnome.org>
18330
18331         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18332         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18333         to tell the runtime about our newly created System.Object and
18334         System.ValueType types.
18335
18336 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18337
18338         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18339         struct instead of Ldarg/Starg.
18340
18341 2002-07-02  Martin Baulig  <martin@gnome.org>
18342
18343         * expression.cs (Indirection.Indirection): Call
18344         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18345
18346 2002-07-02  Martin Baulig  <martin@gnome.org>
18347
18348         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18349         ValueType, call TypeManager.TypeToCoreType() on it.
18350         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18351         the OpCodes.Newarr argument.
18352
18353 2002-07-02  Martin Baulig  <martin@gnome.org>
18354
18355         * expression.cs (Invocation.EmitCall): When compiling corlib,
18356         replace all calls to the system's System.Array type to calls to
18357         the newly created one.
18358
18359         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18360         System.Array methods.
18361         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18362         from the system's System.Array type which must be replaced.
18363
18364 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18365
18366         * typemanager.cs: load unverifiable_code_ctor so we can build
18367         corlib using the correct type. Avoid using GetTypeCode() with
18368         TypeBuilders.
18369         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18370         TypeManager.object_type to allow building corlib.
18371
18372 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18373
18374         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18375
18376 2002-07-01  Martin Baulig  <martin@gnome.org>
18377
18378         * class.cs: Make the last change actually work, we need to check
18379         whether `ifaces != null' to avoid a crash.
18380
18381 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18382
18383         * class.cs: when we build structs without fields that implement
18384         interfaces, we need to add the interfaces separately, since there is
18385         no API to both set the size and add the interfaces at type creation
18386         time.
18387
18388 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18389
18390         * expression.cs: the dimension arguments to the array constructors
18391         need to be converted if they are a long.
18392
18393 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18394
18395         * class.cs: don't emit ldarg.0 if there is no parent constructor
18396         (fixes showstopper for corlib).
18397
18398 2002-06-29  Martin Baulig  <martin@gnome.org>
18399
18400         MCS now compiles corlib on GNU/Linux :-)
18401
18402         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18403         ie. check for MethodImplOptions.InternalCall.
18404
18405         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18406         and TypeManager.attribute_type are null, so we must explicitly check
18407         whether parent is not null to find out whether it's an attribute type.
18408         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18409         and SetBuilder, not only if the property is neither abstract nor external.
18410         This is necessary to set the MethodImplOptions on the accessor methods.
18411         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18412         SetBuilder, see Property.Emit().
18413
18414         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18415         populate "System.Object", "System.ValueType" and "System.Attribute" since
18416         they've already been populated from BootCorlib_PopulateCoreTypes().
18417
18418 2002-06-29  Martin Baulig  <martin@gnome.org>
18419
18420         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18421         is the NullLiteral, we also need to make sure that target_type is not
18422         an enum type.   
18423
18424 2002-06-29  Martin Baulig  <martin@gnome.org>
18425
18426         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18427         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18428         before calling BootstrapCorlib_ResolveDelegate ().
18429
18430 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18431
18432         * statement.cs: fixed build-breaker. All tests passed ok.
18433
18434 2002-06-27  Martin Baulig  <martin@gnome.org>
18435
18436         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18437         for System.Decimal when compiling corlib.
18438
18439 2002-06-27  Martin Baulig  <martin@gnome.org>
18440
18441         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18442         switch blocks which contain nothing but a default clause.
18443
18444 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18445
18446        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18447
18448 2002-06-27  Martin Baulig  <martin@gnome.org>
18449
18450         * ecore.cs (PropertyExpr.PropertyExpr): Call
18451         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18452
18453         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18454         is already a TypeBuilder.
18455
18456 2002-06-27  Martin Baulig  <martin@gnome.org>
18457
18458         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18459         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18460         the "from an array-type to System.Array" case.  This makes it work
18461         when compiling corlib.
18462
18463 2002-06-27  Martin Baulig  <martin@gnome.org>
18464
18465         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18466         non-static PropertyExpr, set its InstanceExpression.  This makes
18467         the `ICollection.Count' property work in System/Array.cs.
18468
18469 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18470
18471         * driver.cs: Made error handling more consistent.  Errors now
18472         tracked by Report class, so many methods which used to return int
18473         now return void.  Main() now prints success/failure and 
18474         errors/warnings message.
18475
18476         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18477         the magic number return values (123 and 124).  Now, if the
18478         expected error occurs, the compiler exits with success (exit value
18479         0).  If the compilation completes without seeing that particular
18480         error, the compiler exits with failure (exit value 1).  The
18481         makefile in mcs/errors has been changed to handle the new behaviour.
18482
18483         * report.cs: Made 'expected error' number a property and renamed
18484         it from 'Probe' to 'ExpectedError'.
18485
18486         * genericparser.cs: Removed error handling support, since it is
18487         now all done by Report class.
18488
18489         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18490         class, so parse() no longer returns an int.
18491
18492         * namespace.cs: Use Report.Error instead of GenericParser.error
18493
18494 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18495
18496         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18497         TypeContainer.AddOperator): At the front of the list put the
18498         explicit implementations, so they get resolved/defined first. 
18499
18500 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18501
18502         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18503         interface type is implemented by this TypeContainer.  Used during
18504         explicit interface implementation.
18505
18506         (Property.Define, Indexer.Define, Method.Define): Validate that
18507         the given interface in the explicit implementation is one of the
18508         base classes for the containing type.
18509
18510         Also if we are explicitly implementing an interface, but there is
18511         no match in the pending implementation table, report an error.
18512
18513         (Property.Define): Only define the property if we are
18514         not explicitly implementing a property from an interface.  Use the
18515         correct name also for those properties (the same CSC uses,
18516         although that is really not needed).
18517
18518         (Property.Emit): Do not emit attributes for explicitly implemented
18519         properties, as there is no TypeBuilder.
18520
18521         (Indexer.Emit): ditto.
18522
18523         Hiding then means that we do not really *implement* a pending
18524         implementation, which makes code fail.
18525
18526 2002-06-22  Martin Baulig  <martin@gnome.org>
18527
18528         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18529         the return value of Object.GetType().  [FIXME: we need to do this whenever
18530         we get a type back from the reflection library].
18531
18532 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18533
18534         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18535
18536 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18537
18538         * attribute.cs: Return null if we can not look up the type.
18539
18540         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18541         the interface types found.
18542
18543         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18544         interface types found.
18545
18546         * typemanager.cs (GetInterfaces): Make this routine returns alll
18547         the interfaces and work around the lame differences between
18548         System.Type and System.Reflection.Emit.TypeBuilder in the results
18549         result for GetInterfaces.
18550
18551         (ExpandInterfaces): Given an array of interface types, expand and
18552         eliminate repeated ocurrences of an interface.  This expands in
18553         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18554         be IA, IB, IC.
18555
18556 2002-06-21  Martin Baulig  <martin@gnome.org>
18557
18558         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18559         on System.Enum.
18560
18561 2002-06-21  Martin Baulig  <martin@gnome.org>
18562
18563         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18564         and called with one of the core types, return the corresponding typebuilder for
18565         that type.
18566
18567         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18568         element type.
18569
18570 2002-06-21  Martin Baulig  <martin@gnome.org>
18571
18572         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18573         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18574         (Expression.ConvertReferenceExplicit): Likewise.
18575
18576         * expression.cs (ElementAccess.DoResolve): Likewise.
18577         (ElementAccess.DoResolveLValue): Likewise.
18578
18579 2002-06-10  Martin Baulig  <martin@gnome.org>
18580
18581         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18582         add the "value" parameter to the parameter list.
18583
18584         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18585         to our caller.
18586
18587 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18588
18589         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18590         the argument to an int, uint, long or ulong, per the spec.  Also
18591         catch negative constants in array creation.
18592
18593 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18594
18595         * class.cs: do not allow the same interface to appear twice in
18596         the definition list.
18597
18598 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18599
18600         * ecore.cs: don't use ldlen with System.Array.
18601
18602 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18603
18604         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18605
18606 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18607
18608         * modifiers.cs: produce correct field attributes for protected
18609         internal. Easy fix so miguel can work on ther harder stuff:-)
18610
18611 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18612
18613         * pending.cs: New file.  Move the code from class.cs here.
18614         Support clearning the pending flag for all methods (when not doing
18615         explicit interface implementation).
18616
18617 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18618
18619         * rootcontext.cs: added a couple more types needed to bootstrap.
18620
18621 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18622
18623         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18624         constructor in the type, instead of any constructor in the type
18625         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18626         a bug in the Mono runtime when applying the params attribute). 
18627
18628 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18629         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18630
18631 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18632
18633         * expression.cs (Unary.ResolveOperator): Use TypeManager
18634         to resolve the type.
18635
18636 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18637
18638         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18639         attached.
18640
18641         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18642         with each member too.
18643
18644         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18645         field builders too - this takes care of the enum member case.
18646
18647 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18648
18649         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18650         address-of operator on both value types and pointers.
18651
18652 2002-06-10  Martin Baulig  <martin@gnome.org>
18653
18654         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18655         PropertyBuilder to the `property_builders' list.
18656
18657         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18658         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18659         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18660         find any indexers which are inherited from an interface.
18661
18662 2002-06-09  Martin Baulig  <martin@gnome.org>
18663
18664         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18665         the same type as the constant if necessary.  There's also a test-130.cs
18666         for this.
18667
18668         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18669
18670         * typemanager.cs (TypeManager.ChangeType): Previously known as
18671         Enum.ChangeEnumType().
18672
18673 2002-06-09  Martin Baulig  <martin@gnome.org>
18674
18675         * expression.cs (Cast.TryReduce): Added support for consts.
18676
18677 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18678
18679         * class.cs (Accessor): Hold attributes information so we can pass
18680         it along.
18681
18682         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18683         Modify to pass in attributes attached to the methods.
18684
18685         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18686
18687         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18688         to handle the Accessor kind :-)
18689
18690         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18691
18692 2002-06-08  Martin Baulig  <martin@gnome.org>
18693
18694         * expression.cs (Unary.TryReduceNegative): Added support for
18695         ULongConstants.
18696
18697 2002-06-08  Martin Baulig  <martin@gnome.org>
18698
18699         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18700         name can't be found in the `defined_names' - the caller will do a
18701         MemberLookup in this case and thus find methods in System.Enum
18702         such as Enum.IsDefined().
18703
18704 2002-06-08  Martin Baulig  <martin@gnome.org>
18705
18706         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18707         Convert.ChangeType() which works with TypeBuilder created types.
18708         (Enum.LookupEnumValue, Enum.Define): Use it here.
18709
18710         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18711         `TypeBuilder.BaseType != null' check.
18712         (TypeContainer.FindMembers): Only lookup parent members if we
18713         actually have a parent.
18714         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18715         (ConstructorInitializer.Resolve): Likewise.
18716
18717         * interface.cs (Interface.FindMembers): Added
18718         `TypeBuilder.BaseType != null' check.
18719
18720         * rootcontext.cs (RootContext.ResolveCore): Added
18721         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18722         classes_second_stage.
18723
18724         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18725         debug_type and trace_type when compiling with --nostdlib.       
18726
18727 2002-06-07  Martin Baulig  <martin@gnome.org>
18728
18729         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18730         (AddField): Set it to true when adding a non-static field.
18731         (DefineType): Use `have_nonstatic_fields' to find out whether we
18732         have non-static fields, not `Fields != null'.
18733
18734 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18735
18736         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18737         dereferencing a null on the static-field code path)
18738
18739 2002-05-30  Martin Baulig  <martin@gnome.org>
18740
18741         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18742         to take command line arguments.  Use reflection to call the new
18743         custom `Initialize' function on the symbol writer and pass it the
18744         command line arguments.
18745
18746         * driver.cs (--debug-args): New command line argument to pass command
18747         line arguments to the symbol writer.
18748
18749 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18750
18751         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18752         the target type for indexers and properties.  Thanks to Joe for
18753         catching this.
18754
18755 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18756
18757         * typemanager.cs (MethodFlags): returns the method flags
18758         (Obsolete/ShouldIgnore) that control warning emission and whether
18759         the invocation should be made, or ignored. 
18760
18761         * expression.cs (Invocation.Emit): Remove previous hack, we should
18762         not do this on matching a base type, we should do this based on an attribute
18763
18764         Only emit calls to System.Diagnostics.Debug and
18765         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18766         on the command line.
18767
18768         * rootcontext.cs: Global settings for tracing and debugging.
18769
18770         * cs-tokenizer.cs (define): New utility function to track
18771         defines.   Set the global settings for TRACE and DEBUG if found.
18772
18773 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18774
18775         * interface.cs (Populate*): Pass in the TypeContainer as well as
18776         the DeclSpace as parameters so that we can create EmitContexts and
18777         then use that to apply attributes etc.
18778
18779         (PopulateMethod, PopulateEvent, PopulateProperty)
18780         (PopulateIndexer): Apply attributes everywhere.
18781
18782         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18783         etc.
18784
18785         (ApplyAttributes): Update accordingly.
18786
18787         We now apply interface attributes for all members too.
18788
18789 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18790
18791         * class.cs (Indexer.Define); Correctly check if we are explicit
18792         implementation (instead of checking the Name for a ".", we
18793         directly look up if the InterfaceType was specified).
18794
18795         Delay the creation of the PropertyBuilder.
18796
18797         Only create the PropertyBuilder if we are not an explicit
18798         interface implementation.   This means that explicit interface
18799         implementation members do not participate in regular function
18800         lookups, and hence fixes another major ambiguity problem in
18801         overload resolution (that was the visible effect).
18802
18803         (DefineMethod): Return whether we are doing an interface
18804         implementation. 
18805
18806         * typemanager.cs: Temporary hack until we get attributes in
18807         interfaces (Ravi is working on that) and we get IndexerName
18808         support in interfaces.
18809
18810         * interface.cs: Register the indexers as properties.
18811
18812         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18813         warning, I have verified that this is a bug in the .NET runtime
18814         (JavaScript suffers of the same problem).
18815
18816         * typemanager.cs (MemberLookup): When looking up members for
18817         interfaces, the parent of an interface is the implicit
18818         System.Object (so we succeed in searches of Object methods in an
18819         interface method invocation.  Example:  IEnumerable x;  x.ToString
18820         ()) 
18821
18822 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18823
18824         * class.cs (Event): Events should also register if they do
18825         implement the methods that an interface requires.
18826
18827         * typemanager.cs (MemberLookup); use the new GetInterfaces
18828         method. 
18829
18830         (GetInterfaces): The code used to lookup interfaces for a type is
18831         used in more than one place, factor it here. 
18832
18833         * driver.cs: Track the errors at the bottom of the file, we kept
18834         on going.
18835
18836         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18837         instance if the method we are calling is static!
18838
18839 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18840
18841         * attribute.cs (ApplyAttributes): Make this function filter out
18842         the IndexerName attribute (as that attribute in reality is never
18843         applied) and return the string constant for the IndexerName
18844         attribute. 
18845
18846         * class.cs (TypeContainer.Emit): Validate that all the indexers
18847         have the same IndexerName attribute, and if so, set the
18848         DefaultName attribute on the class. 
18849
18850         * typemanager.cs: The return value might contain other stuff (not
18851         only methods).  For instance, consider a method with an "Item"
18852         property and an Item method.
18853
18854         * class.cs: If there is a problem with the parameter types,
18855         return. 
18856
18857 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18858
18859         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18860         looks at user defined conversion after making a call to 
18861         StandardConversionExists - we need this for overload resolution.
18862
18863         * expression.cs : Update accordingly the various method calls.
18864
18865         This fixes 2 bugs filed against implicit user defined conversions 
18866
18867 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18868
18869         * statement.cs: Track the result of the assignment.
18870
18871 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18872
18873         * expression.cs (MemberAccess): Improved error reporting for
18874         inaccessible members.
18875
18876 2002-05-22  Martin Baulig  <martin@gnome.org>
18877
18878         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18879         itself with debugging support.
18880
18881 2002-05-22  Martin Baulig  <martin@gnome.org>
18882
18883         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18884         Removed, this isn't needed anymore.
18885
18886 2002-05-20  Martin Baulig  <martin@gnome.org>
18887
18888         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18889         be underlying type for an enum.
18890
18891 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18892
18893         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18894         that splits out the loading of just the core types.
18895
18896         * rootcontext.cs (ResolveCore): Split the struct resolution in
18897         two, so we can load the enumeration underlying types before any
18898         enums are used.
18899
18900         * expression.cs (Is): Bandaid until we fix properly Switch (see
18901         bug #24985 for details).
18902
18903         * typemanager.cs (ImplementsInterface): The hashtable will contain
18904         a null if there are no interfaces implemented.
18905
18906 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * cs-parser.jay (indexer_declarator): It is fine to have array
18909         parameters
18910
18911 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18912
18913         * typemanager.cs: (RegisterBuilder): New function used to register
18914         TypeBuilders that implement interfaces.  Since
18915         TypeBuilder.GetInterfaces (as usual) does not work with lame
18916         Reflection.Emit. 
18917         (AddUserType): register interfaces.
18918
18919         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18920         dealing with TypeBuilder.  Also, arrays are showing up as
18921         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18922         methods can not be invoked on them!
18923
18924         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18925         (ImplicitReferenceConversionExists): Split out from
18926         StandardConversionExists. 
18927
18928         * expression.cs (As): We were only implementing one of the three
18929         cases for the as operator.  We now implement them all.
18930         (Is): Implement the various other cases for Is as well.
18931
18932         * typemanager.cs (CACHE): New define used to control if we want or
18933         not the FindMembers cache.  Seems to have a negative impact on
18934         performance currently
18935
18936         (MemberLookup): Nested types have full acess to
18937         enclosing type members
18938
18939         Remove code that coped with instance/static returns for events, we
18940         now catch this in RealFindMembers.
18941
18942         (RealFindMembers): only perform static lookup if the instance
18943         lookup did not return a type or an event.  
18944
18945 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18946
18947         * assign.cs (CompoundAssign): We pass more semantic information
18948         now to Compound Assignments than we did before: now we have all
18949         the information at hand, and now we resolve the target *before* we
18950         do the expression expansion, which allows the "CacheValue" method
18951         to have the effect we intended (before, a [x] += 1 would generate
18952         two differen ArrayAccess expressions from the ElementAccess,
18953         during the resolution process).
18954
18955         (CompoundAssign.DoResolve): Resolve target and original_source here.
18956
18957 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18958
18959         * expression.cs (ArrayAccess): dropped debugging information. 
18960
18961         * typemanager.cs: Small bug fix: I was always returning i_members,
18962         instead of one of i_members or s_members (depending on which had
18963         the content).
18964
18965         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18966         method is invoked before any code generation takes place, and it
18967         is a mechanism to inform that the expression will be invoked more
18968         than once, and that the method should use temporary values to
18969         avoid having side effects
18970
18971         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18972
18973         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18974         implementation.
18975
18976         * expression.cs (Indirection, ArrayAccess): Add support for
18977         CacheTemporaries in these two bad boys. 
18978
18979         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18980         ldobj or ldind_ref.  
18981         (StoreFromPtr): Handle stobj as well.
18982
18983         * expression.cs (UnaryMutator): Share more code.
18984
18985         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18986         down: I was not tracking the Filter function as well, which
18987         was affecting the results of the cache.
18988
18989 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18990
18991         * attribute.cs: Remove the hack to handle the CharSet property on
18992         StructLayouts. 
18993
18994 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18995
18996         * attribute.cs (DoResolve): More uglyness, we now only try to
18997         resolve the attribute partially, to extract the CharSet
18998         information (only if we are a StructLayout attribute).  Otherwise 
18999
19000         (GetExtraTypeInfo): Add some code to conditionally kill in the
19001         future this.   I am more and more convinced that the .NET
19002         framework has special code to handle the attribute setting on
19003         certain elements.
19004
19005         * expression.cs (IsParamsMethodApplicable): Revert my previous
19006         foreach change here, it was wrong.
19007
19008 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19009
19010         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19011         (pp_expr): do not abort on unknown input, just return.
19012         (eval): abort if there are pending chars.
19013
19014         * attribute.cs (Attribute.Resolve): Positional parameters are
19015         optional.  Deal with that case.
19016
19017         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19018         the Ansi/Unicode/Auto information for the type.
19019
19020         (TypeContainer.DefineType): instantiate the EmitContext here, as
19021         we will be using it during the type definition (to resolve
19022         attributes) and during the emit phase.
19023
19024         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19025         to pull type information out of the attributes
19026
19027         (Attribute.Resolve): track the constructor builder, and allow for
19028         multiple invocations (structs and classes will use this).
19029
19030         * ecore.cs (MemberLookupFinal): new version with all the
19031         parameters customizable.
19032
19033         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19034         constructors.  Return if the result value is null (as the error
19035         would have been flagged already by MemberLookupFinal)
19036
19037         Do not allow instances of abstract classes or interfaces to be
19038         created.
19039
19040         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19041         We have to compare the assembly property here when dealing with
19042         FamANDAssem and Assembly access modifiers, because we might be
19043         creating an assembly from *modules* (that means that we are not
19044         getting TypeBuilders for types defined in other modules that are
19045         part of this assembly).
19046
19047         (Method.Emit): If the method is marked abstract and has a body,
19048         emit an error. 
19049
19050         (TypeContainer.DefineMembers): If both the defined member and the
19051         parent name match are methods, then do not emit any warnings: let
19052         the Method.Define routine take care of flagging warnings.  But if
19053         there is a mismatch (method overrides something else, or method is
19054         overriwritten by something, then emit warning).
19055
19056         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19057         set to null, this means `do not check for the return type on the
19058         signature'. 
19059
19060         (Method.Define): set the return type for the method signature to
19061         null, so that we get methods with the same name and parameters and
19062         different return types.  This is used to flag warning 114 (you are
19063         hiding a method, and you probably want to use the new/override
19064         keywords instead).
19065
19066         * typemanager.cs (MemberLookup): Implemented proper access
19067         control, closing a long standing set of bug reports.  The problem
19068         was that the Framework only has two bits: Public and NonPublic,
19069         and NonPublic includes private and protected methods, but we need
19070         to enforce the FamANDAssem, FamOrAssem and Family. 
19071
19072 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19073
19074         * statement.cs (GotoCase): Return true: Ammounts to giving up
19075         knowledge on whether we return or not, and letting the other case
19076         be responsible for it.
19077
19078 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * driver.cs: Do not load directories for each file processed, only
19081         do it if there is a pattern.
19082
19083         * ecore.cs: Report readonly assigns here as well, as we might have
19084         been resolved only by MemberAccess.
19085
19086         (SimpleName.SimpleNameResolve): Also be useful for LValue
19087         resolution.   We need this to propagate assign to local readonly variables
19088
19089         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19090         do not want to reuse potential criteria memory.
19091
19092         * class.cs (MyEventBuilder): Set reflected_type;
19093
19094         * ecore.cs (Constantify): Added support for constifying bools.
19095
19096         (RootContext.LookupType): Added a cache for values looked up in
19097         the declaration space.
19098
19099         * typemanager.cs (FindMembers): Now is a front-end to
19100         RealFindMembers, and provides a two-level hashtable-based cache to
19101         the request.  
19102
19103         15% performance improvement: from 22.5 to 19.2 seconds.
19104
19105         * expression.cs (IsParamsMethodApplicable): use foreach.
19106         (Invocation.DoResolve): ditto.
19107         (New.DoResolve): ditto.
19108         (ArrayCreation.DoResolve): ditto.
19109
19110         * ecore.cs (FindMostEncompassingType): use foreach.
19111
19112         * delegate.cs (NewDelegate.DoResolve): Use foreach
19113
19114         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19115         (RemoveMethods): use foreach.
19116
19117         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19118         nested foreach statements instead of for, and also break out of
19119         the inner loop once a match is found.
19120
19121         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19122
19123 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19124
19125         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19126         we actually unwrap the expression to allow for extra information
19127         to be extracted. 
19128
19129         * expression.cs: Use Shr_Un on unsigned operations. 
19130
19131 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19132
19133         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19134         applicable operators was not being considered correctly. This closes
19135         the bug Miguel reported.
19136
19137 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19138
19139         * attribute.cs: check that the type derives from System.Attribute
19140         and report the correct error in that case (moved the duplicate code to
19141         its own method, too).
19142
19143 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19144
19145         * attribute.cs: lookup attribute type name as the spec says: first the
19146         bare attribute name and then name + "Attribute" (nant compiles with
19147         mcs after this fix).
19148
19149 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19150
19151         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19152         Because of the way we parse things, we should try to see if a
19153         UIntConstant can fit in an integer.
19154
19155 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19156
19157         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19158         when we are in an explicit context.
19159
19160         (ConvertReferenceExplicit): When converting from Iface type S to Class
19161         T make sure the rules are implemented as an OR.
19162
19163         * parameter.cs (ParameterType): Make it a property for now although the
19164         purpose really isn't anything immediate.
19165
19166         * expression.cs (Is*Applicable): Do better checking on the parameter type
19167         of a ref/out parameter. The ones from the system assemblies are already 
19168         marked with the correct type so we don't need to do any correction.
19169
19170         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19171         the object type is standard too so include that.
19172
19173 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19174
19175         * ecore.cs (StandardConversionExists): Augment with missing code:
19176         deal with IntConstant, LongConstants and Enumerations.
19177
19178         * assign.cs: Report the error, instead of failing silently
19179
19180         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19181         typecontainer that they are declared, because the
19182         typecontainer/namespace will have the list of using clauses that
19183         need to be applied.
19184
19185         Assembly Attributes were escaping the normal registration
19186         mechanism. 
19187
19188         (EmitCode): Apply attributes within an EmitContext that represents
19189         the container they were declared on.
19190
19191         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19192
19193 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19194
19195         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19196         Revamp completely - make much cleaner as we now operate only
19197         on a set of Types.
19198
19199         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19200         to implement the logic detailed in the spec more correctly.
19201
19202         (UserDefinedConversion): Update accordingly.
19203
19204 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19205
19206         * statement.cs: Return flow analysis information up.
19207
19208         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19209         and the default.
19210
19211         (token): Do not consume an extra character before calling
19212         decimal_digits.
19213
19214 2002-05-06  Piers Haken <piersh@friskit.com>
19215
19216         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19217
19218 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19221         EmitContext during the instance constructor initializer
19222         resolution, to stop access to instance variables.
19223
19224         This is mandated by the spec, last paragraph of the `constructor
19225         initializers' section. 
19226
19227 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19228
19229         * cs-parser.jay, class.cs (Accessor): new class used to represent
19230         an accessor (get or set).  In the past we used `null' to represent
19231         a missing accessor.  But this is ambiguous because there was no
19232         way to tell in abstract indexers/properties if one of them was
19233         specified.
19234
19235         Now there is a way of addressing that.
19236
19237         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19238         instead of FindMembers.
19239
19240         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19241         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19242
19243         * attribute.cs: Treat indexers and properties as the same in terms
19244         of applying attributes
19245
19246         * ecore.cs (FindMostEncompassedType): Use statically initialized
19247         EmptyExpressions()s like we do elsewhere to avoid creating useless
19248         objects (and we take this out of the tight loop).
19249
19250         (GetConversionOperators): Move the code to extract the actual
19251         operators to a separate routine to clean things up.
19252
19253 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19254
19255         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19256         events are always registered FieldBuilders.
19257
19258         * class.cs (FieldBase): New class shared by Fields 
19259
19260         * delegate.cs: If we are a toplevel delegate, use our full name.
19261         If we are a nested delegate, then only use our tail name.
19262
19263 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19264
19265         * expression.cs (IsApplicable): Ensure that we add the "&" to
19266         ref/out types before comparing it with the type of the argument.
19267
19268         (IsParamsMethodApplicable): Ditto.
19269
19270         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19271         silly me ;-)
19272
19273         * delegate.cs : Handle the case when we have more than one applicable
19274         method. Flag an error only when we finish checking all.
19275
19276 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19277
19278         * expression.cs: Add support for boolean static initializers.
19279
19280 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19281
19282         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19283
19284         * parameter.cs (ComputeParameterTypes,
19285         ComputeAndDefineParameterTypes): Better error handling: now we
19286         clear the `types' cache if we fail during any of the type lookups.
19287         We also return the status code correctly to our caller
19288
19289         * delegate.cs: If we fail to define a delegate, abort the extra
19290         steps. 
19291
19292         * expression.cs (Binary.ResolveOperator): for
19293         operator==(object,object) and operator !=(object, object) we also
19294         have to verify that there is an implicit conversion from one to
19295         the other.
19296
19297         (ArrayAccess.DoResolve): Array Access can operate on
19298         non-variables. 
19299
19300 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19301
19302         * assign.cs (CompoundAssign): A new class used as a "flag" that
19303         the assignment actually is happening as part of a compound
19304         assignment operator.
19305
19306         During compound assignment, a few new rules exist to enable things
19307         like:
19308
19309         byte b |= 1 + 2
19310
19311         From the spec:
19312
19313         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19314         to the type of x) if y is implicitly convertible to the type of x,
19315         and the operator is a builtin operator and the return type of the
19316         operator is explicitly convertible to the type of x. 
19317
19318         * rootcontext.cs: Reset warning level to 2.  4 catches various
19319         "interesting" features in mcs, we must clean this up at some
19320         point, but currently am trying to kill other bugs ;-)
19321
19322         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19323         in container classes as well.  
19324
19325         * expression.cs (Binary.ResolveOperator): Handle string case
19326         before anything else (as operator overloading does emit an error
19327         before doing anything else).
19328
19329         This code could go away when we move to a table driven model, but
19330         i could not come up with a good plan last night.
19331
19332 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19333
19334         * typemanager.cs (CSharpName): reimplementation using regex.
19335         * class.cs: added null check for fields in Emit
19336         * rootcontext.cs: set warninglevel to 4
19337
19338 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19339
19340         * typemanager.cs (CSharpName): reimplemented with Lupus
19341         suggestion.
19342
19343 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19344
19345         * statement.cs (If): correclty implement Resolve, because we were
19346         not catching sem errors in there.  The same process is needed
19347         everywhere else. 
19348         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19349
19350
19351         (Statement.Warning_DeadCodeFound): Factorize code.
19352         (While): Report dead code here too.
19353
19354         (Statement): Added Resolve virtual method to allow
19355         for resolution split from the emit code.
19356
19357 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19358
19359         * statement.cs (EmitBoolExpression): No longer try to resolve the
19360         expression here.    
19361         (MakeBoolean): New utility function that resolve, implicitly
19362         converts to boolean and tags the expression. 
19363
19364
19365         (If, Do): Implement dead code elimination.
19366         (While): Implement loop inversion
19367
19368         (Do, While, For, If): Resolve the expression prior to calling our
19369         code generation.
19370
19371 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19372
19373         * class.cs:
19374           - added method Report28 (warning: program has more than one entry point)
19375           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19376           - modified method Method.Define, the part at the end of the method
19377
19378         * rootcontext.cs: added static public Location EntryPointLocation;
19379           
19380         * ../errors/cs0028.cs : Add test case for the above warning.              
19381
19382         * typemanager.cs:
19383           - modified method CSharpName to allow arrays of primitive type to
19384             be printed nicely (e.g. instead of System.Int32[][] it now prints
19385             int[][])
19386           - added method CSharpSignature: returns the signature of a method
19387             in string format to be used in reporting errors, warnings, etc.
19388
19389         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19390         with String.Empty.
19391
19392 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19393
19394         * delegate.cs (Define): Fix extremely silly bug where I was
19395         setting the type of the 'object' parameter of the BeginInvoke
19396         method to System.IAsyncResult instead of System.Object ;-)
19397
19398 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19401         here. 
19402
19403         (Constructor.Emit): return if we fail to initialize the
19404         constructor.  Another door closed!  
19405
19406         * expression.cs (New.DoResolve): Improve error message (from -6 to
19407         1501).  Use DeclaredOnly lookup to find the exact constructor.
19408
19409         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19410         loop.  This is useful.
19411
19412         * cs-parser.jay: Adjust the default parameters so that destructors
19413         have the proper signature.
19414
19415 2002-04-26  Martin Baulig  <martin@gnome.org>
19416
19417         * driver.cs (LoadAssembly): If `assembly' contains any characters
19418         which are only valid in path names and not in assembly names
19419         (currently slash, backslash and point), use Assembly.LoadFrom ()
19420         instead of Assembly.Load () on the `assembly' (before iteration
19421         over the link_paths).
19422
19423 2002-04-26  Martin Baulig  <martin@gnome.org>
19424
19425         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19426
19427 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19428
19429         * class.cs (Property): use the new typemanager.MemberLookup
19430
19431         (TypeContainer.MemberLookup): Implement using the
19432         TypeManager.MemberLookup now. 
19433
19434         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19435         and return MemberInfos, so that these can be used without an
19436         EmitContext (what we had before).
19437
19438 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19439
19440         * expression.cs: Fix the case where the argument to params if the
19441         type of the params.  I omitted handling this before.   Fixed
19442
19443 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19444
19445         * driver.cs: Call BootCorlib_PopulateCoreType
19446
19447         * class.cs (Property.CheckBase): Check for properties only, not
19448         for all members. 
19449
19450         * interface.cs: Temporary hack: try/catch around the
19451         CustomAttributeBuilder, because I am getting an exception that I
19452         do not understand.
19453
19454         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19455         types whose definitions are required to be there (attributes are
19456         defined before standard types).
19457
19458         Compute definitions as we boot the various types, as they are used
19459         immediately (value_type class will need object_type, but if we do
19460         not initialize object_type, we will pass a null, which will let
19461         the runtime pick the System.Object from the existing corlib, which
19462         is not what we want).
19463
19464 2002-04-22  Patrik Torstensson <totte@labs2.com>
19465
19466         * cs-tokenizer.cs: fixed a number of trim() issues.
19467
19468 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19469
19470         * expression.cs (Argument.Type): Ensure that we return the correct
19471         type when we have out or ref parameters [in which case we 
19472         append a "&"].
19473
19474 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19475
19476         * class.cs (Property, Indexer): Allow extern modifier in there. 
19477
19478         * typemanager.cs (InitBaseTypes): Initializes object_type and
19479         value_type, since those will be used early on during the bootstrap
19480         process to compile corlib.
19481
19482         (InitCoreTypes): Move code from here to InitBaseTypes.
19483
19484 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19485
19486         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19487         single-dimension arrays as using the ldlen opcode.  
19488
19489         Daniel Lewis discovered this optimization.  
19490
19491         * typemanager.cs: Add signature for System.Array::get_Length
19492
19493 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19494
19495         * statement.cs: report the error when the foreach does not apply to an
19496         array nor a collection.
19497
19498 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19499
19500         * expression.cs: Add implicit conversions to the operator ~.
19501
19502         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19503
19504         * typemanager.cs: Locate the decimal constructor.
19505
19506 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19507
19508         * attribute.cs: use the new property of TypeOf.
19509         * expression.cs: added 'get' property around typearg.
19510
19511         These changes fix a build breaker reported by NickD. Is this the
19512         correct way to fix?  If not, please, revert my changes and make it
19513         work :-).
19514
19515 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * attribute.cs: Add support for typeof in attribute invocations.
19518         I am not sure that this is right though.
19519
19520 2002-04-14  Duncan Mak  <duncan@ximian.com>
19521
19522         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19523         Binary.Operator.Division case.
19524
19525 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19526
19527         * class.cs (DefineType): Ensure that we do a proper check on
19528         attribute types and also register it with the TypeManager.
19529
19530         (TypeContainer.Targets): The default for attribute types is
19531         AttributeTargets.All.
19532
19533         * attribute.cs (ApplyAttributes): Registering the attribute type
19534         is done elsewhere, not when we discover we have a Usage attribute.
19535
19536 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19537
19538         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19539         and get rid of is_delegate parameter.
19540
19541         * everywhere : update.
19542
19543 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19544
19545         * cs-parser.jay (compilation_unit): Revamp completely to use
19546         some new ideas that I got from Rhys' grammar to solve the problems
19547         with assembly level attributes.
19548
19549         (outer_declaration): New grammar production.
19550
19551         (attribute_sections): Add.
19552
19553         (opt_attributes): Base on attribute_sections
19554
19555         (namespace_declaration): Allow opt_attributes to tackle the case
19556         when we have assembly level attributes - we are clever in this
19557         regard now ;-)
19558
19559         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19560         attributes in the non-global context.
19561
19562         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19563         instead of SetGlobalAttributes.
19564
19565         * class.cs, rootcontext.cs : Ensure we define and generate 
19566         attribute types before anything else.
19567
19568         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19569         and flag the new error -20 for the case when the attribute type
19570         does not have valid targets specified. csc does not catch this.
19571
19572         * ../errors/errors.txt : update for error # -20
19573
19574 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19575
19576         * support.cs (InternalParameters.ParameterModifier): Do some null
19577         checking and return sane values.
19578
19579         * class.cs (Method.Define): If we are a PInvoke method, ensure
19580         that we are static and extern. Report error # 601
19581
19582         * ../errors/cs0601.cs : Add test case for the above error.
19583
19584 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19585
19586         * rootcontext.cs (attribute_types): We need to keep type of
19587         all attribute types separately and emit code for them first.
19588
19589         (RegisterAttribute) : Implement.
19590
19591         * class.cs (DefineType): Check if the current Type is a custom
19592         attribute type and register it accordingly.
19593
19594         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19595         adding the first attribute twice and rename to
19596
19597         (SetGlobalAttributes): this.
19598
19599         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19600         lookups.
19601
19602         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19603         if we are processing global arguments. Hmm, I am unsure of this.
19604
19605 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19606
19607         * expression.cs: added static array of strings to avoid calling
19608         Enum.ToString () for Operator in Binary. Significant recover of
19609         performance.
19610
19611 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19612
19613         * class.cs (FindMembers): Allow the Builders of the various
19614         members to be null.  If they are skip them.  This only happens
19615         during the PInvoke declaration.
19616
19617 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19618
19619         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19620         failure, so we do not keep going afterwards.
19621
19622         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19623         wanted to pass `false' as the `is_delegate' argument.  If this is
19624         the case, why not use delegate_type == null to mean `is_delegate =
19625         false' and anything else as is_delegate = true.
19626
19627 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19628
19629         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19630         code for the section, not the beginning of the tests.
19631
19632 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19633
19634         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19635
19636         * expression.cs (Binary): same.  Warn about errors where we have
19637         Enum/Enum in operator + as well.
19638
19639 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19640
19641         * statement.cs:
19642                 - added support for switch(bool)
19643                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19644                 - add TableSwitchEmit() to handle table-based switch statements
19645
19646 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19647
19648         * expression.cs (Invocation.OverloadResolve): Factor out code which
19649         does parameter compatibility checking with arguments so that we can 
19650         re-use the code even from Delegate.VerifyApplicability
19651
19652         (VerifyArgumentsCompat): Move above code here.
19653
19654         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19655         and instead make a call to the above method.
19656
19657 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19658
19659         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19660         We use it to keep track of classes which are attribute types.
19661
19662 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19663
19664         * delegate.cs (Delegate.Define): Correctly define the types in the
19665         presence of fixed and array parameters.
19666
19667         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19668         doing FindMembers.
19669
19670         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19671         include NonPublic after the first iteration.
19672
19673         * class.cs (Indexer.CheckBase): Only check if both parents are
19674         non-null. 
19675
19676         * cs-parser.jay (accessor_body): If empty, set to null.
19677
19678         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19679         same code path here to resolve constants names that we did have in
19680         MemberAccess.DoResolve.  There is too much code duplicated here.
19681
19682 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19683
19684         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19685
19686         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19687         to MakeUnionSet.
19688
19689         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19690         tokens, numbers and strings.
19691
19692         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19693         parenthesis.
19694
19695         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19696         asyncronous parameters and the regular parameters.  
19697
19698         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19699         specify the target directory.
19700
19701         * expression.cs: (This.DoResolve): Simplify
19702         (As.Emit): Optimize, do not generate IsInst if the expression is
19703         always of the given type.
19704
19705         (Is.DoResolve): Bug fix, we were reporting both always/never for
19706         the is expression.
19707
19708         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19709         creating too many unnecessary arrays.
19710
19711 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19712
19713         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19714         fields instead of rolling our own initializer.   Takes care of all
19715         implicit conversions, and drops unnecessary static checks/argument.
19716
19717 2002-03-31  Dick Porter  <dick@ximian.com>
19718
19719         * driver.cs: use the GetDirectories() return values properly, and
19720         use "/" as path separator.
19721
19722 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19723
19724         * expression.cs (Unary): Optimize - - expr into expr.
19725         (Binary): Optimize a + (-b) into a -b.
19726
19727         * codegen.cs (CodeGen): Made all methods static.
19728
19729 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19730
19731         * rootcontext.cs: 
19732
19733         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19734         TypeBuilder property.
19735
19736         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19737         instead. 
19738
19739         * tree.cs: Removed the various RecordXXXX, and replaced with a
19740         single RecordDecl.  Removed all the accessor methods, and just
19741         left a single access point Type 
19742
19743         * enum.cs: Rename DefineEnum to DefineType.
19744
19745         * decl.cs: New abstract method `DefineType' used to unify the
19746         Defines for Enumerations, Interfaces, TypeContainers and
19747         Delegates.
19748
19749         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19750         LookupBaseClasses method that used to live in class.cs and
19751         interface.cs here, and renamed to FindType.
19752
19753         * delegate.cs: Implement DefineType.  Take advantage of the
19754         refactored pattern for locating the parent builder without taking
19755         the parent_builder argument (which we know does not work if we are
19756         nested, and triggering a toplevel definition).
19757
19758 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19759
19760         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19761         accessibility of a member has changed during override and report
19762         an error if so.
19763
19764         * class.cs (Method.Define, Property.Define): Only complain on
19765         overrides if the method is private, any other accessibility is
19766         fine (and since we just checked the permission is the same, we are
19767         good to go).
19768
19769         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19770         and elif are processed always.  The other pre-processing
19771         directives are only processed if we are "taking" the path
19772
19773 2002-03-29  Martin Baulig  <martin@gnome.org>
19774
19775         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19776         current location is not Null.
19777
19778         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19779         a separate method so we can profile it.
19780
19781         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19782         `span.Seconds' are just seconds, but no minutes or hours.
19783         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19784
19785 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19786
19787         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19788         Remove the gratuitous set of Final:
19789
19790                                 // If an interface implementation, then we can set Final.
19791                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19792                                     implementing.DeclaringType.IsInterface)
19793                                         flags |= MethodAttributes.Final;
19794
19795         I do not know what I was smoking when I used that.
19796
19797
19798         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19799         step into fixing the name resolution issues for delegates and
19800         unifying the toplevel name resolution.
19801
19802 2002-03-28  Martin Baulig  <martin@gnome.org>
19803
19804         * class.cs (Method.Emit): If we have a symbol writer, call its
19805         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19806         tell it about the current method.
19807
19808         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19809         writer that we're going to emit the first byte of IL code for a new
19810         statement (a new source line).
19811         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19812         EmitContext.Mark() before emitting any code.
19813
19814         * location.cs (SymbolDocument): Return null when we're Null.
19815
19816         * statement.cs (Statement): Moved the `Location loc' variable here.
19817         (Statement.EmitBoolExpression): If we have a symbol writer, call
19818         ec.Mark() before emitting any code to tell it that we're at the
19819         beginning of a new statement.
19820         (StatementExpression): Added `Location' argument to the constructor.
19821         (Block): Added public readonly variable `StartLocation' and public
19822         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19823         (Block): Added constructor which takes a start and end location.
19824         (Block.SetEndLocation): New method. This sets the end location.
19825         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19826         local variables we create.
19827         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19828         each statement and do also mark the begin and end of the block.
19829
19830         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19831         tell it the current lexer.Location, use Location.Null for the end of the
19832         block.
19833         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19834         current block, set its end location using SetEndLocation().
19835         (statement_expression): StatementExpression constructor now takes the
19836         lexer.Location as additional argument.
19837         (for_statement, declare_local_variables): Likewise.
19838         (declare_local_variables): When creating a new implicit block, use the
19839         new Block constructor and pass it the lexer.Location.
19840
19841 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19842
19843         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19844         members also on the parent interfaces recursively.
19845
19846 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19847
19848         * report.cs: Use new formats, since Gonzalo finished the missing
19849         bits. 
19850
19851         * expression.cs (Binary.ResolveOperator): added missing operator|
19852         operator& and operator^ for bool/bool.
19853
19854         * cs-parser.jay: CheckDef now takes a Location argument that is
19855         used to report errors more precisly (instead of reporting the end
19856         of a definition, we try to track something which is a lot closer
19857         to the source of the problem).
19858
19859         * cs-tokenizer.cs: Track global token use, so we can properly flag
19860         the use of #define/#undef after the first token has been seen.
19861
19862         Also, rename the reportXXXX to Error_DescriptiveName
19863
19864         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19865         TypeContainer, so that Enum and Interface can use this too.
19866
19867         * class.cs (TypeContainer.LookupInterfaceOrClass,
19868         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19869         `builder' argument.  Typically this was used to pass the parent
19870         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19871         the definition).  
19872
19873         The problem is that a nested class could trigger the definition of
19874         a toplevel class, and the builder would be obviously wrong in that
19875         case. 
19876
19877         So we drop this argument, and we compute dynamically the
19878         TypeBuilder/ModuleBuilder (the correct information was available
19879         to us anyways from DeclSpace.Parent)
19880
19881         * interface.cs (Interface.DefineInterface): Drop builder
19882         parameter cleanup like class.cs
19883
19884         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19885         like class.cs
19886
19887         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19888         values. 
19889
19890         (Try.Emit): Propagate the returns value from the statement.
19891
19892         (Return.Emit): Even if we are leavning 
19893
19894         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19895
19896         * modifiers.cs: Fix the computation of MethodAttributes flags.
19897
19898 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19899
19900         * driver.cs: allow compilation of files that start with '/'.
19901         Add a default case when checking the argument of --target.
19902
19903 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19904
19905         * interface.cs: Implement the same search algorithm for types in
19906         the interface code.
19907
19908         * delegate.cs: Do not allow multiple definition.
19909
19910         * Recovered ChangeLog that got accidentally amputated
19911
19912         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19913
19914         * rootcontext.cs: Load manually enum to allow core classes to
19915         contain enumerations.
19916
19917         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19918         Update to new static methods in TypeManager.
19919
19920         * typemanager.cs (GetMethod, GetConstructor): Use our
19921         implementation of FindMembers to find the members, since during
19922         corlib compilation, the types are TypeBuilders and GetMethod and
19923         GetConstructor do not work.
19924
19925         Make all methods in TypeManager static.
19926
19927         (InitCodeHelpers): Split the functionality from
19928         the InitCodeTypes function.
19929
19930         * driver.cs: Call InitCodeHelpers after we have populated the
19931         types. 
19932
19933         * cs-parser.jay (delegate_declaration): we did not used to compute
19934         the delegate name correctly for void delegates.
19935
19936 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19937
19938         * rootcontext.cs (RootContext): Init the interface_resolve_order
19939         and type_container_resolve_order always.
19940
19941         (ResolveCore, BootstrapCorlib_ResolveClass,
19942         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19943         compiler when compiling with --nostdlib
19944
19945         * class.cs (TypeContainer.DefineType): Check that our parent is
19946         not null.  This test is most important when we are bootstraping
19947         the core types.
19948
19949         * codegen.cs: Split out the symbol writing code.
19950
19951 2002-03-25  Martin Baulig  <martin@gnome.org>
19952
19953         * driver.cs (-g): Made -g an alias for --debug.
19954
19955 2002-03-24  Martin Baulig  <martin@gnome.org>
19956
19957         * codegen.cs (SymbolWriter): New public variable. Returns the
19958         current symbol writer.
19959         (CodeGen): Added `bool want_debugging_support' argument to the
19960          constructor. If true, tell the ModuleBuild that we want debugging
19961         support and ask it for the ISymbolWriter.
19962         (Save): If we have a symbol writer, call it's Close() method after
19963         saving the assembly.
19964
19965         * driver.c (--debug): New command line argument to create a
19966         debugger information file.
19967
19968         * location.cs (SymbolDocument): New public property. Returns an
19969         ISymbolDocumentWriter object for the current source file or null
19970         if we don't have a symbol writer.
19971
19972 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19973
19974         * driver.cs (LoadAssembly): Correctly return when all the paths
19975         have been tried and not before.
19976
19977         * statement.cs (Switch.Emit): return the actual coverage for this
19978         statement (returns/not-returns)
19979
19980         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19981         switch of the statement if we are the last switch section.  That
19982         kills two problems: try/catch problems (we used to emit an empty
19983         nop at the end) and switch statements where all branches would
19984         return. 
19985
19986 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19987
19988         * driver.cs: Add default assemblies (the equivalent to the
19989         Microsoft CSC.RSP file)
19990
19991         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19992         also update tokens_seen and set it to false.
19993
19994         * driver.cs: Implement --recurse for Mike.
19995
19996         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19997         correctly splitting out the paths.
19998
19999 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20000
20001         * interface.cs (Interface.PopulateProperty): Instead of using
20002         `parent' as the declaration space for the set parameters, use
20003         `this' 
20004
20005         * support.cs (InternalParameters): InternalParameters constructor
20006         takes a DeclSpace instead of a TypeContainer.
20007
20008         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20009         types are being initialized, load the address of it before calling
20010         the function.  
20011
20012         (New): Provide a mechanism to disable the generation of local
20013         value type temporaries when the caller will be providing us with
20014         an address to store it.
20015
20016         (ArrayCreation.EmitDynamicInitializers): Use it.
20017
20018 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20019
20020         * expression.cs (Invocation.EmitArguments): Only probe for array
20021         property if there is more than one argument.  Sorry about that.
20022
20023         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20024         empty param arrays.
20025
20026         * class.cs (Method.LabelParameters): Fix incorrect code path that
20027         prevented the `ParamArrayAttribute' from being applied to the
20028         params attribute.
20029
20030 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20031
20032         * support.cs (ReflectionParameters): Correctly compute whether the
20033         last argument is a params array.  Fixes the problem with
20034         string.Split ('a')
20035
20036         * typemanager.cs: Make the assemblies array always be non-null
20037         (empty, but non-null)
20038
20039         * tree.cs (RecordDecl): New function that abstracts the recording
20040         of names.  This reports error 101, and provides a pointer to the
20041         previous declaration.  Fixes a crash in the compiler.
20042
20043         * cs-parser.jay (constructor_declaration): Update to new grammar,
20044         and provide a constructor_body that can be empty.
20045
20046 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20047
20048         * driver.cs: Add support for --resources.
20049
20050         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20051         Make all types for the various array helper methods be integer.
20052
20053         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20054         CheckState to ConvCast.
20055
20056         (ConvCast): Now it takes a `checked' state argument, to avoid
20057         depending on the emit context for the conversion, and just using
20058         the resolve time setting.
20059
20060         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20061         instead of Invocation.EmitArguments.  We do not emit the original
20062         arguments, instead we emit those which have been converted to
20063         unsigned int expressions.
20064
20065         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20066
20067         * codegen.cs: ditto.
20068
20069         * expression.cs (LocalVariableReference): Drop the use of the
20070         Store function that depended on the variable index.
20071
20072         * statement.cs (VariableInfo): Drop the `Idx' property from this
20073         class, as this is not taking into account the indexes for
20074         temporaries tat we generate during the execution, getting the
20075         indexes wrong.
20076
20077         * class.cs: First emit class initializers, then call the parent
20078         constructor. 
20079
20080         * expression.cs (Binary): Fix opcode emision.
20081         (UnaryMutator.EmitCode): Support checked code generation
20082
20083         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20084         matches for events for both the Static and Instance scans,
20085         pointing to the same element.   Fix that.
20086
20087 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * rootcontext.cs (ResolveTree): Always set the
20090         interface_resolve_order, because nested interfaces will be calling
20091         into us.
20092
20093         * class.cs (GetInterfaceOrClass): Track the same resolution
20094         process used by TypeManager.LookupType.  This fixes the nested
20095         type lookups in class declarations (separate path from
20096         LookupType). 
20097
20098         (TypeContainer.DefineType): Also define nested interfaces.
20099         (TypeContainer.RegisterOrder): New public function used to
20100         register the order in which child interfaces need to be closed.
20101
20102         Nested interfaces need to be closed after their parents have been
20103         created. 
20104
20105         * interface.cs (InterfaceAttr): Put all the logic for computing
20106         the interface attribute here. 
20107
20108         (DefineInterface): Register our interface order with the
20109         RootContext or with the TypeContainer depending on the case.
20110
20111 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20112
20113         * cs-parser.jay: rework foreach statement to work with the new
20114         changes to the policy on SimpleNames.
20115
20116         * report.cs: support Stacktrace on warnings as well.
20117
20118         * makefile: drop --unsafe and /unsafe from the compile.
20119
20120 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20121
20122         * ecore.cs (StandardConversionExists): Modify to take an Expression
20123         as the first parameter. Ensure we do null -> reference type conversion
20124         checking.
20125
20126         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20127         temporary Expression objects.
20128
20129 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20130
20131         * interface.cs: workaround bug in method overloading resolution
20132         (there is already a bugzilla bug for it).
20133
20134 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20135
20136         We could also solve this problem by having a separate path for
20137         performing type lookups, instead of DoResolve, we could have a
20138         ResolveType entry point, and only participating pieces of the
20139         production (simplename, deref, array) would implement this. 
20140
20141         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20142         signal SimpleName to only resolve type names and not attempt to
20143         resolve anything else.
20144
20145         * expression.cs (Cast): Set the flag.
20146
20147         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20148
20149         * class.cs: Only report 108 if there is no `new' modifier.
20150
20151         * cs-parser.jay: rework foreach statement to work with the new
20152         changes to the policy on SimpleNames.
20153         
20154         * report.cs: support Stacktrace on warnings as well.
20155
20156         * makefile: drop --unsafe and /unsafe from the compile.
20157
20158 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20159
20160         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20161         lookups here, instead of doing that at parse time.  This means
20162         that our grammar will not introduce `LocalVariableReferences' as
20163         expressions at this point.  That solves the problem of code like
20164         this:
20165
20166         class X {
20167            static void Main ()
20168            { int X = 1;
20169             { X x = null }}}
20170
20171         This is only half the fix.  The full fix requires parameters to
20172         also be handled in this way.
20173
20174         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20175         makes the use more obvious of the DeclSpace.  The
20176         ec.TypeContainer.TypeBuilder is now only used to pull the
20177         TypeBuilder for it.
20178
20179         My theory is that I can get rid of the TypeBuilder completely from
20180         the EmitContext, and have typecasts where it is used (from
20181         DeclSpace to where it matters).  
20182
20183         The only pending problem is that the code that implements Aliases
20184         is on TypeContainer, and probably should go in DeclSpace.
20185
20186         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20187         lookups here, instead of doing that at parse time.  This means
20188         that our grammar will not introduce `LocalVariableReferences' as
20189         expressions at this point.  That solves the problem of code like
20190         this:
20191
20192         class X {
20193            static void Main ()
20194            { int X = 1;
20195             { X x = null }}}
20196
20197         This is only half the fix.  The full fix requires parameters to
20198         also be handled in this way.
20199
20200         * class.cs (Property.DefineMethod): When implementing an interface
20201         method, set newslot, when implementing an abstract method, do not
20202         set the flag (before we tried never setting it, or always setting
20203         it, which is the difference).
20204         (Indexer.DefineMethod): same.
20205         (Method.DefineMethod): same.
20206
20207         * ecore.cs: Only set the status used flag if we get back a Field.
20208
20209         * attribute.cs: Temporary hack, so Paolo can keep working.
20210
20211 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20212
20213         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20214         the unmanaged type in the case we have a MarshalAs attribute.
20215
20216         (Resolve): Handle the case when we are parsing the special MarshalAs
20217         attribute [we need to store the unmanaged type to use later]
20218
20219         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20220         MarshalAs Attribute.
20221
20222         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20223         on parameters and accordingly set the marshalling info.
20224
20225 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20226
20227         * class.cs: Optimizing slightly by removing redundant code after
20228         we switched to the `NoTypes' return value.
20229         (Property.DefineMethod): use NoTypes here too.
20230
20231         This fixes the bug I introduced in my last batch of changes.
20232
20233 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20234
20235         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20236
20237         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20238         Enums since those are types too. 
20239
20240         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20241
20242         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20243         thanks to a call during the lookup process.
20244
20245 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20246
20247         * statement.cs (Foreach): Lots of work to accomodate a particular
20248         kind of foreach statement that I had not kept in mind.  It is
20249         possible to have foreachs on classes that provide a GetEnumerator
20250         method that return objects that implement the "pattern" for using
20251         a foreach, there is no need to support GetEnumerator
20252         specifically. 
20253
20254         This is needed to compile nant.
20255
20256         * decl.cs: Only report 114 if the member is not `Finalize' and if
20257         the warning level is at least 2.
20258
20259         * class.cs: Moved the compare function from Method to
20260         MethodSignature. 
20261
20262         (MethodSignature.InheritableMemberSignatureCompare): Add new
20263         filter function that is used to extract inheritable methods from a
20264         class. 
20265
20266         (Method.Define): Use the new `inheritable_method_signature_filter'
20267         delegate
20268
20269         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20270         command. 
20271
20272 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20273
20274         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20275
20276         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20277
20278         * expression.cs: Pass location information to
20279         ConvertImplicitStandard. 
20280
20281         * class.cs: Added debugging code to track return values from
20282         interfaces. 
20283
20284 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20285
20286         * expression.cs (Is.DoResolve): If either side of the `is' is an
20287         interface, do not flag the warning.
20288
20289         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20290         for interfaces
20291
20292         * report.cs: Allow for --fatal to be used with --probe.
20293
20294         * typemanager.cs (NoTypes): Move the definition for the empty Type
20295         array here. 
20296
20297         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20298         properties. 
20299         (TypeContainer.DefineProxy): New function used to proxy to parent
20300         implementations when implementing interfaces.
20301         (TypeContainer.ParentImplements): used to lookup if our parent
20302         implements a public function that is required by an interface.
20303         (TypeContainer.VerifyPendingMethods): Hook this up.
20304
20305         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20306         `modules' and `assemblies' arraylists into arrays.  We only grow
20307         these are the very early start up of the program, so this improves
20308         the speedof LookupType (nicely measured).
20309
20310         * expression.cs (MakeByteBlob): Replaced unsafe code with
20311         BitConverter, as suggested by Paolo.
20312
20313         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20314         folding of string concatenation, but if either side is a string,
20315         and the other is not, then return null, and let the runtime use
20316         the concatenation on the string plus the object (using
20317         `Object.ToString'). 
20318
20319 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20320
20321         Constant Folding has been implemented now.
20322
20323         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20324         the error instead on types that are not supported in one's
20325         complement. 
20326
20327         * constant.cs (Constant and all children): New set of functions to
20328         perform implict and explicit conversions.
20329
20330         * ecore.cs (EnumConstant): Implement the new functions to perform
20331         conversion by proxying to the child expression.
20332
20333         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20334         own separate setting that can not be turned off from the command
20335         line using --unchecked or --checked and is only controlled using
20336         the checked/unchecked statements and expressions.  This setting is
20337         used by the constant folder to flag errors.
20338
20339         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20340         ConstantCheckState as well.   
20341
20342         During Resolve, they also have to flag the state, because the
20343         constant folder runs completely in the Resolve phase.
20344
20345         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20346         well.
20347
20348 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20349
20350         * cfold.cs: New file, this file contains the constant folder.
20351
20352         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20353         argument to track whether we are using the resulting address to
20354         load or store a value and provide better error messages. 
20355
20356         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20357         new AddressOf arguments.
20358
20359         * statement.cs (Foreach.EmitCollectionForeach): Update
20360
20361         * expression.cs (Argument.Emit): Call AddressOf with proper
20362         arguments to track usage.
20363
20364         (New.DoEmit): Call AddressOf with new arguments.
20365
20366         (Unary.Emit): Adjust AddressOf call.
20367
20368 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20369
20370         * cs-parser.jay (member_access): Change the case for pre-defined types
20371         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20372         this suggestion.
20373
20374         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20375         a method body.
20376
20377         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20378         essentially like methods and apply attributes like MethodImplOptions to them too.
20379
20380         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20381         not being null.
20382
20383         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20384         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20385         is the DeclSpace.
20386
20387         * Update code everywhere accordingly.
20388
20389         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20390
20391         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20392
20393 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20394
20395         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20396         try performing lookups against those instead of jumping straight into using
20397         the 'using' clauses.
20398
20399         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20400
20401         (LookupType): Perform lookups in implicit parents too.
20402
20403         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20404         sequence as RootContext.LookupType. 
20405
20406         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20407         the various cases of namespace lookups into this method.
20408
20409 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20410
20411         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20412         in positional arguments)
20413
20414         * class.cs (Operator): Update the AllowedModifiers to contain
20415         extern. 
20416
20417         * cs-parser.jay: Update operator declaration to allow for the
20418         operator body to be empty.
20419
20420         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20421         values. 
20422
20423 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20424
20425         * class.cs (Method.Emit): Label parameters.
20426
20427         * driver.cs: Return 1 or 0 as the program exit code.
20428
20429 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20430
20431         * expression.cs: Special case the `null' object when trying to
20432         auto-compute the type, as anything can be explicitly converted to
20433         that. 
20434
20435         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20436         spotting this Paolo.
20437
20438         (Expression.ImplicitNumericConversion): Perform comparissions of
20439         the type using the underlying type in the case of an enumeration
20440         rather than using the enumeration type for the compare.
20441
20442         Cope with the underlying == type case, which is not possible to
20443         catch before. 
20444
20445         (Expression.ConvertNumericExplicit): Perform comparissions of
20446         the type using the underlying type in the case of an enumeration
20447         rather than using the enumeration type for the compare.
20448
20449         * driver.cs: If the user does not supply an extension, assume .exe
20450
20451         * cs-parser.jay (if_statement): Rewrote so that we can track the
20452         location for the if statement.
20453
20454         * expression.cs (Binary.ConstantFold): Only concat strings when
20455         the operation is "+", not everything ;-)
20456
20457         * statement.cs (Statement.EmitBoolExpression): Take a location
20458         argument. 
20459         (If, While, Do): Track location.
20460
20461         * expression.cs (Binary.ResolveOperator): In the object + string
20462         case, I was missing a call to ConvertImplicit
20463
20464 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20465
20466         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20467         Location arguments. Ensure we use RootContext.LookupType to do our work
20468         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20469
20470         * interface.cs (PopulateMethod): Handle the type of the parameter being
20471         null gracefully.
20472
20473         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20474         have a params method with no fixed arguments and a call is made with no
20475         arguments.
20476
20477 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20478
20479         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20480         the verbatim-string-literal
20481
20482         * support.cs (InternalParameters.ParameterModifier): handle null
20483         fixed parameters.
20484         (InternalParameters.ParameterType): ditto.
20485
20486         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20487         duplicating the name of the variable parameter.
20488         (GetParameterByName): Fix bug where we were not looking up array
20489         paramters if they were the only present (thanks Paolo!).
20490         (GetParameterInfo): We only have an empty set of types if both
20491         fixed and array are set to null.
20492         (GetParameterInfo-idx): Handle FixedParameter == null
20493
20494         * cs-parser.jay: Handle the case where there is no catch
20495         statements (missing null test).
20496
20497 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20498
20499         * driver.cs (MainDriver): Be conservative on our command line
20500         handling.
20501
20502         Catch DirectoryNotFoundException when calling GetFiles.
20503
20504         (SplitPathAndPattern): Used to split the input specification into
20505         a path and a pattern that we can feed to Directory.GetFiles.
20506
20507 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20508
20509         * statement.cs (Fixed): Implement the last case of the Fixed
20510         statement (string handling).
20511
20512         * expression.cs (StringPtr): New class used to return a char * to
20513         a string;  Used by the Fixed statement.
20514
20515         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20516
20517         * expression.cs (Binary.ResolveOperator): Remove redundant
20518         MemberLookup pn parent type.
20519         Optimize union call, we do not need a union if the types are the same.
20520         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20521         type.
20522
20523         Specialize the use of MemberLookup everywhere, instead of using
20524         the default settings. 
20525
20526         (StackAlloc): Implement stackalloc keyword.
20527
20528         * cs-parser.jay: Add rule to parse stackalloc.
20529
20530         * driver.cs: Handle /h, /help, /?
20531
20532         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20533         before we supported unsafe code.
20534
20535         * makefile: add --unsafe to the self compilation of mcs.
20536
20537 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20538
20539         * expression.cs (PointerArithmetic): New class that is used to
20540         perform pointer arithmetic.
20541         (Binary.Resolve): Handle pointer arithmetic
20542         Handle pointer comparission.
20543         (ArrayPtr): Utility expression class that is used to take the
20544         address of an array.
20545
20546         (ElementAccess): Implement array access for pointers
20547
20548         * statement.cs (Fixed): Implement fixed statement for arrays, we
20549         are missing one more case before we are done.
20550
20551         * expression.cs (Indirection): Implement EmitAssign and set the
20552         ExprClass to Variable.  This allows pointer dereferences to be
20553         treated as variables, and to have values assigned to them.
20554
20555         * ecore.cs (Expression.StoreFromPtr): New utility function to
20556         store values dereferencing.
20557
20558 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20559
20560         * expression.cs (Binary.ResolveOperator): Ensure that we are
20561         not trying to operate on a void type - this fixes the reported
20562         bug.
20563
20564         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20565         the parent implementation is sealed.
20566
20567         * ../errors/cs0239.cs : Add.
20568
20569         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20570
20571         * typemanager.cs (unverifiable_code_type): Corresponds to 
20572         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20573         which have unsafe code in them.
20574
20575         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20576         unsafe context.
20577
20578 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20579
20580         * cs-tokenizer.cs: Add support for @"litreal strings"
20581
20582         Make tokenizer accept pre-processor directives
20583         on any column (remove the old C-like limitation). 
20584
20585         * rootcontext.cs (EmitCode): Emit any global attributes.
20586         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20587
20588         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20589
20590         * cs-parser.jay: Add support for global attributes.  
20591
20592 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20593
20594         * expression.cs (Indirection): New helper class.  Unary will
20595         create Indirection classes to be able to implement the
20596         IMemoryLocation interface on it.
20597
20598 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20599
20600         * cs-parser.jay (fixed_statement): reference the right statement.
20601
20602         * statement.cs (Fixed.Emit): Finish implementing the fixed
20603         statement for the &x case.
20604
20605 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20606
20607         * class.cs (Property.Define, Method.Define): Remove newslot when
20608         `implementing'.  
20609
20610         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20611         wrong.  NewSlot should only be used if the `new' keyword is present.
20612
20613         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20614         locating our system dir.  Sorry about this.
20615
20616 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20617
20618         * driver.cs (GetSystemDir): Compute correctly the location of our
20619         system assemblies.  I was using the compiler directory instead of
20620         the library directory.
20621
20622 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20623
20624         * expression.cs (BetterFunction): Put back in what Miguel commented out
20625         since it is the correct fix. The problem is elsewhere ;-)
20626
20627         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20628         parameters of the parms method are themselves compatible or not !
20629
20630         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20631         to check that a class implements an interface before saying that an implicit
20632         conversion was allowed. Use ImplementsInterface to do the checking.
20633
20634 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20635
20636         * class.cs (Method.Define): Track whether we are an explicit
20637         implementation or not.  And only call DefineMethodOverride if we
20638         are an explicit implementation.
20639
20640         (Property.DefineMethod): Ditto.
20641
20642 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20643
20644         * expression.cs (BetterFunction): Catch hideous bug which was
20645          preventing us from detecting ambiguous calls due to implicit casts i.e
20646         cs0121.
20647
20648 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * support.cs (Pair): Remove un-needed method.  I figured why I was
20651         getting the error in cs-parser.jay, the variable in a foreach loop
20652         is readonly, and the compiler does not really treat this as a variable.
20653
20654         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20655         instead of EQUALS in grammar.  
20656
20657         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20658
20659         * expression.cs (Unary.DoResolve): Check whether the argument is
20660         managed or not.
20661
20662 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20663
20664         * support.cs: Api for Pair to set a value.  Despite the fact that
20665         the variables are public the MS C# compiler refuses to compile
20666         code that accesses the field if the variable is part of a foreach
20667         statement. 
20668
20669         * statement.cs (Fixed): Begin implementation of the fixed
20670         statement.
20671
20672         (Block.AddVariable): Return the VariableInfo on success and null
20673         on failure instead of true/false. 
20674
20675         * cs-parser.jay (foreach): Catch errors on variables already
20676         defined (we were ignoring this value before) and properly unwind
20677         the block hierarchy
20678
20679         (fixed_statement): grammar for the fixed statement.
20680
20681 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20682
20683         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20684         pointer types to be incretemented.
20685
20686         (SizeOf): Implement.
20687
20688         * cs-parser.jay (pointer_member_access): Implement
20689         expr->IDENTIFIER production.
20690
20691         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20692         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20693         on safe contexts.
20694
20695         (Unary): Implement indirection.
20696
20697         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20698         use in non-unsafe context).
20699
20700         (SimpleName.DoResolve): Check for pointers in field access on safe
20701         contexts. 
20702
20703         (Expression.LoadFromPtr): Factor the load-indirect code in this
20704         function.  This was duplicated in UnboxCast and ParameterReference
20705
20706 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20707
20708         * expression.cs (ComposedCast): report an error if a pointer cast
20709         is used in a safe region.
20710
20711         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20712         pointer type casts in unsafe context.
20713
20714         * codegen.cs (EmitContext): Set up IsUnsafe.
20715
20716         * cs-parser.jay (non_expression_type): Add productions for pointer
20717         casts. 
20718
20719         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20720         code.  We should not use force into static mode if the method is
20721         not virtual.  Fixes bug in MIS
20722
20723         * statement.cs (Do.Emit, While.Emit, For.Emit,
20724         Statement.EmitBoolExpression): Add support to Do and While to
20725         propagate infinite loop as `I do return' semantics.
20726
20727         Improve the For case to also test for boolean constants.
20728
20729         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20730         to the list of attributes we can add.
20731
20732         Remove `EmitContext' argument.
20733
20734         * class.cs (Method.Define): Apply parameter attributes.
20735         (Constructor.Define): Apply parameter attributes.
20736         (MethodCore.LabelParameters): Move here the core of labeling
20737         parameters. 
20738
20739         * support.cs (ReflectionParameters.ParameterModifier,
20740         InternalParameters.ParameterModifier): Use IsByRef on the type and
20741         only return the OUT bit for these parameters instead of in/out/ref
20742         flags.
20743
20744         This is because I miss-understood things.  The ParameterInfo.IsIn
20745         and IsOut represent whether the parameter has the [In] and [Out]
20746         attributes set.  
20747
20748 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20749
20750         * ecore.cs (FieldExpr.Emit): Release temporaries.
20751
20752         * assign.cs (LocalTemporary.Release): new function.
20753
20754         * codegen.cs (EmitContext.GetTemporaryStorage,
20755         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20756         temporary storage.  Now we can "put back" localbuilders when we
20757         are done with them
20758
20759 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20760
20761         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20762         need to make a copy of the variable to generate verifiable code.
20763
20764 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20765
20766         * driver.cs: Compute dynamically the system directory.
20767
20768         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20769         Slower, but more generally useful.  Used by the abstract
20770         registering implementation. 
20771
20772         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20773         the rules for the special rule on Type/instances.  First check if
20774         we have the same name, and if so, try that special static path
20775         rather than the instance path.
20776
20777 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20780         for, while and if.
20781
20782         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20783         Enum, ValueType, Delegate or Array for non-corlib compiles.
20784
20785         * cs-tokenizer.cs: Catch long identifiers (645)
20786
20787         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20788         piece of code.
20789
20790         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20791         fix, we were returning too early, so we were not registering
20792         pending methods from abstract classes.
20793
20794         Do not register pending methods if the class is abstract.
20795
20796         * expression.cs (Conditional.DoResolve): Report circular implicit
20797         conversions when we neecd to compute it for conditional
20798         expressions. 
20799
20800         (Is.DoResolve): If the expression is always of the provided type,
20801         flag warning 183.  If the expression can not ever be of the
20802         provided type flag warning 184.
20803
20804         * class.cs: Catch 169 as well.
20805
20806         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20807         read. 
20808
20809 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20810
20811         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20812
20813 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20814
20815         * interface.cs: (PopulateMethod): Check for pointers being defined
20816         only if the unsafe context is active.
20817         (PopulateProperty): ditto.
20818         (PopulateIndexer): ditto.
20819
20820         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20821         specified.  If pointers are present, make sure that they are
20822         present in an unsafe context.
20823         (Constructor, Constructor.Define): ditto.
20824         (Field, Field.Define): ditto.
20825         (Property, Property.Define): ditto.
20826         (Event, Event.Define): ditto.
20827
20828         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20829         hashtable if there are classes or structs defined.
20830
20831         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20832         code, as the constant resolution moved.
20833
20834         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20835         the metadata, so we can flag error 133. 
20836
20837         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20838         pointer is being declared in an unsafe context.
20839
20840 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20841
20842         * modifiers.cs (Modifiers.Check): Require a Location argument.
20843         Report error 227 for Unsafe use.
20844
20845         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20846
20847         * statement.cs (For.Emit): If the test is null, then report that
20848         we do `return', as we wont reach anything afterwards.
20849
20850         (Switch.SwitchGoverningType): Track the expression that matched
20851         the conversion.
20852
20853         * driver.cs: Allow negative numbers as an error code to flag.
20854
20855         * cs-parser.jay: Handle 1551.
20856
20857         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20858
20859 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20860
20861         * cs-parser.jay: Report 1518 (type declaration can only contain
20862         class, struct, interface, enum or delegate)
20863
20864         (switch_label): Report 1523 (keywords `case' or `default' must
20865         preced code)
20866
20867         (opt_switch_sections): Report 1522 (empty switch)
20868
20869         * driver.cs: Report 1515 (response file specified multiple times)
20870         Report 1516 (Source file specified multiple times).
20871
20872         * expression.cs (Argument.Resolve): Signal 1510
20873
20874         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20875         access not allowed in static code)
20876
20877 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20878
20879         * typemanager.cs (IsPointerType): Utility method which we are going
20880         to need a lot.
20881
20882         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20883         the object type, so we take care of that.
20884
20885         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20886
20887         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20888         added to non-params parameters :-)
20889
20890         * typemanager.cs (CSharpName): Include 'void' type too. 
20891
20892         (void_ptr_type): Include in the set of core types.
20893
20894         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20895         duplicating code.
20896
20897         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20898         an unsafe context.
20899
20900         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20901         completely forgotten about it.
20902
20903 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20904
20905         * cs-parser.jay (pointer_type): Add. This begins our implementation
20906         of parsing rules for unsafe code.
20907
20908         (unsafe_statement): Implement.
20909
20910         (embedded_statement): Modify to include the above.
20911
20912         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20913
20914         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20915         if the current context is an unsafe one.
20916
20917         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20918         are handled differently, we need separate rules for them.
20919
20920         (local_variable_declaration): Update to use local_variable_pointer_type
20921         to allow variable declarations of unmanaged pointer types.
20922
20923         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20924         in unsafe contexts.
20925
20926         * ../errors/cs0214.cs : Add.
20927
20928 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20929
20930         * makefile: remove 'response' file when cleaning.
20931
20932 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20933
20934         * cs-parser.jay: Report 1524.
20935
20936 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20937
20938         * typemanager.cs (RegisterMethod): drop checking if we have
20939         registered this from here
20940
20941 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20942
20943         * class.cs (Method.EmitDestructor): Implement calling our base
20944         destructor. 
20945
20946         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20947         value of InFinally.
20948
20949         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20950         this routine and will wrap the call in a try/catch block.  Deal
20951         with the case.
20952
20953 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20954
20955         * ecore.cs (Expression.MemberLookup): instead of taking a
20956         parameter `same_type' that was used to tell whether we could
20957         access private members we compute our containing type from the
20958         EmitContext.
20959
20960         (FieldExpr): Added partial support for volatile fields.  This does
20961         not work for volatile fields exposed from assemblies, as I can not
20962         figure out how to extract the modreq from it.
20963
20964         Updated all the source files to use this.
20965
20966         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20967         because it is referenced by MemberLookup very often. 
20968
20969 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20970
20971         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20972         TypeBuilder.GetCustomAttributes to retrieve what we need.
20973
20974         Get rid of redundant default_member_attr_type as this is the same as
20975         default_member_type which already exists.
20976
20977         * interface.cs, attribute.cs : Update accordingly.
20978
20979 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20980
20981         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20982         work for TYpeBuilders though.  Ravi, can you please fix this?
20983
20984         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20985
20986         * expression.cs (Argument.Emit): Handle the case of ref objects
20987         being passed to ref functions;  
20988
20989         (ParameterReference.EmitLoad): Loads the content of the pointer
20990         without dereferencing.
20991
20992 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20993
20994         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20995
20996 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20997
20998         * class.cs (Indexer.DefineMethod): Incorporate the interface
20999         type in the name of the method if we are doing explicit interface
21000         implementation.
21001
21002         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21003
21004         (BetterConversion): Fix extremely trivial bug where we were referring to
21005         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21006         again !
21007
21008         * ../errors/bug16.cs : Add although we have fixed it.
21009
21010 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21011
21012         * expression.cs (BaseIndexer): Begin implementation.
21013
21014         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21015
21016         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21017         production directly to remove a shift/reduce, and implement
21018         explicit interface implementation.
21019
21020         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21021         after a floating point suffix.
21022
21023         * expression.cs (DoNumericPromotions): Improved the conversion for
21024         uint/uint.  If we have a constant, we avoid doing a typecast to a
21025         larger type.
21026
21027         * class.cs (Indexer): Implement explicit interface implementation
21028         for indexers.
21029
21030 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21031
21032         * class.cs: make the default instance constructor public and hidebysig.
21033
21034 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21035
21036         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21037         so we can call it from elsewhere.
21038
21039         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21040         we emit it internally if the class has a defined indexer; otherwise the user
21041         emits it by decorating the class definition with the DefaultMemberAttribute.
21042
21043         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21044         attribute is not used on a type which defines an indexer.
21045
21046         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21047         character when we skip whitespace.
21048
21049         * ../errors/cs0646.cs : Add.
21050
21051 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21052
21053         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21054         again. 
21055
21056         * makefile: Add practical target `mcs3.exe' which builds the third
21057         generation compiler. 
21058
21059         * expression.cs (New): Fix structures constructor calling.
21060
21061         * class.cs (Property, Method, Indexer): Emit Final flag on the
21062         method if we are an interface implementation and we are not
21063         abstract. 
21064
21065         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21066         whether this property is referencing a `base' method.
21067
21068         * expression.cs (Invocation.EmitCall): take an extra argument:
21069         is_base, this is used to determine whether the `call' or
21070         `callvirt' opcode should be used.
21071
21072
21073         * delegate.cs: update EmitCall.
21074
21075         * class.cs (Method.Define): Set NewSlot for the cases where we are
21076         not implementing an interface method.
21077
21078         (Property.Define): ditto.
21079
21080 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21081
21082         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21083         'r'.  Allows mcs to parse itself fully.
21084
21085 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21086
21087         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21088         of the number of initializers that require the InitializeArray method.
21089
21090         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21091         update the above field where necessary.
21092
21093         (MakeByteBlob): Update accordingly.
21094
21095         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21096         greater than 2.
21097
21098         (EmitDynamicInitializers): Update in accordance with the new optimization.
21099
21100         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21101         same OpCode applies.
21102
21103         * cs-parser.jay : Fix some glaring errors I introduced.
21104
21105 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21106
21107         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21108         so that we can check for name clashes there too.
21109
21110         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21111         for interface indexers.
21112
21113         * interfaces.cs (Define): Emit the default member attribute.
21114
21115         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21116         variable was being referred to while setting the value ;-)
21117
21118 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21119
21120         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21121         byte-by-byte information when we know the data is zero.
21122
21123         Make the block always a multiple of 4, because
21124         DefineInitializedData has a bug.
21125
21126         * assign.cs: Fix, we should assign from the temporary, not from
21127         the source. 
21128
21129         * expression.cs (MakeByteBlob): Fix my incorrect code.
21130
21131 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21132
21133         * typemanager.cs (EnumToUnderlying): This function is used to get
21134         the underlying type from an enumeration, because it does not
21135         always work. 
21136
21137         * constant.cs: Use the I4_S form for values between -128 and 127.
21138
21139         * statement.cs (Block.LookupLabel): Looks up a label.
21140         (Block): Drop support for labeled blocks.
21141
21142         (LabeledStatement): New kind of statement that represents a label
21143         only.
21144
21145         (Goto): Finally implement this bad boy.
21146
21147         * cs-parser.jay: Update to reflect new mechanism to implement
21148         labels.
21149
21150 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21151
21152         * codegen.cs (EmitContext.This): a codegen property that keeps the
21153         a single instance of this instead of creating many different this
21154         instances. 
21155
21156         * delegate.cs (Delegate.DoResolve): Update to use the property;
21157
21158         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21159
21160         * expression.cs (BaseAccess.DoResolve): Ditto.
21161
21162 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21163
21164         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21165         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21166
21167         (InitCoreTypes): Update accordingly.
21168
21169         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21170         so we can quickly store the state.
21171
21172         (ApplyAttributes): Set the correct implementation flags
21173         for InternalCall methods.
21174
21175 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21176
21177         * expression.cs (EmitCall): if a method is not virtual, then do
21178         not use callvirt on it.
21179
21180         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21181         user defined stuff) requires the use of stobj, which takes an
21182         address on the stack instead of an array and an index.  So emit
21183         the Ldelema operation for it.
21184
21185         (EmitStoreOpcode): Use stobj for valuetypes.
21186
21187         (UnaryMutator.EmitCode): Use the right 1 value depending on
21188         whether we are dealing with int64/uint64, float or doubles.
21189
21190         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21191         constructors that I implemented last night.
21192
21193         (Constructor.IsDefault): Fix to work properly for static
21194         constructors.
21195
21196         * cs-parser.jay (CheckDef): report method signature errors.
21197         Update error number 103 to be 132.
21198
21199         * decl.cs: New AdditionResult enumeration value: MethodExists.
21200         Although we do this check for methods later on in the semantic
21201         analysis, catching repeated default constructors is so easy that
21202         we catch these here. 
21203
21204         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21205         promotions code.
21206
21207         (ParameterReference.EmitAssign, Emit): handle
21208         bools as bytes.
21209
21210         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21211         (ArrayAccess.EmitStoreOpcode): ditto.
21212
21213         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21214
21215         * expression.cs (MakeByteBlob): Complete all the missing types
21216         (uint, short, ushort, byte, sbyte)
21217
21218         * class.cs: Only init instance field initializers on instance
21219         constructors. 
21220
21221         Rename `constructors' to instance_constructors. 
21222
21223         (TypeContainer.AddConstructor): Only add constructors to the list
21224         if it is not static.
21225
21226         Make sure that we handle default_static_constructor independently
21227         everywhere where we handle instance_constructors
21228
21229 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21230
21231         * class.cs: Do not lookup or create a base initializer for a
21232         static constructor.
21233
21234         (ConstructorInitializer.Resolve): use the proper type to lookup
21235         for constructors.
21236
21237         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21238
21239         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21240         in DeclSpace. 
21241
21242         * decl.cs: CloseType is now an virtual method, the default
21243         implementation just closes this type.
21244
21245 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21246
21247         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21248         to PreserveSig by default. Also emit HideBySig on such methods.
21249
21250         Basically, set the defaults to standard values.
21251
21252         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21253         argument, if candidate is better, it can't be worse than the best !
21254
21255         (Invocation): Re-write bits to differentiate between methods being
21256         applicable in their expanded form and their normal form - for params
21257         methods of course.
21258
21259         Get rid of use_standard everywhere as only standard conversions are allowed
21260         in overload resolution. 
21261
21262         More spec conformance.
21263
21264 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21265
21266         * driver.cs: Add --timestamp, to see where the compiler spends
21267         most of its time.
21268
21269         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21270         `this' in static code.
21271
21272         (SimpleName.DoResolve): Implement in terms of a helper function
21273         that allows static-references to be passed upstream to
21274         MemberAccess.
21275
21276         (Expression.ResolveWithSimpleName): Resolve specially simple
21277         names when called by MemberAccess to implement the special
21278         semantics. 
21279
21280         (Expression.ImplicitReferenceConversion): Handle conversions from
21281         Null to reference types before others, as Null's type is
21282         System.Object. 
21283
21284         * expression.cs (Invocation.EmitCall): Handle the special case of
21285         calling methods declared on a reference type from a ValueType
21286         (Base classes System.Object and System.Enum)
21287
21288         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21289         the left hand side is a TypeExpr, not on every enumeration. 
21290
21291         (Binary.Resolve): If types are reference types, then do a cast to
21292         object on operators != and == of both arguments.
21293
21294         * typemanager.cs (FindMembers): Extract instance and static
21295         members if requested.
21296
21297         * interface.cs (PopulateProperty): Use void_type instead of null
21298         as the return type for the setter method.
21299
21300         (PopulateIndexer): ditto.
21301
21302 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21303
21304         * support.cs (ReflectionParameters): Fix minor bug where we
21305         were examining the wrong parameter for the ParamArray attribute.
21306
21307         Cope with requests for the type of the parameter at position
21308         greater than the params parameter's. We now return the element
21309         type of the params array as that makes more sense.
21310
21311         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21312         accordingly as we no longer have to extract the element type
21313         ourselves.
21314
21315         (Invocation.OverloadResolve): Update.
21316
21317 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21318
21319         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21320         against IEnumerator, test whether the return value is a descendant
21321         of the IEnumerator interface.
21322
21323         * class.cs (Indexer.Define): Use an auxiliary method to implement
21324         the other bits of the method definition.  Begin support for
21325         explicit interface implementation.
21326
21327         (Property.DefineMethod): Use TypeManager.void_type instead of null
21328         for an empty return value.
21329
21330 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21331
21332         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21333         dealing with a FieldExpr which is composed of a FieldBuilder, in
21334         the code path we did extract the constant, but we should have
21335         obtained the underlying value to be able to cast it (otherwise we
21336         end up in an infinite loop, this is what Ravi was running into).
21337
21338         (ArrayCreation.UpdateIndices): Arrays might be empty.
21339
21340         (MemberAccess.ResolveMemberAccess): Add support for section
21341         14.5.4.1 that deals with the special case of E.I when E is a type
21342         and something else, that I can be a reference to a static member.
21343
21344         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21345         handle a particular array type to create byte blobs, it is just
21346         something we dont generate byteblobs for.
21347
21348         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21349         arguments. 
21350
21351         * location.cs (Push): remove the key from the hashtable that we
21352         are about to add.   This happens for empty files.
21353
21354         * driver.cs: Dispose files after we have parsed them.
21355
21356         (tokenize): new function that only runs the tokenizer on its
21357         input, for speed testing.
21358
21359 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21360
21361         * class.cs (Event.Define): Define the private field only if there
21362         are no accessors defined.
21363
21364         * expression.cs (ResolveMemberAccess): If there is no associated
21365         field with the event, that means we have an event defined with its
21366         own accessors and we should flag error cs0070 since transforming
21367         ourselves into a field is not valid in that case.
21368
21369         * ecore.cs (SimpleName.DoResolve): Same as above.
21370
21371         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21372         and charset to sane values.
21373
21374 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21375
21376         * assign.cs (DoResolve): Perform check on events only if they 
21377         are being accessed outside the declaring type.
21378
21379         * cs-parser.jay (event_declarations): Update rules to correctly
21380         set the type of the implicit parameter etc.
21381
21382         (add_accessor, remove_accessor): Set current local parameters.
21383
21384         * expression.cs (Binary): For delegate addition and subtraction,
21385         cast the return value from the method into the appropriate delegate
21386         type.
21387
21388 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21389
21390         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21391         of these as the workaround is unnecessary.
21392
21393         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21394         delegate data - none of that is needed at all.
21395
21396         Re-write bits to extract the instance expression and the delegate method
21397         correctly.
21398
21399         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21400         on delegates too.
21401
21402         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21403         of attaching attributes instead of duplicating code everywhere.
21404
21405         * everywhere : Update code to do attribute emission using the above method.
21406
21407 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21408
21409         * expression.cs (IsParamsMethodApplicable): if there are not
21410         parameters, return immediately.
21411
21412         * ecore.cs: The 0 literal can be implicity converted to an enum
21413         type. 
21414
21415         (SimpleName.DoResolve): First lookup the type, then lookup the
21416         members. 
21417
21418         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21419         want to get its address.  If the InstanceExpression is not
21420         addressable, store the result in a temporary variable, then get
21421         the address of it.
21422
21423         * codegen.cs: Only display 219 errors on warning level or above. 
21424
21425         * expression.cs (ArrayAccess): Make it implement the
21426         IMemoryLocation interface.
21427
21428         (Binary.DoResolve): handle the operator == (object a, object b)
21429         and operator != (object a, object b) without incurring into a
21430         BoxedCast (because 5 != o should never be performed).
21431
21432         Handle binary enumerator operators.
21433
21434         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21435         value type, otherwise use Ldelem_ref.
21436
21437         Use precomputed names;
21438
21439         (AddressOf): Implement address of
21440
21441         * cs-parser.jay (labeled_statement): Fix recursive block
21442         addition by reworking the production.
21443
21444         * expression.cs (New.DoEmit): New has a special case:
21445                 
21446                  If we are dealing with a ValueType, we have a few
21447                  situations to deal with:
21448                 
21449                     * The target of New is a ValueType variable, that is
21450                       easy, we just pass this as the variable reference
21451                 
21452                     * The target of New is being passed as an argument,
21453                       to a boxing operation or a function that takes a
21454                       ValueType.
21455                 
21456                       In this case, we need to create a temporary variable
21457                       that is the argument of New.
21458
21459
21460 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21461
21462         * rootcontext.cs (LookupType): Check that current_type is not null before
21463         going about looking at nested types.
21464
21465         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21466         not implement the IAssignMethod interface any more.
21467
21468         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21469         where we tranform them into FieldExprs if they are being resolved from within
21470         the declaring type.
21471
21472         * ecore.cs (SimpleName.DoResolve): Do the same here.
21473
21474         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21475
21476         * ../errors/bug10.cs : Add.
21477
21478         * ../errors/cs0070.cs : Add.
21479
21480         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21481
21482         * assign.cs : Get rid of EventIsLocal everywhere.
21483
21484 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21485
21486         * ecore.cs (ConvertIntLiteral): finished the implementation.
21487
21488         * statement.cs (SwitchLabel): Convert the value we are using as a
21489         key before looking up the table.
21490
21491 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21492
21493         * codegen.cs (EmitTopBlock): Require a Location argument now.
21494
21495         * cs-parser.jay (constructor_declarator): We need to setup
21496         current_local_parameters before we parse the
21497         opt_constructor_initializer, to allow the variables to be bound
21498         to the constructor arguments.
21499
21500         * rootcontext.cs (LookupType): First lookup nested classes in our
21501         class and our parents before we go looking outside our class.
21502
21503         * expression.cs (ConstantFold): Extract/debox the values at the
21504         beginnning. 
21505
21506         * rootcontext.cs (EmitCode): Resolve the constants first before we
21507         resolve the types.  This is not really needed, but it helps debugging.
21508
21509         * statement.cs: report location.
21510
21511         * cs-parser.jay: pass location to throw statement.
21512
21513         * driver.cs: Small bug fix.
21514
21515         * report.cs: Updated format to be 4-zero filled digits.
21516
21517 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21518
21519         * expression.cs (CheckIndices): Fix minor bug where the wrong
21520         variable was being referred to ;-)
21521
21522         (DoEmit): Do not call EmitStaticInitializers when the 
21523         underlying type is System.Object.
21524
21525 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21526
21527         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21528         and do the usual workaround for SRE.
21529
21530         * class.cs (MyEventBuilder.EventType): New member to get at the type
21531         of the event, quickly.
21532
21533         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21534
21535         * assign.cs (Assign.DoResolve): Handle the case when the target
21536         is an EventExpr and perform the necessary checks.
21537
21538         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21539         interface.
21540
21541         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21542
21543         (EventExpr): Set the type in the constructor itself since we 
21544         are meant to be born fully resolved.
21545
21546         (EventExpr.Define): Revert code I wrote earlier.
21547                 
21548         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21549         instance expression is null. The instance expression is a This in that case
21550         or a null, depending on whether it is a static method or not.
21551
21552         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21553         refers to more than one method.
21554
21555         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21556         and accordingly flag errors.
21557
21558 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21559
21560         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21561
21562 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21563
21564         * location.cs (ToString): Provide useful rutine.
21565
21566 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21567
21568         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21569         objects, return the actual integral boxed.
21570
21571         * statement.cs (SwitchLabel): define an ILLabel for each
21572         SwitchLabel. 
21573
21574         (Switch.CheckSwitch): If the value is a Literal, extract
21575         the underlying literal.
21576
21577         Also in the unused hashtable we had, add the SwitchLabel so we can
21578         quickly look this value up.
21579
21580         * constant.cs: Implement a bunch of new constants.  Rewrite
21581         Literal based on this.  Made changes everywhere to adapt to this.
21582
21583         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21584         dereferencing array only once, and also copes with enumrations.
21585
21586         bytes are two bytes wide, not one.
21587
21588         (Cast): Perform constant conversions.
21589
21590         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21591         wrappers to the literals here.
21592
21593         * expression.cs (DoNumericPromotions): long literals can converted
21594         to ulong implicity (this is taken care of elsewhere, but I was
21595         missing this spot).
21596
21597         * ecore.cs (Expression.Literalize): Make the return type Literal,
21598         to improve type checking.
21599
21600         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21601
21602 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * literal.cs: Revert code from ravi that checked the bounds.  The
21605         bounds are sane by the definition of the type itself. 
21606
21607         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21608         need to actually look up in our parent hierarchy for interfaces
21609         implemented. 
21610
21611         * const.cs: Use the underlying type for enumerations
21612
21613         * delegate.cs: Compute the basename for the delegate creation,
21614         that should fix the delegate test case, and restore the correct
21615         Type Lookup semantics in rootcontext
21616
21617         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21618         referencing a nested type with the Reflection API is using the "+"
21619         sign. 
21620
21621         * cs-parser.jay: Do not require EOF token at the end.
21622
21623 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21624
21625         * rootcontext.cs (LookupType): Concatenate type names with
21626         a '.' instead of a '+' The test suite passes again.
21627
21628         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21629         field of the enumeration.
21630
21631         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21632         the case when the member is an EventExpr.
21633
21634         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21635         static has an associated instance expression.
21636
21637         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21638
21639         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21640
21641         * class.cs (Event.Define): Register event and perform appropriate checks
21642         for error #111.
21643
21644         We define the Add and Remove methods even if the use provides none because
21645         in that case, we provide default implementations ourselves.
21646
21647         Define a private field of the type of the event. This is done by the CSC compiler
21648         and we should be doing it too ;-)
21649
21650         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21651         More methods we use in code we generate.
21652
21653         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21654         is important.
21655
21656         (InitCoreTypes): Update accordingly for the above.
21657
21658         * class.cs (Event.Emit): Generate code for default accessors that we provide
21659
21660         (EmitDefaultMethod): Do the job in the above.
21661
21662         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21663         appropriate place.
21664
21665 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21666
21667         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21668         builders even if we were missing one.
21669
21670         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21671         pass the Basename as our class name instead of the Name.  The
21672         basename will be correctly composed for us.
21673
21674         * parameter.cs (Paramters): Now takes a Location argument.
21675
21676         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21677         make all the code call directly LookupType in RootContext and take
21678         this chance to pass the Location information everywhere.
21679
21680         * Everywhere: pass Location information.
21681
21682 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21683
21684         * class.cs (Constructor.Define): Updated way of detecting the
21685         length of the parameters.
21686
21687         (TypeContainer.DefineType): Use basename as the type name for
21688         nested types.
21689
21690         (TypeContainer.Define): Do not recursively define types here, as
21691         definition is taken care in order by the RootContext.
21692
21693         * tree.cs: Keep track of namespaces in a per-file basis.
21694
21695         * parameter.cs (Parameter.ComputeSignature): Update to use
21696         DeclSpace. 
21697
21698         (Parameters.GetSignature): ditto.
21699
21700         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21701         instead of a TypeContainer.
21702
21703         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21704         resolve names.  Because we need to be resolve in our context, not
21705         our parents.
21706
21707         * driver.cs: Implement response files.
21708
21709         * class.cs (TypeContainer.DefineType): If we are defined, do not
21710         redefine ourselves.
21711
21712         (Event.Emit): Emit the code for add/remove handlers.
21713         (Event.Define): Save the MethodBuilders for add/remove.
21714
21715         * typemanager.cs: Use pair here too.
21716
21717         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21718         DictionaryEntry requires the first argument to be non-null.  
21719
21720         (enum_declaration): Compute full name for registering the
21721         enumeration.
21722
21723         (delegate_declaration): Instead of using
21724         formal_parameter_list, use opt_formal_parameter_list as the list
21725         can be empty.
21726
21727         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21728         (EventParsing): New property that controls whether `add' and
21729         `remove' are returned as tokens or identifiers (for events);
21730
21731 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21732
21733         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21734         use MyEventBuilder only and let it wrap the real builder for us.
21735
21736         (MyEventBuilder): Revamp constructor etc.
21737
21738         Implement all operations that we perform on EventBuilder in precisely the same
21739         way here too.
21740
21741         (FindMembers): Update to use the EventBuilder member.
21742
21743         (Event.Emit): Update accordingly.
21744
21745 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21746
21747         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21748         by calling the appropriate methods.
21749
21750         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21751         useful.
21752
21753         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21754
21755 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21756
21757         * delegate.cs (Delegate.Populate): Check that the return type
21758         and various parameters types are indeed accessible.
21759
21760         * class.cs (Constructor.Define): Same here.
21761
21762         (Field.Define): Ditto.
21763
21764         (Event.Define): Ditto.
21765
21766         (Operator.Define): Check that the underlying Method defined itself
21767         correctly - so it's MethodBuilder should not be null.
21768
21769         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21770         expression happens to be null.
21771
21772         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21773         members but as of now we don't seem to be able to do anything really useful with it.
21774
21775         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21776         not the EventBuilder.
21777
21778 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21779
21780         * cs-tokenizer.cs: Add support for defines.
21781         Add support for #if, #elif, #else, #endif
21782
21783         (eval_var): evaluates a variable.
21784         (eval): stubbed for evaluating functions.
21785
21786         * cs-parser.jay: Pass the defines information
21787
21788         * driver.cs: Add --define command line option.
21789
21790         * decl.cs: Move MemberCore here.
21791
21792         Make it the base class for DeclSpace.  This allows us to catch and
21793         report 108 and 109 for everything now.
21794
21795         * class.cs (TypeContainer.Define): Extract all the members
21796         before populating and emit the warning 108 (new keyword required
21797         to override) instead of having each member implement this.
21798
21799         (MemberCore.Define): New abstract method, we will be using this in
21800         the warning reporting engine in Populate.
21801
21802         (Operator.Define): Adjust to new MemberCore protocol. 
21803
21804         * const.cs (Const): This does not derive from Expression, it is a
21805         temporary object we use to create fields, it is a MemberCore. 
21806
21807         * class.cs (Method.Define): Allow the entry point to be in a
21808         specific class.
21809
21810         * driver.cs: Rewrite the argument handler to clean it up a bit.
21811
21812         * rootcontext.cs: Made it just an auxiliary namespace feature by
21813         making everything static.
21814
21815         * driver.cs: Adapt code to use RootContext type name instead of
21816         instance variable.
21817
21818         * delegate.cs: Remove RootContext argument.
21819
21820         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21821         argument. 
21822
21823         * class.cs (Event.Define): The lookup can fail.
21824
21825         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21826
21827         * expression.cs: Resolve the this instance before invoking the code.
21828
21829 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21830
21831         * cs-parser.jay: Add a production in element_access that allows
21832         the thing to become a "type" reference.  This way we can parse
21833         things like "(string [])" as a type.
21834
21835         Note that this still does not handle the more complex rules of
21836         casts. 
21837
21838
21839         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21840
21841         * ecore.cs: (CopyNewMethods): new utility function used to
21842         assemble the list of methods from running FindMembers.
21843
21844         (MemberLookup): Rework FindMembers so that 
21845
21846 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21847
21848         * class.cs (TypeContainer): Remove Delegates who fail to be
21849         defined.
21850
21851         * delegate.cs (Populate): Verify that we dont get null return
21852         values.   TODO: Check for AsAccessible.
21853
21854         * cs-parser.jay: Use basename to emit error 574 (destructor should
21855         have the same name as container class), not the full name.
21856
21857         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21858         possible representation.  
21859
21860         Also implements integer type suffixes U and L.
21861
21862 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21863
21864         * expression.cs (ArrayCreation.DoResolve): We need to do the
21865         argument resolution *always*.
21866
21867         * decl.cs: Make this hold the namespace.  Hold the root context as
21868         well.
21869         (LookupType): Move here.
21870
21871         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21872
21873         * location.cs (Row, Name): Fixed the code, it was always returning
21874         references to the first file.
21875
21876         * interface.cs: Register properties defined through interfaces.
21877
21878         * driver.cs: Add support for globbing on the command line
21879
21880         * class.cs (Field): Make it derive from MemberCore as well.
21881         (Event): ditto.
21882
21883 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21884
21885         * class.cs (Event::Define): Check that the type of the event is a delegate
21886         type else flag error #66.
21887
21888         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21889         same.
21890
21891         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21892         values of EntryPoint, CharSet etc etc.
21893
21894         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21895
21896         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21897         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21898         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21899         which needs this to do its work.
21900
21901         * ../errors/cs0066.cs : Add.
21902
21903 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21904
21905         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21906         helper functions.
21907
21908         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21909         clears out the parameters field.
21910         (MemberSignatureCompare): Cleanup
21911
21912         (MemberCore): New base class used to share code between MethodCore
21913         and Property.
21914
21915         (RegisterRequiredImplementations) BindingFlags.Public requires
21916         either BindingFlags.Instace or Static.  Use instance here.
21917
21918         (Property): Refactored code to cope better with the full spec.
21919
21920         * parameter.cs (GetParameterInfo): Return an empty array instead
21921         of null on error.
21922
21923         * class.cs (Property): Abstract or extern properties have no bodies.
21924
21925         * parameter.cs (GetParameterInfo): return a zero-sized array.
21926
21927         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21928         method modifier validation to the typecontainer so we can reuse
21929         this on properties.
21930
21931         (MethodCore.ParameterTypes): return an empty sized array of types.
21932
21933         (Property.Define): Test property modifier validity.
21934
21935         Add tests for sealed/override too.
21936
21937         (Method.Emit): abstract or extern methods have no bodies.
21938
21939 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21940
21941         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21942         thing.
21943
21944         (Method::Define, ::Emit): Modify accordingly.
21945
21946         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21947
21948         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21949
21950         * makefile: Pass in /unsafe.
21951
21952 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21953
21954         * class.cs (MakeKey): Kill routine.
21955
21956         * class.cs (TypeContainer.Define): Correctly define explicit
21957         method implementations (they require the full interface name plus
21958         the method name).
21959
21960         * typemanager.cs: Deply the PtrHashtable here and stop using the
21961         lame keys.  Things work so much better.
21962
21963         This of course broke everyone who depended on `RegisterMethod' to
21964         do the `test for existance' test.  This has to be done elsewhere.
21965
21966         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21967         the object stupid Equals method (because, that like fails all over
21968         the place).  We still do not use it.
21969
21970         * class.cs (TypeContainer.SetRequiredInterface,
21971         TypeContainer.RequireMethods): Killed these two routines and moved
21972         all the functionality to RegisterRequiredImplementations.
21973
21974         (TypeContainer.RegisterRequiredImplementations): This routine now
21975         registers all the implementations required in an array for the
21976         interfaces and abstract methods.  We use an array of structures
21977         which can be computed ahead of time to reduce memory usage and we
21978         also assume that lookups are cheap as most classes will not
21979         implement too many interfaces.
21980
21981         We also avoid creating too many MethodSignatures.
21982
21983         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21984         clear the "pending" bit if we find that there are problems with
21985         the declaration.
21986
21987         (TypeContainer.VerifyPendingMethods): Update to report errors of
21988         methods that look like implementations but are not.
21989
21990         (TypeContainer.Define): Add support for explicit interface method
21991         implementation. 
21992
21993 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21994
21995         * typemanager.cs: Keep track of the parameters here instead of
21996         being a feature of the TypeContainer.
21997
21998         * class.cs: Drop the registration of parameters here, as
21999         InterfaceMethods are also interface declarations.
22000
22001         * delegate.cs: Register methods with the TypeManager not only with
22002         the TypeContainer.  This code was buggy.
22003
22004         * interface.cs: Full registation here.
22005
22006 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22007
22008         * expression.cs: Remove reducer for binary expressions, it can not
22009         be done this way.
22010
22011         * const.cs: Put here the code that used to go into constant.cs
22012
22013         * constant.cs: Put here the code for constants, this is a new base
22014         class for Literals.
22015
22016         * literal.cs: Make Literal derive from Constant.
22017
22018 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22019
22020         * statement.cs (Return.Emit): Report error 157 if the user
22021         attempts to return from a finally block.
22022
22023         (Return.Emit): Instead of emitting a return, jump to the end of
22024         the function.
22025
22026         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22027         LocalBuilder to store the result of the function.  ReturnLabel is
22028         the target where we jump.
22029
22030
22031 2001-12-09  Radek Doulik  <rodo@ximian.com>
22032
22033         * cs-parser.jay: remember alias in current namespace
22034
22035         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22036         namespaces
22037
22038         * class.cs (LookupAlias): lookup alias in my_namespace
22039
22040         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22041         aliases hashtable
22042         (LookupAlias): lookup alias in this and if needed in parent
22043         namespaces
22044
22045 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22046
22047         * support.cs: 
22048
22049         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22050         making things static.  I need this to avoid passing the
22051         TypeContainer when calling ParameterType.
22052
22053         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22054         that did string manipulation to compute the type and then call
22055         GetType.  Use Parameter.ParameterType instead.
22056
22057         * cs-tokenizer.cs: Consume the suffix for floating values.
22058
22059         * expression.cs (ParameterReference): figure out whether this is a
22060         reference parameter or not.  Kill an extra variable by computing
22061         the arg_idx during emission.
22062
22063         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22064         function that returns whether a parameter is an out/ref value or not.
22065
22066         (Parameter.ParameterType): The type of the parameter (base,
22067         without ref/out applied).
22068
22069         (Parameter.Resolve): Perform resolution here.
22070         (Parameter.ExternalType): The full type (with ref/out applied).
22071
22072         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22073         support for expressions on the using statement.
22074
22075 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22076
22077         * statement.cs (Using.EmitLocalVariableDecls): Split the
22078         localvariable handling of the using statement.
22079
22080         (Block.EmitMeta): Keep track of variable count across blocks.  We
22081         were reusing slots on separate branches of blocks.
22082
22083         (Try.Emit): Emit the general code block, we were not emitting it. 
22084
22085         Check the type of the declaration to be an IDisposable or
22086         something that can be implicity converted to it. 
22087
22088         Emit conversions if required.
22089
22090         * ecore.cs (EmptyExpression): New utility class.
22091         (Expression.ImplicitConversionExists): New utility function.
22092
22093 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22094
22095         * statement.cs (Using): Implement.
22096
22097         * expression.cs (LocalVariableReference): Support read only variables.
22098
22099         * statement.cs: Remove the explicit emit for the Leave opcode.
22100         (VariableInfo): Add a readonly field.
22101
22102 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22103
22104         * ecore.cs (ConvCast): new class used to encapsulate the various
22105         explicit integer conversions that works in both checked and
22106         unchecked contexts.
22107
22108         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22109         properly generate the overflow opcodes.
22110
22111 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22112
22113         * statement.cs: The correct type for the EmptyExpression is the
22114         element_type, not the variable type.  Ravi pointed this out.
22115
22116 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22117
22118         * class.cs (Method::Define): Handle PInvoke methods specially
22119         by using DefinePInvokeMethod instead of the usual one.
22120
22121         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22122         above to do the task of extracting information and defining the method.
22123
22124 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22125
22126         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22127         of the condition for string type.
22128
22129         (Emit): Move that here. 
22130
22131         (ArrayCreation::CheckIndices): Keep string literals in their expression
22132         form.
22133
22134         (EmitDynamicInitializers): Handle strings appropriately.
22135
22136 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22137
22138         * codegen.cs (EmitContext): Replace multiple variables with a
22139         single pointer to the current Switch statement.
22140
22141         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22142         EmitContext.
22143
22144 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22145
22146         * statement.cs 
22147
22148         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22149         default'.
22150
22151         (Foreach.Emit): Foreach on arrays was not setting
22152         up the loop variables (for break/continue).
22153
22154         (GotoCase): Semi-implented.
22155
22156 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22157
22158         * attribute.cs (CheckAttribute): Handle system attributes by using
22159         Attribute.GetAttributes to examine information we need.
22160
22161         (GetValidPlaces): Same here.
22162
22163         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22164
22165         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22166
22167         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22168
22169         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22170
22171         (Method::Emit): Handle the case when we are a PInvoke method.
22172
22173 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22174
22175         * expression.cs: Use ResolveWithSimpleName on compound names.
22176
22177 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22178
22179         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22180         before trying to reduce it.
22181
22182         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22183
22184         * constant.cs (LookupConstantValue): Implement.
22185
22186         (EmitConstant): Use the above in emitting the constant.
22187
22188         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22189         that are user-defined by doing a LookupConstantValue on them.
22190
22191         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22192         too, like above.
22193
22194 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22195
22196         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22197
22198         (BaseAccess.DoResolve): Implement.
22199
22200         (MemberAccess.DoResolve): Split this routine into a
22201         ResolveMemberAccess routine that can be used independently
22202
22203 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22204
22205         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22206         As that share bits of the implementation.  Is returns a boolean,
22207         while As returns the Type that is being probed.
22208
22209 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22210
22211         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22212         instead of a Literal - much easier.
22213
22214         (EnumInTransit): Remove - utterly useless :-)
22215
22216         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22217
22218         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22219
22220         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22221         chain when we have no associated expression.
22222
22223 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22224
22225         * constant.cs (Define): Use Location while reporting the errror.
22226
22227         Also emit a warning when 'new' is used and there is no inherited
22228         member to hide.
22229
22230         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22231         populated.
22232
22233         (LookupEnumValue): Implement to lookup an enum member's value and define it
22234         if necessary.
22235
22236         (Populate): Re-write accordingly to use the above routine.
22237
22238 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22239
22240         * expression.cs (This): Fix prototype for DoResolveLValue to
22241         override the base class DoResolveLValue.
22242
22243         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22244         declarations) 
22245
22246         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22247         (we need to load the address of the field here).  This fixes
22248         test-22. 
22249
22250         (FieldExpr.DoResolveLValue): Call the DoResolve
22251         function to initialize the Instance expression.
22252
22253         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22254         correctly the GetEnumerator operation on a value type.
22255
22256         * cs-parser.jay: Add more simple parsing error catches.
22257
22258         * statement.cs (Switch): Add support for string switches.
22259         Handle null specially.
22260
22261         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22262
22263 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22264
22265         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22266
22267         (declare_local_constant): New helper function.
22268
22269         * statement.cs (AddConstant): Keep a separate record of constants
22270
22271         (IsConstant): Implement to determine if a variable is a constant.
22272
22273         (GetConstantExpression): Implement.
22274
22275         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22276
22277         * statement.cs (IsVariableDefined): Re-write.
22278
22279 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22280
22281         * class.cs (TypeContainer::FindMembers): Look for constants
22282         in the case when we are looking for MemberTypes.Field
22283
22284         * expression.cs (MemberAccess::DoResolve): Check that in the
22285         case we are a FieldExpr and a Literal, we are not being accessed
22286         by an instance reference.
22287
22288         * cs-parser.jay (local_constant_declaration): Implement.
22289
22290         (declaration_statement): Implement for constant declarations.
22291
22292 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22293
22294         * statement.cs (Switch): Catch double defaults.
22295
22296         (Switch): More work on the switch() statement
22297         implementation.  It works for integral values now, need to finish
22298         string support.
22299
22300
22301 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22302
22303         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22304         integer literals into other integer literals.  To be used by
22305         switch. 
22306
22307 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22308
22309         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22310         some memory.
22311
22312         (EmitDynamicInitializers): Cope with the above since we extract data
22313         directly from ArrayData now.
22314
22315         (ExpectInitializers): Keep track of whether initializers are mandatory
22316         or not.
22317
22318         (Bounds): Make it a hashtable to prevent the same dimension being 
22319         recorded for every element in that dimension.
22320
22321         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22322         from being found.
22323
22324         Also fix bug which was causing the indices to be emitted in the reverse
22325         order.
22326
22327 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22328
22329         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22330         unfinished.  They do not work, because the underlying code is
22331         sloppy.
22332
22333 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22334
22335         * cs-parser.jay: Remove bogus fixme.
22336
22337         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22338         on Switch statement.
22339
22340 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22341
22342         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22343         the same. 
22344
22345         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22346         parameter. Apparently, any expression is allowed. 
22347
22348         (ValidateInitializers): Update accordingly.
22349
22350         (CheckIndices): Fix some tricky bugs thanks to recursion.
22351
22352         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22353         I was being completely brain-dead.
22354
22355         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22356         and re-write acordingly.
22357
22358         (DelegateInvocation): Re-write accordingly.
22359
22360         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22361
22362         (MakeByteBlob): Handle types more correctly.
22363
22364         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22365         initialization from expressions but it is incomplete because I am a complete
22366         Dodo :-|
22367
22368 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22369
22370         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22371         on If.  Basically, we have to return `true' (ie, we do return to
22372         our caller) only if both branches of the if return.
22373
22374         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22375         short-circuit operators, handle them as short circuit operators. 
22376
22377         (Cast.DoResolve): Resolve type.
22378         (Cast.Cast): Take an expression as the target type.
22379
22380         * cs-parser.jay (cast_expression): Remove old hack that only
22381         allowed a limited set of types to be handled.  Now we take a
22382         unary_expression and we resolve to a type during semantic
22383         analysis.
22384
22385         Use the grammar productions from Rhys to handle casts (this is
22386         not complete like Rhys syntax yet, we fail to handle that corner
22387         case that C# has regarding (-x), but we will get there.
22388
22389 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22390
22391         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22392         field which is an array type.
22393
22394         * cs-parser.jay (declare_local_variables): Support array initialization too.
22395
22396         * typemanager.cs (MakeKey): Implement.
22397
22398         (everywhere): Use the above appropriately.
22399
22400         * cs-parser.jay (for_statement): Update for array initialization while
22401         declaring variables.
22402
22403         * ecore.cs : The error message was correct, it's the variable's names that
22404         were misleading ;-) Make the code more readable.
22405
22406         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22407         the correct type etc.
22408
22409         (ConvertExplicit): Handle Enum types by examining the underlying type.
22410
22411 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22412
22413         * parameter.cs (GetCallingConvention): Always return
22414         CallingConventions.Standard for now.
22415
22416 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22417
22418         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22419         and `r' after calling DoNumericPromotions.
22420
22421         * ecore.cs: Fix error message (the types were in the wrong order).
22422
22423         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22424         BindingFlags.Instance as well 
22425
22426         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22427         implicit int literal conversion in an empty cast so that we
22428         propagate the right type upstream.
22429
22430         (UnboxCast): new class used to unbox value types.
22431         (Expression.ConvertExplicit): Add explicit type conversions done
22432         by unboxing.
22433
22434         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22435         the target type before applying the implicit LongLiterals to ULong
22436         literal cast.
22437
22438 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22439
22440         * cs-parser.jay (for_statement): Reworked the way For works: now
22441         we declare manually any variables that are introduced in
22442         for_initializer to solve the problem of having out-of-band code
22443         emition (that is what got for broken).
22444
22445         (declaration_statement): Perform the actual variable declaration
22446         that used to be done in local_variable_declaration here.
22447
22448         (local_variable_declaration): Do not declare anything, just pass
22449         the information on a DictionaryEntry
22450
22451 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22452
22453         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22454         re-write of the logic to now make it recursive.
22455
22456         (UpdateIndices): Re-write accordingly.
22457
22458         Store element data in a separate ArrayData list in the above methods.
22459
22460         (MakeByteBlob): Implement to dump the array data into a byte array.
22461
22462 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22463
22464         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22465         into CheckIndices.
22466
22467         * constant.cs (Define): Implement.
22468
22469         (EmitConstant): Re-write fully.
22470
22471         Pass in location info.
22472
22473         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22474         respectively.
22475
22476         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22477         DictionaryEntry since we need location info too.
22478
22479         (constant_declaration): Update accordingly.
22480
22481         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22482         code into another method : UpdateIndices.
22483
22484 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22485
22486         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22487         some type checking etc.
22488
22489 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22490
22491         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22492         bits to provide dimension info if the user skips doing that.
22493
22494         Update second constructor to store the rank correctly.
22495
22496 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22497
22498         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22499         and try to implement.
22500
22501         * ../errors/cs0150.cs : Add.
22502
22503         * ../errors/cs0178.cs : Add.
22504
22505 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22506
22507         * statement.cs: Implement foreach on multi-dimensional arrays. 
22508
22509         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22510         name of the params argument.
22511
22512         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22513         initializing the array.
22514
22515         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22516         we can use this elsewhere.
22517
22518         * statement.cs: Finish implementation of foreach for single
22519         dimension arrays.
22520
22521         * cs-parser.jay: Use an out-of-band stack to pass information
22522         around, I wonder why I need this.
22523
22524         foreach_block: Make the new foreach_block the current_block.
22525
22526         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22527         function used to return a static Parameters structure.  Used for
22528         empty parameters, as those are created very frequently.
22529
22530         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22531
22532 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22533
22534         * interface.cs : Default modifier is private, not public. The
22535         make verify test passes again.
22536
22537 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22538
22539         * support.cs (ReflectionParameters): Fix logic to determine
22540         whether the last parameter is a params one. Test 9 passes again.
22541
22542         * delegate.cs (Populate): Register the builders we define with
22543         RegisterParameterForBuilder. Test 19 passes again.
22544
22545         * cs-parser.jay (property_declaration): Reference $6 instead
22546         of $$ to get at the location.
22547
22548         (indexer_declaration): Similar stuff.
22549
22550         (attribute): Ditto.
22551
22552         * class.cs (Property): Register parameters for the Get and Set methods
22553         if they exist. Test 23 passes again.
22554
22555         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22556         call to EmitArguments as we are sure there aren't any params arguments. 
22557         Test 32 passes again.
22558
22559         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22560         IndexOutOfRangeException. 
22561
22562         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22563         Test 33 now passes again.
22564
22565 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22566
22567         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22568         broke a bunch of things.  Will have to come up with a better way
22569         of tracking locations.
22570
22571         * statement.cs: Implemented foreach for single dimension arrays.
22572
22573 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22574
22575         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22576         an error.  This removes the lookup from the critical path.
22577
22578         * cs-parser.jay: Removed use of temporary_loc, which is completely
22579         broken. 
22580
22581 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22582
22583         * support.cs (ReflectionParameters.ParameterModifier): Report
22584         whether the argument is a PARAMS argument or not.
22585
22586         * class.cs: Set the attribute `ParamArrayAttribute' on the
22587         parameter argument.
22588
22589         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22590         and cons_param_array_attribute (ConstructorInfo for
22591         ParamArrayAttribute)., 
22592
22593         * codegen.cs: Emit the return using the `Return' statement, that
22594         way we can report the error correctly for missing return values. 
22595
22596         * class.cs (Method.Emit): Clean up.
22597
22598         * expression.cs (Argument.Resolve): Take another argument: the
22599         location where this argument is used.  Notice that this is not
22600         part of the "Argument" class as to reduce the size of the
22601         structure (we know the approximate location anyways).
22602
22603         Test if the argument is a variable-reference, if not, then
22604         complain with a 206.
22605
22606         (Argument.Emit): Emit addresses of variables.
22607
22608         (Argument.FullDesc): Simplify.
22609
22610         (Invocation.DoResolve): Update for Argument.Resolve.
22611
22612         (ElementAccess.DoResolve): ditto.
22613
22614         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22615         method should be virtual, as this method is always virtual.
22616
22617         (NewDelegate.DoResolve): Update for Argument.Resolve.
22618
22619         * class.cs (ConstructorInitializer.DoResolve): ditto.
22620
22621         * attribute.cs (Attribute.Resolve): ditto.
22622
22623 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22624
22625         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22626
22627         * expression.cs (ParameterReference): Drop IStackStorage and implement
22628         IAssignMethod instead. 
22629
22630         (LocalVariableReference): ditto.
22631
22632         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22633         IAssignMethod instead. 
22634
22635 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22636
22637         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22638         enumerations that are used in heavily used structures derive from
22639         byte in a laughable and pathetic attempt to reduce memory usage.
22640         This is the kind of pre-optimzations that you should not do at
22641         home without adult supervision.
22642
22643         * expression.cs (UnaryMutator): New class, used to handle ++ and
22644         -- separatedly from the other unary operators.  Cleans up the
22645         code, and kills the ExpressionStatement dependency in Unary.
22646
22647         (Unary): Removed `method' and `Arguments' from this class, making
22648         it smaller, and moving it all to SimpleCall, so I can reuse this
22649         code in other locations and avoid creating a lot of transient data
22650         strucutres when not required.
22651
22652         * cs-parser.jay: Adjust for new changes.
22653
22654 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22655
22656         * enum.cs (Enum.Populate): If there is a failure during
22657         definition, return
22658
22659         * cs-parser.jay (opt_enum_base): we used to catch type errors
22660         here, but this is really incorrect.  The type error should be
22661         catched during semantic analysis.
22662
22663 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22664
22665         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22666         current_local_parameters as expected since I, in my stupidity, had forgotten
22667         to do this :-)
22668
22669         * attribute.cs (GetValidPlaces): Fix stupid bug.
22670
22671         * class.cs (Method::Emit): Perform check on applicability of attributes.
22672
22673         (Constructor::Emit): Ditto.
22674
22675         (Field::Emit): Ditto.
22676
22677         (Field.Location): Store location information.
22678
22679         (Property, Event, Indexer, Operator): Ditto.
22680
22681         * cs-parser.jay (field_declaration): Pass in location for each field.
22682
22683         * ../errors/cs0592.cs : Add.
22684
22685 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22686
22687         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22688
22689         (InitCoreTypes): Update accordingly.
22690
22691         (RegisterAttrType, LookupAttr): Implement.
22692
22693         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22694         info about the same.
22695
22696         (Resolve): Update to populate the above as necessary.
22697
22698         (Error592): Helper.
22699
22700         (GetValidPlaces): Helper to the above.
22701
22702         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22703
22704         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22705
22706 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22707
22708         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22709
22710         * ../errors/cs0617.cs : Add.
22711
22712 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22713
22714         * enum.cs (Emit): Rename to Populate to be more consistent with what
22715         we expect it to do and when exactly it is called.
22716
22717         * class.cs, rootcontext.cs : Update accordingly.
22718
22719         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22720         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22721
22722         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22723
22724         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22725         of a fieldinfo using the above, when dealing with a FieldBuilder.
22726
22727 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22728
22729         * ../errors/cs0031.cs : Add.
22730
22731         * ../errors/cs1008.cs : Add.
22732
22733         * ../errrors/cs0543.cs : Add.
22734
22735         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22736         enum type.
22737
22738         (FindMembers): Implement.
22739
22740         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22741         enums and delegates too.
22742
22743         (enum_types): Rename to builder_to_enum.
22744
22745         (delegate_types): Rename to builder_to_delegate.
22746
22747         * delegate.cs (FindMembers): Implement.
22748
22749 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22750
22751         * typemanager.cs (IsEnumType): Implement.
22752
22753         * enum.cs (Emit): Re-write parts to account for the underlying type
22754         better and perform checking etc.
22755
22756         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22757         of the underlying type.
22758
22759         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22760         value
22761
22762         * enum.cs (error31): Helper to report error #31.
22763
22764         * cs-parser.jay (enum_declaration): Store location of each member too.
22765
22766         * enum.cs (member_to_location): New hashtable. 
22767
22768         (AddEnumMember): Update location hashtable.
22769
22770         (Emit): Use the location of each member while reporting errors.
22771
22772 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22773
22774         * cs-parser.jay: A for_initializer if is a
22775         local_variable_declaration really ammount to have an implicit
22776         block with the variable declaration and no initializer for for.
22777
22778         * statement.cs (For.Emit): Cope with null initializers.
22779
22780         This fixes the infinite loop on for initializers.
22781
22782 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22783
22784         * enum.cs: More cleanup.
22785
22786         * ecore.cs: Remove dead code.
22787
22788         * class.cs (Property.Emit): More simplification.
22789         (Event.Emit): ditto.
22790
22791         Reworked to have less levels of indentation.
22792
22793 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22794
22795         * class.cs (Property): Emit attributes.
22796
22797         (Field): Ditto.
22798
22799         (Event): Ditto.
22800
22801         (Indexer): Ditto.
22802
22803         (Operator): Ditto.
22804
22805         * enum.cs (Emit): Ditto.
22806
22807         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22808         Enums too.
22809
22810         * class.cs (Field, Event, etc.): Move attribute generation into the
22811         Emit method everywhere.
22812
22813         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22814         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22815         as we had no way of defining nested enums !
22816
22817         * rootcontext.cs : Adjust code accordingly.
22818
22819         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22820
22821 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22822
22823         * expression.cs (EvalConstantExpression): Move into ecore.cs
22824
22825         * enum.cs (Enum): Rename some members and make them public and readonly
22826         according to our convention.
22827
22828         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22829         nothing else.
22830
22831         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22832
22833         (Enum::Emit): Write a simple version for now which doesn't try to compute
22834         expressions. I shall modify this to be more robust in just a while.
22835
22836         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22837
22838         (TypeContainer::CloseType): Create the Enum types too.
22839
22840         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22841
22842         * expression.cs (EvalConstantExpression): Get rid of completely.
22843
22844         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22845         user-defined values and other cases.
22846
22847         (IsValidEnumLiteral): Helper function.
22848
22849         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22850         out there in the case we had a literal FieldExpr.
22851
22852         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22853
22854         (Literalize): Revamp a bit to take two arguments.
22855
22856         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22857
22858 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22859
22860         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22861
22862         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22863
22864         (Resolve): Use the above to ensure we have proper initializers.
22865
22866 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22867
22868         * expression.cs (Expression::EvalConstantExpression): New method to 
22869         evaluate constant expressions.
22870
22871         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22872
22873 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22874
22875         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22876         in an array.
22877
22878         (Binary.ResolveOperator): Handle operator != (object a, object b)
22879         and operator == (object a, object b);
22880
22881         (Binary.DoNumericPromotions): Indicate whether the numeric
22882         promotion was possible.
22883
22884         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22885         Implement.  
22886
22887         Made the ArrayAccess implement interface IAssignMethod instead of
22888         IStackStore as the order in which arguments are passed reflects
22889         this.
22890
22891         * assign.cs: Instead of using expr.ExprClass to select the way of
22892         assinging, probe for the IStackStore/IAssignMethod interfaces.
22893
22894         * typemanager.cs: Load InitializeArray definition.
22895
22896         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22897         static data that can be used to initialize arrays. 
22898
22899 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22900
22901         * expression.cs: Handle operator== and operator!= for booleans.
22902
22903         (Conditioal.Reduce): Implement reducer for the ?: operator.
22904
22905         (Conditional.Resolve): Implement dead code elimination.
22906
22907         (Binary.Resolve): Catch string literals and return a new
22908         concatenated string.
22909
22910         (Unary.Reduce): Implement reduction of unary expressions.
22911
22912         * ecore.cs: Split out the expression core handling here.
22913
22914         (Expression.Reduce): New method used to perform constant folding
22915         and CSE.  This is needed to support constant-expressions. 
22916
22917         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22918         targets, and optimize for !x.
22919
22920 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22921
22922         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22923         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22924         set custom atttributes.
22925
22926         * literal.cs (Literal::GetValue): New abstract method to return the actual
22927         value of the literal, cast as an object.
22928
22929         (*Literal): Implement GetValue method.
22930
22931         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22932         expressions to the arraylist but objects of type Argument.
22933
22934         * class.cs (TypeContainer::Emit): Emit our attributes too.
22935
22936         (Method::Emit, Constructor::Emit): Ditto.
22937
22938         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22939         to be ignoring earlier.
22940
22941 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22942
22943         * attribute.cs (AttributeSection::Define): Implement to do the business
22944         of constructing a CustomAttributeBuilder.
22945
22946         (Attribute): New trivial class. Increases readability of code.  
22947
22948         * cs-parser.jay : Update accordingly.
22949
22950         (positional_argument_list, named_argument_list, named_argument): New rules
22951
22952         (attribute_arguments): Use the above so that we are more correct.
22953
22954 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22955
22956         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22957         to perform all checks for a method with a params parameter.
22958
22959         (Invocation::OverloadResolve): Update to use the above method and therefore
22960         cope correctly with params method invocations.
22961
22962         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22963         params too.
22964
22965         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22966         constructors in our parent too because we can't afford to miss out on 
22967         protected ones ;-)
22968
22969         * attribute.cs (AttributeSection): New name for the class Attribute
22970
22971         Other trivial changes to improve readability.
22972
22973         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22974         use the new class names.
22975
22976 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22977
22978         * class.cs (Method::Define): Complete definition for params types too
22979
22980         (Indexer::Define): Ditto.
22981
22982         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22983         Cope everywhere with a request for info about the array parameter.
22984
22985 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22986
22987         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22988
22989         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22990         local_variable_type to extract the string corresponding to the type.
22991
22992         (local_variable_type): Fixup the action to use the new helper method.
22993
22994         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22995         go.
22996
22997         * expression.cs : Clean out code which uses the above.
22998
22999 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23000
23001         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23002         and bale out if necessary by returning a false.
23003
23004         (RegisterProperty): Ditto.
23005
23006         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23007         and print out appropriate error messages.
23008
23009         * interface.cs (everywhere): Ditto.
23010
23011         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23012         location to constructor.
23013
23014         * class.cs (Property, Event, Indexer): Update accordingly.
23015
23016         * ../errors/cs111.cs : Added.
23017
23018         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23019         of a method, as laid down by the spec.
23020
23021         (Invocation::OverloadResolve): Use the above method.
23022
23023 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23024
23025         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23026         now take a TypeContainer and a Parameters object.
23027
23028         (ParameterData): Modify return type of ParameterModifier method to be 
23029         Parameter.Modifier and not a string.
23030
23031         (ReflectionParameters, InternalParameters): Update accordingly.
23032
23033         * expression.cs (Argument::GetParameterModifier): Same here.
23034
23035         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23036         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23037         symbol in it at all so maybe this is only for now.
23038
23039 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23040
23041         * support.cs (InternalParameters): Constructor now takes an extra argument 
23042         which is the actual Parameters class.
23043
23044         (ParameterDesc): Update to provide info on ref/out modifiers.
23045
23046         * class.cs (everywhere): Update call to InternalParameters to pass in
23047         the second argument too.
23048
23049         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23050         to return the modifier info [ref/out etc]
23051
23052         (InternalParameters, ReflectionParameters): Implement the above.
23053
23054         * expression.cs (Argument::ParameterModifier): Similar function to return
23055         info about the argument's modifiers.
23056
23057         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23058         too.
23059
23060         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23061         a new SetFormalParameters object which we pass to InternalParameters.
23062
23063 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23064
23065         * expression.cs (NewArray): Merge into the ArrayCreation class.
23066
23067 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23068
23069         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23070         NewUserdefinedArray into one as there wasn't much of a use in having
23071         two separate ones.
23072
23073         * expression.cs (Argument): Change field's name to ArgType from Type.
23074
23075         (Type): New readonly property which returns the proper type, taking into 
23076         account ref/out modifiers.
23077
23078         (everywhere): Adjust code accordingly for the above.
23079
23080         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23081         whether we are emitting for a ref or out parameter.
23082
23083         * expression.cs (Argument::Emit): Use the above field to set the state.
23084
23085         (LocalVariableReference::Emit): Update to honour the flag and emit the
23086         right stuff.
23087
23088         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23089
23090         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23091
23092         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23093
23094         (ReflectionParameters, InternalParameters): Implement the above method.
23095
23096         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23097         reporting errors.
23098
23099         (Invocation::FullMethodDesc): Ditto. 
23100
23101 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23102
23103         * cs-parser.jay: Add extra production for the second form of array
23104         creation. 
23105
23106         * expression.cs (ArrayCreation): Update to reflect the above
23107         change. 
23108
23109         * Small changes to prepare for Array initialization.
23110
23111 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * typemanager.cs (ImplementsInterface): interface might be null;
23114         Deal with this problem;
23115
23116         Also, we do store negative hits on the cache (null values), so use
23117         this instead of calling t.GetInterfaces on the type everytime.
23118
23119 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23120
23121         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23122
23123         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23124         split functionality out into different classes.
23125
23126         (New::FormArrayType): Move into NewBuiltinArray.
23127
23128         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23129         quite useless.
23130
23131         (NewBuiltinArray): New class to handle creation of built-in arrays.
23132
23133         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23134         account creation of one-dimensional arrays.
23135
23136         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23137
23138         (NewUserdefinedArray::DoResolve): Implement.
23139
23140         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23141
23142         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23143         we maintain inside the TypeManager. This is necessary to perform lookups on the
23144         module builder.
23145
23146         (LookupType): Update to perform GetType on the module builders too.     
23147
23148         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23149
23150         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23151
23152 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23153
23154         * expression.cs (New::DoResolve): Implement guts of array creation.
23155
23156         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23157
23158 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23159
23160         * expression.cs: Fix bug I introduced lsat night that broke
23161         Delegates. 
23162
23163         (Expression.Resolve): Report a 246 error (can not resolve name)
23164         if we find a SimpleName in the stream.
23165
23166         (Expression.ResolveLValue): Ditto.
23167
23168         (Expression.ResolveWithSimpleName): This function is a variant of
23169         ResolveName, this one allows SimpleNames to be returned without a
23170         warning.  The only consumer of SimpleNames is MemberAccess
23171
23172 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23173
23174         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23175         might arrive here.  I have my doubts that this is correct.
23176
23177         * statement.cs (Lock): Implement lock statement.
23178
23179         * cs-parser.jay: Small fixes to support `lock' and `using'
23180
23181         * cs-tokenizer.cs: Remove extra space
23182
23183         * driver.cs: New flag --checked, allows to turn on integer math
23184         checking. 
23185
23186         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23187         Threading.Monitor.Exit 
23188
23189 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23190
23191         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23192         Expression Class to be IndexerAccess.
23193
23194         Notice that Indexer::DoResolve sets the eclass to Value.
23195
23196 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23197
23198         * class.cs (TypeContainer::Emit): Emit code for indexers.
23199
23200         * assign.cs (IAssignMethod): New interface implemented by Indexers
23201         and Properties for handling assignment.
23202
23203         (Assign::Emit): Simplify and reuse code. 
23204
23205         * expression.cs (IndexerAccess, PropertyExpr): Implement
23206         IAssignMethod, clean up old code. 
23207
23208 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23209
23210         * typemanager.cs (ImplementsInterface): New method to determine if a type
23211         implements a given interface. Provides a nice cache too.
23212
23213         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23214         method.
23215
23216         (ConvertReferenceExplicit): Ditto.
23217
23218         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23219         various methods, with correct names etc.
23220
23221         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23222         Operator.UnaryNegation.
23223
23224         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23225         we have a unary plus or minus operator.
23226
23227         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23228         UnaryMinus.
23229
23230         * everywhere : update accordingly.
23231
23232         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23233         respectively.
23234
23235         * class.cs (Method::Define): For the case where we are implementing a method
23236         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23237         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23238
23239 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23240
23241         * interface.cs (FindMembers): Implement to work around S.R.E
23242         lameness.
23243
23244         * typemanager.cs (IsInterfaceType): Implement.
23245
23246         (FindMembers): Update to handle interface types too.
23247
23248         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23249         use IsAssignableFrom as that is not correct - it doesn't work.
23250
23251         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23252         and accordingly override EmitStatement.
23253
23254         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23255         using the correct logic :-)
23256
23257 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23258
23259         * ../errors/cs-11.cs : Add to demonstrate error -11 
23260
23261 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23262
23263         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23264         then pass this as a hint to ResolveLValue.
23265
23266         * expression.cs (FieldExpr): Add Location information
23267
23268         (FieldExpr::LValueResolve): Report assignment to readonly
23269         variable. 
23270
23271         (Expression::ExprClassFromMemberInfo): Pass location information.
23272
23273         (Expression::ResolveLValue): Add new method that resolves an
23274         LValue. 
23275
23276         (Expression::DoResolveLValue): Default invocation calls
23277         DoResolve. 
23278
23279         (Indexers): New class used to keep track of indexers in a given
23280         Type. 
23281
23282         (IStackStore): Renamed from LValue, as it did not really describe
23283         what this did.  Also ResolveLValue is gone from this interface and
23284         now is part of Expression.
23285
23286         (ElementAccess): Depending on the element access type
23287
23288         * typemanager.cs: Add `indexer_name_type' as a Core type
23289         (System.Runtime.CompilerServices.IndexerNameAttribute)
23290
23291         * statement.cs (Goto): Take a location.
23292
23293 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23294
23295         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23296         if two delegates are compatible.
23297
23298         (NewDelegate::DoResolve): Update to take care of the case when
23299         we instantiate a delegate from another delegate.
23300
23301         * typemanager.cs (FindMembers): Don't even try to look up members
23302         of Delegate types for now.
23303
23304 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23305
23306         * delegate.cs (NewDelegate): New class to take care of delegate
23307         instantiation.
23308
23309         * expression.cs (New): Split the delegate related code out into 
23310         the NewDelegate class.
23311
23312         * delegate.cs (DelegateInvocation): New class to handle delegate 
23313         invocation.
23314
23315         * expression.cs (Invocation): Split out delegate related code into
23316         the DelegateInvocation class.
23317
23318 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23319
23320         * expression.cs (New::DoResolve): Implement delegate creation fully
23321         and according to the spec.
23322
23323         (New::DoEmit): Update to handle delegates differently.
23324
23325         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23326         because of which we were printing out arguments in reverse order !
23327
23328         * delegate.cs (VerifyMethod): Implement to check if the given method
23329         matches the delegate.
23330
23331         (FullDelegateDesc): Implement.
23332
23333         (VerifyApplicability): Implement.
23334
23335         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23336         delegate invocations too.
23337
23338         (Invocation::Emit): Ditto.
23339
23340         * ../errors/cs1593.cs : Added.
23341
23342         * ../errors/cs1594.cs : Added.
23343
23344         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23345
23346 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23347
23348         * typemanager.cs (intptr_type): Core type for System.IntPtr
23349
23350         (InitCoreTypes): Update for the same.
23351
23352         (iasyncresult_type, asynccallback_type): Ditto.
23353
23354         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23355         correct.
23356
23357         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23358         too.
23359
23360         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23361         the builders for the 4 members of a delegate type :-)
23362
23363         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23364         type.
23365
23366         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23367
23368         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23369
23370 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23371
23372         * statement.cs (Break::Emit): Implement.   
23373         (Continue::Emit): Implement.
23374
23375         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23376         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23377         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23378         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23379         end loop
23380
23381         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23382         properties that track the label for the current loop (begin of the
23383         loop and end of the loop).
23384
23385 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23386
23387         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23388         use of emitting anything at all.
23389
23390         * class.cs, rootcontext.cs : Get rid of calls to the same.
23391
23392         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23393
23394         (Populate): Define the constructor correctly and set the implementation
23395         attributes.
23396
23397         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23398         have been defined.
23399
23400         (AddDelegateType): Implement.
23401
23402         (IsDelegateType): Implement helper method.
23403
23404         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23405
23406         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23407         and accordingly handle it.
23408
23409         * delegate.cs (Populate): Take TypeContainer argument.
23410         Implement bits to define the Invoke method. However, I still haven't figured out
23411         how to take care of the native int bit :-(
23412
23413         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23414         Qualify the name of the delegate, not its return type !
23415
23416         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23417         conversion.
23418
23419         (StandardConversionExists): Checking for array types turns out to be recursive.
23420
23421         (ConvertReferenceExplicit): Implement array conversion.
23422
23423         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23424
23425 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23426
23427         * cs-parser.jay (delegate_declaration): Store the fully qualified
23428         name as it is a type declaration.
23429
23430         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23431         readonly.
23432
23433         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23434         as TypeContainer::DefineType.
23435
23436         (Populate): Method in which all the definition of the various methods (Invoke)
23437         etc is done.
23438
23439         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23440         see.
23441
23442         (CloseDelegate): Finally creates the delegate.
23443
23444         * class.cs (TypeContainer::DefineType): Update to define delegates.
23445         (Populate, Emit and CloseType): Do the same thing here too.
23446
23447         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23448         delegates in all these operations.
23449
23450 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23451
23452         * expression.cs: LocalTemporary: a new expression used to
23453         reference a temporary that has been created.
23454
23455         * assign.cs: Handle PropertyAccess back here, so that we can
23456         provide the proper semantic access to properties.
23457
23458         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23459         a few more explicit conversions. 
23460
23461         * modifiers.cs: `NEW' modifier maps to HideBySig.
23462
23463         * expression.cs (PropertyExpr): Make this into an
23464         ExpressionStatement, and support the EmitStatement code path. 
23465
23466         Perform get/set error checking, clean up the interface.
23467
23468         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23469         them into toplevel access objects.
23470
23471 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23472
23473         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23474         SRE.
23475
23476         * typemanager.cs: Keep track here of our PropertyBuilders again to
23477         work around lameness in SRE.
23478
23479 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23480
23481         * expression.cs (LValue::LValueResolve): New method in the
23482         interface, used to perform a second resolution pass for LValues. 
23483
23484         (This::DoResolve): Catch the use of this in static methods.
23485
23486         (This::LValueResolve): Implement.
23487
23488         (This::Store): Remove warning, assigning to `this' in structures
23489         is 
23490
23491         (Invocation::Emit): Deal with invocation of
23492         methods on value types.  We need to pass the address to structure
23493         methods rather than the object itself.  (The equivalent code to
23494         emit "this" for structures leaves the entire structure on the
23495         stack instead of a pointer to it). 
23496
23497         (ParameterReference::DoResolve): Compute the real index for the
23498         argument based on whether the method takes or not a `this' pointer
23499         (ie, the method is static).
23500
23501         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23502         value types returned from functions when we need to invoke a
23503         method on the sturcture.
23504
23505
23506 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23507
23508         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23509         defining the type in the Modulebuilder or Typebuilder. This is to take
23510         care of nested types which need to be defined on the TypeBuilder using
23511         DefineNestedMethod.
23512
23513         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23514         methods in RootContext, only ported to be part of TypeContainer.
23515
23516         (TypeContainer::GetInterfaceOrClass): Ditto.
23517
23518         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23519
23520         * interface.cs (Interface::DefineInterface): New method. Does exactly
23521         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23522         too.
23523
23524         (Interface::GetInterfaces): Move from RootContext here and port.
23525
23526         (Interface::GetInterfaceByName): Same here.
23527
23528         * rootcontext.cs (ResolveTree): Re-write.
23529
23530         (PopulateTypes): Re-write.
23531
23532         * class.cs (TypeContainer::Populate): Populate nested types too.
23533         (TypeContainer::Emit): Emit nested members too.
23534
23535         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23536         instead just use the name argument passed in as it is already fully
23537         qualified.
23538
23539         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23540         to TypeContainer mapping to see if a type is user-defined.
23541
23542         * class.cs (TypeContainer::CloseType): Implement. 
23543
23544         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23545         the default constructor.
23546
23547         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23548         twice.
23549
23550         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23551
23552         * interface.cs (CloseType): Create the type here.
23553
23554         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23555         the hierarchy.
23556
23557         Remove all the methods which are now in TypeContainer.
23558
23559 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23560
23561         * delegate.cs (Define): Re-write bits to define the delegate
23562         correctly.
23563
23564 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23565
23566         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23567
23568         * expression.cs (ImplicitReferenceConversion): handle null as well
23569         as a source to convert to any reference type.
23570
23571         * statement.cs (Return): Perform any implicit conversions to
23572         expected return type.  
23573
23574         Validate use of return statement.  
23575
23576         * codegen.cs (EmitContext): Pass the expected return type here.
23577
23578         * class.cs (Method, Constructor, Property): Pass expected return
23579         type to EmitContext.
23580
23581 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23582
23583         * expression.cs: Make DoResolve take an EmitContext instead of a
23584         TypeContainer.
23585
23586         Replaced `l' and `location' for `loc', for consistency.
23587
23588         (Error, Warning): Remove unneeded Tc argument.
23589
23590         * assign.cs, literal.cs, constant.cs: Update to new calling
23591         convention. 
23592
23593         * codegen.cs: EmitContext now contains a flag indicating whether
23594         code is being generated in a static method or not.
23595
23596         * cs-parser.jay: DecomposeQI, new function that replaces the old
23597         QualifiedIdentifier.  Now we always decompose the assembled
23598         strings from qualified_identifier productions into a group of
23599         memberaccesses.
23600
23601 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23602
23603         * rootcontext.cs: Deal with field-less struct types correctly now
23604         by passing the size option to Define Type.
23605
23606         * class.cs: Removed hack that created one static field. 
23607
23608 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23609
23610         * statement.cs: Moved most of the code generation here. 
23611
23612 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23613
23614         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23615         seem very right.
23616
23617         (ElementAccess): Remove useless bits for now - keep checks as the spec
23618         says.
23619
23620 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23621
23622         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23623         and start performing checks according to the spec.
23624
23625 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23626
23627         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23628         rank_specifiers instead.
23629
23630         (rank_specifiers): Change the order in which the rank specifiers are stored
23631
23632         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23633
23634         * expression.cs (ElementAccess): Implement the LValue interface too.
23635
23636 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23637
23638         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23639         except that user defined conversions are not included.
23640
23641         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23642         perform the conversion of the return type, if necessary.
23643
23644         (New::DoResolve): Check whether we are creating an array or an object
23645         and accordingly do the needful.
23646
23647         (New::Emit): Same here.
23648
23649         (New::DoResolve): Implement guts of array creation.
23650
23651         (New::FormLookupType): Helper function.
23652
23653 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23654
23655         * codegen.cs: Removed most of the code generation here, and move the
23656         corresponding code generation bits to the statement classes. 
23657
23658         Added support for try/catch/finalize and throw.
23659
23660         * cs-parser.jay: Added support for try/catch/finalize.
23661
23662         * class.cs: Catch static methods having the flags override,
23663         virtual or abstract.
23664
23665         * expression.cs (UserCast): This user cast was not really doing
23666         what it was supposed to do.  Which is to be born in fully resolved
23667         state.  Parts of the resolution were being performed at Emit time! 
23668
23669         Fixed this code.
23670
23671 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23672
23673         * expression.cs: Implicity convert the result from UserCast.
23674
23675 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23676
23677         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23678         prevented it from working correctly. 
23679
23680         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23681         merely ConvertImplicit.
23682
23683 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23684
23685         * typemanager.cs: Make the LookupTypeContainer function static,
23686         and not per-instance.  
23687
23688         * class.cs: Make static FindMembers (the one that takes a Type
23689         argument). 
23690
23691         * codegen.cs: Add EmitForeach here.
23692
23693         * cs-parser.jay: Make foreach a toplevel object instead of the
23694         inline expansion, as we need to perform semantic analysis on it. 
23695
23696 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23697
23698         * expression.cs (Expression::ImplicitUserConversion): Rename to
23699         UserDefinedConversion.
23700
23701         (Expression::UserDefinedConversion): Take an extra argument specifying 
23702         whether we look for explicit user conversions too.
23703
23704         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23705
23706         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23707
23708         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23709         with the appropriate arguments.
23710
23711         * cs-parser.jay (cast_expression): Record location too.
23712
23713         * expression.cs (Cast): Record location info.
23714
23715         (Expression::ConvertExplicit): Take location argument.
23716
23717         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23718         to determine if we are doing explicit conversions.
23719
23720         (UserCast::Emit): Update accordingly.
23721
23722         (Expression::ConvertExplicit): Report an error if everything fails.
23723
23724         * ../errors/cs0030.cs : Add.
23725
23726 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23727
23728         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23729         virtual and newslot bits. 
23730
23731         * class.cs (TypeContainer::RegisterRequiredImplementations):
23732         Record methods we need.
23733
23734         (TypeContainer::MakeKey): Helper function to make keys for
23735         MethodBases, since the Methodbase key is useless.
23736
23737         (TypeContainer::Populate): Call RegisterRequiredImplementations
23738         before defining the methods.   
23739
23740         Create a mapping for method_builders_to_methods ahead of time
23741         instead of inside a tight loop.
23742
23743         (::RequireMethods):  Accept an object as the data to set into the
23744         hashtable so we can report interface vs abstract method mismatch.
23745
23746 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23747
23748         * report.cs: Make all of it static.
23749
23750         * rootcontext.cs: Drop object_type and value_type computations, as
23751         we have those in the TypeManager anyways.
23752
23753         Drop report instance variable too, now it is a global.
23754
23755         * driver.cs: Use try/catch on command line handling.
23756
23757         Add --probe option to debug the error reporting system with a test
23758         suite. 
23759
23760         * report.cs: Add support for exiting program when a probe
23761         condition is reached.
23762
23763 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23764
23765         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23766         we do a forcible conversion regardless of type, to check if 
23767         ForceConversion returns a null.
23768
23769         (Binary::error19): Use location to report error.
23770
23771         (Unary::error23): Use location here too.
23772
23773         * ../errors/cs0019.cs : Check in.
23774
23775         * ../errors/cs0023.cs : Check in.
23776
23777         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23778         case of a non-null MethodInfo object with a length of 0 !
23779
23780         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23781         an applicable member - according to the spec :-)
23782         Also fix logic to find members in base types.
23783
23784         (Unary::ResolveOperator): Same here.
23785
23786         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23787         as I was getting thoroughly confused between this and error19 :-)
23788
23789         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23790         (::FindMostEncompassedType): Implement.
23791         (::FindMostEncompassingType): Implement.
23792         (::StandardConversionExists): Implement.
23793
23794         (UserImplicitCast): Re-vamp. We now need info about most specific
23795         source and target types so that we can do the necessary conversions.
23796
23797         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23798         mathematical union with no duplicates.
23799
23800 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23801
23802         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23803         in order from base classes to child classes, so that we can in
23804         child classes look up in our parent for method names and
23805         attributes (required for handling abstract, virtual, new, override
23806         constructs: we need to instrospect our base class, and if we dont
23807         populate the classes in order, the introspection might be
23808         incorrect.  For example, a method could query its parent before
23809         the parent has any methods and would determine that the parent has
23810         no abstract methods (while it could have had them)).
23811
23812         (RootContext::CreateType): Record the order in which we define the
23813         classes.
23814
23815 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23816
23817         * class.cs (TypeContainer::Populate): Also method definitions can
23818         fail now, keep track of this.
23819
23820         (TypeContainer::FindMembers): Implement support for
23821         DeclaredOnly/noDeclaredOnly flag.
23822
23823         (Constructor::Emit) Return the ConstructorBuilder.
23824
23825         (Method::Emit) Return the MethodBuilder. 
23826         Check for abstract or virtual methods to be public.
23827
23828         * rootcontext.cs (RootContext::CreateType): Register all the
23829         abstract methods required for the class to be complete and the
23830         interface methods that must be implemented. 
23831
23832         * cs-parser.jay: Report error 501 (method requires body if it is
23833         not marked abstract or extern).
23834
23835         * expression.cs (TypeOf::Emit): Implement.
23836
23837         * typemanager.cs: runtime_handle_type, new global type.
23838
23839         * class.cs (Property::Emit): Generate code for properties.
23840
23841 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23842
23843         * expression.cs (Unary::ResolveOperator): Find operators on base type
23844         too - we now conform exactly to the spec.
23845
23846         (Binary::ResolveOperator): Same here.
23847
23848         * class.cs (Operator::Define): Fix minor quirk in the tests.
23849
23850         * ../errors/cs0215.cs : Added.
23851
23852         * ../errors/cs0556.cs : Added.
23853
23854         * ../errors/cs0555.cs : Added.
23855
23856 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23857
23858         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23859         single integer which is really efficient
23860
23861 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23862
23863         *  expression.cs (Expression::ImplicitUserConversion): Use location
23864         even in the case when we are examining True operators.
23865  
23866         * class.cs (Operator::Define): Perform extensive checks to conform
23867         with the rules for operator overloading in the spec.
23868
23869         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23870         some of the other conversions mentioned in the spec.
23871
23872         * typemanager.cs (array_type): New static member for the System.Array built-in
23873         type.
23874
23875         (cloneable_interface): For System.ICloneable interface.
23876
23877         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23878         we start resolving the tree and populating types.
23879
23880         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23881  
23882 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23883
23884         * expression.cs (Expression::ExprClassFromMemberInfo,
23885         Expression::Literalize): Create literal expressions from
23886         FieldInfos which are literals.
23887
23888         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23889         type casts, because they were wrong.  The test suite in tests
23890         caught these ones.
23891
23892         (ImplicitNumericConversion): ushort to ulong requires a widening
23893         cast. 
23894
23895         Int32 constant to long requires widening cast as well.
23896
23897         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23898         for integers because the type on the stack is not i4.
23899
23900 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23901
23902         * expression.cs (report118): require location argument. 
23903
23904         * parameter.cs: Do not dereference potential null value.
23905
23906         * class.cs: Catch methods that lack the `new' keyword when
23907         overriding a name.  Report warnings when `new' is used without
23908         anything being there to override.
23909
23910         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23911
23912         * class.cs: Only add constructor to hashtable if it is non-null
23913         (as now constructors can fail on define).
23914
23915         (TypeManager, Class, Struct): Take location arguments.
23916
23917         Catch field instance initialization in structs as errors.
23918
23919         accepting_filter: a new filter for FindMembers that is static so
23920         that we dont create an instance per invocation.
23921
23922         (Constructor::Define): Catch errors where a struct constructor is
23923         parameterless 
23924
23925         * cs-parser.jay: Pass location information for various new
23926         constructs. 
23927
23928         * delegate.cs (Delegate): take a location argument.
23929
23930         * driver.cs: Do not call EmitCode if there were problesm in the
23931         Definition of the types, as many Builders wont be there. 
23932
23933         * decl.cs (Decl::Decl): Require a location argument.
23934
23935         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23936         into integers, and find the most appropiate integer for it.
23937
23938         * literal.cs: Implement ULongLiteral.
23939
23940         * rootcontext.cs: Provide better information about the location of
23941         failure when CreateType fails.
23942
23943 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23944
23945         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23946         as well.
23947
23948         * expression.cs (Binary::CheckShiftArguments): Add missing type
23949         computation.
23950         (Binary::ResolveOperator): Add type to the logical and and logical
23951         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23952         before.
23953
23954         (Binary::DoNumericPromotions): In the case where either argument
23955         is ulong (and most signed types combined with ulong cause an
23956         error) perform implicit integer constant conversions as well.
23957
23958 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23959
23960         * expression.cs (UserImplicitCast): Method should always be
23961         non-null. 
23962         (Invocation::BetterConversion): Simplified test for IntLiteral.
23963
23964         (Expression::ImplicitNumericConversion): Split this routine out.
23965         Put the code that performs implicit constant integer conversions
23966         here. 
23967
23968         (Expression::Resolve): Become a wrapper around DoResolve so we can
23969         check eclass and type being set after resolve.
23970
23971         (Invocation::Badness): Remove this dead function
23972
23973         (Binary::ResolveOperator): Do not compute the expensive argumnets
23974         unless we have a union for it.
23975
23976         (Probe::Emit): Is needs to do an isinst and then
23977         compare against null.
23978
23979         (::CanConvert): Added Location argument.  If the Location argument
23980         is null (Location.Null), then we do not report errors.  This is
23981         used by the `probe' mechanism of the Explicit conversion.  We do
23982         not want to generate an error for something that the user
23983         explicitly requested to be casted.  But the pipeline for an
23984         explicit cast first tests for potential implicit casts.
23985
23986         So for now, if the Location is null, it means `Probe only' to
23987         avoid adding another argument.   Might have to revise this
23988         strategy later.
23989
23990         (ClassCast): New class used to type cast objects into arbitrary
23991         classes (used in Explicit Reference Conversions).
23992
23993         Implement `as' as well.
23994
23995         Reverted all the patches from Ravi below: they were broken:
23996
23997                 * The use of `level' as a mechanism to stop recursive
23998                   invocations is wrong.  That was there just to catch the
23999                   bug with a strack trace but not as a way of addressing
24000                   the problem.
24001
24002                   To fix the problem we have to *understand* what is going
24003                   on and the interactions and come up with a plan, not
24004                   just get things going.
24005
24006                 * The use of the type conversion cache that I proposed
24007                   last night had an open topic: How does this work across
24008                   protection domains.  A user defined conversion might not
24009                   be public in the location where we are applying the
24010                   conversion, a different conversion might be selected
24011                   (ie, private A->B (better) but public B->A (worse),
24012                   inside A, A->B applies, but outside it, B->A will
24013                   apply).
24014
24015                 * On top of that (ie, even if the above is solved),
24016                   conversions in a cache need to be abstract.  Ie, `To
24017                   convert from an Int to a Short use an OpcodeCast', not
24018                   `To convert from an Int to a Short use the OpcodeCast on
24019                   the variable 5' (which is what this patch was doing).
24020
24021 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24022
24023         * expression.cs (Invocation::ConversionExists): Re-write to use
24024         the conversion cache
24025
24026         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24027         cache all conversions done, not just user-defined ones.
24028
24029         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24030         to determine if a conversion exists instead of acutually trying to 
24031         perform the conversion. It's faster too.
24032
24033         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24034         and only then attempt the implicit conversion.
24035
24036 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24037
24038         * expression.cs (ConvertImplicit): Use a cache for conversions
24039         already found. Check level of recursion and bail out if necessary.
24040
24041 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24042
24043         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24044         Export standard methods that we expect for string operations.
24045
24046         * statement.cs (Block::UsageWarning): Track usage of variables and
24047         report the errors for not used variables.
24048
24049         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24050         operator. 
24051
24052 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24053
24054         * codegen.cs: remove unnneded code 
24055
24056         * expression.cs: Removed BuiltinTypeAccess class
24057
24058         Fix the order in which implicit conversions are
24059         done.  
24060
24061         The previous fixed dropped support for boxed conversions (adding a
24062         test to the test suite now)
24063
24064         (UserImplicitCast::CanConvert): Remove test for source being null,
24065         that code is broken.  We should not feed a null to begin with, if
24066         we do, then we should track the bug where the problem originates
24067         and not try to cover it up here.
24068
24069         Return a resolved expression of type UserImplicitCast on success
24070         rather than true/false.  Ravi: this is what I was talking about,
24071         the pattern is to use a static method as a "constructor" for
24072         objects. 
24073
24074         Also, do not create arguments until the very last minute,
24075         otherwise we always create the arguments even for lookups that
24076         will never be performed. 
24077
24078         (UserImplicitCast::Resolve): Eliminate, objects of type
24079         UserImplicitCast are born in a fully resolved state. 
24080
24081         * typemanager.cs (InitCoreTypes): Init also value_type
24082         (System.ValueType). 
24083
24084         * expression.cs (Cast::Resolve): First resolve the child expression.
24085
24086         (LValue): Add new method AddressOf to be used by
24087         the `&' operator.  
24088
24089         Change the argument of Store to take an EmitContext instead of an
24090         ILGenerator, because things like FieldExpr need to be able to call
24091         their children expression to generate the instance code. 
24092
24093         (Expression::Error, Expression::Warning): Sugar functions for
24094         reporting errors.
24095
24096         (Expression::MemberLookup): Accept a TypeContainer instead of a
24097         Report as the first argument.
24098
24099         (Expression::ResolvePrimary): Killed.  I still want to improve
24100         this as currently the code is just not right.
24101
24102         (Expression::ResolveMemberAccess): Simplify, but it is still
24103         wrong. 
24104
24105         (Unary::Resolve): Catch errors in AddressOf operators.
24106
24107         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24108         index to a byte for the short-version, or the compiler will choose
24109         the wrong Emit call, which generates the wrong data.
24110
24111         (ParameterReference::Emit, ::Store): same.
24112
24113         (FieldExpr::AddressOf): Implement.
24114
24115         * typemanager.cs: TypeManager: made public variable instead of
24116         property.
24117
24118         * driver.cs: document --fatal.
24119
24120         * report.cs (ErrorMessage, WarningMessage): new names for the old
24121         Error and Warning classes.
24122
24123         * cs-parser.jay (member_access): Turn built-in access to types
24124         into a normal simplename
24125
24126 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24127
24128         * expression.cs (Invocation::BetterConversion): Fix to cope
24129         with q being null, since this was introducing a bug.
24130
24131         * expression.cs (ConvertImplicit): Do built-in conversions first.
24132
24133 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24134
24135         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24136
24137 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24138
24139         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24140         I had introduced long ago (what's new ?).
24141
24142         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24143         the work of all the checking. 
24144         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24145         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24146
24147         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24148         that is the right way. 
24149
24150         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24151         overloading resolution. Use everywhere instead of cutting and pasting code.
24152
24153         (Binary::ResolveOperator): Use MakeUnionSet.
24154
24155         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24156         we have to convert to bool types. Not complete yet.
24157
24158 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24159
24160         * typemanager.cs (TypeManager::CSharpName): support ushort.
24161
24162         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24163         to provide an expression that performsn an implicit constant int
24164         conversion (section 6.1.6).
24165         (Expression::ConvertImplicitRequired): Reworked to include
24166         implicit constant expression conversions.
24167
24168         (Expression::ConvertNumericExplicit): Finished.
24169
24170         (Invocation::Emit): If InstanceExpression is null, then it means
24171         that we perform a call on this.
24172
24173 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24174
24175         * expression.cs (Unary::Emit): Remove some dead code.
24176         (Probe): Implement Resolve and Emit for `is'.
24177         (Expression::ConvertImplicitRequired): Attempt to do constant
24178         expression conversions here.  Maybe should be moved to
24179         ConvertImplicit, but I am not sure.
24180         (Expression::ImplicitLongConstantConversionPossible,
24181         Expression::ImplicitIntConstantConversionPossible): New functions
24182         that tell whether is it possible to apply an implicit constant
24183         expression conversion.
24184
24185         (ConvertNumericExplicit): Started work on explicit numeric
24186         conversions.
24187
24188         * cs-parser.jay: Update operator constants.
24189
24190         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24191         (Parameters::GetSignature): Hook up VerifyArgs here.
24192         (Parameters::VerifyArgs): Verifies that no two arguments have the
24193         same name. 
24194
24195         * class.cs (Operator): Update the operator names to reflect the
24196         ones that the spec expects (as we are just stringizing the
24197         operator names).
24198
24199         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24200         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24201         previous usage did only work for our methods.
24202         (Expression::ConvertImplicit): Handle decimal implicit numeric
24203         conversions as well.
24204         (Expression::InternalTypeConstructor): Used to invoke constructors
24205         on internal types for default promotions.
24206
24207         (Unary::Emit): Implement special handling for the pre/post
24208         increment/decrement for overloaded operators, as they need to have
24209         the same semantics as the other operators.
24210
24211         (Binary::ResolveOperator): ditto.
24212         (Invocation::ConversionExists): ditto.
24213         (UserImplicitCast::Resolve): ditto.
24214
24215 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24216
24217         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24218         operator, return after emitting body. Regression tests pass again !
24219
24220         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24221         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24222         (Invocation::OverloadResolve): Ditto.
24223         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24224
24225         * everywhere : update calls to the above methods accordingly.
24226
24227 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24228
24229         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24230
24231         * expression.cs (ExpressionStatement): New base class used for
24232         expressions that can appear in statements, so that we can provide
24233         an alternate path to generate expression that do not leave a value
24234         on the stack.
24235
24236         (Expression::Emit, and all the derivatives): We no longer return
24237         whether a value is left on the stack or not.  Every expression
24238         after being emitted leaves a single value on the stack.
24239
24240         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24241         facilties of ExpressionStatement if possible.
24242
24243         * cs-parser.jay: Update statement_expression.
24244
24245 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24246
24247         * driver.cs: Change the wording of message
24248
24249 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24250
24251         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24252         the type of the expression to the return type of the method if
24253         we have an overloaded operator match ! The regression tests pass again !
24254         (Unary::ResolveOperator): Ditto.
24255
24256         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24257         to find "op_Implicit", not "implicit" ;-)
24258         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24259         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24260
24261         * everywhere : Correct calls to the above accordingly.
24262
24263         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24264         (ConvertImplicit): Do user-defined conversion if it exists.
24265
24266 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24267
24268         * assign.cs: track location.
24269         (Resolve): Use implicit conversions on assignment.
24270
24271         * literal.cs: Oops.  Not good, Emit of short access values should
24272         pass (Bytes) or the wrong argument will be selected.
24273
24274         * expression.cs (Unary::Emit): Emit code for -expr.
24275
24276         (Unary::ResolveOperator): Handle `Substract' for non-constants
24277         (substract from zero from the non-constants).
24278         Deal with Doubles as well. 
24279
24280         (Expression::ConvertImplicitRequired): New routine that reports an
24281         error if no implicit conversion exists. 
24282
24283         (Invocation::OverloadResolve): Store the converted implicit
24284         expressions if we make them
24285
24286 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24287
24288         * class.cs (ConstructorInitializer): Take a Location argument.
24289         (ConstructorBaseInitializer): Same here.
24290         (ConstructorThisInitializer): Same here.
24291
24292         * cs-parser.jay : Update all calls accordingly.
24293
24294         * expression.cs (Unary, Binary, New): Take location argument.
24295         Update accordingly everywhere.
24296
24297         * cs-parser.jay : Update all calls to the above to take a location
24298         argument.
24299
24300         * class.cs : Ditto.
24301
24302 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24303
24304         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24305         (Invocation::BetterConversion): Same here
24306         (Invocation::ConversionExists): Ditto.
24307
24308         (Invocation::ConversionExists): Implement.
24309
24310 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24311
24312         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24313         Also take an additional TypeContainer argument.
24314
24315         * All over : Pass in TypeContainer as argument to OverloadResolve.
24316
24317         * typemanager.cs (CSharpName): Update to check for the string type and return
24318         that too.
24319
24320         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24321         a given method.
24322
24323 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24324
24325         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24326         (Invocation::BetterFunction): Implement.
24327         (Invocation::BetterConversion): Implement.
24328         (Invocation::ConversionExists): Skeleton, no implementation yet.
24329
24330         Okay, things work fine !
24331
24332 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24333
24334         * typemanager.cs: declare and load enum_type, delegate_type and
24335         void_type. 
24336
24337         * expression.cs (Expression::Emit): Now emit returns a value that
24338         tells whether a value is left on the stack or not.  This strategy
24339         might be reveted tomorrow with a mechanism that would address
24340         multiple assignments.
24341         (Expression::report118): Utility routine to report mismatches on
24342         the ExprClass.
24343
24344         (Unary::Report23): Report impossible type/operator combination
24345         utility function.
24346
24347         (Unary::IsIncrementableNumber): Whether the type can be
24348         incremented or decremented with add.
24349         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24350         complemented. 
24351         (Unary::ResolveOperator): Implement ++, !, ~,
24352
24353         (Invocation::Emit): Deal with new Emit convetion.
24354
24355         * All Expression derivatives: Updated their Emit method to return
24356         whether they leave values on the stack or not.
24357
24358         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24359         stack for expressions that are statements. 
24360
24361 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24362
24363         * expression.cs (LValue): New interface.  Must be implemented by
24364         LValue objects.
24365         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24366         LValue interface.
24367
24368         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24369         interface for generating code, simplifies the code.
24370
24371 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24372
24373         * expression.cs (everywhere): Comment out return statements in ::Resolve
24374         methods to avoid the warnings.
24375
24376 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24377
24378         * driver.cs (parse): Report error 2001 if we can not open the
24379         source file.
24380
24381         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24382         not resolve it.
24383
24384         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24385         object. 
24386
24387         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24388         otherwise nested blocks end up with the same index.
24389
24390         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24391
24392         * expression.cs:  Instead of having FIXMEs in the Resolve
24393         functions, throw exceptions so it is obvious that we are facing a
24394         bug. 
24395
24396         * cs-parser.jay (invocation_expression): Pass Location information.
24397
24398         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24399         Use a basename for those routines because .NET does not like paths
24400         on them. 
24401
24402         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24403         already defined.
24404
24405 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24406
24407         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24408         are loading the correct data types (throws an exception if not).
24409         (TypeManager::InitCoreTypes): Use CoreLookupType
24410
24411         * expression.cs (Unary::ResolveOperator): return the child
24412         expression for expressions which are just +expr.
24413         (Unary::ResolveOperator): Return negative literals for -LITERAL
24414         expressions (otherwise they are Unary {Literal}).
24415         (Invocation::Badness): Take into account `Implicit constant
24416         expression conversions'.
24417
24418         * literal.cs (LongLiteral): Implement long literal class.
24419         (IntLiteral): export the `Value' of the intliteral. 
24420
24421 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24422
24423         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24424
24425         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24426         instead of 'Operator'
24427
24428         * expression.cs (Binary::ResolveOperator): Update accordingly.
24429         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24430         and 'Minus'
24431
24432         * cs-parser.jay (unary_expression): Update to use the new names.
24433
24434         * gen-treedump.cs (GetUnary): Same here.
24435
24436         * expression.cs (Unary::Resolve): Implement.
24437         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24438         operators are found instead of making noise ;-)
24439         (Unary::ResolveOperator): New method to do precisely the same thing which
24440         Binary::ResolveOperator does for Binary expressions.
24441         (Unary.method, .Arguments): Add.
24442         (Unary::OperName): Implement.   
24443         (Unary::ForceConversion): Copy and Paste !
24444
24445         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24446         a unary operator.
24447
24448         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24449         for the inbuilt operators. Only overloading works for now ;-)
24450
24451 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24452
24453         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24454         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24455
24456         * expression.cs (This::Emit): Implement. 
24457         (This::Resolve): Implement.
24458         (TypeOf:Resolve): Implement.
24459         (Expression::ResolveSimpleName): Add an implicit this to instance
24460         field references. 
24461         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24462         Bind instance variable to Field expressions.
24463         (FieldExpr::Instance): New field used to track the expression that
24464         represents the object instance.
24465         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24466         binding 
24467         (FieldExpr::Emit): Implement.
24468
24469         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24470         the last instruction contains a return opcode to avoid generating
24471         the last `ret' instruction (this generates correct code, and it is
24472         nice to pass the peverify output).
24473
24474         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24475         initializer for static and instance variables.
24476         (Constructor::Emit): Allow initializer to be null in the case of
24477         static constructors.  Only emit initializer for instance
24478         constructors. 
24479
24480         (TypeContainer::FindMembers): Return a null array if there are no
24481         matches.
24482
24483         Also fix the code for the MemberTypes.Method branch, as it was not
24484         scanning that for operators (or tried to access null variables before).
24485
24486         * assign.cs (Assign::Emit): Handle instance and static fields. 
24487
24488         * TODO: Updated.
24489
24490         * driver.cs: Stop compilation if there are parse errors.
24491
24492         * cs-parser.jay (constructor_declaration): Provide default base
24493         initializer for non-static constructors.
24494         (constructor_declarator): Do not provide a default base
24495         initializers if none was specified.
24496         Catch the fact that constructors should not have parameters.
24497
24498         * class.cs: Do not emit parent class initializers for static
24499         constructors, that should be flagged as an error.
24500
24501 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24502
24503         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24504         Move back code into TypeContainer::Populate.
24505
24506 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24507
24508         * class.cs (TypeContainer::AddConstructor): Fix the check to
24509         compare against Name, not Basename. 
24510         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24511
24512         * cs-parser.jay : Update accordingly.
24513
24514         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24515         for methods, don't forget to look into the operators too.
24516         (RegisterMethodBuilder): Helper method to take care of this for
24517         methods, constructors and operators.
24518         (Operator::Define): Completely revamp.
24519         (Operator.OperatorMethod, MethodName): New fields.
24520         (TypeContainer::Populate): Move the registering of builders into
24521         RegisterMethodBuilder.
24522         (Operator::Emit): Re-write.
24523
24524         * expression.cs (Binary::Emit): Comment out code path to emit method
24525         invocation stuff for the case when we have a user defined operator. I am
24526         just not able to get it right !
24527
24528 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24529
24530         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24531         argument. 
24532
24533         (Expression::MemberLookup): Provide a version that allows to
24534         specify the MemberTypes and BindingFlags. 
24535
24536         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24537         so it was not fetching variable information from outer blocks.
24538
24539         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24540         Beforefieldinit as it was buggy.
24541
24542         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24543         that Ravi put here.  
24544
24545         * class.cs (Constructor::Emit): Only emit if block is not null.
24546         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24547         deal with this by semantically definining it as if the user had
24548         done it.
24549
24550         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24551         constructors as we now "emit" them at a higher level.
24552
24553         (TypeContainer::DefineDefaultConstructor): Used to define the
24554         default constructors if none was provided.
24555
24556         (ConstructorInitializer): Add methods Resolve and Emit. 
24557
24558         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24559
24560 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24561
24562         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24563         the default constructor builder with our hashtable for methodbuilders
24564         to methodcores.
24565
24566         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24567         and argument_count is 0 in which case we have a match.
24568         (Binary::ResolveOperator): More null checking and miscellaneous coding
24569         style cleanup.
24570
24571 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24572
24573         * rootcontext.cs (IsNameSpace): Compare against null.
24574
24575         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24576
24577         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24578         and Unary::Operator.
24579
24580         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24581         accordingly.
24582
24583         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24584         we have overloaded operators.
24585         (Binary::ResolveOperator): Implement the part which does the operator overload
24586         resolution.
24587
24588         * class.cs (Operator::Emit): Implement.
24589         (TypeContainer::Emit): Emit the operators we have too.
24590
24591         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24592         the case when we have a user-defined operator.
24593
24594 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24595
24596         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24597
24598 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24599
24600         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24601         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24602         (Constructor::Emit): Implement.
24603         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24604         if we have no work to do. 
24605         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24606         Emit method.
24607
24608         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24609         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24610
24611         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24612         of parent.parent.
24613
24614 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24615
24616         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24617         in the source.
24618         (Tree::RecordNamespace): Method to do what the name says ;-)
24619         (Tree::Namespaces): Property to get at the namespaces hashtable.
24620
24621         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24622         keep track.
24623
24624         * rootcontext.cs (IsNamespace): Fixed it :-)
24625
24626 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24627
24628         * class.cs (TypeContainer::FindMembers): Add support for
24629         constructors. 
24630         (MethodCore): New class that encapsulates both the shared aspects
24631         of a Constructor and a Method.  
24632         (Method, Constructor): Factored pieces into MethodCore.
24633
24634         * driver.cs: Added --fatal which makes errors throw exceptions.
24635         Load System assembly as well as part of the standard library.
24636
24637         * report.cs: Allow throwing exceptions on errors for debugging.
24638
24639         * modifiers.cs: Do not use `parent', instead use the real type
24640         container to evaluate permission settings.
24641
24642         * class.cs: Put Ravi's patch back in.  He is right, and we will
24643         have to cope with the
24644
24645 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24646
24647         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24648         FamORAssem, not FamANDAssem.
24649
24650 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24651
24652         * driver.cs: Added --parse option that only parses its input files
24653         and terminates.
24654
24655         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24656         incorrect.  IsTopLevel is not used to tell whether an object is
24657         root_types or not (that can be achieved by testing this ==
24658         root_types).  But to see if this is a top-level *class* (not
24659         necessarly our "toplevel" container). 
24660
24661 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24662
24663         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24664         parent instead of a direct call to GetType.
24665
24666 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24667
24668         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24669         Modifiers.TypeAttr. This should just be a call to that method.
24670
24671         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24672         object so that we can determine if we are top-level or not.
24673
24674         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24675         TypeContainer too.
24676
24677         * enum.cs (Enum::Define): Ditto.
24678
24679         * modifiers.cs (FieldAttr): Re-write.
24680
24681         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24682         (TypeContainer::HaveStaticConstructor): New property to provide access
24683         to precisely that info.
24684
24685         * modifiers.cs (MethodAttr): Re-write.
24686         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24687
24688         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24689         of top-level types as claimed.
24690
24691 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24692
24693         * expression.cs (MemberLookup): Fruitless attempt to lookup
24694         constructors.  Maybe I need to emit default constructors?  That
24695         might be it (currently .NET emits this for me automatically).
24696         (Invocation::OverloadResolve): Cope with Arguments == null.
24697         (Invocation::EmitArguments): new function, shared by the new
24698         constructor and us.
24699         (Invocation::Emit): Handle static and instance methods.  Emit
24700         proper call instruction for virtual or non-virtual invocations.
24701         (New::Emit): Implement.
24702         (New::Resolve): Implement.
24703         (MemberAccess:Resolve): Implement.
24704         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24705         to track instances.
24706         (FieldExpr::Resolve): Set type.
24707
24708         * support.cs: Handle empty arguments.
24709                 
24710         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24711         SimpleLookup): Auxiliary routines to help parse a qualifier
24712         identifier.  
24713
24714         Update qualifier_identifier rule.
24715
24716         * codegen.cs: Removed debugging messages.
24717
24718         * class.cs: Make this a global thing, this acts just as a "key" to
24719         objects that we might have around.
24720
24721         (Populate): Only initialize method_builders_to_methods once.
24722
24723         * expression.cs (PropertyExpr): Initialize type from the
24724         PropertyType. 
24725
24726         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24727         Resolve pattern.  Attempt to implicitly convert value to boolean.
24728         Emit code.
24729
24730         * expression.cs: Set the type for the int32/int32 argument case.
24731         (Binary::ResolveOperator): Set the return type to boolean for
24732         comparission operators
24733
24734         * typemanager.cs: Remove debugging print code.
24735
24736         (Invocation::Resolve): resolve type.
24737
24738         * class.cs: Allocate a MemberInfo of the correct size, as the code
24739         elsewhere depends on the test to reflect the correct contents.
24740
24741         (Method::) Keep track of parameters, due to System.Reflection holes
24742
24743         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24744         mapping here.
24745
24746         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24747         of the exact size and return that.
24748
24749         (Class::LookupMethodByBuilder): New function that maps
24750         MethodBuilders to its methods.  Required to locate the information
24751         on methods because System.Reflection bit us again.
24752
24753         * support.cs: New file, contains an interface ParameterData and
24754         two implementations: ReflectionParameters and InternalParameters
24755         used to access Parameter information.  We will need to grow this
24756         as required.
24757
24758         * expression.cs (Invocation::GetParameterData): implement a cache
24759         and a wrapper around the ParameterData creation for methods. 
24760         (Invocation::OverloadResolve): Use new code.
24761
24762 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24763
24764         * class.cs (TypeContainer::EmitField): Remove and move into 
24765         (Field::Define): here and modify accordingly.
24766         (Field.FieldBuilder): New member.
24767         (TypeContainer::Populate): Update accordingly.
24768         (TypeContainer::FindMembers): Implement.
24769
24770 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24771
24772         * statement.cs: (VariableInfo::VariableType): New field to be
24773         initialized with the full type once it is resolved. 
24774
24775 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24776
24777         * parameter.cs (GetParameterInfo): Use a type cache to compute
24778         things only once, and to reuse this information
24779
24780         * expression.cs (LocalVariableReference::Emit): Implement.
24781         (OpcodeCast::Emit): fix.
24782
24783         (ParameterReference::Resolve): Implement.
24784         (ParameterReference::Emit): Implement.
24785
24786         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24787         that are expressions need to stay as Expressions.
24788
24789         * typemanager.cs (CSharpName): Returns the C# name of a type if
24790         possible. 
24791
24792         * expression.cs (Expression::ConvertImplicit): New function that
24793         implements implicit type conversions.
24794
24795         (Expression::ImplicitReferenceConversion): Implements implicit
24796         reference conversions.
24797
24798         (EmptyCast): New type for transparent casts.
24799
24800         (OpcodeCast): New type for casts of types that are performed with
24801         a sequence of bytecodes.
24802
24803         (BoxedCast): New type used for casting value types into reference
24804         types.  Emits a box opcode.
24805
24806         (Binary::DoNumericPromotions): Implements numeric promotions of
24807         and computation of the Binary::Type.
24808
24809         (Binary::EmitBranchable): Optimization.
24810
24811         (Binary::Emit): Implement code emission for expressions.
24812
24813         * typemanager.cs (TypeManager): Added two new core types: sbyte
24814         and byte.
24815
24816 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24817
24818         * class.cs (TypeContainer::FindMembers): Method which does exactly
24819         what Type.FindMembers does, only we don't have to use reflection. No
24820         implementation yet.
24821
24822         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24823         typecontainer objects as we need to get at them.
24824         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24825
24826         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24827         typecontainer object.
24828
24829         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24830         of just a Report object.
24831
24832 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24833
24834         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24835         "remove_"
24836         (TypeContainer::Populate): Now define the delegates of the type too.
24837         (TypeContainer.Delegates): Property to access the list of delegates defined
24838         in the type.
24839
24840         * delegates.cs (Delegate::Define): Implement partially.
24841
24842         * modifiers.cs (TypeAttr): Handle more flags.
24843
24844 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24845
24846         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24847         and not <=
24848         (Operator::Define): Re-write logic to get types by using the LookupType method
24849         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24850         (Indexer::Define): Ditto.
24851         (Event::Define): Ditto.
24852         (Property::Define): Ditto.
24853
24854 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24855
24856         * class.cs (TypeContainer::Populate): Now define operators too. 
24857         (TypeContainer.Operators): New property to access the list of operators
24858         in a type.
24859         (Operator.OperatorMethodBuilder): New member to hold the method builder
24860         for the operator we are defining.
24861         (Operator::Define): Implement.
24862
24863 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24864
24865         * class.cs (Event::Define): Make the prefixes of the accessor methods
24866         addOn_ and removeOn_ 
24867
24868         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24869         of the location being passed in too. Ideally, this should go later since all
24870         error reporting should be done through the Report object.
24871
24872         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24873         (Populate): Iterate thru the indexers we have and define them too.
24874         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24875         for the get and set accessors.
24876         (Indexer::Define): Implement.
24877
24878 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24879
24880         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24881         my previous implementation, did not work.
24882
24883         * typemanager.cs: Add a couple of missing types (the longs).
24884
24885         * literal.cs: Use TypeManager.bool_type instead of getting it.
24886
24887         * expression.cs (EventExpr): New kind of expressions.
24888         (Expressio::ExprClassFromMemberInfo): finish
24889
24890 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24891
24892         * assign.cs: Emit stores to static fields differently.
24893
24894 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24895
24896         * Merge in changes and adjust code to tackle conflicts. Backed out my
24897         code in Assign::Resolve ;-) 
24898
24899 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24900
24901         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24902         instead Report.Error and also pass in the location.
24903         (CSharpParser::Lexer): New readonly property to return the reference
24904         to the Tokenizer object.
24905         (declare_local_variables): Use Report.Error with location instead of plain 
24906         old error.
24907         (CheckDef): Ditto.
24908
24909         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24910         (Operator.CheckBinaryOperator): Ditto.
24911
24912         * cs-parser.jay (operator_declarator): Update accordingly.
24913
24914         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24915         (CheckBinaryOperator): Same here.
24916
24917         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24918         on the name without any prefixes of namespace names etc. This is because we
24919         already might have something already fully qualified like 
24920         'System.Console.WriteLine'
24921
24922         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24923
24924 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24925
24926         * cs-tokenizer.cs (location): Return a string which also contains
24927         the file name.
24928
24929         * expression.cs (ElementAccess): New class for expressions of the
24930         type 'element access.'
24931         (BaseAccess): New class for expressions of the type 'base access.'
24932         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24933         respectively.
24934
24935         * cs-parser.jay (element_access): Implement action.
24936         (base_access): Implement actions.
24937         (checked_expression, unchecked_expression): Implement.
24938
24939         * cs-parser.jay (local_variable_type): Correct and implement.
24940         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24941
24942         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24943
24944         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24945         name and the specifiers.
24946
24947         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24948
24949         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24950         making them all public ;-)
24951
24952         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24953         class anyways.
24954
24955 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24956
24957         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24958         PropertyExprs.
24959         (FieldExpr, PropertyExprs): New resolved expressions.
24960         (SimpleName::MemberStaticCheck): Perform static checks for access
24961         to non-static fields on static methods. Maybe this should be
24962         generalized for MemberAccesses. 
24963         (SimpleName::ResolveSimpleName): More work on simple name
24964         resolution. 
24965
24966         * cs-parser.jay (primary_expression/qualified_identifier): track
24967         the parameter index.
24968
24969         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24970         (EmitContext::EmitBoolExpression): Chain to expression generation
24971         instead of temporary hack.
24972         (::EmitStatementExpression): Put generic expression code generation.
24973
24974         * assign.cs (Assign::Emit): Implement variable assignments to
24975         local variables, parameters and fields.
24976
24977 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24978
24979         * statement.cs (Block::GetVariableInfo): New method, returns the
24980         VariableInfo for a variable name in a block.
24981         (Block::GetVariableType): Implement in terms of GetVariableInfo
24982
24983         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24984         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24985
24986 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24987
24988         * cs-parser.jay (operator_declaration): Continue on my quest : update
24989         to take attributes argument.
24990         (event_declaration): Ditto.
24991         (enum_declaration): Ditto.
24992         (indexer_declaration): Ditto.
24993
24994         * class.cs (Operator::Operator): Update constructor accordingly.
24995         (Event::Event): Ditto.
24996
24997         * delegate.cs (Delegate::Delegate): Same here.
24998
24999         * enum.cs (Enum::Enum): Same here.
25000
25001 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25002
25003         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25004
25005         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25006
25007         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25008         being passed around as an arraylist.
25009         (Attributes::AddAttribute): Method to add attribute sections.
25010
25011         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25012         (struct_declaration): Update accordingly.
25013         (constant_declaration): Update.
25014         (field_declaration): Update.
25015         (method_header): Update.
25016         (fixed_parameter): Update.
25017         (parameter_array): Ditto.
25018         (property_declaration): Ditto.
25019         (destructor_declaration): Ditto.
25020
25021         * class.cs (Struct::Struct): Update constructors accordingly.
25022         (Class::Class): Ditto.
25023         (Field::Field): Ditto.
25024         (Method::Method): Ditto.
25025         (Property::Property): Ditto.
25026         (TypeContainer::OptAttribute): update property's return type.
25027
25028         * interface.cs (Interface.opt_attributes): New member.
25029         (Interface::Interface): Update to take the extra Attributes argument.
25030
25031         * parameter.cs (Parameter::Parameter): Ditto.
25032
25033         * constant.cs (Constant::Constant): Ditto.
25034
25035         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25036         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25037         the attributes as a parameter.
25038         (InterfaceProperty): Update constructor call.
25039         (InterfaceEvent): Ditto.
25040         (InterfaceMethod): Ditto.
25041         (InterfaceIndexer): Ditto.
25042
25043         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25044         pass the attributes too.
25045         (interface_event_declaration): Ditto.
25046         (interface_property_declaration): Ditto.
25047         (interface_method_declaration): Ditto.
25048         (interface_declaration): Ditto.
25049
25050 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25051
25052         * class.cs (Method::Define): Track the "static Main" definition to
25053         create an entry point. 
25054
25055         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25056         EntryPoint if we find it. 
25057
25058         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25059         (EmitContext::ig): Make this variable public.
25060
25061         * driver.cs: Make the default output file be the first file name
25062         with the .exe extension.  
25063
25064         Detect empty compilations
25065
25066         Handle various kinds of output targets.  Handle --target and
25067         rename -t to --dumper.
25068
25069         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25070         methods inherited from Expression return now an Expression.  This
25071         will is used during the tree rewriting as we resolve them during
25072         semantic analysis.
25073
25074         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25075         the spec.  Missing entirely is the information about
25076         accessability of elements of it.
25077
25078         (Expression::ExprClassFromMemberInfo): New constructor for
25079         Expressions that creates a fully initialized Expression based on
25080         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25081         a Type.
25082
25083         (Invocation::Resolve): Begin implementing resolution of invocations.
25084
25085         * literal.cs (StringLiteral):  Implement Emit.
25086
25087 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25088
25089         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25090         member.
25091
25092 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25093
25094         * cs-parser.jay (attribute_arguments): Implement actions.
25095         (attribute): Fix bug in production. Implement action.
25096         (attribute_list): Implement.
25097         (attribute_target): Implement.
25098         (attribute_target_specifier, opt_target_specifier): Implement
25099         (CheckAttributeTarget): New method to check if the attribute target
25100         is valid.
25101         (attribute_section): Implement.
25102         (opt_attributes): Implement.
25103
25104         * attribute.cs : New file to handle attributes.
25105         (Attribute): Class to hold attribute info.
25106
25107         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25108         (attribute_section): Modify production to use 2 different rules to 
25109         achieve the same thing. 1 s/r conflict down !
25110         Clean out commented, useless, non-reducing dimension_separator rules.
25111
25112         * class.cs (TypeContainer.attributes): New member to hold list
25113         of attributes for a type.
25114         (Struct::Struct): Modify to take one more argument, the attribute list.
25115         (Class::Class): Ditto.
25116         (Field::Field): Ditto.
25117         (Method::Method): Ditto.
25118         (Property::Property): Ditto.
25119
25120         * cs-parser.jay (struct_declaration): Update constructor call to
25121         pass in the attributes too.
25122         (class_declaration): Ditto.
25123         (constant_declaration): Ditto.
25124         (field_declaration): Ditto.
25125         (method_header): Ditto.
25126         (fixed_parameter): Ditto.
25127         (parameter_array): Ditto.
25128         (property_declaration): Ditto.
25129
25130         * constant.cs (Constant::Constant): Update constructor similarly.
25131         Use System.Collections.
25132
25133         * parameter.cs (Parameter::Parameter): Update as above.
25134
25135 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25136
25137         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25138         (TypeContainer.delegates): New member to hold list of delegates.
25139
25140         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25141         this time as I seem to be on crack ;-)
25142
25143 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25144
25145         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25146         tell whether an identifier represents a namespace.
25147
25148         * expression.cs (NamespaceExpr): A namespace expression, used only
25149         temporarly during expression resolution.
25150         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25151         utility functions to resolve names on expressions.
25152
25153 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25154
25155         * codegen.cs: Add hook for StatementExpressions. 
25156
25157         * class.cs: Fix inverted test for static flag in methods.
25158
25159 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25160
25161         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25162         to make it coincide with MS' number.
25163         (Operator::CheckBinaryOperator): Ditto.
25164
25165         * ../errors/errors.txt : Remove error numbers added earlier.
25166
25167         * ../errors/cs1019.cs : Test case for error # 1019
25168
25169         * ../errros/cs1020.cs : Test case for error # 1020
25170
25171         * cs-parser.jay : Clean out commented cruft.
25172         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25173         used anywhere - non-reducing rule.
25174         (namespace_declarations): Non-reducing rule - comment out.
25175
25176         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25177         with TypeContainer::AddEnum.
25178
25179         * delegate.cs : New file for delegate handling classes.
25180         (Delegate): Class for declaring delegates.
25181
25182         * makefile : Update.
25183
25184         * cs-parser.jay (delegate_declaration): Implement.
25185
25186 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25187
25188         * class.cs (Event::Define): Implement.
25189         (Event.EventBuilder): New member.
25190
25191         * class.cs (TypeContainer::Populate): Update to define all enums and events
25192         we have.
25193         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25194         readonly fields for all these cases ?
25195
25196 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25197
25198         * class.cs (Property): Revamp to use the convention of making fields readonly.
25199         Accordingly modify code elsewhere.
25200
25201         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25202         the Define method of the Property class.
25203
25204         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25205         trivial bug.
25206         (TypeContainer::Populate): Update to define all the properties we have. Also
25207         define all enumerations.
25208
25209         * enum.cs (Define): Implement.
25210
25211 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25212
25213         * cs-parser.jay (overloadable_operator): The semantic value is an
25214         enum of the Operator class.
25215         (operator_declarator): Implement actions.
25216         (operator_declaration): Implement.
25217
25218         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25219         validity of definitions.
25220         (Operator::CheckBinaryOperator): Static method to check for binary operators
25221         (TypeContainer::AddOperator): New method to add an operator to a type.
25222
25223         * cs-parser.jay (indexer_declaration): Added line to actually call the
25224         AddIndexer method so it gets added ;-)
25225
25226         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25227         already taken care of by the MS compiler ?  
25228
25229 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25230
25231         * class.cs (Operator): New class for operator declarations.
25232         (Operator::OpType): Enum for the various operators.
25233
25234 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25235
25236         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25237         ostensibly handle this in semantic analysis.
25238
25239         * cs-parser.jay (general_catch_clause): Comment out
25240         (specific_catch_clauses, specific_catch_clause): Ditto.
25241         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25242         (catch_args, opt_catch_args): New productions.
25243         (catch_clause): Rewrite to use the new productions above
25244         (catch_clauses): Modify accordingly.
25245         (opt_catch_clauses): New production to use in try_statement
25246         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25247         and re-write the code in the actions to extract the specific and
25248         general catch clauses by being a little smart ;-)
25249
25250         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25251         Hooray, try and catch statements parse fine !
25252
25253 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25254
25255         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25256         string from the hashtable of variables.
25257
25258         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25259         I end up making that mistake ;-)
25260         (catch_clauses): Fixed gross error which made Key and Value of the 
25261         DictionaryEntry the same : $1 !!
25262
25263 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25264
25265         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25266
25267         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25268         when the add and remove accessors are specified. 
25269
25270 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25271
25272         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25273         information about indexer_declarator.
25274         (indexer_declarator): Implement actions.
25275         (parsing_indexer): New local boolean used to keep track of whether
25276         we are parsing indexers or properties. This is necessary because 
25277         implicit_parameters come into picture even for the get accessor in the 
25278         case of an indexer.
25279         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25280
25281         * class.cs (Indexer): New class for indexer declarations.
25282         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25283         (TypeContainer::indexers): New member to hold list of indexers for the
25284         type.
25285
25286 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25287
25288         * cs-parser.jay (add_accessor_declaration): Implement action.
25289         (remove_accessor_declaration): Implement action.
25290         (event_accessors_declaration): Implement
25291         (variable_declarators): swap statements for first rule - trivial.
25292
25293         * class.cs (Event): New class to hold information about event
25294         declarations.
25295         (TypeContainer::AddEvent): New method to add an event to a type
25296         (TypeContainer::events): New member to hold list of events.
25297
25298         * cs-parser.jay (event_declaration): Implement actions.
25299
25300 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25301
25302         * cs-parser.jay (dim_separators): Implement. Make it a string
25303         concatenating all the commas together, just as they appear.
25304         (opt_dim_separators): Modify accordingly
25305         (rank_specifiers): Update accordingly. Basically do the same
25306         thing - instead, collect the brackets here.
25307         (opt_rank_sepcifiers): Modify accordingly.
25308         (array_type): Modify to actually return the complete type string
25309         instead of ignoring the rank_specifiers.
25310         (expression_list): Implement to collect the expressions
25311         (variable_initializer): Implement. We make it a list of expressions
25312         essentially so that we can handle the array_initializer case neatly too.
25313         (variable_initializer_list): Implement.
25314         (array_initializer): Make it a list of variable_initializers
25315         (opt_array_initializer): Modify accordingly.
25316
25317         * expression.cs (New::NType): Add enumeration to help us
25318         keep track of whether we have an object/delegate creation
25319         or an array creation.
25320         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25321         members to hold data about array creation.
25322         (New:New): Modify to update NewType
25323         (New:New): New Overloaded contructor for the array creation
25324         case.
25325
25326         * cs-parser.jay (array_creation_expression): Implement to call
25327         the overloaded New constructor.
25328
25329 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25330
25331         * class.cs (TypeContainer::Constructors): Return member
25332         constructors instead of returning null.
25333
25334 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25335
25336         * typemanager.cs (InitCoreTypes): Initialize the various core
25337         types after we have populated the type manager with the user
25338         defined types (this distinction will be important later while
25339         compiling corlib.dll)
25340
25341         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25342         on Expression Classification.  Now all expressions have a method
25343         `Resolve' and a method `Emit'.
25344
25345         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25346         generation from working.     Also add some temporary debugging
25347         code. 
25348
25349 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25350
25351         * codegen.cs: Lots of code generation pieces.  This is only the
25352         beginning, will continue tomorrow with more touches of polish.  We
25353         handle the fundamentals of if, while, do, for, return.  Others are
25354         trickier and I need to start working on invocations soon.
25355
25356         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25357         s.InitStatement. 
25358
25359         * codegen.cs (EmitContext): New struct, used during code
25360         emission to keep a context.   Most of the code generation will be
25361         here. 
25362
25363         * cs-parser.jay: Add embedded blocks to the list of statements of
25364         this block.  So code generation proceeds in a top down fashion.
25365
25366 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25367
25368         * statement.cs: Add support for multiple child blocks.
25369
25370 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25371
25372         * codegen.cs (EmitCode): New function, will emit the code for a
25373         Block of code given a TypeContainer and its ILGenerator. 
25374
25375         * statement.cs (Block): Standard public readonly optimization.
25376         (Block::Block constructors): Link children. 
25377         (Block::Child): Child Linker.
25378         (Block::EmitVariables): Emits IL variable declarations.
25379
25380         * class.cs: Drop support for MethodGroups here, delay until
25381         Semantic Analysis.
25382         (Method::): Applied the same simplification that I did before, and
25383         move from Properties to public readonly fields.
25384         (Method::ParameterTypes): Returns the parameter types for the
25385         function, and implements a cache that will be useful later when I
25386         do error checking and the semantic analysis on the methods is
25387         performed.
25388         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25389         and made a method, optional argument tells whether this is a class
25390         or a structure to apply the `has-this' bit.
25391         (Method::GetCallingConvention): Implement, returns the calling
25392         convention. 
25393         (Method::Define): Defines the type, a second pass is performed
25394         later to populate the methods.
25395
25396         (Constructor::ParameterTypes): implement a cache similar to the
25397         one on Method::ParameterTypes, useful later when we do semantic
25398         analysis. 
25399
25400         (TypeContainer::EmitMethod):  New method.  Emits methods.
25401
25402         * expression.cs: Removed MethodGroup class from here.
25403
25404         * parameter.cs (Parameters::GetCallingConvention): new method.
25405
25406 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25407
25408         * class.cs (TypeContainer::Populate): Drop RootContext from the
25409         argument. 
25410
25411         (Constructor::CallingConvention): Returns the calling convention.
25412         (Constructor::ParameterTypes): Returns the constructor parameter
25413         types. 
25414
25415         (TypeContainer::AddConstructor): Keep track of default constructor
25416         and the default static constructor.
25417
25418         (Constructor::) Another class that starts using `public readonly'
25419         instead of properties. 
25420
25421         (Constructor::IsDefault): Whether this is a default constructor. 
25422
25423         (Field::) use readonly public fields instead of properties also.
25424
25425         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25426         track of static constructors;  If none is used, turn on
25427         BeforeFieldInit in the TypeAttributes. 
25428
25429         * cs-parser.jay (opt_argument_list): now the return can be null
25430         for the cases where there are no arguments. 
25431
25432         (constructor_declarator): If there is no implicit `base' or
25433         `this', then invoke the default parent constructor. 
25434
25435         * modifiers.cs (MethodAttr): New static function maps a set of
25436         modifiers flags into a MethodAttributes enum
25437         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25438         MethodAttr, TypeAttr to represent the various mappings where the
25439         modifiers are used.
25440         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25441
25442 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25443
25444         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25445         method arguments.
25446
25447         * interface.cs (PopulateIndexer): Implemented the code generator
25448         for interface indexers.
25449
25450 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25451
25452         * interface.cs (InterfaceMemberBase): Now we track the new status
25453         here.  
25454
25455         (PopulateProperty): Implement property population.  Woohoo!  Got
25456         Methods and Properties going today. 
25457
25458         Removed all the properties for interfaces, and replaced them with
25459         `public readonly' fields. 
25460
25461 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25462
25463         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25464         initialize their hashtables/arraylists only when they are needed
25465         instead of doing this always.
25466
25467         * parameter.cs: Handle refs and out parameters.
25468
25469         * cs-parser.jay: Use an ArrayList to construct the arguments
25470         instead of the ParameterCollection, and then cast that to a
25471         Parameter[] array.
25472
25473         * parameter.cs: Drop the use of ParameterCollection and use
25474         instead arrays of Parameters.
25475
25476         (GetParameterInfo): Use the Type, not the Name when resolving
25477         types. 
25478
25479 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25480
25481         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25482         and instead use public readonly fields.
25483
25484         * class.cs: Put back walking code for type containers.
25485
25486 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25487
25488         * class.cs (MakeConstant): Code to define constants.
25489
25490         * rootcontext.cs (LookupType): New function.  Used to locate types 
25491
25492
25493 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25494
25495         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25496         this System.Reflection code is.  Kudos to Microsoft
25497
25498         * typemanager.cs: Implement a type cache and avoid loading all
25499         types at boot time.  Wrap in LookupType the internals.  This made
25500         the compiler so much faster.  Wow.  I rule!
25501
25502         * driver.cs: Make sure we always load mscorlib first (for
25503         debugging purposes, nothing really important).
25504
25505         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25506         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25507
25508         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25509         on namespaces that have been imported using the `using' keyword.
25510
25511         * class.cs (TypeContainer::TypeAttr): Virtualize.
25512         (Class::TypeAttr): Return attributes suitable for this bad boy.
25513         (Struct::TypeAttr): ditto.
25514         Handle nested classes.
25515         (TypeContainer::) Remove all the type visiting code, it is now
25516         replaced with the rootcontext.cs code
25517
25518         * rootcontext.cs (GetClassBases): Added support for structs. 
25519
25520 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25521
25522         * interface.cs, statement.cs, class.cs, parameter.cs,
25523         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25524         Drop use of TypeRefs, and use strings instead.
25525
25526 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25527
25528         * rootcontext.cs: 
25529
25530         * class.cs (Struct::Struct): set the SEALED flags after
25531         checking the modifiers.
25532         (TypeContainer::TypeAttr): new property, returns the
25533         TypeAttributes for a class.  
25534
25535         * cs-parser.jay (type_list): Oops, list production was creating a
25536         new list of base types.
25537
25538         * rootcontext.cs (StdLib): New property.
25539         (GetInterfaceTypeByName): returns an interface by type name, and
25540         encapsulates error handling here.
25541         (GetInterfaces): simplified.
25542         (ResolveTree): Encapsulated all the tree resolution here.
25543         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25544         types. 
25545
25546         * driver.cs: Add support for --nostdlib, to avoid loading the
25547         default assemblies.
25548         (Main): Do not put tree resolution here. 
25549
25550         * rootcontext.cs: Beginning of the class resolution.
25551
25552 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25553
25554         * rootcontext.cs: Provide better error reporting. 
25555
25556         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25557
25558         * rootcontext.cs (CreateInterface): Handle the case where there
25559         are no parent interfaces.
25560
25561         (CloseTypes): Routine to flush types at the end.
25562         (CreateInterface): Track types.
25563         (GetInterfaces): Returns an array of Types from the list of
25564         defined interfaces.
25565
25566         * typemanager.c (AddUserType): Mechanism to track user types (puts
25567         the type on the global type hash, and allows us to close it at the
25568         end). 
25569
25570 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25571
25572         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25573         RecordInterface instead.
25574
25575         * cs-parser.jay: Updated to reflect changes above.
25576
25577         * decl.cs (Definition): Keep track of the TypeBuilder type that
25578         represents this type here.  Not sure we will use it in the long
25579         run, but wont hurt for now.
25580
25581         * driver.cs: Smaller changes to accomodate the new code.
25582
25583         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25584         when done. 
25585
25586         * rootcontext.cs (CreateInterface):  New method, used to create
25587         the System.TypeBuilder type for interfaces.
25588         (ResolveInterfaces): new entry point to resolve the interface
25589         hierarchy. 
25590         (CodeGen): Property, used to keep track of the code generator.
25591
25592 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25593
25594         * cs-parser.jay: Add a second production for delegate_declaration
25595         with `VOID'.
25596
25597         (enum_body): Put an opt_comma here instead of putting it on
25598         enum_body or enum_member_declarations so we can handle trailing
25599         commas on enumeration members.  Gets rid of a shift/reduce.
25600
25601         (type_list): Need a COMMA in the middle.
25602
25603         (indexer_declaration): Tell tokenizer to recognize get/set
25604
25605         * Remove old targets.
25606
25607         * Re-add the parser target.
25608
25609 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25610
25611         * cs-parser.jay: Add precendence rules for a number of operators
25612         ot reduce the number of shift/reduce conflicts in the grammar.
25613
25614 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25615
25616         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25617         and put it here.
25618
25619         Get rid of old crufty code.
25620
25621         * rootcontext.cs: Use this to keep track of the parsed
25622         representation and the defined types available to the program. 
25623
25624         * gen-treedump.cs: adjust for new convention.
25625
25626         * type.cs: Split out the type manager, and the assembly builder
25627         from here. 
25628
25629         * typemanager.cs: the type manager will live here now.
25630
25631         * cil-codegen.cs: And the code generator here. 
25632
25633 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25634
25635         * makefile: Fixed up for easy making.
25636
25637 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25638
25639         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25640         the 
25641
25642         (unary_expression): Expand pre_increment_expression and
25643         post_decrement_expression to reduce a shift/reduce.
25644
25645 2001-07-11  Simon Cozens
25646
25647         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25648
25649         Improve allow_keyword_as_indent name.
25650
25651 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25652
25653         * Adjustments for Beta2. 
25654
25655 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25656
25657         * decl.cs: Added `Define' abstract method.
25658         (InTransit): new property, used to catch recursive definitions. 
25659
25660         * interface.cs: Implement `Define'. 
25661
25662         * modifiers.cs: Map Modifiers.constants to
25663         System.Reflection.TypeAttribute flags.
25664
25665         * class.cs: Keep track of types and user-defined types.
25666         (BuilderInit): New method for creating an assembly
25667         (ResolveType): New function to launch the resolution process, only
25668         used by interfaces for now.
25669
25670         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25671         that are inserted into the name space. 
25672
25673 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25674
25675         * ARGH.  I have screwed up my tree so many times due to the use of
25676         rsync rather than using CVS.  Going to fix this at once. 
25677
25678         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25679         load types.
25680
25681 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25682
25683         * Experiment successful: Use System.Type rather that our own
25684         version of Type.  
25685
25686 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25687
25688         * cs-parser.jay: Removed nsAliases from here.
25689
25690         Use new namespaces, handle `using XXX;' 
25691
25692         * namespace.cs: Reimplemented namespace handling, use a recursive
25693         definition of the class.  Now we can keep track of using clauses
25694         and catch invalid using clauses.
25695
25696 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25697
25698         * gen-treedump.cs: Adapted for all the renaming.
25699
25700         * expression.cs (Expression): this class now has a Type property
25701         which returns an expression Type.
25702
25703         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25704         `Type', as this has a different meaning now in the base
25705
25706 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25707
25708         * interface.cs, class.cs: Removed from all the sources the
25709         references to signature computation, as we can not do method
25710         signature computation during the parsing time, as we are not
25711         trying to solve at that point distinguishing:
25712
25713         class X {
25714                 void a (Blah x) {}
25715                 void a (NS.Blah x) {}
25716         }
25717
25718         Which depending on the context might be valid or not, as we do not
25719         know if Blah is the same thing as NS.Blah at that point.
25720
25721         * Redid everything so the code uses TypeRefs now instead of
25722         Types.  TypeRefs are just temporary type placeholders, that need
25723         to be resolved.  They initially have a pointer to a string and the
25724         current scope in which they are used.  This is used later by the
25725         compiler to resolve the reference to an actual Type. 
25726
25727         * DeclSpace is no longer a CIR.Type, and neither are
25728         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25729         are all DeclSpaces, but no Types. 
25730
25731         * type.cs (TypeRefManager): This implements the TypeRef manager,
25732         which keeps track of all the types that need to be resolved after
25733         the parsing has finished. 
25734
25735 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25736
25737         * ARGH.  We are going to have to store `foreach' as a class rather
25738         than resolving it, as we need to verify error 1579 after name
25739         resolution.   *OR* we could keep a flag that says `This request to
25740         IEnumerator comes from a foreach statement' which we can then use
25741         to generate the error.
25742
25743 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25744
25745         * class.cs (TypeContainer.AddMethod): we now add methods to the
25746         MethodGroup instead of the method hashtable.  
25747
25748         * expression.cs: Add MethodGroup abstraction, which gets us one
25749         step closer to the specification in the way we handle method
25750         declarations.  
25751
25752         * cs-parser.jay (primary_expression): qualified_identifier now
25753         tried to match up an identifier to a local variable reference or
25754         to a parameter reference.
25755
25756         current_local_parameters is now a parser global variable that
25757         points to the current parameters for the block, used during name
25758         lookup.
25759
25760         (property_declaration): Now creates an implicit `value' argument to
25761         the set accessor.
25762
25763 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25764
25765         * parameter.cs: Do not use `param' arguments as part of the
25766         signature, per the spec.
25767
25768 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25769
25770         * decl.cs: Base class for classes, structs and interfaces.  This
25771         is the "Declaration Space" 
25772
25773         * cs-parser.jay: Use CheckDef for checking declaration errors
25774         instead of having one on each function.
25775
25776         * class.cs: Factor out some code for handling error handling in
25777         accordance to the "Declarations" section in the "Basic Concepts"
25778         chapter in the ECMA C# spec.
25779
25780         * interface.cs: Make all interface member classes derive from
25781         InterfaceMemberBase.
25782
25783 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25784
25785         * Many things: all interfaces are parsed and generated in
25786         gen-treedump.  Support for member variables, constructors,
25787         destructors, properties, constants is there.
25788
25789         Beginning of the IL backend, but very little done, just there for
25790         testing purposes. 
25791
25792 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25793
25794         * cs-parser.jay: Fix labeled statement.
25795
25796         * cs-tokenizer.cs (escape): Escape " and ' always.
25797         ref_line, ref_name: keep track of the line/filename as instructed
25798         by #line by the compiler.
25799         Parse #line.
25800
25801 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25802
25803         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25804         to match the values in System.CodeDOM.
25805
25806         Divid renamed to Divide.
25807
25808         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25809         statements. 
25810         (Statements.set): remove.
25811
25812         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25813         statements. 
25814
25815         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25816         falseStatements always have valid values. 
25817
25818         * cs-parser.jay: Use System.CodeDOM now.
25819