In mcs:
[mono.git] / mcs / gmcs / ChangeLog
1 2006-05-05  Raja R Harinath  <rharinath@novell.com>
2
3         * flowanalysis.cs (BranchingType.Labeled): New.
4         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5         (FlowBranchingLabeled): New.  Does nothing for now, but will
6         eventually handle 'goto' flows.
7         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
9         that's terminated ...
10         (Block.Resolve): ... here.
11
12         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
13         (UsageVector.MergeFinallyOrigins): Likewise.
14         (FlowBranching.InTryOrCatch): Likewise.
15         (FlowBranching.AddFinallyVector): Likewise.
16         (FlowBranchingException): Update to changes.
17
18         Fix #78290
19         * statement.cs (Return.Resolve): Move error checking to ...
20         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
21         (FlowBranchingException): Handle return origins like break and
22         continue origins.
23         (FlowBranching.UsageVector.CheckOutParameters): Remove.
24
25 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
26
27         A fix for #76122
28         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
29         filter.
30
31 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
32
33         A fix for #77543
34         * class.cs (MethodData.Define): Do public accessor check only when method
35         implements an interface.
36
37 2006-05-04  Raja R Harinath  <rharinath@novell.com>
38
39         Remove special handling of 'break'
40         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
41         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
42         (UsageVector.Break): Remove.
43         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
44         reachability.
45         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
46
47         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
48         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
49
50 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
51
52         A fix for #75726
53         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
54         be the interface member.
55
56 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
57
58         A fix for #60069
59         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
60         for emitting small (int) values.
61
62 2006-05-03  Raja R Harinath  <rharinath@novell.com>
63
64         Fix #59427
65         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
66         control-flow passes through the 'finally' after merging-in all the
67         control-flows from 'try' and the 'catch' clauses.
68
69         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
70         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
71         always true at the only non-recursive entry point.
72         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
73         FlowBranchingBreakable.
74         (FlowBranchingLoop): Remove.
75         * statement.cs (Return.DoResolve): Update to changes.
76
77         Fix #76471, #76665
78         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
79         (FlowBranching.CreateBranching): Handle it: create a
80         FlowBranchingContinuable.
81         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
82         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
83         except that it handles the 'continue' command.
84         (FlowBranching.UsageVector.MergeOrigins): Rename from
85         MergeBreakOrigins.
86         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
87         except that it overrides AddContinueOrigin.
88         (FlowBranchingException): Override AddContinueOrigin, similar to
89         AddBreakOrigin.
90         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
91         Create a new branching around the embedded statement.
92         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
93         control flow after the embedded statement.
94         (Continue.Resolve): Move all error checking to AddContinueOrigin.
95
96         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
97         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
98         FlowBranchingBreakable.
99         (FlowBranchingSwitch): Remove.
100
101         Fix test-503.cs
102         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
103         error reporting to ...
104         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
105         Rename from 'AddBreakVector'.  Add new location argument.  Return
106         a bool indicating whether the 'break' crosses an unwind-protect.
107         (FlowBranchingException.AddBreakOrigin): Add.
108         (FlowBranchingException.Merge): Propagate 'break's to surrounding
109         flowbranching after updating with the effects of the 'finally'
110         clause.
111         (FlowBranchingBreakable): New common base class for
112         FlowBranchingLoop and FlowBranchingSwitch.
113
114         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
115         embedded statement.
116         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
117
118 2006-05-02  Raja R Harinath  <rharinath@novell.com>
119
120         * statement.cs (Do.Resolve): If the loop is infinite, set the
121         barrier.
122         (While.Resolve, For.Resolve): Set a barrier after the embedded
123         statement.  There's no direct control flow that goes from the end
124         of the embedded statement to the end of the loop.
125         * flowanalysis.cs (FlowBranching.Infinite): Remove.
126         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
127         above ensure that the reachability is correctly computed.
128
129         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
130         (UsageVector.MergeBreakOrigins): If the current path is
131         unreachable, treat it as if all parameters/locals are initialized.
132         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
133         infinite loops before merging-in break origins.
134
135         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
136         (Reachability.Reachable): Split part into ...
137         (Reachability.Unreachable): ... this.  Simplify.
138         (Reachability.IsUnreachable): Use 'Unreachable' instead.
139
140         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
141         (Reachability.SetThrowsSometimes): Likewise.
142         (FlowBranchingBlock.MergeTopBlock): Don't compare against
143         TriState.Always, use corresponding property.
144         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
145         (Block.Resolve): Likewise.  Remove some redundant checks.
146
147 2006-05-02  Raja R Harinath  <harinath@gmail.com>
148
149         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
150         (Reachability.Meet): Don't bother checking AlwaysThrows --
151         barrier is always set.
152         (FlowBranchingBlock.Merge): Likewise.
153
154 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
155
156         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
157         defined, so it's references should also compile only for NET_2_0
158         (as occurs in mcs version)
159
160 2006-05-01  Raja R Harinath  <harinath@gmail.com>
161
162         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
163         checks for unreachable.
164
165 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
166
167         A fix for #77980
168         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
169
170         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
171         whether field is really assigned.
172
173 2006-04-30  Raja R Harinath  <harinath@gmail.com>
174
175         * flowanalysis.cs (Reachability): Make 4-argument constructor
176         private.
177         (Reachability.Meet): Rename from 'And'.  Remove static variant.
178         (Reachability.Always): Rename from the highly misleading
179         'Reachability.Never'.
180         (FlowBranching.Merge): Update to changes.  Mark an impossible
181         situation with a 'throw'.
182         (*): Update to changes.
183
184 2006-04-29  Raja R Harinath  <harinath@gmail.com>
185
186         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
187         Remove 'Undefined'.
188         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
189         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
190         (*): Update to changes.
191         * statement.cs: Update to changes.
192
193 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
194
195         A fix for #78049
196         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
197
198 2006-04-28  Raja R Harinath  <harinath@gmail.com>
199
200         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
201         dummy UsageVector.
202
203         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
204         argument to two arguments: an usage-vector and a bool.  Move call
205         to FlowBranching.Merge () ...
206         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
207
208         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
209         handling of loop and switch reachability to ...
210         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
211
212 2006-04-27  Raja R Harinath  <harinath@gmail.com>
213
214         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
215         handling to FlowBranchingLoop.InLoop.
216         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
217
218 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
219
220         A fix for #78115
221         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
222         anonymous method is allowed from AnonymousContainer here.
223
224         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
225
226 2006-04-24  Raja R Harinath  <rharinath@novell.com>
227
228         Fix #78156
229         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
230
231 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
232
233         A fix for #49011.
234         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
235         (DoubleConstant.Reduce): Ditto.
236
237 2006-04-23  Raja R Harinath  <rharinath@novell.com>
238
239         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
240         Remove 'lvalue_right_side' argument.  Move parts to ...
241         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
242         (LocalVariable.DoResolveLValue): ... these.
243
244 2006-04-21  Raja R Harinath  <rharinath@novell.com>
245
246         Fix cs1655.cs
247         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
248         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
249         (LocalVariableReference.DoResolveBase): Use it to implement new
250         CS1655 check.
251         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
252         (Argument.Resolve): Simplify.  Move CS1510 check ...
253         * ecore.cs (Expression.ResolveLValue): ... here.
254         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
255         (PropertyExpr.DoResolveLValue): Likewise.
256         (FieldExpr.Report_AssignToReadonly): Likewise.
257         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
258         LValueMemberAccess or LValueMemberOutAccess on instance depending
259         on it.
260         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
261         DoResolve as appropriate.
262
263 2006-04-20  Raja R Harinath  <rharinath@novell.com>
264
265         Fix #75800
266         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
267         implicit conversions on 'out' and 'ref' arguments.
268
269         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
270         improve clarity.  Remove dead code.
271
272         Fix #66031
273         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
274         (Catch.Resolve): Resolve VarBlock if it exists.
275
276 2006-04-19  Miguel de Icaza  <miguel@novell.com>
277
278         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
279         twice, this was some residual code, the enumerator was emitted
280         properly in the two branche of if later.
281
282         Fixes #78031
283         
284         Thanks to Martin for finding the source of the problem
285         
286 2006-04-19  Raja R Harinath  <rharinath@novell.com>
287
288         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
289         cast is never an lvalue.
290         (Cast.DoResolve, Cast.ResolveRest): Combine.
291         (Argument.Emit): Simplify slightly.  Move 'Expr is
292         IMemoryLocation' check ...
293         (Argument.Resolve): ... here.
294         (Argument.Error_LValueRequired): Remove.  Inline into only user.
295
296         Simplifications.  Fix cs0191-2.cs
297         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
298         CS1649 and CS1651 to ...
299         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
300         the actual selection of the error code and message to a lookup
301         table.  Add a dummy return value to simplify callsites.
302         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
303         readonly fields of other instances of the same type.  Move CS0197
304         warning from ...
305         * expression.cs (Argument.Resolve): ... here.  Simplify code.
306         Ensure that ec.InRefOutArgumentResolving is only set during LValue
307         resolution of an out or ref argument.  The code simplification
308         above uses this invariant.
309
310 2006-04-18  Raja R Harinath  <rharinath@novell.com>
311
312         Possibly fix #77752.  Fix cs1690-[4-7].cs.
313         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
314         CheckMarshallByRefAccess.  Drop parameter.
315         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
316         warning.
317         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
318         InstanceExpression.
319         * report.cs (AllWarnings): Add CS1690.
320         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
321         for ref access too.
322         (LocalVariableReference.DoResolveBase): Update.
323
324 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
325
326         * class.cs (MethodOrOperator): Moved common parts from method class.
327         detect obsolete attributes.
328         (Method.Define): Simplified as it reuses code from base.
329         (Constructor.ValidAttributeTargets): Fixed issue found during
330         refactoring.
331         (Destructor.ValidAttributeTargets): Fixed issue found during
332         refactoring.
333         (Operator): Finished refactoring set off by #78020. Operator class is now
334         ordinary method class.
335
336         * anonymous.cs: Updated.
337
338 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
339
340         * class.cs (Constructor.Emit): Don't emit the attributes twice.
341
342 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
343
344         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
345         detect obsolete attributes.
346         (Method.CreateEmitContext): Moved to MethodOrOperator.
347
348 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
349
350         A fix for #78048.
351         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
352         customized exception to make crash detection easier.
353         (MethodOrOperator): Started to work on new base class for methods and
354         operators.
355         (Method): Derives from MethodOrOperator.
356         (Constructor.Emit): Emits its own attributes.
357         (AbstractPropertyEventMethod.Emit): Ditto.
358         (Operator): Derives from MethodOrOperator, will refactor fully in extra
359         patch.
360         (Operator.Emit): It's temporary more tricky than should be.
361         
362         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
363
364         * report.cs (InternalErrorException): Add ctor with inner exception.
365
366 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
367
368         A fix for #76744.
369         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
370         only not visible.
371
372 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
373
374         A fix for #77916.
375         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
376         array.
377
378 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
379
380         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
381         attribute is present and Guid not.
382         (Interface.ApplyAttributeBuilder): Ditto.
383
384         * attribute.cs: Add error message.
385
386 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
387
388         A fix for #78020.
389
390         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
391         sources (it's composite) so hold them in extra array as they are used in
392         Emit phase only. It worked in the previous versions by mistake.
393         (Attribute.Emit): Emit attribute for more owners when exist.
394
395         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
396         it has now different behaviour.
397
398 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
399
400         * constant.cs (Constant.IsDefaultInitializer): New method.
401
402         * class.cs: Updated.
403
404         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
405         re-initialize default values. It saves KBs almost for every assembly.
406         Thanks Zoltan for the idea.
407         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
408         (ArrayCreation.DoResolve): Resolve only once.
409         (ArrayCreation.Emit): Emit static initializer only when it is faster.
410         (ArrayCreation.GetAttributableValue): Cope with optimized values.
411
412 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
413
414         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
415         From #77961.
416
417 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
418
419         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
420         in an embedded statement too.
421
422 2006-04-01  Raja R Harinath  <rharinath@novell.com>
423
424         Fix #77929
425         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
426         testing.
427
428         Fix #77958
429         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
430
431         Fix #77962
432         * report.cs (SymbolRelatedToPreviousError): Drop generic type
433         arguments before checking whether a type is reflected or not.
434
435         Fix #77954
436         * expression.cs (Invocation.IsApplicable): Ensure a generic method
437         definition doesn't take part in overload resolution.
438         (Invocation.IsParamsMethodApplicable): Likewise.
439         (Invocation.OverloadResolve): When replacing a reflected override
440         method with its base definition, ensure that type arguments are
441         applied.
442
443 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
444
445         A fix for #77966.
446
447         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
448         was not specified.
449
450         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
451
452 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
453
454         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
455         phase.
456
457         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
458         LocalTemporary change.
459
460         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
461         TypeContainer.
462         (ClassOrStruct.DefineFieldInitializers): Implemented static field
463         initializers optimization.
464         (ClassOrStruct.TypeAttr): Moved from modifiers.
465         (Constructor.CheckBase): Don't crash when static ctor has parameters.
466         (FieldBase.ResolveInitializer): Resolves initializer.
467         (FieldBase.HasDefaultInitializer): New property.
468
469         * cs-parser.jay: Removed message.
470
471         * expression.cs (CompilerGeneratedThis): New specialization.
472
473         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
474
475 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
476
477         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
478
479 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
480
481         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
482         be now EnumConstants only.
483
484 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
485
486         * attribute.cs, driver.cs: Reset more caches.
487
488 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
489
490         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
491
492 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
493
494         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
495         for easier reuse. Updated all overrides.
496         (IntegralConstant): New base class for all integral constants.
497         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
498         of the constant range, report custom error.
499         (UIntConstant.Reduce): Fixed uint conversion.
500
501         * ecore.cs, literal.cs: Reduce updates.
502
503 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
504
505         A fix for #75813.
506
507         * class.cs (Constructor.Define): Removed extra if for default ctors.
508         A patch from Atsushi Enomoto.
509
510 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
511
512         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
513         GetAttributableValue.
514
515         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
516         when required.
517
518         * convert.cs (ImplicitConversionRequired): Error message moved to
519         DoubleLiteral.
520
521         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
522         automatic implicit conversion of an output value.
523         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
524
525         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
526         conversion.
527         (TypeOf.GetAttributableValue): Add extra handling for object type.
528
529         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
530         special error message.
531
532 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
533
534         * class.cs (Constructor.Emit): Don't crash when struct ctor is
535         InternalCall.
536         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
537         compatible with MS runtime.
538
539 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
540
541         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
542         attribute arguments here.
543
544         * class.cs (Indexer.Define): The check was moved to attribute class.
545
546 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
547
548         * expression.cs (StringConcat.Append): Reverted back to no warning state.
549
550 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
551
552         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
553
554         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
555         the blocks too.
556
557 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
558
559         * doc-bootstrap.cs : fix build.
560
561 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
562
563         * expression.cs (StringConcat.Append): Issue a warning when empty string
564         is going to append.
565
566 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
567
568         * assign.cs (CompoundAssign.ResolveSource): Removed.
569
570         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
571         clean up.
572
573         * class.cs (TypeContainer.FindMethods): Removed.
574         (TypeContainer.CheckMemberUsage): Made static.
575
576         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
577
578         * constant.cs (CheckRange): Removed unused type argument.
579         (CheckUnsigned): Removed unused type argument.
580
581         * cs-parser.jay: Updated after MemberAccess clean up.
582         Uses Length for empty string test.
583
584         * cs-tokenizer.cs: Uses Length for empty string test.
585         (IsCastToken): Made static.
586         (is_hex): Made static.
587         (real_type_suffix): Made static.
588
589         * decl.cs (SetupCache): Made static.
590         (OnGenerateDocComment): Removed unused ds argument.
591
592         * delegate.cs (VerifyDelegate): Removed unused argument.
593
594         * doc.cs: Uses Length for empty string test.
595
596         * driver.cs: Uses Length for empty string test.
597
598         * enum.cs (IsValidEnumType): Made static
599
600         * expression.cs (EnumLiftUp): Removed unused argument.
601         (ResolveMethodGroup): Ditto.
602         (BetterConversion): Ditto.
603         (GetVarargsTypes): Ditto.
604         (UpdateIndices): Ditto.
605         (ValidateInitializers): Ditto.
606         (MemberAccess.ctor): Ditto.
607         (GetIndexersForType): Ditto.
608
609         * flowanalysis.cs: (MergeFinally): Removed unused argument.
610
611         * iterators.cs: Updated after MemberAccess clean up.
612
613         * location.cs: Uses Length for empty string test.
614
615         * namespace.cs: Uses Length for empty string test.
616
617          * report.cs (CheckWarningCode): Made static.
618
619         * statement.cs (LabeledStatement): Removed unused argument.
620
621         * typemanager.cs (FilterNone): Removed.
622
623 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
624
625         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
626         obsolete.
627
628         * class.cs: Updated.
629
630 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
631
632         * cs-parser.jay.cs: __arglist is not allowed for delegates.
633
634 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
635
636         A fix for #77816.
637
638         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
639         host container.
640         (AnonymousMethod.ImplicitStandardConversionExists): New method.
641         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
642         Add more error reporting; Fixed issue with params.
643
644         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
645
646         * cs-parser.jay: AnonymousMethod requires host container.
647
648         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
649
650 2006-03-18  Raja R Harinath  <harinath@gmail.com>
651
652         * class.cs: Change 'TypeContainer ds' constructor argument to
653         'DeclSpace parent'.  Some classes were missed below due to
654         different naming convention.
655
656         * class.cs (MemberCore.Parent): Delete.  This makes the
657         ParentContainer changes below enforceable by the compiler.
658
659         Treat pointers to enclosing declaration space as 'DeclSpace', not
660         'TypeContainer'.
661         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
662         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
663
664         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
665         of TypeContainer.
666         (Block.AddThisVariable): Likewise.
667         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
668         (AbstractPropertyEventMethod.Emit): Likewise.
669         (AbstractPropertyEventMethod.EmitMethod): Likewise.
670         (GetMethod.Define, SetMethod.Define): Likewise.
671         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
672         (DelegateMethod.EmitMethod): Likewise.
673
674         Fix regression test-partial-13.cs.
675         Rationalize use of PartialContainer.  Ensure that the partial
676         class semantics can be tied to type-correctness, i.e., any
677         violation will cause a compile error.
678         * class.cs, const.cs: Access all fields that belong to class
679         TypeContainer via ParentContainer.  Arguments of EmitContexts and
680         Resolve()-like functions still use 'Parent'.
681
682         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
683         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
684         (PropertyMethod.CheckModifiers): Remove unused argument.
685         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
686         DeclSpace.
687
688 2006-03-28  Raja R Harinath  <rharinath@novell.com>
689
690         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
691
692 2006-03-17  Raja R Harinath  <harinath@gmail.com>
693
694         Make semantics of PartialContainer simpler.
695         * decl.cs (DeclSpace.IsPartial): Remove.
696         * class.cs (TypeContainer.IsPartial): Likewise.
697         (TypeContainer..ctor): Set PartialContainer to point to self.
698         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
699         (TypeContainer.FindNestedType): Likewise.
700         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
701
702 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
703
704         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
705
706 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
707
708         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
709         classes.
710
711 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
712
713         * class.cs (Operator.Define): An error for base conversion was not
714         reported correctly.
715
716 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
717
718         A fix for #77593, #77574.
719
720         * class.cs (MethodCore.CheckBase): Another if for operator.
721
722 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
723
724         A fix for #77822.
725
726         * expression.cs (VerifyArgumentsCompat): Reverted to double error
727         reporting, it's more tricky than I thought.
728
729 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
730
731         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
732         were not resolved
733
734         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
735         (DelegateCreation.ImplicitStandardConversionExists): New method for just
736         conversion test.
737         
738         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
739         not needed.
740
741 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
742
743         A fix for #77353.
744
745         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
746         (Event.Define): ditto
747         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
748
749         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
750         Removed redundant code and set NewSlot for Invoke method too.
751
752         * parameter.cs (Parameters.ctor): Add custom, type ctor.
753         (Parameters.MergeGenerated): New method. Use this method when you merge
754         compiler generated argument with user arguments.
755
756 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
757
758         * attribute.cs (ResolveAsTypeTerminal): Removed.
759
760         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
761         specialization for predefined types; 30% speed up.
762         Finally placed obsolete check to right place.
763         (Expression.ResolveType): Removed.
764
765         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
766         Updated after ResolveType was removed.
767
768         * expression.cs (Cast.ctor): Check void cast.
769         (Binary.ResolveAsTypeTerminal): Is never type.
770         (Conditional.ResolveAsTypeTerminal): Is never type.
771
772         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
773
774 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
775
776         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
777
778 2006-03-23  Martin Baulig  <martin@ximian.com>
779
780         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
781         type check if either of the types is an open generic type.
782
783 2006-03-23  Martin Baulig  <martin@ximian.com>
784
785         * convert.cs
786         (Convert.ExplicitTypeParameterConversion): New method; implement
787         explicit type parameter conversions.
788
789 2006-03-23  Martin Baulig  <martin@ximian.com>
790
791         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
792         blindly allow all conversions if we do not have any constraints.
793
794 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
795
796         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
797         these two separated members to simplify the code.
798         (Attribute.Resolve): Refactored to use new fields and methods.
799         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
800         implemented obsolete attribute checking.
801         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
802         implemented obsolete checking again. It look line never ending quest ;-)
803         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
804
805         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
806
807         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
808
809         *class.cs (Property.Define): Add RegisterProperty call.
810
811         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
812         argument groups (only 2).
813
814         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
815         encoding expression to arguments.
816         (Expression.ExprClassToResolveFlags): Just turned to property.
817
818         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
819         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
820         optimized as well as implemented support for zero-length attributes.
821
822         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
823         Add caching of PropertyInfo's.
824
825 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
826
827         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
828         error multiple times.
829
830 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
831
832         New partial class implementation.
833         A fix for #77027, #77029, #77403
834
835         * attribute.cs (Attributable): Made attributes protected.
836
837         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
838         the replacements of ClassPart and PartialContainer.
839         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
840         (TypeContainer.AddInterface): Ditto.
841         (TypeContainer.AddPartial): The main method for partial classes. It checks
842         for errors and merges ModFlags and attributes. At the end class is added to
843         partial_parts list.
844         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
845         required here.
846         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
847         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
848         from the rest of partial classes.
849         (TypeContainer.GetClassBases): Simplified.
850         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
851         DefineType.
852         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
853         (TypeContainer.HasExplicitLayout): Uses Flags now.
854         (PartialContainer): Removed.
855         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
856         (StaticClass): Was merged with Class.
857         (Class.GetClassBases): class and static class bases are verified here.
858         (Class.TypeAttr): Added static attributes when class is static.
859         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
860         (MemberBase): In some cases we need to call parent container for partial
861         class. It should be eliminated but it's not easy now.
862
863         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
864
865         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
866         partial classed to accumulate class comments.
867         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
868
869         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
870
871         * driver.cs (MainDriver): Tree.GetDecl was removed.
872
873         * modifiers.cs (Modifiers): Add partial modifier.
874
875         * tree.cs (Tree.decl): Removed.
876         (RootTypes): Started to use this class more often for root types
877         specializations.
878
879 2006-03-23  Raja R Harinath  <rharinath@novell.com>
880
881         * generic.cs (TypeParameter.UpdateConstraints): Update
882         'constraints' if null.
883
884 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
885
886         A fix for #77615
887
888         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
889         external interface does not have an attribute.
890
891 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
892
893         Another prerequisites for new partial classs implementation.
894         
895         * attribute.cs (Attribute.Equal): Implemented.
896         (Attribute.Emit): Changed as attributes can be applied more than twice.
897         (Attributes.Emit): Check for duplicate attributes here.
898
899         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
900         as a parameter, clean-up.
901
902 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
903
904         A fix for #77485
905
906         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
907         contains obsolete attribute check which can in some cases look for base
908         type of current class which is not initialized yet.
909         (TypeContainer.BaseType): Replacement of ptype.
910
911         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
912
913 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
914
915         First of prerequisites for new partial classs implemention.
916         
917         * attribute.cs (Attributable): Extended by ResolveContext;
918         Attributes finally have correct context for resolving in all cases.
919         (AttachTo): Attribute owner is assigned here.
920
921         * codegen.cs (IResolveContext): Introduce new interface to hold
922         all information needed in resolving phase.
923         (EmitContext): Implements IResolveContext; more clean-up needed here.
924         
925         * decl.cs (MemberCore): Implemented IResolveContext.
926
927         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
928         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
929         parameter.cs, statement.cs, tree.cs, typemanager.cs:
930         Refactored to use new IResolveContext instead of EmitContext; cleanup
931
932 2006-03-22  Raja R Harinath  <rharinath@novell.com>
933
934         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
935         mcs to keep code differences small.
936         * attribute.cs (Attribute.GetParameterDefaultValue): New.
937         * typemanager.cs (parameter_default_value_attribute_type): New.
938         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
939         CS1908 check.
940
941 2006-03-22  Martin Baulig  <martin@ximian.com>
942
943         * generic.cs
944         (Nullable.NullableLiteral): Derive from `NullLiteral'.
945
946         * convert.cs
947         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
948         instead of the normal `NullLiteral'.
949
950 2006-03-21  Martin Baulig  <martin@ximian.com>
951
952         Fix #77583.
953         * generic.cs (TypeManager.InferType): If `pt' is a generic
954         parameter, don't check whether `pt == at'.
955
956 2006-03-20  Raja R Harinath  <rharinath@novell.com>
957
958         Fix #77852
959         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
960         (TypeParameter.Resolve): Update to change.
961         (ConstraintChecker.CheckConstraints): Resolve type-argument
962         constraints before use.
963
964 2006-03-16  Martin Baulig  <martin@ximian.com>
965
966         * generic.cs
967         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
968         and don't have any instance constructors, also lookup in the base class.
969         (TypeManager.IsNullableValueType): New public method.
970
971         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
972         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
973         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
974
975         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
976         instead of just TypeManager.IsNullableType() to determine whether
977         a lifted operator exists.
978         (UnaryMutator.DoResolve): Likewise.
979         (Conditional.DoResolve): Likewise.
980         (Binary.DoResolve): A lifted operator only exists if both operands
981         are valuetypes and at least one of them is a nullable type.
982
983 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
984
985         * iterator.cs : yield break is allowed in try statement which has
986           catch clauses. Fixed bug #77767.
987
988 2006-03-12  Martin Baulig  <martin@ximian.com>
989
990         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
991         private IsSignatureEqual() to compare types; see the comment in
992         that method; fixes #77674.
993
994 2006-03-10  Raja R Harinath  <rharinath@novell.com>
995
996         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
997         (Expression.ResolveAsTypeTerminal): Likewise.
998         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
999         * expression.cs, generic.cs, iterators.cs: Likewise.
1000         * parameter.cs, statement.cs, typemanager.cs: Likewise.
1001
1002 2006-03-09  Martin Baulig  <martin@ximian.com>
1003
1004         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1005         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1006
1007 2006-03-09  Martin Baulig  <martin@ximian.com>
1008
1009         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1010         `prepared' flag is set.
1011
1012         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1013         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1014         issues; see gtest-254.cs.
1015
1016 2006-03-07  Martin Baulig  <martin@ximian.com>
1017
1018         * generic.cs (TypeManager.InferType): Allow infering
1019         `IEnumerable<T>' with an array of T; see gtest-251.cs.
1020
1021 2006-03-06  Martin Baulig  <martin@ximian.com>
1022
1023         * generic.cs
1024         (TypeManager.InferType): Fix gtest-250.cs.
1025
1026         * typemanager.cs
1027         (TypeManager.IsSubclassOf): Also check the base class.
1028
1029         * expression.cs
1030         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1031         fixes gtest-249.cs.
1032
1033 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1034
1035         Fix #77679.
1036         * expression.cs (ParameterReference.DoResolveBase): Change return
1037         type to bool.
1038         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1039         Update.
1040
1041         Fix #77628.
1042         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1043
1044         Fix #77642.
1045         * typemanager.cs (GetFullNameSignature): Don't nullref on
1046         protected accessors.
1047
1048 2006-02-16  Martin Baulig  <martin@ximian.com>
1049
1050         * generic.cs
1051         (TypeManager.GetGenericFieldDefinition): New public method; use it
1052         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1053
1054 2006-02-14  Martin Baulig  <martin@ximian.com>
1055
1056         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1057
1058 2006-02-14  Martin Baulig  <martin@ximian.com>
1059
1060         * generic.cs
1061         (TypeManager.DropGenericMethodArguments): New public method; don't
1062         use GetGenericMethodDefinition() on something which is not a
1063         generic method.
1064
1065 2006-02-14  Martin Baulig  <martin@ximian.com>
1066
1067         * generic.cs
1068         (ConstraintChecker.CheckConstraints): If a type parameter has the
1069         `struct' constraint, the type must be a non-nullable valuetype.
1070
1071 2006-02-10  Martin Baulig  <martin@ximian.com>
1072
1073         * typemanager.cs
1074         (TypeManager.IsOverride): Make this work for instantiated methods
1075         in a generic class; fixes #77509.
1076         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1077         rather than calling it directly; fixes #77488.  
1078
1079 2006-02-08  Martin Baulig  <martin@ximian.com>
1080
1081         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1082         reporting into CheckConstraint() so we can use the correctly
1083         instantiated type.
1084
1085 2006-02-08  Martin Baulig  <martin@ximian.com>
1086
1087         * expression.cs (BaseAccess): Add support for generic methods.
1088
1089         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1090         the new MethodGroupExpr.
1091
1092 2006-02-07  Martin Baulig  <martin@ximian.com>
1093
1094         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1095         also reference types; fixes #77483.
1096
1097 2006-02-07  Martin Baulig  <martin@ximian.com>
1098
1099         * generic.cs
1100         (TypeManager.IsGenericMethod): We now return whether something is
1101         an instantiated generic method (and not a generic method def).
1102         (TypeManager.IsGenericMethodDefinition): New public method.
1103
1104         * typemanager.cs
1105         (TypeManager.CSharpSignature): Only include type arguments for
1106         "real" generic methods, not for any instantiated method.
1107         (TypeManager.GetMethodName): Likewise, but also allow generic
1108         method definitions here.
1109
1110 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1111
1112         * codegen.cs (EmitScopeInitFromBlock): check here the
1113         capture_context, there is no need to make two calls to the
1114         EmitContext. 
1115
1116         * anonymous.cs: Add some debugging messages that might help me
1117         track other instances of this problem in the future (the
1118         regression of test 467).
1119
1120         * cs-parser.jay: track the variable block, as we need to initalize
1121         any captured variables declared in this block for the "catch"
1122         portion of the "Try" statement.
1123
1124         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1125         scope initialization for captured variables. 
1126
1127         Also, move the emit for the variables after the block location has
1128         been marked.
1129
1130 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1131
1132        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1133         
1134 2006-02-06  Martin Baulig  <martin@ximian.com>
1135
1136         * class.cs (TypeContainer.DefineType): If we're a struct, pass
1137         `TypeManager.value_type' as parent type to
1138         ModuleBuilder.DefineType().  Fixes #77358.      
1139
1140 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1141
1142         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1143         commit yesterday, the initialization for the roots is necessary.
1144         What is not necessary is the scope activation.
1145
1146 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1147
1148         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1149         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1150         CS0206 checks.
1151         (Argument.Resolve): Remove CS0206 checks.
1152
1153 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1154
1155         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1156         scopes for all the roots, the scopes will now be emitted when the
1157         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1158
1159         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1160         code.  This reduces a lot of existing cruft.
1161         
1162         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1163         that the ScopeInfo is generated as we enter the scope, not at the
1164         time of use, which is what we used to do before.
1165
1166         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1167         every time a Block is about to be emitted if we have a
1168         CaptureContext. 
1169
1170 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1171
1172         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1173         attribute for mscorlib too.
1174
1175         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1176         (Reset): Update.
1177         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1178
1179         * typemanager.cs (cons_param_array_attribute): Make private.
1180         (Reset): Set it to null.
1181         (InitCoreHelpers): Don't initialize it.
1182         (ConsParamArrayAttribute): New.  Initialize it as needed.
1183         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1184
1185 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1186
1187         * expression.cs: There might be errors reported during the
1188         selection of applicable methods.  If there are errors, do not
1189         continue execution as it will lead the compiler to crash.
1190
1191 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1192
1193         * expression.cs: Member access is not allowed on anonymous
1194         methods.  Fixes #77402.
1195
1196 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1197
1198         Fix #77401
1199         * cs-parser.jay (VariableDeclaration): Don't set
1200         current_array_type to null.
1201         (field_declaration, event_declaration, declaration_statement):
1202         Set it to null here.
1203
1204 2006-01-29  Raja R Harinath  <harinath@gmail.com>
1205
1206         Fix part of #77397
1207         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1208
1209 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1210
1211         * typemanager.cs (GenericParameterPosition): New.
1212         * doc.cs: Use it.
1213
1214 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1215
1216         * doc.cs : To process "include" elements, first we should create
1217           another list than XmlNodeList, because it could result in node
1218           removal, which could result in that the XmlNodeList gives up
1219           yielding next node.
1220
1221 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1222
1223         * expression.cs: Introduce an error report that we were not
1224         catching before.   Gonzalo ran into it.
1225
1226 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1227
1228         A fix for bug: #76957
1229         
1230         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1231         ComputeMethodHost before creating the method, this is a new
1232         requirement. 
1233
1234         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1235         that this method references (RegisterScope).  The actual scope
1236         where the method is hosted is computed with the ComputeMethodHost
1237         before we create the method.
1238
1239         Moved the Deepest routine here.
1240
1241         (AnonymousContainer.ComputeMethodHost): New routine used to
1242         compute the proper ScopeInfo that will host the anonymous method.
1243
1244         (ScopeInfo): Deal with multiple roots.  The problem was that we
1245         did not have a unique root where all ScopeInfos could be hanged
1246         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1247         of roots.  
1248
1249         Remove AdjustMethodScope which is now computed at the end.  Remove
1250         LinkScope which did a partial link, instead link all ScopeInfos
1251         before code generation from the new "LinkScopes" routine. 
1252
1253         Simplify all the Add* routines as they no longer need to maintain
1254         the tree, they just need to record that they are using variables
1255         from a ScopeInfo.
1256
1257         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1258         routines to produce the forest of ScopeInfo trees.
1259
1260         * class.cs (TypeContainer.AppendMethod): This is just like
1261         AddMethod, but ensures that an interface implementation method
1262         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1263         methods, but at the end.
1264
1265         We use this functionality to ensure that the generated MoveNext
1266         method in the iterator class is resolved/emitted before the
1267         enumerator methods created.   
1268
1269         This is required because the MoveNext method computes the right
1270         ScopeInfo for the method.  And the other methods will eventually
1271         need to resolve and fetch information computed from the anonymous
1272         method. 
1273
1274         
1275 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1276
1277         Improve implementation of section 14.4.2.2 (Better function member).
1278         * expression.cs (Invocation.MoreSpecific): Compare all type
1279         arguments before deciding if one type is more specific than
1280         another.  Handle array types too.  Return the more specific type.
1281         (Invocation.BetterFunction): Add more tie-breaking rules from
1282         section 14.4.2.2.  Perform "more specific" check after
1283         other tie-breaking rules.  Compare all parameter types before
1284         choosing the "more specific" method.
1285
1286 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1287             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1288
1289         Fix rest of #76995.
1290         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1291         the 'aliases' hash.
1292         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1293         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1294
1295 2006-01-18  Martin Baulig  <martin@ximian.com>
1296
1297         * class.cs (TypeContainer.AddToMemberContainer): Use
1298         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1299         fixes #77124.
1300
1301 2006-01-18  Martin Baulig  <martin@ximian.com>
1302
1303         Fix #76417: a generic class may now have methods which may unify
1304         for some type parameter substitutions.
1305
1306         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1307         for methods which may unify anymore.
1308
1309         * expression.cs (Invocation.MoreSpecific): New private static
1310         method; checks whether one method is more specific than another
1311         according to 14.4.2.2 of the spec.
1312         (Invocation.BetterFunction): Implement the tie-breaking rules from
1313         14.4.2.2 of the spec: if two methods unify for some type parameter
1314         substitution, we need to pick the more specific one.
1315
1316 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1317
1318         Fix #76656, cs0231-2.cs.
1319         * cs-parser.jay (formal_parameter_list): Make error case catch
1320         more issues.
1321         (parenthesized_expression_0): Add CS1026 check.
1322         (invocation_expression): Remove unused { $$ = lexer.Location }.
1323
1324 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1325
1326         Fix #76824.
1327         * cs-parser.jay (statement_expression): Don't list out the
1328         individual statement-expressions.  Convert syntax error into
1329         CS0201 check.
1330
1331 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1332
1333         Fix #76874.
1334         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1335         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1336         CheckIntermediateModification.
1337         (FieldExpr.DoResolve): Add new two-argument version that
1338         allows us to resolve the InstanceExpression as an lvalue.
1339         The one-argument variant is now just a wrapper.
1340         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1341         Resolve the lhs as an lvalue if the it has a value type.
1342         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1343         from Assign.DoResolve.
1344         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1345         resolved as an lvalue.
1346         (PropertyExpr.DoResolve): Update.
1347         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1348         has a value type.  Move CS1612 check here from
1349         CheckIntermediateModification.
1350         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1351         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1352         'right_side' of a ResolveLValue on an 'out' argument.
1353         (EmptyExpression.LValueMemberAccess): New.  Used as the
1354         'right_side' of a propagated ResolveLValue on a value type.
1355         (LocalVariableReference.DoResolveBase): Recognize
1356         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1357         Add CS1654 check.
1358         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1359         EmptyExpression.Null.
1360
1361 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1362
1363         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1364           Type.IsGenericParameter(). Fixed bug #77183.
1365         * doc.cs : it is now identical to doc.cs in mcs.
1366
1367 2006-01-16  Martin Baulig  <martin@ximian.com>
1368
1369         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1370
1371 2006-01-16  Martin Baulig  <martin@ximian.com>
1372
1373         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1374         ctors; fixes #77250.
1375
1376 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1377
1378         This fixes the problem where we used ldfld instead of ldflda to
1379         load the "THIS" pointer on captured parameters, when THIS is a
1380         value type.  See bug #77205.
1381         
1382         * iterators.cs (CapturedThisReference.Emit): Pass false to
1383         EmitThis (we do not need the address).
1384
1385         * codegen.cs (EmitThis): it needs to know whether we need the
1386         address of `this' or not.  This is used by value types.  
1387
1388         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1389         every other call passes false.
1390
1391 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1392
1393         Fix #77221.
1394         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1395         GetOverride.
1396         * expression.cs (Invocation.OverloadResolve): Update.
1397         (Invocation.DoResolve): Avoid double resolution of invocation.
1398
1399 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1400
1401         Fix #77180.
1402         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1403         unary negation of floating point types as 0-expr; negation cannot
1404         overflow in floating point types.
1405
1406         Fix #77204.
1407         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1408         on operands of 'void' type.
1409
1410         Fix #77200.
1411         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1412         and ExclusiveOr for boolean constants too.
1413
1414 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1415
1416         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1417
1418 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1419
1420         * cs-tokenizer.cs (Position): New class used to save and restore
1421         the position state in the tokenizer.  Before this patch the save
1422         and restore was not complete enough so the line and columns would
1423         start to drift and the debugger and stack traces will get the
1424         wrong data.
1425
1426 2006-01-10  Martin Baulig  <martin@ximian.com>
1427
1428         * generic.cs
1429         (TypeParameter.InflateConstraints): New public method.
1430
1431         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1432         constraints; fixes #77042.
1433
1434 2006-01-10  Martin Baulig  <martin@ximian.com>
1435
1436         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1437         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1438         #77061. 
1439
1440 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1441
1442         Fix #75636.
1443         * expression.cs (Invocation.OverloadResolve): Replace reflected
1444         override methods with their base virtual methods, rather than
1445         skipping over them.
1446         * typemanager.cs (TypeManager.GetOverride): New.
1447
1448 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1449
1450         * driver.cs: Report the case of no source files and no -out:
1451         argument provided.
1452
1453 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1454
1455         Fix #77035.
1456         * expression.cs (ComposedCast.GetSignatureForError): Define.
1457
1458 2006-01-05  Jb Evain  <jbevain@gmail.com>
1459
1460         * class.cs (Property.Define, Indexer.Define): do not tag the
1461         properties as SpecialName | RTSpecialName.
1462
1463 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1464
1465         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1466         doing a low-level comparission of parameter types.  It was lacking
1467         a check for __argslist. 
1468
1469 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1470
1471         * expression.cs (ParameterReference.DoResolveBase): Allow
1472         reference parameters if they are local to this block. 
1473
1474         This allows the ref and out parameters of a delegate to be used in
1475         an anonymous method, for example:
1476
1477         delegate void set (out int x);
1478
1479         set s = delegate (out int x){
1480                 x = 0;
1481         };
1482
1483         This is used by functionality introduced late in the C# language.
1484         
1485         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1486         method that take ref and out parameters. 
1487
1488         Fixes #77119 which was a late change in the spec.
1489
1490 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1491
1492         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1493         parent if its the same scope.  Fixes #77060.
1494
1495 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1496
1497         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1498
1499 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1500
1501         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1502         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1503         that doesn't contain the full public key. This is a update of the
1504         friend assemblies in .Net 2.0 release.
1505         
1506 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1507
1508         Fix #76995
1509
1510         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1511         ListDictionary, to contain the ExternAliasEntry entries (in
1512         addition to the NamespaceEntry.aliases hashtable). This field is
1513         shared between the original entry and its doppelganger (bodyless 
1514         copy of it).
1515         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1516         extern_aliases field.
1517         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1518         lookup in extern_aliases.
1519
1520 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1521
1522         Fix #77006.
1523         * class.cs (TypeContainer.Mark_HasEquals): New.
1524         (TypeContainer.Mark_HasGetHashCode): New.
1525         (ClassPart): Override them.
1526         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1527
1528         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1529         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1530         DeclSpace.
1531
1532         Fix #77008.
1533         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1534         'parent' argument to the base constructor.
1535
1536         Remove all mention of TypeContainer from decl.cs.
1537         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1538         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1539         (DeclSpace.DeclSpace): Likewise.
1540         (DeclSpace.DefineMembers): Remove unused argument.
1541         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1542         debugging check -- we don't care if the debug code throws an
1543         InvalidCastException instead of an InternalErrorException.
1544         * class.cs (TypeContainer.DefineMembers): Update to changes.
1545         (TypeContainer.DoDefineMembers): Likewise.
1546         (TypeContainer.GetMethods): Likewise.
1547         (PropertyMember.Define): Likewise.
1548         (MemberBase.Parent): New property that forwards to
1549         MemberCore.Parent, but ensures that we get a TypeContainer.
1550         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1551         (RootContext.PopulateTypes): Likewise.  Remove special case code
1552         for !RootContext.StdLib: DefineMembers is idempotent.
1553
1554 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1555
1556         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1557
1558 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1559
1560         * doc.cs : The search for referenced namespace was insufficient to
1561           get global one as it used to do. Fixed bug #76965.
1562
1563 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1564
1565         * doc.cs : check name in cref in the last phase that whether it is
1566           namespace or not.
1567
1568 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1569
1570         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1571           Mono.C5.
1572
1573 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1574
1575         * doc.cs : so it turned out that we cannot skip override check for 
1576           interface members. Fixed bug #76954.
1577
1578 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1579
1580         * cs-tokenizer.cs : fixed bug #75984:
1581           - #warning and #error should not be handled when the source line
1582             is disabled.
1583           - #line is not checked strictly when the source line is disabled.
1584           - #define and #undef is on the other hand checked strictly at any
1585             state.
1586
1587 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1588
1589         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1590           CS1027 report.
1591
1592 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1593
1594         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1595
1596         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1597         nested types.
1598
1599 2005-12-14  Martin Baulig  <martin@ximian.com>
1600
1601         * typemanager.cs (TypeManager.GetFullName): Make this public;
1602         `Type.Fullname' now never returns null.
1603
1604         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1605         explicit interface implementations; we're now using the same
1606         naming convention than csc does.
1607
1608 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1609
1610         * convert.cs (ExplicitConversionCore): Check the return value from
1611         ExplicitConversionCore which can return null on failure.  Fixes #76914
1612
1613 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1614
1615         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1616         instead of IsGenericInstance.
1617         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1618         code that's now covered by the more general test.
1619         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1620
1621         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1622         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1623         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1624         * generic.cs, report.cs, typemanager.cs: Likewise.
1625
1626 2005-12-08  Martin Baulig  <martin@ximian.com>
1627
1628         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1629
1630         * typemanager.cs (TypeManager.CSharpSignature): Include type
1631         arguments in the signature of a generic method.
1632
1633 2005-12-07  Martin Baulig  <martin@ximian.com>
1634
1635         Add support for custom attributes on type parameters.
1636
1637         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1638
1639         * generic.cs (TypeParameterName): New public class; we use this
1640         instead of a `string' to store the name of a type parameter, so we
1641         can also have `Attributes'.
1642         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1643         array instead of a `string[]' array.
1644         (TypeParameter.ctor): We now also take an `Attributes' argument.
1645         (TypeParameter.EmitAttributes): New public method; emit our
1646         `OptAttributes' here.
1647         (GenericMethod.EmitAttributes): New public method; emit the custom
1648         attributes on all our type parameters.
1649
1650         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1651         our type parameters.
1652         (MethodData.Define): If we're a generic method, call
1653         EmitAttributes() on it.
1654
1655 2005-12-07  Martin Baulig  <martin@ximian.com>
1656
1657         * generic.cs
1658         (ConstraintChecker): New public abstract class; move the
1659         constraint checking here from `ConstructedType' and also do
1660         constraint checking for generic methods here.
1661
1662         * expression.cs (Invocation.OverloadResolve): Use
1663         ConstraintChecker.CheckConstraints() if we resolved to a generic
1664         method.  Fix #76806.
1665
1666 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1667
1668         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1669
1670         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1671         event initializers.
1672         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1673         (FieldBase.Initializer): Initializer is now optional.
1674         (EventField.Define): Only event field can have initializer.
1675
1676         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1677
1678         * const.cs (Const): Reuse initializer.
1679
1680         * cs-parser.jay: Updated after FieldBase changes.
1681         Added current_array_type to simplify array initializers.
1682
1683         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1684
1685         * expression.cs, iterators.cs: Updated.
1686
1687         * namespace.cs (NamespaceEntry): Made UsingFound private.
1688
1689 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1690
1691         * parameterCollection.cs: Obsolete, removed.
1692         * parser.cs: Obsolete, removed.
1693
1694 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1695
1696         Fix #76849.
1697         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1698
1699         * enum.cs (Enum.Define): Set obsolete context here.
1700
1701 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1702
1703         * doc.cs :
1704           - FindDocumentedMember() now expects 1) paramList as null
1705             when "we don't have to check the number of parameters" and
1706             2) Type.EmptyTypes when "there is no arguments".
1707           - Introduced FoundMember struct to hold the exact type which was
1708             used to find the documented member (the above change broke
1709             test-xml-044; it might be better just to use DeclaringType than
1710             what MS does, like this change does, but it depends on usage.)
1711
1712 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1713
1714         * doc.cs : documented member might be from DeclaringType for nested
1715           types. Fixed bug #76782.
1716
1717 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1718
1719         * anonymous.cs: Have the param code handle leaving copies on the
1720         stack etc. Allows anonymous params to take part in the assignment
1721         code (++, +=, etc). Fixes bug #76550
1722
1723         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1724         it down to the anon code.
1725
1726         * iterators.cs: Use dummy var here
1727
1728         * codegen.cs: Handle new vars
1729
1730 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1731
1732         Fix #76849.
1733         * class.cs (MethodData.Define): Set proper Obsolete context.
1734
1735         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1736         obsolete context.
1737         (FieldExpr.DoResolve): Ditto.
1738
1739 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1740
1741         Fix #76849.
1742         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1743         parent is not obsolete.
1744
1745 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1746
1747         * doc.cs : (FindDocumentedMember) find parameterless members first
1748           and get CS0419 in the early stage. Fixed first case of bug #76727.
1749
1750 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1751
1752         Fix #76859.
1753         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1754         no error was reported.
1755
1756         *expression.cs (Binary.DoResolve): left can be null.
1757
1758 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1759
1760         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1761         abstract method and all overrides.
1762         * support.cs (ParameterData.GenericConstraints): Delete.
1763         (ReflectionParameters.type_params): Delete.
1764         (ReflectionParameters.ReflectionParameters): Make private.
1765         (ReflectionParameters.GetConstaints): New factory method.
1766         * generic.cs (TypeParameterDefineType): Use it.
1767         (TypeManager.GetTypeParameterConstraints): Likewise.
1768
1769 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1770
1771         Fix #76783.
1772         * class.cs (MethodData.Emit): Parameters should be labeled first.
1773
1774 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1775
1776         Fix #76761.
1777         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1778
1779 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1780
1781         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1782
1783         * class.cs (MethodCore): Parameter clean up.
1784         (IMethodData): Added ParameterInfo.
1785         (MethodData): Parameter clean up.
1786         (Indexer.Define): Parameter clean up.
1787
1788         * anonymous.cs,
1789         * codegen.cs,
1790         * cs-parser.jay,
1791         * decl.cs,
1792         * doc.cs,
1793         * ecore.cs,
1794         * flowanalysis.cs,
1795         * iterators.cs,
1796         * pending.cs,
1797         * statement.cs,
1798         * typemanager.cs: Parameter clean up.
1799
1800         * delegate.cs (Define): Get rid of duplicated code.
1801
1802         * expression.cs (ParameterReference): Removed useless parameters
1803         and simplified.
1804         (Invocation): Ditto.
1805
1806         * parameter.cs (ParamsParameter): New class, params specialization.
1807         (ArglistParameter): Attemp to separate arglist.
1808         (Parameter): Refactored to be reusable and faster.
1809         (Parameter.Modifier): Made understandable.
1810         (Parameters): Changed to be used as a class for `this' assembly
1811         parameters. Refactored to use new specialized classes.
1812
1813         * support.cs (ParameterData): Added Types property.
1814         (InternalParameters): Deleted.
1815
1816 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1817
1818         * doc.cs : the previous patch does not actually fix the bug.
1819           PropertyInfo override check is now implemented and really fixed it.
1820         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1821
1822 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1823
1824         * doc.cs : apply "override filter" also to properties.
1825           Fixed bug #76730.
1826
1827 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1828
1829         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1830           no need to check overrides. For classes, omit those results from 
1831           interfaces since they must exist in the class. Fixed bug #76726.
1832
1833 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1834
1835         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1836           with different parameters. Fixed the second problem in #76685.
1837
1838 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1839
1840         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1841           get expected 'protected' access in CheckValidFamilyAccess()).
1842           Fixed bug #76692.
1843
1844 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1845
1846         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1847           Fixed bug #76705.  CS1569 was incorrectly commented out.
1848
1849 2005-11-23  Martin Baulig  <martin@ximian.com>
1850
1851         * generic.cs (Constraints.Define): Removed.
1852         (TypeParameter.DefineConstraints): Removed.
1853         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1854         on the GenericTypeParameterBuilder here.
1855
1856 2005-11-23  Martin Baulig  <martin@ximian.com>
1857
1858         * typemanager.cs (TypeManager.GetProperty): Make this public.
1859
1860         * generic.cs (Nullable.NullableInfo.ctor): Use
1861         TypeManager.GetProperty() rather than using reflection directly.
1862
1863 2005-11-17  Martin Baulig  <martin@ximian.com>
1864
1865         * expression.cs (Indexers.GetIndexersForType): Added support for
1866         generic parameters; fixes #76587.
1867
1868 2005-11-17  Martin Baulig  <martin@ximian.com>
1869
1870         * anonymous.cs
1871         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1872         inherit the scope from our parent.  Fixes #76653.
1873
1874 2005-11-15  Martin Baulig  <martin@ximian.com>
1875
1876         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1877         instead of `ScopeTypeBuilder' to refer to the "current" type.
1878         (AnonymousMethod.CreateScopeType): Correctly create the helper
1879         class if we're inside a generic type definition.
1880
1881 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1882
1883         * doc.cs : use Invocation.IsOverride() to do real override check.
1884         * expression.cs : made Invocation.IsOverride() internal.
1885
1886 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1887
1888         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1889           TypeBuilder.FindMembers() and filter overriden base members out.
1890           Fixed bug #76990.
1891
1892 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1893
1894         * doc.cs : ref/out parameters are represented as '@' (instead of
1895           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1896
1897 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1898
1899         * doc.cs : when there was no '.' in cref to methods in doc comment,
1900           then parameters were missing in the output. Fixed bug #76691.
1901
1902 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1903
1904         * driver.cs : don't output docs when there is an error.
1905           Fixed bug #76693.
1906
1907 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1908
1909         * doc.cs :
1910           Now it should detect indexers. Fixed primary concern in bug #76685.
1911           Fixed CS0419 message to not show the identical member signature in
1912           the message.
1913
1914 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1915
1916         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1917           instead of Type.FindMembers() since it does not handle events.
1918           Fixed bug #71604.
1919
1920 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1921
1922         * codegen.cs: Fixed typo (speficied -> specified).
1923
1924 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1925
1926         Fix #76369.
1927         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1928
1929 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1930
1931         * attribute.cs: Changed error message.
1932
1933         * cs-tokenizer.cs: One more check.
1934
1935 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1936
1937         * statement.cs (Block.Resolve): Ignore empty statement.
1938
1939 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1940
1941         * report.cs: Made error/warning methods more strict to avoid
1942         their misuse.
1943
1944         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1945         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1946         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1947         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1948
1949 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1950
1951         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1952         Use the more explicit AssemblyName.FullName instead of 
1953         AssemblyName.Name to report errors.
1954         
1955 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1956
1957         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1958         with mcs.
1959
1960 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1961
1962         * class.cs,
1963         * convert.cs,
1964         * cs-parser.jay,
1965         * decl.cs,
1966         * enum.cs,
1967         * expression.cs,
1968         * generic.cs,
1969         * pending.cs,
1970         * report.cs: Fixed error reporting and typos.
1971
1972         * generic.cs (TypeParameter.GetSignatureForError): New method.
1973         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1974
1975         * typemanager.cs (GetFullName): Refactored.
1976
1977 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1978
1979         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1980         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1981
1982         * class.cs (TypeContainer.IsComImport): New property.
1983         (Constructor.Define): Create proper ctor for ComImport types.
1984
1985         * expression.cs (New.CheckComImport): Fixed.
1986
1987 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1988
1989         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1990         that a parameter has been captured does not mean that we do not
1991         have to do the rest of the processing.  This fixes the second part
1992         of #76592.  If there was another anonymous method capturing
1993         values in the past, the Scope would never be set for the second
1994         method that captured the same parameter.
1995
1996         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1997         properly manipulate the stack.   Second part of fix for #76592.
1998
1999         * expression.cs (New): Add support for invoking "new" on
2000         interfaces that have been flagged with the ComImport attribute and
2001         the CoClass.  Fixes #76637 
2002
2003         * statement.cs (Try.DoEmit): When a variable is captured, do not
2004         try to emit the vi.LocalBuilder variable as it has been captured.
2005         Create a temporary variable and store the results on the
2006         FieldBuilder.  Fixes #76642
2007
2008 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2009
2010         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2011
2012         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2013
2014         * expression.cs (Binary.DoResolve): Added && optimalization.
2015     
2016         * typemanager.cs (AddUserType): Removed useless argument.
2017
2018 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2019
2020         * statement.cs (Block.variables): Uses ListDictionary.
2021
2022 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2023
2024         Fix #75969.
2025         * class.cs (PartialContainer.EmitType): Customized to emit
2026         security attributes.
2027         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2028         for partial classes.
2029
2030 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2031
2032         Fix #76599.
2033         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2034         access has to be fixed.
2035         
2036         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2037
2038 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2039
2040         Fix #76590.
2041         * ecore.cs (NullCast.Reduce): Implemented.
2042
2043         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2044         constant type.
2045         
2046         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2047         properly.
2048         (Foreach.Resolve): Catch null properly.
2049
2050 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2051  
2052         * cs-tokenizer.cs: Warning text fix.
2053
2054         * driver.cs: AllWarningNumbers exposed on public interface.
2055
2056         * report.cs (): Reviewed warning numbers.
2057         (IsValidWarning): Use binary search.
2058
2059 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2060  
2061         * driver.cs: Implemeted resource visibility.
2062         (Resources): New class for code sharing between /res: and
2063         /linkres:
2064  
2065 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2066
2067         decl.cs (CurrentTypeParameters): Fixed to be public.
2068
2069 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2070
2071         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2072
2073 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2074
2075         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2076
2077 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
2078
2079         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2080
2081 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2082
2083         Add friend assembly access support.
2084         * typemanager.cs: assembly_internals_vis_attrs
2085         cache for friend assembly access. 
2086         (TypeManager.IsFriendAssembly): New method for
2087         checking friend assembly access.
2088         (TypeManager.Error_FriendAccessNameNotMatching): New
2089         helper method.
2090         (TypeManager.CompareKeyTokens): Likewise.
2091         (TypeManager.Filter): Handle friend accessible
2092         members.
2093
2094         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2095         friend accessible types.
2096
2097         * ecore.cs (Expression.IsAccessorAccessible): Handle
2098         friend accessible properties.
2099
2100         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2101         accessible types.
2102         
2103 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2104
2105         Fix #76568.
2106         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2107         folding.
2108         
2109         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2110         contants only.
2111         
2112         * ecore.cs (NullCast): Child is contant only.
2113         
2114         * literal.cs (NullLiteral.Reduce): null can be converted to any
2115         reference type.
2116
2117 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2118
2119         * driver.cs: Use Encoding.Default as default code page instead
2120           of ISO-28591.
2121
2122 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2123
2124         Fix #76085.
2125         * expression.cs (Invocation.Error_InvalidArguments): Handle
2126         __arglist parameters.
2127         (Invocation.VerifyArgumentsCompat): Likewise.
2128         * support.cs (ReflectionParameters.GetSignatureForError): Print
2129         __arglist parameters.
2130         (InternalParamters.GetSignatureForError): Likewise.
2131         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2132
2133 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2134
2135         * attribute.cs (GetPropertyValue): Made public.
2136
2137         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2138         Resolve.
2139         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2140         attribute.
2141         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2142         is not defined.
2143         
2144         * driver.cs: Reflect method name change.
2145         
2146         * statement.cs (Try.Resolve): Warn when try has both general
2147         exception handlers.
2148         
2149         * typemanager.cs: runtime_compatibility_attr_type new predefined
2150         type.
2151
2152 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2153
2154         Fix #76419.
2155         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2156         treat it as an empty parameter list.
2157
2158 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2159
2160         Fix #76271.     
2161         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2162         ResolveAsTypeStep silent.
2163         * statement.cs (Block.AddConstant): Mark block as used.
2164         (Block.ResolveMeta): Avoid piling on error messages
2165         if a constant initializer resolution fails.
2166
2167 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2168
2169         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2170         Remove.
2171         (NamespaceEntry.VerifyAllUsing): New.
2172         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2173         behaviour.  Delegates actual resolution of alias to ...
2174         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2175         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2176         Update.
2177         * driver.cs (Driver.MainDriver): Update.
2178         
2179         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2180         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2181         property.
2182         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2183         Remove.
2184         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2185         RootNamespace.DefineNamespacesForAll.
2186
2187 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2188
2189         * typemanager.cs (assemblies, external_aliases, modules)
2190         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2191         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2192         overhead.  Move resposibility ...
2193         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2194         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2195
2196 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2197
2198         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2199         cached_namespaces.  Improve usage.
2200         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2201         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2202         Move from GlobalRootNamespace and simplify.
2203         (RootNamespace.Global): Make instance variable.
2204         (RootNamespace.RootNamespace): Add "alias name" parameter.
2205         (GlobalRootNamespace): Simplify drastically.
2206         (Namespace.Lookup): Don't use GetNamespace.
2207         * typemanager.cs (GetRootNamespace): Rename from
2208         ComputeNamespaceForAlias.
2209         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2210
2211 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2212
2213         * anonymous.cs (AnonymousContainer): Don't crash when container
2214         doesn't exist.
2215
2216 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2217
2218         * expression.cs (Binary.DoResolve): Warn when comparing same
2219         values.
2220
2221 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2222
2223         Fix #76486.
2224         * expression.cs (Binary.DoResolve): It looks like there are no
2225         convetsion rules in enum context.
2226
2227 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2228
2229         Add support for extern alias qualifiers.
2230         * typemanager.cs: Move some LookupTypeReflection code
2231         to namespace.cs, to have cleaner code. Added some methods
2232         to help us keep track of the extern aliased references.
2233         * driver.cs: Add suport for extern alias assemblies on command
2234         line and check for their warnings/errors. Also keep track of the
2235         extern aliased assemblies.
2236         * namespace.cs: Move the global functionality of Namespace
2237         to GlobalRootNamespace/RootNamespace. Now the global namespace
2238         is GlobalRootNamespace.Globa. Also the code moved from 
2239         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2240         Finally added LocalAliasEntry (AliasEntry before) and
2241         ExternAliasEntry, to handle alias statements.
2242         * cs-parser.jay: Add support in the grammar for extern alias
2243         statement.
2244         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2245         Update callings to Namespace (now in GlobalRootNamespace).
2246
2247 2005-10-25  Martin Baulig  <martin@ximian.com>
2248
2249         * convert.cs (ImplicitTypeParameterConversion): Make base
2250         interfaces actually work; fixes #76557.
2251
2252 2005-10-25  Martin Baulig  <martin@ximian.com>
2253
2254         * generic.cs
2255         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2256         all the type parameters; fixes #76551.
2257
2258 2005-10-25  Martin Baulig  <martin@ximian.com>
2259
2260         Fix #76472.
2261
2262         * generic.cs
2263         (GenericMethod.ctor): Added `Expression return_type' and
2264         `Parameters parameters' arguments.
2265         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2266         parameter and return types to check their constraints if they're
2267         generic types.
2268
2269         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2270         boolean field.
2271
2272         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2273         constraints of a generic type if `ec.ResolvingGenericMethod'.
2274
2275         * class.cs (MethodCore.DoDefineParameters): Set
2276         `ec.ResolvingGenericMethod' if we're a generic method.
2277         (MemberBase.MemberType): Likewise.
2278
2279 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2280
2281         * typemanager.cs (TypeManager): Added 
2282         TypeManager.internals_visible_attr_type to cache
2283         S.R.CompilerServices.InternalsVisibleToAttribute.
2284
2285         * codegen.cs (AssemblyClass): Added checks for 
2286         InternalsVisibleToAttribute in new method 
2287         CheckInternalsVisibleAttribute () and also cache the
2288         AssemblyName in AssemblyClass.Name.
2289         
2290 2005-10-24  Martin Baulig  <martin@ximian.com>
2291
2292         * typemanager.cs
2293         (TypeManager.ExpandInterfaces): Added overloaded version which
2294         just takes a `Type[]' array.
2295
2296         * generic.cs
2297         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2298         just use the interfaces which were explicitly specified and not
2299         the interfaces they inherit.  Fixes #76482.
2300         (TypeParameter.FindMembers): Expand the interfaces here.
2301
2302 2005-10-21  Martin Baulig  <martin@ximian.com>
2303
2304         * generic.cs
2305         (Constraints.Resolve): Also resolve the actual types here.
2306         (Constraints.ResolveTypes): Just check the constraints here.
2307         Fixes #76363; see gtest-218.cs.
2308
2309 2005-10-21  Martin Baulig  <martin@ximian.com>
2310
2311         * convert.cs
2312         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2313         instead of a `BoxedCast'; fixes gtest-217.cs.
2314
2315 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2316
2317         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2318           1) "new()" is specified as generic parameter constraint and 2) the
2319           type is TypeBuilder and 3) the type is abstract even if it has a
2320           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2321
2322 2005-10-20  Martin Baulig  <martin@ximian.com>
2323
2324         * generic.cs
2325         (GenericConstraints.TypeParameter): New public property.
2326         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2327         (TypeParameter.DeclSpace): New public property.
2328         (TypeParameter.DefineType): Inflate the constraints if our
2329         `DeclSpace' is an `Iterator'.   
2330
2331 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2332
2333         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2334           GenericMethod argument to compare methods' generic type arguments.
2335           Fixed bug #76382.
2336
2337 2005-10-19  Martin Baulig  <martin@ximian.com>
2338
2339         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2340         not ResolveType() when resolving the base type, so we're not
2341         checking the constraints here.
2342         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2343         if we have any.
2344
2345 2005-10-19  Martin Baulig  <martin@ximian.com>
2346
2347         * generic.cs (ConstructedType.CheckConstraints): Committing
2348         untested fix for #76441.
2349
2350 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2351
2352         Fix #76371.
2353         * class.cs (TypeContainer.DefineType): Move updating of
2354         topological sort earlier in the code.
2355         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2356
2357 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2358
2359         Fix #76273.
2360         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2361         
2362         * constant.cs (Constant.TryReduce): Moved from Cast class.
2363         (Reduce): Made little bit more OO and fixed missing conversions.
2364         
2365         * ecore.cs (Reduce): Implemented.
2366         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2367         
2368         * literal.cs (Reduce): Implemented.
2369         
2370         * class.cs: Reverted Miguel's wrong commit.
2371
2372 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2373
2374         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2375
2376 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2377
2378         * cs-parser.jay, expression.cs : CS0214 was missing error location
2379           for constants. Fixed bug #76404.
2380
2381 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2382
2383         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2384         InstanceExpression.
2385         (PropertyExpr.EmitCall): Likewise.
2386         * expression.cs (Invocation.EmitArguments): Handle case where
2387         arguments == null.
2388         (Invocation.EmitCall): Avoid allocating temporary variable if
2389         there are no arguments.
2390
2391 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2392
2393         Fix #76370.
2394         * convert.cs (ExplicitConversionCore): Fixed object->enum
2395         conversion.
2396
2397 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2398
2399         Fix #76323.
2400         * convert.cs (ImplicitConversionStandard): Move conversion of
2401         void* to arbitrary pointer types ...
2402         (ExplicitConversionStandard): .. here.
2403         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2404         error to always print typenames.
2405
2406 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2407
2408         * convert.cs (GetConversionOperator): Rename from
2409         GetConversionOperators.  Move operator selection code from ...
2410         (UserDefinedConversion): ... here.
2411
2412 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2413
2414         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2415         conversion.
2416
2417 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2418
2419         * assign.cs (Assign.DoResolve): Error method changed.
2420
2421         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2422         
2423         * const.cs (ResolveValue): Reset in_transit immediately.
2424         
2425         * constant.cs: Error method changed.
2426         
2427         * convert.cs: Removed useless location parameter.
2428         (ExplicitNumericConversion): Don't do double enum check.
2429         (ExplicitConversionCore): Renamed from ExplicitConversion.
2430         (ExplicitUnsafe): Extracted from ExplicitConversion.
2431         (ExplicitConversion): Uses for error reporting.
2432         
2433         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2434         error messages.
2435         (ResolveBoolean): Uses common error method.
2436         (CastToDecimal): Get rid of ec.
2437         (CastFromDecimal): Optimized.
2438         (ConvCast): Get rid of ec.
2439         
2440         * enum.cs (ResolveValue): Reset in_transit immediately.
2441         (Emit): Return after first error.
2442         
2443         * expression.cs: Convert changes.
2444         
2445         * literal.cs: Error method changed.
2446         
2447         * statement.cs: Error method changed.
2448
2449 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2450
2451         Fix gtest-131.cs and gtest-211.cs.
2452         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2453         Only emit code for a label if it is used.  Unreachable code can
2454         violate ECMA evaluation stack invariants.
2455
2456 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2457
2458         * anonymous.cs: Implemented ExprClassName.
2459         
2460         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2461         delegate.
2462         
2463         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2464         check.
2465         
2466         * class.cs (StaticClass.DefineContainerMembers): Report protected
2467         members as error.
2468         
2469         * codegen.cs: if(ed) PRODUCTION.
2470         
2471         * convert.cs (Error_CannotImplicitConversion): Better error
2472         distinction.
2473         
2474         * cs-parser.jay: More error checks.
2475         
2476         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2477         
2478         * driver.cs (CSCParseOption): Enabled wrong option check.
2479         
2480         * ecore.cs (Expression.ExprClassName): Turned to property.
2481         (MemberExpr.CheckIntermediateModification): For checking boxed
2482         value types     modification.
2483         
2484         * statement.cs (Fixed.Resolve): Expression type must be
2485         convertible to fixed type.
2486         (CollectionForeach.GetEnumeratorFilter,TryType):
2487         Small refactoring for easier error checking.
2488
2489 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2490
2491         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2492         attributes.
2493         
2494         * class.cs (GeneratedBaseInitializer): New class for customization
2495         compiler generated initializers.
2496         (MemberBase.DoDefine): Check Obsolete attribute here.
2497         (FieldMember.DoDefine): Ditto.
2498         
2499         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2500         constants.
2501         
2502         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2503         (MemberCore.GetObsoleteAttribute): Removed argument.
2504         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2505         (MemberCore.CheckObsoleteType): New helper.
2506         
2507         * delegate.cs,
2508         * enum.cs,
2509         * statement.cs: Updates after MemberCore changes.
2510         
2511         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2512         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2513         
2514         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2515         obsolete attribute for compiler construct.
2516         (As.DoResolve): Cache result.
2517         
2518         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2519
2520 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2521
2522         * expression.cs (Probe): instead of having a "Type probe_type"
2523         keep the extra information as a TypeExpr probe_type_expr since the
2524         "As" operator needs to perform some type checks.
2525
2526         * (As.DoResolve): If the type is a type parameter, ensure that it
2527         is constrained by a class.
2528
2529 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2530
2531         * statement.cs (Lock): Use the TemporaryVariable class instead of
2532         manually using local variables as those do not work when variables
2533         are captured.
2534
2535         * ecore.cs: Moved the TemporaryVariable class from being a nested
2536         class inside Foreach to be a public class that can be employed in
2537         other places. 
2538
2539 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2540
2541         * cs-parser.jay: interface_accessors replaced by
2542         accessor_declarations.
2543
2544         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2545         location.
2546         
2547         * statement.cs (GotoCase.Resolve): Convert null constant to
2548         null case.
2549         (SwitchLabel.ResolveAndReduce): Ditto.
2550         (SwitchLabel.NullStringCase): Custom null stamp.
2551         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2552         
2553         typemanager.cs (CSharpSignature): Don't skip first argument
2554         for full names.
2555
2556 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2557
2558         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2559         expression.cs, iterators.cs, literal.cs: Store constants and
2560         literals location.
2561         
2562         * class.cs (MemberBase.ShortName): Pass location.
2563         
2564         * cs-parser.jay: Some location fixes.
2565         
2566         * ecore.cs (Expression.Location): Made virtual.
2567
2568 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2569
2570         Fix #72930.
2571         * const.cs (Const.ResolveValue): Check for assigning non-null
2572         value to reference type.
2573
2574 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2575
2576         Fix #76133.
2577         * expression.cs (This.VerifyFixed): In a value type T, the type of
2578         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2579         value type R, 'this' is treated as a value parameter.
2580
2581 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2582
2583         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2584         if the underlying types are the same, otherwise we need to produce
2585         code that will do the proper cast.
2586
2587         This was exposed by Marek's constant rewrite which produced
2588         invalid code for the call site:
2589
2590         enum X : long { a }
2591         void Method (X v) {}
2592
2593         Method ((X) 5)
2594
2595         This fixes test-49.cs
2596
2597 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2598
2599         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2600           Type/Object should be allowed as well. Fixed bug #75968.
2601
2602 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2603
2604         * expression.cs : (Binary.DoResolve): when one is enum constant and
2605           another is constant 0, then return enum one *as enum type*.
2606           Fixed bug 74846.
2607
2608 2005-10-04  Martin Baulig  <martin@ximian.com>
2609
2610         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2611         `SetMemberIsUsed()' work for generics, too.
2612
2613 2005-10-04  Martin Baulig  <martin@ximian.com>
2614
2615         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2616         for corlib.  Fixes #75691.
2617
2618 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2619
2620         Fix #76255.
2621         * driver.cs: Fix compilation files with full root path.
2622
2623 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2624
2625         * report.cs (SymbolRelatedToPreviousError): Format the output so
2626         it does not use an open parenthesis that is never closed. 
2627
2628         * driver.cs: Follow coding guidelines
2629
2630 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2631
2632         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2633
2634         * location.cs (InEmacs): in this mode, do not report column
2635         location as it confuses Emacs.
2636
2637 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2638
2639         * support.cs (SeekableStreamReader.Position): Don't error out when
2640         the requested position is just beyond the end of the current
2641         buffered data.
2642
2643 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2644
2645         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2646         try to keep in sync with the byte count of the underlying Stream.
2647         However, this limits us to a window size of 2048 characters: i.e.,
2648         the maximum lookahead of our lexer/parser can be 2048 characters.
2649
2650 2005-09-22  Martin Baulig  <martin@ximian.com>
2651
2652         * driver.cs: Removed a debugging FIXME.
2653
2654 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2655
2656         * cs-parser.jay (type_arguments): Add CS1644 check.
2657         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2658
2659 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2660
2661         * Makefile (PROGRAM): Make profile specific.
2662         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2663         the current directory.
2664
2665         Fix test-455.cs.
2666         * expression.cs (Invocation.EmitCall): Remove optimization on
2667         this_call since it doesn't handle 'this' being a value type.
2668
2669 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2670
2671         * driver.cs: Ensure file handles are closed after parsing
2672
2673 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2674
2675         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2676         if the underlying types are the same, otherwise we need to produce
2677         code that will do the proper cast.
2678
2679         This was exposed by Marek's constant rewrite which produced
2680         invalid code for the call site:
2681
2682         enum X : long { a }
2683         void Method (X v) {}
2684
2685         Method ((X) 5)
2686
2687         This fixes test-49.cs
2688
2689 2005-09-05  Martin Baulig  <martin@ximian.com>
2690
2691         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2692         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2693
2694         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2695
2696 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2697
2698         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2699           to be a pointer type due to the spec 25.2, so check if declaring
2700           type is generic type definition. Fixed bug #75772.
2701
2702 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2703
2704         Fixed bug #75957.
2705         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2706           both types are not defined by methods.
2707         * expression.cs : (Invocation.IsApplicable): it should work when
2708           the argument type is equal to the parameter type, not only when
2709           ImplicitConversionExists() returns true.
2710
2711 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2712
2713         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2714         internal.
2715
2716         Fix #75941.
2717         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2718         flow-branching for LocalVariableReferences in case we were invoked
2719         from a MemberAccess.
2720         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2721         Carved out of ...
2722         (LocalVariableReference.DoResolveBase): ... this.
2723         (MemberAccess.Resolve): Do the check that was disabled during
2724         SimpleNameResolve.
2725
2726 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2727
2728         * class.cs :
2729           (PartialContainer.Create): check abstract/sealed/static strictly
2730           but abstract/sealed can exist only at one side. Fixed bug #75883.
2731
2732 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2733
2734         Fix #75945.
2735         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2736         specified, don't default to UnmanagedType.I4.
2737
2738 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2739
2740         * expression.cs : conditional operator should check possibly
2741           incorrect assign expression. Fixed bug #75946.
2742
2743 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2744
2745         Fix #75934.
2746         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2747         (ScopeInfo.EmitScopeType): Use it to construct field names from
2748         names of captured locals.
2749
2750         Fix #75929.
2751         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2752         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2753         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2754         (ExplicitConversion): Remove enum cases already handled by
2755         implicit conversion.  Move implicit conversion check to the beginning.
2756         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2757         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2758         Don't treat System.Enum as a struct.
2759
2760 2005-08-30  Jb Evain  <jbevain@gmail.com>
2761
2762         * attribute.cs: handles as expression in parameters.
2763
2764 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2765
2766         Fix #75802.
2767         * class.cs (TypeContainer.VerifyClsName): Don't use a
2768         PartialContainer when verifying CLS compliance.
2769         (AbstractPropertyEventMethod): Set Parent here, ...
2770         (PropertyMethod): ... not here.
2771
2772 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2773
2774         * attribute.cs : escaped attribute name should not be allowed to be
2775           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2776
2777 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2778
2779         Fix #75927.
2780         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2781         when converting a long constant to unsigned long.
2782         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2783         detect where IsApplicable and VerifyArgumentsCompat disagree.
2784
2785 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2786         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2787
2788         Fix #75848.
2789         * class.cs (TypeContainer.CanElideInitializer): New helper.
2790         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2791         can safely emitting the initializer of a field.
2792
2793 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2794
2795         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2796           allowed inside a switch (without loop). Fixed bug #75433.
2797
2798 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2799
2800         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2801         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2802
2803 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2804
2805         * driver.cs : kinda reverting the default encoding changes (not exact 
2806           revert since I noticed that "codepage:reset" might not work fine).
2807
2808 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2809
2810         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2811           Location. Now getter and setter store location correctly.
2812           (errors/cs0111-12.cs now reports the expected location.)
2813
2814 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2815
2816         * driver.cs : Use default encoding on the environment.
2817           Removed (now that) extra parameter for SeekableStreamReader.
2818         * support.cs : (SeekableStreamReader) third .ctor() argument for
2819           StreamReader is not required (always true). preamble size could
2820           be acquired in simpler and safe way.
2821
2822 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2823
2824         * cs-parser.jay: report CS0642 at warning level 3
2825           and report CS0642 for an if else statement also
2826           fixes bug #74745. Patch by John Luke (and a bit
2827           modified by me).
2828           Removed extra CS0642 warning check for "while",
2829           "for" and "fixed".
2830         * statement.cs: In Block.Resolve(), CS0642 check
2831           is reimplemented to check a sequence of an empty
2832           statement and a block.
2833
2834           Both fix bug #66777.
2835
2836 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2837
2838         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2839         detection until I fix it.
2840         
2841         * cs-tokenizer.cs: Changed error message.
2842         
2843         * cs-parser.jay: Fixed 2 error locations.
2844         
2845         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2846         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2847         properties.
2848         
2849         * enum.cs (GetSignatureForError): Fixed.
2850         
2851         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2852         method detection.
2853         
2854         * class.cs,
2855         * typemanager.cs (RegisterProperty): Removed.
2856         
2857         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2858
2859 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2860
2861         Fix #75874.
2862         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2863         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2864
2865 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2866
2867         * expression.cs : tiny fix is required for not warning positive ulong.
2868           See test-441.cs.
2869
2870 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2871
2872         * expression.cs : add CS0652 check for constant and integral
2873           expression. Fixed bug #53974.
2874
2875 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2876
2877         * expression.cs : in DoNumericPromotions(), check if there is implicit
2878           conversion overload for string (to check CS0034). Fixed bug #52492.
2879
2880 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2881
2882         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2883
2884 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2885
2886         * ecore.cs : report location when it is *not* Null.
2887
2888 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2889
2890         * codegen.cs,
2891           ecore.cs,
2892           flowanalysis.cs,
2893           expression.cs:
2894           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2895           correctly. Fixed bug #75721.
2896
2897 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2898
2899         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2900         loop that performs 'min (pos, char_count)'.
2901
2902         Fix #75862.
2903         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2904         converted value in Operator.OnesComplement.
2905
2906 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2907
2908         * anonymous.cs: If the anon method is pulled into a helper class,
2909         it needs to be `internal' not `private'. Fixes runtime behavior on
2910         msft. bug #75704
2911
2912 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2913
2914         Fix #75803
2915         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2916         is a partial class.
2917
2918 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2919
2920         The big constants rewrite
2921         Fix #75746, #75685 and more
2922         As a side effect saved 1MB for MWF ;-)
2923         
2924         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2925         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2926         enum based for corlib compilation.
2927         
2928         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2929         subtractions.
2930         
2931         * class.cs (FixedField.Define): Use ResolveAsConstant.
2932         
2933         * const.cs (IConstant): Interface constants and enums.
2934         (Const.ResolveValue): New method for constant resolvning.
2935         (ExternalConstant): Constants from imported assemblies.
2936         
2937         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2938         conversion; like enums.
2939         (Constant.ToType): Converts this constant to different type.
2940         (Constant.Increment): Adds 1.
2941         
2942         * convert.cs (ImplicitConversionRequired): Simplified.
2943         
2944         * cs-parser.jay: Create EnumMember directly.
2945         
2946         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2947         
2948         * doc.cs (GenerateEnumDocComment): Removed.
2949         
2950         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2951         (ConvertIntLiteral): Removed.
2952         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2953         
2954         * enum.cs (EnumMember): Implement IConstant.
2955         (Enum.IsValidEnumConstant): Removed.
2956         (Enum.GetNextDefaultValue): Removed.
2957         (Enum.FindMembers): Updated.
2958         (Enum.GenerateDocComment): Iterate enum members.
2959         
2960         * expression.cs (Cast.TryReduce): Handle enums correctly.
2961         (New.Constantify): Made public.
2962         (MemberAccess.DoResolve): Removed contant specific if(s).
2963         
2964         * literal.cs (NullLiteral): Implement new abstract methods.
2965         
2966         * statement.cs (GotoCase.Resolve): Use new constant methods.
2967         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2968         
2969         * typemanager.cs (LookupEnum): Removed.
2970         (IsEnumType): Fixed to work with corlib.
2971         (RegisterConstant): Removed.
2972         (LookupConstant): Removed.
2973         (GetConstant): Changed to work with IConstant.
2974
2975 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2976
2977         * location.cs : Fixed overflown (>255) column number.
2978
2979 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2980
2981         First cut of the qualified-alias-member feature.
2982         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2983         token.
2984         * cs-parser.jay (DOUBLE_COLON): New token.
2985         (namespace_or_type_name): Add rule for recognizing
2986         qualified-alias-members.
2987         (primary_expression): Likewise.
2988         (element_access): Allow QualifiedAliasMember as a possible
2989         type-bearing expression.
2990         (local_variable_type, local_variable_pointer_type): Likewise.
2991         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2992         aliases in the current and enclosing namespace declarations.
2993         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2994         * decl.cs (MemberName.is_double_colon): New.
2995         (MemberName.MemberName): Add new constructor for alias-member.
2996         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2997         * expression.cs (QualifiedAliasMember): New expression type.
2998
2999 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3000
3001         * location.cs : it borked when no argument was specified.
3002
3003 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3004
3005         * location.cs : tiny ToString() format fix.
3006
3007 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3008
3009         * statement.cs : oops, it was missing.
3010
3011 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3012
3013         A set of fixes for precise line/column location.
3014
3015         * location.cs :
3016           "token" field now holds a file/line "delta", a line number offset 
3017           from the segment, and a column number. See also:
3018           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3019           December/009508.html
3020           Removed static IsNull. Use instance IsNull property instead.
3021         * cs-tokenizer.cs :
3022           For some tokens it stores Location. For Identifier it stores
3023           LocatedToken which is a pair of string name and location.
3024           Column numbers are adjusted only at getChar().
3025         * report.cs :
3026           Use Location.ToString() for reporting (it now contains column).
3027         * cs-parser.jay :
3028           Largely modified to use LocatedToken instead of
3029           string (IDENTIFIER), and to acquire Location from some tokens.
3030         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3031           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3032           codegen.cs :
3033           Now MemberName holds Location. DeclSpace.ctor() receives Location
3034           as a parameter. Removed extra parameters to all derived classes.
3035           Replaced Location.IsNull() with instance property.
3036         * assign.cs, expression.cs :
3037           Added .ctor() overload that omits Location.
3038         * attribute.cs :
3039           Added "nameEscaped" flag that indicates the identifier was escaped
3040           in the source file. This fixes bug #57047.
3041
3042 2005-09-02  Martin Baulig  <martin@ximian.com>
3043
3044         * class.cs: Make CS3005 a warning, not an error.
3045
3046 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3047
3048         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3049         New method, looking for lo-case imported cls type.
3050
3051         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3052         here.
3053
3054         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3055
3056         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3057
3058         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3059         all_imported_types.
3060         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3061
3062         Optimized to save 3.5 MB for SWF compilation.
3063
3064 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3065
3066         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3067         (PartialContainer.Create): Moved logic AddToContainer.
3068         (PartialContainer.MarkForDuplicationCheck): Shares name.
3069         
3070         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3071         place.
3072         
3073         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3074         initialization.
3075         (Namespace.GetSignatureForError): New method.
3076         
3077         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3078         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3079
3080 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3081
3082         Fix #75669.
3083         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3084         member lookup rather than qualifier_type, since qualifier_type can
3085         be null.
3086
3087 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3088
3089         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3090         enum member.
3091
3092 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3093
3094         * statement.cs: Copy the local exception into the exception
3095         captured local.  Fixes 75674
3096
3097 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3098
3099         Fix #75658.
3100         * expression.cs (Invocation.OverloadResolve): Don't report error
3101         CS1501 if error CS1502 has been reported.
3102         (New.DoResolve): Delegate CS1501 reporting to
3103         Invocation.OverloadResolve.
3104
3105         Fix #75656.
3106         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3107         invariant-meaning-in-block property in an enclosing block if
3108         necessary.
3109
3110 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3111
3112         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3113         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3114         (Switch.CheckSwitch): Just save 50kb for SWF.
3115
3116 2005-07-27  Martin Baulig  <martin@ximian.com>
3117
3118         * anonymous.cs (CaptureContext.AddField): Added
3119         `AnonymousContainer am' argument; compute its toplevel scope if
3120         it's not already computed.  Fixes #75649.
3121
3122 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3123
3124         Fix #75628.
3125         * class.cs (Constructor.Emit): Reset block to null if the block
3126         resolve fails.
3127
3128 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3129
3130         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3131
3132 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3133
3134         * class.cs (MethodData.Define): Check whether accessor implementing
3135         interface is public.
3136
3137         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3138
3139 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3140
3141         Fix #57245
3142         * namespace.cs (LookupType): Moved same type check to...
3143         
3144         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3145         with the same name.
3146
3147 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3148
3149         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3150         already found a typebuilder.
3151         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3152         MemberNames, not strings.
3153
3154         * const.cs (Error_ExpressionMustBeConst): 
3155         Rename from Error_EpressionMustBeConst.
3156         * const.cs, class.cs, statement.cd: Update.
3157
3158 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3159
3160         Fix #65573
3161
3162         * const.cs (Const.LookupConstantValue): Report missing contant expression
3163         everytime.
3164         (Error_EpressionMustBeConstant): Only one error method.
3165
3166         * class.cs, statement.c: Updated.
3167
3168 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3169
3170         * statement.cs (Block.Flags): Add back HasVarargs.
3171         (Block.flags): Make protected.
3172         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3173
3174         * typemanager.cs (types, typecontainers, user_types): Remove.
3175         (UserTypes, TypeContainers): Likewise.
3176         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3177         (CleanUp, Reset): Update.
3178         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3179         (GetNestedType): Use Type.GetNestedType.
3180         (CoreLookupType): Take two arguments, the namespace and the
3181         basename of the type.  Update to use the Namespace.Lookup
3182         mechanism.
3183         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3184         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3185         string concatenation and substring matches.
3186         * class.cs, enum.cs, delegate.cs: Update to changes.
3187
3188 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3189
3190         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3191         Expression and made virtual.
3192
3193         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3194         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3195
3196         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3197
3198         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3199         error message.
3200
3201         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3202         change.
3203
3204 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3205
3206         Fix #57707
3207         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3208         AssemblyCultureAttribute is not used on executable.
3209
3210         * rootcontext.cs,
3211         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3212
3213 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3214
3215         Fix #60638.
3216         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3217         New.  Reports CS0252/CS0253.
3218         Mostly taken from preliminary patch by Duncak Mak.
3219         (Binary.DoResolveOperator): Store results of operator lookup.
3220         Use them to detect if we need to warn about unintended reference
3221         comparisons.
3222
3223 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3224
3225         Fix #72969.
3226         * namespace.cs (Namespace.Lookup): Add back location parameter.
3227         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3228         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3229
3230         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3231         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3232         (Namespace.LookupType): ... this.
3233         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3234         of namespaces.
3235         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3236         purported to handle pointers.
3237         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3238         CoreLookupType.
3239
3240 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3241
3242         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3243         type as namespace.
3244
3245 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3246
3247         * namespace.cs (Namespace.Lookup): Drop location parameter.
3248         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3249         (NamespaceEntry.Lookup): ... this.
3250         (NamespaceEntry.Error_AmbiguousTypeReference):
3251         Move here from DeclSpace.
3252         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3253         names ...
3254         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3255         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3256         Move to NamespaceEntry.
3257         * delegate.cs, expression.cs: Update to changes.
3258
3259 2005-08-31  Martin Baulig  <martin@ximian.com>
3260
3261         Committing a patch from Atsushi Enomoto for #75850.
3262
3263         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3264         Prefer a generic enumerator over a non-generic one.
3265
3266 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3267
3268         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3269         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3270
3271 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3272
3273         * driver.cs : reverting default encoding change as well as mcs.
3274
3275 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3276
3277         * driver.cs, support.cs : merged r48826.
3278           Marek Safer wrote:
3279           > could you integrate your mcs changes to gmcs otherwise
3280           > gmcs cannot compile some files.
3281
3282 2005-08-20  Martin Baulig  <martin@ximian.com>
3283
3284         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3285         scope if we don't already have it.
3286
3287         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3288         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3289         fixes #75867.
3290
3291 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3292
3293         * statement.cs: Copy the local exception into the exception
3294         captured local.  Fixes 75674
3295
3296 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3297
3298         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3299         type as namespace.
3300
3301 2005-08-12  Martin Baulig  <martin@ximian.com>
3302
3303         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3304         for nested types here to avoid hitting the cache too early.
3305
3306 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3307
3308         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3309         an error. 
3310
3311 2005-08-03  Martin Baulig  <martin@ximian.com>
3312
3313         Make iterators in generic methods work; see gtest-191.cs.
3314
3315         * generic.cs
3316         (Constraints.Resolve): Protect against being called twice.
3317
3318         * class.cs
3319         (TypeContainer.GetClassBases): Make this `protected virtual'.
3320
3321         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3322         (Iterator.GetClassBases): Override this and compute the base
3323         classes here.
3324         (Iterator.DefineNestedTypes): If we're a generic method, all our
3325         method type parameters become class type parameters on the proxy
3326         class.
3327
3328         * statement.cs
3329         (ToplevelBlock.Parameters): Make this a property, not a field.
3330         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3331
3332 2005-08-03  Martin Baulig  <martin@ximian.com>
3333
3334         * typemanager.cs (TypeManager.IsSubclassOf): Use
3335         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3336         (TypeManager.GetFullName_recursed): Improved.
3337
3338 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3339
3340         Fix #75417
3341         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3342         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3343         invocation_type == mi.DeclaringType, since the first one also checks
3344         other condition used by generic instances.
3345         
3346 2005-07-27  Martin Baulig  <martin@ximian.com>
3347
3348         * anonymous.cs (CaptureContext.AddField): Added
3349         `AnonymousContainer am' argument; compute its toplevel scope if
3350         it's not already computed.  Fixes #75649.
3351
3352 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3353
3354         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3355         CheckAttributeType and refactored.
3356         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3357         ResolveAsTypeTerminal error handling.
3358         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3359         handling.
3360         (GetSignatureForError): Print errors in same way.
3361
3362         * class.cs,
3363         * codegen.cs: Reflect attribute GetSignatureForError change.
3364
3365         * ecore.cs,
3366         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3367
3368         * namespace.cs (UsingEntry): Refactored to make fields private.
3369
3370         * assign.cs,
3371         statement.cs: Error_UnexpectedKind has extra parameter.
3372
3373 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3374
3375         * ecore.cs (IAlias): Remove.
3376         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3377         that implement the interface.
3378         * namespace.cs (Namespace): Likewise.
3379         (Namespace.declspaces): Renamed from 'defined_names'.
3380         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3381         DeclSpace instead of an IAlias.
3382         * tree.cs (Tree.AddDecl): Update.
3383
3384 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3385
3386         * statement.cs (Block.Flags); Remove HasVarargs.
3387         (Block.HasVarargs): Move to ToplevelBlock.
3388         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3389         (Block.Variables): Make protected.  Initialize variable hashtable
3390         if necessary.
3391         (Block.AddVariable): Update.
3392         (Block.Resolve): Update to changes.
3393         (ToplevelBlock.HasVarargs): New boolean.
3394         (ToplevelBlock.ThisVariable): Move here from Block.
3395         (ToplevelBlock.AddThisVariable): Likewise.
3396         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3397         * expression.cs (This.ResolveBase): Update to changes.
3398         (ArglistAccess.DoResolve): Likewise.
3399
3400 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3401
3402         Fix #75321
3403         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3404
3405         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3406         not used and not used & assigned.
3407         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3408
3409 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3410
3411         Fix #75053
3412         * expression.cs (Is.DoResolve): null is never provided type.
3413
3414 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3415
3416         Fix #52496
3417         * cs-parser.jay: Less strict event error rule to catch more errors.
3418
3419 2005-07-11  Martin Baulig  <martin@ximian.com>
3420
3421         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3422         for the constructor constraint: we do not only have to check
3423         whether the class has a public constructor, but also ensure that
3424         it's parameterless.  Fixes #75492.
3425
3426 2005-07-11  Martin Baulig  <martin@ximian.com>
3427
3428         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3429         between type parameters if they either have the reference type
3430         constraint or the class constraint.
3431
3432 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3433
3434         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3435
3436 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3437
3438         Fix #74975
3439         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3440         (ExtractSecurityPermissionSet): Cope with self referencing security
3441         attributes properly.
3442
3443         * driver.cs (SetOutputFile): Made public property OutputFile.
3444
3445 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3446
3447         Fix #75486.
3448         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3449         has_nonstatic_fields.  Make into a FieldBase pointer.
3450         (TypeContainer.AddField): Add CS0282 check.
3451         (TypeContainer.EmitType): Update.
3452
3453 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3454
3455         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3456         compare if they start with __.
3457
3458 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3459
3460         * statement.cs (Switch.SwitchGoverningType): Only look at
3461         UserCasts that don't need implicit standard conversions to one of
3462         the allowed switch types (Fixes test-322.cs).
3463         (LocalInfo.Resolve): Re-enable sanity-test.
3464
3465 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3466
3467         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3468         
3469         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3470         
3471         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3472
3473 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3474
3475         Fix #75472.
3476         * ecore.cs (SimpleName.GetSignatureForError): Add.
3477         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3478         (MemberAccess.GetSignatureForError): Add.
3479
3480 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3481  
3482         The big error and warning messages review.
3483         
3484         * anonymous.cs,
3485         * assign.cs,
3486         * attribute.cs,
3487         * class.cs,
3488         * codegen.cs,
3489         * convert.cs,
3490         * cs-parser.jay,
3491         * cs-tokenizer.cs,
3492         * decl.cs,
3493         * delegate.cs,
3494         * doc.cs,
3495         * driver.cs,
3496         * ecore.cs,
3497         * enum.cs,
3498         * expression.cs,
3499         * flowanalysis.cs,
3500         * iterators.cs,
3501         * literal.cs,
3502         * location.cs,
3503         * modifiers.cs,
3504         * namespace.cs,
3505         * parameter.cs,
3506         * pending.cs,
3507         * report.cs,
3508         * rootcontext.cs,
3509         * statement.cs,
3510         * support.cs,
3511         * tree.cs,
3512         * typemanager.cs: Updated.
3513         
3514         * class.cs: (MethodCore.SetYields): Moved here to share.
3515         (PropertyMethod.Define): Moved iterator setup here.
3516         
3517         * iterators.cs: Add orig_method to have full access to parent
3518         container.
3519
3520 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3521
3522         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3523         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3524         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3525         variable of struct type.
3526         * expression.cs (Unary.ResolveOperator): Update to change.
3527         (Indirection.VerifyFixed): Likewise.
3528         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3529         (ParameterReference.VerifyFixed): Value parameters are fixed.
3530         (This.VerifyFixed): Treat 'this' as a value parameter.
3531         * statement.cs (LocalInfo.IsFixed): Remove.
3532
3533 2005-07-01  Martin Baulig  <martin@ximian.com>
3534
3535         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3536         `ec.EmitThis ()' to get the correct scope.
3537
3538 2005-07-01  Martin Baulig  <martin@ximian.com>
3539
3540         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3541         instance is a ParameterReference; fixes #75299.
3542
3543 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3544
3545         Fix #75412.
3546         * expression.cs (Indexers.map): Remove.
3547         (Indexers.Append): Filter out inaccessible setters and getters.
3548         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3549
3550         Fix #75283.
3551         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3552         Refactored from ...
3553         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3554         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3555         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3556         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3557
3558 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3559
3560         Fix #75322
3561         * class.cs (FieldBase.GetInitializerExpression): One more field
3562         for backup.
3563
3564 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3565
3566         * pending.cs: Do not define a proxy if the base method is virtual,
3567         it will be picked up by the runtime (bug 75270).
3568
3569 2005-07-08  Martin Baulig  <martin@ximian.com>
3570
3571         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3572         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3573
3574 2005-07-07  Martin Baulig  <martin@ximian.com>
3575
3576         * generic.cs (ConstructedType.CheckConstraint): Use
3577         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3578         called recursively; fixes #75329.
3579
3580 2005-07-06  Martin Baulig  <martin@ximian.com>
3581
3582         * generic.cs (TypeManager.InferTypeArguments): Added support for
3583         anonymous methods; fixes #75461.
3584
3585 2005-07-01  Martin Baulig  <martin@ximian.com>
3586
3587         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3588         `ec.EmitThis ()' to get the correct scope.
3589
3590 2005-07-01  Martin Baulig  <martin@ximian.com>
3591
3592         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3593         instance is `This'; fixes #75299.
3594
3595 2005-06-30  Martin Baulig  <martin@ximian.com>
3596
3597         * class.cs (Indexer): Implement IIteratorContainer; added support
3598         for iterators in indexers.
3599
3600         * codegen.cs
3601         (EmitContext.CurrentIterator): Make this a property, not a field.
3602
3603         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3604
3605 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3606
3607         * pending.cs: Do not define a proxy if the base method is virtual,
3608         it will be picked up by the runtime (bug 75270).
3609
3610 2005-06-28  Martin Baulig  <martin@ximian.com>
3611
3612         * cs-parser.jay (interface_method_declaration): Avoid a
3613         reduce/reduce conflict by moving some of the code into a separate
3614         `interface_method_declaration_body' rule; fixes #75368.
3615
3616 2005-06-28  Martin Baulig  <martin@ximian.com>
3617
3618         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3619         array check after the check for TypeBuilder's.
3620
3621 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3622
3623         * convert.cs (FindMostEncompassedType): Add two trivial special
3624         cases (number_of_types == 0 || number_of_types == 1).
3625         (FindMostEncompasingType): Likewise.
3626
3627 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3628
3629         Some cleanups preparing for the fix of #75283.
3630         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3631         error testing.
3632         (EventExpr.InstanceResolve): Likewise.
3633         (EventExpr.DoResolve): Remove redundant checks.
3634
3635 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3636
3637         * class.cs: Small fix.
3638
3639 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3640
3641         Fix #75160.
3642         * class.cs (GetPartialBases): Fix return value check of
3643         part.GetClassBases.
3644
3645 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3646
3647         Ensure that partial classes are registered in their enclosing
3648         namespace.  Initial part of fix of #75160.
3649         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3650         Register declspace with namespace here, not in
3651         DeclSpace.RecordDecl.
3652         * cs-parser.jay: Pass namespace to RecordDecl.
3653         * class.cs (PartialContainer.Create): Likewise.
3654         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3655         called.
3656         * decl.cs (Declspace.RecordDecl): Remove.
3657         * namespace.cs (NamespaceEntry.DefineName): Remove.
3658
3659 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3660
3661         * rootcontext.cs: Reset TargetExt as well.
3662
3663 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3664
3665         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3666         -langversion:ISO-1.
3667
3668 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3669
3670         Fix #75080, cs0119.cs.
3671         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3672         of ...
3673         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3674         allowing ExprClass.Type and ExprClass.Namespace for
3675         ResolveFlags.VariableOrValue.
3676         (Expression.Resolve) [1-argument variant]: Change default resolve
3677         flags based on language version.
3678         (Expression.Error_UnexpectedKind): Use a simple string array
3679         rather than an ArrayList.
3680         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3681         not ExprClass.Type.
3682         (TypeOfVoid.DoResolve): Likewise.
3683         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3684         flags argument -- it always has the same value.
3685
3686 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3687
3688         Fix #75081.
3689         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3690         Use it in the error message.
3691         * assign.cs, expression.cs, statement.cs: Update.
3692
3693 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3694
3695         Fix #75088.
3696         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3697         the "almostMatchedMember" case too.
3698         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3699         that failed the accessibility checks to 'almost_match'.
3700
3701 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3702
3703         * attribute.cs: Use internal MethodBuilder methods to set
3704         ExactSpelling and SetLastError on PInvoke methods, instead
3705         of passing them via charset.  Fixes #75060.
3706
3707 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3708
3709         * parameter.cs (Parameter): Remove TODO comment.
3710         (Parameter.DefineParameter): Remove Location parameter.
3711         (Parameters.LabelParameters): Likewise.
3712         * class.cs (Constructor.Emit): Update to change.
3713         (MethodData.Emit): Likewise.
3714         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3715         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3716
3717 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3718
3719         * parameter.cs,
3720           Removed Parameters.Location and added Parameter.Location instead.
3721           Removed Location parameter from Emit() and GetSignature().
3722         * anonymous.cs,
3723           class.cs,
3724           cs-parser.jay,
3725           delegate.cs,
3726           iterators.cs,
3727           statement.cs :
3728           Modified all related calls.
3729
3730 2005-06-21  Martin Baulig  <martin@ximian.com>
3731
3732         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3733         left-hand side is not a nullable type; fixes #75328.
3734
3735 2005-06-21  Martin Baulig  <martin@ximian.com>
3736
3737         * typemanager.cs
3738         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3739         (TypeManager.GetFullNameSignature): Likewise.
3740
3741         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3742         `source.FullName' and `target.FullName' to check whether there are
3743         two conflicting definitions.
3744
3745 2005-06-21  Martin Baulig  <martin@ximian.com>
3746
3747         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3748         a BoxedCast - also for reference types - to be compatible with csc.
3749
3750 2005-06-21  Martin Baulig  <martin@ximian.com>
3751
3752         * expression.cs (MemberAccess.DoResolve): Add support for nested
3753         types in a generic instance; fixes #75320.
3754
3755 2005-06-20  Martin Baulig  <martin@ximian.com>
3756
3757         * generic.cs (TypeManager.InferType): Also walk the class
3758         hierarchy for generic instances; fixes #75261.
3759
3760 2005-06-17  Martin Baulig  <martin@ximian.com>
3761
3762         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3763         to make things work for corlib.
3764
3765 2005-06-15  Martin Baulig  <martin@ximian.com>
3766
3767         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3768         obsolete `SecurityAction' values.
3769
3770 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3771
3772         * rootcontext.cs: Reset TargetExt as well.
3773         
3774 2005-06-09  Martin Baulig  <martin@ximian.com>
3775
3776         * delegate.cs (Delegate.VerifyMethod): Added
3777         `MethodGroupExpr old_mg' argument; inherit its
3778         `HasTypeParameters'; fix #75085.
3779
3780 2005-06-09  Martin Baulig  <martin@ximian.com>
3781
3782         * expression.cs (Invocation.OverloadResolve): Correctly handle
3783         generic methods for the SetMemberIsUsed(); fix #75064.
3784
3785 2005-06-09  Martin Baulig  <martin@ximian.com>
3786
3787         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3788         fixes #75062.
3789
3790 2005-06-08  Martin Baulig  <martin@ximian.com>
3791
3792         * cs-parser.jay (nullable_type_or_conditional): If we put the
3793         nullable back and our `type' is a `ComposedCast', remove the
3794         nullable from it.  Fixes #75156.
3795
3796         * expression.cs (ComposedCast.RemoveNullable): New public method.
3797
3798 2005-06-08  Martin Baulig  <martin@ximian.com>
3799
3800         The big Iterators rewrite :-)
3801
3802         * iterators.cs: Rewrite this to use the anonymous methods framework.
3803
3804         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3805         before the TypeContainers; see 2test-21.cs.
3806
3807         * class.cs
3808         (TypeContainer.DefineType): Don't create a new EmitContext if we
3809         already have one (this only happens if we're an Iterator).
3810         (TypeContainer.Define): Also call Define() on all our iterators.
3811         (Method.CreateEmitContext): Added support for iterators.
3812
3813         * anonymous.cs
3814         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3815         (AnonymousContainer.CreateMethodHost): Moved here from
3816         AnonymousMethod and made abstract.
3817         (AnonymousContainer.CreateScopeType): New abstract method.
3818         (AnonymousContainer.IsIterator): New public property.
3819         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3820         get the ScopeTypeBuilder rather than manually defining it here. 
3821         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3822         iterators here.
3823
3824         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3825         before RootContext.DefineTypes().
3826
3827         * codegen.cs (EmitContext.RemapToProxy): Removed.
3828         (EmitContext.CurrentAnonymousMethod): Changed type from
3829         AnonymousMethod -> AnonymousContainer.
3830         (EmitContext.ResolveTopBlock): Protect from being called twice.
3831         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3832         (EmitContext.EmitThis): Removed the iterators hacks; use the
3833         anonymous methods framework for that.
3834
3835         * statement.cs
3836         (ToplevelBlock.Container): Make this a property, not a field.
3837         (ToplevelBlock.ReParent): New public method; move the
3838         ToplevelBlock into a new container.
3839         (Foreach.TemporaryVariable): Simplify.
3840
3841 2005-06-05  Martin Baulig  <martin@ximian.com>
3842
3843         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3844         (Block.AddTemporaryVariable): New public method; creates a new
3845         `LocalInfo' for a temporary variable.
3846         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3847         variables here.
3848         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3849         non-iterator variables.
3850
3851 2005-06-05  Martin Baulig  <martin@ximian.com>
3852
3853         * statement.cs (Foreach.TemporaryVariable): Create the
3854         LocalBuilder in the Emit phase and not in Resolve since in some
3855         situations, we don't have an ILGenerator during Resolve; see
3856         2test-19.cs for an example.
3857
3858 2005-06-04  Martin Baulig  <martin@ximian.com>
3859
3860         The big Foreach rewrite - Part II.
3861
3862         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3863         with `PropertyInfo ienumerator_getcurrent'.
3864
3865         * codegen.cs (VariableStorage): Removed.
3866
3867         * statement.cs
3868         (Foreach): Derive from Statement, not ExceptionStatement.
3869         (Foreach.CollectionForeach): New nested class.  Moved all the code
3870         dealing with collection foreach here.
3871         (Foreach.ForeachHelperMethods): Removed.
3872         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3873
3874 2005-05-23  Martin Baulig  <martin@ximian.com>
3875
3876         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3877         don't need to.  Fix #75014.
3878
3879 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3880
3881         Improve user-defined conversion handling.
3882         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3883         applicable operators.
3884         (AddConversionOperators): New.  Helper for GetConversionOperators.
3885         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3886         there is only one most encompassed/encompassing type.
3887         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3888         "applicable operator" handling.
3889         (UserConversion): Move cache here from GetConversionOperators.
3890         Directly cache the chosen operator, rather than the whole
3891         MethodGroup.
3892         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3893         case.  Allow conversion of decimal to sbyte and byte too.
3894         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3895         New static methods.  Used to avoid allocating EmptyExpressions in
3896         convert.cs.
3897
3898 2005-05-24  Duncan Mak  <duncan@novell.com>
3899
3900         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3901         another class, used in Convert.ExplicitNumericConversion.
3902         (CastToDecimal): New class, similar to above, but casts to
3903         System.Decimal, used in Convert.ImplicitNumericConversion and also
3904         in explicit convesion from double/float to decimal.
3905
3906         * convert.cs (ImplicitNumericConversion): Handle implicit
3907         conversions to System.Decimal.
3908         (ExplicitNumericConversion): handle explicit conversions to
3909         System.Decimal.
3910
3911         This fixes #68711.
3912         
3913 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3914
3915         * typemanager.cs: Do not throw an exception in the TypeBuilder
3916         case, we take care of it on the TypeCode.
3917
3918 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3919         
3920         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3921         is back.
3922         
3923         * cs-parser.jay: Catch more lexical errors.
3924         
3925         * report.cs: Add one more Error method.
3926         
3927         * rootcontext.cs,
3928         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3929
3930 2005-05-20  Martin Baulig  <martin@ximian.com>
3931
3932         * class.cs (TypeContainer.CircularDepException): Removed.
3933         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3934         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3935         (CS0146) and interface (CS0529) dependencies here.
3936
3937 2005-05-20  Martin Baulig  <martin@ximian.com>
3938
3939         * expression.cs (New.DoResolve): Move the CS0712 check above the
3940         CS0144 check; otherwise it can never be reached.
3941
3942 2005-05-20  Martin Baulig  <martin@ximian.com>
3943
3944         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3945
3946 2005-05-20  Martin Baulig  <martin@ximian.com>
3947
3948         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3949
3950         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3951
3952 2005-05-19  Martin Baulig  <martin@ximian.com>
3953
3954         * delegate.cs
3955         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3956         to disable error reporting.
3957
3958         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3959         here since we don't want to report an error; see the new test-336.cs.
3960
3961 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3962
3963         * statement.cs (ToplevelBlock.GetParameterReference)
3964         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3965         Move here from class Block.
3966         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3967         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3968
3969 2005-05-18  Martin Baulig  <martin@ximian.com>
3970
3971         Fix #74978.
3972
3973         * flowanalysis.cs
3974         (FlowBranching.Reachability): Add non-static public And() and Or()
3975         methods.
3976         (FlowBranchingSwitch): New class; do the `break_origins' thing
3977         like in FlowBranchingLoop.
3978         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3979         reachability, not just locals and parameters.
3980         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3981         switch; MergeBreakOrigins() now takes care of that.
3982
3983 2005-05-18  Martin Baulig  <martin@ximian.com>
3984
3985         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3986         a loop and may leave it, reset the barrier; fixes #74974.
3987
3988 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3989
3990         Fix test-382.cs.  Emit values of decimal constants.
3991         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3992         Carved out of ...
3993         (TypeContainer.AddField): ... this.
3994         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3995         with initializers to include 'Const's.
3996         (ClassPart.RegisterFieldForInitialization): Forward to
3997         PartialContainer.
3998         * const.cs (Const.Const): Pass initializer to base class.
3999         (Const.Define): In case of decimal constants, register them for
4000         initialization in a static constructor.
4001
4002 2005-05-14  Martin Baulig  <martin@ximian.com>
4003
4004         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4005         do not call ResolveUnreachable() on unreachable statements in
4006         here, see the comment in the source code.
4007
4008 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4009
4010         Fix #74934.
4011         * expression.cs (BinaryResolveOperator): If one of the operands of
4012         an equality comparison is 'null' and the other is a pointer type,
4013         convert the null to a NullPointer.
4014         * convert.cs (ImplicitReferenceConversion): If the expression is a
4015         NullLiteral and the target type is a pointer type, return a
4016         NullPointer instead.
4017         (ImplicitConversionStandard): Likewise.
4018
4019 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4020         
4021         * cs-parser.jay: Set readonly context based on special constructs.
4022         
4023         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4024         readonly variable error handling.
4025         
4026         * rootcontext.cs (EmitCode): Don't verify members when error
4027         occurred.
4028         
4029         * statement.cs (LocalInfo): Add reaodnly context information.
4030         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4031
4032 2005-05-17  Martin Baulig  <martin@ximian.com>
4033
4034         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4035         #70970. 
4036
4037 2005-05-13  Martin Baulig  <martin@ximian.com>
4038
4039         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4040         handle unreachable blocks.
4041
4042 2005-05-13  Martin Baulig  <martin@ximian.com>
4043
4044         * class.cs
4045         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4046         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4047         #74905. 
4048
4049 2005-05-13  Martin Baulig  <martin@ximian.com>
4050
4051         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4052         instance variable, not a local.  Fix #74873.
4053         (Block.ResolveUnreachable): Set it to true here.
4054
4055 2005-05-12  Martin Baulig  <martin@ximian.com>
4056
4057         * cs-parser.jay (property_declaration): Pass the `current_class',
4058         not the `current_container' to Property's .ctor.  Fixes #74912.
4059
4060 2005-05-11  Martin Baulig  <martin@ximian.com>
4061
4062         * typemanager.cs (Closure): Copy this from MCS and merge all the
4063         GMCS-specific changes into it.
4064
4065 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4066
4067         Fix #74920.
4068         * typemanager.cs (unmanaged_enclosing_types): New.
4069         (IsUnmanagedType): Avoid infloops by using
4070         'unmanaged_enclosing_types' to talk with recursive invocations.
4071
4072 2005-05-11  Duncan Mak  <duncan@novell.com>
4073
4074         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4075         continuing to process for 'arg'.
4076         (handle_preprocessing_directive): Check the argument of the #endif
4077         directive and report error CS1025 if there are any trailing
4078         characters.
4079
4080         According to the C# spec, having even whitespace after the #endif
4081         directive is illegal; however, because we call arg.TrimEnd ()
4082         beforehand, we have the same behavior as csc, allowing whitespace
4083         after the directive.
4084
4085         Fixes #74892.
4086
4087 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4088
4089         Fix #74863.
4090         
4091         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4092         (Constructor.GetObsoleteAttribute): Implemented correctly.
4093
4094 2005-05-10  Martin Baulig  <martin@ximian.com>
4095
4096         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4097         resolve the type; fixes #74864.
4098         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4099         in DoResolve(); fixes #74862.
4100
4101 2005-05-10  Martin Baulig  <martin@ximian.com>
4102
4103         * support.cs (ReflectionParameters.ParameterModifier): Use
4104         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4105         and `ParameterAttributes.In'.  Fixes #74884.
4106
4107 2005-05-10  Martin Baulig  <martin@ximian.com>
4108
4109         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4110         the cache if we're just looking for `MemberTypes.NestedType' in a
4111         generic instance.
4112
4113         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4114         constraints if we're still resolving the type tree.
4115         (Expression.MemberLookup): If we're resolving the type tree, only
4116         look for `MemberTypes.NestedType' since we're only interested in
4117         getting types.
4118
4119         * class.cs (TypeContainer.DefineType): Don't resolve the type
4120         parameters here; do this later in ResolveType() after the type
4121         tree has been resolved.
4122         (TypeContainer.ResolveType): New public method; this is called
4123         after the type tree is resolved and before the types are being
4124         populated.  We resolve the generic constraints here.
4125         (TypeContainer.DoDefineMember): Check the constraints on our base
4126         class and interfaces.
4127
4128         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4129         set the `ResolvingTypeTree' flag on the EmitContext.
4130
4131         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4132
4133 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4134
4135         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4136         
4137         * expression.cs (Argument.GetParameterModifier): Turned to property.
4138         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4139         
4140         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4141         its C# equivalent.
4142         
4143 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4144
4145         Fix #74852.
4146         * decl.cs (MemberCache.AddMethods): Register override methods,
4147         rather than non-override methods.
4148         * typemanager.cs (RegisterOverride): New.
4149         (IsOverride): Update.
4150
4151 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4152
4153         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4154
4155 2005-05-06  Martin Baulig  <martin@ximian.com>
4156
4157         * attribute.cs
4158         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4159         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4160
4161 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4162
4163         Fix #73105.
4164         
4165         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4166         recursive declaration.
4167         
4168         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4169         
4170 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4171
4172         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4173         
4174         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4175
4176 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4177
4178         Fix #74797.
4179         * decl.cs (DeclSpace.FamilyAccessible): 
4180         Use TypeManager.IsNestedFamilyAccessible.
4181
4182         Fix reopened #64812.
4183         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4184         internal'.
4185
4186 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4187             Abin Thomas  <projectmonokochi@rediffmail.com>
4188             Anoob V E  <projectmonokochi@rediffmail.com>
4189             Harilal P R  <projectmonokochi@rediffmail.com>
4190
4191         Fix #64812.
4192         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4193         allow access to all static members.
4194
4195 2005-05-04  Martin Baulig  <martin@ximian.com>
4196
4197         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4198
4199 2005-05-04  Martin Baulig  <martin@ximian.com>
4200
4201         Fix #74655.
4202
4203         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4204         section at the end; make things work if `default' is not the last
4205         section.        
4206
4207 2005-05-04  Martin Baulig  <martin@ximian.com>
4208
4209         Fix #70400.
4210
4211         * statement.cs (Switch): Replaced the `got_default' field with a
4212         `default_section' one.
4213         (Switch.CheckSwitch): Set `default_section' here.
4214         (Switch.Resolve): If we're a constant switch and the constant is
4215         not found, use the default section.
4216
4217 2005-05-03  Martin Baulig  <martin@ximian.com>
4218
4219         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4220
4221         * statement.cs (Foreach.ArrayForeach): New nested class.
4222         (Foreach.TemporaryVariable): New nested class.
4223         (Foreach.EmitArrayForeach): Removed; this is now in the new
4224         ArrayForeach class.
4225
4226 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4227
4228         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4229         more conservative.
4230         (VerifyPendingMethods): Revert change below.
4231
4232         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4233         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4234         that used to trigger warning -28.  Remove warning -28.
4235         * expression.cs (Invocation.OverloadResolve): Use
4236         TypeManager.IsOverride to distinguish override methods.
4237
4238         Fix #74773.
4239         * pending.cs (VerifyPendingMethods): If a base type implements the
4240         requested interface, don't bother checking individual methods of
4241         the base type.  As a side-effect, this prevents the creation of
4242         unnecessary proxies.
4243
4244 2005-05-02  Martin Baulig  <martin@ximian.com>
4245
4246         Fix #70182.
4247
4248         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4249         Also `And' the locals if the old vector is null.
4250         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4251         null; in this case we basically reset all the variables.        
4252
4253 2005-05-02  Martin Baulig  <martin@ximian.com>
4254
4255         Fix #74529.
4256
4257         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4258         Added `FlowBranching branching' argument; always `and' the
4259         variables instead of `or'ing them unless we're an infinite loop.
4260
4261         * statement.cs (While.Resolve): Create a new sibling unless we're
4262         infinite.       
4263
4264 2005-05-02  Martin Baulig  <martin@ximian.com>
4265
4266         Fix #70140.
4267
4268         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4269         arguments; use it instead of creating a new TopLevelBlock.
4270         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4271         our ConstructorInitializer.
4272
4273         * statement.cs
4274         (TopLevelBlock.TopLevelBranching): New public property.
4275         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4276         and create our `TopLevelBranching'.
4277
4278         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4279         anonymous method host, use `block.TopLevelBranching' rather than
4280         creating a new branching.
4281
4282 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4283
4284         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4285         a ScopeInfo, if any of the current children is a child of the new
4286         entry, move those children there.
4287
4288 2005-04-30  Martin Baulig  <martin@ximian.com>
4289
4290         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4291         at the beginning of a SwitchSection.  Fix #73335.
4292
4293 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4294
4295         Fix #74378
4296         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4297         
4298         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4299         (FieldExpr.DoResolve): Obsolete members are ignored for field
4300         initializers.
4301         
4302 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4303
4304         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4305         of arrays detection.
4306
4307         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4308         verification.
4309         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4310
4311         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4312         arrays report.
4313
4314 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4315
4316         * cs-parser.jay: Use the prefered version of -unsafe in error
4317         message.
4318
4319 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4320
4321         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4322         circumstances.
4323
4324 2005-04-20  John Luke  <john.luke@gmail.com>
4325
4326         * driver.cs: fix typo in error message, --outout to --output
4327
4328 2005-04-30  Martin Baulig  <martin@ximian.com>
4329
4330         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4331         handle the .NET 2.x security attributes.
4332
4333 2005-04-30  Martin Baulig  <martin@ximian.com>
4334
4335         * typemanager.cs
4336         (TypeManager.ExpandInterfaces): Don't add things twice.
4337
4338         * class.cs
4339         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4340
4341 2005-04-29  Martin Baulig  <martin@ximian.com>
4342
4343         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4344
4345         * anonymous.cs: Added support for anonymous generic methods.
4346
4347 2005-04-29  Martin Baulig  <martin@ximian.com>
4348
4349         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4350         generic instances.
4351
4352 2005-04-29  Martin Baulig  <martin@ximian.com>
4353
4354         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4355
4356         * expression.cs (New.DoResolve): Fix the CS0304 check.
4357
4358 2005-04-29  Martin Baulig  <martin@ximian.com>
4359
4360         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4361         naming schema.
4362
4363         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4364         explicit interface implementation, compare the interface types.
4365         (MethodData.Define): Use the new naming scheme from the latest
4366         .NET 2.x beta2.
4367         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4368
4369         * decl.cs (MemberName.GetMemberName): Removed.
4370         (MemberName.MethodName, FullName): New properties.
4371
4372 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4373
4374         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4375
4376 2005-04-22  Martin Baulig  <martin@ximian.com>
4377
4378         * generic.cs (GenericMethod): Create the EmitContext in the
4379         `Define()'; in `Define(MethodBuilder)', create the type parameters
4380         before calling `Define()'.  Fixes #73933.
4381
4382 2005-04-22  Martin Baulig  <martin@ximian.com>
4383
4384         * generic.cs
4385         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4386         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4387
4388         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4389         ConstructedType, check its constraints.
4390
4391 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4392
4393         * codegen.cs (InRefOutArgumentResolving): New field.
4394         
4395         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4396         fields outside contructor.
4397         
4398         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4399         
4400 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4401
4402         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4403         parameter code was not completed ever, so it was not as up-to-date
4404         as local variables.  Must finish it.
4405
4406         The bug fix was to compare the Toplevel of the block, not the
4407         current block.  Thanks for Ben for pointing this out. 
4408
4409 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4410
4411         * decl.cs (AddMethods): Use the declaring type of the problem
4412         method to determine if we want to squash a warning.
4413
4414 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4415
4416         * attribute.cs: Removed debug output.
4417
4418         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4419         
4420         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4421         Report.Stderr.
4422         
4423 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4424
4425         Fix #74481.
4426         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4427         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4428         all null comparisons against reference types.
4429
4430 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4431
4432         Fix# 74565
4433         * class.cs (TypeContainer.CircularDepException) New nested
4434         exception class.
4435         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4436         (TypeContainer.DefineType): Removed error, reset InTransit before
4437         exit.
4438         (Class.DefineType): Throw exception when is in Transit.
4439         Catch exception and report error.
4440         (Struct.DefineType): Throw exception when is in Transit.
4441         Catch exception and report error.
4442         (Interface.DefineType): Throw exception when is in Transit.
4443         Catch exception and report error.
4444
4445         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4446         handle nested exception handlers.
4447
4448         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4449         a catch.
4450
4451         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4452         InFinally and InCatch storage.
4453
4454         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4455         (Catch.Resolve): Set and Restore ec.InCatch.
4456         (Try.Resolve): Set and Restore ec.InFinally.
4457         (Try.HasCatch): True when try has catch.
4458
4459 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4460
4461         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4462           for the same event member, so exclude such cases from warning 419.
4463           Fixed bug #74633.
4464
4465 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4466
4467         * expression.cs (Binary.ResolveOperator): Apply patch from John
4468         Luke to fix bug 59864: operators &, | and ^ on enumerations
4469         require that the same enum type on both sides.
4470
4471         * driver.cs: Add warnings to old flag usage, this is to assist
4472         people who produce Makefiles and hope that the Makefiles will be
4473         used on Windows.
4474
4475         * class.cs (TypeContainer.EmitType): Moved the definition of the
4476         special $PRIVATE$ field from the resolve phase to the Emit phase.
4477         During resolve we do not know if we are a struct with
4478         HasExplicitLayout, we know this only after the attributes for the
4479         type are emitted.
4480
4481         Set the FieldOffset to zero on the dummy field that we create for
4482         the class.   Fixes 74590.
4483
4484 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4485
4486         Fix #73834.
4487         * ecore.cs (PropertyExpr.resolved): New.
4488         (DoResolve): Use it to handle a case of double resolution here.
4489         Handle a case of identical-name-and-type-name.
4490         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4491         resolution by storing the results of expression resolution back
4492         into the "probes" array.
4493
4494 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4495
4496         Fix cs0208-7.cs and cs0208-8.cs.
4497         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4498         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4499         error reporting to point out the reason a struct is not unmanaged.
4500
4501 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4502
4503         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4504           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4505
4506 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4507
4508         Fix #74528.
4509         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4510         IdenticalNameAndTypeName here.
4511         (EventExpr.InstanceResolve): Likewise.
4512
4513 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4514
4515         C# 2.0 DefaultCharSetAttribute implementation
4516         
4517         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4518         which allows us to set GlobalNamespace for every resolve.
4519         (Attribute.ResolveArguments): Cut from Resolve.
4520         (Attribute.GetCharSetValue): Returns CharSet named argument.
4521         (Attribute.DefinePInvokeMethod): Gets default charset from
4522         module settings.
4523         (GlobalAttribute.ResolveAsTypeStep): Override.
4524         (GlobalAttribute.ResolveArguments): Override.
4525         
4526         * class.cs (TypeAttr): Is protected.
4527         
4528         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4529         (ModuleClass.DefaultCharSetType): New memeber.
4530         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4531         
4532         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4533         charset from module.
4534         
4535         * delegate.cs (TypeAttr): Override.
4536         (Delegate.DefineType): Use this TypeAttr.
4537         
4538         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4539         at very early stage (before types are defined) to resolve model
4540         module attributes. It will probably not work with corlib but it
4541         should be ok.
4542         
4543         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4544         charset from module.
4545         
4546         * typemanager.cs (default_charset_type): New type.
4547
4548 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4549
4550         * decl.cs (MemberCache.AddMethods): Don't warn if
4551         System.Object.Finalize has buggy MethodAttributes.
4552
4553         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4554         removed below.
4555
4556 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4557
4558         * doc.cs : detect ambiguous reference to overloaded members.
4559           Fixed bug #71603. MS 1.1 csc does not detect it.
4560
4561 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4562
4563         * doc.cs : delegates must not be referenced with parameters.
4564           Fixed bug #71605.
4565
4566 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4567
4568         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4569
4570 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4571
4572         * driver.cs (MainDriver): Stop processing if the CLS stage found
4573         errors. 
4574
4575         (CompilerCallableEntryPoint.InvokeCompiler): Always
4576         reset after execution;   Take a TextWriter argument for the
4577         output.
4578
4579         * report.cs: Use the error stream instead of hardcoding stderr. 
4580
4581 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4582
4583         * class.cs: Reduce code paths to test, too small of an
4584         optimization to make it worth the extra testing.  Always perform
4585         it. 
4586
4587 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4588
4589         Fix #74510.
4590         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4591         operators that had errors reported on them.
4592
4593 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4594
4595         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4596         argument types.
4597         (Attribute.Resolve): Add named argument type checking.
4598         
4599         * class.cs (FixedField.Define): Use IsPrimitiveType
4600         
4601         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4602         
4603         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4604         unsafe parameter types.
4605         
4606         * statement.cs (Using.ResolveExpression): Add better error description.
4607         
4608         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4609         
4610 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4611
4612         Fix #74484.
4613         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4614         AttributeUsageAttribute in the emitcontext of the attribute class,
4615         not in the emitcontext of the attributable entity it was attached to.
4616         * cs-parser.jay: Use 'current_class', not 'current_container',
4617         when creating a GlobalAttribute.
4618
4619 2005-04-08  Alp Toker  <alp@atoker.com>
4620
4621         * pending.cs: The fix to #58413 failed to compile methods implementing
4622         interfaces with/without params modifiers and vice versa, even though
4623         params modifiers aren't part of the signature. Make the modifier check
4624         less strict as in csc.
4625
4626 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4627             Anoob V E  <projectmonokochi@rediffmail.com>
4628             Harilal P R  <projectmonokochi@rediffmail.com>
4629
4630         Fix #58413.
4631         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4632         modifiers of pending methods.
4633         (PendingImplementation.PendingImplementation): Initialize it.
4634         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4635         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4636         with ParameterData.  Add check for modifiers.
4637         * class.cs (MethodData.Define): Update to changes.
4638
4639 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4640
4641         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4642
4643 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4644
4645         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4646         property.
4647         
4648         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4649         
4650         * rootcontext.cs,
4651         * typemanager.cs: Registered RequiredAttributeAttribute.
4652         
4653 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4654
4655         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4656         Warning CS0169 is back at level 3.
4657         (IMethodData.SetMemberIsUsed): New method.
4658         
4659         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4660         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4661         
4662         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4663
4664         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4665         contants.
4666         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4667         is used.
4668         
4669         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4670         is used.
4671         
4672         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4673         to avoid the problems with nested types.
4674
4675 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4676             Anoob V.E  <projectmonokochi@rediffmail.com>
4677             Harilal P.R  <projectmonokochi@rediffmail.com>
4678             Raja R Harinath  <rharinath@novell.com>
4679
4680         Fix #73820.
4681         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4682         attribute.
4683         * typemanager (GetConstructor): Make public.
4684
4685 2005-04-05  John Luke  <john.luke@gmail.com>
4686             Raja R Harinath  <rharinath@novell.com>
4687
4688         Fix #62232.
4689         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4690         struct too.  Return false quicker in a few cases.
4691         (VerifyUnManaged): Use it.
4692
4693 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4694
4695         Fix #74041.
4696         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4697         not 'unreachable_seen'.
4698
4699 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4700
4701         * attribute.cs (Attribute.GetValue): Removed unused.
4702         
4703         * codegen.cs (CodeGen.TrimExt): Removed unused.
4704         
4705         * cs-parser.jay (output): Removed unused.
4706         
4707         * cs-tokenizer.cs (hex_digits): Removed unused.
4708         
4709         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4710         
4711         * expression.cs (Indirection.LoadExprValue): Removed unused.
4712         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4713         
4714         * iterators.cs (Iterator.param_types): Removed unused.
4715         
4716         * statement.cs (Goto.block): Removed unused.
4717         (ToplevelBlock.did): Removed unused.
4718         (Switch.ResolveConstantSwitch): Removed unused.
4719
4720 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4721
4722         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4723         resetting thingy.
4724
4725 2005-04-19  Martin Baulig  <martin@ximian.com>
4726
4727         Merged r42462 from MCS and made it work for GMCS.
4728
4729         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4730
4731         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4732
4733 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4734
4735         Fix #74232 and cs0208-3.cs.
4736         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4737         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4738         unmanaged type.  Don't use FieldBuilders when 't' is a
4739         TypeBuilder.  Use ModFlags and MemberType fields.
4740         * class.cs (MemberBase.member_type): Rename from MemberType.
4741         (MemberBase.MemberType): New property.  Determines member_type on
4742         demand.
4743         (MemberBase.DoDefine): Don't initialize MemberType here.
4744         (FieldMember.Define): Likewise.
4745
4746 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4747
4748         Fix #74241
4749         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4750         Attributes are emitted there.
4751         
4752 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4753
4754         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4755         keyword in 'partial enum' too.
4756         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4757         is not allowed).
4758         Report from Kamil Skalski <nazgul@omega.pl>.
4759
4760         Fix #74309.
4761         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4762         have partial containers too.
4763
4764         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4765         in block' checks to Block.CheckInvariantMeaningInBlock.
4766         * statement.cs (Block.GetKnownVariableInfo): Make private.
4767         (Block.IsVariableUsedInChildBlock): Remove.
4768         (Block.IsVariableUsedInBlock): Likewise.
4769         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4770         conflicting declaration.
4771         (Block.AddVariable): Make error messages less long-winded and more
4772         specific.  Show location of conflicting declaration.
4773         * parameter.cs (Parameters.Location): New readonly property.
4774
4775 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4776
4777         Clean up semantics of invoking ResolveMemberAccess.
4778         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4779         can have an instance, ensure that we pass in a non-TypeExpression
4780         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4781         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4782         argument.  Update to changes and simplify.
4783         (FieldExpr.Emitinstance): Remove CS0120 check.
4784         (PropertyExpr.EmitInstance): Likewise.
4785         * expression.cs (Argument.Resolve): Likewise.
4786         (Invocation.DoResolve): Update to changes in semantics of
4787         InstanceExpression.
4788
4789 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4790
4791         Fix #74241
4792         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4793         customization.
4794         
4795         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4796
4797 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4798
4799         Fix difference in behaviour with commandline invocation.
4800         * driver.cs (Driver.Reset): New.
4801         (CompilerCallableEntryPoint): Call it.
4802
4803         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4804         variable" warnings if the boolean expression failed to resolve.
4805
4806 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4807
4808         * attribute.cs: Fix the union of several permissions when some of them
4809         are unrestricted (so the result isn't an unrestricted permission set).
4810         Fix #74036.
4811
4812 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4813
4814         * ecore.cs (MemberExpr): New class.  Convert from interface
4815         IMemberExpr.
4816         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4817         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4818         error checks.
4819         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4820         (MethodGroupExpr.IsExplicitImpl): Remove.
4821         (Expression.GetFieldFromEvent): Remove.
4822         (SimpleName.MemberStaticCheck): Remove.
4823         (SimpleName.DoSimpleNameResolve): Update to changes.
4824         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4825         (MemberAccess.IdenticalNameAndTypeName): Remove.
4826         (MemberAccess.error176): Move to MemberExpr.
4827         (MemberAccess.DoResolve): Update to changes.
4828         (BaseAccess.DoResolve): Likewise.
4829
4830 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4831
4832         C# 2.0 Conditional attribute class implementation
4833         
4834         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4835         Analyzes class whether it has attribute which has ConditionalAttribute
4836         and its condition is not defined.
4837         
4838         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4839         (Class.IsExcluded): New method. Search for at least one defined
4840         condition in ConditionalAttribute of attribute class.
4841
4842 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4843
4844         * ecore.cs (PropertyExpr): Derive from Expression, not
4845         ExpressionStatement.
4846         (PropertyExpr.EmitStatement): Remove.
4847
4848 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4849
4850         Fix #74060.
4851         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4852         internal field "value__" of an enum be private.  The examples for
4853         "value__" that I found on MSDN all used FieldAttributes.Private.
4854
4855         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4856         Don't mention IL method attribute names.
4857
4858         Fix #47991.  Remove a TODO.
4859         * statement.cs (Block.Toplevel): Make into a field.
4860         (Block.Parameters): Move into ToplevelBlock.
4861         (Block.known_variables): Rename from child_variable_names.
4862         (Block.Block): Remove variants that take Parameters.  Initialize
4863         'Toplevel' with the immediately surrounding toplevel block.
4864         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4865         LocalInfo parameter.
4866         (Block.GetKnownVariableInfo): New.
4867         (Block.IsVariableNameUsedInChildBlock): Update.
4868         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4869         the block, even though it may not be in scope.
4870         (Block.AddVariable): Remove Parameters parameter.  Use
4871         Toplevel.Parameters instead.
4872         (Block.AddConstant): Remove Parameters parameter.
4873         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4874         (Block.IsParamaterReference): Likewise.
4875         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4876         (ToplevelBlock.Parameters): New.  Moved from Block.
4877         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4878         initialize Parameters to a non-null value.
4879         * cs-parser.jay: Update to changes.
4880         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4881         simple names that mean different things in the same block.  Use
4882         Block.IsVariableNameUsedInBlock.
4883
4884 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4885
4886         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4887
4888 2005-03-26  Raja R Harinath  <harinath@acm.org>
4889
4890         Fix #73038.
4891         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4892         fails to resolve, ensure that the LHS is still resolved as an
4893         lvalue.
4894
4895 2005-03-25  Raja R Harinath  <harinath@acm.org>
4896
4897         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4898         ec.ContainerType.
4899         (Enum.current_ec): Remove.
4900         (Enum.LookupEnumValue): Remove EmitContext argument.
4901         Just uses the one created during DefineType.
4902         (Enum.FindMembers): Update.
4903         * expression.cs (MemberAccess.DoResolve): Update.
4904
4905 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4906
4907         * assign.cs (Assign.DoResolve): Check for CS1717 when
4908         source and target are same (uses Equals).
4909
4910         * expression.cs (LocalVariableReference, ParameterReference,
4911         This): Implemented Equals, GetHashCode.
4912
4913         * statement.cs (Block.GetParameterReference): Removed useless
4914         local variable.
4915
4916 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4917
4918         Fix cs0128.cs
4919         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4920         blocks before deciding whether the error is cs0136 or cs0128.
4921
4922         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4923         (using_alias_directive, using_namespace_directive): Pass
4924         MemberName, not an expression to Namespace.UsingAlias and
4925         Namespace.Using.
4926         (MakeName): Use the MemberName of the namespace.
4927         * namespace.cs (Namespace.MemberName): New.
4928         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4929         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4930         Likewise.
4931         * decl.cs (MemberName.Name): Make readonly.
4932         (MemberName.FromDotted): New "constructor".
4933         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4934         (MemberCore.Name): Compute from MemberName on demand.
4935         (MemberCore.SetMemberName): Provide a way to change the
4936         MemberName.
4937         (MemberCore.AddToContainer): Don't take a fullname parameter.
4938         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4939         fully qualified name of the container to the member name.
4940         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4941         only if the type is a member of the root container.
4942         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4943         MemberName.Left rather than searching for an embedded ".".
4944         (PartialContainer.CreatePart): Update to changes in RootContext.
4945         (MemberBase.ShortName): Turn into a property.  Use
4946         MemberCore.SetMemberName.
4947         (MemberBase.ExplicitInterfaceName): Remove.
4948         (MemberBase.UpdateMemberName): Remove.
4949         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4950         (PropertyBase.SetMemberName): New override.
4951         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4952         (Tree.GetDecl): New.
4953         (Tree.AllDecls): Rename from Decls.
4954         * attribute.cs, enum.cs, report.cs: Update to changes.
4955         * driver.cs (MainDriver): Use MemberName.FromDotted on
4956         RootContext.MainClass.
4957
4958 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4959
4960         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4961         checks.
4962
4963         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4964
4965 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4966
4967         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4968         property accessor modifiers.
4969
4970         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4971         fixed buffer attribute (CS1716).
4972         (PropertyMethod.HasCustomAccessModifier): When property accessor
4973         has custom modifier.
4974
4975         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4976         modifiers.
4977         (PropertyExpr.DoResolveLValue): Add CS0272.
4978
4979 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4980
4981         * convert.cs: When converting to a pointer, use the proper Conv.U
4982         or Conv.I depending on the source data type.
4983
4984         * cs-tokenizer.cs: Make the size for large decimal constants,
4985         fixes #72957.
4986
4987 2005-03-17  Martin Baulig  <martin@ximian.com>
4988
4989         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4990         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4991
4992 2005-03-17  Martin Baulig  <martin@ximian.com>
4993
4994         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4995         to bool so we can return an error condition.
4996         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4997         returned an error.
4998
4999 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5000
5001         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5002         attributes.
5003
5004 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5005
5006         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5007         Refactor to avoid traversing the list of assemblies, and to avoid
5008         string concatenation.
5009         * typemanager.cs (guid_attr_type): Remove.
5010         (negative_hits, pointers, references): Remove hashes.
5011         (type_hash): New.
5012         (GetConstructedType): New.  Uses type_hash to handle constructed
5013         types (arrays, references, pointers).
5014         (GetReferenceType, GetPointerType): Use it.
5015         (GetNestedType): New.  Uses type_hash to handle nested types of
5016         reflected types.
5017         (LookupType, LookupTypeDirect): Remove.
5018         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5019         'types' hash and LookupTypeReflection directly.
5020         (params_string, params_object): Use GetConstructedType.
5021         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5022         top-level types.
5023         (Namespace.Lookup): Use cached_types.
5024         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5025         provided by old TypeManager.LookupType.
5026         * rootcontext.cs (MakeFQN): Remove.
5027         * decl.cs (DeclSpace.MakeFQN): Likewise.
5028         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5029         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5030         TypeManager.GetConstructedType.
5031         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5032
5033 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
5034
5035         * cs-parser.jay: Fix build.
5036
5037 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5038
5039         * class.cs (TypeContainer.CircularDepException) New nested
5040         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5041
5042         * cs-parser.jay: Reports CS1527 for any namespace element.
5043
5044         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5045         Added CS0407.
5046
5047         * expression.cs (ParameterReference.IsAssigned): Changed error to
5048         CS0269.
5049         (Error_WrongNumArguments): Moved CS0245 detection here.
5050
5051         * statement.cs (Return.Resolve): Add CS1622 report.
5052
5053 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5054
5055         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5056
5057 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5058
5059         * attribute.cs expression.cs: Get rid of some allocations.
5060
5061 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5062
5063         * doc.cs : just eliminate the latest change.
5064
5065 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5066
5067         * doc.cs : commented out the latest change. It breaks xml-030.cs
5068
5069 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5070
5071         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5072           fail. So invoke CreateType() in FindDocumentedType().
5073
5074 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5075
5076         * cs-tokenizer.cs : added IsKeyword().
5077         * doc.cs : Detect keyword incorrectly used as identifier.
5078           Allow identifiers prefixed by @.
5079
5080 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5081
5082         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5083         It caused exception in namespace resolving (again!).
5084         
5085         * class.cs (Class.ctor): Removed exit.
5086         (PropertyMethod.ctor): ditto.
5087         
5088         * codegen.cs (Codegen.Reset): Reset static data.
5089         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5090         
5091         * cs-tokenizer.cs (Cleanup): Removed.
5092         
5093         * driver.cs (GetSystemDir): Rewrote to one line command.
5094         It caused problem with unloaded dynamic modules.
5095         (UnixParseOption): Removed Exit.
5096         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5097         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5098         Now can be mcs used as library.
5099         
5100         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5101         empty location.
5102         
5103         * location.cs (Reset): Reset static data.
5104         
5105         * namespace.cs (Reset): Reset static data.
5106         
5107         * report.cs (Report.Reset): Reset static data.
5108         
5109         * rootcontext.cs (RootContext.Reset): Reset static data.
5110         
5111         * tree.cs (RootTypes.ctor): Use Location.Null
5112         
5113         * typemanager.cs (TypeManager.Reset): Reset static data.
5114         (CoreLookupType): Removed Exit.
5115         (TypeHandle.Reset): Reset static data.
5116         
5117 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5118
5119         Fix #73516.
5120         * typemanager.cs (ComputeNamespaces): Import namespaces from
5121         referenced modules too.
5122
5123 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5124
5125         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5126         than '.'.
5127
5128 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5129
5130         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5131         enclosing DeclSpace.  This ensures that a name-lookup populates
5132         more caches and there are fewer 'TypeExpression's.  Carve out
5133         nested type lookup into ...
5134         (LookupNestedTypeInHierarchy): ... this.
5135
5136 2005-04-15  Martin Baulig  <martin@ximian.com>
5137
5138         Merged r41590 from MCS and make it work in the generics land.
5139
5140         * generic.cs (TypeParameter.UpdateConstraints): Removed the
5141         `check' argument.
5142
5143         * class.cs (PartialContainer.UpdateConstraints): Removed.
5144         (PartialContainer.CheckConstraints): Removed.
5145         (PartialContainer.SetParameterInfo): Store the constraints here.
5146         (PartialContainer.DefineTypeParameters): New public method;
5147         resolve the type parameter's constraints here.  Note that the
5148         PartialContainer doesn't have an EmitContext anymore, so we must
5149         do this in the ClassPart.
5150
5151 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5152
5153         Clean up a few partial-class semantics.  
5154         Fixes test-357.cs and cs1618-2.cs.
5155         * cs-parser.jay (struct_declaration): Use 'current_class' as
5156         parent of newly-created struct.  Remove call to Register ().
5157         Use 'pop_current_class' to complete handing the current struct.
5158         (interface_declaration): Likewise.
5159         (class_declaration): Likewise.
5160         (enum_declaration): Use 'current_class' as parent of newly created
5161         enum.
5162         (delegate_declaration): Likewise.
5163         (pop_current_class): New function.  This is used to handle closing
5164         up the 'current_class' and 'current_container', and pointing them
5165         to the enclosing class/container.
5166         (CSharpParser): Initialize 'current_class' too.
5167         * decl.cs (MemberCore): Add check for invariant: a partial
5168         container is not a parsed entity, and thus does not enclose any
5169         parsed members.
5170         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5171         (DeclSpace.BaseTypeExpr): Use it.
5172         (DeclSpace.LookupType): Add check for invariant.
5173         * class.cs (TypeContainer): Add check for invariant: a nested
5174         class should have the same NamespaceEntry as its enclosing class.
5175         (TypeContainer.EmitFieldInitializers): Make virtual.
5176         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5177         MemberCore.
5178         (TypeContainer.Register): Remove.
5179         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5180         null.  Use TypeResolveEmitContext for resolving base types and
5181         interfaces.  Move initialization of Parts.TypeBuilder here from
5182         ...
5183         (TypeContainer.DefineNestedTypes): ... here.
5184         (PartialContainer): Take a Namespace not a NamespaceEntry.
5185         (PartialContainer.Create): Don't use Register.  Call the
5186         appropriate Add... function directly.
5187         (ClassPart): Take both the PartialContainer and the enclosing
5188         class as constructor arguments.
5189         (ClassPart.EmitFieldInitializers): Override.
5190         (ClassPart.PartFindNestedTypes): Remove.
5191         (FieldBase.GetInitializerExpression): Resolve the initializer
5192         expression in the emit context of the enclosing class.
5193         * tree.cs (RootTypes): Remove Register ().
5194         
5195 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5196
5197         * cs-parser.jay: Removed CS0134.
5198         
5199         * driver.cs: Removed CS1901.
5200         
5201         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5202         for predefined types.
5203
5204 2005-03-07  Duncan Mak  <duncan@novell.com>
5205
5206         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5207         well. Fixes bug #73454.
5208
5209 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5210
5211         * cs-tokenizer.cs (xtoken): Add CS1035.
5212         
5213         * class.cs (MethodData.Define): Add CS0683.
5214         (FieldMember.ctor): Add CS0681.
5215
5216 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5217
5218         * ecore.cs (SimpleName.DoResolve): Rename from
5219         SimpleName.DoResolveAllowStatic.
5220         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5221         Pass 'intermediate' flag to MemberStaticCheck.
5222         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5223         of "intermediate" lookups via MemberAccess.
5224         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5225         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5226
5227 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5228
5229         Fix #73394.
5230         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5231         slipped in because of variable names that are identical to a
5232         builtin type's BCL equivalent ('string String;', 'int Int32;').
5233         (PropertyExpr.EmitInstance): Likewise.
5234
5235 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5236
5237         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5238         
5239         * report.cs (warning_ignore_table): Made public.
5240
5241 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5242
5243         Fix #73282.
5244         * class.cs (MethodData.Emit): Pass 'container' to
5245         container.GetObsoleteAttribute instead of 'container.Parent'.
5246
5247 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5248
5249         * cs-parser.jay: Add 1534 error test.
5250
5251         * iterators.cs (Yield.CheckContext): Add error 1629.
5252         (Iterator.ctor): Save unsafe modifier.
5253         (MoveNextMethod.DoEmit): Restore unsafe context.
5254
5255         * namespace.cs (UsingAlias): Better error message.
5256
5257 2005-03-03  Dan Winship  <danw@novell.com>
5258
5259         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5260         the warning message [#73219]
5261
5262 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5263
5264         Fix compile with MCS 1.0.0.0.
5265         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5266         w_restore to not depend on string constant folding.
5267
5268 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5269
5270         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5271         CS0246 check to users who passed 'silent = false'.
5272         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5273         check.
5274         (SimpleName.SimpleNameResolve): Update.
5275         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5276         (MemberAccess.IdenticalNameAndTypeName): Update.
5277         * doc.cs (FindDocumentedTypeNonArray): Update.
5278
5279 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5280
5281         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5282         * parameters.cs (ComputeAndDefineParameters): Remove.
5283         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5284         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5285         Use GetParameterInfo.
5286
5287 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5288
5289         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5290
5291 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5292
5293         Unify DeclSpace.LookupType and DeclSpace.FindType.
5294         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5295         is in charge of defining nested types on demand.
5296         (DeclSpace.LookupType): Use it when the current_type is a
5297         TypeBuilder.  Use LookupTypeDirect for reflected types.
5298         (DeclSpace.FindType): Remove.
5299         (DeclSpace.LookupInterfaceOrClass): Likewise.
5300         (DeclSpace.DefineTypeAndParents): Likewise.
5301         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5302         DeclSpace.LookupType.
5303         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5304         * typemanager.cs (LookupType): Simplify.
5305         (AddUserType): Remove type from negative_hits.
5306         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5307         * class.cs (TypeContainer.FindMembers): Move handling of nested
5308         types ...
5309         (TypeContainer.FindMembers_NestedTypes): ... here.
5310         (TypeContainer.FindNestedType): Implement override.
5311         (ClassPart.FindNestedType): Delegate to PartialContainer.
5312         (ClassPart.PartFindNestedType): Looks up the nested types of the
5313         part alone.
5314
5315 2005-04-14  Martin Baulig  <martin@ximian.com>
5316
5317         * generic.cs (ConstructedType): Moved all the type lookup and
5318         nested class logic into SimpleName.
5319         (ConstructedType.ResolveConstructedType): Our underlying type is
5320         already fully resolved; all the type lookup stuff is in
5321         SimpleName.
5322
5323         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5324         constructed types here instead of in ConstructedType.
5325
5326         * decl.cs (MemberName.GetTypeExpression): Always create a
5327         SimpleName, not a ConstructedType.
5328         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5329
5330 2005-03-02  Martin Baulig  <martin@ximian.com>
5331
5332         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5333         static constructor in static classes.
5334
5335 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5336
5337         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5338         sizeParamIndex is not specified.
5339
5340 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5341
5342         Fix #73117
5343         * report.cs (WarningMessage.IsEnabled): Missing null check.
5344
5345 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5346
5347         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5348         in the fields and not in the properties.
5349
5350 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5351
5352         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5353         fields as well.
5354
5355 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5356
5357         * attribute.cs: Small refactoring (improved robustness).
5358         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5359         (ValidateGuid): Removed.
5360         (Resolve): Removed referenced to above mentioned.
5361         (GetAttributeUsage): Made private and changed to work without
5362         class assistance.
5363         (GetIndexerAttributeValue): Don't crash.
5364         (GetConditionalAttributeValue): Ditto.
5365         (GetClsCompliantAttributeValue): Ditto.
5366         (ExtractSecurityPermissionSet): All attributes exceptions are
5367         error 648.
5368         (GetPropertyValue): New helper.
5369         (GetMethodImplOptions): New method.
5370         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5371         some missing properties.
5372         
5373         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5374         (Method.ApplyAttributeBuilder): Updated.
5375         
5376         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5377         exception.
5378
5379 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5380
5381         Fix #73052.
5382         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5383         non-simple types (array, pointer, reference).
5384
5385 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5386
5387         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5388
5389         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5390         for operators.
5391         (Method.CheckBase): Catch wrong destructor here.
5392         (MethodData.Define): Add errors 550, 668.
5393
5394         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5395
5396         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5397
5398         * pending.cs (VerifyPendingMethods): Add error 551.
5399
5400         * typemanager.cs (CSharpName): Next error report helper.
5401
5402 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5403
5404         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5405         attributes. Removed useless attribute double check.
5406         It saves almost 2MBs for corlib.
5407
5408 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5409
5410         Fix #72924.
5411         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5412         called twice in case of error.
5413
5414 2005-02-23  Chris Toshok  <toshok@ximian.com>
5415
5416         Fix compiler portions of #72827.
5417         * statement.cs (Block.Emit): call Begin/EndScope on the
5418         EmitContext instead of the ILGenerator.
5419
5420         * codegen.cs (EmitContext.BeginScope): new method, call
5421         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5422         we have one.)
5423         (EmitContext.BeginScope): same, but EndScope and CloseScope
5424
5425         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5426         offset and call the superclass's OpenScope(int) with it.
5427         (SymbolWriter.CloseScope): get the current il
5428         offset and call superclass's CloseScope(int) with it.
5429
5430 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5431
5432         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5433         CS1677 for out and ref as well.
5434
5435         * class.cs (Method.Define): Add error CS1599 detection.
5436         
5437         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5438         
5439         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5440         
5441         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5442         
5443         * support.cs.cs (ModifierDesc): New helper method.
5444
5445 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5446             Abin Thomas  <projectmonokochi@rediffmail.com>
5447             Anoob V E  <projectmonokochi@rediffmail.com>
5448             Harilal P R  <projectmonokochi@rediffmail.com>
5449
5450         Fix #57851, #72718.
5451         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5452         MemberLookup (used for error reporting) actually returns a result.
5453         Fix error report number (122, not 112).
5454
5455 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5456             Anoob V E  <projectmonokochi@rediffmail.com>
5457             Harilal P R  <projectmonokochi@rediffmail.com>
5458
5459         Fix #71134.
5460         * pending.cs (PendingImplementation.GetAbstractMethods):
5461         Find NonPublic members too.
5462
5463 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5464
5465         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5466         Fixed error 217.
5467         
5468         * class.cs (MethodCore.CheckMethodAgainstBase):
5469         Add error 239 report.
5470
5471 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5472
5473         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5474         
5475         * class.cs (Operator.Define): Add error 217 report.
5476         
5477 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5478
5479         Fix #68955.
5480         * expression.cs (Invocation.IsApplicable): Make public.
5481         (Invocation.IsParamsMethodApplicable): Likewise.
5482         * delegate.cs (Delegate.VerifyApplicability): Don't use
5483         Invocation.VerifyArgumentCompat for parameter applicability
5484         testing.  Use Invocation.IsApplicable and
5485         Invocation.IsParamsMethodApplicable.
5486
5487 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5488
5489         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5490         
5491         * class.cs (Operator.Define): Add error 217 report.
5492         
5493 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5494
5495         * namespace.cs (UsingEntry.Resolve): Undo change below.
5496
5497 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5498
5499         Fix #72756.
5500         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5501         disable the error message when the extended MemberLookup also
5502         fails.
5503         (Expression.MemberLookupFinal): Update.
5504         (SimpleName.DoSimpleNameResolve): Update.
5505         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5506         Don't use MemberLookupFinal.
5507         (New.DoResolve): Update.
5508         (BaseAccess.CommonResolve): Update.
5509
5510 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5511
5512         Fix #72732.
5513         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5514         occured previously, don't resolve again.
5515
5516 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5517
5518         Fix #69949
5519         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5520         argument. Call ResolveAttributeUsage for unresolved.
5521         when types doesn't match ctor arguments.
5522         
5523         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5524         for nested attribute classes.
5525         (Class.attribute_usage): Removed.
5526         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5527         for attribute class.
5528         
5529         * ecore.cs (IsAttribute): Removed.
5530         
5531         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5532         
5533         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5534         now normal types.
5535         (attribute_types): Removed.
5536         (EmitCode): Global attributes are emited as the latest.
5537
5538 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5539
5540         * class.cs (EmitFieldInitializers): Don't emit field initializer
5541         for default values when optimilization is on.
5542         
5543         * constant.cs (Constant.IsDefaultValue): New property.
5544         
5545         * driver.cs: Add /optimize handling.
5546         
5547         * constant.cs,
5548         * ecore.cs,
5549         * literal.cs: Implement new IsDefaultValue property.
5550         
5551         * rootcontext.cs (Optimize): New field, holds /optimize option.
5552
5553 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5554
5555         Fix crasher in re-opened #72347.
5556         * namespace.cs (Namespace.Lookup): Return null if
5557         DeclSpace.DefineType returns null.
5558
5559         Fix #72678.
5560         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5561
5562 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5563
5564         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5565         now returns null if it cannot resolve to an lvalue.
5566         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5567         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5568         returned null.  Remove check for SimpleName.
5569         (EventExpr.DoResolveLValue): New.
5570         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5571         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5572         error from ...
5573         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5574         avoid CS0131 error.
5575         (Unary.ResolveOperator): Move CS0211 check ...
5576         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5577         CS0131 error.
5578         (Unary.DoResolveLValue): Simplify.
5579         (AddressOf.DoResolveLValue): New.
5580         (ArrayAccess.DoResolveLValue): New.
5581
5582 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5583
5584         * attribute.cs (Attribute.Resolve): Add arguments casting for
5585         when types doesn't match ctor arguments.
5586
5587 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5588
5589         Fix parts of #63202.
5590         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5591         lookup of operator in base type.  Ensure that all checks happen
5592         when the operator resolves to an "op_..." method.
5593
5594 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5595
5596         Fix #71992.
5597         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5598         'ignore_cs0104' parameter.  Pass it to ...
5599         (NamespaceEntry.Lookup): ... this.
5600         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5601         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5602         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5603         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5604         Update.  Request that cs0104 errors be ignored.
5605         (ComposedCast.ResolveAsTypeStep): Update.
5606
5607 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5608
5609         Fix #59209.
5610         * expression.cs (Invocation.BetterFunction): Remove support for
5611         comparing virtual functions and their overrides.
5612         (Invocation.IsOverride): New.
5613         (Invocation.OverloadResolve): Don't consider 'override' functions
5614         during candidate selection.  Store them in a lookaside list.
5615         If the selected method is a 'virtual' function, use the list to
5616         find any overrides that are closer to the LHS type.
5617
5618 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5619
5620         * expression.cs (New.DoResolve): Add complex core type reduction.
5621         (New.Constantify): Converts complex core type syntax like 'new int ()'
5622         to simple constant.
5623         
5624 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5625
5626         * decl.cs (EntryType.EntryType): New constructor to create an
5627         updated copy of a cache entry.
5628         (MemberCache.AddMethods): Use it.
5629         (MemberCache.ClearDeclaredOnly): Remove.
5630         (MemberCache.MemberCache): Update.
5631
5632 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5633
5634         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5635         variable.  This one is represents the actual low-level declaration
5636         of the method, as opposed to the semantic level `IsStatic'.   
5637
5638         An anonymous method which is hosted into a static method might be
5639         actually an instance method.  IsStatic would reflect the
5640         container, while MethodIsStatic represents the actual code
5641         generated.
5642
5643         * expression.cs (ParameterReference): Use the new MethodIsStatic
5644         instead of IsStatic.
5645
5646         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5647         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5648         set on the current EmitContext. 
5649
5650         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5651         resolve our casted expression as an LValue.  This triggers the
5652         proper LValue processing that is later required by Assign.
5653
5654         This fixes 72347.
5655
5656         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5657
5658 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5659
5660         C# 2.0 Fixed buffer implementation
5661
5662         * anonymous.cs: Update after RegisterHelperClass renaming.
5663
5664         * attribute.cs (AttributeTester.fixed_buffer_cache):
5665         Cache of external fixed buffers.
5666         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5667         implementation if field is fixed buffer else null.
5668
5669         * class.cs
5670         (TypeContainer.AddField): Accept FieldMember instead of Field.
5671         (FieldBase.IsFieldClsCompliant): Extracted code from
5672         VerifyClsCompliance descendant customization.
5673         (FixedField): New class handles fixed buffer fields.
5674         (FixedFieldExternal): Keeps information about imported fixed
5675         buffer.
5676         (IFixedField): Make access to internal or external fixed buffer
5677         same.
5678
5679         * cs-parser.jay: Add fixed buffer parsing.
5680
5681         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5682         buffer.
5683
5684         * expression.cs (Indirection): Extended implementation to accept
5685         fixed buffer field.
5686         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5687         (ElementAccess.MakePointerAccess): Get type as parameter.
5688         (DoResolve): Add fixed buffer field expression conversion.
5689         (DoResolveLValue): Ditto.
5690         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5691         (ArrayPtr): Derives from FixedBufferPtr.
5692         (ArrayPtr.Emit): Add extra emit for array elements.
5693
5694         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5695
5696         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5697         for compiler generated types.
5698         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5699
5700         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5701         and consume less memory.
5702         (Fixed.Resolve): Add fixed buffer case.
5703
5704         * typemanager.cs (compiler_generated_attr_ctor,
5705         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5706         (HasElementType): Add our own implementation to work on every
5707         runtime.
5708
5709 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5710
5711         * anonymous.cs (CaptureContext): Track whether `this' has been
5712         referenced.   
5713
5714         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5715         only captured `this' if it was implicitly done (instance
5716         methods/variables were used). 
5717
5718         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5719         `this' must be captured.
5720
5721 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5722  
5723         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5724         is null it means that there has been no need to capture anything,
5725         so we just create a sibling.
5726
5727         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5728
5729         Just a partial fix.  The other half is fairly elusive.
5730         
5731 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5732
5733         Fix #52586, cs0121-4.cs.
5734         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5735         and return a hashtable.
5736         (MemberCache.ClearDeclaredOnly): New.
5737         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5738         the method_hash of a base type too.
5739         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5740         type methods.  Overwrite entries with the same MethodHandle so
5741         that the ReflectedType is correct.  The process leaves in base
5742         virtual functions and their overrides as distinct entries.
5743         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5744         matters since it was boxed in a ArrayList before.
5745         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5746         modifier.
5747         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5748         case of a virtual function and its override (choose the overload
5749         as better).
5750         (Invocation.OverloadResolve): Avoid 'override' members during
5751         'applicable_type' calculation.
5752
5753 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5754
5755         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5756         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5757         GetTypeHandle.  It is possible for a reflected type to derive from
5758         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5759         System.Array during mscorlib compilation).
5760         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5761         contain a method_hash, don't create one either.  Don't create a
5762         deep copy of the base cache's method_hash.
5763         (MemberCache.SetupCache): Rename back from DeepCopy.
5764         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5765         already initialized.  If we see an override function, add its
5766         underlying base virtual function to the member_hash too.
5767
5768 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5769
5770         Combine two near-redundant caches.
5771         * typemanager.cs (method_params): Rename from method_internal_params.
5772         (TypeManager.GetParameterData): New.  Replace
5773         Invocation.GetParameterData.
5774         (TypeManager.LookupParametersByBuilder): Remove.
5775         * expression.cs (Invocation.method_parameter_cache): Remove.
5776         (Invocation.GetParameterData): Remove.
5777         Update to changes.
5778         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5779         Update to changes.
5780
5781 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5782
5783         Fix #72015.
5784         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5785         TypeManager.multicast_delegate_type is null, resolve it by looking
5786         up "System.MulticastDelegate".
5787         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5788
5789 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5790             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5791             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5792
5793         Fix cs0164.cs.
5794         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5795         (LabeledStatement.AddReference): New.  Set 'referenced'.
5796         (Goto.Resolve): Use it.
5797
5798 2005-02-05  John Luke  <john.luke@gmail.com>
5799
5800         * driver.cs: remove duplicate -doc line in Usage ()
5801
5802 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5803
5804         * location.cs (Location.AddFile): Fix CS2002 error report.
5805
5806 2005-02-02  Martin Baulig  <martin@ximian.com>
5807
5808         * delegate.cs (Delegate.DefineType): Report an internal error if
5809         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5810         details.        
5811
5812 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5813
5814         Fix a crasher in a variant of #31984.
5815         * const.cs (Constant.CheckBase): New override that defers the
5816         new-or-override check in case the base type hasn't been populated
5817         yet.
5818         (Constant.Define): Ensure the new-or-override check is performed.
5819
5820 2005-02-01  Duncan Mak  <duncan@ximian.com>
5821
5822         * const.cs (LookupConstantValue): Check that `ce' is not null
5823         before calling GetValue ().
5824
5825 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5826
5827         Fix test-334.cs (#69519).
5828         * cs-parser.jay (using_alias_directive): Pass in an expression to
5829         NamespaceEntry.UsingAlias.
5830         (using_namespace_directive): Pass in an expression to
5831         NamespaceEntry.Using.
5832         (namespace_name): Don't flatten to a string.
5833         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5834         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5835         ResolveAsTypeStep.
5836         (NamespaceEntry.UsingEntry): Likewise.
5837         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5838         changes.
5839         (NamespaceEntry.LookupForUsing): Remove.
5840         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5841         names.
5842         (NamespaceEntry.Lookup): Remove support for dotted names.
5843
5844 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5845
5846         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5847         split into two.
5848         (NamespaceEntry.ImplicitParent): Compute on demand.
5849         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5850         parallels the current.
5851         (NamespaceEntry.LookupForUsing): Use it.
5852         (NamespaceEntry.Lookup): If the current namespace-entry is
5853         implicit, don't search aliases and using tables.
5854
5855 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5856
5857         Fix #31984.
5858         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5859         BaseCache here.
5860         (TypeContainer.BaseCache): Compute on demand.
5861         (TypeContainer.FindMembers): Define constants and types if they're
5862         not already created.
5863         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5864         check.
5865         * const.cs (Constant.Define): Make idempotent.
5866
5867 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5868
5869         * pending.cs: Produce better code (no nops produced by using Ldarg
5870         + value).
5871         
5872         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5873         i - 1' it should be arg + 1.
5874
5875         Fixes bug #71819.
5876
5877 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5878
5879         * attribute.cs (Attribute.CheckAttributeType): Make private
5880         non-virtual.
5881         (Attribute.ResolveType): Make virtual.
5882         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5883         handling of RootContext.Tree.Types.
5884
5885 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5886
5887         Update attribute-handling to use the SimpleName/MemberAccess
5888         mechanisms.
5889         * cs-parser.jay (attribute): Pass in an expression to the
5890         constructors of Attribute and GlobalAttribute.
5891         * attribute.cs (Attribute): Take an expression for the name.
5892         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5893         passed in attribute name expression.
5894         (Attribute.CheckAttributeType): Use it.
5895         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5896         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5897         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5898         argument to prevent error messages if the lookup fails.
5899
5900 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5901
5902         * expression.cs (Indirection): Implemented IVariable interface
5903         to support indirection in AddressOf operator.
5904         (PointerArithmetic.Emit): Add optimalization for case where
5905         result can be precomputed.
5906
5907 2005-01-26  Martin Baulig  <martin@ximian.com>
5908
5909         * class.cs (TypeContainer.AttributeTargets): Return the correct
5910         AttributeTargets depending on our `Kind' instead of throwing an
5911         exception; fixes #71632.
5912
5913 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5914
5915         Fix #71257
5916         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5917         constant members.
5918
5919 2005-03-17  Martin Baulig  <martin@ximian.com>
5920
5921         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5922         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5923
5924 2005-03-17  Martin Baulig  <martin@ximian.com>
5925
5926         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5927         to bool so we can return an error condition.
5928         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5929         returned an error.
5930
5931 2005-03-17  Martin Baulig  <martin@ximian.com>
5932
5933         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5934
5935         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5936         converting from an array-type of T to `IEnumerable<T>'.
5937
5938 2005-03-16  Martin Baulig  <martin@ximian.com>
5939
5940         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5941         (Nullable.LiftedUnaryMutator): New public class.
5942
5943         * expression.cs (UnaryMutator.DoResolve): Added support for
5944         Nullable Types.
5945
5946 2005-03-14  Martin Baulig  <martin@ximian.com>
5947
5948         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5949
5950 2005-03-14  Martin Baulig  <martin@ximian.com>
5951
5952         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5953         the comparision operators `<', `>', `<=' and `>='.
5954
5955 2005-03-13  Martin Baulig  <martin@ximian.com>
5956
5957         * generic.cs
5958         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5959         avoid confusion with the `NullLiteral'.
5960         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5961
5962 2005-03-13  Martin Baulig  <martin@ximian.com>
5963
5964         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5965         comparing arbitrary types with the null literal.
5966
5967 2005-03-13  Martin Baulig  <martin@ximian.com>
5968
5969         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5970         boolean operators '&&', '||', '&' and '|'.
5971         (Nullable.OperatorTrueOrFalse): New public class.
5972
5973         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5974         instead of a `StaticCallExpr'; added support for nullables.
5975
5976 2005-03-10  Martin Baulig  <martin@ximian.com>
5977
5978         * expression.cs
5979         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5980         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5981
5982 2005-03-07  Martin Baulig  <martin@ximian.com>
5983
5984         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5985         it work if `expr' is not an IMemoryLocation.
5986         (Nullable.Lifted): Implement IMemoryLocation.
5987         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5988         target type.
5989
5990 2005-03-05  Martin Baulig  <martin@ximian.com>
5991
5992         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5993         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5994         (Nullable): Added support for lifted unary and binary operators.
5995
5996         * expression.cs (Unary.DoResolve): Added support for nullable types.
5997         (Binary.DoResolve): Likewise.
5998         (Conditional.DoResolve): Likewise.
5999
6000 2005-03-02  Martin Baulig  <martin@ximian.com>
6001
6002         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6003
6004         * class.cs (ClassPart.SetParameterInfo): Override this.
6005         (PartialContainer.SetParameterInfo): Override this.
6006         (TypeContainer.CheckConstraints): New protected method.
6007         (PartialContainer.CheckConstraints): Override this and check
6008         whether the same contraints were specified in all parts of a
6009         partial generic type definition.
6010         (PartialContainer.UpdateConstraints): New public method.
6011
6012         * generic.cs (TypeParameter.UpdateConstraints): New public method.
6013
6014 2005-03-02  Martin Baulig  <martin@ximian.com>
6015
6016         Committing a patch from Carlos Alberto Cortez to fix #72887.
6017
6018         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6019         casts from `T []' to `int []'.
6020
6021 2005-03-02  Martin Baulig  <martin@ximian.com>
6022
6023         * generic.cs (TypeManager.IsEqual): Make this symmetric.
6024
6025         * expression.cs (Binary.ResolveOperator): When resolving a
6026         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6027         `=='.  Fixes #71866.  See gen-127.cs.
6028
6029 2005-03-02  Martin Baulig  <martin@ximian.com>
6030
6031         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6032         static constructor in static classes.
6033
6034 2005-03-02  Martin Baulig  <martin@ximian.com>
6035
6036         * generic.cs
6037         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6038         (Nullable.LiftedConversion): Added support for user-defined
6039         conversions.
6040
6041         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6042
6043         * cs-parser.jay: Use ComposedCast everywhere instead of
6044         NullableType, so we don't need to check for NullableType
6045         everywhere.
6046         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6047         case where we'll be resolved into a `parenthesized_expression_0'
6048         afterwards.
6049
6050         * convert.cs
6051         (Convert.UserDefinedConversion): Added nullable conversions.
6052
6053 2005-02-28  Martin Baulig  <martin@ximian.com>
6054
6055         * generic.cs (TypeManager.IsNullableType): New static method.
6056         (Nullable): New abstract class.
6057         (Nullable.NullLiteral): New public class.
6058         (Nullable.LiftedConversion): New public class.
6059
6060         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6061         `builtin_types opt_nullable'.
6062
6063         * convert.cs
6064         (Convert.ImplicitConversionStandard): Added nullable conversions.
6065         (Convert.ExplicitConversionStandard): Likewise.
6066         (Convert.ExplicitConversion): Likewise.
6067
6068 2005-02-26  Martin Baulig  <martin@ximian.com>
6069
6070         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6071         begin with a "?", for instance "?[]".  Don't do a type lookup if
6072         `dim' is empty.
6073
6074 2005-02-25  Martin Baulig  <martin@ximian.com>
6075
6076         The first part of Nullable Types :-)
6077
6078         * generic.cs (NullableType): New public class.
6079         (NullCoalescingOperator): New public class.
6080         (TypeArguments.Resolve): Add a CS0306 check.
6081
6082         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6083         (opt_nullable): New rule.
6084         (type): Added `opt_nullable' to `namespace_or_type_name',
6085         `builtin_types' and `pointer_type'.
6086         (array_type): Added `opt_nullable'.
6087         (opt_rank_specifier_or_nullable): New rule; this is the
6088         combination of `opt_rank_specifier' and `opt_nullable'.
6089         (opt_error): New rule; catch errors here.
6090         (nullable_type_or_conditional): New rule; we use this to check for
6091         nullable and still detect the conditional operator.
6092         (local_variable_type): Use `opt_rank_specifier_or_nullable'
6093         instead `opt_rank_specifier'.
6094
6095         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6096         for nullables.
6097
6098 2005-02-24  Martin Baulig  <martin@ximian.com>
6099
6100         * README, README.Changes: Removed; they're old and obsolete.
6101
6102 2005-02-22  Martin Baulig  <martin@ximian.com>
6103
6104         * generic.cs (TypeParameter.Resolve): If resolving the constraints
6105         returned an error, set `constraints' to null to avoid a crash
6106         later on.
6107         (TypeParameter.ResolveType): Likewise.
6108
6109 2005-02-22  Martin Baulig  <martin@ximian.com>
6110
6111         * generic.cs
6112         (Constraints.ResolveTypes): Protect against being called twice.
6113         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6114         (TypeParameter.ResolveType): New public method; calls
6115         constraints.ResolveTypes().
6116         (TypeParameter.DefineType): Moved constraints.ResolveType() out
6117         into the new ResolveType().
6118         (GenericMethod.Define): Call ResolveType() on all our
6119         TypeParameter's.        
6120
6121 2005-02-21  Martin Baulig  <martin@ximian.com>
6122
6123         * generic.cs
6124         (TypeManager.generic_nullable_type): New static public field.
6125         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6126
6127         * rootcontext.cs
6128         (RootContext.ResolveCore): Resolve "System.Nullable`1".
6129
6130 2005-02-15  Martin Baulig  <martin@ximian.com>
6131
6132         * generic.cs (ConstructedType.Constraints): Correctly check
6133         constraints if the argument type is a type parameter; fixes
6134         #72326. 
6135
6136 2005-02-02  Martin Baulig  <martin@ximian.com>
6137
6138         * delegate.cs (Delegate.DefineType): Report an internal error if
6139         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6140         details.        
6141
6142 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6143
6144         * pending.cs: Produce better code (no nops produced by using Ldarg
6145         + value).
6146         
6147         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6148         i - 1' it should be arg + 1.
6149
6150         Fixes bug #71819.
6151         
6152 2005-01-26  Martin Baulig  <martin@ximian.com>
6153
6154         * cs-parser.jay (indexer_declarator): Don't report an error if we
6155         have type parameters since we can be an explicit interface
6156         implementation; fixes #71449.
6157
6158 2005-01-26  Martin Baulig  <martin@ximian.com>
6159
6160         * class.cs (TypeContainer.AttributeTargets): Return the correct
6161         AttributeTargets depending on our `Kind' instead of throwing an
6162         exception; fixes #71632.
6163
6164 2005-01-26  Martin Baulig  <martin@ximian.com>
6165
6166         * delegate.cs (Delegate.DefineType): Correctly define our type
6167         parameters.  Fixes #71483.
6168
6169 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6170
6171         Fix #71602.
6172         * expression.cs (MemberAccess.DoResolve): Don't complain with
6173         cs0572 when the LHS of a member access has identical name and type
6174         name.
6175
6176 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6177
6178         Fix #71651, #71675
6179         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6180         CreatePermission.
6181         Create custom PermissionSet only for PermissionSetAttribute.
6182
6183 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6184
6185         Fix #71649
6186         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6187         delegates in static class.
6188
6189 2005-01-24  Martin Baulig  <martin@ximian.com>
6190
6191         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6192         merging an implicit block, just use its reachability.
6193
6194         * statement.cs (Block.Resolve): Make the unreachable code check
6195         work wrt. implicit blocks; see test-337 from #63842.
6196
6197 2005-01-21  Alp Toker  <alp@atoker.com>
6198  
6199         * cs-parser.jay: destructor_declaration's container is PartialContainer
6200         not Class when partial types are used, so use Kind prop instead of
6201         'is'.
6202         
6203 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6204
6205         * cs-parser.jay: Improve error reporting when an interface
6206         declares new types.
6207
6208 2005-01-20  Dick Porter  <dick@ximian.com>
6209
6210         * support.cs: SeekableStreamReader fix from Sandor Dobos
6211         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6212         chars are read.  Fixes bug 70369.
6213
6214 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6215
6216         * cs-parser.jay (catch_clause): Simplify current_block handling
6217         somewhat.
6218
6219 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6220
6221         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6222         code with ImplicitStandardConversion to handle the implicit
6223         conversion of method groups into valid delegate invocations. 
6224
6225         The problem is that in parameter handling we were using this code
6226         path.  Fixes bug #64698
6227
6228 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6229
6230         * cs-parser.jay: Fix several infelicities.
6231         - Avoid assigning to the parser value stack.  Code like 
6232           '$3 = null' is unclean.  Synthesize a value for the code block
6233           instead. 
6234         - Avoid using oob_stack for storing location information.  Use ...
6235         (_mark_): ... this.  New (empty) rule.  Saves the current location
6236         in $$.
6237         (foreach_statement): Avoid using oob_stack for current_block
6238         handling.  Use technique used in for_statement and
6239         using_statement.  Synthesize a value for the code block to store
6240         additional intermediate information.
6241
6242 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6243
6244         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6245         of a different type is only allowed to private fields of a
6246         containing type, not on fields of a base class.
6247
6248         See test-174.cs and error cs0122-9.cs
6249
6250 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6251
6252         Fix test-335.cs (bug #58126).
6253         * cs-parser.jay (argument): Split out non-expression parts of the
6254         rule into 'non_simple_argument'.
6255         (invocation_expression): Support parenthesized invocations with
6256         multiple arguments, and with single non-simple arguments.
6257
6258 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6259
6260         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6261         places.
6262
6263 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6264
6265         Fix cs0038-1.cs, cs1640-6.cs.
6266         * ecore.cs (Expression.Resolve): Remove special-case for
6267         SimpleName in error-handling.
6268         (Expression.almostMatchedMembers): Relax access permission to
6269         protected.
6270         (Expression.MemberLookupFailed): Handle duplicates in
6271         almostMatchedMembers list.
6272         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6273         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6274         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6275         overload if the passed in MemberInfo is a MethodBase.
6276
6277 2005-01-25  Martin Baulig  <martin@ximian.com>
6278
6279         * doc.cs
6280         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6281
6282 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6283
6284         Fix #70749
6285         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6286         for non-CAS & merge permission sets properly.
6287
6288 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6289
6290         Improve standard-compliance of simple name and member access 
6291         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6292         * ecore.cs (FullNamedExpression): New abstract base class 
6293         for Namespaces and TypeExpressions.
6294         (ResolveFlags.SimpleName): Remove.
6295         (SimpleName): Remove support for dotted names.
6296         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6297         DeclSpace.FindType and DeclSpace.LookupType.
6298         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6299         (Expression.ExprClassName): Make member function.
6300         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6301         a namespace.  Remove creation of dotted "SimpleName"s.
6302         (MemberAccess.DoResolve): Likewise.
6303         * decl.cs (DeclSpace.Cache): Make private.
6304         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6305         (DeclSpace.FindType): Update.
6306         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6307         FullNamedExpression.
6308         * namespace.cs (Namespace): Derive from FullNamedExpression
6309         so that it can be part of expression resolution.
6310         (Namespace.Lookup): Return an FullNamedExpression.
6311         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6312         namespace.
6313         * rootcontext.cs (NamespaceLookup): Remove.
6314         (LookupType): Move to DeclSpace.
6315         * attribute.cs (CheckAttributeType): Update.
6316         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6317         (FindDocumentedTypeNonArray): Likewise.
6318
6319 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6320
6321         Fix cs0509.cs, cs1632.cs.
6322         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6323         is the same as IsInterface.
6324         (TypeContainer.GetClassBases): Likewise.
6325         * statement.cs (LabeledStatement.ig): New field.
6326         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6327         label.
6328         (LabeledStatement.DoEmit): Check that the label was created with
6329         the same ILGenerator.
6330
6331 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6332
6333         Fix #71058
6334         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6335         accessors to its properties.
6336
6337         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6338         from accessors to property.
6339         
6340 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6341
6342         Fix #70722
6343         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6344         only for overrides.
6345         
6346 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6347
6348         * attribute.cs: Check for null and empty strings.  
6349
6350         I have lost another battle to Paolo.
6351
6352 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6353
6354         Fix #70942
6355         * class.cs (PropertyMethod): Set Parent field in ctors.
6356         (SetMethod.InternalParameters): Add unsafe switch hack.
6357         Override MarkForDuplicationCheck where it is appropriate.
6358
6359         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6360         It says whether container allows members with the same name.
6361         Base default is no.
6362         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6363         Removed is_method parameter.
6364
6365 2005-01-06  Duncan Mak  <duncan@ximian.com>
6366
6367         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6368         because the previous change led to incorrect reporting of CS1032
6369         ("Cannot define/undefine preprocessor symbols after first token in
6370         file"). Instead of using `tokens_seen' as the only flag that
6371         triggers CS1040, introduce `comments_seen'. This new flag is used
6372         to signify having seen comments on the current line, so it is
6373         unset after a newline.
6374
6375 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6376
6377         * doc.cs : When searching for a type, find nested type too.
6378           This fixes bug #71040.
6379
6380 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6381
6382         * doc.cs :
6383           - Warn missing member comment on those classes which also does not
6384             have doc comments. Fixed bug #71041.
6385           - Don't warn missing doc comment on default constructor.
6386             Fixed bug #71042.
6387
6388 2005-01-06  Duncan Mak  <duncan@ximian.com>
6389
6390         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6391         comments, set `tokens_seen' to true. This allows us to detect
6392         misplaced preprocessor directives (i.e. not at the beginning of
6393         the a line, nor after whitespaces). In that case, report error
6394         CS1040. This fixes bug #56460.
6395
6396         * cs-parser.jay (interface_member_declaration): Add checks for
6397         IsExplicitImpl, and report CS0541 error if an interface member is
6398         defined as an explicit interface declaration.
6399
6400 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6401
6402         Fix #70817
6403         * class.cs (PropertyMethod): Set Parent field in ctors.
6404         (SetMethod.InternalParameters): Add unsafe switch hack.
6405         
6406         * decl.cs (MemberCore.Parent): Cannot be readonly.
6407
6408 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6409
6410         * decl.cs (DeclSpace.ResolveType): Remove.
6411         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6412         Merge in code from ...
6413         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6414         * class.cs, enum.cs: Update to changes.
6415
6416 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6417
6418         * anonymous.cs: Ensure that we init the scope of our parent if it
6419         has not been initialized yet.
6420
6421 2004-12-30  Duncan Mak  <duncan@ximian.com>
6422
6423         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6424         if field.FieldBuilder is null. Fixes #70758.
6425
6426         * convert.cs: Fixed some typos and updated some of the comments.
6427         (ImplicitStandardConversionExists):
6428         (TryImplicitIntConversion): If `target_type' is an interface and
6429         the type of `ic' implements this interface, return true or a new
6430         BoxedCast instead of null. This fixes #70468.
6431
6432 2004-12-29  Duncan Mak  <duncan@ximian.com>
6433
6434         * expression.cs (Argument.Emit): Check that Expr is
6435         IMemoryLocation before casting to it, and report CS1510 otherwise.
6436
6437         This fixes #70402.
6438
6439 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6440
6441         * statement.cs (Block.ThisVariable): remove the recursion here, to
6442         make the --profile more sane.
6443
6444 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6445
6446         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6447         assembly, by JB Evain.
6448
6449 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6450
6451         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6452           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6453         "parent" refers to enclosing type/class.  "base" refers to superclass.
6454
6455 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6456
6457         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6458         Ensure that we only have GlobalAttributes.
6459         * attribute.cs (Attribute.Emit): Make non-virtual.
6460         (GlobalAttribute.Emit): Remove.
6461         (Attribute.Resolve): Make virtual.
6462         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6463         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6464         the argument. Don't create one.
6465         (Attribute.GetObsoleteAttribute): Likewise.
6466         (Attribute.GetClsCompliantAttributeValue): Likewise.
6467         * class.cs, decl.cs: Update to changes.
6468
6469 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6470
6471         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6472         
6473         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6474         
6475         * statement.cs (Foreach.Resolve): Add error 186 report.
6476
6477 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6478
6479         * expression.cs (Conditional.DoResolve): Add warning 429.
6480         
6481         * statement.cs (If.Resolve): Add warning 665.
6482
6483 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6484
6485         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6486         except when in the parser, and in GlobalAttribute.
6487         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6488         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6489         RootContext.Tree.Types.NamespaceEntry once work is done.
6490         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6491         and resets RootContext.Tree.Types.NamespaceEntry.
6492
6493 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6494
6495         * cs-parser.jay: Don't create a block for every variable.
6496
6497 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6498
6499         * location.cs: Provide extra information.
6500
6501         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6502         variables from the captured environment, it is the ldarg_0.
6503
6504 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6505
6506         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6507         find a conclusion.
6508         
6509         * class.cs: Changed warning level for 169 to avoid developer
6510         displeasure from warning flooding. It will be changed back when they
6511         fix most of current BCL warnings.
6512         
6513         * RootContext.cs: Pushed default WarningLevel to 3.
6514         
6515         * statement.cs: Removed unused variable.
6516
6517 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6518
6519         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6520         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6521         Add error 502 report.
6522         (StaticClass.DefineType): Add error 441 report.
6523         (Class.AllowedModifiersProp): New virtual property as temporary
6524         extension to AllowedModifiers.
6525         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6526         to share implementation with StaticClass and don't call virtual
6527         methods from ctor.
6528         
6529         * driver.cs (MainDriver): Add error 1558 test.
6530
6531         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6532         report. Moved error 36 test here.
6533
6534         * statement.cs (Throw.Resolve): Add error 724 report.
6535
6536         * typemanager.cs: Add out_attribute_type core type.
6537         
6538 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6539
6540         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6541         3018 report.
6542         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6543
6544         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6545         3017 report.
6546         
6547         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6548
6549         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6550         Add error 3023 report.
6551         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6552
6553         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6554         implementation.
6555
6556 2004-12-12  John Luke  <john.luke@gmail.com>
6557
6558         * driver.cs (AddArgs): take -- into account when
6559         adding arguments, fixes bug 65710 
6560
6561 2004-12-12  Martin Baulig  <martin@ximian.com>
6562
6563         * expression.cs (Unary.TryReduceNegative): Added support for
6564         SByteConstant and ByteConstant.
6565         (Unary.Reduce): Check error values from TryReduceNegative().
6566
6567 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6568
6569         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6570         and report exception as error 182.
6571
6572 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6573
6574         * driver.cs (Main): Fix message when there are warnings.
6575
6576 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6577
6578         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6579
6580 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6581
6582         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6583         Reduced number of warnings.
6584         
6585         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6586
6587 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6588
6589         * driver.cs: Removed message.
6590
6591         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6592
6593 2004-12-08    <vargaz@freemail.hu>
6594
6595         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6596
6597 2004-12-08  Martin Baulig  <martin@ximian.com>
6598
6599         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6600         instead of a CS3002 for properties and indexer.
6601
6602 2004-12-08  Martin Baulig  <martin@ximian.com>
6603
6604         * decl.cs (MemberName.ToString): Make this work again.
6605
6606 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6607
6608         * attribute.cs (Resolve): Add error 591 detection.
6609
6610         * class.cs (FieldMember.Define): Add error 1547 detection.
6611         (Indexer.Define): Add error 620 detection.
6612         (Operator.Define): Add error 590 detection.
6613
6614         * ecore.cs: Missing argument for error 79.
6615
6616         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6617         detection.
6618
6619 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6620
6621         Fix #70106
6622         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6623         only.
6624
6625 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6626
6627         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6628           Some operator comments were suppressed.
6629         * doc.cs : Implicit/explicit operator name in doc comments are like
6630           "op_Explicit(type)~returnType", so added suffix handling.
6631
6632 2005-01-21  Alp Toker  <alp@atoker.com>
6633
6634         * cs-parser.jay: destructor_declaration's container is PartialContainer
6635         not Class when partial types are used, so use Kind prop instead of 'is'.
6636
6637 2004-12-12  Martin Baulig  <martin@ximian.com>
6638
6639         * expression.cs (Unary.TryReduceNegative): Added support for
6640         SByteConstant and ByteConstant.
6641         (Unary.Reduce): Check error values from TryReduceNegative().
6642
6643 2004-12-11  Martin Baulig  <martin@ximian.com>
6644
6645         * support.cs (ReflectionParameters.ParameterName): If we have a
6646         `gpd', call `ParameterName' on it.
6647
6648         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6649
6650         * pending.cs (PendingImplementation.DefineProxy): Call
6651         DefineParameter() for all of the MethodBuilder's arguments.
6652
6653 2004-12-09  Martin Baulig  <martin@ximian.com>
6654
6655         * doc.cs (DocUtil): Make this a static class.
6656
6657 2004-12-09  Martin Baulig  <martin@ximian.com>
6658
6659         * expression.cs (Invocation.InferType): Moved the type inference
6660         implementation into TypeManager.
6661
6662         * generics.cs (TypeManager): Moved the type inference
6663         implementation here.
6664
6665 2004-12-09  Martin Baulig  <martin@ximian.com>
6666
6667         * typemanager.cs (TypeManager): Make this a partial class.
6668
6669         * generics.cs
6670         (TypeManager): Move the generics part of `TypeManager' here.
6671
6672 2004-12-08  Martin Baulig  <martin@ximian.com>
6673
6674         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6675         instead of a CS3002 for properties and indexer.  Added CS3024
6676         check for generic interfaces.
6677
6678         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6679         instances are not CLS-compliant.
6680
6681 2004-12-08  Martin Baulig  <martin@ximian.com>
6682
6683         * cs-parser.jay
6684         (void_pointer_expression): New rule for `void*', `void**' etc.
6685         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6686
6687 2004-12-08  Martin Baulig  <martin@ximian.com>
6688
6689         * expression.cs (Invocation.InferType): Removed the hack for
6690         MethodCore.MayUnify().  
6691
6692         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6693         this actually work.
6694
6695         * class.cs (MethodCore.MayUnify): Use
6696         TypeManager.MayBecomeEqualGenericTypes().       
6697
6698 2004-12-08  Martin Baulig  <martin@ximian.com>
6699
6700         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6701         parameter, box it.  Fixes #69233.
6702
6703 2004-12-08  Martin Baulig  <martin@ximian.com>
6704
6705         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6706         have the ctor constraint.  Fixes #68326.
6707
6708 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6709
6710         * cs-parser.jay : interface comment was not consumed because of
6711           extra opt_semicolon before doc handling.
6712
6713 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6714
6715         Fix test-327.cs, test-328.cs, and put in early infrastructure
6716         for eventually fixing #52697.
6717         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6718         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6719         from other methods.
6720         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6721         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6722         (VerifyUsing, error246): Update.
6723         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6724         'NamespaceEntry.LookupNamespaceOrType'.
6725
6726 2004-12-07  Martin Baulig  <martin@ximian.com>
6727
6728         * driver.cs: Call it "BETA SOFTWARE" :-)
6729
6730 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6731
6732         Fix crash on cs0657-17.cs.
6733         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6734         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6735         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6736         the case where the NamespaceEntry gets overwritten.
6737
6738 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6739
6740         Fixed #69195, #56821
6741         * ecore.cs (ResolveBoolean): Tiny refactoring.
6742
6743         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6744         of right expression resolving when left is false constant and
6745         operator is LogicalAnd OR true constant and operator is LogicalOr.
6746
6747         * statement.cs (ResolveUnreachable): Always reports warning.
6748
6749 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6750
6751         * class.cs: Distinguish between 1721 and 1722 (just a little help
6752         for the programmer).
6753
6754 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6755
6756         * delegate.cs: Only allow this on new versions of the language. 
6757
6758 2004-12-02  Duncan Mak  <duncan@ximian.com>
6759
6760         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6761         Expression class.
6762         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6763         here as a static method. Take an additional bool out parameter
6764         `must_do_cs1540_check' for signaling to InstanceResolve.
6765         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6766         member field from PropertyExpr class and made it an argument of
6767         the method instead.
6768         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6769         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6770         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6771         and `remove_accessor' as well as InstanceResolve: report CS0122
6772         where applicable.
6773
6774         Fixes #70129.
6775
6776 2004-12-07  Martin Baulig  <martin@ximian.com>
6777
6778         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6779         and CS0692 where appropriate.
6780
6781 2004-12-06  Martin Baulig  <martin@ximian.com>
6782
6783         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6784         IsDuplicateImplementation() and improved it.
6785
6786         * expression.cs (Invocation.InferTypeArguments): Added
6787         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6788         and removed the "ref" modifier from `infered_types'.
6789
6790         * decl.cs (MemberName.ToString): Removed the exception.
6791
6792 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6793
6794         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6795           comments are allowed.
6796
6797 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6798
6799         * delegate.cs: Add checks for subtypes in paramaters and return values
6800         in VerifyMethod () to add support for Covariance/Contravariance
6801         in delegates.
6802         
6803 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6804
6805         * report.cs: Remove extra closing parenthesis.
6806
6807         * convert.cs (Error_CannotImplicitConversion): If the name of the
6808         types are the same, provide some extra information.
6809
6810 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6811
6812         Fix bug #70102
6813         * attribute.cs (Resolve): Improved implementation of params
6814         attribute arguments.
6815
6816         * support.cs (ParameterData): Add HasParams to be faster.
6817
6818 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6819
6820         all things are for /doc support:
6821
6822         * doc.cs: new file that supports XML documentation generation.
6823         * mcs.exe.sources: added doc.cs.
6824         * driver.cs:
6825           Handle /doc command line option.
6826           Report error 2006 instead of 5 for missing file name for /doc.
6827           Generate XML documentation when required, after type resolution.
6828         * cs-tokenizer.cs:
6829           Added support for picking up documentation (/// and /** ... */),
6830           including a new XmlCommentState enumeration.
6831         * cs-parser.jay:
6832           Added lines to fill Documentation element for field, constant,
6833           property, indexer, method, constructor, destructor, operator, event
6834           and class, struct, interface, delegate, enum.
6835           Added lines to warn incorrect comment.
6836         * rootcontext.cs :
6837           Added Documentation field (passed only when /doc was specified).
6838         * decl.cs:
6839           Added DocComment, DocCommentHeader, GenerateDocComment() and
6840           OnGenerateDocComment() and some supporting private members for
6841           /doc feature to MemberCore.
6842         * class.cs:
6843           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6844         * delegate.cs:
6845           Added overriden DocCommentHeader.
6846         * enum.cs:
6847           Added overriden DocCommentHeader and GenerateDocComment().
6848
6849 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6850
6851         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6852         unwrapping the enumeration values, chain to
6853         DoConstantNumericPromotions again, so we can promote things to the
6854         fundamental types (takes care of enums that are bytes, sbytes).
6855
6856         Fixes bug #62054.
6857
6858 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6859
6860         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6861         Fix long-standing bug in type-lookup.  Use FindType instead of
6862         LookupType when ec.ResolvingTypeTree.
6863         (Attribute.ResolveType, Attribute.Resolve)
6864         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6865         Update to changes.
6866         (Attributes.Search): Remove internal version.  Update.
6867         (Attributes.SearchMulti): Update.
6868         (Attributes.GetClsCompliantAttribute): Remove.
6869         (Attributes.GetIndexerNameAttribute): Remove.
6870         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6871         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6872         * class.cs (Indexer.Define): Likewise.
6873
6874 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6875
6876         Fix bug #68790
6877         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6878         MarshallByReference members access.
6879
6880         * expression.cs: Use CheckMarshallByRefAccess;
6881         Better error CS0197 message.
6882
6883         * report.cs: Print whole related error message.
6884
6885 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6886
6887         * class (GetClassBases): Better error 60 report.
6888         (EventProperty): Disabled warning 67 detection.
6889
6890 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6891
6892         Fix bug #60324
6893         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6894
6895         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6896         precise values.
6897
6898 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6899
6900         Fix bug #49488
6901         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6902
6903         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6904
6905 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6906
6907         * attribute.cs (Attribute.Resolve): Refine error reporting and
6908         report a cs0117 if the identifier does not exist, to distinguish
6909         from 0617 which is a miss-use of the actual identifier.
6910
6911         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6912         between cs0070 and cs0079.
6913
6914         * class.cs (MemberBase.DoDefine): When reporting a wrong
6915         accessibility level, we use MethodCore to compare instead of
6916         Method (this was a regression in some refactoring effort).
6917
6918         So now we correctly report cs0056 again.
6919
6920         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6921         testing the target_type (which was known to be object_type) and
6922         not the source type (which is anonymous_method).
6923
6924         Fixed reporting of error cs1660.
6925
6926         * expression.cs (UserCast.Source): Expose the underlying cast.
6927
6928         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6929         allowed types to find a match to int32 first (most common).
6930
6931         In addition, it ignores any ImplicitUserConversions that did an
6932         internal implicit conversion (as the switch statement allows only
6933         one integral conversion to exist).
6934
6935         * class.cs (PartialContainer.Create): rename `name' to
6936         `member_name' for clarity.  Then replace the string calls with a
6937         call to MemberName.GetPartialName, as now using
6938         MemberName.ToString is an error (this is due to the side effects
6939         it had, that were fixed in the past).
6940
6941         This will restore the error reporting on a number of partial class
6942         errors that were missusing this (and getting an exception as a
6943         results, which is now just a plain textual warning, because
6944         yyparse debug output would crash otherwise).
6945
6946 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6947
6948         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6949
6950 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6951
6952         * rootcontext.cs (LookupType): Make sure to cache lookups that
6953         don't give us a negative result. This saves about 5% of corlib
6954         compilation time.
6955
6956 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6957
6958         * report.cs (AbstractMessage.Print): messages are sent to stderr
6959
6960         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6961         non-interface in the list of interfaces (at this point, either
6962         parent was properly set, or a base class is being listed in the
6963         interfaces section).
6964
6965         This flags error 1722, and resolves the crash from bug 69259.
6966
6967 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6968
6969         * statement.cs (Using.EmitExpressionFinally): make this work right
6970         for valuetypes. Fixes 69926.
6971
6972 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6973
6974         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6975         converted to an enum" here, before we try to change the underlying
6976         type.  This code exists, but it is a different code path than the
6977         one used while encoding constants.
6978
6979         (ImplicitReferenceConversionExists): In addition, resynchronized
6980         the code here, so it matches the same code in
6981         ImplicitReferenceConversionExists for the `from any class-type S
6982         to any interface-type T'.       
6983
6984 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6985
6986         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6987
6988 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6989
6990         * cs-parser.jay: Use verbosity accordingly. 
6991
6992 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6993
6994         * expression.cs (Unary.ResolveOperator): Do not report warning;
6995         AddressOf reads from variable.
6996         
6997         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6998
6999 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7000
7001         Fix bug #69462
7002
7003         * attribute.cs (Attributable): Removed CheckTargets.
7004         (Attributes.Emit): Explicit attribute targets are tested here.
7005
7006         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7007         not enabled for interfaces.
7008
7009         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7010         (GetAssemblyName): Ouch next bug there.
7011
7012 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7013
7014         * expression.cs: Error 275 added.
7015         
7016 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7017
7018         Fix bug #69177 (Implemented decimal constant support)
7019
7020         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7021         (BinaryFold): Add DecimalConstant.
7022
7023         * const.cs (Define): Decimal constant 
7024         (is not constant.
7025         (ChangeType): Add decimal type handling.
7026         (LookupConstantValue): Don't set value for decimal type but
7027         emit DecimalConstantAttribute. Needed for constant optimization.
7028
7029         * constant.cs (ToDecimal): New method.
7030         (ConvertToDecimal): New method.
7031         (IntConstant): Implemented ConvertToDecimal.
7032         (DecimalConstant.Emit): Emit optimized version for decimals in
7033         int range.
7034
7035         * expression.cs (ResolveOperator): Changed order of constant
7036         reduction to work correctly with native types which have
7037         overloaded operators.
7038         (ResolveMemberAccess): Extract constant value from attribute
7039         for decimal type.
7040
7041         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7042
7043         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7044         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7045         (ChangeType): Decimal is special.
7046         (TypeToCoreType): Add decimal type.
7047
7048 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7049
7050         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7051         decimal types.
7052
7053 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7054
7055         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7056         test cs1667-5.cs.
7057
7058 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7059
7060         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7061
7062         * pending.cs (PendingImplementation): Grab only interfaces.
7063
7064 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7065
7066         * statement.cs (ForeachHelperMethods): Add location member and
7067         error 202 detection.
7068
7069 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7070
7071         * expression.cs (DoResolveBase): Fixed wrong warning for out
7072         variables.
7073
7074 2004-12-04  Martin Baulig  <martin@ximian.com>
7075
7076         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7077         to check whether the conversion is ok.
7078
7079         * typemanager.cs (TypeManager.GetTypeArguments): Just return
7080         `Type.EmptyTypes' if we're not a generic TypeContainer.
7081
7082 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7083
7084         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7085         old bug: when converting from the null literal to a pointer,
7086         return an EmptyCast, not the NullLiteral.
7087
7088         This fixes #69921, the recent null_type changes probably made this
7089         bug more prominent.
7090
7091 2004-12-03  Martin Baulig  <martin@ximian.com>
7092
7093         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7094         method as our child, call AnonymousMethod.Compatible() on it.
7095
7096 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7097
7098         * class.cs (FieldBase): Use an unused bit field from the field to
7099         encode the `has_offset' property from the FieldMember.  This saves
7100         a couple of Ks on bootstrap compilation.
7101
7102         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7103         method as our child, return the AnonymousMethod resolved
7104         expression.
7105
7106         * expression.cs (New.DoResolve): Allow return values from
7107         NewDelegate to also include AnonymousMethods.
7108
7109         Fixes #70150.
7110
7111 2004-11-29  Raja R Harinath  <rharinath@novell.com>
7112
7113         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7114         cs1648 report.
7115         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7116         System.Runtime.InteropServices._Exception, since it's a base
7117         interface of the core type System.Exception in the net_2_0 profile.
7118
7119 2004-11-27  Martin Baulig  <martin@ximian.com>
7120
7121         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7122
7123 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7124
7125         * Makefile: Convert to use executable.make.
7126         * gmcs.exe.sources: New.
7127
7128 2004-11-25  Martin Baulig  <martin@ximian.com>
7129
7130         * expression.cs (Invocation.InferType): Added support for byref types.
7131
7132 2004-11-25  Martin Baulig  <martin@ximian.com>
7133
7134         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7135         in TypeManager.TypeToCoreType().
7136
7137 2004-11-25  Martin Baulig  <martin@ximian.com>
7138
7139         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7140         "Dispose" method from the `current_type'.
7141         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7142         DoDefineMembers() instead of using the MethodBuilder; this is
7143         required for generic iterators.
7144
7145         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7146
7147 2004-11-24  Martin Baulig  <martin@ximian.com>
7148
7149         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7150
7151 2004-11-20  Martin Baulig  <martin@ximian.com>
7152
7153         * expression.cs (Invocation.InferType): Correctly infer generic
7154         instances; see gen-103.cs.
7155         (Invocation.InferTypeArguments): If a generic method doesn't have
7156         any unbound type parameters, we don't need to infer anything.
7157
7158 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7159
7160         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7161
7162 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7163
7164         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7165         (TypeHandle.GetMemberCache): New.
7166         (TypeHandle.TypeHandle): Update.
7167         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7168         (TypeManager.LookupParentInterfacesCache):
7169         Rename from LookupInterfaceCache.  Optimize slightly.
7170         (TypeManager.MemberLookup_FindMembers): Update.
7171         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7172         multi-type variant.
7173         (AddCacheContents): Rename from AddHashtable.
7174         * class.cs (TypeContainer.parent_container): Remove.
7175         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7176         (TypeContainer.DoDefineMembers): Don't initialize it.
7177         Update to name changes.
7178         
7179 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7180
7181         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7182         that factors the code to check access modifiers on override.  
7183
7184         (PropertyBase): Use the code here.
7185
7186         Patch from Lluis S'anchez, fixes bug #69361.
7187
7188 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7189
7190         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7191         routine that is used to report the use of a captured variable
7192         whose address has been taken.
7193
7194         There are two checks: one when variables are being captured and
7195         the other check is when the address of a variable is taken. 
7196         
7197         (because an anonymous methods might be resolved before *or* after
7198         the address has been taken) and 
7199
7200         * expression.cs (Conditional.DoResolve): Remove the special
7201         casing that Martin added to trueExpr and falseExpr being both
7202         NullLiteral.  We get the right behavior now just by introducing
7203         the null_type into the compiler. 
7204
7205         * convert.cs (ExplicitConversion): Change the code to use
7206         null_type instead of testing `expr is NullLiteral'.
7207         (ImplicitConversionStandard): use null_type too.
7208         (ImplicitReferenceConversionExists): use null_type too.
7209         (ImplicitReferenceConversion): use null_type too.
7210
7211         * literal.cs: The type of `NullLiteral' is now null_type instead
7212         of object_type. 
7213         (Resolve): Set the type here.
7214
7215         * typemanager.cs: Introduce null_type.
7216
7217 2004-11-18  Martin Baulig  <martin@ximian.com>
7218
7219         * rootcontext.cs
7220         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7221
7222 2004-11-18  Martin Baulig  <martin@ximian.com>
7223
7224         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7225
7226 2004-11-18  Martin Baulig  <martin@ximian.com>
7227
7228         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7229         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7230         call ResolveConstructedType() on it to resolve it without checking
7231         constraints.
7232         (Constraints.ResolveTypes): Check them here.
7233         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7234         but don't check constraints.
7235         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7236         check constraints here.
7237         (ConstructedType.ResolveConstructedType): New public method.  This
7238         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7239         resolve ourselves without checking constraints.
7240
7241         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7242
7243 2004-11-18  Martin Baulig  <martin@ximian.com>
7244
7245         * decl.cs
7246         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7247
7248         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7249
7250 2004-11-18  Martin Baulig  <martin@ximian.com>
7251
7252         * ecore.cs (TypeExpr.ResolveType): Removed.
7253         (Expression.ResolveAsTypeTerminal): We always return a fully
7254         resolved `TypeExpr', so we can just access its `Type'.
7255
7256         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7257
7258 2004-11-17  Martin Baulig  <martin@ximian.com>
7259
7260         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7261         sure we don't return any unresolved TypeExpr's.
7262         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7263         a `TypeExpr'.
7264         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7265
7266         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7267         unresolved `ConstructedType's.
7268
7269 2004-11-17  Martin Baulig  <martin@ximian.com>
7270
7271         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7272
7273 2004-11-17  Martin Baulig  <martin@ximian.com>
7274
7275         * ecore.cs
7276         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7277
7278         * decl.cs (DeclSpace.ResolveType): Removed.
7279         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7280
7281 2004-11-17  Martin Baulig  <martin@ximian.com>
7282
7283         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7284         direction, like FindMembers() does.  Fixes #69546, testcase is in
7285         test-315.cs.    
7286
7287 2004-11-16  Martin Baulig  <martin@ximian.com>
7288
7289         This is based on a patch from Marek Safar, see bug #69082.
7290         Fixes bugs #63705 and #67130.
7291
7292         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7293         method; create a MemberCache for an interface type and cache the
7294         result.
7295
7296         * decl.cs (IMemberContainer.ParentContainer): Removed.
7297         (IMemberContainer.ParentCache): New property.
7298         (MemberCache.SetupCacheForInterface): Removed.
7299         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7300         to create a cache for an interface's "parent".
7301
7302         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7303         interfaces too.
7304
7305 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7306
7307         * statement.cs: Avoid adding bools to a hashtable.
7308
7309 2004-11-15  Martin Baulig  <martin@ximian.com>
7310
7311         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7312
7313 2004-11-11  Martin Baulig  <martin@ximian.com>
7314
7315         * typemanager.cs (TypeManager.GetMethodName): New method.
7316
7317         * class.cs (MethodData.Define): Include the generic arity in the
7318         name of an explicit interface; also add it to the method name.
7319
7320         * pending.cs (PendingImplementation.InterfaceMethod): The method
7321         name now includes the generic arity.
7322
7323 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7324
7325         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7326         calling an unsafe method from a safe location.
7327
7328 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7329
7330         Fix #69167
7331         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7332
7333 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7334
7335         * namespace.cs (VerifyUsing): use GetPartialName instead of
7336         ToString. 
7337
7338 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7339
7340         * statement.cs (Return.Resolve): Fix regression in typo: if
7341         `in_exc', we have to request a NeedReturnLabel, this was a typo
7342         introduced in the anonymous method check-in.  Fixes #69131.
7343
7344         * Indexers were using the ShortName when defining themselves,
7345         causing a regression in the compiler bootstrap when applying the
7346         patch from 2004-11-02 (first part), now they use their full name
7347         and the bug is gone.
7348
7349 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7350
7351         * driver.cs: Strip the path from the names of embedded resources. Fixes
7352         #68519.
7353
7354 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7355
7356         Fix error message regression: cs0104-2.cs.
7357         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7358         (AliasEntry.Resolve): Update.
7359         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7360         'silent' flag.
7361         (RootContext.LookupType): Update.
7362
7363 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7364
7365         * cs-parser.jay: Add support for handling accessor modifiers
7366         * class: Add support port accessor modifiers and error checking,
7367         define PropertyMethod.Define as virtual (not abstract anymore)
7368         * ecore.cs: Add checking for proeprties access with access modifiers
7369         * iterators.cs: Modify Accessor constructor call based in the modified
7370         constructor
7371 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7372
7373         * expression.cs (StringConcat): Handle being called twice,
7374         as when we have a concat in a field init with more than two
7375         ctors in the class
7376
7377 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7378
7379         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7380         special case explicit implementations, we should always produce
7381         the .property or .event declaration.
7382         
7383         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7384         since it will not return correct data if people use this
7385         unresolved in the presence of using statements (see test-313).
7386
7387         * class.cs (MethodData.Define): If we are an explicit interface
7388         implementation, set the method name to the full name of the
7389         interface plus the name of the method.  
7390
7391         Notice that using the method.MethodName.GetFullName() does not
7392         work, as it will only contain the name as declared on the source
7393         file (it can be a shorthand in the presence of using statements)
7394         and not the fully qualifed type name, for example:
7395
7396         using System;
7397
7398         class D : ICloneable {
7399                 object ICloneable.Clone ()  {
7400                 }
7401         }
7402
7403         Would produce a method called `ICloneable.Clone' instead of
7404         `System.ICloneable.Clone'.
7405
7406         * namespace.cs (Alias.Resolve): Use GetPartialName.
7407         
7408 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7409
7410         * cs-parser.jay: Add error 1055 report.
7411
7412 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7413
7414         * assign.cs (Assign.DoResolve): Only do the transform of
7415         assignment into a New if the types are compatible, if not, fall
7416         through and let the implicit code deal with the errors and with
7417         the necessary conversions. 
7418
7419 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7420
7421         * cs-parser.jay: Add error 1031 report.
7422
7423         * cs-tokenizer.cs: Add location for error 1038.
7424
7425 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7426
7427         * cs-parser.jay: Add error 1016 report.
7428
7429 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7430
7431         * cs-parser.jay: Add errors 1575,1611 report.
7432
7433 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7434
7435         * cs-parser.jay: Add error 1001 report.
7436
7437 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7438
7439         Fix #68850
7440         * attribute.cs (GetMarshal): Add method argument for
7441         caller identification.
7442
7443         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7444         agument for GetMarshal and RuntimeMissingSupport.
7445
7446 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7447
7448         * attribute.cs (ExtractSecurityPermissionSet): Removed
7449         TypeManager.code_access_permission_type.
7450
7451         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7452
7453 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7454
7455         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7456         for obsolete use of a variable here.   Fixes regression on errors
7457         cs0619-25 and cs0619-26.
7458
7459 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7460
7461         Fix #62358, implemented security attribute encoding.
7462
7463         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7464         Tests permitted SecurityAction for assembly or other types.
7465         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7466         data from SecurityPermissionAttribute to PermisionSet class.
7467
7468         * class.cs (ApplyAttributeBuilder): Added special handling
7469         for System.Security.Permissions.SecurityAttribute based types.
7470
7471         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7472         special handling for System.Security.Permissions.SecurityAttribute
7473         based types.
7474
7475         * enum.cs (ApplyAttributeBuilder): Added special handling
7476         for System.Security.Permissions.SecurityAttribute based types.
7477
7478         * parameter.cs (ApplyAttributeBuilder): Added special handling
7479         for System.Security.Permissions.SecurityAttribute based types.
7480
7481         * rootcontext.cs: Next 2 core types.
7482
7483         * typemanager.cs (TypeManager.security_permission_attr_type):
7484         Built in type for the SecurityPermission Attribute.
7485         (code_access_permission_type): Build in type.
7486
7487 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7488
7489         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7490         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7491         all of this information into
7492         EmitContext.EmitCapturedVariableInstance.
7493         
7494         * codegen.cs (EmitCapturedVariableInstance): move here the
7495         funcionality of emitting an ldarg.0 in the presence of a
7496         remapping.   This centralizes the instance emit code.
7497
7498         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7499         then emit a load of this: it means that we have reached the
7500         topmost ScopeInfo: the one that contains the pointer to the
7501         instance of the class hosting the anonymous method.
7502
7503         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7504         captures to the topmost CaptureContext.
7505
7506 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7507
7508         * expression.cs (LocalVariableReference): Move the knowledge about
7509         the iterators into codegen's EmitCapturedVariableInstance.
7510
7511 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7512
7513         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7514         all code paths return a value from an anonymous method (it is the
7515         same as the 161 error, but for anonymous methods).
7516
7517 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7518
7519         The introduction of anonymous methods in the compiler changed
7520         various ways of doing things in the compiler.  The most
7521         significant one is the hard split between the resolution phase
7522         and the emission phases of the compiler.
7523
7524         For instance, routines that referenced local variables no
7525         longer can safely create temporary variables during the
7526         resolution phase: they must do so from the emission phase,
7527         since the variable might have been "captured", hence access to
7528         it can not be done with the local-variable operations from the runtime.
7529         
7530         * statement.cs 
7531
7532         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7533         is a toplevel block.
7534
7535         (ToplevelBlock): A new kind of Block, these are the blocks that
7536         are created by the parser for all toplevel method bodies.  These
7537         include methods, accessors and anonymous methods.
7538
7539         These contain some extra information not found in regular blocks:
7540         A pointer to an optional CaptureContext (for tracking captured
7541         local variables and parameters).  A pointer to the parent
7542         ToplevelBlock.
7543         
7544         (Return.Resolve): Catch missmatches when returning a value from an
7545         anonymous method (error 1662).
7546         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7547         phase.
7548
7549         (Break.Resolve): ditto.
7550
7551         (SwitchLabel): instead of defining the labels during the
7552         resolution phase, we now turned the public ILLabel and ILLabelCode
7553         labels into methods called GetILLabelCode() and GetILLabel() that
7554         only define the label during the Emit phase.
7555
7556         (GotoCase): Track the SwitchLabel instead of the computed label
7557         (its contained therein).  Emit the code by using
7558         SwitchLabel.GetILLabelCode ().
7559
7560         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7561         whether the Local has been captured or not.
7562
7563         (LocalInfo.IsCaptured): New property, used to tell whether the
7564         local has been captured.
7565         
7566         * anonymous.cs: Vastly updated to contain the anonymous method
7567         support.
7568
7569         The main classes here are: CaptureContext which tracks any
7570         captured information for a toplevel block and ScopeInfo used to
7571         track the activation frames for various local variables.   
7572
7573         Each toplevel block has an optional capture context associated
7574         with it.  When a method contains an anonymous method both the
7575         toplevel method and the anonymous method will create a capture
7576         context.   When variables or parameters are captured, they are
7577         recorded on the CaptureContext that owns them, for example:
7578
7579         void Demo () {
7580              int a;
7581              MyDelegate d = delegate {
7582                  a = 1;
7583              }
7584         }
7585
7586         Here `a' will be recorded as captured on the toplevel
7587         CapturedContext, the inner captured context will not have anything
7588         (it will only have data if local variables or parameters from it
7589         are captured in a nested anonymous method.
7590
7591         The ScopeInfo is used to track the activation frames for local
7592         variables, for example:
7593
7594         for (int i = 0; i < 10; i++)
7595                 for (int j = 0; j < 10; j++){
7596                    MyDelegate d = delegate {
7597                         call (i, j);
7598                    }
7599                 }
7600
7601         At runtime this captures a single captured variable `i', but it
7602         captures 10 different versions of the variable `j'.  The variable
7603         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7604         recorded on a child.  
7605
7606         The toplevel ScopeInfo will also track information like the `this'
7607         pointer if instance variables were referenced (this is necessary
7608         as the anonymous method lives inside a nested class in the host
7609         type of the method). 
7610
7611         (AnonymousMethod): Expanded to track the Toplevel, implement
7612         `AnonymousMethod.Compatible' to tell whether an anonymous method
7613         can be converted to a target delegate type. 
7614
7615         The routine now also produces the anonymous method content
7616
7617         (AnonymousDelegate): A helper class that derives from
7618         DelegateCreation, this is used to generate the code necessary to
7619         produce the delegate for the anonymous method that was created. 
7620
7621         * assign.cs: API adjustments for new changes in
7622         Convert.ImplicitStandardConversionExists.
7623
7624         * class.cs: Adjustments to cope with the fact that now toplevel
7625         blocks are of type `ToplevelBlock'. 
7626
7627         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7628         insteda of standard blocks.
7629
7630         Flag errors if params arguments are passed to anonymous methods.
7631
7632         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7633         `CurrentAnonymousMethod' which points to the current Anonymous
7634         Method.  The variable points to the AnonymousMethod class that
7635         holds the code being compiled.  It is set in the new EmitContext
7636         created for the anonymous method.
7637
7638         (EmitContext.Phase): Introduce a variable and an enumeration to
7639         assist in enforcing some rules about when and where we are allowed
7640         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7641         only one that enfonces this right now).
7642
7643         (EmitContext.HaveCaptureInfo): new helper method that returns
7644         whether we have a CapturedContext initialized.
7645
7646         (EmitContext.CaptureVariable): New method used to register that a
7647         LocalInfo must be flagged for capturing. 
7648
7649         (EmitContext.CapturedParameter): New method used to register that a
7650         parameters must be flagged for capturing. 
7651         
7652         (EmitContext.CapturedField): New method used to register that a
7653         field must be flagged for capturing. 
7654
7655         (EmitContext.HaveCapturedVariables,
7656         EmitContext.HaveCapturedFields): Return whether there are captured
7657         variables or fields. 
7658
7659         (EmitContext.EmitMethodHostInstance): This is used to emit the
7660         instance for the anonymous method.  The instance might be null
7661         (static methods), this (for anonymous methods that capture nothing
7662         and happen to live side-by-side with the current method body) or a
7663         more complicated expression if the method has a CaptureContext.
7664
7665         (EmitContext.EmitTopBlock): Routine that drives the emission of
7666         code: it will first resolve the top block, then emit any metadata
7667         and then emit the code.  The split is done so that we can extract
7668         any anonymous methods and flag any captured variables/parameters.
7669         
7670         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7671         during this phase, the ILGenerator should not be used as labels
7672         and local variables declared here might not be accessible to any
7673         code that is part of an anonymous method.  
7674
7675         Exceptions to this include the temporary variables that are
7676         created by some statements internally for holding temporary
7677         variables. 
7678         
7679         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7680         metadata for a cb
7681
7682         (EmitContext.TemporaryReturn): This method is typically called
7683         from the Emit phase, and its the only place where we allow the
7684         ReturnLabel to be defined other than the EmitMeta.  The reason is
7685         that otherwise we would have to duplicate a lot of logic in the
7686         Resolve phases of various methods that today is on the Emit
7687         phase. 
7688
7689         (EmitContext.NeedReturnLabel): This no longer creates the label,
7690         as the ILGenerator is not valid during the resolve phase.
7691
7692         (EmitContext.EmitThis): Extended the knowledge in this class to
7693         work in anonymous methods in addition to iterators. 
7694
7695         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7696         code is necessary on the stack to access the instance to a local
7697         variable (the variable will be accessed as a field).
7698
7699         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7700         EmitContext.EmitAddressOfParameter): Routines to support
7701         parameters (not completed at this point). 
7702         
7703         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7704         will also remove the parameters.
7705
7706         * convert.cs (Convert): Define a `ConstantEC' which points to a
7707         null.  This is just to prefity some code that uses
7708         ImplicitStandardConversion code and do not have an EmitContext
7709         handy.
7710
7711         The idea is to flag explicitly that at that point in time, it is
7712         known that the conversion will not trigger the delegate checking
7713         code in implicit conversions (which requires a valid
7714         EmitContext). 
7715
7716         Everywhere: pass new EmitContext parameter since
7717         ImplicitStandardConversionExists now requires it to check for
7718         anonymous method conversions. 
7719
7720         (Convert.ImplicitStandardConversionExists): If the type of an
7721         expression is the anonymous_method_type, and the type is a
7722         delegate, we invoke the AnonymousMethod.Compatible method to check
7723         whether an implicit conversion is possible. 
7724
7725         (Convert.ImplicitConversionStandard): Only do implicit method
7726         group conversions if the language level is not ISO_1.
7727
7728         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7729         MethodInfo for the Invoke method.  used by Delegate and
7730         AnonymousDelegate.
7731
7732         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7733         method conversions if the target type is a delegate.
7734
7735         Removed extra debugging nops.
7736
7737         (LocalVariableReference): Turn the `local_info' into a public
7738         field. 
7739
7740         Add `prepared' field, the same hack used for FieldExprs to cope
7741         with composed assignments, as Local variables do not necessarily
7742         operate purely on the stack as they used to: they can be captured
7743         fields. 
7744
7745         Add `temp' for a temporary result, like fields.
7746
7747         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7748
7749         It now copes with Local variables that are captured and emits the
7750         proper instance variable to load it from a field in the captured
7751         case. 
7752
7753         (ParameterReference.DoResolveBase): During the resolve phase,
7754         capture parameters if we are in an anonymous method.
7755
7756         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7757         anonymous method, use the EmitContext helper routines to emit the
7758         parameter reference.
7759
7760         * iterators.cs: Set RemapToProxy to true/false during the
7761         EmitDispose class.
7762
7763         * parameters.cs (GetParameterByName): New helper method. 
7764
7765         * typemanager.cs (anonymous_method_type) a new type that
7766         represents an anonyous method.  This is always an internal type,
7767         used as a fencepost to test against the anonymous-methodness of an
7768         expression. 
7769         
7770 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7771
7772         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7773         561 report.
7774         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7775
7776 2004-11-10  Martin Baulig  <martin@ximian.com>
7777
7778         * expression.cs (Invocation.BetterFunction): If two methods have
7779         equal parameter types, but only one of them is generic, the
7780         non-generic one wins.
7781         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7782         instance; just use `Type.IsValueType' to determine whether
7783         something is a struct or not.
7784         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7785         so we can be called multiple times.
7786
7787 2004-11-10  Martin Baulig  <martin@ximian.com>
7788
7789         * generic.cs (TypeParameter.DefineConstraints): New public method.
7790         (TypeParameter.CheckAccessLevel): Override this and return true.
7791         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7792         override ResolveType() anymore.
7793         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7794
7795 2004-11-10  Martin Baulig  <martin@ximian.com>
7796
7797         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7798         call DeclSpace.ResolveNestedType() on it.
7799
7800 2004-11-10  Martin Baulig  <martin@ximian.com>
7801
7802         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7803         non-null, call ParameterModifier() on it.
7804
7805 2004-11-10  Martin Baulig  <martin@ximian.com>
7806
7807         * iterators.cs
7808         (Iterators): Added `current_type' and `this_type' fields.
7809         (Iterators.DefineIterator): Create a new EmitContext and store it
7810         in `ec'; compute `this_type'.
7811
7812 2004-11-10  Martin Baulig  <martin@ximian.com>
7813
7814         * typemanager.cs
7815         (TypeManager.IsPrivateAccessible): New public method.
7816         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7817
7818 2004-11-10  Martin Baulig  <martin@ximian.com>
7819
7820         * class.cs (TypeContainer.DefineType): Call
7821         TypeBuilder.DefineGenericParameters() before resolving the type
7822         parameters.
7823         (MethodData.parent_method): New protected field.
7824         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7825         (MethodData.Define): Compute `parent_method'.
7826
7827         * decl.cs
7828         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7829         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7830         (DeclSpace.ec): New protected field; store the EmitContext here.
7831         (DeclSpace.EmitContext): New public property.
7832         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7833         (DeclSpace.ResolveNestedType): New public method.
7834         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7835         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7836         (DeclSpace.FamilyAccessible): Likewise.
7837         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7838         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7839         EmitContext.
7840
7841         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7842         field.
7843
7844         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7845         (Enum.Emit): Don't create a new EmitContext.
7846
7847 2004-10-18  Martin Baulig  <martin@ximian.com>
7848
7849         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7850         `Type' directly, but call ResolveType() on it.
7851         (Catch.Resolve): Likewise.
7852         (Foreach.Resolve): Likewise.
7853
7854 2004-10-18  Martin Baulig  <martin@ximian.com>
7855
7856         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7857         `Type' directly, but call ResolveType() on it.
7858         (Probe.DoResolve): Likewise.
7859         (ArrayCreation.LookupType): Likewise.
7860         (TypeOf.DoResolve): Likewise.
7861         (SizeOf.DoResolve): Likewise.
7862
7863 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7864
7865         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7866         the ResolveType.
7867
7868 2004-10-17  John Luke  <john.luke@gmail.com>
7869
7870         * class.cs (Operator.GetSignatureForError): use CSharpName
7871
7872         * parameter.cs (Parameter.GetSignatureForError): Returns
7873         correct name even if was not defined.
7874
7875 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7876
7877         Fix #65816.
7878         * class.cs (TypeContainer.EmitContext): New property.
7879         (DefineNestedTypes): Create an emitcontext for each part.
7880         (MethodCore.DoDefineParameters): Use container's emitcontext.
7881         Pass type array to InternalParameters.
7882         (MemberBase.DoDefine): Use container's emitcontext.
7883         (FieldMember.Define): Likewise.
7884         (Event.Define): Likewise.
7885         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7886         Pass type array to InternalParameters.
7887         (SetIndexerMethod.GetParameterInfo): Likewise.
7888         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7889         * delegate.cs (Define): Pass emitcontext to
7890         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7891         array to InternalParameters.
7892         * expression.cs (ParameterReference.DoResolveBase): Pass
7893         emitcontext to GetParameterInfo.
7894         (ComposedCast.DoResolveAsTypeStep): Remove check on
7895         ec.ResolvingTypeTree.
7896         * parameter.cs (Parameter.Resolve): Change argument to
7897         EmitContext.  Use ResolveAsTypeTerminal.
7898         (Parameter.GetSignature): Change argument to EmitContext.
7899         (Parameters.ComputeSignature): Likewise.
7900         (Parameters.ComputeParameterTypes): Likewise.
7901         (Parameters.GetParameterInfo): Likewise.
7902         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7903         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7904         * support.cs (InternalParameters..ctor): Remove variant that takes
7905         a DeclSpace.
7906         * typemanager.cs (system_intptr_expr): New.
7907         (InitExpressionTypes): Initialize it.
7908
7909 2004-10-12  Chris Toshok  <toshok@ximian.com>
7910
7911         * cs-parser.jay: fix location for try_statement and catch_clause.
7912
7913 2004-10-18  Martin Baulig  <martin@ximian.com>
7914
7915         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7916         `Type' directly, but call ResolveType() on it.
7917         (MemberBase.DoDefine): Likewise.
7918
7919         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7920         `Type' directly, but call ResolveType() on it.
7921         (ComposedCast.DoResolveAsTypeStep): Likewise.
7922
7923         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7924         `Type' directly, but call ResolveType() on it.
7925
7926 2004-10-17  John Luke  <john.luke@gmail.com>
7927
7928         * class.cs (Operator.GetSignatureForError): use CSharpName
7929
7930         * parameter.cs (Parameter.GetSignatureForError): Returns
7931         correct name even if was not defined.
7932
7933 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7934
7935         Fix #65816.
7936         * class.cs (TypeContainer.EmitContext): New property.
7937         (DefineNestedTypes): Create an emitcontext for each part.
7938         (MethodCore.DoDefineParameters): Use container's emitcontext.
7939         Pass type array to InternalParameters.
7940         (MemberBase.DoDefine): Use container's emitcontext.
7941         (FieldMember.Define): Likewise.
7942         (Event.Define): Likewise.
7943         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7944         Pass type array to InternalParameters.
7945         (SetIndexerMethod.GetParameterInfo): Likewise.
7946         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7947         * delegate.cs (Define): Pass emitcontext to
7948         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7949         array to InternalParameters.
7950         * expression.cs (ParameterReference.DoResolveBase): Pass
7951         emitcontext to GetParameterInfo.
7952         (ComposedCast.DoResolveAsTypeStep): Remove check on
7953         ec.ResolvingTypeTree.
7954         * parameter.cs (Parameter.Resolve): Change argument to
7955         EmitContext.  Use ResolveAsTypeTerminal.
7956         (Parameter.GetSignature): Change argument to EmitContext.
7957         (Parameters.ComputeSignature): Likewise.
7958         (Parameters.ComputeParameterTypes): Likewise.
7959         (Parameters.GetParameterInfo): Likewise.
7960         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7961         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7962         * support.cs (InternalParameters..ctor): Remove variant that takes
7963         a DeclSpace.
7964         * typemanager.cs (system_intptr_expr): New.
7965         (InitExpressionTypes): Initialize it.
7966
7967 2004-10-12  Chris Toshok  <toshok@ximian.com>
7968
7969         * cs-parser.jay: fix location for try_statement and catch_clause.
7970
7971 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7972
7973         More DeclSpace.ResolveType avoidance.
7974         * decl.cs (MemberCore.InUnsafe): New property.
7975         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7976         with newly created EmitContext.
7977         (FieldMember.Define): Likewise.
7978         * delegate.cs (Delegate.Define): Likewise.
7979         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7980         only if normal name-lookup fails.
7981         (TypeExpr.DoResolve): Enable error-checking.
7982         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7983         (SizeOf.DoResolve): Likewise.
7984         (ComposedCast.DoResolveAsTypeStep): Likewise.
7985         (StackAlloc.DoResolve): Likewise.
7986         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7987         (Block.Unsafe): New property.
7988         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7989         (Unsafe): Set 'unsafe' flag of contained block.
7990         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7991         (Fixed.Resolve): Likewise.
7992         (Catch.Resolve): Likewise.
7993         (Using.ResolveLocalVariableDecls): Likewise.
7994         (Foreach.Resolve): Likewise.
7995
7996 2004-10-05  John Luke <john.luke@gmail.com>
7997
7998         * cs-parser.jay: add location to error CS0175
7999
8000 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8001
8002         * ecore.cs (Expression.Constantity): Add support for turning null
8003         into a constant.
8004
8005         * const.cs (Const.Define): Allow constants to be reference types
8006         as long as the value is Null.
8007
8008 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8009
8010         * namespace.cs (NamespaceEntry.Using): No matter which warning
8011         level is set, check if this namespace name has already been added.
8012
8013 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8014
8015         * expression.cs: reftype [!=]= null should always use br[true,false].
8016         # 67410
8017
8018 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8019
8020         Fix #67108
8021         * attribute.cs: Enum conversion moved to 
8022         GetAttributeArgumentExpression to be applied to the all
8023         expressions.
8024
8025 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8026
8027         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8028         * class.c (TypeContainer.DefineType): Flag error if
8029         base types aren't accessible due to access permissions.
8030         * decl.cs (DeclSpace.ResolveType): Move logic to
8031         Expression.ResolveAsTypeTerminal.
8032         (DeclSpace.ResolveTypeExpr): Thin layer over
8033         Expression.ResolveAsTypeTerminal.
8034         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8035         Refactor code into NestedAccess.  Use it.
8036         (DeclSpace.NestedAccess): New.
8037         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8038         argument to silence errors.  Check access permissions.
8039         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8040         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8041         (Cast.DoResolve): Likewise.
8042         (New.DoResolve): Likewise.
8043         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8044         (TypeOf.DoResolve): Likewise.
8045
8046         * expression.cs (Invocation.BetterConversion): Return the Type of
8047         the better conversion.  Implement section 14.4.2.3 more faithfully.
8048         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8049         section 14.4.2.2 explicit.
8050         (Invocation.OverloadResolve): Update.
8051         (Invocation): Remove is_base field.
8052         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8053         (Invocation.Emit): Likewise.
8054
8055 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8056
8057         * cs-parser.jay: Reverted 642 warning fix.
8058
8059 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8060
8061         Fix bug #66615
8062         * decl.cs (FindMemberWithSameName): Indexer can have more than
8063         1 argument.
8064
8065 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8066
8067         * expression.cs (LocalVariableReference.DoResolveLValue):
8068         Do not report warning 219 for out values.
8069         (EmptyExpression.Null): New member to avoid extra allocations.
8070
8071 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8072
8073         * cs-parser.jay: Fix wrong warning 642 report.
8074
8075         * cs-tokenizer.cs (CheckNextToken): New helper;
8076         Inspect next character if is same as expected.
8077
8078 2004-09-23  Martin Baulig  <martin@ximian.com>
8079
8080         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8081         (Convert.ImplicitReferenceConversionExists): Likewise.
8082
8083 2004-11-09  Raja R Harinath  <rharinath@novell.com>
8084
8085         * Makefile (DISTFILES): Comment out a few missing files.
8086
8087 2004-10-29  Raja R Harinath  <rharinath@novell.com>
8088
8089         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8090         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
8091         (gmcs.exe): Invoke bootstrap-libs.
8092         (clean-local): Clean the net_2_0_bootstrap profile too.
8093         (PROGRAM_INSTALL_DIR): New.
8094         (install-local): Use it.
8095
8096 2004-10-13  Martin Baulig  <martin@ximian.com>
8097
8098         * generic.cs (TypeManager.InflatedConstraints): New nested class.
8099         (TypeParameter.DefineType): If we're a method type parameter and
8100         that method is overriding something, "inflate" its constraints.
8101
8102 2004-10-12  Martin Baulig  <martin@ximian.com>
8103
8104         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8105         and have type arguments, create and resolve a ConstructedType.
8106
8107 2004-10-12  Martin Baulig  <martin@ximian.com>
8108
8109         * decl.cs (MemberCache.FindMemberToOverride): Use
8110         TypeManager.IsEqual() to compare the parameters and Type.Equals()
8111         to compare the invocationType.
8112
8113         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8114         When comparing two type parameters, only do the signature-only
8115         comparision for method type parameters.
8116
8117 2004-10-11  Martin Baulig  <martin@ximian.com>
8118
8119         * report.cs: Don't make --fatal abort on warnings, we have
8120         -warnaserror for that.
8121
8122 2004-10-11  Martin Baulig  <martin@ximian.com>
8123
8124         * typemanager.cs
8125         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8126         (TypeManager.IsEqual): Call ourself recursively instead of using
8127         Type.IsEqual(). 
8128
8129 2004-10-11  Martin Baulig  <martin@ximian.com>
8130
8131         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8132         on our own type parameters, not on the ones we inherit from a containing
8133         class.
8134
8135         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8136         the comparision.
8137
8138         * generic.cs (TypeParameter.Define): We may only be called once.
8139
8140         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8141         instead of TypeManager.IsEqual().
8142
8143 2004-09-28  Martin Baulig  <martin@ximian.com>
8144
8145         * generic.cs
8146         (GenericConstraints.EffectiveBaseClass): New public property.
8147         (TypeParameter.GenericConstraints): New public property.
8148         (ConstructedType.CheckConstraints): Improved.
8149
8150         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8151         (Convert.TypeParameterConversion): New private method; use this in
8152         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8153         for all conversions related to type parameters.
8154
8155 2004-09-24  Martin Baulig  <martin@ximian.com>
8156
8157         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8158         type parameter conversions for type parameters which are known to
8159         be reference types.
8160
8161 2004-09-24  Martin Baulig  <martin@ximian.com>
8162
8163         * generic.cs (GenericConstraints): Added `IsReferenceType' and
8164         `IsValueType' properties.
8165
8166         * support.cs (ReflectionConstraints): Use
8167         Type.GetGenericParameterConstraints() instead of the old hack.
8168
8169 2004-09-24  Martin Baulig  <martin@ximian.com>
8170
8171         * generic.cs (GenericConstraints): Moved here and made it an
8172         abstract class.
8173
8174         * support.cs (GenericConstraints): Moved to generic.cs.
8175
8176 2004-09-24  Martin Baulig  <martin@ximian.com>
8177
8178         * support.cs
8179         (ReflectionConstraints): Un-nested this class and made it public.
8180
8181         * typemanager.cs
8182         (TypeManager.GetTypeParameterConstraints): New public method.
8183         (TypeManager.HasConstructorConstraint): Use the attributes.
8184
8185 2004-09-24  Martin Baulig  <martin@ximian.com>
8186
8187         * support.cs (GenericConstraints): Replaced `HasConstructor',
8188         `IsReferenceType' and `IsValueType' with `Attributes'.
8189         (ReflectionParameters.ReflectionConstraints): Removed the Create()
8190         method and made the .ctor public.
8191
8192         * generic.cs (Constraints.Attributes): New public property.
8193         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8194         `IsReferenceType' -> `HasReferenceTypeConstraint' and
8195         `IsValueType' -> `HasValueTypeConstraint'.
8196
8197 2004-09-23  Martin Baulig  <martin@ximian.com>
8198
8199         * generic.cs (Constraints): Reflect latest runtime changes.
8200
8201 2004-09-23  Martin Baulig  <martin@ximian.com>
8202
8203         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8204         (Convert.ImplicitReferenceConversionExists): Likewise.
8205
8206 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8207
8208         * class.cs (Operator.Define): Add error 448 and 559 report.
8209         
8210 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8211
8212         * class.cs (MemberBase.IsTypePermitted): New protected
8213         method for checking error CS0610.
8214
8215 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8216
8217         * class.cs (TypeContainer.HasExplicitLayout): New property
8218         Returns whether container has StructLayout attribute set Explicit.
8219         (FieldMember): New abstract class for consts and fields.
8220         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8221         (Field): Reuse FieldMember.
8222
8223         * const.cs (Const): Reuse FieldMember.
8224
8225         * rootcontext.cs: EmitConstants call moved to class.
8226
8227 2004-09-22  Martin Baulig  <martin@ximian.com>
8228
8229         Marek and me just fixed one of our oldest bugs: #28562 :-)
8230
8231         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8232
8233         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8234         we're an EnumConstant, just return that.
8235         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8236         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8237         to get the value which'll actually be written into the attribute.
8238         However, we have to use GetValue() to access the attribute's value
8239         in the compiler.        
8240
8241 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8242
8243         * constant.cs (Constant.IsNegative): New abstract property
8244         IsNegative.
8245
8246         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8247         (StackAlloc.DoResolve): Reused IsNegative.
8248
8249 2004-09-22  Martin Baulig  <martin@ximian.com>
8250
8251         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8252         public method; like LookupTypeContainer, but also works for
8253         generic instances.
8254
8255         * report.cs (Report.SymbolRelatedToPreviousError): Use
8256         TypeManager.LookupGenericTypeContainer().       
8257
8258 2004-09-22  Martin Baulig  <martin@ximian.com>
8259
8260         Thanks to Peter Sestoft for this bug report.
8261
8262         * expression.cs (Conditional): If both the `trueExpr' and the
8263         `falseExpr' is a NullLiteral, return a NullLiteral.
8264
8265 2004-09-22  Martin Baulig  <martin@ximian.com>
8266
8267         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8268         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8269         for the "get_Current" call.
8270
8271 2004-09-21  Martin Baulig  <martin@ximian.com>
8272
8273         * convert.cs (Convert.ImplicitReferenceConversion): When
8274         converting to an interface type, first check whether we're
8275         converting from a reference type.
8276
8277 2004-09-14  Martin Baulig  <martin@ximian.com>
8278
8279         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8280
8281 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8282
8283         Fixed bug #61902
8284         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8285         called and is obsolete then this member suppress message
8286         when call is inside next [Obsolete] method or type.
8287
8288         * expression.cs: Use TestObsoleteMethodUsage member.
8289
8290 2004-09-14  Martin Baulig  <martin@ximian.com>
8291
8292         * genericparser.cs: Removed.
8293
8294 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8295
8296         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8297
8298 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8299
8300         * attribute.cs (Attribute.Resolve): Add error 653 report.
8301
8302         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8303         report.
8304         (Method.ApplyAttributeBuilder): Add error 685 report.
8305         (Operator.Define): Add error 564 report.
8306
8307         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8308
8309         * expression.cs (Invocation.DoResolve): Add error
8310         245 and 250 report.
8311
8312         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8313         error 674 report.
8314
8315 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8316
8317         * class.cs (ConstructorInitializer.Resolve):
8318         Wrong error number (515->516).
8319
8320 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8321
8322         * class.cs (Indexer.Define): Add error 631 report.
8323
8324 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8325
8326         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8327
8328 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8329
8330         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8331
8332 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8333
8334         * cs-parser.jay: Added error CS0241 report.
8335
8336 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8337
8338         * cs-parser.jay (fixed_statement): Introduce a scope for the
8339         declaration in the 'fixed' statement.
8340
8341 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8342
8343         * cs-parser.jay: Added CS0230 error report.
8344
8345 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8346
8347         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8348
8349 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8350
8351         * expression.cs (Argument.Resolve): Added error CS0192 and
8352         CS0199 report.
8353
8354 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8355
8356         C# 2.0 #pragma warning feature
8357
8358         * cs-tokenizer.cs (PreProcessPragma): New method; 
8359         Handles #pragma directive.
8360
8361         * report.cs (WarningRegions): New class; Support
8362         class for #pragma warning directive. It tests whether
8363         warning is enabled for a given line.
8364
8365 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8366
8367         * const.cs: Add more descriptive error report, tahnks to
8368         Sebastien. 
8369
8370 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8371
8372         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8373
8374 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8375
8376         * expression.cs: Apply patch from Ben: Remove dead code from
8377         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8378         as that code just threw an exception anwyays.
8379
8380         * const.cs: Remove the call to the turnintoconstant, for details
8381         see bug: #63144
8382         
8383         * literal.cs: The type of the null-literal is the null type;  So
8384         we use a placeholder type (literal.cs:System.Null, defined here)
8385         for it.
8386
8387         * expression.cs (Conditional.DoResolve): Remove some old code that
8388         is no longer needed, conversions have been fixed.
8389
8390         (ArrayCreationExpression.DoResolve): Return false if we fail to
8391         resolve the inner expression.
8392
8393 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8394
8395         Fix test-290.cs.
8396         * cs-parser.jay (delegate_declaration): Record a delegate
8397         declaration as a type declaration.
8398         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8399
8400 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8401
8402         * parameter.cs: Do not crash if the type can not be resolved. 
8403
8404         * expression.cs: Report errors with unsafe pointers, fixes #64896
8405
8406 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8407
8408         * expression.cs: Pointer arith always needs to do a conv.i
8409         if the operand is a long. fix 65320
8410
8411 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8412
8413         Fixed cs0619-37.cs, cs0619-38.cs
8414
8415         * enum.cs (GetObsoleteAttribute): Removed.
8416
8417         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8418         on Enum member is double staged. The first is tested member
8419         and then enum.
8420
8421 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8422
8423         Fixed #56986, #63631, #65231
8424
8425         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8426         adds member to name container.
8427         (TypeContainer.AddToTypeContainer): New method, adds type to
8428         name container.
8429         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8430         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8431         AddOperator): Simplified by reusing AddToMemberContainer.
8432         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8433         instead of field.
8434         (Method.CheckForDuplications): Fixed implementation to test all
8435         possibilities.
8436         (MemberBase): Detection whether member is explicit interface
8437         implementation is now in constructor.
8438         (MemberBase.UpdateMemberName): Handles IndexerName.
8439         (Accessor): Changed to keep also location information.
8440         (AbstractPropertyEventMethod): Is derived from MemberCore.
8441         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8442         will be emited or not.
8443         (PropertyBase.AreAccessorsDuplicateImplementation):
8444         Tests whether accessors are not in collision with some method.
8445         (Operator): Is derived from MethodCore to simplify common
8446         operations.
8447
8448         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8449         must be performed.
8450         (DeclSpace.AddToContainer): Adds the member to defined_names
8451         table. It tests for duplications and enclosing name conflicts.
8452
8453         * enum.cs (EnumMember): Clean up to reuse the base structures
8454
8455 2004-09-03  Martin Baulig  <martin@ximian.com>
8456
8457         Merged latest changes into gmcs.  Please keep this comment in
8458         here, it makes it easier for me to see what changed in MCS since
8459         the last time I merged.
8460
8461 2004-09-03  Martin Baulig  <martin@ximian.com>
8462
8463         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8464         into TypeContainer, to make partial classes work again.
8465
8466 2004-09-03  Martin Baulig  <martin@ximian.com>
8467
8468         * rootcontext.cs (RootContext.V2): Removed.
8469
8470 2004-03-23  Martin Baulig  <martin@ximian.com>
8471
8472         * expression.cs (Invocation.OverloadResolve): Added `bool
8473         may_fail' argument and use it instead of the Location.IsNull() hack.
8474
8475 2004-09-09  Martin Baulig  <martin@ximian.com>
8476
8477         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8478
8479 2004-09-09  Martin Baulig  <martin@ximian.com>
8480
8481         * generic.cs (TypeParameter.DefineType): Added support for
8482         explicit interface methods.
8483
8484 2004-09-09  Martin Baulig  <martin@ximian.com>
8485
8486         * README.Changes: New document.  Started to list important changes
8487         between MCS and GMCS here.
8488
8489 2004-09-08  Martin Baulig  <martin@ximian.com>
8490
8491         * class.cs
8492         (TypeContainer.CheckRecursiveDefinition): New protected method.
8493         (TypeContainer.DefineType): Move the CS0146 check into
8494         CheckRecursiveDefinition().     
8495
8496 2004-09-06  Martin Baulig  <martin@ximian.com>
8497
8498         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8499         types for the constructor constraint.
8500
8501 2004-09-03  Martin Baulig  <martin@ximian.com>
8502
8503         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8504         into TypeContainer, to make partial classes work again.
8505
8506 2004-09-03  Martin Baulig  <martin@ximian.com>
8507
8508         * rootcontext.cs (RootContext.V2): Removed.
8509
8510 2004-03-23  Martin Baulig  <martin@ximian.com>
8511
8512         * expression.cs (Invocation.OverloadResolve): Added `bool
8513         may_fail' argument and use it instead of the Location.IsNull() hack.
8514
8515 2004-09-03  Martin Baulig  <martin@ximian.com>
8516
8517         Merged latest changes into gmcs.  Please keep this comment in
8518         here, it makes it easier for me to see what changed in MCS since
8519         the last time I merged.
8520
8521 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8522
8523         Fix #61128.
8524         * expression.cs (BetterConversion): Don't allow either conversion 
8525         to be null.  Remove redundant implicit conversion test when 'q ==
8526         null' -- when this function is invoked, we already know that the
8527         implicit conversion exists.
8528         (BetterFunction): Assume that 'best' is non-null.  Remove
8529         redundant reimplementation of IsApplicable when 'best' is null.
8530         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8531         number of arguments.
8532         (IsAncestralType): Extract from OverloadResolve.
8533         (OverloadResolve): Make robust to the MethodGroupExpr being
8534         unsorted.  Implement all the logic of Section 14.5.5.1, and
8535         support overloading of methods from multiple applicable types.
8536         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8537
8538         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8539         (RealError, Warning): Append type of report to related symbol.
8540
8541 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8542
8543         * enum.cs: Fixed CLS-Compliance checks for enum members.
8544         Error tests cs3008-8.cs, cs3014-8.cs
8545
8546 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8547
8548         Fixed bug #62342, #63102
8549         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8550         like ImplementMethod.
8551
8552 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8553
8554         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8555         Fixed bug #65170.
8556
8557 2004-09-02  Martin Baulig  <martin@ximian.com>
8558
8559         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8560         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8561         on the MethodBase.
8562
8563 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8564
8565         C# 2.0 Static classes implemented
8566
8567         * class.cs (TypeContainer): instance_constructors,
8568         initialized_fields, initialized_static_fields,
8569         default_constructor, base_inteface_types are protected to be
8570         accessible from StaticClass.
8571         (TypeContainer.DefineDefaultConstructor): New virtual method
8572         for custom default constructor generating
8573         (StaticClass): New class to handle "Static classes" feature.
8574
8575         * cs-parser.jay: Handle static keyword on class like instance
8576         of StaticClass.
8577
8578         * driver.cs: Added "/langversion" command line switch with two
8579         options (iso-1, default).
8580
8581 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8582
8583         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8584
8585 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8586
8587         * delegate.cs: Style.
8588
8589 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8590
8591         * delegate.cs: Add seperate instance expr field for miguel.
8592
8593 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8594
8595         * PointerArithmetic (Resolve): make sure we are not doing
8596         pointer arith on void*. Also, make sure we are resolved
8597         by not setting eclass until resolve.
8598
8599         All callers: Make sure that PointerArithmetic gets resolved.
8600
8601 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8602
8603         * ArrayCreation (LookupType): If the type does not resolve 
8604         to an array, give an error.
8605
8606 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8607
8608         * statement.cs (Try.Resolve): Fixed bug #64222
8609
8610 2004-08-27  Martin Baulig  <martin@ximian.com>
8611
8612         * class.cs
8613         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8614         crash here.     
8615
8616 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8617
8618         * ecore.cs (Constantify): Get underlying type via
8619         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8620         Windows in special cases.
8621
8622 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8623
8624         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8625         for obtaining also private methods.
8626         (GetRemoveMethod): Used GetRemoveMethod (true)
8627         for obtaining also private methods.
8628
8629 2004-09-02  Martin Baulig  <martin@ximian.com>
8630
8631         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8632         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8633         on the MethodBase.
8634
8635 2004-08-27  Martin Baulig  <martin@ximian.com>
8636
8637         * class.cs
8638         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8639         crash here.     
8640
8641 2004-08-25  Martin Baulig  <martin@ximian.com>
8642
8643         * support.cs (ReflectionParameters..ctor): If this is a generic
8644         method, retrieve and store its type parameters.
8645         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8646         (ReflectionParameters.GenericConstraints): The argument specifies
8647         the type parameter, not the method parameter.
8648         (InternalParameters.GenericConstraints): Likewise.
8649
8650         * generic.cs (TypeParameter.DefineType): Correctly handle
8651         constraints wrt. generic methods in interfaces and their
8652         implementations.        
8653
8654 2004-08-24  Martin Baulig  <martin@ximian.com>
8655
8656         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8657         (Constraints.IsSubclassOf): New internal method.
8658
8659         * typemanager.cs (TypeManager.FindMembers): Added special support
8660         for GenericTypeParameterBuilder's.      
8661         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8662         type parameters.
8663
8664 2004-08-24  Martin Baulig  <martin@ximian.com>
8665
8666         * typemanager.cs
8667         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8668         this for accessibility checks.
8669         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8670         IsNestedFamilyAccessible.
8671         (TypeManager.IsSubclassOf): New method, do what the name actually
8672         says.   
8673
8674 2004-08-24  Martin Baulig  <martin@ximian.com>
8675
8676         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8677         as a SimpleName, include the generic arity.
8678
8679 2004-08-24  Martin Baulig  <martin@ximian.com>
8680
8681         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8682         MethodAttributes.HideBySig for operators.
8683
8684 2004-08-23  Martin Baulig  <martin@ximian.com>
8685
8686         Back to the old error reporting system :-)
8687
8688         * report.cs (Message): Removed.
8689         (Report.MessageData, ErrorData, WarningData): Removed.
8690         (Report.Error, Warning): Back to the old system.
8691
8692 2004-08-23  Martin Baulig  <martin@ximian.com>
8693
8694         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8695
8696         * class.cs (TypeContainer.ParentContainer): New public virtual
8697         method; replaces the explicit interface implementation.
8698         (ClassPart.ParentContainer): Override.
8699
8700 2004-08-23  Martin Baulig  <martin@ximian.com>
8701
8702         * statement.cs (Switch): Added support for constant switches; see
8703         #59428 or test-285.cs.
8704
8705 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8706
8707         Fixed bug #62740.
8708         * statement.cs (GetEnumeratorFilter): Removed useless
8709         logic because C# specs is strict. GetEnumerator must be
8710         public.
8711
8712 2004-08-22  Martin Baulig  <martin@ximian.com>
8713
8714         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8715         a switch and may break, reset the barrier.  Fixes #59867.
8716
8717 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8718
8719         CLS-Compliance speed up (~5% for corlib)
8720
8721         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8722         New method. Tests container for CLS-Compliant names
8723
8724         * class.cs (TypeContainer.VerifyClsName): New method.
8725         Checks whether container name is CLS Compliant.
8726         (Constructor): Implements IMethodData.
8727
8728         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8729         low-case table for CLS Compliance test.
8730         (MemberCache.VerifyClsParameterConflict): New method.
8731         Checks method parameters for CS3006 error.
8732
8733         * enum.cs (EnumMember): Is derived from MemberCore.
8734         (Enum.VerifyClsName): Optimized for better performance.
8735
8736 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8737
8738         * report.cs: Renamed Error_T to Error and changed all
8739         references.
8740
8741 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8742
8743         * class.cs (TypeContainer.IndexerArrayList): New inner class
8744         container for indexers.
8745         (TypeContainer.DefaultIndexerName): New constant for default
8746         indexer name. Replaced all "Item" with this constant.
8747         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8748
8749         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8750         DefaultMemberAttribute constructor.
8751
8752 2004-08-05  Martin Baulig  <martin@ximian.com>
8753
8754         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8755         Fix bug #59429.
8756
8757 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8758
8759         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8760         multi platforms problem.
8761
8762         * compiler.csproj: Included shared files.
8763
8764 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8765
8766         Fix bug 60333, 55971 in the more general way
8767         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8768         Added arg_type argument for constant conversion.
8769         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8770
8771 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8772
8773         Fix bug #59760
8774         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8775         OperatorArrayList, MethodCoreArrayList for typecontainer
8776         containers. Changed class member types to these new types.
8777         (MethodArrayList.DefineMembers): Added test for CS0659.
8778
8779 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8780
8781         * cfold.cs: Synchronize the folding with the code in expression.cs
8782         Binary.DoNumericPromotions for uint operands.
8783
8784         * attribute.cs: Revert patch from Raja, it introduced a regression
8785         while building Blam-1.2.1 (hard to isolate a test case).
8786
8787 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8788
8789         Fix for #55382
8790         * class.cs:
8791         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8792         name collision.
8793         (MethodCore.parent_method): New member. The method we're overriding
8794         if this is an override method.
8795         (MethodCore.CheckBase): Moved from Method class and made common.
8796         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8797         private.
8798         (MethodCore.CheckForDuplications): New abstract method. For custom
8799         member duplication search in a container
8800         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8801         method and its return type.
8802         (Event.conflict_symbol): New member. Symbol with same name in the
8803         parent class.
8804
8805         * decl.cs:
8806         (MemberCache.FindMemberWithSameName): New method. The method
8807         is looking for conflict with inherited symbols.
8808
8809 2004-08-04  Martin Baulig  <martin@ximian.com>
8810
8811         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8812
8813         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8814
8815 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8816
8817         * report.cs (Message): New enum for better error, warning reference in
8818         the code.
8819         (MessageData): New inner abstract class. It generally handles printing of
8820         error and warning messages.
8821         Removed unused Error, Warning, Message methods.
8822
8823 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8824
8825         Fix for cs0592-8.cs test
8826         * attribute.cs
8827         (Attributable.ValidAttributeTargets): Made public.
8828         (Attribute.ExplicitTarget): New member for explicit target value.
8829         (Attribute.CheckTargets): Now we translate explicit attribute
8830         target to Target here.
8831
8832 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8833
8834         * ecore.cs (MethodGroupExpr): new IsBase property.
8835
8836         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8837
8838         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8839         rather than an instance expr.
8840
8841         (DelegateCreation.Emit): Use the method group rather than
8842         the instance expression. Also, if you have base.Foo as the
8843         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8844
8845         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8846
8847         (NewDelegate.DoResolve): Only check for the existance of Invoke
8848         if the method is going to be needed. Use MethodGroupExpr.
8849
8850         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8851
8852         * expression.cs: For pointer arith., make sure to use
8853         the size of the type, not the size of the pointer to
8854         the type.
8855
8856 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8857
8858         Fix for #60722
8859         * class.cs (Class): Added error CS0502 test.
8860
8861 2004-08-03  John Luke  <jluke@cfl.rr.com>
8862             Raja R Harinath  <rharinath@novell.com>
8863
8864         Fix for #60997.
8865         * attribute.cs (Attribute.complained_before): New flag.
8866         (Attribute.ResolveType, Attribute.Resolve),
8867         (Attribute.DefinePInvokeMethod): Set it.
8868         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8869         
8870 2004-08-03  Martin Baulig  <martin@ximian.com>
8871
8872         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8873         use a user-defined operator; we still need to do numeric
8874         promotions in case one argument is a builtin type and the other
8875         one has an implicit conversion to that type.  Fixes #62322.
8876
8877 2004-08-18  Martin Baulig  <martin@ximian.com>
8878
8879         * class.cs (Method.Define): Use the correct method name when
8880         creating the MethodBuilder for a generic method.
8881
8882 2004-08-17  Martin Baulig  <martin@ximian.com>
8883
8884         * generic.cs (Constraints): Support type parameter constraints.
8885
8886 2004-08-16  Martin Baulig  <martin@ximian.com>
8887
8888         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8889         (Token.GENERIC_DIMENSION): New token; this is returned if we
8890         encounter an unbound generic type in a typeof() expression.
8891
8892         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8893         this token is only generated while parsing a typeof() expression.
8894         (typeof_expression): Removed the old unbound_type hack.
8895
8896         * generic.cs (TypeArguments.IsUnbound): New public property.
8897
8898         * decl.cs (MemberName): Added support for unbound types.
8899
8900 2004-08-14  Martin Baulig  <martin@ximian.com>
8901
8902         * typemanager.cs
8903         (TypeManager.IsEqualGenericInstance): New static method.
8904         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8905         just used to check accessibility, so follow the rules of 26.1.6.        
8906
8907         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8908         ConstructedType instead of a TypeExpression if we have type arguments.
8909
8910         * cs-parser.jay (typeof_expression): Support unbound generic types.
8911
8912         * ecore.cs (UnboundTypeExpression): New public class.
8913
8914 2004-08-12  Martin Baulig  <martin@ximian.com>
8915
8916         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8917         TypeManager.IsEqual() rather than `=='.
8918
8919         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8920         generic instances as well.
8921
8922 2004-08-12  Martin Baulig  <martin@ximian.com>
8923
8924         * expression.cs (Invocation.InferType): We can only infer method
8925         type parameters.  Fixes #62647.
8926
8927 2004-08-11  Martin Baulig  <martin@ximian.com>
8928
8929         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8930         before resolving the base classes.
8931
8932 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8933
8934         * Makefile: install .mdb file too.
8935
8936 2004-08-05  Martin Baulig  <martin@ximian.com>
8937
8938         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8939         initializer, the current type is just the TypeBuilder, not the
8940         instantiated generic type.
8941         (FieldExpr.IsFieldInitializer): New public property.
8942
8943 2004-08-04  Martin Baulig  <martin@ximian.com>
8944
8945         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8946
8947         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8948
8949 2004-08-03  Martin Baulig  <martin@ximian.com>
8950
8951         * class.cs (MethodData.Define): If we're an explicit
8952         implementation, remove the generic arity from the type name.
8953
8954 2004-08-03  Martin Baulig  <martin@ximian.com>
8955
8956         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8957         use a user-defined operator; we still need to do numeric
8958         promotions in case one argument is a builtin type and the other
8959         one has an implicit conversion to that type.  Fixes #62322.
8960
8961 2004-08-02  Martin Baulig  <martin@ximian.com>
8962
8963         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8964         `TypeExpr[]' array.
8965         (TypeContainer.GetClassBases): Return the unexpanded list of
8966         interfaces; we expand them later.
8967         (TypeContainer.DefineType): After creating the TypeBuilder, call
8968         TypeManager.ExpandInterfaces() to get an expanded and resolved
8969         list of interfaces.
8970
8971         * ecore.cs (TypeExpr.GetInterfaces): Removed
8972
8973         * generics.cs (Constraints.InterfaceConstraints): Remove.
8974         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8975         register the interface constraints.
8976
8977         * typemanager.cs
8978         (TypeManager.AddUserType): Removed the `ifaces' argument.
8979         (TypeManager.AddTypeParameter): Likewise.
8980         (TypeManager.AddUserInterface): Removed, was unused.
8981         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8982         `TypeExpr[]' array for the interfaces.
8983         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8984         has been defined, returns a list of the resolved interfaces types.
8985         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8986         (TypeManager.GetExplicitInterfaces): Likewise.  
8987
8988 2004-08-02  Martin Baulig  <martin@ximian.com>
8989
8990         * expression.cs (Invocation.EmitCall): If we're invoking a method
8991         on a type parameter, use the new `Constrained' prefix opcode.
8992
8993 2004-08-02  Martin Baulig  <martin@ximian.com>
8994
8995         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8996         (LocalInfo.IsThis): New public property.
8997         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8998
8999 2004-08-01  Martin Baulig  <martin@ximian.com>
9000
9001         * class.cs (TypeContainer.GetClassBases): Don't set the default
9002         here since we may get called from GetPartialBases().
9003         (TypeContainer.DefineType): If GetClassBases() didn't return a
9004         parent, use the default one.
9005
9006 2004-07-30  Martin Baulig  <martin@ximian.com>
9007
9008         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9009
9010         * class.cs (SourceMethod): New public class, derive from the
9011         symbol writer's ISourceMethod.
9012         (Method): Use the new symbol writer API.
9013
9014         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9015         as argument and use the new symbol writer.
9016
9017         * location.cs
9018         (SourceFile): Implement the symbol writer's ISourceFile.
9019         (Location.SymbolDocument): Removed.
9020         (Location.SourceFile): New public property.
9021
9022         * symbolwriter.cs: Use the new symbol writer API.
9023
9024 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9025
9026         * Makefile (install-local): Remove.  Functionality moved to
9027         executable.make.
9028
9029 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9030
9031         * Makefile: Install mcs.exe.config file together with mcs.exe.
9032         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9033         correct runtime version.
9034         
9035 2004-07-25  Martin Baulig  <martin@ximian.com>
9036
9037         * class.cs
9038         (TypeContainer.RegisterOrder): Removed, this was unused.
9039         (TypeContainer, interface_order): Removed.
9040         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9041         TypeContainer as argument since we can also be called with a
9042         `PartialContainer' for a partial class/struct/interface.
9043         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9044         of checking whether we're an `Interface' - we could be a
9045         `PartialContainer'.
9046         (PartialContainer.Register): Override; call
9047         AddClass()/AddStruct()/AddInterface() on our parent.
9048
9049         * cs-parser.jay (interface_member_declaration): Add things to the
9050         `current_container', not the `current_class'.
9051
9052         * rootcontext.cs (RegisterOrder): The overloaded version which
9053         takes an `Interface' was unused, removed.
9054
9055         * typemanager.cs (TypeManager.LookupInterface): Return a
9056         `TypeContainer', not an `Interface'.
9057         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9058         contain a `PartialContainer' for an interface, so check it's
9059         `Kind' to figure out what it is.
9060
9061 2004-07-25  Martin Baulig  <martin@ximian.com>
9062
9063         * class.cs (Class.DefaultTypeAttributes): New public constant.
9064         (Struct.DefaultTypeAttributes): Likewise.
9065         (Interface.DefaultTypeAttributes): Likewise.
9066         (PartialContainer.TypeAttr): Override this and add the
9067         DefaultTypeAttributes.
9068
9069 2004-07-25  Martin Baulig  <martin@ximian.com>
9070
9071         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9072         we can just use the `Parent' field instead.
9073
9074 2004-07-25  Martin Baulig  <martin@ximian.com>
9075
9076         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9077
9078 2004-07-25  Martin Baulig  <martin@ximian.com>
9079
9080         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9081         our parts before defining any methods.
9082         (TypeContainer.VerifyImplements): Make this virtual.
9083         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9084         on our PartialContainer.
9085
9086 2004-07-25  Martin Baulig  <martin@ximian.com>
9087
9088         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9089
9090         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9091         argument, we can just use the `Parent' field instead.
9092
9093         * class.cs
9094         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9095         (MemberBase.DoDefine): Likewise.
9096
9097 2004-07-24  Martin Baulig  <martin@ximian.com>
9098
9099         * decl.cs (MemberCore.Parent): New public field.
9100         (DeclSpace.Parent): Moved to MemberCore.
9101
9102         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9103         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9104         parent's .ctor.
9105         (FieldBase, Field, Operator): Likewise.
9106         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9107         (EventField, Event): Likewise.
9108
9109 2004-07-23  Martin Baulig  <martin@ximian.com>
9110
9111         * class.cs (PartialContainer): New public class.
9112         (ClassPart): New public class.
9113         (TypeContainer): Added support for partial classes.
9114         (TypeContainer.GetClassBases): Splitted some of the functionality
9115         out into GetNormalBases() and GetPartialBases().
9116
9117         * cs-tokenizer.cs (Token.PARTIAL): New token.
9118         (Tokenizer.consume_identifier): Added some hacks to recognize
9119         `partial', but only if it's immediately followed by `class',
9120         `struct' or `interface'.
9121
9122         * cs-parser.jay: Added support for partial clases.
9123
9124 2004-07-23  Martin Baulig  <martin@ximian.com>
9125
9126         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9127         a `DeclSpace' and also made it readonly.
9128         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9129         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9130         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9131
9132         * cs-parser.jay: Pass the `current_class', not the
9133         `current_container' (at the moment, this is still the same thing)
9134         to a new Method, Property, Event, Indexer or Constructor.
9135
9136 2004-07-23  Martin Baulig  <martin@ximian.com>
9137
9138         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9139         and removed the `current_interface' one.
9140         (struct_declaration, class_declaration, interface_declaration):
9141         Set `current_class' to the newly created class/struct/interface;
9142         set their `Bases' and call Register() before parsing their body.
9143
9144 2004-07-23  Martin Baulig  <martin@ximian.com>
9145
9146         * class.cs (Kind): New public enum.
9147         (TypeContainer): Made this class abstract.
9148         (TypeContainer.Kind): New public readonly field.
9149         (TypeContainer.CheckDef): New public method; moved here from
9150         cs-parser.jay.
9151         (TypeContainer.Register): New public abstract method.
9152         (TypeContainer.GetPendingImplementations): New public abstract
9153         method.
9154         (TypeContainer.GetClassBases): Removed the `is_class' and
9155         `is_iface' parameters.
9156         (TypeContainer.DefineNestedTypes): Formerly known as
9157         DoDefineType().
9158         (ClassOrStruct): Made this class abstract.
9159
9160         * tree.cs (RootTypes): New public type. 
9161
9162 2004-07-20  Martin Baulig  <martin@ximian.com>
9163
9164         * tree.cs (Tree.RecordNamespace): Removed.
9165         (Tree.Namespaces): Removed.
9166
9167         * rootcontext.cs (RootContext.IsNamespace): Removed.
9168
9169         * cs-parser.jay (namespace_declaration): Just create a new
9170         NamespaceEntry here.
9171
9172 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
9173
9174         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9175         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9176         entry to make sure it runs in the correct runtime version.
9177         
9178 2004-07-18  Martin Baulig  <martin@ximian.com>
9179
9180         * generic.cs (ConstructedType.CheckConstraints): Improved
9181         constraints checking.
9182
9183 2004-07-18  Martin Baulig  <martin@ximian.com>
9184
9185         * expression.cs (Invocation.BetterMethod): Call
9186         TypeManager.TypeToCoreType() on all types and removed my previous
9187         hack; we're already doig the right thing here.
9188
9189 2004-07-17  Martin Baulig  <martin@ximian.com>
9190
9191         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9192
9193 2004-07-16  Martin Baulig  <martin@ximian.com>
9194
9195         * iterators.cs: Added generics support.
9196
9197 2004-07-16  Martin Baulig  <martin@ximian.com>
9198
9199         * iterators.cs: Rewrote this.  We're now using one single Proxy
9200         class for both the IEnumerable and the IEnumerator interface and
9201         `Iterator' derives from Class so we can use the high-level API.
9202
9203         * class.cs (TypeContainer.AddIterator): New method.
9204         (TypeContainer.DoDefineType): New protected virtual method, which
9205         is called from DefineType().
9206         (TypeContainer.DoDefineMembers): Call DefineType() and
9207         DefineMembers() on all our iterators.
9208         (TypeContainer.Emit): Call Emit() on all our iterators.
9209         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9210
9211         * codegen.cs (EmitContext.CurrentIterator): New public field.
9212
9213 2004-07-15  Martin Baulig  <martin@ximian.com>
9214
9215         * typemanager.cs
9216         (TypeManager.not_supported_exception_type): New type.   
9217
9218 2004-07-14  Martin Baulig  <martin@ximian.com>
9219
9220         * typemanager.cs
9221         (TypeManager.generic_ienumerable_type): New type.
9222         (TypeManager.generic_ienumerator_type): New type.
9223
9224         * rootcontext.cs
9225         (RootContext.interfaces_first_stage): Added
9226         "System.Collections.Generic.IEnumerator`1" and
9227         "System.Collections.Generic.IEnumerable`1".     
9228
9229 2004-07-14  Martin Baulig  <martin@ximian.com>
9230
9231         * iterators.cs: Use real error numbers.
9232
9233 2004-07-14  Martin Baulig  <martin@ximian.com>
9234
9235         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9236         requires this to be a System.Collection.IEnumerable and not a
9237         class implementing that interface.
9238         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9239
9240 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9241
9242         * class.cs: Fixed previous fix, it broke some error tests.
9243
9244 2004-07-12  Martin Baulig  <martin@ximian.com>
9245
9246         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9247         Fixes #61293.
9248
9249 2004-07-14  Martin Baulig  <martin@ximian.com>
9250
9251         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9252         an exclamation mark (!) for the generic arity to reflect the
9253         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9254
9255 2004-07-13  Martin Baulig  <martin@ximian.com>
9256
9257         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9258         specifiers being part of a type argument.
9259
9260 2004-07-13  Martin Baulig  <martin@ximian.com>
9261
9262         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9263         name for generic types.
9264
9265 2004-07-13  Martin Baulig  <martin@ximian.com>
9266
9267         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9268         bit to fix #60119.
9269
9270 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9271
9272         * assign.cs (LocalTemporary): Add new argument: is_address,If
9273         `is_address' is true, then the value that we store is the address
9274         to the real value, and not the value itself.
9275         
9276         * ecore.cs (PropertyExpr): use the new local temporary
9277         stuff to allow us to handle X.Y += z (where X is a struct)
9278
9279 2004-07-08  Martin Baulig  <martin@ximian.com>
9280
9281         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9282         not always return, just like we're doing in Using.Resolve().
9283
9284 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9285
9286         * cs-parser.jay (fixed_statement): flag this as Pinned.
9287
9288 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9289
9290         * typemanager.cs (TypeManager): Removed MakePinned method, this
9291         mechanism is replaced with the .NET 2.x compatible mechanism of
9292         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9293
9294         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9295         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9296         `IsFixed' property which has a different meaning.
9297
9298 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9299
9300         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9301         visible from inside a nested class, not just the names of the
9302         immediately enclosing class.
9303         Fix for bug #60730.
9304
9305 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9306
9307         * expression.cs (BetterConversion): Remove buggy special-case
9308         handling of "implicit constant expression conversions".  At this
9309         point, we already know that the conversion is possible -- we're
9310         only checking to see which is better.
9311
9312 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9313
9314         * cs-parser.jay: Added error CS0210 test.
9315
9316 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9317
9318         * cs-parser.jay: Added error CS0134 test.
9319
9320 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9321
9322         Fix bug #52507
9323         * cs-parser.jay: Added error CS0145 test.
9324
9325 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9326
9327         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9328
9329 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9330         
9331         * expression.cs (StackAlloc.Resolve): The argument may not
9332         be a constant; deal with this case.
9333         
9334 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9335
9336         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9337         GetIndexerAttributeValue.
9338         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9339
9340         * class.cs (Indexer.Define): Added error tests for CS0415,
9341         CS0609.
9342
9343 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9344
9345         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9346         property code.
9347
9348 2004-06-23  Martin Baulig  <martin@ximian.com>
9349
9350         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9351         neither return nor throw, reset the barrier as well.  Fixes #60457.
9352
9353 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9354
9355         * class.cs : EventAttributes is now set to None by default.
9356           This fixes bug #60459.
9357
9358 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9359
9360         Fix bug #60219
9361         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9362         Don't throw exception but return null (it's sufficient now).
9363
9364 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9365
9366         * typemanager.cs (GetArgumentTypes): Faster implementation.
9367
9368 2004-06-18  Martin Baulig  <martin@ximian.com>
9369
9370         * attribute.cs (Attribute.Resolve): Check whether we're an
9371         EmptyCast which a Constant child.  Fixes #60333.
9372
9373 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9374
9375         * statement.cs (EmitCollectionForeach): Account for the fact that
9376         not all valuetypes are in areas which we can take the address of.
9377         For these variables, we store to a temporary variable. Also, make
9378         sure that we dont emit a `callvirt' on a valuetype method.
9379
9380 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9381
9382         * expression.cs (StackAlloc.DoReSolve): Added test for
9383         negative parameter (CS0247).
9384
9385 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9386
9387         Fix bug #59792
9388         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9389
9390 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9391
9392         Fix bug #59781
9393         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9394         ulong.
9395
9396 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9397
9398         Fix bug #58254 & cs1555.cs, cs1556.cs
9399         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9400
9401 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9402
9403         * cs-parser.jay: Added error CS1669 test for indexers.
9404
9405 2004-06-18  Martin Baulig  <martin@ximian.com>
9406
9407         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9408         argument.  Fixes #60441.
9409
9410 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9411         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9412         The name needs to have the actual name of the method in order
9413         for other tests (such as the one in OverloadResolve for Invoke
9414         on a delegate) to work. As well, it does not really help
9415         error reporting because the method group had multiple methods.
9416         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9417         Make profiling work.
9418         
9419 2004-06-13  Martin Baulig  <martin@ximian.com>
9420
9421         * cs-parser.jay: Don't allow generic attributes.
9422
9423 2004-06-13  Martin Baulig  <martin@ximian.com>
9424
9425         * class.cs (MemberBase.DoDefineBase): New protected method.
9426         (MemberBase.DoDefine): Compute the `flags' in the new
9427         DoDefineBase() which must be called first.
9428         (Method.Define): Call DoDefineBase() first so we have the flags
9429         when defining the generic method.
9430
9431         * cs-parser.jay (interface_method_declaration): Support generic methods.
9432
9433 2004-06-13  Martin Baulig  <martin@ximian.com>
9434
9435         * decl.cs (TypeName): Removed.
9436         (MemberName): Removed TypeName and MemberNow; now we just have
9437         MemberName.
9438
9439         * cs-parser.jay: Don't distinguish between type arguments and type
9440         parameters in the grammar and simplified the rules a bit.  The
9441         reduce/reduce conflicts are now gone (except the one we inherited
9442         from mcs).
9443
9444 2004-06-11  Martin Baulig  <martin@ximian.com>
9445
9446         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9447         call this twice: for params and varargs methods.
9448
9449 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9450
9451         * class.cs:
9452         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9453
9454 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9455
9456         * attribute.cs (Attribute.GetValidTargets): Made public.
9457
9458         * class.cs: 
9459         (AbstractPropertyEventMethod): New class for better code sharing.
9460         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9461         CS1667 report.
9462         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9463
9464 2004-06-09  Martin Baulig  <martin@ximian.com>
9465
9466         * cs-parser.jay: Removed a reduce/reduce conflict.
9467
9468 2004-06-03  Martin Baulig  <martin@ximian.com>
9469
9470         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9471         GetSimpleName() and return a SimpleName.
9472
9473         * ecore.cs (SimpleName.Arguments): New public field.
9474         (SimpleName): Added overloaded ctor which takes an additional
9475         TypeArguments argument.
9476         (SimpleName.SimpleNameResolve): Added support for generic methods.
9477         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9478         formerly in MemberAccess.DoResolve(), but we also need it in
9479         SimpleNameResolve().
9480
9481         * expression.cs (MemberAccess.DoResolve): Use the new
9482         MethodGroupExpr.ResolveGeneric().       
9483
9484 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9485
9486         * decl.cs: If possible, use lookuptypedirect here. We can only do
9487         this if there is no `.' after the namespace. Avoids using
9488         LookupType, which does lots of slow processing.
9489         (FindNestedType) New method, does what it says :-).
9490         * namespace.cs: use LookupTypeDirect.
9491         * rootcontext.cs: use membercache, if possible.
9492         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9493
9494 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9495
9496         * expression.cs:
9497         According to the spec, 
9498
9499         In a member access of the form E.I, if E is a single identifier,
9500         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9501         field, property, localvariable, or parameter with the same type as
9502         the meaning of E as a type-name (§3.8), then both possible
9503         meanings of E are permitted.
9504
9505         We did not check that E as a simple-name had the same type as E as
9506         a type name.
9507
9508         This trivial check gives us 5-7% on bootstrap time.
9509
9510 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9511
9512         * expression.cs (Invocation.OverloadResolve): Avoid the
9513         use of hashtables and boxing here by allocating on demand.
9514
9515 2004-05-30  Martin Baulig  <martin@ximian.com>
9516
9517         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9518         we're doing a silent lookup.  Don't try to lookup nested types in
9519         TypeManager.object_type (thanks to Ben Maurer).
9520
9521 2004-05-30  Martin Baulig  <martin@ximian.com>
9522
9523         Committing a patch from Ben Maurer.
9524
9525         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9526
9527 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9528
9529         * convert.cs: add a trivial cache for overload operator resolution.
9530
9531 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9532
9533         * attribute.cs
9534         (AttributeTester.GetObsoleteAttribute): Returns instance of
9535         ObsoleteAttribute when type is obsolete.
9536
9537         * class.cs
9538         (TypeContainer.VerifyObsoleteAttribute): Override.
9539         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9540         (MethodCode.VerifyObsoleteAttribute): Override.
9541         (MemberBase.VerifyObsoleteAttribute): Override.
9542
9543         * decl.cs
9544         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9545         and report proper error.
9546
9547         *delegate.cs
9548         (Delegate.VerifyObsoleteAttribute): Override.
9549
9550         * ecore.cs
9551         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9552         and report proper error.
9553         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9554
9555         * enum.cs
9556         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9557         and enum member.
9558
9559         * expression.cs
9560         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9561         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9562         Added test for ObsoleteAttribute.
9563
9564         * statement.cs
9565         (Catch): Derived from Statement.
9566
9567 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9568
9569         * decl.cs: If possible, use lookuptypedirect here. We can only do
9570         this if there is no `.' after the namespace. Avoids using
9571         LookupType, which does lots of slow processing.
9572         (FindNestedType) New method, does what it says :-).
9573         * namespace.cs: use LookupTypeDirect.
9574         * rootcontext.cs: use membercache, if possible.
9575         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9576
9577 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9578
9579         * expression.cs:
9580         According to the spec, 
9581
9582         In a member access of the form E.I, if E is a single identifier,
9583         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9584         field, property, localvariable, or parameter with the same type as
9585         the meaning of E as a type-name (§3.8), then both possible
9586         meanings of E are permitted.
9587
9588         We did not check that E as a simple-name had the same type as E as
9589         a type name.
9590
9591         This trivial check gives us 5-7% on bootstrap time.
9592
9593 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9594
9595         Fixed bug #59071 & cs0160.cs
9596         * statement.cs (Try.Resolve): Check here whether order of catch
9597         clauses matches their dependencies.
9598
9599 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9600
9601         Fixed bug #58624
9602         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9603         unsafe type.
9604
9605 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9606
9607         * expression.cs (Invocation.OverloadResolve): Avoid the
9608         use of hashtables and boxing here by allocating on demand.
9609
9610 2004-05-30  Martin Baulig  <martin@ximian.com>
9611
9612         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9613         we're doing a silent lookup.  Don't try to lookup nested types in
9614         TypeManager.object_type (thanks to Ben Maurer).
9615
9616 2004-05-30  Martin Baulig  <martin@ximian.com>
9617
9618         Committing a patch from Ben Maurer.
9619
9620         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9621
9622 2004-05-29  Martin Baulig  <martin@ximian.com>
9623
9624         * class.cs (IMethodData.ShouldIgnore): New method.
9625
9626         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9627         `Location' argument, we don't need it anywhere.  Use
9628         `IMethodData.ShouldIgnore ()' instead of
9629         `MethodData.GetMethodFlags ()'.
9630         (TypeManager.AddMethod): Removed.
9631         (TypeManager.AddMethod2): Renamed to AddMethod.
9632
9633 2004-05-29  Martin Baulig  <martin@ximian.com>
9634
9635         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9636
9637         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9638         converting from a class type S to an interface type and we already
9639         have an object on the stack, don't box it again.  Fixes #52578.
9640
9641 2004-05-29  Martin Baulig  <martin@ximian.com>
9642
9643         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9644         Added support for `params' parameters.  Fixes #59267.
9645
9646 2004-05-29  Martin Baulig  <martin@ximian.com>
9647
9648         * literal.cs (NullPointer): Provide a private .ctor which sets
9649         `type' to TypeManager.object_type.  Fixes #59048.
9650
9651 2004-05-29  Martin Baulig  <martin@ximian.com>
9652
9653         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9654         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9655
9656         * ecore.cs (EventExpr.instance_expr): Make the field private.
9657
9658 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9659
9660         Fixed bug #50080 & cs0214-2.cs
9661         * expression.cs (Cast.DoResolve): Check unsafe context here.
9662         
9663         * statement.cs (Resolve.DoResolve): Likewise.
9664
9665 2004-05-26  Martin Baulig  <martin@ximian.com>
9666
9667         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9668
9669         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9670         (RootContext.LookupType): Pass down the `silent' flag.
9671
9672 2004-05-25  Martin Baulig  <martin@ximian.com>
9673
9674         * expression.cs
9675         (MethodGroupExpr.IdenticalTypeName): New public property.
9676         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9677         expression actually refers to a type.
9678
9679 2004-05-25  Martin Baulig  <martin@ximian.com>
9680
9681         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9682         for #56176 and made it actually work.
9683
9684 2004-05-25  Martin Baulig  <martin@ximian.com>
9685
9686         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9687         (FieldExpr, PropertyExpr): Override and implement
9688         CacheTemporaries.  Fixes #52279.
9689
9690 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9691
9692         * location.cs: In the new compiler listing a file twice is a
9693         warning, not an error.
9694
9695 2004-05-24  Martin Baulig  <martin@ximian.com>
9696
9697         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9698         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9699
9700 2004-05-24  Martin Baulig  <martin@ximian.com>
9701
9702         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9703         walking the `using' list.  Fixes #53921.
9704
9705 2004-05-24  Martin Baulig  <martin@ximian.com>
9706
9707         * const.cs (Const.LookupConstantValue): Added support for
9708         EmptyCast's; fixes #55251.
9709
9710 2004-05-24  Martin Baulig  <martin@ximian.com>
9711
9712         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9713         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9714         which does the CS0135 check.  The reason is that we first need to
9715         check whether the variable actually exists.
9716
9717 2004-05-24  Martin Baulig  <martin@ximian.com>
9718
9719         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9720         than RootContext.LookupType() to find the explicit interface
9721         type.  Fixes #58584.
9722
9723 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9724
9725         * Makefile: Simplify.  Use executable.make.
9726         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9727
9728 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9729
9730         * decl.cs:
9731         * enum.cs:
9732         Use the invariant culture when doing String.Compare for CLS case
9733         sensitivity.
9734         
9735 2004-05-23  Martin Baulig  <martin@ximian.com>
9736
9737         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9738         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9739
9740         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9741
9742 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9743
9744         * class.cs (MemberBase.Define): Reuse MemberType member for 
9745         resolved type. Other methods can use it too.
9746
9747 2004-05-23  Martin Baulig  <martin@ximian.com>
9748
9749         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9750         the variable also exists in the current block (otherwise, we need
9751         to report a CS0103).  Fixes #58670.
9752
9753 2004-05-23  Martin Baulig  <martin@ximian.com>
9754
9755         * flowanalysis.cs (Reachability.Reachable): Compute this
9756         on-the-fly rather than storing it as a field.
9757
9758 2004-05-23  Martin Baulig  <martin@ximian.com>
9759
9760         * flowanalysis.cs (Reachability.And): Manually compute the
9761         resulting `barrier' from the reachability.      
9762        
9763 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9764
9765         Fix bug #57835
9766         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9767         instance of ObsoleteAttribute when symbol is obsolete.
9768
9769         * class.cs
9770         (IMethodData): Extended interface for ObsoleteAttribute support.
9771
9772 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9773
9774         * attribute.cs: Fix bug #55970
9775
9776 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9777
9778         Fix bug #52705
9779         * attribute.cs
9780         (GetObsoleteAttribute): New method. Creates the instance of
9781         ObsoleteAttribute.
9782         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9783         ObsoleteAttribute when member is obsolete.
9784         (AttributeTester.Report_ObsoleteMessage): Common method for
9785         Obsolete error/warning reporting.
9786
9787         * class.cs
9788         (TypeContainer.base_classs_type): New member for storing parent type.
9789
9790         * decl.cs
9791         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9792         for this MemberCore.
9793
9794 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9795
9796         * attribute.cs, const.cs: Fix bug #58590
9797
9798 2004-05-21  Martin Baulig  <martin@ximian.com>
9799
9800         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9801         out parameters if the end of the method is unreachable.  Fixes
9802         #58098. 
9803
9804 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9805
9806         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9807         Hari was right, why extra method.
9808
9809 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9810
9811         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9812
9813 2004-05-20  Martin Baulig  <martin@ximian.com>
9814
9815         * delegate.cs: Convert this file to Unix mode - like the original
9816         version in mcs is.
9817
9818 2004-05-20  Martin Baulig  <martin@ximian.com>
9819
9820         * attribute.cs: Convert this file to Unix mode - like the original
9821         version in mcs is.
9822
9823 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9824
9825        Fix bug #58688 (MCS does not report error when the same attribute
9826        is assigned twice)
9827
9828        * attribute.cs (Attribute.Emit): Distinction between null and default.
9829
9830 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9831
9832        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9833        of a top-level attribute without an attribute target.
9834        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9835        Make non-static.
9836        (Attribute.Conditional_GetConditionName), 
9837        (Attribute.Obsolete_GetObsoleteMessage): Update.
9838        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9839        part of ScanForIndexerName.
9840        (Attribute.CanIgnoreInvalidAttribute): New function.
9841        (Attribute.ScanForIndexerName): Move to ...
9842        (Attributes.ScanForIndexerName): ... here.
9843        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9844        (Attributes.Search): New internal variant that can choose not to
9845        complain if types aren't resolved.  The original signature now
9846        complains.
9847        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9848        complaints suppressed.
9849        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9850        only if it not useful.
9851        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9852        top-level for attributes that are shared between the assembly
9853        and a top-level class.
9854        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9855        * class.cs: Update to reflect changes.
9856        (DefineIndexers): Fuse loops.
9857        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9858        a couple more variants of attribute names.
9859
9860 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9861
9862         Fix bug #52585 (Implemented explicit attribute declaration)
9863
9864         * attribute.cs:
9865         (Attributable.ValidAttributeTargets): New abstract method. It gets
9866         list of valid attribute targets for explicit target declaration.
9867         (Attribute.Target): It holds target itself.
9868         (AttributeSection): Removed.
9869         (Attribute.CheckTargets): New method. It checks whether attribute
9870         target is valid for the current element.
9871
9872         * class.cs:
9873         (EventProperty): New class. For events that are declared like
9874         property (with add and remove accessors).
9875         (EventField): New class. For events that are declared like field.
9876         class.cs
9877
9878         * cs-parser.jay: Implemented explicit attribute target declaration.
9879
9880         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9881         Override ValidAttributeTargets.
9882
9883         * parameter.cs:
9884         (ReturnParameter): Class for applying custom attributes on 
9885         the return type.
9886         (ParameterAtribute): New class. Class for applying custom
9887         attributes on the parameter type.
9888
9889 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9890
9891         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9892         definitions. 
9893
9894         (Method): Allow UNSAFE here.
9895
9896         * modifiers.cs: Support unsafe reporting.
9897
9898 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9899
9900         * decl.cs: Fix bug #58478.
9901
9902 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9903
9904         * statement.cs: When checking for unreachable code on an EmptyStatement,
9905         set the location. Fixes bug #58488.
9906
9907 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9908
9909         * driver.cs: Add -pkg handling.
9910
9911         From Gonzalo: UseShelLExecute=false
9912
9913 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9914
9915         * attribute.cs:
9916         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9917         for attribute.
9918         (Attribute.IsClsCompliaceRequired): Moved to base for better
9919         accesibility.
9920         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9921         when attribute is AttributeUsageAttribute.
9922         (Attribute.GetValidTargets): Simplified.
9923         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9924         attribute for this type.
9925         (Attribute.ApplyAttributes): Method renamed to Emit and make
9926         non-static.
9927         (GlobalAttributeSection): New class for special handling of global
9928         attributes (assembly, module).
9929         (AttributeSection.Emit): New method.
9930
9931         * class.cs: Implemented Attributable abstract methods.
9932         (MethodCore.LabelParameters): Moved to Parameter class.
9933         (Accessor): Is back simple class.
9934         (PropertyMethod): Implemented Attributable abstract class.
9935         (DelegateMethod): Implemented Attributable abstract class.
9936         (Event): New constructor for disctintion between normal Event
9937         and Event with accessors.
9938
9939         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9940
9941         * codegen.cs, const.cs, decl.cs, delegate.cs:
9942         (CommonAssemblyModulClass): Implemented Attributable abstract class
9943         and simplified.
9944
9945         * enum.cs: Implement IAttributeSupport interface.
9946         (EnumMember): New class for emum members. Implemented Attributable
9947         abstract class
9948
9949         * parameter.cs:
9950         (ParameterBase): Is abstract.
9951         (ReturnParameter): New class for easier [return:] attribute handling.
9952
9953         * typemanager.cs: Removed builder_to_attr.
9954
9955 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9956
9957         Fix bug #57151.
9958         * attribute.cs (Attribute.GetPositionalValue): New function.
9959         * class.cs (TypeContainer.VerifyMembers): New function.
9960         (TypeContainer.Emit): Use it.
9961         (ClassOrStruct): New base class for Class and Struct.
9962         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9963         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9964         class.
9965         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9966         then each non-static field should have a FieldOffset attribute.
9967         Otherwise, none of the fields should have a FieldOffset attribute.
9968         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9969         and FieldOffset attributes.
9970         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9971         (TypeManager.field_offset_attribute_type): New core types.
9972         (TypeManager.InitCoreTypes): Initialize them.
9973
9974 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9975
9976         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9977         Return correct type.
9978         From bug #58270.
9979
9980 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9981
9982         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9983         be implicitly converted to ulong.
9984         
9985         * expression.cs: The logic for allowing operator &, | and ^ worked
9986         was wrong, it worked before because we did not report an error in
9987         an else branch.  Fixes 57895.
9988
9989         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9990         allow volatile fields to be reference types.
9991
9992 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9993
9994         * driver.cs: Add support for /debug-
9995
9996 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9997
9998         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9999         Add a 'complain' parameter to silence errors.
10000         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10001         silently overlooked type-resolutions.
10002         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10003         to reflect changes.
10004         (Attributes.Search): New function.
10005         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10006         (Attributes.GetAttributeFullName): Remove hack.
10007         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10008         Update to reflect changes.
10009         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10010         Use Attributes.Search instead of nested loops.
10011
10012 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10013
10014         * decl.cs:
10015         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10016         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10017         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10018
10019         * report.cs: (Report.Warning): Renamed to Warning_T because of
10020         parameter collision.
10021
10022 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10023
10024         * expression.cs (MemberAccess.ResolveMemberAccess):
10025         Exit with non-zero status after Report.Error.
10026         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10027         Likewise.
10028         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10029
10030 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10031
10032         * support.cs: Don't hang when the file is empty.
10033
10034 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10035
10036         * support.cs: In SeekableStreamReader, compute the preamble size of the
10037           underlying stream. Position changes should take into account that initial
10038           count of bytes.
10039
10040 2004-05-03  Todd Berman  <tberman@sevenl.net>
10041
10042         * driver.cs: remove unused GetSysVersion function.
10043
10044 2004-05-03  Todd Berman  <tberman@sevenl.net>
10045
10046         * driver.cs: Remove the hack from saturday, as well as the hack
10047         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10048         link_paths to get that bit proper.
10049
10050 2004-05-01  Todd Berman  <tberman@sevenl.net>
10051
10052         * driver.cs: Try a LoadFrom before a Load, this checks the current
10053         path. This is currently a bug in mono that is be fixed, however, this
10054         provides a workaround for now. This will be removed when the bug
10055         is fixed.
10056
10057 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10058
10059         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10060         incomplete key pairs (#57941).
10061
10062 2004-05-01  Todd Berman  <tberman@sevenl.net>
10063
10064         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10065         from the GAC
10066
10067 2004-04-30  Jackson Harper  <jackson@ximian.com>
10068
10069         * codegen.cs: Open keys readonly.
10070         
10071 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10072
10073         * typemanager.cs: don't report cyclic struct layout when a struct
10074         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10075         which has 2 Pango.Rectangle fields.
10076
10077 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10078
10079         * expression.cs: Handle IntPtr comparisons with IL code
10080         rather than a method call.
10081
10082 2004-04-29  Martin Baulig  <martin@ximian.com>
10083
10084         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10085         the list of PropertyInfo's in class hierarchy and find the
10086         accessor.  Fixes #56013.
10087
10088 2004-04-29  Martin Baulig  <martin@ximian.com>
10089
10090         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10091
10092 2004-04-29  Martin Baulig  <martin@ximian.com>
10093
10094         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10095
10096         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10097
10098 2004-04-29  Martin Baulig  <martin@ximian.com>
10099
10100         * class.cs (ConstructorInitializer.Resolve): Check whether the
10101         parent .ctor is accessible.  Fixes #52146.
10102
10103 2004-04-29  Martin Baulig  <martin@ximian.com>
10104
10105         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10106
10107         * statement.cs (Using.EmitLocalVariableDecls): Use
10108         TypeManager.idisposable_type, not typeof (IDisposable).
10109         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10110
10111 2004-04-29  Martin Baulig  <martin@ximian.com>
10112
10113         * class.cs (Event.Define): Don't emit the field and don't set
10114         RTSpecialName and SpecialName for events on interfaces.  Fixes
10115         #57703. 
10116
10117 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10118
10119         Refactor Attribute.ApplyAttributes.
10120         * attribute.cs (Attributable): New base class for objects that can
10121         have Attributes applied on them.
10122         (Attribute): Make AttributeUsage fields public.
10123         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10124         (Attribute.IsInternalCall): New property.
10125         (Attribute.UsageAttr): Convert to a public read-only property.
10126         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10127         (Attribute.ResolveType, Attribute.Resolve)
10128         (Attribute.ScanForIndexerName): Update to reflect changes.
10129         (Attribute.CheckAttributeTarget): Re-format.
10130         (Attribute.ApplyAttributes): Refactor, to various
10131         Attributable.ApplyAttributeBuilder methods.
10132         * decl.cs (MemberCore): Make Attributable.
10133         * class.cs (Accessor): Make Attributable.
10134         (MethodData.ApplyAttributes): Use proper attribute types, not
10135         attribute names.
10136         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10137         (TypeContainer.ApplyAttributeBuilder)
10138         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10139         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10140         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10141         (Operator.ApplyAttributeBuilder): New factored-out methods.
10142         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10143         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10144         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10145         * parameter.cs (ParameterBase): New Attributable base class
10146         that can also represent Return types.
10147         (Parameter): Update to the changes.
10148
10149 2004-04-29  Jackson Harper  <jackson@ximian.com>
10150
10151         * driver.cs: Prefer the corlib system version when looking for
10152         assemblies in the GAC. This is still a hack, but its a better hack
10153         now.
10154         
10155 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10156
10157         * decl.cs, enum.cs: Improved error 3005 reporting.
10158   
10159         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10160         (related_symbols): New private member for list of symbols
10161         related to reported error/warning.
10162         
10163         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10164
10165 2004-04-29  Martin Baulig  <martin@ximian.com>
10166
10167         * ecore.cs (Expression.Constantify): If we're an enum and
10168         TypeManager.TypeToCoreType() doesn't give us another type, use
10169         t.UnderlyingSystemType.  Fixes #56178.  
10170
10171 2004-04-29  Martin Baulig  <martin@ximian.com>
10172
10173         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10174         interfaces and for each interface, only add members directly
10175         declared in that interface.  Fixes #53255.
10176
10177 2004-04-28  Martin Baulig  <martin@ximian.com>
10178
10179         * expression.cs (ConditionalLogicalOperator): Use a temporary
10180         variable for `left' to avoid that we evaluate it more than once;
10181         bug #52588.
10182
10183 2004-04-28  Martin Baulig  <martin@ximian.com>
10184
10185         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10186         `void[]' (CS1547).
10187
10188 2004-04-28  Martin Baulig  <martin@ximian.com>
10189
10190         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10191         void (CS1547).
10192
10193         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10194         whether the type is not void (CS1547).
10195
10196 2004-04-28  Martin Baulig  <martin@ximian.com>
10197
10198         * expression.cs (Unary.DoResolveLValue): Override this and report
10199         CS0131 for anything but Operator.Indirection.
10200
10201 2004-04-28  Martin Baulig  <martin@ximian.com>
10202
10203         Committing a patch from Ben Maurer; see bug #50820.
10204
10205         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10206         check for classes.
10207
10208         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10209         classes.        
10210
10211 2004-04-28  Martin Baulig  <martin@ximian.com>
10212
10213         Committing a patch from Ben Maurer; see bug #50820.
10214
10215         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10216         check for classes.
10217
10218         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10219         classes.        
10220
10221 2004-04-28  Martin Baulig  <martin@ximian.com>
10222
10223         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10224         (Block.AddLabel): Call DoLookupLabel() to only search in the
10225         current block.
10226
10227 2004-04-28  Martin Baulig  <martin@ximian.com>
10228
10229         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10230         comparing StringConstants and NullLiterals in Equality and Inequality.
10231
10232 2004-04-28  Jackson Harper  <jackson@ximian.com>
10233
10234         * driver.cs: Attempt to load referenced assemblies from the
10235         GAC. This is the quick and dirty version of this method that
10236         doesnt take into account versions and just takes the first
10237         canidate found. Will be good enough for now as we will not have more
10238         then one version installed into the GAC until I update this method.
10239
10240 2004-04-28  Martin Baulig  <martin@ximian.com>
10241
10242         * typemanager.cs (TypeManager.CheckStructCycles): New public
10243         static method to check for cycles in the struct layout.
10244
10245         * rootcontext.cs (RootContext.PopulateTypes): Call
10246         TypeManager.CheckStructCycles() for each TypeContainer.
10247         [Note: We only need to visit each type once.]
10248
10249 2004-04-28  Martin Baulig  <martin@ximian.com>
10250
10251         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10252
10253         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10254         success and added `out object value'.  Use a `bool resolved' field
10255         to check whether we've already been called rather than
10256         `ConstantValue != null' since this breaks for NullLiterals.
10257
10258 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10259
10260         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10261         setting of this flag, since the 'set' method may be non-public.
10262
10263 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10264
10265         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10266         check on current_vector.Block.
10267
10268 2004-04-27  Martin Baulig  <martin@ximian.com>
10269
10270         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10271         a field initializer.  Fixes #56459.
10272
10273 2004-04-27  Martin Baulig  <martin@ximian.com>
10274
10275         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10276         we're not attempting to use an indexer.  Fixes #52154.
10277
10278 2004-04-27  Martin Baulig  <martin@ximian.com>
10279
10280         * statement.cs (Return): Don't create a return label if we don't
10281         need it; reverts my change from January 20th.  Thanks to Ben
10282         Maurer for this.
10283
10284 2004-04-27  Martin Baulig  <martin@ximian.com>
10285
10286         According to the spec, `goto' can only leave a nested scope, but
10287         never enter it.
10288
10289         * statement.cs (Block.LookupLabel): Only lookup in the current
10290         block, don't recurse into parent or child blocks.
10291         (Block.AddLabel): Check in parent and child blocks, report
10292         CS0140/CS0158 if we find a duplicate.
10293         (Block): Removed this indexer for label lookups.
10294         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10295         this already does the error reporting for us.
10296
10297         * flowanalysis.cs
10298         (FlowBranching.UsageVector.Block): New public variable; may be null.
10299         (FlowBranching.CreateSibling): Added `Block' argument.
10300         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10301         label for the target of a `goto' and check whether we're not
10302         leaving a `finally'.
10303
10304 2004-04-27  Martin Baulig  <martin@ximian.com>
10305
10306         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10307         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10308         just for returns).
10309
10310 2004-04-27  Martin Baulig  <martin@ximian.com>
10311
10312         * statement.cs (Block.AddLabel): Also check for implicit blocks
10313         and added a CS0158 check.
10314
10315 2004-04-27  Martin Baulig  <martin@ximian.com>
10316
10317         * flowanalysis.cs (FlowBranchingLoop): New class.
10318         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10319         UsageVector's instead of an ArrayList.
10320         (FlowBranching.Label): Likewise.
10321         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10322         (FlowBranching.AddBreakVector): New method.
10323
10324 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10325
10326         * attribute.cs: Small regression fix: only convert the type if we
10327         the type is different, fixes System.Drawing build.
10328
10329 2004-04-27  Martin Baulig  <martin@ximian.com>
10330
10331         * attribute.cs (Attribute.Resolve): If we have a constant value
10332         for a named field or property, implicity convert it to the correct
10333         type.
10334
10335 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10336
10337         * statement.cs (Block.Block): Implicit blocks share
10338         'child_variable_names' fields with parent blocks.
10339         (Block.AddChildVariableNames): Remove.
10340         (Block.AddVariable): Mark variable as "used by a child block" in
10341         every surrounding block.
10342         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10343         been used in a child block, complain about violation of "Invariant
10344         meaning in blocks" rule.
10345         * cs-parser.jay (declare_local_variables): Don't use
10346         AddChildVariableNames.
10347         (foreach_statement): Don't create an implicit block: 'foreach'
10348         introduces a scope.
10349
10350 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10351
10352         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10353         converting from 0L to ulong.  Fixes 57522.
10354
10355 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10356
10357         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10358         derived class hides via 'new' keyword field from base class (test-242.cs).
10359         TODO: Handle this in the more general way.
10360         
10361         * class.cs (CheckBase): Ditto.
10362
10363 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10364
10365         * decl.cs (caching_flags): New member for storing cached values
10366         as bit flags.
10367         (MemberCore.Flags): New enum where bit flags for caching_flags
10368         are defined.
10369         (MemberCore.cls_compliance): Moved to caching_flags.
10370         (DeclSpace.Created): Moved to caching_flags.
10371
10372         * class.cs: Use caching_flags instead of DeclSpace.Created
10373         
10374 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10377         if we are only a derived class, not a nested class.
10378
10379         * typemanager.cs: Same as above, but do this at the MemberLookup
10380         level (used by field and methods, properties are handled in
10381         PropertyExpr).   Allow for the qualified access if we are a nested
10382         method. 
10383
10384 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10385
10386         * class.cs: Refactoring.
10387         (IMethodData): New inteface; Holds links to parent members
10388         to avoid member duplication (reduced memory allocation).
10389         (Method): Implemented IMethodData interface.
10390         (PropertyBase): New inner classes for get/set methods.
10391         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10392         (Event): New inner classes for add/remove methods.
10393         (Event.DelegateMethod): Implemented IMethodData interface.
10394
10395         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10396         EmitContext (related to class.cs refactoring).
10397
10398 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10399
10400         * delegate.cs (Delegate.VerifyApplicability): If the number of
10401         arguments are the same as the number of parameters, first try to
10402         verify applicability ignoring  any 'params' modifier on the last
10403         parameter.
10404         Fixes #56442.
10405
10406 2004-04-08  Martin Baulig  <martin@ximian.com>
10407
10408         Merged latest changes into gmcs.  Please keep this comment in
10409         here, it makes it easier for me to see what changed in MCS since
10410         the last time I merged.
10411
10412 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10413
10414         * class.cs (TypeContainer.AddIndexer): Use
10415         'ExplicitInterfaceName' to determine if interface name was
10416         explicitly specified.  'InterfaceType' is not initialized at this time.
10417         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10418         Indexers array is already in the required order.  Initialize
10419         'IndexerName' only if there are normal indexers.
10420         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10421         (TypeContainer.Emit): Emit DefaultMember attribute only if
10422         IndexerName is initialized.
10423         Fixes #56300.
10424
10425 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10426
10427         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10428         Fixes #57007
10429
10430 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10431
10432         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10433         attributes.
10434         Fix for #56456.
10435
10436         * attribute.cs (Attribute.Resolve): Check for duplicate named
10437         attributes.
10438         Fix for #56463.
10439
10440 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10441
10442         * iterators.cs (MarkYield): track whether we are in an exception,
10443         and generate code accordingly.  Use a temporary value to store the
10444         result for our state.
10445
10446         I had ignored a bit the interaction of try/catch with iterators
10447         since their behavior was not entirely obvious, but now it is
10448         possible to verify that our behavior is the same as MS .NET 2.0
10449
10450         Fixes 54814
10451
10452 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10453
10454         * iterators.cs: Avoid creating temporaries if there is no work to
10455         do. 
10456
10457         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10458         Enumerations, use TypeManager.EnumToUnderlying and call
10459         recursively. 
10460
10461         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10462         bug #57013
10463
10464         (This.Emit): Use EmitContext.EmitThis to emit our
10465         instance variable.
10466
10467         (This.EmitAssign): Ditto.
10468
10469         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10470         codepaths, we will move all the functionality into
10471         Mono.CSharp.This 
10472
10473         (FieldExpr.EmitAssign): Ditto.
10474
10475         This fixes several hidden bugs that I uncovered while doing a code
10476         review of this today.
10477
10478         * codegen.cs (EmitThis): reworked so the semantics are more clear
10479         and also support value types "this" instances.
10480
10481         * iterators.cs: Changed so that for iterators in value types, we
10482         do not pass the value type as a parameter.  
10483
10484         Initialization of the enumerator helpers is now done in the caller
10485         instead of passing the parameters to the constructors and having
10486         the constructor set the fields.
10487
10488         The fields have now `assembly' visibility instead of private.
10489
10490 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10491
10492         * expression.cs (Argument.Resolve): Check if fields passed as ref
10493         or out are contained in a MarshalByRefObject.
10494
10495         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10496         another compiler type.
10497
10498 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10499
10500         * class.cs (Indexer.Define): use the new name checking method.
10501         Also, return false on an error.
10502         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10503         (is_identifier_[start/part]_character): make static.
10504
10505 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10506
10507         * expression.cs (Binary.ResolveOperator): Do no append strings
10508         twice: since we can be invoked more than once (array evaluation)
10509         on the same concatenation, take care of this here.  Based on a fix
10510         from Ben (bug #56454)
10511
10512 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10513
10514         * codegen.cs: Fix another case where CS1548 must be reported (when 
10515         delay-sign isn't specified and no private is available #56564). Fix
10516         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10517         error when MCS is used on the MS runtime and we need to delay-sign 
10518         (which seems unsupported by AssemblyBuilder - see #56621).
10519
10520 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10521
10522         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10523         (TypeManager.ComputeNamespaces): Faster implementation for
10524         Microsoft runtime.
10525
10526         * compiler.csproj: Updated AssemblyName to mcs.
10527
10528 2004-05-11  Jackson Harper  <jackson@ximian.com>
10529
10530         * Makefile: Preserve MONO_PATH
10531         
10532 2004-05-11  Jackson Harper  <jackson@ximian.com>
10533
10534         * Makefile: Use mono and mcs to build gmcs
10535         
10536 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10537
10538         * codegen.cs: Add patch from Robert Shade
10539         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10540         sync with mcs.
10541
10542 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10543
10544         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10545         incomplete key pairs (#57941).
10546
10547 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10548
10549         * codegen.cs: Fix another case where CS1548 must be reported (when 
10550         delay-sign isn't specified and no private is available #56564). Fix
10551         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10552         error when MCS is used on the MS runtime and we need to delay-sign 
10553         (which seems unsupported by AssemblyBuilder - see #56621).
10554
10555 2004-04-29  Jackson Harper  <jackson@ximian.com>
10556
10557         * Makefile: Set MONO_PATH to use the bootstrap corlib
10558         * driver.cs: Check the GAC for referenced assemblies.
10559                 
10560 2004-04-29  Martin Baulig  <martin@ximian.com>
10561
10562         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10563
10564 2004-04-07  Martin Baulig  <martin@ximian.com>
10565
10566         * expression.cs (Binary.ResolveOperator): Added special case for
10567         Equality/Inequality between a type parameter and a null literal.
10568
10569 2004-04-07  Martin Baulig  <martin@ximian.com>
10570
10571         * convert.cs: Check null literal -> type parameter conversions.
10572
10573 2004-04-07  Martin Baulig  <martin@ximian.com>
10574
10575         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10576         `class' and `struct' constraints.
10577
10578 2004-04-07  Martin Baulig  <martin@ximian.com>
10579
10580         * generic.cs (SpecialConstraint): New public enum.
10581         (Constraints.Resolve): Added support for the `class' and `struct'
10582         constraints.
10583
10584         * cs-parser.jay (type_parameter_constraint): Added support for the
10585         `class' and `struct' constraints.
10586
10587 2004-04-07  Martin Baulig  <martin@ximian.com>
10588
10589         * support.cs (GenericConstraints): Replaced `Types' by
10590         `ClassConstraint' and `InterfaceConstraints'; added
10591         `HasClassConstraint'.   
10592
10593 2004-04-07  Martin Baulig  <martin@ximian.com>
10594
10595         * generic.cs
10596         (Constraints.InterfaceConstraints): New public property.
10597         (Constraints.Types): Make this property public
10598         (TypeParameter): Implement IMemberContainer.
10599         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10600         instead of a TypeBuilder/MethodBuilder; pass the interface
10601         constraints to TypeManager.AddTypeParameter().
10602         (TypeParameter.DefineType): Just take an EmitContext and no
10603         TypeBuilder/MethodBuilder.  Use the new public API.
10604
10605         * typemanager.cs (TypeManager.AddTypeParameter): Added
10606         `TypeExpr[]' argument; add the interfaces to the
10607         `builder_to_ifaces' hash.
10608         (TypeManager.LookupMemberContainer): For
10609         GenericTypeParameterBuilders, get the TypeParameter from the
10610         `builder_to_type_param'.
10611         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10612         the TypeParameter and call FindMembers on it.
10613
10614 2004-04-07  Martin Baulig  <martin@ximian.com>
10615
10616         * class.cs
10617         (MethodCore.GenericMethod): Moved this field here from Method.
10618         (MethodCore.IsDuplicateImplementation): Take the number of type
10619         parameters into account if we're a generic method.
10620
10621         * expression.cs (Invocation.InferTypeArguments): Don't return true
10622         if `arguments' is null; we still need to check whether we actually
10623         don't need to infer anything in this case.
10624         (MemberAccess): Merged the functionality from GenericMemberAccess
10625         into this class.
10626
10627         * generic.cs (GenericMemberAccess): Removed.
10628
10629 2004-04-05  Martin Baulig  <martin@ximian.com>
10630
10631         * decl.cs (MemberCore): For generic classes, interfaces and
10632         structs, `Name' now includes the number of type parameters
10633         ("Stack!1.Node!1").
10634         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10635         encode the number of type arguments in the type name.
10636
10637         * expression.cs (Expression.MemberLookup): Removed the
10638         `num_type_args' argument; we now encode the number of type
10639         arguments in the type name.
10640
10641         * ecore.cs (SimpleName): Encode the number of type arguments in
10642         the type name itself.
10643
10644         * generic.cs (ConstructedType): Likewise.
10645
10646         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10647         `MemberName'; we now include the number of type parameters in the
10648         type name.
10649
10650         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10651         (TypeManager.MemberLookup): Removed the
10652         `num_type_args' argument; we now encode the number of type
10653         arguments in the type name.     
10654
10655 2004-04-03  Martin Baulig  <martin@ximian.com>
10656
10657         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10658         (MemberCore.MemberName): Moved here from MemberBase.
10659         (DeclSpace.SetParameterInfo): Just take the constraints as an
10660         ArrayList; we already have the type parameters in our
10661         `MemberName'; also do the CS0080 reporting here.
10662
10663         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10664         `IDENTIFIER opt_type_parameter_list'; when constructing our
10665         `MemberName', it'll already include our type parameters.
10666         (class_declaration, interface_declaration): Likewise.
10667         (delegate_declaration): Likewise.
10668         (MakeName): Take a MemberName and return a MemberName.
10669         The following two changes are required to avoid shift/reduce conflicts:
10670         (member_name): Don't include a TypeName anymore; ie. this is now
10671         just 'IDENTIFIER opt_type_parameter_list'.
10672         (property_declaration, event_declaration): Use a
10673         `namespace_or_type_name' instead of a `member_name'.            
10674
10675 2004-04-03  Martin Baulig  <martin@ximian.com>
10676
10677         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10678         `MemberName' class.
10679         (TypeName): Formerly known as MemberName.
10680
10681         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10682         instead of a `MemberName'.
10683
10684         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10685         (member_name): New rule; create a MemberName.
10686
10687 2004-04-02  Martin Baulig  <martin@ximian.com>
10688
10689         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10690         (CS0305 and CS0308).
10691
10692 2004-04-02  Martin Baulig  <martin@ximian.com>
10693
10694         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10695         support for nested types.
10696
10697 2004-04-02  Martin Baulig  <martin@ximian.com>
10698
10699         * ecore.cs (IAlias): New public interface.
10700         (TypeExpr, TypeExpression): Implement IAlias.
10701         (TypeAliasExpression): New public class.
10702
10703         * namespace.cs (Namespace): Implement IAlias.
10704         (Namespace.Lookup): Return an IAlias instead on an object.
10705         (Namespace.DefineName): Take an IAlias instead of an object.
10706         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10707         an object.
10708         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10709         Expression.
10710         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10711         object.
10712         (NamespaceEntry.Lookup): Likewise.
10713
10714         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10715         instead of a Type.      
10716
10717         * decl.cs (DeclSpace): Implement IAlias.
10718         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10719
10720         * generic.cs (ConstructedType): Improved error checking.
10721
10722 2004-04-02  Martin Baulig  <martin@ximian.com>
10723
10724         * convert.cs: Added type parameter conversions.
10725
10726         * ecore.cs
10727         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10728         (ClassCast.Emit): If the source type is a type parameter, box it.
10729         If the target type is a type parameter, emit an `unbox.any'
10730         instead of a `classcast'.1      
10731
10732 2004-04-01  Martin Baulig  <martin@ximian.com>
10733
10734         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10735
10736 2004-04-01  Martin Baulig  <martin@ximian.com>
10737
10738         * generic.cs (ConstructedType.CheckConstraints): Use
10739         Convert.ImplicitStandardConversionExists(); user-defined implicit
10740         conversions are not allowed according to the spec.
10741
10742 2004-03-30  Martin Baulig  <martin@ximian.com>
10743
10744         * expression.cs (New): Added support for type parameters.
10745
10746         * typemanager.cs
10747         (TypeManager.activator_type): New public static field.
10748         (TypeManager.activator_create_instance): Likewise.
10749
10750 2004-03-30  Martin Baulig  <martin@ximian.com>
10751
10752         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10753         public method.
10754
10755 2004-03-30  Martin Baulig  <martin@ximian.com>
10756
10757         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10758         the spec here: the argument type must be convertible to the
10759         constraints.
10760
10761 2004-03-30  Martin Baulig  <martin@ximian.com>
10762
10763         * generic.cs
10764         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10765         TypeManager.AddTypeParameter().
10766         (ConstructedType.CheckConstraints): Re-enable this and actually
10767         check whether we have a constructor constraint.
10768
10769         * typemanager.cs
10770         (TypeManager.builder_to_type_param): New static field.
10771         (TypeManager.AddTypeParameter): New static method.
10772         (TypeManager.LookupTypeParameter): New public method.
10773
10774 2004-03-30  Martin Baulig  <martin@ximian.com>
10775
10776         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10777         the new API to actually define the constructor constraint.
10778
10779         * typemanager.cs
10780         (TypeManager.new_constraint_attr_type): New static field.
10781         (TypeManager.InitCoreTypes): Initialize it.
10782
10783 2004-03-30  Martin Baulig  <martin@ximian.com>
10784
10785         * generic.cs (Constraints): Completed error checking, use correct
10786         error numbers.
10787
10788 2004-03-29  Martin Baulig  <martin@ximian.com>
10789
10790         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10791
10792         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10793         public version which takes a `ParameterData pd' instead of an
10794         `ArrayList args'.
10795
10796 2004-03-29  Martin Baulig  <martin@ximian.com>
10797
10798         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10799         not a MethodInfo.       
10800
10801 2004-03-29  Martin Baulig  <martin@ximian.com>
10802
10803         * expression.cs (Argument.ResolveMethodGroup): If we're a
10804         ConstructedType, call GetMemberAccess() on it.  
10805
10806 2004-03-29  Martin Baulig  <martin@ximian.com>
10807
10808         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10809         (MethodCore.CheckGenericOverride): When overriding a generic
10810         method, check whether the constraints match.
10811
10812         * support.cs (GenericConstraints): New public interface.
10813         (ParameterData.GenericConstraints): New public method.
10814
10815         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10816         method parameter and compute our constraints if appropriate.
10817         (Parameter.GenericConstraints): New public property.
10818
10819         * generic.cs (Constraints): Implement GenericConstraints.
10820
10821 2004-03-29  Martin Baulig  <martin@ximian.com>
10822
10823         * decl.cs (MemberCache.FindMemberToOverride): Use
10824         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10825
10826 2004-03-29  Martin Baulig  <martin@ximian.com>
10827
10828         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10829
10830 2004-03-29  Martin Baulig  <martin@ximian.com>
10831
10832         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10833         not allowed on non-generic declarations").
10834
10835 2004-03-29  Martin Baulig  <martin@ximian.com>
10836
10837         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10838         public version of this method.
10839
10840         * class.cs (MethodCore.IsDuplicateImplementation): Use
10841         Invocation.InferTypeArguments() to check this.
10842
10843 2004-03-29  Martin Baulig  <martin@ximian.com>
10844
10845         * convert.cs: Use TypeManager.IsDelegateType() instead of
10846         comparing types correctly.
10847
10848 2004-03-29  Martin Baulig  <martin@ximian.com>
10849
10850         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10851         types directly to make it work for generic instances.
10852
10853         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10854
10855 2004-03-29  Martin Baulig  <martin@ximian.com>
10856
10857         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10858         support for arrays.     
10859
10860 2004-03-24  Martin Baulig  <martin@ximian.com>
10861
10862         * decl.cs (DeclSpace.FindType): Also use
10863         TypeManager.CheckGeneric() for types from the using clauses.
10864
10865 2004-03-23  Martin Baulig  <martin@ximian.com>
10866
10867         * expression.cs (Invocation.OverloadResolve): Added `bool
10868         may_fail' argument and use it instead of the Location.IsNull() hack.
10869
10870 2004-03-23  Martin Baulig  <martin@ximian.com>
10871
10872         * expression.cs (Invocation.InferType): Use correct type inference
10873         rules here.     
10874
10875 2004-03-23  Martin Baulig  <martin@ximian.com>
10876
10877         * ecore.cs (MethodGroupExpr.Name): Use
10878         TypeManager.CSharpSignature() instead of just the name.
10879
10880         * expression.cs (Invocation.OverloadResolve): Provide better error
10881         reporting.
10882         (Invocation.DoResolve): OverloadResolve() never returns null
10883         without reporting an error, so removed the error -6 reporting here.
10884
10885 2004-03-23  Martin Baulig  <martin@ximian.com>
10886
10887         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10888         generic methods.
10889
10890         * cs-parser.jay (delegate_declaration): Support generic delegates.
10891
10892         * delegate.cs: Support generic delegates.
10893
10894 2004-03-22  Martin Baulig  <martin@ximian.com>
10895
10896         * expression.cs (Invocation.InferParamsTypeArguments): New static
10897         method; does type inference for params arguments.
10898
10899 2004-03-21  Martin Baulig  <martin@ximian.com>
10900
10901         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10902         method; checks whether a method is a generic method.    
10903
10904         * expression.cs (Invocation.InferTypeArguments): New static method;
10905         infer type arguments for generic method invocation.
10906
10907         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10908         property; we set this to true if we're resolving a generic method
10909         invocation and the user specified type arguments, ie. we're not
10910         doing type inference.
10911
10912 2004-03-20  Martin Baulig  <martin@ximian.com>
10913
10914         * class.cs (MethodData.DeclaringType): New public property.
10915         (MethodData.Define): Set DeclaringType here.
10916         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10917         instead of OperatorMethodBuilder.DeclaringType.
10918
10919 2004-03-20  Martin Baulig  <martin@ximian.com>
10920
10921         * cs-tokenizer.cs (xtoken): Return a special
10922         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10923
10924         * cs-parser.jay (default_value_expression): Switch to the new
10925         syntax (14.5.13).
10926
10927 2004-03-19  Martin Baulig  <martin@ximian.com>
10928
10929         * decl.cs (MemberName): New class.  We use this to "construct"
10930         namespace_or_type_name's.
10931
10932         * generics.cs (TypeArguments.GetDeclarations): New public method;
10933         returns the type arguments as a string[] and reports a CS0081 if
10934         one of them is not an identifier.
10935
10936         * class.cs (MemberBase): The .ctor now takes the name as a
10937         MemberName instead of a string.
10938         (MemberBase.ExplicitInterfaceName): Changed type from string to
10939         Expression.
10940         (MemberBase.DoDefine): If we're an explicit implementation, the
10941         InterfaceType may be a generic instance.
10942
10943         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10944         (namespace_name): Call MemberName.GetName () to transform the
10945         MemberName into a string and ensure we don't have any type
10946         arguments.
10947         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10948         MemberName into an expression.
10949         (method_header): Use namespace_or_type_name instead of member_name.     
10950
10951 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10952
10953         * rootcontext.cs: Add new types to the boot resolution.
10954
10955         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10956         MulticastDelegate is not allowed.
10957
10958         * typemanager.cs: Add new types to lookup: System.TypedReference
10959         and ArgIterator.
10960
10961         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10962         check for TypedReference or ArgIterator, they are not allowed. 
10963
10964         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10965         makes us properly catch 1510 in some conditions (see bug 56016 for
10966         details). 
10967
10968 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10969
10970         * CryptoConvert.cs: update from corlib version
10971         with endian fixes.
10972
10973 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10974
10975         * class.cs (Indexer.Define): Check indexername declaration
10976
10977 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10978
10979         * attribute.cs (IsClsCompliant): Fixed problem with handling
10980         all three states (compliant, not-compliant, undetected).
10981
10982 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10983
10984         * attribute.cs (Attribute): Location is now public.
10985         (Resolve): Store resolved arguments (pos_values) in attribute class.
10986         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10987         (GetClsCompliantAttributeValue): New method that gets
10988         CLSCompliantAttribute value.
10989         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10990         if exists else null.
10991         (AttributeTester): New class for CLS-Compliant verification routines.
10992
10993         * class.cs (Emit): Add CLS-Compliant verification.
10994         (Method.GetSignatureForError): Implemented.
10995         (Constructor.GetSignatureForError): Implemented
10996         (Constructor.HasCompliantArgs): Returns if constructor has
10997         CLS-Compliant arguments.
10998         (Constructor.Emit): Override.
10999         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11000         is needed to test only parameters.
11001         (FieldBase.GetSignatureForError): Implemented.
11002         (TypeContainer): New member for storing base interfaces.
11003         (TypeContainer.FindMembers): Search in base interfaces too.
11004
11005         * codegen.cs (GetClsComplianceAttribute): New method that gets
11006         assembly or module CLSCompliantAttribute value.
11007         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11008         for assembly.
11009         (ModuleClass.Emit): Add error 3012 test.
11010
11011         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11012
11013         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11014         state for all decl types.
11015         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11016         if CLS-Compliant tests are required.
11017         (IsClsCompliaceRequired): New method. Analyze whether code
11018         must be CLS-Compliant.
11019         (IsExposedFromAssembly): New method. Returns true when MemberCore
11020         is exposed from assembly.
11021         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11022         value or gets cached value.
11023         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11024         is explicitly marked with CLSCompliantAttribute.
11025         (IsIdentifierClsCompliant): New abstract method. This method is
11026         used to testing error 3005.
11027         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11028         for identifier and parameters CLS-Compliant testing.
11029         (VerifyClsCompliance): New method. The main virtual method for
11030         CLS-Compliant verifications.
11031         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11032         null. I don't know why is null (too many public members !).
11033         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11034         and get value of first CLSCompliantAttribute that found.
11035
11036         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11037         (VerifyClsCompliance): Override and add extra tests.
11038
11039         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11040         clscheck- disable CLS-Compliant verification event if assembly is has
11041         CLSCompliantAttribute(true).
11042
11043         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11044         ApllyAttribute is now called in emit section as in the other cases.
11045         Possible future Emit integration.
11046         (IsIdentifierClsCompliant): New override.
11047         (VerifyClsCompliance): New override.
11048         (GetEnumeratorName): Returns full enum name.
11049
11050         * parameter.cs (GetSignatureForError): Implemented.
11051
11052         * report.cs (WarningData): New struct for Warning message information.
11053         (LocationOfPreviousError): New method.
11054         (Warning): New method. Reports warning based on the warning table.
11055         (Error_T): New method. Reports error based on the error table.
11056
11057         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11058         verifications are done here.
11059
11060         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11061
11062         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11063         CLSCompliantAttribute.
11064         (all_imported_types): New member holds all imported types from other
11065         assemblies.
11066         (LoadAllImportedTypes): New method fills static table with exported types
11067         from all referenced assemblies.
11068         (Modules): New property returns all assembly modules.
11069
11070 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11071
11072         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11073         throwing a parser error.
11074
11075         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11076         which removes the hardcoded get_/set_ prefixes for properties, as
11077         IL allows for the properties to be named something else.  
11078
11079         Bug #56013
11080
11081         * expression.cs: Do not override operand before we know if it is
11082         non-null.  Fix 56207
11083
11084 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11085
11086         * typemanager.cs: support for pinned variables.
11087
11088 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11089
11090         * decl.cs, typemanager.cs: Avoid using an arraylist
11091         as a buffer if there is only one result set.
11092
11093 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11094
11095         * expression.cs: Make sure you cant call a static method
11096         with an instance expression, bug #56174.
11097
11098 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11099
11100         * class.cs (IsDuplicateImplementation): Improve error reporting to
11101         flag 663 (method only differs in parameter modifier).
11102
11103         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11104         in preprocessor directives.
11105
11106         * location.cs (LookupFile): Allow for the empty path.
11107
11108         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11109         better approach for some of that patch, but its failing with the
11110         CharSet enumeration.  For now try/catch will do.
11111
11112         * typemanager.cs: Do not crash if a struct does not have fields.
11113         Fixes 56150.
11114
11115 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11116
11117         * expression.cs: cs0213, cant fix a fixed expression.
11118         fixes 50231.
11119
11120 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11121
11122         * cs-parser.jay: detect invalid embeded statements gracefully.
11123         bug #51113.
11124
11125 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11126
11127         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11128         As a regex:
11129         s/
11130         the invocation type may not be a subclass of the tye of the item/
11131         The type of the item must be a subclass of the invocation item.
11132         /g
11133
11134         Fixes bug #50820.
11135
11136 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11137
11138         * attribute.cs: Added methods to get a string and a bool from an
11139         attribute. Required to information from AssemblyKeyFileAttribute,
11140         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11141         * codegen.cs: Modified AssemblyName creation to include support for
11142         strongnames. Catch additional exceptions to report them as CS1548.
11143         * compiler.csproj: Updated include CryptoConvert.cs.
11144         * compiler.csproj.user: Removed file - user specific configuration.
11145         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11146         Mono.Security assembly. The original class is maintained and tested in
11147         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11148         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11149         like CSC 8.0 (C# v2) supports.
11150         * Makefile: Added CryptoConvert.cs to mcs sources.
11151         * rootcontext.cs: Added new options for strongnames.
11152
11153 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11154
11155         * driver.cs: For --expect-error, report error code `2'
11156         if the program compiled with no errors, error code `1' if
11157         it compiled with an error other than the one expected.
11158
11159 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11160
11161         * compiler.csproj: Updated for Visual Studio .NET 2003.
11162         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11163         * compiler.sln: Updated for Visual Studio .NET 2003.
11164
11165 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11166
11167         * expression.cs: Fix bug #47234. We basically need to apply the
11168         rule that we prefer the conversion of null to a reference type
11169         when faced with a conversion to 'object' (csc behaviour).
11170
11171 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11172
11173         * statement.cs: Shorter form for foreach, eliminates
11174         a local variable. r=Martin.
11175
11176 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11177
11178         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11179         checks if we can use brtrue/brfalse to test for 0.
11180         * expression.cs: use the above in the test for using brtrue/brfalse.
11181         cleanup code a bit.
11182
11183 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11184
11185         * expression.cs: Rewrite string concat stuff. Benefits:
11186
11187         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11188         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11189         rather than a concat chain.
11190
11191         * typemanager.cs: Add lookups for more concat overloads.
11192
11193 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11194
11195         * expression.cs: Emit shorter il code for array init.
11196
11197         newarr
11198         dup
11199         // set 1
11200
11201         // set 2
11202
11203         newarr
11204         stloc.x
11205
11206         ldloc.x
11207         // set 1
11208
11209         ldloc.x
11210         // set 2
11211
11212 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11213
11214         * statement.cs: Before, two switch blocks would be merged if the
11215         total size of the blocks (end_item - begin_item + 1) was less than
11216         two times the combined sizes of the blocks.
11217
11218         Now, it will only merge if after the merge at least half of the
11219         slots are filled.
11220
11221         fixes 55885.
11222
11223 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11224
11225         * class.cs : csc build fix for GetMethods(). See bug #52503.
11226
11227 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11228
11229         * expression.cs: Make sure fp comparisons work with NaN.
11230         This fixes bug #54303. Mig approved this patch a long
11231         time ago, but we were not able to test b/c the runtime
11232         had a related bug.
11233
11234 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11235
11236         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11237
11238 2004-03-19  Martin Baulig  <martin@ximian.com>
11239
11240         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11241         two overloads may unify for some type parameter substitutions and
11242         report a CS0408 if appropriate.
11243
11244 2004-03-19  Martin Baulig  <martin@ximian.com>
11245
11246         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11247         error here and not in our caller.
11248
11249 2004-03-19  Martin Baulig  <martin@ximian.com>
11250
11251         * interface.cs: Completely killed this file.
11252         (Interface): We're now a TypeContainer and live in class.cs.
11253
11254         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11255         argument; we're now also called for interfaces.
11256         (TypeContainer.DefineMembers): Allow this method being called
11257         multiple times.
11258         (TypeContainer.GetMethods): New public method; formerly known as
11259         Interface.GetMethod().  This is used by PendingImplementation.
11260         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11261         it's now private and non-static.
11262         (Interface): Moved this here; it's now implemented similar to
11263         Class and Struct.
11264         (Method, Property, Event, Indexer): Added `bool is_interface'
11265         argument to their .ctor's.
11266         (MemberBase.IsInterface): New public field.
11267
11268         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11269         instances instead of InterfaceMethod, InterfaceProperty, etc.
11270         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11271         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11272
11273 2004-03-19  Martin Baulig  <martin@ximian.com>
11274
11275         * class.cs (MethodCore.IsDuplicateImplementation): New private
11276         method which does the CS0111 checking.
11277         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11278         Use IsDuplicateImplementation().
11279
11280 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11281
11282         * decl.cs (FindMemberToOverride): New method to find the correct
11283         method or property to override in the base class.
11284         * class.cs
11285             - Make Method/Property use the above method to find the
11286               version in the base class.
11287             - Remove the InheritableMemberSignatureCompare as it is now
11288               dead code.
11289
11290         This patch makes large code bases much faster to compile, as it is
11291         O(n) rather than O(n^2) to do this validation.
11292
11293         Also, it fixes bug 52458 which is that nested classes are not
11294         taken into account when finding the base class member.
11295
11296         Reviewed/Approved by Martin.
11297
11298 2004-03-17  Martin Baulig  <martin@ximian.com>
11299
11300         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11301         of type arguments into account; use the `real_num_type_args'
11302         approach like in DoResolveAsTypeStep().
11303
11304         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11305         nested types.
11306
11307 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11308
11309         * interface.cs: In all interface classes removed redundant
11310         member initialization.
11311
11312 2004-03-16  Martin Baulig  <martin@ximian.com>
11313
11314         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11315
11316 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11317
11318         * decl.cs (DefineTypeAndParents): New helper method to define a
11319         type's containers before the type itself is defined;  This is a
11320         bug exposed by the recent changes to Windows.Forms when an
11321         implemented interface was defined inside a class that had not been
11322         built yet.   
11323
11324         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11325
11326         (Check): Loop correctly to report errors modifiers
11327         (UNSAFE was not in the loop, since it was the same as TOP).
11328
11329         * interface.cs: Every interface member now takes a ModFlags,
11330         instead of a "is_new" bool, which we set on the base MemberCore. 
11331
11332         Every place where we called "UnsafeOk" in the interface, now we
11333         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11334         the unsafe settings from the member declaration instead of the
11335         container interface. 
11336
11337         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11338
11339         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11340         `set_indexer_name' to the pending bits (one per type).
11341
11342         We fixed a bug today that was picking the wrong method to
11343         override, since for properties the existing InterfaceMethod code
11344         basically ignored the method name.  Now we make sure that the
11345         method name is one of the valid indexer names.
11346
11347 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11348  
11349         * support.cs (SeekableStreamReader): Keep track of stream byte
11350         positions and don't mix them with character offsets to the buffer.
11351
11352         Patch from Gustavo Giráldez
11353
11354 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11355
11356         * interface.cs (InterfaceSetGetBase): Removed double member
11357         initialization, base class does it as well.
11358
11359 2004-03-13  Martin Baulig  <martin@ximian.com>
11360
11361         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11362         when compiling corlib.
11363
11364 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11365
11366         * convert.cs (ExplicitConversion): We were reporting an error on
11367         certain conversions (object_type source to a value type, when the
11368         expression was `null') before we had a chance to pass it through
11369         the user defined conversions.
11370
11371         * driver.cs: Replace / and \ in resource specifications to dots.
11372         Fixes 50752
11373
11374         * class.cs: Add check for duplicate operators.  Fixes 52477
11375
11376 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11377
11378         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11379         that are in the middle of the statements, not only at the end.
11380         Fixes #54987
11381
11382         * class.cs (TypeContainer.AddField): No longer set the
11383         `HaveStaticConstructor' flag, now we call it
11384         `UserDefineStaticConstructor' to diferentiate the slightly
11385         semantic difference.
11386
11387         The situation is that we were not adding BeforeFieldInit (from
11388         Modifiers.TypeAttr) to classes that could have it.
11389         BeforeFieldInit should be set to classes that have no static
11390         constructor. 
11391
11392         See:
11393
11394         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11395
11396         And most importantly Zoltan's comment:
11397
11398         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11399
11400         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11401          before its static fields are used', i.e. initialization does not need
11402          to be triggered by the first access to the type. Setting this flag
11403          helps the JIT to compile better code, since it can run the static
11404          constructor at JIT time, and does not need to generate code to call it
11405          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11406          this flag for lots of classes like String. 
11407          
11408          csc sets this flag if the type does not have an explicit static 
11409          constructor. The reasoning seems to be that if there are only static
11410          initalizers for a type, and no static constructor, then the programmer
11411          does not care when this initialization happens, so beforefieldinit
11412          can be used.
11413          
11414          This bug prevents the AOT compiler from being usable, since it 
11415          generates so many calls to mono_runtime_class_init that the AOT code
11416          is much slower than the JITted code. The JITted code is faster, 
11417          because it does not generate these calls if the vtable is type is
11418          already initialized, which is true in the majority of cases. But the
11419          AOT compiler can't do this."
11420
11421 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11422
11423         * class.cs (MethodData.Emit): Refactor the code so symbolic
11424         information is generated for destructors;  For some reasons we
11425         were taking a code path that did not generate symbolic information
11426         before. 
11427
11428 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11429
11430         * class.cs: Create a Constructor.CheckBase method that
11431         takes care of all validation type code. The method
11432         contains some code that was moved from Define.
11433
11434         It also includes new code that checks for duplicate ctors.
11435         This fixes bug #55148.
11436
11437 2004-03-09  Joshua Tauberer <tauberer@for.net>
11438
11439         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11440         a { ... }-style array creation invokes EmitStaticInitializers
11441         which is not good for reference-type arrays.  String, decimal
11442         and now null constants (NullCast) are not counted toward
11443         static initializers.
11444
11445 2004-03-05  Martin Baulig  <martin@ximian.com>
11446
11447         * location.cs (SourceFile.HasLineDirective): New public field;
11448         specifies whether the file contains or is referenced by a "#line"
11449         directive.
11450         (Location.DefineSymbolDocuments): Ignore source files which
11451         either contain or are referenced by a "#line" directive.        
11452
11453 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11454
11455         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11456         direct access to our parent, so check the method inline there.
11457
11458 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11459
11460         * expression.cs (Invocation.EmitCall): Miguel's last commit
11461         caused a regression. If you had:
11462
11463             T t = null;
11464             t.Foo ();
11465
11466         In Foo the implict this would be null.
11467
11468 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11469
11470         * expression.cs (Invocation.EmitCall): If the method is not
11471         virtual, do not emit a CallVirt to it, use Call.
11472
11473         * typemanager.cs (GetFullNameSignature): Improve the method to
11474         cope with ".ctor" and replace it with the type name.
11475
11476         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11477         as an argument the ConstructorBuilder where it is being defined,
11478         to catch the recursive constructor invocations.
11479
11480 2004-03-16  Martin Baulig  <martin@ximian.com>
11481
11482         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11483         ConstructedType, call ResolveType() on it to get the type rather
11484         than just using `expr.Type'.
11485
11486 2004-03-16  Martin Baulig  <martin@ximian.com>
11487
11488         * generics.cs (ConstructedType.GetMemberAccess): Take the
11489         EmitContext instead on the TypeExpr and use
11490         ec.TypeContainer.CurrentType/ec.ContainerType.
11491
11492 2004-03-16  Martin Baulig  <martin@ximian.com>
11493
11494         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11495         parameters before aliases.
11496
11497 2004-03-16  Martin Baulig  <martin@ximian.com>
11498
11499         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11500         New oublic function; checks whether two generic instances may become
11501         equal under some instantiations (26.3.1).
11502
11503         * class.cs (TypeContainer.Define): Call
11504         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11505         error.
11506
11507 2004-03-16  Martin Baulig  <martin@ximian.com>
11508
11509         * class.cs (TypeContainer.GetClassBases): Moved
11510         Error_TypeParameterAsBase() here and also check whether the base
11511         class is not an attribute.
11512
11513 2004-03-16  Martin Baulig  <martin@ximian.com>
11514
11515         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11516
11517 2004-03-16  Martin Baulig  <martin@ximian.com>
11518
11519         * class.cs (Error_TypeParameterAsBase): Use correct error number
11520         here (CS0689).  
11521
11522 2004-03-16  Martin Baulig  <martin@ximian.com>
11523
11524         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11525         for generics.
11526
11527         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11528         error reporting.
11529
11530 2004-03-15  Martin Baulig  <martin@ximian.com>
11531
11532         * typemanager.cs (TypeManager.GetFullName): New public method.
11533         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11534         argument; only return members with the correct number of type
11535         arguments.
11536         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11537         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11538         whether the number of type arguments matches.
11539
11540         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11541         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11542
11543         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11544         field; it's set by the protected .ctor when we're actually a
11545         GenericMemberAccess.
11546         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11547         arguments and pass it to MemberLookupFinal ().
11548
11549         * ecore.cs (Expression.MemberLookup): Added `int
11550         num_type_arguments' argument; only return members with the correct
11551         number of type arguments.
11552         (Expression.MemberLookupFailed): Check whether the MemberLookup
11553         failed because we did not have the correct number of type
11554         arguments; report CS0305 in this case.
11555
11556         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11557         `e.ResolveAsTypeTerminal()' already did so.
11558
11559 2004-03-15  Martin Baulig  <martin@ximian.com>
11560
11561         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11562         we're a ConstructedType; in this case, the caller must report an
11563         error (for instance CS0131).
11564
11565         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11566         (TypeArguments.Resolve): Actually report errors here.
11567
11568 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11569
11570         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11571         `set_indexer_name' to the pending bits (one per type).
11572
11573         We fixed a bug today that was picking the wrong method to
11574         override, since for properties the existing InterfaceMethod code
11575         basically ignored the method name.  Now we make sure that the
11576         method name is one of the valid indexer names.
11577
11578 2004-03-15  Martin Baulig  <martin@ximian.com>
11579
11580         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11581         for generic instances.
11582
11583 2004-03-13  Martin Baulig  <martin@ximian.com>
11584
11585         * class.cs (TypeContainer.DefineType): Call
11586         TypeManager.AddUserType() immediately after creating the
11587         TypeBuilder; pass all type parameters when creating the
11588         CurrentType.
11589
11590         * decl.cs (DeclSpace.FindNestedType): New public method.
11591         (DeclSpace.FindType): Added `int num_type_args' argument; only
11592         return types with the correct number of type parameters.
11593         (DeclSpace.CountTypeParams): New public property.
11594
11595         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11596         the number of type parameters; defaults to zero.
11597
11598         * generic.cs (TypeArguments.Count): New public property.
11599         (ConstructedType.DoResolveAsTypeStep): First call
11600         ds.FindNestedType() to find out whether we're nested in the
11601         current generic type; in this case, we inherit all type parameters
11602         from the current class.
11603
11604         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11605         num_type_args' argument.
11606         (RootContext.LookupType): Added overloaded version which takes the
11607         number of type arguments; only return types with the correct
11608         number of type arguments.
11609
11610         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11611         checks whether `Type t' has `int num_type_args'.
11612
11613 2004-03-13  Martin Baulig  <martin@ximian.com>
11614
11615         * generic.cs (GenericMethod.DefineType): New method; calls
11616         DefineType() on all the type parameters.
11617
11618         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11619         (MethodData.Define): If we're a generic method, call
11620         GenericMethod.DefineType() to define the type parameters.       
11621
11622 2004-03-10  Martin Baulig  <martin@ximian.com>
11623
11624         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11625         instead of IsAssignableFrom.    
11626
11627 2004-03-10  Martin Baulig  <martin@ximian.com>
11628
11629         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11630
11631         * support.cs (ParameterData.HasArrayParameter): New property.
11632         (ReflectionParameters.ctor): Take a MethodBase instead of a
11633         ParameterInfo[].  If we have any type parameters, get the generic
11634         method definition and ask it whether we have variable arguments.
11635
11636 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11637
11638         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11639         routines to check if a type is an enumerable/enumerator allow
11640         classes that implement the IEnumerable or IEnumerator interfaces.
11641
11642         * class.cs (Property, Operator): Implement IIteratorContainer, and
11643         implement SetYields.
11644
11645         (Property.Define): Do the block swapping for get_methods in the
11646         context of iterators.   We need to check if Properties also
11647         include indexers or not.
11648
11649         (Operator): Assign the Block before invoking the
11650         OperatorMethod.Define, so we can trigger the Iterator code
11651         replacement. 
11652
11653         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11654         Property and Operator classes are not created when we parse the
11655         declarator but until we have the block completed, so we use a
11656         singleton SimpleIteratorContainer.Simple to flag whether the
11657         SetYields has been invoked.
11658
11659         We propagate this setting then to the Property or the Operator to
11660         allow the `yield' to function.
11661
11662 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11663
11664         * codegen.cs: Implemented attribute support for modules.
11665         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11666         Assembly/Module functionality.
11667
11668         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11669         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11670         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11671
11672 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11673
11674         * interface.cs (FindMembers): The operation is performed on all base
11675         interfaces and not only on the first. It is required for future CLS Compliance patch.
11676
11677 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11678
11679         * statement.cs, codegen.cs:
11680         This patch deals with patterns such as:
11681
11682         public class List : IEnumerable {
11683
11684                 public MyEnumerator GetEnumerator () {
11685                         return new MyEnumerator(this);
11686                 }
11687
11688                 IEnumerator IEnumerable.GetEnumerator () {
11689                         ...
11690                 }
11691                 
11692                 public struct MyEnumerator : IEnumerator {
11693                         ...
11694                 }
11695         }
11696
11697         Before, there were a few things we did wrong:
11698         1) we would emit callvirt on a struct, which is illegal
11699         2) we emited ldarg when we needed to emit ldarga
11700         3) we would mistakenly call the interface methods on an enumerator
11701         type that derived from IEnumerator and was in another assembly. For example:
11702
11703         public class MyEnumerator : IEnumerator
11704
11705         Would have the interface methods called, even if there were public impls of the
11706         method. In a struct, this lead to invalid IL code.
11707
11708 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11709
11710         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11711           renamed to Emit.
11712
11713         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11714
11715 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11716
11717         * cs-parser.jay: Fix small regression: we were not testing V2
11718         compiler features correctly.
11719
11720         * interface.cs: If the emit context is null, then create one
11721
11722 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11723
11724         * decl.cs (GetSignatureForError): New virtual method to get full name
11725           for error messages.
11726
11727         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11728           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11729
11730         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11731           Duplicated members and code in these classes has been removed.
11732           Better encapsulation in these classes.
11733
11734 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11735
11736         * assign.cs (Assign.DoResolve): When dealing with compound
11737         assignments, there is a new rule in ECMA C# 2.4 (might have been
11738         there before, but it is documented here) that states that in:
11739
11740         a op= b;
11741
11742         If b is of type int, and the `op' is a shift-operator, then the
11743         above is evaluated as:
11744
11745         a = (int) a op b 
11746
11747         * expression.cs (Binary.ResolveOperator): Instead of testing for
11748         int/uint/long/ulong, try to implicitly convert to any of those
11749         types and use that in pointer arithmetic.
11750
11751         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11752         method to print information for from the type, not from the
11753         null-method we were given.
11754
11755 2004-02-01  Duncan Mak  <duncan@ximian.com>
11756
11757         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11758         parsing for cmd, fixes bug #53694.
11759
11760 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11761
11762         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11763         in the member name duplication tests. Property and operator name duplication
11764         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11765
11766 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11767
11768         * interface.cs (PopulateMethod): Fixed crash when interface method
11769         returns not existing type (error test cs0246-3.cs).
11770
11771 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11772
11773         * cs-parser.jay (interface_accessors): Re-write actions to also
11774         store attributes attached to get and set methods. Fix spelling
11775         while at it.
11776
11777         (inteface_property_declaration): Modify accordingly.
11778
11779         (InterfaceAccessorInfo): New helper class to store information to pass
11780         around between rules that use interface_accessors.
11781
11782         * interface.cs (Emit): Apply attributes on the get and set
11783         accessors of properties and indexers too.
11784
11785         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11786         right MethodBuilder when applying attributes to the get and set accessors.
11787
11788 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11789
11790         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11791
11792 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11793
11794         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11795
11796 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11797
11798         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11799         changes that treat `yield' specially when present before `break'
11800         or `return' tokens.
11801
11802         * cs-tokenizer.cs: yield is no longer a keyword.
11803
11804 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11805
11806         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11807         setting for default constructors.
11808         For default constructors are almost every time set wrong Modifier. The
11809         generated IL code has been alright. But inside mcs this values was
11810         wrong and this was reason why several of my CLS Compliance tests
11811         failed.
11812
11813 2004-02-27  Martin Baulig  <martin@ximian.com>
11814
11815         * generics.cs (ConstructedType.ResolveType): Make the nested type
11816         stuff actually work.
11817
11818 2004-02-25  Martin Baulig  <martin@ximian.com>
11819
11820         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11821         property; returns the type parameters just from the current type,
11822         ie. with the ones from outer classes.
11823         (DeclSpace.LookupGeneric): First search in the current class, then
11824         in outer classes.
11825         (DeclSpace.initialize_type_params): When hiding a type parameter
11826         from an outer class, put it into the `type_param_list' anyways.
11827
11828         * expression.cs (MemberAccess.expr): Made this field protected.
11829
11830         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11831         the type parameters from the current class.
11832
11833         * generic.cs (ConstructedType.ResolveType): Support nested generic
11834         types by taking the type parameters which we inherit from outer
11835         classes into account.
11836         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11837         support for nested generic types.
11838
11839 2004-02-23  Martin Baulig  <martin@ximian.com>
11840
11841         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11842         field and check whether we're nested inside a generic type.
11843         (DeclSpace.ResolveType): If we're resolving to a generic type
11844         definition, create a ConstructedType and return its resolved type.
11845         (DeclSpace.initialize_type_params): New private method;
11846         initializes the `type_param_list' field from the type parameters
11847         from this and all enclosing classes.
11848         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11849         we're already initialized.
11850
11851 2004-02-23  Martin Baulig  <martin@ximian.com>
11852
11853         * class.cs (Method.Define): Create the generic method before
11854         calling DoDefine().
11855         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11856         the TypeContainer one); we use this for generic methods.
11857
11858         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11859         parent's TypeBuilder.
11860
11861 2004-02-18  Martin Baulig  <martin@ximian.com>
11862
11863         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11864         to check for equality.
11865
11866 2004-02-05  Martin Baulig  <martin@ximian.com>
11867
11868         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11869         `ec.TypeContainer.CurrentType', use it instead of
11870         `ec.ContainerType' to check whether we're in the type's ctor.
11871
11872 2004-01-29  Martin Baulig  <martin@ximian.com>
11873
11874         * expression.cs (Invocation.DoResolve): If we're a
11875         `ConstructedType', then we're actually a generic method, so
11876         rewrite the expr as a GenericMemberAccess.
11877
11878         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11879         here; manually parse it into a string.
11880
11881 2004-01-28  Martin Baulig  <martin@ximian.com>
11882
11883         * typemanager.cs (TypeManager.IsEqual): New static method.
11884         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11885         check for equality instead of using `=='.
11886
11887 2004-01-26  Martin Baulig  <martin@ximian.com>
11888
11889         * decl.cs (DeclSpace.CurrentType): New public field.
11890
11891         * expression.cs (This.ResolveBase): If we have an
11892         `ec.TypeContainer.CurrentType', use it instead of
11893         `ec.ContainerType'.
11894
11895         * class.cs (TypeContainer.DefineType): If we're a generic type,
11896         create the `CurrentType' (unresolved).
11897         (TypeContainer.GenericType): New private field.
11898         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11899         it and store it in `GenericType' before creating the MemberCache.
11900         (TypeContainer.GetMembers): If we have a `GenericType', call
11901         TypeManager.FindMembers() on it.
11902
11903         * interface.cs (Interface.GenericType): New private field.
11904         (Interface.DefineType): If we're a generic type, create the
11905         `CurrentType' (unresolved).
11906         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11907         and store it in `GenericType' before creating the MemberCache.
11908         (Interface.GetMembers): If we have a `GenericType', call
11909         TypeManager.FindMembers() on it.
11910
11911 2004-01-22  Martin Baulig  <martin@ximian.com>
11912
11913         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11914         not a QualifiedIdentifier.  This is what `type_name_expression'
11915         was previously doing.
11916         (type_name_expression): Removed; the code is now in
11917         `namespace_or_type_name'.
11918         (qualified_identifier): Removed, use `namespace_or_type_name'
11919         instead.
11920         (QualifiedIdentifier): Removed this class.      
11921
11922 2004-01-22  Martin Baulig  <martin@ximian.com>
11923
11924         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11925         not a string as alias name.
11926
11927 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11928
11929         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11930         #52730 bug, and instead compute correctly the need to use a
11931         temporary variable when requesting an address based on the
11932         static/instace modified of the field and the constructor.
11933  
11934 2004-01-21  Martin Baulig  <martin@ximian.com>
11935
11936         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11937         class and namespace before looking up aliases.  Fixes #52517.
11938
11939 2004-01-21  Martin Baulig  <martin@ximian.com>
11940
11941         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11942         assinged in a 'try'; fixes exception4.cs.
11943
11944 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11945         * class.cs : Implemented parameter-less constructor for TypeContainer
11946
11947         * decl.cs: Attributes are now stored here. New property OptAttributes
11948
11949         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11950
11951         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11952
11953 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11954
11955         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11956           (CSharpSignature): New method for indexer and property signature.
11957
11958 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11959
11960         * pending.cs (IsVirtualFilter): Faster implementation.
11961
11962 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11963
11964         * typemanager.cs: Avoid inclusion of same assembly more than once.
11965
11966 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11967
11968         * cs-parser.jay: Fixed problem where the last assembly attribute
11969           has been applied also to following declaration (class, struct, etc.)
11970           
11971 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11972
11973         * class.cs: Added error CS0538, CS0539 reporting.
11974         Fixed crash on Microsoft runtime when field type is void.
11975
11976         * cs-parser.jay: Added error CS0537 reporting.
11977
11978         * pending.cs: Added error CS0535 reporting.
11979         Improved error report for errors CS0536, CS0534.
11980
11981 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11982
11983         Merge a few bits from the Anonymous Method MCS tree.
11984
11985         * statement.cs (ToplevelBlock): New class for toplevel methods,
11986         will hold anonymous methods, lifted variables.
11987
11988         * cs-parser.jay: Create toplevel blocks for delegates and for
11989         regular blocks of code. 
11990
11991 2004-01-20  Martin Baulig  <martin@ximian.com>
11992
11993         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11994         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11995         and `NeedExplicitReturn'; added `IsLastStatement'.
11996         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11997         have a `ReturnLabel' or we're not unreachable.
11998
11999         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12000         child's reachability; don't just override ours with it.  Fixes
12001         #58058 (lluis's example).
12002         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12003         InFinally(), InLoop(), InSwitch() and
12004         BreakCrossesTryCatchBoundary() methods.
12005
12006         * statement.cs (Return): Do all error checking in Resolve().
12007         Unless we are the last statement in a top-level block, always
12008         create a return label and jump to it.
12009         (Break, Continue): Do all error checking in Resolve(); also make
12010         sure we aren't leaving a `finally'.
12011         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12012         statement in a top-level block.
12013         (Block.Flags): Added `IsDestructor'.
12014         (Block.IsDestructor): New public property.
12015
12016 2004-01-20  Martin Baulig  <martin@ximian.com>
12017
12018         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12019
12020 2004-01-20  Martin Baulig  <martin@ximian.com>
12021
12022         * statement.cs (Statement.ResolveUnreachable): New public method.
12023         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12024         (Block.Resolve): Resolve unreachable statements.
12025
12026 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12027
12028         * expression.cs: We need to fix the case where we do
12029         not have a temp variable here.
12030
12031         * assign.cs: Only expression compound assignments need
12032         temporary variables.
12033
12034 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12035
12036         * flowanalysis.cs: Reduce memory allocation in a few ways:
12037           - A block with no variables should not allocate a bit
12038             vector for itself.
12039           - A method with no out parameters does not need any tracking
12040             for assignment of the parameters, so we need not allocate
12041             any data for it.
12042           - The arrays:
12043                 public readonly Type[] VariableTypes;
12044                 public readonly string[] VariableNames;
12045             Are redundant. The data is already stored in the variable
12046             map, so we need not allocate another array for it.
12047           - We need to add alot of checks for if (params | locals) == null
12048             due to the first two changes.
12049
12050 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12051
12052         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12053         implement IMemoryLocation, we store a copy on a local variable and
12054         take the address of it.  Patch from Benjamin Jemlich
12055
12056         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12057         to use a special "type_name_expression" rule which reduces the
12058         number of "QualifiedIdentifier" classes created, and instead
12059         directly creates MemberAccess expressions.
12060
12061 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12062
12063         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12064         that fixes #52853.  Null literal assignment to ValueType
12065
12066         * class.cs (MethodData.Emit): Instead of checking the name of the
12067         method to determine if its a destructor, create a new derived
12068         class from Method called Destructor, and test for that.  
12069
12070         * cs-parser.jay: Create a Destructor object instead of a Method.  
12071
12072         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12073
12074         Fixes: 52933
12075
12076 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12077
12078         * expression.cs (Binary.ResolveOperator): Perform an implicit
12079         conversion from MethodGroups to their delegate types on the
12080         Addition operation.
12081
12082         * delegate.cs: Introduce a new class DelegateCreation that is the
12083         base class for `NewDelegate' and `ImplicitDelegateCreation',
12084         factor some code in here.
12085
12086         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12087         conversion from MethodGroups to compatible delegate types. 
12088
12089         * ecore.cs (Expression.Resolve): Do not flag error 654
12090         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12091         we allow conversions from MethodGroups to delegate types now.
12092
12093         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12094         assignments in v2 either.
12095
12096 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12097
12098         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12099         static read-only fields in ctors.
12100
12101         Applied patch from Benjamin Jemlich 
12102
12103         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12104
12105 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12106
12107         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12108         here to return true, as they can be used like this:
12109
12110                 (XXX) int.MEMBER ()
12111
12112         Fixed 49836 and all the other dups
12113
12114 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12115
12116         * driver.cs: Implement /win32res and /win32icon.
12117
12118 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12119
12120         * cs-parser.jay: Add a rule to improve error handling for the
12121         common mistake of placing modifiers after the type.
12122
12123 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12124
12125         * cs-parser.jay (interface_event_declaration): Catch
12126         initialization of events on interfaces, and report cs0068
12127
12128         * cs-parser.jay (interface_event_declaration): Catch
12129         initialization of events. 
12130
12131         * ecore.cs: Better report missing constructors.
12132
12133         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12134         the error reporting done in the wrong place.  Fix.
12135
12136         * expression.cs (Binary.ResolveOperator): Catch the 
12137         operator + (E x, E y) error earlier, and later allow for implicit
12138         conversions in operator +/- (E e, U x) from U to the underlying
12139         type of E.
12140
12141         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12142         52596, if the container class is abstract, the default constructor
12143         is protected otherwise its public (before, we were always public).
12144
12145         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12146         fixed statement.
12147
12148         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12149         Jemlich that fixes bug #52597, MCS was generating invalid code for
12150         idisposable structs.   Thanks to Ben for following up with this
12151         bug as well.
12152
12153 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12154
12155         * driver.cs: Allow assemblies without code to be generated, fixes
12156         52230.
12157
12158 2004-01-07  Nick Drochak <ndrochak@gol.com>
12159
12160         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12161
12162 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * cs-parser.jay: Add rules to improve error reporting if fields or
12165         methods are declared at the namespace level (error 116)
12166
12167         * Add rules to catch event add/remove
12168
12169 2004-01-04  David Sheldon <dave-mono@earth.li>
12170
12171   * expression.cs: Added matching ")" to error message for 
12172   CS0077
12173
12174 2004-01-03 Todd Berman <tberman@gentoo.org>
12175
12176         * ecore.cs, attribute.cs:
12177         Applying fix from #52429.
12178
12179 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12180
12181         * ecore.cs, expression.cs, statement.cs:
12182         Total rewrite of how we handle branching. We
12183         now handle complex boolean expressions with fewer
12184         jumps. As well if (x == 0) no longer emits a ceq.
12185
12186         if (x is Foo) is much faster now, because we generate
12187         better code.
12188
12189         Overall, we get a pretty big improvement on our benchmark
12190         tests. The code we generate is smaller and more readable.
12191
12192         I did a full two-stage bootstrap. The patch was reviewed
12193         by Martin and Miguel.
12194
12195 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12196
12197         * cs-parser.jay: Make primary_expression not take a QI.
12198         we dont need this because the member_access rule covers
12199         us here. So we replace the rule with just IDENTIFIER.
12200
12201         This has two good effects. First, we remove a s/r conflict.
12202         Second, we allocate many fewer QualifiedIdentifier objects.
12203
12204 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12205
12206         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12207         set the correct information via SRE. This prevents
12208         hanging on the MS runtime. Fixes #29374.
12209
12210 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12211
12212         * convert.cs: correctly handle conversions to value types
12213         from Enum and ValueType as unboxing conversions.
12214
12215         Fixes bug #52569. Patch by Benjamin Jemlich.
12216
12217 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12218
12219         * expression.cs (BetterConversion): Prefer int -> uint
12220         over int -> ulong (csc's behaviour). This fixed bug #52046.
12221
12222 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12223
12224         * decl.cs (MemberCache.FindMembers): now returns a
12225         MemberInfo [].
12226
12227         * typemanager.cs: In general, go with with ^^.
12228         (CopyNewMethods): take an IList.
12229         (RealMemberLookup): Only allocate an arraylist
12230         if we copy from two sets of methods.
12231
12232         This change basically does two things:
12233         1) Fewer array lists allocated due to CopyNewMethods.
12234         2) the explicit cast in MemberList costed ALOT.
12235
12236 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12237
12238         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12239         a hashtable to avoid needless string allocations when an identifier is
12240         used more than once (the common case).
12241
12242 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12243
12244         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12245         is broken, it will not return anything. So, we
12246         have to use the information we have in mcs to
12247         do the task.
12248
12249         * typemanager.cs: Add a cache for GetInterfaces,
12250         since this will now be used more often (due to ^^)
12251
12252         (GetExplicitInterfaces) New method that gets the
12253         declared, not effective, interfaces on a type
12254         builder (eg, if you have interface IFoo, interface
12255         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12256         { IBar }.
12257
12258         This patch makes MCS able to bootstrap itself on
12259         Windows again.
12260
12261 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12262
12263         * expression.cs: Remove the Nop's that Miguel put
12264         in by mistake.
12265
12266 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12267
12268         * report.cs, codegen.cs: Give the real stack trace to
12269         the error when an exception is thrown.
12270
12271 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12272
12273         * decl.cs: only allocate hashtables for ifaces if 
12274         it is an iface!
12275
12276 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12277
12278         * expression.cs: fix the error from cs0121-2.cs
12279         (a parent interface has two child interfaces that
12280         have a function with the same name and 0 params
12281         and the function is called through the parent).
12282
12283 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12284
12285         * class.cs, rootcontext.cs, typmanager.cs: do not
12286         leak pointers.
12287
12288 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12289
12290         * codegen.cs: remove stack for the ec flow branching.
12291         It is already a linked list, so no need.
12292
12293 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12294
12295         * Makefile: Allow custom profiler here.
12296
12297 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12298
12299         * typemanager.cs (LookupType):
12300           - Use a static char [], because split takes
12301             a param array for args, so it was allocating
12302             every time.
12303           - Do not store true in a hashtable, it boxes.
12304
12305 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12306
12307         * flowanalysis.cs: bytify common enums.
12308
12309 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12310
12311         * modifiers.cs: Add a new set of flags for the
12312         flags allowed on explicit interface impls.
12313         * cs-parser.jay: catch the use of modifiers in
12314         interfaces correctly.
12315         * class.cs: catch private void IFoo.Blah ().
12316
12317         All related to bug #50572.
12318
12319 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12320
12321         * decl.cs: Rewrite the consistant accessability checking.
12322         Accessability is not linear, it must be implemented in
12323         a tableish way. Fixes #49704.
12324
12325 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12326
12327         * expression.cs: Handle negation in a checked context.
12328         We must use subtraction from zero. Fixes #38674.
12329
12330 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12331
12332         * class.cs: Ignore static void main in DLLs.
12333         * rootcontext.cs: Handle the target type here,
12334         since we are have to access it from class.cs
12335         * driver.cs: account for the above.
12336
12337 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12338
12339         * report.cs: Give line numbers and files if available.
12340
12341 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12342
12343         * driver.cs: Implement /addmodule.
12344
12345         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12346         ModuleBuilders.
12347
12348 2003-12-20  Martin Baulig  <martin@ximian.com>
12349
12350         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12351         (FieldBase.IsAssigned): Removed this field.
12352         (FieldBase.SetAssigned): New public method.
12353         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12354
12355 2003-12-20  Martin Baulig  <martin@ximian.com>
12356
12357         * expression.cs (LocalVariableReference.DoResolve): Don't set
12358         `vi.Used' if we're called from DoResolveLValue().
12359
12360         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12361         returns the usage vector it just merged into the current one -
12362         pass this one to UsageWarning().
12363         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12364         of the `EmitContext', don't call this recursively on our children.
12365
12366 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12367
12368         * driver.cs: Implement /target:module.
12369
12370 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12371
12372         * support.cs (CharArrayHashtable): New helper class.
12373
12374         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12375         char arrays, not strings, so we can avoid creating a string in
12376         consume_identifier if the identifier is a keyword.
12377
12378 2003-12-16  Martin Baulig  <martin@ximian.com>
12379
12380         * statement.cs (LocalInfo.Assigned): Removed this property.
12381         (LocalInfo.Flags): Removed `Assigned'.
12382         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12383         and uses flow analysis.
12384         (Block.UsageWarning): Made this method private.
12385         (Block.Resolve): Call UsageWarning() if appropriate.
12386
12387         * expression.cs (LocalVariableReference.DoResolve): Always set
12388         LocalInfo.Used here.
12389
12390 2003-12-13  Martin Baulig  <martin@ximian.com>
12391
12392         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12393         any value here; we're now using flow analysis to figure out
12394         whether a statement/block returns a value.
12395
12396 2003-12-13  Martin Baulig  <martin@ximian.com>
12397
12398         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12399         working again.
12400         (FlowBranching.MergeFinally): Don't call
12401         `branching.CheckOutParameters()' here, this is called in
12402         MergeTopBlock().
12403         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12404         when adding the `finally' vector.       
12405
12406 2003-12-13  Martin Baulig  <martin@ximian.com>
12407
12408         * flowanalysis.cs
12409         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12410         actually work and also fix #48962.
12411
12412 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12413
12414         * decl.cs: Do not check System.Object for nested types,
12415         since we know it does not have any. Big bang for buck:
12416
12417         BEFORE:
12418            Run 1:   8.35 seconds
12419            Run 2:   8.32 seconds
12420            corlib:  17.99 seconds
12421         AFTER:
12422            Run 1:   8.17 seconds
12423            Run 2:   8.17 seconds
12424            corlib:  17.39 seconds
12425
12426 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12427
12428         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12429         time we are returning 0 members, so we save alot here.
12430
12431 2003-12-11  Martin Baulig  <martin@ximian.com>
12432
12433         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12434         `MergeChild()', also just take the `FlowBranching' as argument;
12435         call Merge() on it and return the result.
12436         (FlowBranching.Merge): We don't need to do anything if we just
12437         have one sibling.
12438
12439 2003-12-11  Martin Baulig  <martin@ximian.com>
12440
12441         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12442         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12443         Maurer for this idea.
12444
12445 2003-12-11  Martin Baulig  <martin@ximian.com>
12446
12447         * flowanalysis.cs (MergeResult): This class is now gone; we now
12448         use the `UsageVector' for this.  The reason for this is that if a
12449         branching just has one sibling, we don't need to "merge" them at
12450         all - that's the next step to do.
12451         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12452         `MergeResult'.
12453
12454 2003-12-11  Martin Baulig  <martin@ximian.com>
12455
12456         Reworked flow analyis and made it more precise and bug-free.  The
12457         most important change is that we're now using a special `Reachability'
12458         class instead of having "magic" meanings of `FlowReturns'.  I'll
12459         do some more cleanups and optimizations and also add some more
12460         documentation this week.
12461
12462         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12463         largely reworked this class.
12464         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12465         the new `Reachability' class instead of having "magic" values here.
12466         (FlowBranching): We're now using an instance of `Reachability'
12467         instead of having separate `Returns', `Breaks' etc. fields.
12468
12469         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12470         based on flow analysis; ignore the return value of block.Emit ().
12471
12472 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12473
12474         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12475         if they are private.
12476
12477 2003-12-09  Martin Baulig  <martin@ximian.com>
12478
12479         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12480         call them directly on the UsageVector.
12481
12482 2003-12-09  Martin Baulig  <martin@ximian.com>
12483
12484         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12485         Changed return type from `FlowReturns' to `Reachability'.
12486
12487 2003-12-09  Martin Baulig  <martin@ximian.com>
12488
12489         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12490         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12491         `Reachable' fields with a single `Reachability' one.
12492
12493 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12494
12495         * class.cs (FindMembers): Remove foreach's.
12496
12497         Bootstrap times:
12498
12499         BEFORE
12500                 Run 1:   8.74 seconds
12501                 Run 2:   8.71 seconds
12502
12503         AFTER
12504                 Run 1:   8.64 seconds
12505                 Run 2:   8.58 seconds
12506
12507
12508 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12509
12510         * cs-parser.jay:
12511         * gen-treedump.cs:
12512         * statement.cs:
12513         This patch does a few things:
12514                 1. EmptyStatement is now a singleton, so it is never reallocated.
12515                 2. All blah is EmptyStatement constructs have been changed to
12516                    blah == EmptyStatement.Value, which is much faster and valid
12517                    now that EmptyStatement is a singleton.
12518                 3. When resolving a block, rather than allocating a new array for
12519                    the non-empty statements, empty statements are replaced with
12520                    EmptyStatement.Value
12521                 4. Some recursive functions have been made non-recursive.
12522         Mainly the performance impact is from (3), however (1) and (2) are needed for
12523         this to work. (4) does not make a big difference in normal situations, however
12524         it makes the profile look saner.
12525
12526         Bootstrap times:
12527
12528         BEFORE
12529         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12530         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12531         Total memory allocated: 56397 KB
12532
12533         AFTER
12534         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12535         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12536         Total memory allocated: 55666 KB
12537
12538 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12539
12540         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12541         than the hashtable in a hashtable version
12542
12543         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12544         we always end up concating a string. This results in a huge perf
12545         loss, because many strings have to be tracked by the GC. In this
12546         patch, we first use a hashtable that works with two keys, so that
12547         the strings do not need to be concat'ed.
12548
12549         Bootstrap times:
12550         BEFORE
12551                 Run 1:   8.74 seconds
12552                 Run 2:   8.71 seconds
12553
12554         AFTER
12555                 Run 1:   8.65 seconds
12556                 Run 2:   8.56 seconds
12557
12558 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12559
12560         * Makefile: Add a new target `do-time' that does a quick and simple
12561         profile, leaving easy to parse output.
12562
12563 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12564
12565         * codegen.cs (Init): Create the dynamic assembly with 
12566         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12567
12568 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12569
12570         * support.cs: Make the PtrHashtable use only one
12571         instance of its comparer.
12572
12573 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12574
12575         * typemanager.cs: Fix lookup of GetNamespaces.
12576
12577 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12578
12579         * expression.cs: Removed redundant line.
12580
12581         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12582         ArrayLists, use for loops with bounds.  
12583
12584         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12585         arraylist.
12586
12587         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12588         arraylists, use for loop with bounds.
12589
12590         The above three changes give us a 0.071 second performance
12591         improvement out of 3.294 seconds down to 3.223.  On my machine
12592         the above changes reduced the memory usage by 1,387 KB during
12593         compiler bootstrap.
12594
12595         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12596         QualifiedIdentifiers.  Before we created a new string through
12597         concatenation, and mostly later on, the result would be
12598         manipulated by DecomposeQI through string manipulation.
12599
12600         This reduced the compiler memory usage for bootstrapping from
12601         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12602         compile times in 0.05 seconds.
12603
12604 2003-11-28  Dick Porter  <dick@ximian.com>
12605
12606         * support.cs: Do string compares with the Invariant culture.
12607
12608         * rootcontext.cs: 
12609         * gen-treedump.cs: 
12610         * expression.cs: 
12611         * driver.cs: 
12612         * decl.cs: 
12613         * codegen.cs: 
12614         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12615         the comparison is done with the Invariant culture.
12616
12617 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12618
12619         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12620         GetEnumerator method.
12621
12622         (ProbeCollectionType): Iterate starting at the most specific type
12623         upwards looking for a GetEnumerator
12624
12625         * expression.cs: Shift count can be up to 31 for int/uint and 63
12626         for long/ulong.
12627
12628 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12629
12630         * statement.cs (Block.LookupLabel): Also look for the label on the
12631         children blocks.  Use a hash table to keep track of visited
12632         nodes. 
12633
12634         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12635         we actually did transform the other operand, otherwise fall back
12636         to the common codepath that casts to long.
12637
12638         * cs-tokenizer.cs: Use the same code pattern as the int case.
12639         Maybe I should do the parsing myself, and avoid depending on the
12640         Parse routines to get this done.
12641
12642 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12643
12644         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12645         which fixes bug 51347.  This time test it.
12646
12647         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12648         attributes for example can not tell the difference between these.
12649         The difference was only a syntax feature of the language. 
12650
12651         * attribute.cs: Apply attributes to delegates.
12652
12653         * delegate.cs: Call the apply attributes method.
12654
12655 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12656
12657         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12658         comparing 0 vs Byte.MinValue, not the value
12659
12660         (ImplicitConversionRequired): When reporting a conversion error,
12661         use error 31 to print out the constant error instead of the
12662         simpler 29.
12663
12664         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12665         which fixes bug 51347.
12666
12667 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12668
12669         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12670         which fixes the -warnaserror command line option.
12671
12672 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12673
12674         * cfold.cs (DoNumericPromotions): During constant folding of
12675         additions on UIntConstant, special case intconstants with
12676         IntConstants like we do on the expression binary operator. 
12677
12678 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12679
12680         * convert.cs (ImplicitReferenceConversion): We were missing a case
12681         (System.Enum are not value types or class types, so we need to
12682         classify them separatedly).
12683
12684         * driver.cs: We do not support error 2007.
12685
12686 2003-11-12 Jackson Harper <jackson@ximian.com>
12687
12688         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12689         system directory. Also use the full file name so users can
12690         libraries names mscorlib-o-tron.dll in a non system dir.
12691         
12692 2004-01-04  David Sheldon <dave-mono@earth.li>
12693
12694         * expression.cs: Added matching ")" to error message for CS0077.
12695
12696 2003-12-19  Martin Baulig  <martin@ximian.com>
12697
12698         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12699         static method; see documentation in the method.
12700         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12701
12702         * convert.cs (Convert.ImplicitReferenceConversion,
12703         Convert.ImplicitReferenceConversionExists): Add support for
12704         generic type declarations; see gen-36.cs.
12705
12706 2003-12-19  Martin Baulig  <martin@ximian.com>
12707
12708         * pending.cs (Pending.InterfaceMethod): Use
12709         `Type.IsAssignableFrom()' instead of `=='.
12710
12711 2003-12-18  Martin Baulig  <martin@ximian.com>
12712
12713         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12714         byref types first.
12715
12716         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12717         `expr_type.Equals (target_type)' instead of `=='.
12718
12719 2003-12-08  Martin Baulig  <martin@ximian.com>
12720
12721         * generics.cs (Constraints.Types): Removed.
12722         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12723         to Type's.
12724         (Constraints.ResolveTypes): New public method; resolves the
12725         TypeExpr's to Type's.
12726         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12727         longer takes the constraints.
12728         (TypeParameter.DefineMethod): Likewise.
12729         (TypeParameter.DefineType): New public method.  Calls
12730         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12731         the constraints.
12732
12733 2003-12-08  Martin Baulig  <martin@ximian.com>
12734
12735         * convert.cs (Convert.ImplicitConversionStandard): Use
12736         `expr_type.Equals (target_type)' instead of `=='.
12737
12738 2003-12-08  Martin Baulig  <martin@ximian.com>
12739
12740         * typemanager.cs (TypeManager.GetReferenceType): Call
12741         `Type.MakeByRefType ()'.
12742
12743 2003-12-08  Martin Baulig  <martin@ximian.com>
12744
12745         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12746         just has some special meaning in some situations.  For instance,
12747         it is allowed to use `where' as the name of a variable etc.
12748
12749 2003-12-04  Martin Baulig  <martin@ximian.com>
12750
12751         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12752         `Type.MakeArrayType()' for array types.
12753
12754 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12755
12756         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12757         debugging message.
12758
12759         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12760         corlib to compile.
12761
12762 2003-11-16  Martin Baulig  <martin@ximian.com>
12763
12764         * codegen.cs (EmitContext.IsGeneric): Removed.
12765
12766         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12767         ResolveGeneric() on the DeclSpace.
12768
12769 2003-11-16  Martin Baulig  <martin@ximian.com>
12770
12771         * generic.cs (TypeArguments.Resolve):
12772         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12773         `ResolveType()' on it to get the Type.
12774
12775 2003-11-15  Martin Baulig  <martin@ximian.com>
12776
12777         * generic.cs (ConstructedType.GetInterfaces): Override this.
12778
12779 2003-11-14  Martin Baulig  <martin@ximian.com>
12780
12781         * interface.cs (Interface.DefineType): Define all type parameters
12782         before adding the interfaces we inherit.
12783
12784 2003-11-11  Martin Baulig  <martin@ximian.com>
12785
12786         * generic.cs (ConstructedType.ResolveType): Always call
12787         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12788
12789 2003-11-10  Martin Baulig  <martin@ximian.com>
12790
12791         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12792         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12793         calling `ResolveType()' on them, directly assign their `Type'.
12794
12795 2003-11-08  Martin Baulig  <martin@ximian.com>
12796
12797         * generic.cs (ConstructedType): Override `IsClass' etc.
12798
12799 2003-11-08  Martin Baulig  <martin@ximian.com>
12800
12801         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12802         return value and the `out parent' parameter.
12803         (TypeContainer.DefineType): Moved the CS0644 check into
12804         GetClassBases().  Don't pass the interface types to the
12805         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12806         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12807
12808         * ecore.cs (TypeExpr.IsAttribute): New property.
12809         (TypeExpr.GetInterfaces): New method.
12810
12811         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12812         TypeExpr instead of a Type.
12813         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12814         (Interface.DefineType): Don't pass the interface types to the
12815         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12816         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12817
12818         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12819         instead of a `Type[]'.
12820         (TypeManager.RegisterBuilder): Likewise.
12821         (TypeManager.AddUserInterface): Likewise.
12822         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12823         `Type[]' and also return a `TypeExpr[]'.
12824         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12825
12826 2003-11-08  Martin Baulig  <martin@ximian.com>
12827
12828         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12829         Expression.     
12830
12831 2003-11-08  Martin Baulig  <martin@ximian.com>
12832
12833         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12834         TypeManager.ResolveExpressionTypes().
12835
12836         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12837         instead of an Expression.
12838         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12839         (TypeExpression): New public class; formerly known as `TypeExpr'.
12840
12841         * expression.cs (ComposedCast): Derive from TypeExpr.
12842
12843         * typemanager.cs (TypeManager.system_*_expr): These are now
12844         TypExpr's instead of Expression's.
12845         (TypeManager.ResolveExpressionTypes): New public static function;
12846         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12847         of them.        
12848
12849 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12850
12851         * expression.cs (New.DoResolve): Do not dereference value that
12852         might be a null return.
12853
12854         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12855         sure that the constant value has the right type.  Fixes an
12856         unreported bug, similar to 50425.
12857
12858         * const.cs (Const.LookupConstantValue): Call
12859         ImplicitStandardConversionExists before doing a conversion to
12860         avoid havng the TypeManager.ChangeType do conversions.
12861
12862         Reduced the number of casts used
12863
12864         (Const.ChangeType): New routine to enable reuse of the constant
12865         type changing code from statement.
12866
12867         * typemanager.cs (ChangeType): Move common initialization to
12868         static global variables.
12869
12870         Fixes #50425.
12871
12872         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12873         every value type to go through, even if it was void.  Fix that. 
12874
12875         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12876         character of the define, and the is_identifier_part_character for
12877         the rest of the string.
12878
12879 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12880
12881         * expression.cs (UnaryMutator.EmitCode): When I updated
12882         LocalVariableReference.DoResolve, I overdid it, and dropped an
12883         optimization done on local variable references.
12884
12885 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12886
12887         * ecore.cs: Convert the return from Ldlen into an int.
12888
12889 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12890
12891         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12892         the accessibility, this is a special case for toplevel non-public
12893         classes (internal for instance).
12894
12895 2003-10-20  Nick Drochak <ndrochak@gol.com>
12896
12897         * ecore.cs: Fix typo and build.  Needed another right paren.
12898
12899 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12900
12901         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12902         `internal' case regular and protected, but not allowing protected
12903         to be evaluated later.  Bug 49840
12904
12905 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12906
12907         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12908         to kb.Nlast, and not the kb.nFirst to isolate the switch
12909         statement.
12910
12911         Extract the underlying type, so enumerations of long/ulong are
12912         treated like long/ulong.
12913
12914 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12915
12916         * expression.cs (New): Overload the meaning of RequestedType to
12917         track the possible creation of the NewDelegate type, since
12918         DoResolve is invoked more than once for new constructors on field
12919         initialization.
12920
12921         See bugs: #48800 and #37014
12922
12923         * cs-parser.jay (declare_local_constants): Take an arraylist
12924         instead of a single constant.
12925
12926         (local_constant_declaration): It should take a
12927         constant_declarators, not a constant_declarator.  Fixes 49487
12928
12929         * convert.cs: Fix error report.
12930
12931 2003-10-13 Jackson Harper <jackson@ximian.com>
12932
12933         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12934         bug #49611
12935         
12936 2003-11-03  Martin Baulig  <martin@ximian.com>
12937
12938         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12939         `out bool has_type_arg'; if set, we need to pass the type to
12940         ig.Emit().
12941         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12942         Stelem_Any/Ldelem_Any for generic parameters.   
12943
12944 2003-11-02  Martin Baulig  <martin@ximian.com>
12945
12946         * expression.cs (Invocation.EmitCall): Use
12947         `TypeManager.IsValueType()' to check whether it's a value type.
12948         Don't set `struct_call' when calling a method on a type parameter.
12949
12950 2003-11-02  Martin Baulig  <martin@ximian.com>
12951
12952         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12953         and removed the TypeBuilder argument.
12954
12955         * typemanager.cs (TypeManager.IsValueType): Return
12956         `t.IsGenericParameter || t.IsValueType'.
12957
12958 2003-10-25  Martin Baulig  <martin@ximian.com>
12959
12960         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12961         call ConstructedType.Resolve() on it.
12962
12963         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12964
12965 2003-10-25  Martin Baulig  <martin@ximian.com>
12966
12967         * class.cs (TypeContainer.GetClassBases): Changed
12968         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12969         CS8214 reporting here.
12970         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12971         instead of a `Type' for our parent.  In case of a recursive
12972         declaration (see tests/gen-23.cs for an example), our parent is a
12973         ConstructedType and it doesn't have its type set.  So, first
12974         create our own TypeBuilder, then call constructed.Resolve() to get
12975         the parent's type and finally TypeBuilder.SetParent() it.
12976
12977         * ecore.cs (TypeExpr.Name): New public virtual property.
12978
12979         * generic.cs
12980         (ConstructedType): We're now a TypeExpr and not just an Expression.
12981         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12982         arguments here; this is done later.
12983         (ConstructedType.Resolve): New public method to resolve the type
12984         arguments and bind them.
12985
12986 2003-10-21  Martin Baulig  <martin@ximian.com>
12987
12988         * convert.cs: Use `TypeManager.IsValueType' instead of
12989         'type.IsValueType' everywhere.
12990
12991         * typemanager.cs (TypeManager.IsValueType): Return true for type
12992         parameters.  The reason for this is that we need to box a type
12993         parameter when converting it to a reference type.
12994
12995         * cs-parser.jay: Added support for default value expressions.
12996
12997         * generics.cs (DefaultValueExpression): New public class.       
12998
12999 2003-10-17  Martin Baulig  <martin@ximian.com>
13000
13001         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13002         TypeContainer so we can also use this for Interfaces.
13003         (TypeParameter.Resolve): Likewise.
13004
13005         * interface.cs (Interface.DefineType): Added support for generic
13006         interfaces.
13007
13008         * cs-parser.jay: Added support for generic structs and interfaces.
13009
13010 2003-10-17  Martin Baulig  <martin@ximian.com>
13011
13012         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13013         call generic methods :-)
13014
13015 2003-10-16  Martin Baulig  <martin@ximian.com>
13016
13017         * cs-parser.jay (namespace_or_type_name): Only create a
13018         GenericMemberAccess if we actually have type arguments.
13019
13020 2003-10-13  Martin Baulig  <martin@ximian.com>
13021
13022         * class.cs (Method.Define): If we're a generic method, call
13023         TypeBuilder.DefineGenericMethod () before resolving
13024         the parameters.
13025         (MethodData): Added .ctor which takes an additional MethodBuilder
13026         argument; this is used for generic methods.
13027         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13028         we already have a MethodBuilder.
13029
13030 2003-10-10  Martin Baulig  <martin@ximian.com>
13031
13032         * class.cs (Method): Added .ctor which takes a `GenericMethod'
13033         instead of a `DeclSpace'.  This is used for generic methods.
13034
13035         * cs-parser.jay (method_header): Added support for generic
13036         methods; create a `GenericMethod' instance and pass it to the
13037         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13038         parameters and locals.
13039
13040         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13041         since we already have the location.  Check whether we're a generic
13042         type declaration or a generic method and create the correct type
13043         parameter.
13044
13045         * generic.cs (TypeParameter.DefineMethod): New public method.
13046         (GenericMethod): New public class; derives from DeclSpace and is
13047         used for generic methods.       
13048
13049 2003-10-09  Martin Baulig  <martin@ximian.com>
13050
13051         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13052         to the .ctor.
13053         (MethodCore.DoDefineParameters): Removed the TypeContainer
13054         argument; use the DeclSpace which was passed to the .ctor instead.
13055         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13056         TypeContainer; we only need a DeclSpace here.
13057
13058 2003-10-09  Martin Baulig  <martin@ximian.com>
13059
13060         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13061         to the .ctor.
13062         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13063         EmitContext's .ctor.    
13064
13065 2003-10-09  Martin Baulig  <martin@ximian.com>
13066
13067         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13068         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13069         AsAccessible(), moved them as well.
13070
13071         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13072
13073 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13074
13075         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13076         generation for >=, as spotted by Paolo, bug 48679.  
13077         Patch from David Waite.
13078
13079         * cs-tokenizer.cs: Add handling for #pragma.
13080
13081         * cs-parser.jay: Allow for both yield and yield return in the
13082         syntax.  The anti-cobolization of C# fight will go on!
13083
13084         * class.cs (TypeBuilder.DefineType): Catch error condition here
13085         (Parent.DefineType erroring out and returning null).
13086
13087         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13088         coping with enumerations variables, we were mistakenly processing
13089         them as a regular value type instead of built-in types.  Fixes the
13090         bug #48063
13091
13092         * typemanager.cs (IsBuiltinOrEnum): New method.
13093
13094 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13095
13096         * cs-parser.jay: Upgrade: yield now needs the return clause.
13097
13098 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13099
13100         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13101
13102 2003-09-29  Martin Baulig  <martin@ximian.com>
13103
13104         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13105         inflated generic methods.
13106
13107         * generics.cs (ConstructedType): Distinguish between open and
13108         closed constructed types; correctly resolve the arguments.
13109
13110 2003-09-22  Martin Baulig  <martin@ximian.com>
13111
13112         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13113         all type arguments meet their constraints.
13114
13115 2003-09-19  Martin Baulig  <martin@ximian.com>
13116
13117         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13118         `MemberCache parent' argument.  Normally, an interface doesn't
13119         have a parent type except System.Object, but we use this in gmcs
13120         for generic type parameters.
13121
13122 2003-09-18  Martin Baulig  <martin@ximian.com>
13123
13124         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13125         on `type.IsInterface'; don't check whether the type has a parent
13126         to determine whether it's an interface.
13127
13128 2003-09-17  Martin Baulig  <martin@ximian.com>
13129
13130         * generic.cs (ConstructedType.ToString): Always use `name' as the
13131         type name.
13132
13133 2003-09-15  Martin Baulig  <martin@ximian.com>
13134
13135         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13136
13137         * generic.cs (Constraints.Resolve): New public method; this is
13138         called to resolve the constraint types and to check whether all
13139         the constraints are correct.
13140         (Constraints.Types): New public property.
13141         (TypeParameter.Resolve): New public method; resolves all the
13142         type's constraints.
13143
13144         * class.cs (TypeContainer.DefineType): Call
13145         TypeParameter.Resolve() before actually defining the type.
13146
13147 2003-09-15  Martin Baulig  <martin@ximian.com>
13148
13149         * class.cs (TypeContainer.DefineType): Added an error flag to
13150         avoid reporting duplicate CS0146's ("class definition is
13151         circular.").
13152
13153         * driver.cs (Driver.MainDriver): Abort if
13154         RootContext.ResolveTree() reported any errors.
13155
13156 2003-09-07  Martin Baulig  <martin@ximian.com>
13157
13158         * report.cs (Error, Warning): Added overloaded versions which take
13159         a `params object[] args' and call String.Format().
13160
13161 2003-09-07  Martin Baulig  <martin@ximian.com>
13162
13163         * decl.cs (DeclSpace..ctor): Don't call
13164         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13165         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13166         (DeclSpace.RecordDecl): New method.
13167
13168         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13169
13170 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13171
13172         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13173         value attributes to be applied to ParameterBuilders.
13174
13175         * class.cs (MethodCore.LabelParameters): Make static and more
13176         generic so that it can be used from other places - like interface
13177         methods, for instance.
13178
13179         * interface.cs (Interface.Emit): Call LabelParameters before
13180         emitting attributes on the InterfaceMethod.
13181
13182 2003-09-07  Martin Baulig  <martin@ximian.com>
13183
13184         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13185         if the number of type parameters doesn't match.
13186
13187 2003-09-04  Martin Baulig  <martin@ximian.com>
13188
13189         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13190         for arrays of generic type params (ie. `!0[]').
13191
13192 2003-09-04  Martin Baulig  <martin@ximian.com>
13193
13194         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13195         for the moment.
13196
13197 2003-09-04  Martin Baulig  <martin@ximian.com>
13198
13199         * decl.cs (DeclSpace.LookupGeneric): New method.
13200         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13201         moment.
13202
13203         * generic.cs (TypeParameterExpr): Take a TypeParameter as
13204         argument, not just a string.
13205         (TypeParameter.Define): New public method; this is called to
13206         actually define the generic parameter; after this, you can use the
13207         new `Type' property to get the type.
13208
13209 2003-09-04  Martin Baulig  <martin@ximian.com>
13210
13211         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13212         is now an ArrayList; initialize the result of the `TypeParameters'
13213         property here.
13214         (DeclSpace.GetGenericData): Removed.
13215         (DeclSpace.LookupGeneric): Temporarily removed; we need to
13216         implement this in a different way.
13217         (DeclSpace.GetTypeParameters): Removed; there's now a
13218         `TypeParameters' property.
13219         (DeclSpace.TypeParameters): New public property.
13220
13221         * generic.cs (Constraints): Make this class public.
13222         (TypeParameter): New public class.
13223
13224 2003-09-04  Martin Baulig  <martin@ximian.com>
13225
13226         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13227         generic parameters.
13228
13229         * class.cs (TypeContainer.DefineType): Call
13230         TypeBuilder.DefineGenericParameter () on all generic parameters if
13231         this is a generic type.
13232
13233 2003-08-28  Martin Baulig  <martin@ximian.com>
13234
13235         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13236         sample-stack.il".
13237
13238         * sample-hello.cs: Compile this with gmcs: "gmcs
13239         /r:sample-stack.dll sample-hello.cs".
13240
13241 2003-08-28  Martin Baulig  <martin@ximian.com>
13242
13243         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13244         the parameters to the generic type.
13245
13246 2003-08-28  Martin Baulig  <martin@ximian.com>
13247
13248         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13249
13250 2003-08-28  Martin Baulig  <martin@ximian.com>
13251
13252         * cs-parser.jay (opt_type_argument_list): Use
13253         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13254         (primary_expression): Replace `qualified_identifier' with `type_name'.
13255         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13256
13257         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13258         parser to check whether it is syntactically a type parameter list;
13259         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13260         this case.
13261
13262 2003-08-26  Martin Baulig  <martin@ximian.com>
13263
13264         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13265         resolving aliases; fixes #47927.
13266
13267 2003-08-26  Martin Baulig  <martin@ximian.com>
13268
13269         * statement.cs (Using.DoResolve): This is internally emitting a
13270         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13271         do not always return.  Fixes #47681.
13272
13273 2003-08-26  Martin Baulig  <martin@ximian.com>
13274
13275         * decl.cs (MemberCore): Moved WarningNotHiding(),
13276         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13277         into MemberBase.
13278         (AdditionResult): Make this nested in DeclSpace.
13279         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13280         argument; call NamespaceEntry.Define() unless we're nested in a
13281         class or struct.
13282
13283         * namespace.cs (Namespace.DefineName): New public function.  This
13284         is called from DeclSpace's .ctor to add 
13285         (Namespace.Lookup): Include DeclSpaces in the lookup.
13286
13287         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13288
13289         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13290
13291 2003-08-25  Martin Baulig  <martin@ximian.com>
13292
13293         * convert.cs (Convert.ExplicitReferenceConversion): When
13294         converting from an interface type to a class, unbox if the target
13295         type is a struct type.  Fixes #47822.
13296
13297 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13298
13299         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13300         #47854.
13301
13302 2003-08-22  Martin Baulig  <martin@ximian.com>
13303
13304         * class.cs (TypeManager.DefineType): When defining a nested type,
13305         call DefineType() on our parent; fixes #47801.
13306
13307 2003-08-22  Martin Baulig  <martin@ximian.com>
13308
13309         * class.cs (MethodData.Define): While checking if a method is an
13310         interface implementation, improve the test a bit more to fix #47654.
13311
13312 2003-08-22  Martin Baulig  <martin@ximian.com>
13313
13314         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13315         correctly; fixes #47722.
13316
13317 2003-08-22  Martin Baulig  <martin@ximian.com>
13318
13319         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13320         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13321
13322         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13323
13324 2003-08-22  Martin Baulig  <martin@ximian.com>
13325
13326         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13327         can only be assigned in static constructors.  Fixes #47161.
13328
13329 2003-08-22  Martin Baulig  <martin@ximian.com>
13330
13331         Rewrote and improved the flow analysis code.
13332
13333         * flowbranching.cs (FlowBranching): Make this class abstract.
13334         (FlowBranching.CreateBranching): New static function to create a
13335         new flow branching.
13336         (FlowBranchingBlock, FlowBranchingException): New classes.
13337         (FlowBranching.UsageVector.Type): New public readonly field.
13338         (FlowBranching.UsageVector.Breaks): Removed the setter.
13339         (FlowBranching.UsageVector.Returns): Removed the setter.
13340         (FlowBranching.UsageVector): Added Break(), Return(),
13341         NeverReachable() and Throw() methods to modify the reachability.
13342         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13343         done by FlowBranching.Merge().
13344         (FlowBranching.UsageVector.MergeChild): New method; merges the
13345         merge result into the current vector.
13346         (FlowBranching.Merge): New abstract method to merge a branching.
13347
13348 2003-08-12  Martin Baulig  <martin@ximian.com>
13349
13350         * expression.cs (Indirection.CacheTemporaries): Create the
13351         LocalTemporary with the pointer type, not its element type.
13352
13353 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13354
13355         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13356         token was a keyword or not.
13357
13358         Add `error' options where an IDENTIFIER was expected;  Provide
13359         CheckToken and CheckIdentifierToken convenience error reporting
13360         functions. 
13361
13362         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13363
13364         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13365         NameSpaceEntry NameSpaceEntry.
13366
13367         (LookupInterfaceOrClass): Avoid creating a full qualified name
13368         from namespace and name: avoid doing lookups when we know the
13369         namespace is non-existant.   Use new Tree.LookupByNamespace which
13370         looks up DeclSpaces based on their namespace, name pair.
13371
13372         * driver.cs: Provide a new `parser verbose' to display the
13373         exception thrown during parsing.  This is turned off by default
13374         now, so the output of a failure from mcs is more graceful.
13375
13376         * namespace.cs: Track all the namespaces defined in a hashtable
13377         for quick lookup.
13378
13379         (IsNamespace): New method
13380
13381 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13382
13383         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13384         we know that we need to concatenate (full typename can never be
13385         null). 
13386
13387         * class.cs: ditto.
13388
13389         * statement.cs: Use a bitfield;  Do not initialize to null things
13390         which are done by the constructor by default.
13391
13392         * cs-parser.jay: bug fix, parameter was 4, not 3.
13393
13394         * expression.cs: Just use the property;
13395
13396         * statement.cs: No need for GetVariableInfo method.
13397
13398 2003-08-08  Martin Baulig  <martin@ximian.com>
13399
13400         * flowanalysis.cs (FlowReturns): This is now nested in the
13401         `FlowBranching' class.
13402         (MyBitVector): Moved this here from statement.cs.
13403         (FlowBranching.SiblingType): New enum type.
13404         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13405
13406 2003-08-07  Martin Baulig  <martin@ximian.com>
13407
13408         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13409         `FlowBranching' class and called `BranchingType'.
13410
13411 2003-08-07  Martin Baulig  <martin@ximian.com>
13412
13413         * flowanalysis.cs: Moved all the control flow analysis code into
13414         its own file.
13415
13416 2003-08-07  Martin Baulig  <martin@ximian.com>
13417
13418         * assign.cs (Assign.DoResolve): `target' must either be an
13419         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13420         #37319.
13421
13422 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13423
13424         * expression.cs (BinaryMethod): This kind of expression is created by the
13425         Binary class if it determines that the operator has to be handled
13426         by a method.
13427
13428         (BinaryDelegate): This kind of expression is created if we are
13429         dealing with a + or - operator on delegates.
13430
13431         (Binary): remove method, argumetns, and DelegateOperator: when
13432         dealing with methods, 
13433
13434         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13435
13436         * statement.cs (Block): use bitfields for the three extra booleans
13437         we had in use.   Remove unused topblock parameter.
13438
13439         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13440
13441         * assign.cs: Drop extra unneeded tests.
13442
13443 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13444
13445         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13446
13447         * statement.cs (Foreach): Use VariableStorage instead of
13448         LocalBuilders.   
13449
13450         * codegen.cs (VariableStorage): New class used by clients that
13451         require a variable stored: locals or fields for variables that
13452         need to live across yield.
13453
13454         Maybe provide a convenience api for EmitThis+EmitLoad?
13455
13456         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13457         these bad boys.
13458
13459 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13460
13461         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13462         RemapParameterLValue): New methods that are used to turn a
13463         precomputed FieldInfo into an expression like this:
13464
13465                 instance.FieldInfo
13466
13467         The idea is to use this instead of making LocalVariableReference
13468         have more than one meaning.
13469
13470         * cs-parser.jay: Add error production to BASE.
13471
13472         * ecore.cs: Deal with TypeManager.GetField returning null, which
13473         is now a valid return value.
13474
13475         (FieldExprNoAddress): New expression for Fields whose address can
13476         not be taken.
13477
13478         * expression.cs (LocalVariableReference): During the resolve
13479         phases, create new expressions if we are in a remapping context.
13480         Remove code that dealt with remapping here.
13481
13482         (ParameterReference): same.
13483
13484         (ProxyInstance): New expression, like the `This' expression, but
13485         it is born fully resolved.  We know what we are doing, so remove
13486         the errors that are targeted to user-provided uses of `this'.
13487
13488         * statement.cs (Foreach): our variable is now stored as an
13489         Expression;  During resolution, follow the protocol, dont just
13490         assume it will return this.
13491
13492 2003-08-06  Martin Baulig  <martin@ximian.com>
13493
13494         * support.cs (SeekableStreamReader.cs): New public class.
13495
13496         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13497         SeekableStreamReader instead of the normal StreamReader.
13498
13499 2003-08-04  Martin Baulig  <martin@ximian.com>
13500
13501         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13502         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13503         deambiguate casts and delegate invocations.
13504         (parenthesized_expression): Use the new tokens to ensure this is
13505         not a cast of method invocation.
13506
13507         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13508         when reading a `)' and Deambiguate_CloseParens () was previously
13509         called.
13510
13511         * expression.cs (ParenthesizedExpression): New class.  This is
13512         just used for the CS0075 test.
13513         (Binary.DoResolve): Check for CS0075.   
13514
13515 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13516
13517         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13518         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13519         reference comparison.
13520
13521         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13522         examine the ReturnType for equality - this is necessary in the
13523         cases of implicit and explicit operators whose signature also
13524         includes the return type.
13525
13526 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * namespace.cs: Cache the result of the namespace computation,
13529         instead of computing it every time.
13530
13531 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13532
13533         * decl.cs: Use a global arraylist that we reuse over invocations
13534         to avoid excesive memory consumption.  Reduces memory usage on an
13535         mcs compile by one meg (45 average).
13536
13537         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13538         private, work around that.
13539
13540 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13541
13542         * literal.cs (IntLiteral): Define Zero and One static literals. 
13543
13544         * cs-parser.jay (integer_literal): use static literals to reduce
13545         memory usage for the most used literals (0, 1 and -1).  211kb
13546         reduced in memory usage.
13547
13548         Replace all calls to `new ArrayList' with `new
13549         ArrayList(4)' which is a good average number for most allocations,
13550         and also requires only 16 bytes of memory for its buffer by
13551         default. 
13552
13553         This reduced MCS memory usage in seven megabytes for the RSS after
13554         bootstrapping.
13555
13556 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13557
13558         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13559         handle params methods the correct way by forming only one
13560         applicable set with params and normal methods in them. Earlier we
13561         were looking at params methods only if we found no normal methods
13562         which was not the correct thing to do.
13563
13564         (Invocation.BetterFunction): Take separate arguments indicating
13565         when candidate and the best method are params methods in their
13566         expanded form.
13567
13568         This fixes bugs #43367 and #46199.
13569
13570         * attribute.cs: Documentation updates.
13571
13572         (CheckAttribute): Rename to CheckAttributeTarget.
13573         (GetValidPlaces): Rename to GetValidTargets.
13574
13575         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13576         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13577
13578         Fixes bug #44468.
13579
13580 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13581
13582         * codegen.cs: Compute IsGeneric correctly.
13583
13584         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13585         resolution. 
13586
13587         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13588         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13589         regressions, and I was chasing more bugs than I required.
13590
13591         * interface.cs: Use expressions for base type names (like classes
13592         and structs have been doing for a while now), and resolve that.
13593         This patch should probably go into head as well.
13594
13595         This makes it one less user of FindType.
13596
13597 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13598
13599         This compiler can not self host currently.  Need to fix that.
13600         
13601         * Makefile: compile to `gmcs.exe'
13602
13603         * driver.cs: Turn on v2 by default on gmcs.
13604
13605         * generic.cs (ConstructedType): Does no longer take a container
13606         type argument;  That will be taken care of later.
13607
13608         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13609         Use SimpleName to resolve for now, so we can continue the work on
13610         the parser, until we get Type.GetType that understands generics.
13611
13612         (ConstructedType.ToString): Implement
13613
13614         (TypeArguments.Resolve): Resolve the child expressions as types. 
13615         
13616         * cs-parser.jay: Rename interface_constraints to
13617         type_parameter_constraints
13618
13619         (namespace_or_type_name): Only use constructed types for the basic
13620         construction, we will deal with identifier<...> later.
13621
13622         (type/type_name): No longer call DecomposeQI, as
13623         namespace_or_type_name is always decoded now.
13624         
13625 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13626
13627         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13628         closely: we eliminate methods in base types when we have an
13629         applicable method in a top-level type.
13630
13631         Please see section 14.5.5.1 for an exact description of what goes
13632         on. 
13633
13634         This fixes bug #45127 and a host of other related to corlib compilation.
13635
13636         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13637         array is the method corresponding to the top-level type (this is
13638         because of the changes made to icall.c) so we change this
13639         accordingly.
13640
13641         (MethodGroupExpr.Name): This too.
13642
13643         * typemanager.cs (GetElementType): New method which does the right
13644         thing when compiling corlib. 
13645
13646         * everywhere: Make use of the above in the relevant places.
13647
13648 2003-07-22  Martin Baulig  <martin@ximian.com>
13649
13650         * cs-parser.jay (invocation_expression): Moved
13651         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13652         `cast_expression', but create a InvocationOrCast which later
13653         resolves to either an Invocation or a Cast.
13654
13655         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13656         method; call this before EmitStatement() to make sure that this
13657         expression can be used as a statement.
13658
13659         * expression.cs (InvocationOrCast): New class; resolves to either
13660         an Invocation or a Cast.
13661
13662         * statement.cs (StatementExpression): Call ResolveStatement() on
13663         the ExpressionStatement before emitting it.
13664
13665 2003-07-21  Martin Baulig  <martin@ximian.com>
13666
13667         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13668         `ref' and `out' attributes match; fixes #46220.
13669         (MemberAccess.ResolveMemberAccess): You can't reference a type
13670         through an expression; fixes #33180.
13671         (Indexers.GetIndexersForType): Don't return the indexers from
13672         interfaces the class implements; fixes #46502.
13673
13674 2003-07-21  Martin Baulig  <martin@ximian.com>
13675
13676         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13677         CS0661 checks; fixes bug #30442.
13678
13679 2003-07-21  Martin Baulig  <martin@ximian.com>
13680
13681         * decl.cs (AdditionResult): Added `Error'.
13682
13683         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13684
13685         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13686         cs0031.cs actually work.
13687
13688  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13689  
13690         * cs-parser.jay (namespace_name): do not use
13691         namespace_or_type_name, use qualified_identifier, because
13692         namespace_or_type_name will soon return a composed expression
13693         instead of a string.
13694  
13695         (namespace_or_type_name): Instead of returning a string, now this
13696         production returns an expression.
13697  
13698         * codegen.cs (EmitContext): Setup IsGeneric property based on
13699         whether our DeclSpace is generic, our the method is generic.
13700  
13701         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13702         the method is generic.
13703  
13704         * cs-parser.jay (type_arguments, opt_type_argument_list,
13705         type_parameters, type_parameter_list, opt_type_parameter_list,
13706         type_parameter,, opt_type_parameter_constraints_clauses,
13707         type_parameter_constraints_clauses,
13708         type_parameter_constraint_clause, type_parameter_constraint,
13709         interface_constraints): Add new production
13710  
13711         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13712         DeclSpace is generic or not.
13713  
13714         (DeclSpace.SetParameterInfo): New routine, used to set the
13715         parameter info for a type.
13716  
13717         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13718         returns a GenericTypeExpr
13719  
13720         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13721         generic, lookup the generic argument.
13722  
13723         * attribute.cs: Do not allow TypeParameterExpressions in
13724         Attributes.
13725  
13726         * class.cs: Do not allow the Main method to be defined in a
13727         Generic container.
13728  
13729         * expression.cs (SizeOf): Do not allow generic types to be used as
13730         arguments to sizeof.
13731  
13732         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13733         it: whether a type is generic or not.  Only works for types we are
13734         currently building for now.
13735         
13736 2003-07-20  Martin Baulig  <martin@ximian.com>
13737
13738         * namespace.cs: Fixed that bug which caused a crash when compiling
13739         the debugger's GUI.
13740
13741 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13742
13743         * typemanager.cs (LookupTypeReflection): Never expose types which
13744         are NotPublic, NestedPrivate, NestedAssembly, or
13745         NestedFamANDAssem.  We used to return these, and later do a check
13746         that would report a meaningful error, but the problem is that we
13747         would not get the real match, if there was a name override.
13748
13749 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13750
13751         * namespace.cs (Namespace, Name): Do not compute the namespace
13752         name dynamically, compute it in the constructor.  This reduced
13753         memory usage by 1697 KB.
13754
13755         * driver.cs: Use --pause to pause at the end.
13756
13757 2003-07-17  Peter Williams  <peter@newton.cx>
13758
13759         * Makefile: Change the name of the test target so that it doesn't
13760         conflict with the recursive test target.
13761
13762 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13763
13764         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13765         AddressOf): Do not use EmitThis, that was wrong, use the actual
13766         this pointer.
13767
13768 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13769
13770         * class.cs (MethodData.Define): While checking if a method is an
13771         interface implementation, improve the test: If we are not public
13772         (use new test here: use the computed MethodAttributes directly,
13773         instead of the parsed modifier flags) check if the `implementing'
13774         method comes from an interface or not.
13775
13776         * pending.cs (VerifyPendingMethods): Slightly better error
13777         message.
13778
13779         * makefile: add test target that does the mcs bootstrap.
13780
13781 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13782
13783         * interface.cs (Define): Do nothing here since there are no
13784         members to populate etc. Move the attribute emission out of here
13785         since this was just totally the wrong place to put it. Attribute
13786         application happens during the 'Emit' phase, not in the 'Define'
13787         phase.
13788
13789         (Emit): Add this method and move the attribute emission here
13790
13791         * rootcontext.cs (EmitCode): Call the Emit method on interface
13792         types too.
13793
13794 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13795
13796         * expression.cs (OverloadResolve): Report error only if Location
13797         is not 'Null' which means that there was a probe going on.
13798
13799 2003-07-14  Martin Baulig  <martin@ximian.com>
13800
13801         * expression.cs (ConditionalLogicalOperator): New public class to
13802         implement user defined conditional logical operators.
13803         This is section 14.11.2 in the spec and bug #40505.
13804
13805 2003-07-14  Martin Baulig  <martin@ximian.com>
13806
13807         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13808
13809 2003-07-14  Martin Baulig  <martin@ximian.com>
13810
13811         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13812
13813         * ecore.cs (IVariable.VerifyFixed): New interface method.
13814
13815         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13816         operator, check whether the variable is actually fixed.  Fixes bug
13817         #36055.  Set a variable definitely assigned when taking its
13818         address as required by the spec.
13819
13820         * statement.cs (LocalInfo.IsFixed): New field.
13821         (LocalInfo.MakePinned): Set `IsFixed' to true.
13822
13823 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13824
13825         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13826         for .ctors, ensure that we only ask for members declared in the
13827         attribute type (BindingFlags.DeclaredOnly).
13828
13829         Fixes bug #43632.
13830
13831         * expression.cs (Error_WrongNumArguments): Report error 1501
13832         correctly the way CSC does.
13833
13834 2003-07-13  Martin Baulig  <martin@ximian.com>
13835
13836         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13837         lookup on the fully qualified name, to make things like "X.X" work
13838         where "X.X" is a fully qualified type name, but we also have a
13839         namespace "X" in the using list.  Fixes #41975.
13840
13841 2003-07-13  Martin Baulig  <martin@ximian.com>
13842
13843         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13844         function. If we're a CompoundAssign, we need to create an embedded
13845         CompoundAssign, not an embedded Assign.
13846         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13847         Fixes #45854.
13848
13849 2003-07-13  Martin Baulig  <martin@ximian.com>
13850
13851         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13852         work to fix bug #46088.
13853
13854 2003-07-13  Ravi Pratap <ravi@ximian.com>
13855
13856         * class.cs (Operator.Emit): Do not emit attributes here - it is
13857         taken care of by the Method class that we delegate too. This takes
13858         care of bug #45876.
13859
13860 2003-07-10  Martin Baulig  <martin@ximian.com>
13861
13862         * expression.cs (TypeOfVoid): New class.
13863         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13864
13865 2003-07-10  Martin Baulig  <martin@ximian.com>
13866
13867         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13868         bug #35957.
13869
13870 2003-07-10  Martin Baulig  <martin@ximian.com>
13871
13872         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13873         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13874
13875         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13876
13877         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13878
13879 2003-07-10  Martin Baulig  <martin@ximian.com>
13880
13881         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13882         of decimal.  Fixes #42850.
13883
13884         NOTE: I also fixed the created byte blob, but this doesn't work on
13885         the MS runtime and csc never produces any byte blobs for decimal
13886         arrays.
13887
13888 2003-07-10  Martin Baulig  <martin@ximian.com>
13889
13890         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13891         structs; fixes #32068.
13892         (Block.AddChildVariableNames): Fixed #44302.
13893
13894 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13895
13896         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13897
13898 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13899
13900         * attribute.cs: And this test is onger needed.
13901
13902 2003-07-08  Martin Baulig  <martin@ximian.com>
13903
13904         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13905         inaccessible types.  Fixes #36313.
13906
13907         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13908
13909         * namespace.cs (NamespaceEntry): Create implicit entries for all
13910         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13911         implicit entries for N1.N2 and N1.
13912
13913 2003-07-08  Martin Baulig  <martin@ximian.com>
13914
13915         Rewrote the handling of namespaces to fix a lot of the issues
13916         wrt. `using' aliases etc.
13917
13918         * namespace.cs (Namespace): Splitted this class into a
13919         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13920
13921         * typemanager.cs (TypeManager.IsNamespace): Removed.
13922         (TypeManager.ComputeNamespaces): Only compute namespaces from
13923         loaded assemblies here, not the namespaces from the assembly we're
13924         currently compiling.
13925
13926 2003-07-08  Martin Baulig  <martin@ximian.com>
13927
13928         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13929
13930 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13931
13932         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13933         already fixed it.  
13934
13935         I thought about the memory savings here, but LookupTypeReflection
13936         is used under already very constrained scenarios.  Compiling
13937         corlib or mcs only exposes one hit, so it would not really reduce
13938         any memory consumption.
13939
13940 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13941
13942         * typemanager.cs: fixes bug #45889 by only adding public types from
13943         other assemblies to the list of known types.
13944
13945 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13946
13947         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13948         on the type we resolved.
13949
13950 2003-07-05  Martin Baulig  <martin@ximian.com>
13951
13952         * pending.cs (PendingImplementation.ParentImplements): Don't
13953         create the proxy if the parent is abstract.
13954
13955         * class.cs (TypeContainer.DefineIndexers): Process explicit
13956         interface implementations first.  Fixes #37714.
13957
13958 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13959
13960         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13961         defined recursively;  but since we modify the input parameters
13962         (left is set to `this' temporarily), we reset this value if the
13963         left_is_explicit is false, which gives the original semantics to
13964         the code.  
13965
13966         * literal.cs (NullPointer): new class used to represent a null
13967         literal in a pointer context.
13968
13969         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13970         type is a pointer, use a NullPointer object instead of a
13971         NullLiteral.   Closes 43687
13972
13973         (ExplicitConversion): Convert pointer values using
13974         the conv opcode to the proper type.
13975
13976         * ecore.cs (New): change ValueTypeVariable property into a method,
13977         that returns whether the valuetype is suitable for being used.
13978
13979         * expression.cs (Binary.DoNumericPromotions): Only return if we
13980         the int constant was a valid uint, and we can return both left and
13981         right as uints.  If not, we continue processing, to trigger the
13982         type conversion.  This fixes 39018.
13983
13984         * statement.cs (Block.EmitMeta): During constant resolution, set
13985         the CurrentBlock property on the emitcontext, so that we resolve
13986         constants propertly.
13987
13988 2003-07-02  Martin Baulig  <martin@ximian.com>
13989
13990         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13991         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13992
13993         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13994         than emitting it here.
13995
13996         * statement.cs: Fixed some more flow analysis bugs.
13997
13998 2003-07-02  Martin Baulig  <martin@ximian.com>
13999
14000         * class.cs (MethodData.Define): When implementing interface
14001         methods, set Final unless we're Virtual.
14002
14003         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14004         check work for interface methods.
14005
14006 2003-07-01  Martin Baulig  <martin@ximian.com>
14007
14008         * ecore.cs (EmitContext.This): Replaced this property with a
14009         GetThis() method which takes a Location argument.  This ensures
14010         that we get the correct error location for a CS0188.
14011
14012 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14013
14014         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14015         ImplicitStandardConversion.
14016
14017         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14018
14019 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14020
14021         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14022         optimization.
14023
14024 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14025
14026         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14027         constructors.
14028
14029         (MethodData.Define): Turn off initlocals for unsafe methods.
14030
14031 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14032
14033         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14034         complete;  Fixes #37521.
14035
14036         * delegate.cs: Use Modifiers.TypeAttr to compute the
14037         TypeAttributes, instead of rolling our own.  This makes the flags
14038         correct for the delegates.
14039
14040 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14041
14042         * class.cs (Constructor.Define): Set the private flag for static
14043         constructors as well.
14044
14045         * cs-parser.jay (statement_expression): Set the return value to
14046         null, to avoid a crash when we catch an error.
14047
14048 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14049
14050         * cs-parser.jay: Applied patch from Jackson that adds support for
14051         extern and unsafe modifiers to destructor declarations.
14052
14053         * expression.cs: Report error 21 if the user is trying to index a
14054         System.Array.
14055
14056         * driver.cs: Add an error message, suggested by the bug report.
14057
14058         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14059         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14060
14061 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14062
14063         * namespace.cs: Add some information to reduce FAQs.
14064
14065 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14066
14067         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14068         underlying enumeration types.  Fixes #43915.
14069
14070         * expression.cs: Treat ushort/short as legal values to be used in
14071         bitwise operations.
14072
14073 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14074
14075         * delegate.cs: transfer custom attributes for paramenters from
14076         the delegate declaration to Invoke and BeginInvoke.
14077
14078 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14079
14080         * attribute.cs: handle custom marshalers and emit marshal info
14081         for fields, too.
14082
14083 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14084
14085         * makefile.gnu: Added anonymous.cs to the compiler sources.
14086
14087 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14088
14089         * iterators.cs: Change the name of the proxy class to include two
14090         underscores.
14091
14092         * cs-parser.jay: Update grammar to include anonymous methods.
14093
14094         * anonymous.cs: new file.
14095
14096 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14097
14098         * class.cs (Field.Define): Add missing test for pointers and
14099         safety. 
14100
14101 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14102
14103         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14104         we use the stobj opcode.
14105
14106         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14107         since it wasn't the correct fix. 
14108
14109         It still is puzzling that we are required to use stobj for IntPtr
14110         which seems to be a ValueType.
14111
14112 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14113
14114         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14115         during regular simple name resolution.   Now, the trick is that
14116         instead of returning for processing the simplename, we do a
14117         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14118         contextual lookup type).   If a match is found, return that, if
14119         not, return for further composition.
14120
14121         This fixes long-standing 30485.
14122
14123         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14124         using the address to initialize an object, do an Stobj instead of
14125         using the regular Stelem.
14126
14127         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14128         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14129         Because if we are a BaseIndexerAccess that value will be true.
14130         Fixes 43643.
14131
14132         * statement.cs (GotoCase.Resolve): Return after reporting an
14133         error, do not attempt to continue. 
14134
14135         * expression.cs (PointerArithmetic.Emit): If our operand is a
14136         long, convert our constants to match the operand before
14137         multiplying.  Convert to I type before adding.   Fixes 43670.
14138
14139 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14140
14141         * enum.cs (ImplicitConversionExists) : Rename to
14142         ImplicitEnumConversionExists to remove ambiguity. 
14143
14144         * ecore.cs (NullCast): New type of cast expression class which
14145         basically is very similar to EmptyCast with the difference being
14146         it still is a constant since it is used only to cast a null to
14147         something else
14148         (eg. (string) null)
14149
14150         * convert.cs (ImplicitReferenceConversion): When casting a null
14151         literal, we return a NullCast.
14152
14153         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14154         should be around anymore.
14155
14156         The renaming (reported was slightly wrong). Corrections:
14157
14158         ConvertImplicitStandard -> ImplicitConversionStandard
14159         ConvertExplicitStandard -> ExplicitConversionStandard
14160
14161         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14162         before passing them in !
14163
14164         * convert.cs (ImplicitConversionStandard): When comparing for
14165         equal expr and target types, ensure that expr is not a
14166         NullLiteral.
14167
14168         In general, we must not be checking (expr_type ==
14169         target_type) in the top level conversion methods
14170         (ImplicitConversion, ExplicitConversion etc). This checking is
14171         done in the methods that they delegate to.
14172
14173 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14174
14175         * convert.cs: Move Error_CannotConvertType,
14176         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14177         ImplicitNumericConversion, ImplicitConversionExists,
14178         ImplicitUserConversionExists, StandardConversionExists,
14179         FindMostEncompassedType, FindMostSpecificSource,
14180         FindMostSpecificTarget, ImplicitUserConversion,
14181         ExplicitUserConversion, GetConversionOperators,
14182         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14183         TryImplicitIntConversion, Error_CannotConvertImplicit,
14184         ConvertImplicitRequired, ConvertNumericExplicit,
14185         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14186         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14187         its own file.
14188
14189         Perform the following renames:
14190
14191         StandardConversionExists -> ImplicitStandardConversionExists
14192         ConvertImplicit -> ImplicitConversion
14193         ConvertImplicitStandard -> ImplicitStandardConversion
14194         TryImplicitIntConversion -> ImplicitIntConversion
14195         ConvertImplicitRequired -> ImplicitConversionRequired
14196         ConvertNumericExplicit -> ExplicitNumericConversion
14197         ConvertReferenceExplicit -> ExplicitReferenceConversion
14198         ConvertExplicit -> ExplicitConversion
14199         ConvertExplicitStandard -> ExplicitStandardConversion
14200
14201 2003-05-19  Martin Baulig  <martin@ximian.com>
14202
14203         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14204         (TypeInfo): Added support for structs having structs as fields.
14205
14206         * ecore.cs (FieldExpr): Implement IVariable.
14207         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14208         VariableInfo for the field.
14209
14210 2003-05-18  Martin Baulig  <martin@ximian.com>
14211
14212         * expression.cs (This.DoResolve): Report a CS0027 if we're
14213         emitting a field initializer.
14214
14215 2003-05-18  Martin Baulig  <martin@ximian.com>
14216
14217         * expression.cs (This.ResolveBase): New public function.
14218         (This.DoResolve): Check for CS0188.
14219
14220         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14221         This.Resolve().
14222
14223         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14224         `instance_expression' to null if we don't have any non-static
14225         methods.
14226
14227 2003-05-18  Martin Baulig  <martin@ximian.com>
14228
14229         Reworked the way how local variables and parameters are handled by
14230         the flow analysis code.
14231
14232         * statement.cs (TypeInfo, VariableMap): New public classes.
14233         (VariableInfo): New public class.  This is now responsible for
14234         checking whether a variable has been assigned.  It is used for
14235         parameters and local variables.
14236         (Block.EmitMeta): Take the InternalParameters as argument; compute
14237         the layout of the flow vectors here.
14238         (Block.LocalMap, Block.ParameterMap): New public properties.
14239         (FlowBranching): The .ctor doesn't get the InternalParameters
14240         anymore since Block.EmitMeta() now computes the layout of the flow
14241         vector.
14242         (MyStructInfo): This class is now known as `StructInfo' and nested
14243         in `TypeInfo'; we don't access this directly anymore.
14244
14245         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14246         property and removed IsAssigned(), IsFieldAssigned(),
14247         SetAssigned() and SetFieldAssigned(); we now call them on the
14248         VariableInfo so we don't need to duplicate this code everywhere.
14249
14250         * expression.cs (ParameterReference): Added `Block block' argument
14251         to the .ctor.
14252         (LocalVariableReference, ParameterReference, This): The new
14253         VariableInfo class is now responsible for all the definite
14254         assignment stuff.
14255
14256         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14257         IsParameterAssigned, SetParameterAssigned): Removed.
14258
14259 2003-05-18  Martin Baulig  <martin@ximian.com>
14260
14261         * typemanager.cs (InitCoreTypes): Try calling
14262         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14263         the 3-args-version.  Corlib now also needs our `void_type'.
14264         (GetMethod): Added overloaded version which takes an optional
14265         `bool report_errors' to allow lookups of optional methods.
14266
14267 2003-05-12  Martin Baulig  <martin@ximian.com>
14268
14269         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14270         only used for locals and not for parameters.
14271
14272 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14273
14274         * support.cs (InternalParameters.ParameterType): Return the
14275         ExternalType of the parameter.
14276
14277         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14278         they were unused.
14279
14280 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14281
14282         * class.cs (MethodData.Define): Do not set the `newslot' on
14283         interface members, if they are also flagged as "override".
14284
14285         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14286         better code for ++i and i++.  This only works for static fields
14287         and local variables.
14288
14289         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14290         want to pull the DeclSpace out of the builder_to_declspace instead
14291         of the TypeBuilder (like in TypeContainer.FindMembers).
14292
14293         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14294         instead of LookupTypeContainer.  Fixes the crash on .NET for
14295         looking up interface members.
14296
14297         * const.cs: Create our own emit context during the Definition
14298         stage, so that constants are evaluated in the proper context, when
14299         a recursive definition happens.
14300
14301 2003-05-11  Martin Baulig  <martin@ximian.com>
14302
14303         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14304         new block for a switch section.
14305         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14306         the adding/lookup in the switch block.  Fixes #39828.
14307
14308 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14309
14310         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14311         functionality: I needed to convert the data after I had performed
14312         the add/sub operation into the operands type size.
14313
14314         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14315         pass the type for the box operation, otherwise the resulting
14316         object would have been of type object.
14317
14318         (BoxedCast): Add constructor to specify the type to box as.
14319
14320 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14321
14322         * iterators.cs: I was reusing the `count' variable inadvertently,
14323         take steps to not allow this to happen.
14324
14325 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14326
14327         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14328         by creating an array at the point where the params starts and
14329         putting all those arguments there, then adjusting the size of the
14330         array.
14331
14332 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14333
14334         * expression.cs (New.AddressOf): Implement interface
14335         IMemoryLocation.  This is used when the `new' operator is used in
14336         the context of an invocation to a method on a value type.
14337
14338         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14339         example. 
14340
14341         * namespace.cs: Also check the using aliases here.
14342
14343         * driver.cs: Move the test for using validity after the types have
14344         been entered, so we do a single pass that also includes the using
14345         aliases. 
14346
14347         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14348         in the regular case.   CreateSiblingForFinally is doing extra
14349         error checking.
14350
14351         * attribute.cs (GetAttributeArgumentExpression): Store the result
14352         on an out value, and use the return value to indicate failure
14353         instead of using null (which is a valid return for Constant.GetValue).
14354
14355         * statement.cs: Perform the analysis flow for the increment
14356         portion after the statement, because this will be the real flow of
14357         execution.  Fixes #42385
14358
14359         * codegen.cs (EmitContext.EmitArgument,
14360         EmitContext.EmitStoreArgument): New helper functions when the
14361         RemapToProxy flag is set.
14362
14363         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14364         function.
14365
14366         Add support for remapping parameters. 
14367
14368         * iterators.cs: Propagate parameter values;  Store parameter
14369         values in the proxy classes.
14370
14371 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14372
14373         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14374         need a proxy reference;  I do not know what I was thinking
14375
14376         * cs-parser.jay (constructor_initializer): catch another error,
14377         and display nice message.
14378
14379         (field_declaration): catch void field declaration
14380         to flag a better error. 
14381
14382         * class.cs (MemberBase.CheckBase): Report an error instead of a
14383         warning if a new protected member is declared in a struct. 
14384         (Field.Define): catch the error of readonly/volatile.
14385
14386         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14387
14388         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14389         volatile variable is taken
14390
14391 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * statement.cs (Fixed.Resolve): Report an error if we are not in
14394         an unsafe context.
14395
14396 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14397
14398         * typemanager.cs: reuse the code that handles type clashes for
14399         delegates and enumerations.
14400
14401         * class.cs (Report28): Always report.
14402
14403         * expression.cs (EncodeAsAttribute): Allow nulls here.
14404
14405 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14406
14407         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14408         the functionality for testing whether an expression is valid for
14409         an attribute here.  Also handle the case of arrays of elements
14410         being stored. 
14411
14412         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14413         encoding a linear array into an array of objects that are suitable
14414         to be passed to an CustomAttributeBuilder.
14415
14416         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14417
14418         * ecore.cs: (FieldExpr): Handle field remapping here.
14419
14420         * iteratators.cs: Pass the instance variable (if the method is an
14421         instance method) to the constructors, so we can access the field
14422         variables on the class.
14423
14424         TODO: Test this with structs.  I think the THIS variable on
14425         structs might have to be a pointer, and not a refenrece
14426
14427 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14428
14429         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14430         local variables to fields in a proxy class.
14431
14432         * iterators.cs (PopulateProxy): Rename our internal fields to
14433         <XXX>.  
14434         Create a <THIS> field if we are an instance method, so we can
14435         reference our parent container variables.
14436         (MapVariable): Called back from the EmitContext code to enter a
14437         new variable to field mapping into the proxy class (we just create
14438         a FieldBuilder).
14439
14440         * expression.cs
14441         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14442         for using the remapped locals to fields.
14443
14444         I placed the code here, because that gives the same semantics to
14445         local variables, and only changes the Emit code.
14446
14447         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14448         statements inside iterators.
14449         (VariableInfo): Add a FieldBuilder for the cases when we are
14450         remapping local variables to fields in a proxy class
14451
14452         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14453         current_block != null.
14454
14455         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14456         not cope with strings, as it has been moved to the
14457         TableSwitchEmit.  Fixed bug in switch generation.
14458
14459         * expression.cs (New.DoResolve): Provide more context for the user
14460         when reporting an error.
14461
14462         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14463         pointers. 
14464
14465         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14466         check the permissions for it.  Note than in a type-resolution
14467         context the check was already present in DeclSpace.ResolveType,
14468         but was missing from the MemberAccess.
14469
14470         (ArrayCreation.CheckIndices): warn if the user has
14471         more nested levels of expressions, but there are no more
14472         dimensions specified.  Avoids crash on bug 41906.
14473
14474 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * statement.cs (Block): replace Implicit bool, for a generic
14477         flags.   
14478         New flag: `Unchecked'.  This is used during the EmitMeta phase
14479         (which is out-of-line with the regular Resolve/Emit process for a
14480         statement, as this is done ahead of time, but still gets a chance
14481         to call constant resolve).
14482
14483         (Block.Flags): new enum for adding a new flag.
14484
14485         (Block.EmitMeta): track the state of unchecked.
14486
14487         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14488         to enable constant resolution to work there as well.
14489
14490 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * typemanager.cs (ienumerable_type): Also look up
14493         System.Collections.IEnumerable. 
14494
14495 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14496
14497         TODO: Test more than one conditional per method.
14498
14499         * class.cs (Indexer.Define): Report the location where the user is
14500         referencing the unsupported feature.
14501
14502         (MethodData): Overload the use of `conditionals' to
14503         minimize the creation of needless ArrayLists.   This saves roughly
14504         212kb on my machine.
14505
14506         (Method): Implement the new IIteratorContainer interface.
14507         (Method.SetYields): Implement the method by setting the ModFlags
14508         to contain METHOD_YIELDS.
14509
14510         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14511         which just got set to null.
14512
14513         * iterators.cs: New file.
14514
14515         (Yield, YieldBreak): New statements.
14516
14517         * statement.cs (Return.Resolve): Flag an error if we are used in
14518         an iterator method.
14519
14520         * codegen.cs (InIterator): New flag set if the code is being
14521         compiled in an iterator method.
14522
14523         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14524         internal modifier, and we just use it to avoid adding extra
14525         fields, as this is seldom used.  
14526
14527         * cs-parser.jay: Add yield_statement (yield and yield break).
14528
14529         * driver.cs: New flag -v2 to turn on version 2 features. 
14530
14531         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14532         hashtable when v2 is enabled.
14533
14534 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14535
14536         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14537         there is already a namespace defined with this name.
14538
14539         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14540         people upgraded their corlibs.
14541
14542         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14543         always use fully qualified types, no need to use the compiler
14544         front end.
14545
14546         (TypeManager.IsNamespace): Use binarysearch.
14547
14548         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14549         AddDelegate): I did not quite use the new IsValid API properly: I
14550         have to pass the short-name and the fullname.  I was passing only
14551         the basename instead of the fullname sometimes. 
14552
14553         (TypeContainer.DefineType): call NamespaceClash.
14554
14555         * interface.cs (Interface.DefineType): use NamespaceClash before
14556         defining the type.
14557
14558         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14559         defining the type.
14560
14561         * enum.cs: (Enum.DefineType): use NamespaceClash before
14562         defining the type.
14563
14564         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14565         speed increase.  First, use the negative_hits cache when we get a
14566         negative.  Second, add the type with its full original name
14567         instead of the new . and + encoded name (reflection uses + to
14568         separate type from a nested type).  Use LookupTypeReflection
14569         directly which bypasses the type->name hashtable (that we already
14570         know does not contain the type.
14571
14572         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14573         location/container type. 
14574
14575         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14576
14577 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14578
14579         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14580
14581         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14582         method is being referenced in the method group from a static
14583         context, and report error 120 if so.
14584
14585         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14586         Error118. 
14587
14588         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14589         is created, we create the A namespace).
14590
14591         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14592         Fixes #41591
14593
14594 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14595
14596         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14597         invocation to ModuleBuilder.GetType with the same values will
14598         return a new type instance, so we need to cache its return
14599         values. 
14600
14601         * expression.cs (Binary.ResolveOperator): Only allow the compare
14602         operators on enums if they are of the same type.
14603
14604         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14605         types of ValueType on their own case.  Before we were giving them
14606         the same treatment as objects.
14607
14608         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14609         fullname.  Short name is used to compare against container name.
14610         Fullname is used to check against defined namespace names.
14611
14612         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14613         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14614
14615         (Method.CheckBase): Call parent.
14616         (MemberBase.CheckBase): Check for protected members on sealed
14617         classes.
14618         (PropertyBase.CheckBase): Call parent.
14619         (Field.Define): Call parent.
14620
14621         * report.cs: Negative error codes are now mapped to 8000 - code,
14622         so that the display is render more nicely.
14623
14624         * typemanager.cs: Do not use try/catch, instead report a regular
14625         error. 
14626
14627         (GetPointerType, GetReferenceType): These methods provide
14628         mechanisms to obtain the T* and T& from a T.  We had the code
14629         previously scattered around the code base, and it also used
14630         TypeManager.LookupType that would go through plenty of caches.
14631         This one goes directly to the type source.
14632
14633         In some places we did the Type.GetType followed by
14634         ModuleBuilder.GetType, but not in others, so this unifies the
14635         processing as well.
14636
14637         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14638         statements now that we have namespace information.
14639
14640         * typemanager.cs (IsNamespace): New method, returns whether the
14641         string presented is a namespace or not.
14642
14643         (ComputeNamespaces): New public entry point, computes the list of
14644         available namespaces, using the GetNamespaces API call in Mono, or
14645         the slower version in MS.NET.   
14646
14647         Now before we start the semantic analysis phase, we have a
14648         complete list of namespaces including everything that the user has
14649         provided.
14650
14651         Deleted old code to cache namespaces in .nsc files.
14652
14653 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14654
14655         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14656         class/struct location definition Location for the implicit
14657         constructor location.
14658
14659         (Operator.Define): Use the location of the operator for the
14660         implicit Method definition.
14661
14662         (Constructor.Emit): use the constructor location for the implicit
14663         base initializer constructor.
14664
14665         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14666         and the Expression class now contains two new methods:
14667
14668         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14669         isolate type lookup from the rest of the resolution process.
14670
14671         Since we use Expressions to hold type definitions due to the way
14672         we parse the input we have historically overloaded Resolve to
14673         perform the Type lookups if a special flag is passed.  Now this is
14674         eliminated and two methods take their place. 
14675
14676         The differences in the two methods between xStep and xTerminal is
14677         that xStep is involved in our current lookup system that uses
14678         SimpleNames to compose a name, while xTerminal is used just to
14679         catch the case where the simplename lookup failed.
14680
14681 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14682
14683         * expression.cs (ResolveMemberAccess): Remove redundant code.
14684         TypeExpr expressions are always born fully resolved.
14685
14686         * interface.cs (PopulateMethod): Do not lookup the types twice.
14687         We were doing it once during SemanticAnalysis and once during
14688         PopulateMethod.
14689
14690         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14691         in local variable type definitions, were being returned as a
14692         SimpleName (we decomposed everything into a string), that is
14693         because primary_expression was being used instead of a type in the
14694         grammar (reduce/reduce conflicts).
14695
14696         The part that was wrong is that we converted the expression into a
14697         string (an oversimplification in one hand, compounded with primary
14698         expressions doing string concatenation).
14699
14700         So things like:
14701
14702         A.B.C [] x;
14703
14704         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14705         using clauses from working on this particular context.  And a type
14706         was being matched directly against "A.B.C[]".
14707
14708         We now use the correct approach, and allow for ComposedCast to be
14709         part of the unary expression.  So the "A.B.C []" become a composed
14710         cast of "A.B.C" (as a nested group of MemberAccess with a
14711         SimpleName at the end) plus the rank composition "[]". 
14712
14713         Also fixes 35567
14714
14715 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14716
14717         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14718         for the access level checking.
14719
14720         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14721         `TypeContainer container', because I kept getting confused when I
14722         was debugging this code.
14723
14724         * expression.cs (Indexers): Instead of tracking getters/setters,
14725         we now track them in parallel.  We create one arraylist less, but
14726         most importantly it is possible now for the LValue code to find a
14727         matching get for a set.
14728
14729         (IndexerAccess.DoResolveLValue): Update the code.
14730         GetIndexersForType has been modified already to extract all the
14731         indexers from a type.  The code assumed it did not.
14732
14733         Also make the code set the correct return type for the indexer.
14734         This was fixed a long time ago for properties, but was missing for
14735         indexers.  It used to be void_type.
14736
14737         (Binary.Emit): Test first for doubles instead of
14738         floats, as they are more common.
14739
14740         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14741         when dealing with floats and the <=, >= operators.  This fixes bug
14742         #39314 
14743
14744         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14745         to load the array value by emitting a load on the foreach variable
14746         type.  This was incorrect.  
14747
14748         We now emit the code to load an element using the the array
14749         variable type, and then we emit the conversion operator.
14750
14751         Fixed #40176
14752
14753 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14754
14755         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14756
14757 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14758
14759         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14760         test for protection before we test for signatures. 
14761
14762         (MethodSignature.ToString): implement.
14763
14764         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14765         to the case where we reduced into a LongConstant.
14766
14767         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14768         depend on whether the information is acurrate, because the
14769         Microsoft runtime will always claim that the array type is public,
14770         regardless of the real state.
14771
14772         If the type is a pointer, another problem happens: the type is
14773         reported as non-public in Microsoft.  
14774
14775         In both cases we have to call CheckAccessLevel recursively with
14776         the underlying type as the argument to be tested.
14777
14778 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14779
14780         * assign.cs (Assign.Emit): If we are dealing with a compound
14781         assignment expression, we should use the code path that stores the
14782         intermediate result in a temporary value.  This fixes #40903.
14783
14784         *expression.cs (Indirection.ToString): Provide ToString method for
14785         debugging. 
14786
14787 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14788
14789         * class.cs: Null out fields holding references to Block objects so
14790         they can be garbage collected.
14791
14792         * expression.cs (OverloadResolve): Remove unused local.
14793
14794 2003-04-07  Martin Baulig  <martin@ximian.com>
14795
14796         * codegen.cs (EmitContext.CurrentFile): New public field.
14797         (EmitContext.Mark): Use the CurrentFile to check whether the
14798         location is in the correct file.
14799         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14800
14801 2003-04-07  Martin Baulig  <martin@ximian.com>
14802
14803         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14804
14805         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14806         location.  [FIXME: The location argument which gets passed to this
14807         method is sometimes wrong!]
14808
14809 2003-04-07  Nick Drochak <ndrochak@gol.com>
14810
14811         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14812
14813 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14814
14815         * expression.cs (Indirection.EmitAssign): We were using the
14816         temporary, but returning immediately instead of continuing the
14817         EmitAssing flow.
14818
14819 2003-04-06  Martin Baulig  <martin@ximian.com>
14820
14821         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14822         if it's a nested child, but also deriving from the outer class.
14823         See test 190.cs.
14824
14825         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14826         nested child, but also deriving from the outer class.  See
14827         test-190.cs.
14828         (FilterWithClosure): We may access private members of the outer
14829         class if we're a nested child and deriving from the outer class.
14830         (RealMemberLookup): Only set `closure_private_ok' if the
14831         `original_bf' contained BindingFlags.NonPublic.
14832
14833 2003-04-05  Martin Baulig  <martin@ximian.com>
14834
14835         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14836         probe if its a type parameter, and if so, flag an error.
14837
14838         * decl.cs: Move here the SetParameterInfo code from class.cs.
14839         Handle IsGeneric here.
14840
14841         Handle a variety of errors in the parameter info definition.
14842
14843         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14844         type parameters here.
14845
14846         * cs-parser.jay (class_declaration): report errors for parameters
14847         here as well.
14848
14849 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14850
14851         * generic.cs: New file, contains support code for generics.
14852
14853         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14854         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14855
14856         Update parser for the above removals.
14857
14858         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14859         now taken care of in the parser.
14860
14861 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * class.cs (Event.Define): Do not allow abstract events to have
14864         initializers. 
14865
14866 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14867
14868         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14869         block in event declarations.
14870
14871         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14872         value type, get its address.
14873
14874         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14875         leaving a class on the stack instead of a boolean value (int
14876         0/1).  Change the code so we compare against null, and then the
14877         result against zero.
14878
14879         * class.cs (TypeContainer.GetClassBases): We were checking for the
14880         parent class being sealed too late.
14881
14882         * expression.cs (Binary.Emit): For <= and >= when dealing with
14883         floating point values, use cgt.un and clt.un instead of cgt and
14884         clt alone.
14885
14886 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14887
14888         * statement.cs: Apply the same optimization as MS: skip the 
14889         GetEnumerator returning an IEnumerator, and use the one returning a 
14890         CharEnumerator instead. This allows us to avoid the try-finally block 
14891         and the boxing.
14892
14893 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14894
14895         * cs-parser.jay: Attributes cannot be applied to
14896                          namespaces. Fixes #40473
14897
14898 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14899
14900         * class.cs:
14901         (Add*): check if the name is valid using the full name for constants,
14902         fields, properties and events.
14903
14904 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14905
14906         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14907         char constants to be part of the enumeration.
14908
14909         * expression.cs (Conditional.DoResolve): Add support for operator
14910         true. Implements the missing functionality from 14.12
14911
14912         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14913         operator true/false as required by the spec.
14914
14915         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14916         implicit conversion to boolean.
14917
14918         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14919         also one where the type implements `operator true'. 
14920
14921         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14922         get an expression that will invoke operator true based on an
14923         expression.  
14924
14925         (GetConversionOperators): Removed the hack that called op_True
14926         here.  
14927
14928         (Expression.ResolveBoolean): Move this from Statement.
14929
14930 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14931
14932         * ecore.cs (FieldExpr): do not allow initialization of initonly
14933         fields on derived classes
14934
14935 2003-03-13  Martin Baulig  <martin@ximian.com>
14936
14937         * statement.cs (Block.Emit): Call ig.BeginScope() and
14938         ig.EndScope() when compiling with debugging info; call
14939         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14940
14941 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14942
14943         * expression.cs (Indexers): Do not construct immediately, allow
14944         for new members to be appended as we go.  Fixes 38143
14945
14946 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14947
14948         * expression.cs: save/restore context when resolving an unchecked
14949         expression.
14950
14951 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14952
14953         * cfold.cs: Catch division by zero in modulus operator during
14954         constant folding.
14955
14956 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14957
14958         * interface.cs (Interface.DefineMembers): Avoid defining members
14959         twice. 
14960
14961 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14962
14963         * driver.cs: handle the +/- options for -noconfig
14964
14965         * statement.cs (Unckeched.Resolve): Also track the state of
14966         unchecked in the Resolve phase.
14967
14968 2003-02-27  Martin Baulig  <martin@ximian.com>
14969
14970         * ecore.cs (Expression.MemberLookup): Don't create a
14971         MethodGroupExpr for something which is not a method.  Fixes #38291.
14972
14973 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14974
14975         * class.cs (MemberBase.CheckParameters): Also check that the type
14976         is unmanaged if it is a pointer.
14977
14978         * expression.cs (SizeOf.Resolve): Add location information.
14979
14980         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14981         a managed type is declared.
14982
14983         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14984         parameter modifiers as well.  Fixes bug 38606
14985
14986         * class.cs: Very sad.  Am backing out the speed up changes
14987         introduced by the ArrayList -> Array in the TypeContainer, as they
14988         were not actually that much faster, and introduced a bug (no error
14989         reports on duplicated methods).
14990
14991         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14992         source first, this will guarantee that we have a valid expression
14993         before calling in lower levels functions that will require a
14994         resolved object.  Then use this original_source in the
14995         target.ResolveLValue instead of the original source that was
14996         passed to us.
14997
14998         Another change.  Use target.Resolve instead of LValueResolve.
14999         Although we are resolving for LValues, we will let the Assign code
15000         take care of that (it will be called again from Resolve).  This
15001         basically allows code like this:
15002
15003         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15004         class Y { void A (X x) { x [0] += o; }
15005
15006         The problem was that the indexer was trying to resolve for
15007         set_Item (idx, object o) and never finding one.  The real set_Item
15008         was set_Item (idx, X).  By delaying the process we get the right
15009         semantics. 
15010
15011         Fixes bug 36505
15012
15013 2003-02-23  Martin Baulig  <martin@ximian.com>
15014
15015         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15016         while calling DoEmit ().
15017
15018         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15019         source files; if you use the #line directive inside a method, the
15020         compiler stops emitting line numbers for the debugger until it
15021         reaches the end of the method or another #line directive which
15022         restores the original file.
15023
15024 2003-02-23  Martin Baulig  <martin@ximian.com>
15025
15026         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15027
15028 2003-02-23  Martin Baulig  <martin@ximian.com>
15029
15030         * statement.cs (Block.AddChildVariableNames): We need to call this
15031         recursively, not just for our immediate children.
15032
15033 2003-02-23  Martin Baulig  <martin@ximian.com>
15034
15035         * class.cs (Event.Define): Always make the field private, like csc does.
15036
15037         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15038         actually work, fixes bug #37521.
15039
15040 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15041
15042         * delegate.cs: When creating the various temporary "Parameters"
15043         classes, make sure that we call the ComputeAndDefineParameterTypes
15044         on those new parameters (just like we do with the formal ones), to
15045         allow them to be resolved in the context of the DeclSpace.
15046
15047         This fixes the bug that Dick observed in Bugzilla #38530.
15048
15049 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15050
15051         * expression.cs (ResolveMemberAccess): When resolving a constant,
15052         do not attempt to pull a constant if the value was not able to
15053         generate a valid constant.
15054
15055         * const.cs (LookupConstantValue): Do not report more errors than required.
15056
15057 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15058
15059         * expression.cs: fixes bug #38328.
15060
15061 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15062
15063         * class.cs: Changed all the various members that can be part of a
15064         class from being an ArrayList to be an Array of the right type.
15065         During the DefineType type_list, interface_list, delegate_list and
15066         enum_list are turned into types, interfaces, delegates and enums
15067         arrays.  
15068
15069         And during the member population, indexer_list, event_list,
15070         constant_list, field_list, instance_constructor_list, method_list,
15071         operator_list and property_list are turned into their real arrays.
15072
15073         Although we could probably perform this operation earlier, for
15074         good error reporting we need to keep the lists and remove the
15075         lists for longer than required.
15076
15077         This optimization was triggered by Paolo profiling the compiler
15078         speed on the output of `gen-sample-program.pl' perl script. 
15079
15080         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15081         not crash in methods like MemberLookupFailed that use this field.  
15082
15083         This problem arises when the compiler fails to resolve a type
15084         during interface type definition for example.
15085
15086 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15087
15088         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15089         inherit from System.Object, so we have to stop at null, not only
15090         when reaching System.Object.
15091
15092 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15093
15094         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15095         DeclaredOnly because the parent indexer might have had a different
15096         name, but did not loop until the top of the hierarchy was reached.
15097
15098         The problem this one fixes is 35492: when a class implemented an
15099         indexer from an interface, we were getting the interface method
15100         (which was abstract) and we were flagging an error (can not invoke
15101         abstract method).
15102
15103         This also keeps bug 33089 functioning, and test-148 functioning.
15104
15105         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15106         out if a method is special is to see if it is declared in a
15107         property or event, or whether it is one of the predefined operator
15108         names.   This should fix correctly #36804.
15109
15110 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15111
15112         The goal here is to remove the dependency on EmptyCast.Peel ().
15113         Killing it completely.
15114
15115         The problem is that currently in a number of places where
15116         constants are expected, we have to "probe" for an EmptyCast, and
15117         Peel, which is not the correct thing to do, as this will be
15118         repetitive and will likely lead to errors. 
15119
15120         The idea is to remove any EmptyCasts that are used in casts that
15121         can be reduced to constants, so we only have to cope with
15122         constants. 
15123
15124         This bug hunt was triggered by Bug 37363 and the desire to remove
15125         the duplicate pattern where we were "peeling" emptycasts to check
15126         whether they were constants.  Now constants will always be
15127         constants.
15128
15129         * ecore.cs: Use an enumconstant here instead of wrapping with
15130         EmptyCast.  
15131
15132         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15133         throwing me off.  By handling this we can get rid of a few hacks.
15134
15135         * statement.cs (Switch): Removed Peel() code.
15136
15137 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15138
15139         * class.cs: Location information for error 508
15140
15141         * expression.cs (New.DoResolve): Add a guard against double
15142         resolution of an expression.  
15143
15144         The New DoResolve might be called twice when initializing field
15145         expressions (see EmitFieldInitializers, the call to
15146         GetInitializerExpression will perform a resolve on the expression,
15147         and later the assign will trigger another resolution
15148
15149         This leads to bugs (#37014)
15150
15151         * delegate.cs: The signature for EndInvoke should contain any ref
15152         or out parameters as well.  We were not doing this in the past. 
15153
15154         * class.cs (Field.Define): Do not overwrite the type definition
15155         inside the `volatile' group.  Turns out that volatile enumerations
15156         were changing the type here to perform a validity test, which
15157         broke conversions. 
15158
15159 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15160
15161         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15162         and structs, we do not want to load the instance variable
15163
15164         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15165         enum_type has to be handled like an object reference (implicit
15166         conversions exists from this to object), but the regular IsClass
15167         and IsValueType tests will never return true for this one.
15168
15169         Also we use TypeManager.IsValueType instead of type.IsValueType,
15170         just for consistency with the rest of the code (this is only
15171         needed if we ever use the construct exposed by test-180.cs inside
15172         corlib, which we dont today).
15173
15174 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15175
15176         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15177         just InternalCall.
15178
15179 2003-02-09  Martin Baulig  <martin@ximian.com>
15180
15181         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15182         (Namespace.DefineNamespaces): New static public method; this is
15183         called when we're compiling with debugging to add all namespaces
15184         to the symbol file.
15185
15186         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15187         pass it to the Namespace's .ctor.
15188
15189         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15190         and MethodBase arguments; pass the namespace ID to the symwriter;
15191         pass the MethodBase instead of the token to the symwriter.
15192         (SymbolWriter.DefineNamespace): New method to add a namespace to
15193         the symbol file.
15194
15195 2003-02-09  Martin Baulig  <martin@ximian.com>
15196
15197         * symbolwriter.cs: New file.  This is a wrapper around
15198         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15199         methods here in near future.
15200
15201 2003-02-09  Martin Baulig  <martin@ximian.com>
15202
15203         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15204         ILGenerator.MarkSequencePoint() which are actually used by the
15205         symbol writer.
15206
15207 2003-02-09  Martin Baulig  <martin@ximian.com>
15208
15209         * location.cs (SourceFile): New public sealed class.  This
15210         contains the name and an index which is used in the location's token.
15211         (Location): Reserve an appropriate number of bits in the token for
15212         the source file instead of walking over that list, this gives us a
15213         really huge performance improvement when compiling with debugging.
15214
15215         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15216         `SourceFile' argument instead of a string.
15217         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15218         but don't parse/tokenize here, we need to generate the list of all
15219         source files before we do that.
15220         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15221         the files.
15222
15223         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15224         instead of a string.
15225
15226         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15227         of a string.
15228
15229 2003-02-09  Martin Baulig  <martin@ximian.com>
15230
15231         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15232         filename on `#line default'.
15233
15234 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15235
15236         * statement.cs: don't clear the pinned var when the fixed statement
15237         returns from the method (fixes bug#37752).
15238
15239 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15240
15241         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15242         to IsValueType.
15243
15244 2003-02-07  Martin Baulig  <martin@ximian.com>
15245
15246         * driver.cs: Removed the `--debug-args' command line argument.
15247
15248         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15249         automatically by the AsssemblyBuilder.
15250         (CodeGen.InitializeSymbolWriter): We don't need to call any
15251         initialization function on the symbol writer anymore.  This method
15252         doesn't take any arguments.
15253
15254 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15255
15256         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15257         from referenced assemblies as well.
15258
15259 2003-02-02  Martin Baulig  <martin@ximian.com>
15260
15261         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15262
15263 2003-02-02  Martin Baulig  <martin@ximian.com>
15264
15265         * class.cs (Constructor.Emit): Open the symbol writer before
15266         emitting the constructor initializer.
15267         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15268         single-stepping through constructor initializers.
15269
15270 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15271
15272         * class.cs: Handle error 549: do not allow virtual methods in
15273         sealed classes. 
15274
15275 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15276
15277         * decl.cs: Check access levels when resolving types
15278
15279 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15280
15281         * statement.cs: Add parameters and locals set in catch blocks that might 
15282         return to set vector
15283
15284 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15285
15286         * class.cs (Operator): Set the SpecialName flags for operators.
15287
15288         * expression.cs (Invocation.DoResolve): Only block calls to
15289         accessors and operators on SpecialName methods.
15290
15291         (Cast.TryReduce): Handle conversions from char constants.
15292
15293
15294 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15295
15296         * statement.cs: small memory and time optimization in FlowBranching.
15297
15298 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15299
15300         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15301         problem that the last fix but in the other sid (Set).
15302
15303         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15304         access when there is no indexer in the hierarchy.
15305
15306 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15307
15308         * class.cs: Combine some if statements.
15309
15310 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15311
15312         * driver.cs: fixed bug #37187.
15313
15314 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15315
15316         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15317         any indexer, it's needed to build a list with all the indexers in the
15318         hierarchy (AllGetters), else we have problems. Fixes #35653.
15319
15320 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15321
15322         * class.cs (MethodData.Define): It is wrong for an interface
15323         implementation to be static in both cases: explicit and implicit.
15324         We were only handling this in one case.
15325
15326         Improve the if situation there to not have negations.
15327
15328         * class.cs (Field.Define): Turns out that we do not need to check
15329         the unsafe bit on field definition, only on usage.  Remove the test.
15330
15331 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15332
15333         * driver.cs: use assembly.Location instead of Codebase (the latest
15334         patch made mcs fail when using MS assemblies).
15335
15336 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15337
15338         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15339         get the path to *corlib.dll.
15340
15341 2003-01-21  Nick Drochak <ndrochak@gol.com>
15342
15343         * cs-tokenizer.cs:
15344         * pending.cs:
15345         * typemanager.cs: Remove compiler warnings
15346
15347 2003-01-20  Duncan Mak  <duncan@ximian.com>
15348
15349         * AssemblyInfo.cs: Bump the version number to 0.19.
15350
15351 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15352
15353         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15354
15355 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15356
15357         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15358
15359 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15360
15361         * cs-parser.jay: Small fix: we were not comparing the constructor
15362         name correctly.   Thanks to Zoltan for the initial pointer.
15363
15364 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15365
15366         * cs-tokenizer.cs: Set file name when specified with #line
15367
15368 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15369
15370         * cs-parser.jay: Only perform the constructor checks here if we
15371         are named like the class;  This will help provider a better
15372         error.  The constructor path is taken when a type definition is
15373         not found, but most likely the user forgot to add the type, so
15374         report that rather than the constructor error.
15375
15376 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15377
15378         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15379         allocations.
15380
15381 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15382
15383         * cs-parser.jay: Add cleanup call.
15384
15385 2003-01-13  Duncan Mak  <duncan@ximian.com>
15386
15387         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15388         consistent with other methods.
15389
15390 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15391
15392         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15393
15394 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15395
15396         * attribute.cs: only set GuidAttr to true when we have a
15397         GuidAttribute.
15398
15399 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15400
15401         * ecore.cs:
15402         * expression.cs:
15403         * typemanager.cs: fixes to allow mcs compile corlib with the new
15404         Type.IsSubclassOf fix.
15405
15406 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15407
15408         * expression.cs (LocalVariableReference.DoResolve): Classify a
15409         constant as a value, not as a variable.   Also, set the type for
15410         the variable.
15411
15412         * cs-parser.jay (fixed_statement): take a type instead of a
15413         pointer_type, so we can produce a better error message later.
15414
15415         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15416         as an error.  
15417
15418         (For.DoEmit): Make inifinite loops have a
15419         non-conditional branch back.
15420
15421         (Fixed.DoEmit): First populate the pinned variables, then emit the
15422         statement, then clear the variables.  Before I was emitting the
15423         code once for each fixed piece.
15424
15425
15426 2003-01-08  Martin Baulig  <martin@ximian.com>
15427
15428         * statement.cs (FlowBranching.MergeChild): A break in a
15429         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15430
15431 2003-01-08  Martin Baulig  <martin@ximian.com>
15432
15433         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15434         lives in the same number space than `param_map'.  Fixes #36154.
15435
15436 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15437
15438         * cs-parser.jay (constructor_declaration): Set the
15439         Constructor.ModFlags before probing for it.  This makes the
15440         compiler report 514, 515 and 132 (the code was there, but got
15441         broken). 
15442
15443         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15444         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15445         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15446
15447 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15448
15449         * enum.cs: create the enum static fields using the enum type.
15450
15451 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15452
15453         * class.cs: don't try to create the ParamBuilder for the return
15454         type if it's not needed (and handle it breaking for the ms runtime
15455         anyway).
15456
15457 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15458
15459         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15460
15461 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15462
15463         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15464         the command.   This showed up while compiling the JANET source
15465         code, which used \r as its only newline separator.
15466
15467 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15468
15469         * class.cs (Method.Define): If we are an operator (because it
15470         reuses our code), then set the SpecialName and HideBySig.  #36128
15471
15472 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15473
15474         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15475         exception, report error 120 `object reference required'.
15476
15477         * driver.cs: Add --pause option, used during to measure the size
15478         of the process as it goes with --timestamp.
15479
15480         * expression.cs (Invocation.DoResolve): Do not allow methods with
15481         SpecialName to be invoked.
15482
15483 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15484
15485         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15486         number before adding it.
15487
15488 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15489
15490         * ecore.cs (StandardImplicitConversion): When in an unsafe
15491         context, we allow conversion between void * to any other pointer
15492         type. This fixes bug #35973.
15493
15494 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15495
15496         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15497         is not thrown when extensionless outputs are used 
15498
15499 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15500
15501         * rootcontext.cs: fixed compilation of corlib.
15502
15503 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15504
15505         * attribute.cs (Attributes.Contains): Add new method.
15506
15507         * class.cs (MethodCore.LabelParameters): if the parameter is an
15508         `out' parameter, check that no attribute `[In]' has been passed.
15509
15510         * enum.cs: Handle the `value__' name in an enumeration.
15511
15512 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15513
15514         * decl.cs: Added special case to allow overrides on "protected
15515         internal" methods
15516
15517 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15518
15519         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15520         since it makes much more sense.
15521
15522         (Attributes.ctor): Don't require a Location parameter.
15523
15524         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15525
15526         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15527         since we already have that information per attribute.
15528
15529         * everywhere : make appropriate changes.
15530
15531         * class.cs (LabelParameters): Write the code which actually
15532         applies attributes to the return type. We can't do this on the MS
15533         .NET runtime so we flag a warning in the case an exception is
15534         thrown.
15535
15536 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15537
15538         * const.cs: Handle implicit null conversions here too.
15539
15540 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15541
15542         * class.cs (MethodCore.LabelParameters): Remove the extra
15543         Type [] parameter since it is completely unnecessary. Instead
15544         pass in the method's attributes so that we can extract
15545         the "return" attribute.
15546
15547 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15548
15549         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15550         of ignoring it and letting the compile continue.
15551
15552         * typemanager.cs (ChangeType): use an extra argument to return an
15553         error condition instead of throwing an exception.
15554
15555 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15556
15557         * expression.cs (Unary.TryReduce): mimic the code for the regular
15558         code path.  Perform an implicit cast in the cases where we can
15559         implicitly convert to one of the integral types, and then reduce
15560         based on that constant.   This fixes bug #35483.
15561
15562 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15563
15564         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15565
15566 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15567
15568         * namespace.cs: fixed bug #35489.
15569
15570 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15571
15572         * class.cs: Remove some dead code.
15573
15574         * cs-parser.jay: Estimate the number of methods needed
15575         (RootContext.MethodCount);
15576
15577         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15578         numbers instead of StringBuilders.
15579
15580         * support.cs (PtrHashtable): Add constructor with initial size;
15581         We can now reduce reallocations of the method table.
15582
15583 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15584
15585         * attribute.cs (ApplyAttributes): Keep track of the emitted
15586         attributes on a per-target basis. This fixes bug #35413.
15587
15588 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15589
15590         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15591         default to the Windows 1252 encoding.
15592
15593         (UnixParseOption): Support version, thanks to Alp for the missing
15594         pointer. 
15595
15596         * AssemblyInfo.cs: Add nice assembly information.
15597
15598         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15599         (bug 35169).
15600
15601         * cs-parser.jay: Allow a trailing comma before the close bracked
15602         in the attribute_section production.
15603
15604         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15605         address of the instance was being taken, I will take this out,
15606         because we take the address of the object immediately here.
15607
15608 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15609
15610         * typemanager.cs (AreMultipleAllowed): Take care of the most
15611         obvious case where attribute type is not in the current assembly -
15612         stupid me ;-)
15613
15614 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15617         definitions, instead of doing that afterwards.  
15618
15619         Also we use a nice little hack, depending on the constructor, we
15620         know if we are a "composed" name or a simple name.  Hence, we
15621         avoid the IndexOf test, and we avoid 
15622
15623         * codegen.cs: Add code to assist in a bug reporter to track down
15624         the source of a compiler crash. 
15625
15626 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15627
15628         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15629         types have been emitted for a given element and flag an error
15630         if something which does not have AllowMultiple set is used more
15631         than once.
15632
15633         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15634         attribute types and their corresponding AllowMultiple properties
15635
15636         (AreMultipleAllowed): Check the property for a given type.
15637
15638         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15639         property in the case we have a TypeContainer.
15640
15641         (Attributes.AddAttribute): Detect duplicates and just skip on
15642         adding them. This trivial fix catches a pretty gross error in our
15643         attribute emission - global attributes were being emitted twice!
15644
15645         Bugzilla bug #33187 is now fixed.
15646
15647 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15648
15649         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15650         instead of pp_and).
15651
15652         * expression.cs (Binary.ResolveOperator): I can only use the
15653         Concat (string, string, string) and Concat (string, string,
15654         string, string) if the child is actually a concatenation of
15655         strings. 
15656
15657 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15658
15659         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15660         context where we need a 2-character lookahead.
15661
15662         * pending.cs (PendingImplementation): Rework so we can keep track
15663         of interface types all the time, and flag those which were
15664         implemented by parents as optional.
15665
15666 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15667
15668         * expression.cs (Binary.ResolveOperator): Use
15669         String.Concat(string,string,string) or
15670         String.Concat(string,string,string,string) when possible. 
15671
15672         * typemanager: More helper methods.
15673
15674
15675 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15676
15677         * pending.cs: remove the bogus return from GetMissingInterfaces()
15678         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15679
15680 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15681
15682         * namespace.cs: avoid duplicated 'using xxx' being added to
15683         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15684         when we get more than one 'using' statement for the same namespace.
15685         Report a CS0105 warning for it.
15686
15687 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15688
15689         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15690         of calling getChar/putback, uses internal knowledge of it.    
15691
15692         (xtoken): Reorder tokenizer so most common patterns are checked
15693         first.  This reduces the compilation time in another 5% (from 8.11s
15694         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15695
15696         The parsing time is 22% of the compilation in mcs, and from that
15697         64% is spent on the tokenization process.  
15698
15699         I tried using a binary search for keywords, but this is slower
15700         than the hashtable.  Another option would be to do a couple of
15701         things:
15702
15703                 * Not use a StringBuilder, instead use an array of chars,
15704                   with a set value.  Notice that this way we could catch
15705                   the 645 error without having to do it *afterwards*.
15706
15707                 * We could write a hand-parser to avoid the hashtable
15708                   compares altogether.
15709
15710         The identifier consumption process takes 37% of the tokenization
15711         time.  Another 15% is spent on is_number.  56% of the time spent
15712         on is_number is spent on Int64.Parse:
15713
15714                 * We could probably choose based on the string length to
15715                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15716                   computations. 
15717
15718         Another 3% is spend on wrapping `xtoken' in the `token' function.
15719
15720         Handle 0xa0 as whitespace (#34752)
15721
15722 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15723
15724         * typemanager.cs (IsCLRType): New routine to tell whether a type
15725         is one of the builtin types.  
15726
15727         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15728         typecode in more places instead of doing pointer comparissions.
15729         We could leverage some knowledge about the way the typecodes are
15730         laid out.
15731
15732         New code to cache namespaces in assemblies, it is currently not
15733         invoked, to be used soon.
15734
15735         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15736
15737         * expression.cs (Binary.ResolveOperator): specially handle
15738         strings, and do not perform user-defined operator overloading for
15739         built-in types.
15740
15741 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15742
15743         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15744         internalcall as it is a pretty simple operation;  Avoid whenever
15745         possible to call Char.IsLetter.
15746
15747         (consume_identifier): Cut by half the number of
15748         hashtable calls by merging the is_keyword and GetKeyword behavior.
15749
15750         Do not short-circuit, because if we do, we
15751         report errors (ie, #if false && true would produce an invalid
15752         directive error);
15753
15754
15755 2002-11-24  Martin Baulig  <martin@ximian.com>
15756
15757         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15758         check constant ranges and report a CS0221.  Fixes #33186.
15759
15760 2002-11-24  Martin Baulig  <martin@ximian.com>
15761
15762         * cs-parser.jay: Make this work for uninitialized variable
15763         declarations in the `for' initializer.  Fixes #32416.
15764
15765 2002-11-24  Martin Baulig  <martin@ximian.com>
15766
15767         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15768         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15769
15770 2002-11-24  Martin Baulig  <martin@ximian.com>
15771
15772         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15773         argument; if true, we also check for user-defined conversions.
15774         This is only needed if both arguments are of a user-defined type.
15775         Fixes #30443, added test-175.cs.
15776         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15777
15778         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15779
15780 2002-11-24  Martin Baulig  <martin@ximian.com>
15781
15782         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15783         function to get the store opcode.
15784         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15785         only emit the Ldelema if the store opcode is Stobj.  You must run
15786         both test-34 and test-167 to test this.  Fixes #34529.
15787
15788 2002-11-23  Martin Baulig  <martin@ximian.com>
15789
15790         * ecore.cs (Expression.MemberLookup): Added additional
15791         `qualifier_type' argument which is used when we're being called
15792         from MemberAccess.DoResolve() and null if we're called from a
15793         SimpleName lookup.
15794         (Expression.MemberLookupFailed): New method to report errors; this
15795         does the CS1540 check and reports the correct error message.
15796
15797         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15798         argument for the CS1540 check and redone the way how we're dealing
15799         with private members.  See the comment in the source code for details.
15800         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15801         `closure_start_type' to `closure_qualifier_type' and check whether
15802         it's not null.  It was not this filter being broken, it was just
15803         being called with the wrong arguments.
15804
15805         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15806         and pass it the correct `qualifier_type'; this also does the error
15807         handling for us.
15808
15809 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15810
15811         * expression.cs (Invocation.EmitParams): If the we are dealing
15812         with a non-built-in value type, load its address as well.
15813
15814         (ArrayCreation): Use a a pretty constant instead
15815         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15816         static initializers.  
15817
15818         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15819         because they are not really value types, just glorified integers. 
15820
15821         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15822
15823         * ecore.cs: Remove redundant code for enumerations, make them use
15824         the same code path as everything else, fixes the casting issue
15825         with enumerations in Windows.Forms.
15826
15827         * attribute.cs: Do only cast to string if it is a string, the
15828         validation happens later.
15829
15830         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15831         people upgrade their corlibs.
15832
15833         * ecore.cs: Oops, enumerations were not following the entire code path
15834
15835 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15836
15837         * typemanager.cs (FilterWithClosure): Commented out the test for
15838         1540 in typemanager.cs, as it has problems when accessing
15839         protected methods from a parent class (see test-174.cs). 
15840
15841         * attribute.cs (Attribute.ValidateGuid): new method.
15842         (Attribute.Resolve): Use above.
15843
15844 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15845
15846         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15847
15848         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15849         handling for enumerations, as we only needed the TypeContainer
15850         functionality to begin with (this is required for the fix below to
15851         work for enums that reference constants in a container class for
15852         example). 
15853
15854         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15855
15856         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15857         a valid TypeBuilder to perform lookups on.o
15858
15859         * class.cs (InheritableMemberSignatureCompare): Use true in the
15860         call to GetGetMethod and GetSetMethod, because we are comparing
15861         the signature, and we need to get the methods *even* if they are
15862         private. 
15863
15864         (PropertyBase.CheckBase): ditto.
15865
15866         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15867         GotoCase.Resolve): Use Peel on EmpytCasts.
15868
15869         * ecore.cs (EmptyCast): drop child, add Peel method.
15870
15871 2002-11-17  Martin Baulig  <martin@ximian.com>
15872
15873         * ecore.cs (EmptyCast.Child): New public property.
15874
15875         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15876         label resolved to an EmptyCast.  Fixes #34162.
15877         (GotoCase.Resolve): Likewise.
15878         (Block.EmitMeta): Likewise.
15879
15880 2002-11-17  Martin Baulig  <martin@ximian.com>
15881
15882         * expression.cs (Invocation.BetterConversion): Prefer int over
15883         uint; short over ushort; long over ulong for integer literals.
15884         Use ImplicitConversionExists instead of StandardConversionExists
15885         since we also need to check for user-defined implicit conversions.
15886         Fixes #34165.  Added test-173.cs.
15887
15888 2002-11-16  Martin Baulig  <martin@ximian.com>
15889
15890         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15891         with the `true' and `false' literals.  Fixes #33151.
15892
15893 2002-11-16  Martin Baulig  <martin@ximian.com>
15894
15895         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15896         October 22nd; don't do the cs1540 check for static members.
15897
15898         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15899         now using our own filter here and doing the cs1540 check again.
15900
15901 2002-11-16  Martin Baulig  <martin@ximian.com>
15902
15903         * support.cs (InternalParameters): Don't crash if we don't have
15904         any fixed parameters.  Fixes #33532.
15905
15906 2002-11-16  Martin Baulig  <martin@ximian.com>
15907
15908         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15909         when looking up static methods to make this work on Windows.
15910         Fixes #33773.
15911
15912 2002-11-16  Martin Baulig  <martin@ximian.com>
15913
15914         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15915         a setter rather than using PropertyInfo.CanWrite.
15916
15917 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15918
15919         * class.cs: Allow acces to block member by subclasses. Fixes build
15920         breaker.
15921
15922 2002-11-14  Martin Baulig  <martin@ximian.com>
15923
15924         * class.cs (Constructor.Emit): Added the extern/block check.
15925         Fixes bug #33678.
15926
15927 2002-11-14  Martin Baulig  <martin@ximian.com>
15928
15929         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15930         iteration while looking for indexers, this is needed because the
15931         indexer may have a different name in our base classes.  Fixed the
15932         error reporting (no indexers at all, not get accessor, no
15933         overloaded match).  Fixes bug #33089.
15934         (IndexerAccess.DoResolveLValue): Likewise.
15935
15936 2002-11-14  Martin Baulig  <martin@ximian.com>
15937
15938         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15939         indexers.  Fixes the first part of bug #33089.
15940         (MethodSignature.InheritableMemberSignatureCompare): Added support
15941         for properties.
15942
15943 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15944
15945         * attribute.cs (Attribute.Resolve): Catch the
15946         NullReferenceException and report it since it isn't supposed to
15947         happen. 
15948
15949 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15950
15951         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15952         LogicalOr and LogicalAnd that can benefit from recursively
15953         handling EmitBranchable.  The code now should be nice for Paolo.
15954
15955 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15956
15957         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15958         the Type lookups, as we perform quite a number of lookups on
15959         non-Types.  This can be removed once we can deterministically tell
15960         whether we have a type or a namespace in advance.
15961
15962         But this might require special hacks from our corlib.
15963
15964         * TODO: updated.
15965
15966         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15967         and double which avoids a conversion from an integer to a double.
15968
15969         * expression.cs: tiny optimization, avoid calling IsConstant,
15970         because it effectively performs the lookup twice.
15971
15972 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15973
15974         But a bogus return here to keep the semantics of the old code
15975         until the Mono runtime is fixed.
15976
15977         * pending.cs (GetMissingInterfaces): New method used to remove all
15978         the interfaces that are already implemented by our parent
15979         classes from the list of pending methods. 
15980
15981         * interface.cs: Add checks for calls after ResolveTypeExpr.
15982
15983 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15984
15985         * class.cs (Class.Emit): Report warning 67: event not used if the
15986         warning level is beyond 3.
15987
15988         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15989         being a NullLiteral.
15990
15991         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15992         specifiers. 
15993
15994         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15995         path that might fail if a type can not be resolved.
15996
15997         * expression.cs (Binary.Emit): Emit unsigned versions of the
15998         operators. 
15999
16000         * driver.cs: use error 5.
16001
16002 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16003
16004         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16005
16006 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16007
16008         * cs-parser.jay (switch_section): A beautiful patch from Martin
16009         Baulig that fixed 33094.
16010
16011 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16014         Check whether the base is abstract and report an error if so.
16015
16016         * expression.cs (IndexerAccess.DoResolveLValue,
16017         IndexerAccess.DoResolve): ditto. 
16018
16019         (Invocation.DoResolve): ditto.
16020
16021         (Invocation.FullMethodDesc): Improve the report string.
16022
16023         * statement.cs (Block): Eliminate IsVariableDefined as it is
16024         basically just a wrapper for GetVariableInfo.
16025
16026         * ecore.cs (SimpleName): Use new 
16027
16028         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16029         type, as we return the actual parameter ref/unref state on a
16030         different call.
16031
16032 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * support.cs: Return proper flags REF/OUT fixing the previous
16035         commit.  
16036
16037         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16038         not used to mean `ref' but `ref or out' in ParameterReference
16039
16040         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16041         full type signature instead of calling TypeManger.CSharpName
16042         ourselves. 
16043
16044         * support.cs (InternalParameters.ParameterDesc): Do not compare
16045         directly to the modflags, because REF/OUT will actually be bitsets
16046         if set. 
16047
16048         * delegate.cs (VerifyMethod): Check also the modifiers.
16049
16050         * cs-tokenizer.cs: Fix bug where floating point values with an
16051         exponent where a sign was missing was ignored.
16052
16053         * driver.cs: Allow multiple assemblies to be specified in a single
16054         /r: argument
16055
16056 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16057
16058         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16059         because identifiers after a parenthesis would end up in this kind
16060         of production, and we needed to desamiguate it for having casts
16061         like:
16062
16063                 (UserDefinedType *) xxx
16064
16065 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16068         we should set on the Bindingflags.NonPublic, but not turn on
16069         private_ok.  private_ok controls whether a Private member is
16070         returned (this is chekced on the filter routine), while the
16071         BindingFlags.NonPublic just controls whether private/protected
16072         will be allowed.   This fixes the problem part of the problem of
16073         private properties being allowed to be used in derived classes.
16074
16075         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16076         so we can call the children DoResolveLValue method (this will
16077         properly signal errors on lvalue assignments to base properties)
16078
16079         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16080         getter are null, and we have a property info, we know that this
16081         happened because the lookup failed, so we report an error 122 for
16082         protection level violation.
16083
16084         We also silently return if setter and getter are null in the
16085         resolve functions, this condition only happens if we have flagged
16086         the error before.  This is the other half of the problem. 
16087
16088         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16089         not have accessibility information, that is why we were returning
16090         true in the filter function in typemanager.cs.
16091
16092         To properly report 122 (property is inaccessible because of its
16093         protection level) correctly, we report this error in ResolveAccess
16094         by failing if both the setter and the getter are lacking (ie, the
16095         lookup failed). 
16096
16097         DoResolve and DoLResolve have been modified to check for both
16098         setter/getter being null and returning silently, the reason being
16099         that I did not want to put the knowledge about this error in upper
16100         layers, like:
16101
16102         int old = Report.Errors;
16103         x = new PropertyExpr (...);
16104         if (old != Report.Errors)
16105                 return null;
16106         else
16107                 return x;
16108
16109         So the property expr is returned, but it is invalid, so the error
16110         will be flagged during the resolve process. 
16111
16112         * class.cs: Remove InheritablePropertySignatureCompare from the
16113         class, as we no longer depend on the property signature to compute
16114         whether it is possible to implement a method or not.
16115
16116         The reason is that calling PropertyInfo.GetGetMethod will return
16117         null (in .NET, in Mono it works, and we should change this), in
16118         cases where the Get Method does not exist in that particular
16119         class.
16120
16121         So this code:
16122
16123         class X { public virtual int A { get { return 1; } } }
16124         class Y : X { }
16125         class Z : Y { public override int A { get { return 2; } } }
16126
16127         Would fail in Z because the parent (Y) would not have the property
16128         defined.  So we avoid this completely now (because the alternative
16129         fix was ugly and slow), and we now depend exclusively on the
16130         method names.
16131
16132         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16133         reference method, instead of using the property.
16134
16135         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16136         routines are gone now.
16137
16138         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16139         names, they were incorrectly named.
16140
16141         * cs-tokenizer.cs: Return are more gentle token on failure. 
16142
16143         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16144         had an out-of-sync index variable, which caused it to remove from
16145         the list of pending methods the wrong method sometimes.
16146
16147 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16148
16149         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16150         CanWrite, because those refer to this particular instance of the
16151         property, and do not take into account the fact that we can
16152         override single members of a property.
16153
16154         Constructor requires an EmitContext.  The resolution process does
16155         not happen here, but we need to compute the accessors before,
16156         because the resolution does not always happen for properties.
16157
16158         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16159         subclass, before we did not update this flag, but we did update
16160         bindingflags. 
16161
16162         (GetAccessors): Drop this routine, as it did not work in the
16163         presence of partially overwritten set/get methods. 
16164
16165         Notice that this broke the cs1540 detection, but that will require
16166         more thinking. 
16167
16168 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16169
16170         * class.cs:
16171         * codegen.cs:
16172         * driver.cs: issue a warning instead of an error if we don't support
16173         debugging for the platform. Also ignore a couple of errors that may
16174         arise when trying to write the symbols. Undo my previous patch.
16175
16176 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16177
16178         * driver.cs: ignore /debug switch except for Unix platforms.
16179
16180 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16181
16182         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16183
16184 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16185
16186         * driver.cs: Do not make mcs-debug conditional, so we do not break
16187         builds that use it.
16188
16189         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16190         review this patch.  But basically after all the children variables
16191         have been merged, the value of "Breaks" was not being set to
16192         new_breaks for Switch blocks.  I think that it should be set after
16193         it has executed.  Currently I set this to the value of new_breaks,
16194         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16195         conservative, but I do not understand this code very well.
16196
16197         I did not break anything in the build, so that is good ;-)
16198
16199         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16200
16201 2002-10-20  Mark Crichton  <crichton@gimp.org>
16202
16203         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16204
16205 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16206
16207         * cfold.cs: Fixed compile blocker.
16208
16209 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16210
16211         * driver.cs: I was chekcing the key, not the file.
16212
16213 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16214
16215         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16216         message that we were generating - we just need to silently return
16217         a null.
16218
16219 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16220
16221         * class.cs (Event.Define): Change my previous commit, as this
16222         breaks the debugger.  This is a temporary hack, as it seems like
16223         the compiler is generating events incorrectly to begin with.
16224
16225         * expression.cs (Binary.ResolveOperator): Added support for 
16226         "U operator - (E x, E y)"
16227
16228         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16229         y)".
16230
16231         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16232         init-only variables, but this path did not take into account that
16233         there might be also instance readonly variables.  Correct this
16234         problem. 
16235
16236         This fixes bug 32253
16237
16238         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16239         delegates as well.
16240
16241         * driver.cs: Change the extension for modules to `netmodule'
16242
16243         * cs-parser.jay: Improved slightly the location tracking for
16244         the debugger symbols.
16245
16246         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16247         modifiers that were specified instead of the hardcoded value
16248         (FamAndAssem).  This was basically ignoring the static modifier,
16249         and others.  Fixes 32429.
16250
16251         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16252         fixed a bug in the process (32476)
16253
16254         * expression.cs (ArrayAccess.EmitAssign): Patch from
16255         hwang_rob@yahoo.ca that fixes bug 31834.3
16256
16257 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16258
16259         * driver.cs: Make the module extension .netmodule.
16260
16261 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16262
16263         * driver.cs: Report an error if the resource file is not found
16264         instead of crashing.
16265
16266         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16267         false, like Emit does.
16268
16269 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16270
16271         * typemanager.cs: Remove unused private member.  Also reported mcs
16272         bug to report this as a warning like csc.
16273
16274 2002-10-15  Martin Baulig  <martin@gnome.org>
16275
16276         * statement.cs (Statement.Emit): Made this a virtual method; emits
16277         the line number info and calls DoEmit().
16278         (Statement.DoEmit): New protected abstract method, formerly knows
16279         as Statement.Emit().
16280
16281         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16282
16283 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16284
16285         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16286         have fixed a remaining problem: not every AddXXXX was adding a
16287         fully qualified name.  
16288
16289         Now everyone registers a fully qualified name in the DeclSpace as
16290         being defined instead of the partial name.  
16291
16292         Downsides: we are slower than we need to be due to the excess
16293         copies and the names being registered this way.  
16294
16295         The reason for this is that we currently depend (on the corlib
16296         bootstrap for instance) that types are fully qualified, because
16297         we dump all the types in the namespace, and we should really have
16298         types inserted into the proper namespace, so we can only store the
16299         basenames in the defined_names array.
16300
16301 2002-10-10  Martin Baulig  <martin@gnome.org>
16302
16303         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16304         from bug #31834, see the bug report for a testcase which is
16305         miscompiled.
16306
16307 2002-10-10  Martin Baulig  <martin@gnome.org>
16308
16309         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16310         flow analysis code for this.
16311
16312         * statement.cs (Do, While, For): Tell the flow analysis code about
16313         infinite loops.
16314         (FlowBranching.UsageVector): Added support for infinite loops.
16315         (Block.Resolve): Moved the dead code elimination here and use flow
16316         analysis to do it.
16317
16318 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16319
16320         * class.cs (Field.Define): Catch cycles on struct type
16321         definitions. 
16322
16323         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16324         fields if the fields are static.  We only need to check instance
16325         fields. 
16326
16327         * expression.cs (As.DoResolve): Test for reference type.
16328
16329         * statement.cs (Using.ResolveExpression): Use
16330         ConvertImplicitRequired, not ConvertImplicit which reports an
16331         error on failture
16332         (Using.ResolveLocalVariableDecls): ditto.
16333
16334         * expression.cs (Binary.ResolveOperator): Report errors in a few
16335         places where we had to.
16336
16337         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16338
16339 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16340
16341         * expression.cs: Use StoreFromPtr instead of extracting the type
16342         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16343
16344         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16345         an enumeration value to a System.Enum, but System.Enum is not a
16346         value type, but an class type, so we need to box.
16347
16348         (Expression.ConvertExplicit): One codepath could return
16349         errors but not flag them.  Fix this.  Fixes #31853
16350
16351         * parameter.cs (Resolve): Do not allow void as a parameter type.
16352
16353 2002-10-06  Martin Baulig  <martin@gnome.org>
16354
16355         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16356         if it's a class type and not a struct.  Fixes #31815.
16357
16358 2002-10-06  Martin Baulig  <martin@gnome.org>
16359
16360         * statement.cs: Reworked the flow analysis code a bit to make it
16361         usable for dead code elimination.
16362
16363 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16364
16365         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16366
16367 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16368
16369         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16370         to fix the test 165, will investigate deeper.
16371
16372 2002-10-04  Martin Baulig  <martin@gnome.org>
16373
16374         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16375         finally blocks actually work.
16376         (Try.Resolve): We don't need to create a sibling for `finally' if
16377         there is no finally block.
16378
16379 2002-10-04  Martin Baulig  <martin@gnome.org>
16380
16381         * class.cs (Constructor.Define): The default accessibility for a
16382         non-default constructor is private, not public.
16383
16384 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16385
16386         * class.cs (Constructor): Make AllowedModifiers public, add
16387         EXTERN.
16388
16389         * cs-parser.jay: Perform the modifiers test here, as the
16390         constructor for the Constructor class usually receives a zero
16391         because of the way we create it (first we create, later we
16392         customize, and we were never checking the modifiers).
16393
16394         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16395         is a version of LookupTypeReflection that includes the type-name
16396         cache.  This can be used as a fast path for functions that know
16397         the fully qualified name and are only calling into *.GetType() to
16398         obtain a composed type.
16399
16400         This is also used by TypeManager.LookupType during its type
16401         composition.
16402
16403         (LookupType): We now also track the real type name, as sometimes
16404         we can get a quey for the real type name from things like
16405         ComposedCast.  This fixes bug 31422.
16406
16407         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16408         complete type fullname, it does not have to go through the type
16409         resolution system to obtain the composed version of the type (for
16410         obtaining arrays or pointers).
16411
16412         (Conditional.Emit): Use the EmitBoolExpression to
16413         generate nicer code, as requested by Paolo.
16414
16415         (ArrayCreation.CheckIndices): Use the patch from
16416         hwang_rob@yahoo.ca to validate the array initializers. 
16417
16418 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16419
16420         * class.cs (ConstructorInitializer.Emit): simplify code by using
16421         Invocation.EmitCall, and at the same time, fix the bugs in calling
16422         parent constructors that took variable arguments. 
16423
16424         * ecore.cs (Expression.ConvertNumericExplicit,
16425         Expression.ImplicitNumericConversion): Remove the code that
16426         manually wrapped decimal (InternalTypeConstructor call is now gone
16427         as well).
16428
16429         * expression.cs (Cast.TryReduce): Also handle decimal types when
16430         trying to perform a constant fold on the type.
16431
16432         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16433
16434         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16435         that only turned off an error report, and did nothing else. 
16436
16437 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16438
16439         * driver.cs: Handle and ignore /fullpaths
16440
16441 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16442
16443         * expression.cs (Binary.ResolveOperator): Catch the case where
16444         DoNumericPromotions returns true, 
16445
16446         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16447
16448 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16449
16450         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16451         report error 70.
16452
16453 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16454
16455         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16456         conversion exists, but it is also required that the conversion be
16457         performed.  This manifested in "(Type64Enum) 2".  
16458
16459         * class.cs (TypeManager.AddMethod): The fix is not to change
16460         AddEnum, because that one was using a fully qualified name (every
16461         DeclSpace derivative does), but to change the AddMethod routine
16462         that was using an un-namespaced name.  This now correctly reports
16463         the duplicated name.
16464
16465         Revert patch until I can properly fix it.  The issue
16466         is that we have a shared Type space across all namespaces
16467         currently, which is wrong.
16468
16469         Options include making the Namespace a DeclSpace, and merge
16470         current_namespace/current_container in the parser.
16471
16472 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16473
16474         * cs-parser.jay: Improve error reporting when we get a different
16475         kind of expression in local_variable_type and
16476         local_variable_pointer_type. 
16477
16478         Propagate this to avoid missleading errors being reported.
16479
16480         * ecore.cs (ImplicitReferenceConversion): treat
16481         TypeManager.value_type as a target just like object_type.   As
16482         code like this:
16483
16484         ValueType v = 1;
16485
16486         Is valid, and needs to result in the int 1 being boxed before it
16487         is assigned to the value type v.
16488
16489         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16490         to validate the enumeration name.
16491
16492         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16493         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16494         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16495
16496         * ecore.cs (TryImplicitIntConversion): When doing an
16497         implicit-enumeration-conversion, check if the type is 64-bits and
16498         perform a conversion before passing to EnumConstant.
16499
16500 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16501
16502         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16503         report ambiguous type references.  Unlike the MS version, we
16504         report what the ambiguity is.   Innovation at work ;-)
16505
16506         (DeclSpace.FindType): Require a location argument to
16507         display when we display an ambiguous error.
16508
16509         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16510
16511         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16512
16513         * expression.cs (EmitDynamicInitializers): Apply patch from
16514         hwang_rob@yahoo.ca that fixes the order in which we emit our
16515         initializers. 
16516
16517 2002-09-21  Martin Baulig  <martin@gnome.org>
16518
16519         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16520         delegate takes no arguments.
16521
16522 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16523
16524         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16525         from integers.
16526
16527         * expression.cs: Extract the underlying type.
16528
16529         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16530
16531         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16532
16533 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16534
16535         * class.cs (TypeContainer.DefineType): We can not use the nice
16536         PackingSize with the size set to 1 DefineType method, because it
16537         will not allow us to define the interfaces that the struct
16538         implements.
16539
16540         This completes the fixing of bug 27287
16541
16542         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16543         means also structs.  This fixes part of the problem. 
16544         (Expresion.ImplicitReferenceConversionExists): ditto.
16545
16546         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16547         error if there were no errors reported during the type lookup
16548         process, to avoid duplicates or redundant errors.  Without this
16549         you would get an ambiguous errors plus a type not found.  We have
16550         beaten the user enough with the first error.  
16551
16552         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16553         reference. 
16554
16555         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16556         during the resolution process, stop the lookup, this avoids
16557         repeated error reports (same error twice).
16558
16559         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16560
16561         * typemanager.cs (LookupType): Redo the type lookup code to match
16562         the needs of System.Reflection.  
16563
16564         The issue is that System.Reflection requires references to nested
16565         types to begin with a "+" sign instead of a dot.  So toplevel
16566         types look like: "NameSpace.TopLevelClass", and nested ones look
16567         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16568         levels. 
16569
16570 2002-09-19  Martin Baulig  <martin@gnome.org>
16571
16572         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16573         says that a method always returns or always throws an exception,
16574         don't report the CS0161.
16575
16576         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16577         set `Returns = new_returns'.
16578
16579 2002-09-19  Martin Baulig  <martin@gnome.org>
16580
16581         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16582         to an enum constant, check for a CS0176.
16583
16584 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16585
16586         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16587         for operators that must be in pairs and report errors.
16588
16589         * ecore.cs (SimpleName.DoResolveType): During the initial type
16590         resolution process, when we define types recursively, we must
16591         check first for types in our current scope before we perform
16592         lookups in the enclosing scopes.
16593
16594         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16595
16596         (Invocation.VerifyArgumentsCompat): Call
16597         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16598         I thought we were supposed to always call this, but there are a
16599         few places in the code where we dont do it.
16600
16601 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16602
16603         * driver.cs: Add support in -linkres and -resource to specify the
16604         name of the identifier.
16605
16606 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * ecore.cs (StandardConversionExists): Sync with the conversion
16609         code: allow anything-* to void* conversions.
16610
16611         (FindMostSpecificSource): Use an Expression argument
16612         instead of a Type, because we might be handed over a Literal which
16613         gets a few more implicit conversions that plain types do not.  So
16614         this information was being lost.
16615
16616         Also, we drop the temporary type-holder expression when not
16617         required.
16618
16619 2002-09-17  Martin Baulig  <martin@gnome.org>
16620
16621         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16622         this is an explicit interface implementation.
16623
16624 2002-09-17  Martin Baulig  <martin@gnome.org>
16625
16626         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16627         different `IndexerName' attributes.
16628
16629         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16630         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16631         virtual CommonResolve().
16632
16633 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16634
16635         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16636         and convert that to the UnderlyingType.
16637
16638         * statement.cs (Foreach.Resolve): Indexers are just like variables
16639         or PropertyAccesses.
16640
16641         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16642         inside quoted strings, we were not doing this before.
16643
16644 2002-09-16  Martin Baulig  <martin@gnome.org>
16645
16646         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16647         resolve it.  This is needed for the definite assignment check of the
16648         instance expression, fixes bug #29846.
16649         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16650
16651 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16652
16653         * parameter.cs: Fix compile error.  Cannot reference static member
16654         from an instance object.  Is this an mcs bug?
16655
16656 2002-09-14  Martin Baulig  <martin@gnome.org>
16657
16658         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16659         multiple times.  Fixes bug #30295, added test-166.cs.
16660
16661 2002-09-14  Martin Baulig  <martin@gnome.org>
16662
16663         * statement.cs (Block.Emit): Don't emit unreachable code.
16664         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16665         `break' statements.
16666         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16667
16668 2002-09-14  Martin Baulig  <martin@gnome.org>
16669
16670         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16671         is set.
16672
16673 2002-09-14  Martin Baulig  <martin@gnome.org>
16674
16675         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16676         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16677         be false on the ms runtime.
16678
16679 2002-09-13  Martin Baulig  <martin@gnome.org>
16680
16681         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16682         the CS0038 error message.
16683
16684 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16685
16686         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16687         constant inside, return it.
16688
16689 2002-09-12  Martin Baulig  <martin@gnome.org>
16690
16691         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16692         implicit conversion can be done between enum types.
16693
16694         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16695         check whether an implicit conversion to the current enum's UnderlyingType
16696         exists and report an error if not.
16697
16698         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16699         without debugging support.
16700
16701         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16702         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16703
16704 2002-09-12  Martin Baulig  <martin@gnome.org>
16705
16706         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16707
16708         * ecore.cs (IMemberExpr.DeclaringType): New property.
16709         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16710         nonstatic member of an outer type (CS0038).
16711
16712 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16713
16714         * driver.cs: Activate the using-error detector at warning level
16715         4 (at least for MS-compatible APIs).
16716
16717         * namespace.cs (VerifyUsing): Small buglett fix.
16718
16719         * pending.cs (PendingImplementation): pass the container pointer. 
16720
16721         * interface.cs (GetMethods): Allow for recursive definition.  Long
16722         term, I would like to move every type to support recursive
16723         definitions, not the current ordering mechanism that we have right
16724         now.
16725
16726         The situation is this: Attributes are handled before interfaces,
16727         so we can apply attributes to interfaces.  But some attributes
16728         implement interfaces, we will now handle the simple cases
16729         (recursive definitions will just get an error).  
16730
16731         * parameter.cs: Only invalidate types at the end if we fail to
16732         lookup all types.  
16733
16734 2002-09-09  Martin Baulig  <martin@gnome.org>
16735
16736         * ecore.cs (PropertyExpr.Emit): Also check for
16737         TypeManager.system_int_array_get_length so this'll also work when
16738         compiling corlib.  Fixes #30003.
16739
16740 2002-09-09  Martin Baulig  <martin@gnome.org>
16741
16742         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16743         and throw an exception if we can't get the type's size.  Fixed #30040,
16744         added test-165.cs.
16745
16746 2002-09-09  Martin Baulig  <martin@gnome.org>
16747
16748         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16749
16750         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16751         context.  Fixes bug #30027.
16752
16753         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16754         virtual functions.  Fixes bug #30043, added test-164.cs.
16755
16756 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16757
16758         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16759
16760 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16761
16762         * driver.cs: Use an object to get the windows codepage since it's not a
16763         static property.
16764
16765 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16766
16767         * statement.cs (For.Emit): for infinite loops (test == null)
16768         return whether there is a break inside, not always "true".
16769
16770         * namespace.cs (UsingEntry): New struct to hold the name of the
16771         using definition, the location where it is defined, and whether it
16772         has been used in a successful type lookup.
16773
16774         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16775         strings.
16776
16777         * decl.cs: ditto.
16778
16779 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16780
16781         * attribute.cs : Fix incorrect code which relied on catching
16782         a NullReferenceException to detect a null being passed in
16783         where an object was expected.
16784
16785 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16786
16787         * statement.cs (Try): flag the catch variable as assigned
16788
16789         * expression.cs (Cast): Simplified by using ResolveType instead of
16790         manually resolving.
16791
16792         * statement.cs (Catch): Fix bug by using ResolveType.
16793
16794 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16795
16796         * expression.cs (BetterConversion): Special case for when we have
16797         a NullLiteral as the argument and we have to choose between string
16798         and object types - we choose string the way csc does.
16799
16800         * attribute.cs (Attribute.Resolve): Catch the
16801         NullReferenceException and report error #182 since the Mono
16802         runtime no more has the bug and having this exception raised means
16803         we tried to select a constructor which takes an object and is
16804         passed a null.
16805
16806 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16807
16808         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16809         message (1502, 1503) when we can't locate a method after overload
16810         resolution. This is much more informative and closes the bug
16811         Miguel reported.
16812
16813         * interface.cs (PopulateMethod): Return if there are no argument
16814         types. Fixes a NullReferenceException bug.
16815
16816         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16817         expressions too. Previously we were checking only in one place for
16818         positional arguments leaving out named arguments.
16819
16820         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16821         type to the enum type is not allowed. Remove code corresponding to
16822         that.
16823
16824         (ConvertNumericExplicit): Allow explicit conversions from
16825         the underlying type to enum type. This precisely follows the spec
16826         and closes a bug filed by Gonzalo.
16827
16828 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16829
16830         * compiler.csproj:
16831         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16832
16833 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16834
16835         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16836         it was important that we stored the right value after the
16837         reduction in `converted'.
16838
16839 2002-09-04  Martin Baulig  <martin@gnome.org>
16840
16841         * location.cs (Location.SymbolDocument): Use full pathnames for the
16842         source files.
16843
16844 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16845
16846         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16847         of the expression resolve mechanism, because that will catch the
16848         SimpleName error failures.
16849
16850         (Conditional): If we can not resolve the
16851         expression, return, do not crash.
16852
16853 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16854
16855         * cs-tokenizer.cs:
16856         (location): display token name instead of its number.
16857
16858 2002-08-28  Martin Baulig  <martin@gnome.org>
16859
16860         * expression.cs (Binary.ResolveOperator): Don't silently return
16861         but return an error if an operator cannot be applied between two
16862         enum types.
16863
16864 2002-08-28  Martin Baulig  <martin@gnome.org>
16865
16866         * class.cs (Constructor.Define): Set the permission attributes
16867         correctly instead of making all constructors public.
16868
16869 2002-08-28  Martin Baulig  <martin@gnome.org>
16870
16871         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16872         for private members before reporting a CS0103; if we find anything,
16873         it's a CS0122.
16874
16875 2002-08-28  Martin Baulig  <martin@gnome.org>
16876
16877         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16878         to check whether `closure_start_type == closure_invocation_type',
16879         we also need to check whether `m.DeclaringType == closure_invocation_type'
16880         before bypassing the permission checks.  We might be accessing
16881         protected/private members from the base class.
16882         (TypeManager.RealMemberLookup): Only set private_ok if private
16883         members were requested via BindingFlags.NonPublic.
16884
16885         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16886
16887         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16888         MethodGroupExpr.IsExplicitImpl if appropriate.
16889         (Invocation.DoResolve): Don't report the CS0120 for explicit
16890         interface implementations.
16891
16892 2002-08-27  Martin Baulig  <martin@gnome.org>
16893
16894         * expression.cs (Invocation.DoResolve): If this is a static
16895         method and we don't have an InstanceExpression, we must report
16896         a CS0120.
16897
16898 2002-08-25  Martin Baulig  <martin@gnome.org>
16899
16900         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16901         `==' between a valuetype and an object.
16902
16903 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16904
16905         * ecore.cs (TypeExpr): Provide a ToString method.
16906
16907 2002-08-24  Martin Baulig  <martin@gnome.org>
16908
16909         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16910         now called proggie.dbg and it's a binary file.
16911
16912 2002-08-23  Martin Baulig  <martin@gnome.org>
16913
16914         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16915
16916 2002-08-23  Martin Baulig  <martin@gnome.org>
16917
16918         * struct.cs (MyStructInfo.ctor): Make this work with empty
16919         structs; it's not allowed to use foreach() on null.
16920
16921 2002-08-23  Martin Baulig  <martin@gnome.org>
16922
16923         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16924         writer the full pathname of the generated assembly.
16925
16926 2002-08-23  Martin Baulig  <martin@gnome.org>
16927
16928         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16929         A `finally' block never returns or breaks; improved handling of
16930         unreachable code.
16931
16932 2002-08-23  Martin Baulig  <martin@gnome.org>
16933
16934         * statement.cs (Throw.Resolve): Allow `throw null'.
16935
16936 2002-08-23  Martin Baulig  <martin@gnome.org>
16937
16938         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16939         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16940         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16941         MemberLookup would return a wrong event if this is an explicit
16942         interface implementation and the class has an event with the same
16943         name.
16944
16945 2002-08-23  Martin Baulig  <martin@gnome.org>
16946
16947         * statement.cs (Block.AddChildVariableNames): New public method.
16948         (Block.AddChildVariableName): Likewise.
16949         (Block.IsVariableNameUsedInChildBlock): Likewise.
16950         (Block.AddVariable): Check whether a variable name has already
16951         been used in a child block.
16952
16953         * cs-parser.jay (declare_local_variables): Mark all variable names
16954         from the current block as being used in a child block in the
16955         implicit block.
16956
16957 2002-08-23  Martin Baulig  <martin@gnome.org>
16958
16959         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16960         find the symbol writer.
16961
16962         * driver.cs: csc also allows the arguments to /define being
16963         separated by commas, not only by semicolons.
16964
16965 2002-08-23  Martin Baulig  <martin@gnome.org>
16966
16967         * interface.cs (Interface.GetMembers): Added static check for events.
16968
16969 2002-08-15  Martin Baulig  <martin@gnome.org>
16970
16971         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16972         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16973
16974         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16975         why the MethodData.EmitDestructor() change was necessary.
16976
16977 2002-08-20  Martin Baulig  <martin@gnome.org>
16978
16979         * class.cs (TypeContainer.FindMembers): Added static check for events.
16980
16981         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16982
16983         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16984         use Type.GetEvents(), not Type.FindMembers().
16985
16986 2002-08-20  Martin Baulig  <martin@gnome.org>
16987
16988         * decl.cs (MemberCache): Added a special method cache which will
16989         be used for method-only searched.  This ensures that a method
16990         search will return a MethodInfo with the correct ReflectedType for
16991         inherited methods.      
16992
16993 2002-08-20  Martin Baulig  <martin@gnome.org>
16994
16995         * decl.cs (DeclSpace.FindMembers): Made this public.
16996
16997 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16998
16999         * delegate.cs: fixed build on windows.
17000         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17001
17002 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17003
17004         * ecore.cs (StandardConversionExists): Return a false
17005         if we are trying to convert the void type to anything else
17006         since that is not allowed.
17007
17008         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17009         we flag error 70 in the event an event is trying to be accessed
17010         directly from outside the declaring type.
17011
17012 2002-08-20  Martin Baulig  <martin@gnome.org>
17013
17014         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17015         MemberCache from typemanager.cs to decl.cs.
17016
17017 2002-08-19  Martin Baulig  <martin@gnome.org>
17018
17019         * class.cs (TypeContainer): Implement IMemberContainer.
17020         (TypeContainer.DefineMembers): Create the MemberCache.
17021         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17022         return public members if BindingFlags.Public was given, check
17023         whether members are static.
17024
17025 2002-08-16  Martin Baulig  <martin@gnome.org>
17026
17027         * decl.cs (DeclSpace.Define): Splitted this in Define and
17028         DefineMembers.  DefineMembers is called first and initializes the
17029         MemberCache.
17030
17031         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17032         DefineMembers() on all our DeclSpaces.
17033
17034         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17035         but call DefineMembers() on all nested interfaces.  We call their
17036         Define() in our new Define() function.
17037
17038         * interface.cs (Interface): Implement IMemberContainer.
17039         (Interface.Define): Moved all code except the attribute stuf to
17040         DefineMembers().
17041         (Interface.DefineMembers): Initialize the member cache.
17042
17043         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17044         need this anymore since we can use MemberCache.FindMembers directly.
17045
17046 2002-08-19  Martin Baulig  <martin@gnome.org>
17047
17048         * typemanager.cs (MemberCache): When creating the cache for an
17049         interface type, add all inherited members.
17050         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17051         to `out bool used_cache' and documented it.
17052         (TypeManager.MemberLookup): If we already used the cache in the first
17053         iteration, we don't need to do the interfaces check.
17054
17055 2002-08-19  Martin Baulig  <martin@gnome.org>
17056
17057         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17058         here from IMemberFinder and don't implement this interface anymore.
17059         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17060
17061         * typemanager.cs (IMemberFinder): This interface is now only used by
17062         classes which actually support the member cache.
17063         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17064         since we only put DeclSpaces into this Hashtable.
17065         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17066         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17067
17068 2002-08-16  Martin Baulig  <martin@gnome.org>
17069
17070         * typemanager.cs (ICachingMemberFinder): Removed.
17071         (IMemberFinder.MemberCache): New property.
17072         (TypeManager.FindMembers): Merged this with RealFindMembers().
17073         This function will never be called from TypeManager.MemberLookup()
17074         so we can't use the cache here, just the IMemberFinder.
17075         (TypeManager.MemberLookup_FindMembers): Check whether the
17076         IMemberFinder has a MemberCache and call the cache's FindMembers
17077         function.
17078         (MemberCache): Rewrote larger parts of this yet another time and
17079         cleaned it up a bit.
17080
17081 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17082
17083         * driver.cs (LoadArgs): Support quoting.
17084
17085         (Usage): Show the CSC-like command line arguments.
17086
17087         Improved a few error messages.
17088
17089 2002-08-15  Martin Baulig  <martin@gnome.org>
17090
17091         * typemanager.cs (IMemberContainer.Type): New property.
17092         (IMemberContainer.IsInterface): New property.
17093
17094         The following changes are conditional to BROKEN_RUNTIME, which is
17095         defined at the top of the file.
17096
17097         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17098         class'es members, but add all members from TypeHandle.ObjectType
17099         if we're an interface.
17100         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17101         is the current type.
17102         (MemberCache.CacheEntry.Container): Removed this field.
17103         (TypeHandle.GetMembers): Include inherited members.
17104
17105 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17106
17107         * typemanager.cs: fixed compilation and added a comment on a field that
17108         is never used.
17109
17110 2002-08-15  Martin Baulig  <martin@gnome.org>
17111
17112         * class.cs (ConstructorInitializer.Resolve): In the
17113         Expression.MemberLookup call, use the queried_type as
17114         invocation_type.
17115
17116         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17117         declared' attribute, it's always true.
17118         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17119         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17120         temporary wrapper for FindMembers which tells MemberLookup whether
17121         members from the base classes are included in the return value.
17122         This will go away soon.
17123         (TypeManager.MemberLookup): Use this temporary hack here; once the
17124         new MemberCache is completed, we don't need to do the DeclaredOnly
17125         looping here anymore since the MemberCache will take care of this.
17126         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17127         (MemberCache): When creating the MemberCache for a class, get
17128         members from the current class and all its base classes.
17129         (MemberCache.CacheEntry.Container): New field.  This is a
17130         temporary hack until the Mono runtime is fixed to distinguish
17131         between ReflectedType and DeclaringType.  It allows us to use MCS
17132         with both the MS runtime and the unfixed Mono runtime without
17133         problems and without accecting performance.
17134         (MemberCache.SearchMembers): The DeclaredOnly looping from
17135         TypeManager.MemberLookup is now done here.      
17136
17137 2002-08-14  Martin Baulig  <martin@gnome.org>
17138
17139         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17140         Type.GetFields on dynamic types but get the fields from the
17141         corresponding TypeContainer.
17142         (MyStructInfo.GetStructInfo): Added check for enum types.
17143
17144         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17145         (MemberList.SyncRoot): Implemented.
17146         (TypeManager.FilterWithClosure): No need to check permissions if
17147         closure_start_type == closure_invocation_type, don't crash if
17148         closure_invocation_type is null.
17149
17150 2002-08-13  Martin Baulig  <martin@gnome.org>
17151
17152         Rewrote TypeContainer.FindMembers to use a member cache.  This
17153         gives us a speed increase of about 35% for the self-hosting MCS
17154         build and of about 15-20% for the class libs (both on GNU/Linux).
17155
17156         * report.cs (Timer): New class to get enhanced profiling.  This
17157         whole class is "TIMER" conditional since it remarkably slows down
17158         compilation speed.
17159
17160         * class.cs (MemberList): New class.  This is an IList wrapper
17161         which we're now using instead of passing MemberInfo[]'s around to
17162         avoid copying this array unnecessarily.
17163         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17164         (ICachingMemberFinder, IMemberContainer): New interface.
17165         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17166         has already been checked, otherwise use it for the name comparision.
17167         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17168         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17169         if possible.  Returns a MemberList, not a MemberInfo [].
17170         (TypeHandle): New class, implements IMemberContainer.  We create
17171         one instance of this class per type, it contains a MemberCache
17172         which is used to do the member lookups.
17173         (MemberCache): New class.  Each instance of this class contains
17174         all members of a type and a name-based hash table.
17175         (MemberCache.FindMembers): This is our new member lookup
17176         function.  First, it looks up all members of the requested name in
17177         the hash table.  Then, it walks this list and sorts out all
17178         applicable members and returns them.
17179
17180 2002-08-13  Martin Baulig  <martin@gnome.org>
17181
17182         In addition to a nice code cleanup, this gives us a performance
17183         increase of about 1.4% on GNU/Linux - not much, but it's already
17184         half a second for the self-hosting MCS compilation.
17185
17186         * typemanager.cs (IMemberFinder): New interface.  It is used by
17187         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17188         Enum, Delegate or Interface.
17189         (TypeManager.finder_to_member_finder): New PtrHashtable.
17190         (TypeManager.finder_to_container): Removed.
17191         (TypeManager.finder_to_delegate): Removed.
17192         (TypeManager.finder_to_interface): Removed.
17193         (TypeManager.finder_to_enum): Removed.
17194
17195         * interface.cs (Interface): Implement IMemberFinder.
17196
17197         * delegate.cs (Delegate): Implement IMemberFinder.
17198
17199         * enum.cs (Enum): Implement IMemberFinder.
17200
17201         * class.cs (TypeContainer): Implement IMemberFinder.
17202
17203 2002-08-12  Martin Baulig  <martin@gnome.org>
17204
17205         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17206
17207 2002-08-12  Martin Baulig  <martin@gnome.org>
17208
17209         * ecore.cs (ITypeExpression): New interface for expressions which
17210         resolve to a type.
17211         (TypeExpression): Renamed to TypeLookupExpression.
17212         (Expression.DoResolve): If we're doing a types-only lookup, the
17213         expression must implement the ITypeExpression interface and we
17214         call DoResolveType() on it.
17215         (SimpleName): Implement the new ITypeExpression interface.
17216         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17217         hack, the situation that we're only looking up types can't happen
17218         anymore when this method is called.  Moved the type lookup code to
17219         DoResolveType() and call it.
17220         (SimpleName.DoResolveType): This ITypeExpression interface method
17221         is now doing the types-only lookup.
17222         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17223         (ResolveFlags): Added MaskExprClass.
17224
17225         * expression.cs (MemberAccess): Implement the ITypeExpression
17226         interface.
17227         (MemberAccess.DoResolve): Added support for a types-only lookup
17228         when we're called via ITypeExpression.DoResolveType().
17229         (ComposedCast): Implement the ITypeExpression interface.
17230
17231         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17232         Expression.Resolve() with ResolveFlags.Type instead.
17233
17234 2002-08-12  Martin Baulig  <martin@gnome.org>
17235
17236         * interface.cs (Interface.Define): Apply attributes.
17237
17238         * attribute.cs (Attribute.ApplyAttributes): Added support for
17239         interface attributes.
17240
17241 2002-08-11  Martin Baulig  <martin@gnome.org>
17242
17243         * statement.cs (Block.Emit): Only check the "this" variable if we
17244         do not always throw an exception.
17245
17246         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17247         whether the property has a set accessor.
17248
17249 2002-08-11  Martin Baulig  <martin@gnome.org>
17250
17251         Added control flow analysis support for structs.
17252
17253         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17254         with control flow analysis turned off.
17255         (IVariable): New interface.
17256         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17257         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17258         (FieldExpr.DoResolve): Resolve the instance expression with flow
17259         analysis turned off and do the definite assignment check after the
17260         resolving when we know what the expression will resolve to.
17261
17262         * expression.cs (LocalVariableReference, ParameterReference):
17263         Implement the new IVariable interface, only call the flow analysis
17264         code if ec.DoFlowAnalysis is true.
17265         (This): Added constructor which takes a Block argument.  Implement
17266         the new IVariable interface.
17267         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17268         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17269         This does the definite assignment checks for struct members.
17270
17271         * class.cs (Constructor.Emit): If this is a non-static `struct'
17272         constructor which doesn't have any initializer, call
17273         Block.AddThisVariable() to tell the flow analysis code that all
17274         struct elements must be initialized before control returns from
17275         the constructor.
17276
17277         * statement.cs (MyStructInfo): New public class.
17278         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17279         argument to this indexer.  If non-zero, check an individual struct
17280         member, not the whole struct.
17281         (FlowBranching.CheckOutParameters): Check struct members.
17282         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17283         overloaded versions of these methods which take an additional
17284         `int field_idx' argument to check struct members.
17285         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17286         overloaded versions of these methods which take an additional
17287         `string field_name' argument to check struct member.s
17288         (VariableInfo): Implement the IVariable interface.
17289         (VariableInfo.StructInfo): New public property.  Returns the
17290         MyStructInfo instance of the variable if it's a struct or null.
17291         (Block.AddThisVariable): New public method.  This is called from
17292         Constructor.Emit() for non-static `struct' constructor which do
17293         not have any initializer.  It creates a special variable for the
17294         "this" instance variable which will be checked by the flow
17295         analysis code to ensure that all of the struct's fields are
17296         initialized before control returns from the constructor.
17297         (UsageVector): Added support for struct members.  If a
17298         variable/parameter is a struct with N members, we reserve a slot
17299         in the usage vector for each member.  A struct is considered fully
17300         initialized if either the struct itself (slot 0) or all its
17301         members are initialized.
17302
17303 2002-08-08  Martin Baulig  <martin@gnome.org>
17304
17305         * driver.cs (Driver.MainDriver): Only report an error CS5001
17306         if there were no compilation errors.
17307
17308         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17309         `UnsafeContext' property to determine whether the parent is in
17310         unsafe context rather than checking the parent's ModFlags:
17311         classes nested in an unsafe class are unsafe as well.
17312
17313 2002-08-08  Martin Baulig  <martin@gnome.org>
17314
17315         * statement.cs (UsageVector.MergeChildren): Distinguish between
17316         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17317         we return.  Added test17() and test18() to test-154.cs.
17318
17319 2002-08-08  Martin Baulig  <martin@gnome.org>
17320
17321         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17322         Family access, make sure the invoking type isn't a subclass of the
17323         queried type (that'd be a CS1540).
17324
17325         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17326         this method which takes an additional `Type invocation_type'.
17327
17328         * expression.cs (BaseAccess.DoResolve): Use the base type as
17329         invocation and query type.
17330         (MemberAccess.DoResolve): If the lookup failed and we're about to
17331         report a CS0122, try a lookup with the ec.ContainerType - if this
17332         succeeds, we must report a CS1540.
17333
17334 2002-08-08  Martin Baulig  <martin@gnome.org>
17335
17336         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17337         (MethodGroupExpr): Implement the IMemberExpr interface.
17338
17339         * expression (MemberAccess.ResolveMemberAccess): No need to have
17340         any special code for MethodGroupExprs anymore, they're now
17341         IMemberExprs.   
17342
17343 2002-08-08  Martin Baulig  <martin@gnome.org>
17344
17345         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17346         Family, FamANDAssem and FamORAssem permissions.
17347         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17348
17349 2002-08-08  Martin Baulig  <martin@gnome.org>
17350
17351         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17352         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17353         or loop block.
17354
17355 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17356
17357         * driver.cs: implemented /resource option to embed managed resources.
17358
17359 2002-08-07  Martin Baulig  <martin@gnome.org>
17360
17361         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17362         (FieldBase.HasFieldInitializer): New public property.
17363         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17364         returns the field initializer and makes sure it is only resolved once.
17365         (TypeContainer.EmitFieldInitializers): Call
17366         FieldBase.GetInitializerExpression to get the initializer, this ensures
17367         that it isn't resolved multiple times.
17368
17369         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17370         the resolving process (SimpleName/MemberLookup) that we're currently
17371         emitting a field initializer (which must not access any instance members,
17372         this is an error CS0236).
17373
17374         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17375         argument, if the `IsFieldInitializer' flag is set, we must report and
17376         error CS0236 and not an error CS0120.   
17377
17378 2002-08-07  Martin Baulig  <martin@gnome.org>
17379
17380         * ecore.cs (IMemberExpr): New public interface.
17381         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17382         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17383         if the expression is an IMemberExpr.
17384
17385         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17386         to be null, implicitly default to `this' if we're non-static in
17387         this case.  Simplified the code a lot by using the new IMemberExpr
17388         interface.  Also fixed bug #28176 here.
17389
17390 2002-08-06  Martin Baulig  <martin@gnome.org>
17391
17392         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17393         ParameterReferences during semantic analysis so that we can do a
17394         type-only search when resolving Cast, TypeOf and SizeOf.
17395         (block): Pass the `current_local_parameters' to the Block's
17396         constructor.
17397
17398         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17399         argument to the constructor.
17400         (ConstructorInitializer.Resolve): Create a temporary implicit
17401         block with the parameters.
17402
17403         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17404         references here if we aren't doing a type-only search.
17405
17406         * statement.cs (Block): Added constructor which takes a
17407         `Parameters parameters' argument.
17408         (Block.Parameters): New public property.
17409
17410         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17411         to `Parameters' and made it public readonly.
17412
17413 2002-08-06  Martin Baulig  <martin@gnome.org>
17414
17415         * ecore.cs (Expression.Warning): Made this public as well.
17416
17417         * report.cs (Report.Debug): Print the contents of collections.
17418
17419 2002-08-06  Martin Baulig  <martin@gnome.org>
17420
17421         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17422         used to tell Resolve() which kinds of expressions it may return.
17423         (Expression.Resolve): Added overloaded version of this method which
17424         takes a `ResolveFlags flags' argument.  This can be used to tell
17425         Resolve() which kinds of expressions it may return.  Reports a
17426         CS0118 on error.
17427         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17428         ResolveFlags.SimpleName.
17429         (Expression.Error118): Added overloaded version of this method which
17430         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17431         which kinds of expressions are allowed.
17432
17433         * expression.cs (Argument.ResolveMethodGroup): New public method.
17434         Resolves an argument, but allows a MethodGroup to be returned.
17435         This is used when invoking a delegate.
17436
17437         * TODO: Updated a bit.
17438
17439 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17440
17441         Fixed compilation with csc.
17442
17443         * ecore.cs: Expression.Error made public. Is this correct? Should
17444         Warning be made public too?
17445
17446         * expression.cs: use ea.Location instead of ea.loc.
17447         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17448
17449 2002-08-06  Martin Baulig  <martin@gnome.org>
17450
17451         * ecore.cs (Expression.loc): Moved the location here instead of
17452         duplicating it in all derived classes.
17453         (Expression.Location): New public property.
17454         (Expression.Error, Expression.Warning): Made them non-static and
17455         removed the location argument.
17456         (Expression.Warning): Added overloaded version which takes an
17457         `int level' argument.
17458         (Expression.Error118): Make this non-static and removed the
17459         expression and location arguments.
17460         (TypeExpr): Added location argument to the constructor.
17461
17462         * expression.cs (StaticCallExpr): Added location argument to
17463         the constructor.
17464         (Indirection, PointerArithmetic): Likewise.
17465         (CheckedExpr, UnCheckedExpr): Likewise.
17466         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17467         (StringPtr): Likewise.
17468
17469
17470 2002-08-05  Martin Baulig  <martin@gnome.org>
17471
17472         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17473
17474         * assign.cs (Assign.DoResolve): Check whether the source
17475         expression is a value or variable.
17476
17477         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17478         while resolving the corresponding blocks.
17479
17480         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17481         an error, don't silently return null.
17482
17483         * statement.cs (Block.AddVariable): Do the error reporting here
17484         and distinguish between CS0128 and CS0136.
17485         (Block.DoResolve): Report all unused labels (warning CS0164).
17486         (LabeledStatement): Pass the location to the constructor.
17487         (LabeledStatement.HasBeenReferenced): New property.
17488         (LabeledStatement.Resolve): Set it to true here.
17489
17490         * statement.cs (Return.Emit): Return success even after reporting
17491         a type mismatch error (CS0126 or CS0127), this is what csc does and
17492         it avoids confusing the users with any consecutive errors.
17493
17494 2002-08-05  Martin Baulig  <martin@gnome.org>
17495
17496         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17497
17498         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17499
17500         * expression.cs (MemberAccess.DoResolve): Silently return if an
17501         error has already been reported.
17502
17503         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17504         error has already been reported.
17505
17506 2002-08-05  Martin Baulig  <martin@gnome.org>
17507
17508         * statement.cs (UsageVector): Only initialize the `parameters'
17509         vector if we actually have any "out" parameters.
17510
17511 2002-08-05  Martin Baulig  <martin@gnome.org>
17512
17513         * expression.cs (Binary.ResolveOperator): When combining delegates,
17514         they must have the same type.
17515
17516 2002-08-05  Martin Baulig  <martin@gnome.org>
17517
17518         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17519         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17520         work with the ms runtime and we also don't need it: if we're a
17521         PropertyBuilder and not in the `indexer_arguments' hash, then we
17522         are a property and not an indexer.
17523
17524         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17525         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17526         since the latter one doesn't work with the ms runtime.
17527
17528 2002-08-03  Martin Baulig  <martin@gnome.org>
17529
17530         Fixed bugs #27998 and #22735.
17531
17532         * class.cs (Method.IsOperator): New public field.
17533         (Method.CheckBase): Report CS0111 if there's already a method
17534         with the same parameters in the current class.  Report CS0508 when
17535         attempting to change the return type of an inherited method.
17536         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17537         and it's not marked abstract or extern.
17538         (PropertyBase): New abstract base class for Property and Indexer.
17539         (PropertyBase.CheckBase): Moved here from Property and made it work
17540         for indexers.
17541         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17542         the same so we can reuse it there.
17543         (Property, Indexer): Derive from PropertyBase.
17544         (MethodSignature.inheritable_property_signature_filter): New delegate
17545         to find properties and indexers.
17546
17547         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17548         argument and improved error reporting.
17549
17550         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17551         EmptyReadOnlyParameters and made it a property.
17552
17553         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17554         version of this method which takes a `PropertyInfo indexer'.
17555         (TypeManager.RegisterIndexer): New method.
17556
17557         * class.cs: Added myself as author of this file :-)
17558
17559 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17560
17561         * class.cs: fixed compilation on windoze.
17562
17563 2002-08-03  Martin Baulig  <martin@gnome.org>
17564
17565         * interface.cs (Interface.GetInterfaceBases): Check whether all
17566         base interfaces are at least as accessible than the current one.
17567
17568         * class.cs (TypeContainer.GetClassBases): Check whether base types
17569         are at least as accessible than the current type.
17570         (TypeContainer.AsAccessible): Implemented and made non-static.
17571         (MemberBase.CheckParameters): Report errors if the accessibility
17572         checks fail.
17573
17574         * delegate.cs (Delegate.Delegate): The default visibility is
17575         internal for top-level types and private for nested types.
17576         (Delegate.Define): Report errors if the accessibility checks fail.
17577
17578         * enum.cs (Enum.Enum): The default visibility is internal for
17579         top-level types and private for nested types.
17580         (Enum.DefineType): Compute the correct visibility.
17581
17582         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17583         function which takes a `bool is_toplevel' instead of a TypeContainer.
17584
17585         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17586         builtin type.
17587
17588 2002-08-02  Martin Baulig  <martin@gnome.org>
17589
17590         * expression.cs (LocalVariableReferenc): Added constructor which
17591         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17592         (LocalVariableReference.IsReadOnly): New property.
17593         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17594         variable is readonly, use our own readonly flag to do this; you can
17595         use the new constructor to get a writable reference to a read-only
17596         variable.
17597
17598         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17599         reference to the local variable.
17600
17601 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17602
17603         * rootcontext.cs (ResolveCore): Also include System.Exception
17604
17605         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17606         we reach an EmptyStatement.
17607
17608         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17609         is also fine.
17610
17611         * expression.cs (Binary.ResolveOperator): Check error result in
17612         two places.
17613
17614         use brtrue/brfalse directly and avoid compares to null.
17615
17616 2002-08-02  Martin Baulig  <martin@gnome.org>
17617
17618         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17619         Fixes bug #28407, added test-155.cs.
17620
17621 2002-08-01  Martin Baulig  <martin@gnome.org>
17622
17623         * class.cs (Event.EmitDefaultMethod): Make this work with static
17624         events.  Fixes #28311, added verify-3.cs.
17625
17626 2002-08-01  Martin Baulig  <martin@gnome.org>
17627
17628         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17629         `is_disposable' fields.
17630         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17631         `hm.is_disposable' if we're using the collection pattern.
17632         (Foreach.EmitCollectionForeach): Use the correct type for the
17633         enumerator's local variable, only emit the try/finally block if
17634         necessary (fixes #27713).
17635
17636 2002-08-01  Martin Baulig  <martin@gnome.org>
17637
17638         * ecore.cs (Expression.report118): Renamed to Error118 and made
17639         it public static.
17640
17641         * statement.cs (Throw.Resolve): Check whether the expression is of
17642         the correct type (CS0118) and whether the type derives from
17643         System.Exception (CS0155).
17644         (Catch.Resolve): New method.  Do the type lookup here and check
17645         whether it derives from System.Exception (CS0155).
17646         (Catch.CatchType, Catch.IsGeneral): New public properties.
17647
17648         * typemanager.cs (TypeManager.exception_type): Added.
17649
17650 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17651
17652         * driver.cs: Updated About function.
17653
17654 2002-07-31  Martin Baulig  <martin@gnome.org>
17655
17656         Implemented Control Flow Analysis.
17657
17658         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17659         (EmitContext.CurrentBranching): Added.
17660         (EmitContext.StartFlowBranching): Added.
17661         (EmitContext.EndFlowBranching): Added.
17662         (EmitContext.KillFlowBranching): Added.
17663         (EmitContext.IsVariableAssigned): Added.
17664         (EmitContext.SetVariableAssigned): Added.
17665         (EmitContext.IsParameterAssigned): Added.
17666         (EmitContext.SetParameterAssigned): Added.
17667         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17668         Added control flow analysis stuff here.
17669
17670         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17671         resolve the expression as lvalue.
17672         (LocalVariableReference.DoResolve): Check whether the variable has
17673         already been assigned.
17674         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17675         the parameter as assigned here.
17676         (ParameterReference.DoResolve): Check whether the parameter has already
17677         been assigned.
17678         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17679         expression as lvalue.
17680
17681         * statement.cs (FlowBranching): New class for the flow analysis code.
17682         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17683         (LabeledStatement.IsDefined): New public property.
17684         (LabeledStatement.AddUsageVector): New public method to tell flow
17685         analyis that the label may be reached via a forward jump.
17686         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17687         flow analysis.
17688         (VariableInfo.Number): New public field.  This is used by flow analysis
17689         to number all locals of a block.
17690         (Block.CountVariables): New public property.  This is the number of
17691         local variables in this block (including the locals from all parent
17692         blocks).
17693         (Block.EmitMeta): Number all the variables.
17694
17695         * statement.cs: Added flow analysis support to all classes.
17696
17697 2002-07-31  Martin Baulig  <martin@gnome.org>
17698
17699         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17700         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17701         then use this argument.
17702
17703         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17704
17705         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17706         use this to specify /define options.
17707
17708 2002-07-29  Martin Baulig  <martin@gnome.org>
17709
17710         * statement.cs (Fixed): Moved all code that does variable lookups
17711         and resolvings from Emit to Resolve.
17712
17713         * statement.cs (For): Moved all code that does variable lookups
17714         and resolvings from Emit to Resolve.
17715
17716         * statement.cs (Using): Moved all code that does variable lookups
17717         and resolvings from Emit to Resolve.
17718
17719 2002-07-29  Martin Baulig  <martin@gnome.org>
17720
17721         * attribute.cs (Attribute.Resolve): Explicitly catch a
17722         System.NullReferenceException when creating the
17723         CustromAttributeBuilder and report a different warning message.
17724
17725 2002-07-29  Martin Baulig  <martin@gnome.org>
17726
17727         * support.cs (ParameterData.ParameterName): Added method to
17728         get the name of a parameter.
17729
17730         * typemanager.cs (TypeManager.IsValueType): New public method.
17731
17732 2002-07-29  Martin Baulig  <martin@gnome.org>
17733
17734         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17735         is a flag which specifies that it's either ref or out.
17736         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17737         the out parameter to `out Parameter.Modifier mod', also set the
17738         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17739
17740         * support.cs (InternalParameters.ParameterModifier): Distinguish
17741         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17742         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17743
17744         * expression.cs (Argument.GetParameterModifier): Distinguish
17745         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17746         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17747
17748 2002-07-29  Martin Baulig  <martin@gnome.org>
17749
17750         * expression.cs (ParameterReference.ParameterReference): Added
17751         `Location loc' argument to the constructor.
17752
17753         * cs-parser.jay: Pass location to ParameterReference.
17754
17755 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17756
17757         * statement.cs (Try): Initialize the location.
17758
17759         * cs-parser.jay: pass location to Try.
17760
17761         * expression.cs (Unary.Reduce): Change the prototype to return
17762         whether a constant fold could be performed or not.  The result is
17763         returned in an out parameters.  In the case of Indirection and
17764         AddressOf, we want to perform the full tests.
17765
17766 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17767
17768         * statement.cs (Statement.Emit): Flag dead code.
17769
17770 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17771
17772         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17773
17774 2002-07-27  Martin Baulig  <martin@gnome.org>
17775
17776         * class.cs (MethodData.Define): Put back call to
17777         TypeManager.AddMethod(), accidentally commented this out.
17778
17779         * report.cs (Debug): New public method to print debugging information,
17780         this is `[Conditional ("DEBUG")]'.
17781
17782 2002-07-26  Martin Baulig  <martin@gnome.org>
17783
17784         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17785         (switch_statement): Push the current_block to the switch_stack and
17786         pop it again when we're done with the switch.
17787         (switch_section): The new block is a child of the current_block.
17788         Fixes bug #24007, added test-152.cs.
17789
17790 2002-07-27  Martin Baulig  <martin@gnome.org>
17791
17792         * expression.cs (Invocation.EmitArguments): When calling a varargs
17793         function with only its fixed arguments, we need to pass an empty
17794         array.
17795
17796 2002-07-27  Martin Baulig  <martin@gnome.org>
17797
17798         Mono 0.13 has been released.
17799
17800 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * driver.cs: Rename --resource to --linkres, because that is what
17803         we do currently, we dont support --resource yet.
17804
17805         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17806
17807 2002-07-25  Martin Baulig  <martin@gnome.org>
17808
17809         * class.cs (MethodData): New public class.  This is a `method builder'
17810         class for a method or one accessor of a Property/Indexer/Event.
17811         (MethodData.GetMethodFlags): Moved here from MemberBase.
17812         (MethodData.ApplyAttributes): Likewise.
17813         (MethodData.ApplyObsoleteAttribute): Likewise.
17814         (MethodData.ApplyConditionalAttribute): Likewise.
17815         (MethodData.ApplyDllImportAttribute): Likewise.
17816         (MethodData.CheckAbstractAndExternal): Likewise.
17817         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17818         (MethodData.Emit): Formerly known as Method.Emit().
17819         (MemberBase): Moved everything which was specific to a single
17820         accessor/method to MethodData.
17821         (Method): Create a new MethodData and call Define() and Emit() on it.
17822         (Property, Indexer, Event): Create a new MethodData objects for each
17823         accessor and call Define() and Emit() on them.
17824
17825 2002-07-25  Martin Baulig  <martin@gnome.org>
17826
17827         Made MethodCore derive from MemberBase to reuse the code from there.
17828         MemberBase now also checks for attributes.
17829
17830         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17831         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17832         as virtual.
17833         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17834         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17835         (MemberBase.ApplyAttributes): New virtual method; applies the
17836         attributes to a method or accessor.
17837         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17838         (MemberBase.ApplyConditionalAttribute): Likewise.
17839         (MemberBase.ApplyDllImportAttribute): Likewise.
17840         (MemberBase.CheckAbstractAndExternal): Likewise.
17841         (MethodCore.ParameterTypes): This is now a property instead of a
17842         method, it's initialized from DoDefineParameters().
17843         (MethodCore.ParameterInfo): Removed the set accessor.
17844         (MethodCore.DoDefineParameters): New protected virtual method to
17845         initialize ParameterTypes and ParameterInfo.
17846         (Method.GetReturnType): We can now simply return the MemberType.
17847         (Method.GetMethodFlags): Override the MemberBase version and add
17848         the conditional flags.
17849         (Method.CheckBase): Moved some code from Define() here, call
17850         DoDefineParameters() here.
17851         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17852         here to avoid some larger code duplication.
17853         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17854         ensure that abstract and external accessors don't declare a body.
17855
17856         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17857         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17858         lookup in the attribute's parent classes, so we need to abort as soon
17859         as we found the first match.
17860         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17861         the attribute has no arguments.
17862
17863         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17864         of a Method.
17865
17866 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17867
17868         * cs-parser.jay: reverted previous patch.
17869
17870 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17871
17872         * cs-parser.jay: fixed bug #22119.
17873
17874 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17875
17876         * attribute.cs: fixed compilation. The error was:
17877         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17878         be assigned to before control leaves the current method."
17879         [FIXME:  Filed as bug #28186: MCS must report this error.]
17880
17881 2002-07-25  Martin Baulig  <martin@gnome.org>
17882
17883         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17884         method to pull the condition name ouf of a Conditional attribute.
17885         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17886         the obsolete message and error flag out of an Obsolete attribute.
17887
17888         * class.cs (Method.GetMethodFlags): New public method to get the
17889         TypeManager.MethodFlags for this method.
17890         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17891         private methods.
17892         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17893         if we're overriding a virtual function, set the new private variable
17894         `parent_method'; call the new TypeManager.AddMethod().
17895
17896         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17897         the MethodBuilder and the Method in a PtrHashtable.
17898         (TypeManager.builder_to_method): Added for this purpose.
17899         (TypeManager.MethodFlags): Added IsObsoleteError.
17900         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17901         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17902         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17903         the message from the attribute.
17904
17905 2002-07-24  Martin Baulig  <martin@gnome.org>
17906
17907         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17908         preprocessor directives, ensure that the argument to #define/#undef is
17909         exactly one identifier and that it's actually an identifier.
17910
17911         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17912         did not work ....
17913
17914 2002-07-24  Martin Baulig  <martin@gnome.org>
17915
17916         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17917         initialize it to TypeManager.object_type in the constructor.
17918         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17919         of the `hm.get_current' method if we're using the collection pattern.
17920         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17921         for the explicit conversion to make it work when we're using the collection
17922         pattern and the `Current' property has a different return type than `object'.
17923         Fixes #27713.
17924
17925 2002-07-24  Martin Baulig  <martin@gnome.org>
17926
17927         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17928         does not match, but don't report any errors.  This method is called in
17929         order for all methods in a MethodGroupExpr until a matching method is
17930         found, so we don't want to bail out if the first method doesn't match.
17931         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17932         matches, report the 123.  Fixes #28070.
17933
17934 2002-07-24  Martin Baulig  <martin@gnome.org>
17935
17936         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17937         TypeManager.TypeToCoreType() to the top of the method so the
17938         following equality checks will work.  Fixes #28107.
17939
17940 2002-07-24  Martin Baulig  <martin@gnome.org>
17941
17942         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17943         operand is of type uint, and the other operand is of type sbyte,
17944         short or int, the operands are converted to type long." -
17945         Actually do what this comment already told us.  Fixes bug #28106,
17946         added test-150.cs.
17947
17948 2002-07-24  Martin Baulig  <martin@gnome.org>
17949
17950         * class.cs (MethodBase): New abstract class.  This is now a base
17951         class for Property, Indexer and Event to avoid some code duplication
17952         in their Define() and DefineMethods() methods.
17953         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17954         generic methods for Define() and DefineMethods().
17955         (FieldBase): Derive from MemberBase, not MemberCore.
17956         (Property): Derive from MemberBase, not MemberCore.
17957         (Property.DefineMethod): Moved all the code from this method to the
17958         new MethodBase.DefineAccessor(), just call it with appropriate
17959         argumetnts.
17960         (Property.Define): Call the new Property.DoDefine(), this does some
17961         sanity checks and we don't need to duplicate the code everywhere.
17962         (Event): Derive from MemberBase, not MemberCore.
17963         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17964         accessors, this will also make them work with interface events.
17965         (Indexer): Derive from MemberBase, not MemberCore.
17966         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17967         (Indexer.Define): Use the new MethodBase functions.
17968
17969         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17970         argument to the constructor.
17971         (Interface.FindMembers): Added support for interface events.
17972         (Interface.PopluateEvent): Implemented.
17973
17974         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17975
17976 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17977
17978         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17979         but this is required to check for a method name being the same as
17980         the containing class.  
17981
17982         Handle this now.
17983
17984 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17985
17986         * interface.cs: initialize variable.
17987
17988 2002-07-23  Martin Baulig  <martin@gnome.org>
17989
17990         Implemented the IndexerName attribute in interfaces.
17991
17992         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17993         name if this is an explicit interface implementation.
17994         (Indexer.InterfaceIndexerName): New public variable.  If we're
17995         implementing an interface indexer, this is the IndexerName in that
17996         interface.  Otherwise, it's the IndexerName.
17997         (Indexer.DefineMethod): If we're implementing interface indexer,
17998         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17999         and Pending.ImplementIndexer methods.
18000         (Indexer.Define): Also define the PropertyBuilder if we're
18001         implementing an interface indexer and this is neither an explicit
18002         interface implementation nor do the IndexerName match the one in
18003         the interface.
18004
18005         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18006         If a method is defined here, then we always need to create a proxy
18007         for it.  This is used when implementing interface indexers.
18008         (Pending.IsInterfaceIndexer): New public method.
18009         (Pending.ImplementIndexer): New public method.
18010         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18011         This is used when implementing interface indexers to define a proxy
18012         if necessary.
18013         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18014         define a proxy if necessary.
18015
18016         * interface.cs (Interface.IndexerName): New public variable.
18017         (Interface.PopulateIndexer): Set the IndexerName.
18018         (Interface.DefineIndexers): New private method.  Populate all the
18019         indexers and make sure their IndexerNames match.
18020
18021         * typemanager.cs (IndexerPropertyName): Added support for interface
18022         indexers.
18023
18024 2002-07-22  Martin Baulig  <martin@gnome.org>
18025
18026         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18027         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18028         ret if HasReturnLabel.
18029         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18030         variables.
18031
18032         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18033         and set the ec.LoopBeginTryCatchLevel.
18034         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18035         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18036         the current ec.TryCatchLevel, the branch goes out of an exception
18037         block.  In this case, we need to use Leave and not Br.
18038
18039 2002-07-22  Martin Baulig  <martin@gnome.org>
18040
18041         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18042         block unless the block does not always return or it is contained in
18043         another try { ... } catch { ... } block.  Fixes bug #26506.
18044         Added verify-1.cs to the test suite.
18045
18046 2002-07-22  Martin Baulig  <martin@gnome.org>
18047
18048         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18049         then we do not always return.  Fixes bug #24985.
18050
18051 2002-07-22  Martin Baulig  <martin@gnome.org>
18052
18053         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18054         lookup on a per-class level; ie. walk up the class hierarchy until we
18055         found at least one applicable method, then choose the best among them.
18056         Fixes bug #24463 and test-29.cs.
18057
18058 2002-07-22  Martin Baulig  <martin@gnome.org>
18059
18060         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18061         return types of the methods.  The return type is not part of the
18062         signature and we must not check it to make the `new' modifier work.
18063         Fixes bug #27999, also added test-147.cs.
18064         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18065
18066         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18067         on the method's return type.
18068
18069 2002-07-21  Martin Baulig  <martin@gnome.org>
18070
18071         * assign.cs: Make this work if the rightmost source is a constant and
18072         we need to do an implicit type conversion.  Also adding a few more tests
18073         to test-38.cs which should have caught this.
18074
18075         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18076         target in the makefile for this.  The makefile.gnu is primarily intended
18077         for end-users who don't want to debug the compiler.
18078
18079 2002-07-21  Martin Baulig  <martin@gnome.org>
18080
18081         * assign.cs: Improved the Assign class so it can now handle embedded
18082         assignments (X = Y = Z = something).  As a side-effect this'll now also
18083         consume less local variables.  test-38.cs now passes with MCS, added
18084         a few new test cases to that test.
18085
18086 2002-07-20  Martin Baulig  <martin@gnome.org>
18087
18088         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18089         instructions.  Fixes bug #27977, also added test-146.cs.
18090
18091 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18092
18093         * cs-tokenizer.cs: fixed getHex ().
18094
18095 2002-07-19  Martin Baulig  <martin@gnome.org>
18096
18097         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18098         not Type.GetType() to lookup the array type.  This is needed when
18099         we're constructing an array of a user-defined type.
18100         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18101         single-dimensional arrays, but also for single-dimensial arrays of
18102         type decimal.
18103
18104 2002-07-19  Martin Baulig  <martin@gnome.org>
18105
18106         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18107         this function is called, it's not allowed to share LocalBuilders
18108         among ILGenerators.
18109
18110 2002-07-19  Martin Baulig  <martin@gnome.org>
18111
18112         * expression.cs (Argument.Resolve): Report an error 118 when trying
18113         to pass a type as argument.
18114
18115 2002-07-18  Martin Baulig  <martin@gnome.org>
18116
18117         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18118         Conv_R_Un for the signed `long' type.
18119
18120 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18121
18122         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18123         `expr' for the temporary result, as that will fail if we do
18124         multiple resolves on the same expression.
18125
18126 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18127
18128         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18129         ec.TypeContainer for looking up aliases. 
18130
18131         * class.cs (TypeContainer): Remove LookupAlias from here.
18132
18133         * decl.cs (DeclSpace); Move here.
18134
18135 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18136
18137         * class.cs (FindMembers): Only call filter if the constructor
18138         bulider is not null.
18139
18140         Also handle delegates in `NestedTypes' now.  Now we will perform
18141         type lookups using the standard resolution process.  This also
18142         fixes a bug.
18143
18144         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18145         This uses Expressions (the limited kind that can be parsed by the
18146         tree) instead of strings.
18147
18148         * expression.cs (ComposedCast.ToString): Implement, used to flag
18149         errors since now we have to render expressions.
18150
18151         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18152         FormArrayType. 
18153
18154         * ecore.cs (SimpleName.ToString): ditto.
18155
18156         * cs-parser.jay: Instead of using strings to assemble types, use
18157         Expressions to assemble the type (using SimpleName, ComposedCast,
18158         MemberAccess).  This should fix the type lookups in declarations,
18159         because we were using a different code path for this.
18160
18161         * statement.cs (Block.Resolve): Continue processing statements
18162         even when there is an error.
18163
18164 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18165
18166         * class.cs (Event.Define): Also remove the `remove' method from
18167         the list of pending items.
18168
18169         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18170         generate more compact code. 
18171
18172 2002-07-17  Martin Baulig  <martin@gnome.org>
18173
18174         * const.cs (Const.LookupConstantValue): Add support for constant
18175         `unchecked' and `checked' expressions.
18176         Also adding test case test-140.cs for this.
18177
18178 2002-07-17  Martin Baulig  <martin@gnome.org>
18179
18180         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18181         check whether mi.ReturnType implements the IEnumerator interface; the
18182         `==' and the IsAssignableFrom() will fail in this situation.
18183
18184 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18185
18186         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18187         here too.
18188
18189 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18190
18191         * expression.cs: fixed bug #27811.
18192
18193 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18194
18195         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18196         Molaro: when we are a ref, the value already contains a pointer
18197         value, do not take the address of it.
18198
18199 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18200         * removed mb-parser.jay and mb-tokenizer.cs
18201
18202 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18203
18204         * expression.cs: check against the building corlib void type.
18205
18206 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18207
18208         * ecore.cs: fix for valuetype static readonly fields: when 
18209         initializing them, we need their address, not the address of a copy.
18210
18211 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18212
18213         * typemanager.cs: register also enum_type in corlib.
18214
18215 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18216
18217         * class.cs: allow calling this (but not base) initializers in structs.
18218
18219 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18220
18221         * ecore.cs: make sure we compare against the building base types
18222         in GetTypeSize ().
18223
18224 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18225
18226         * typemanager.cs: fix TypeToCoreType() to handle void and object
18227         (corlib gets no more typerefs after this change).
18228
18229 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18230
18231         * expression.cs (ArrayCreation.EmitArrayArguments): use
18232         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18233
18234         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18235         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18236         array indexes, the runtime actually forbids them.
18237
18238         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18239         for array arguments here.
18240
18241         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18242         instead of the default for ValueTypes.
18243
18244         (New.DoEmit): Use IsValueType instead of
18245         IsSubclassOf (value_type)
18246         (New.DoResolve): ditto.
18247         (Invocation.EmitCall): ditto.
18248
18249         * assign.cs (Assign): ditto.
18250
18251         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18252         Statements *are* currently doing part of their resolution during
18253         Emit.  
18254
18255         Expressions do always resolve during resolve, but statements are
18256         only required to propagate resolution to their children.
18257
18258 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18259
18260         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18261
18262         (LoadAssembly): Do not add the dll if it is already specified
18263
18264         (MainDriver): Add the System directory to the link path at the end,
18265         after all the other -L arguments. 
18266
18267         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18268         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18269         ldelem.u1) and using the opposite for sbytes.
18270
18271         This fixes Digger, and we can finally run it.
18272
18273         * driver.cs (UnixParseOption): Move the option parsing here.  
18274         (CSCParseOption): Implement CSC-like parsing of options.
18275
18276         We now support both modes of operation, the old Unix way, and the
18277         new CSC-like way.  This should help those who wanted to make cross
18278         platform makefiles.
18279
18280         The only thing broken is that /r:, /reference: and /lib: are not
18281         implemented, because I want to make those have the same semantics
18282         as the CSC compiler has, and kill once and for all the confussion
18283         around this.   Will be doing this tomorrow.
18284
18285         * statement.cs (Unsafe.Resolve): The state is checked during
18286         resolve, not emit, so we have to set the flags for IsUnsfe here.
18287
18288 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18289
18290         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18291         not catch the Error_ObjectRefRequired in SimpleName (as it is
18292         possible to have a class/instance variable name that later gets
18293         deambiguated), we have to check this here.      
18294
18295 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18296
18297         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18298         make static and put into Expression.
18299
18300         (Event.Define): Register the private field of the event with the 
18301         TypeManager so that GetFieldFromEvent can get at it.
18302
18303         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18304         keep track of the private field associated with an event which
18305         has no accessors.
18306
18307         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18308         private field.
18309
18310         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18311
18312 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18313
18314         * expression.cs (Binary.EmitBranchable): this routine emits the
18315         Binary expression in a branchable context.  This basically means:
18316         we need to branch somewhere, not just get the value on the stack.
18317
18318         This works together with Statement.EmitBoolExpression.
18319
18320         * statement.cs (Statement.EmitBoolExpression): Use
18321         EmitBranchable. 
18322
18323 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18324
18325         * statement.cs (For): Reduce the number of jumps in loops.
18326
18327         (For): Implement loop inversion for the For statement.
18328
18329         (Break): We can be breaking out of a Try/Catch controlled section
18330         (foreach might have an implicit try/catch clause), so we need to
18331         use Leave instead of Br.
18332
18333         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18334         now).  If the instace expression supports IMemoryLocation, we use
18335         the AddressOf method from the IMemoryLocation to extract the
18336         address instead of emitting the instance.
18337
18338         This showed up with `This', as we were emitting the instance
18339         always (Emit) instead of the Address of This.  Particularly
18340         interesting when This is a value type, as we dont want the Emit
18341         effect (which was to load the object).
18342
18343 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18344
18345         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18346
18347         * statement.cs (Checked): Set the CheckedState during the resolve
18348         process too, as the ConvCast operations track the checked state on
18349         the resolve process, and not emit.
18350
18351         * cs-parser.jay (namespace_member_declaration): Flag that we have
18352         found a declaration when we do.  This is used to flag error 1529
18353
18354         * driver.cs: Report ok when we display the help only.
18355
18356 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18357
18358         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18359
18360 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18361
18362         * cs-tokenizer.cs (define): We also have to track locally the
18363         defines.  AllDefines is just used for the Conditional Attribute,
18364         but we also need the local defines for the current source code. 
18365
18366 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18367
18368         * statement.cs (While, For, Do): These loops can exit through a
18369         Break statement, use this information to tell whether the
18370         statement is the last piece of code.
18371
18372         (Break): Flag that we break.
18373
18374         * codegen.cs (EmitContexts): New `Breaks' state variable.
18375
18376 2002-07-03  Martin Baulig  <martin@gnome.org>
18377
18378         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18379         modifiers in method declarations in structs.  Otherwise, you won't
18380         be able to override things like Object.Equals().
18381
18382 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18383
18384         * class.cs (Method, Property, Indexer): Do not allow the public
18385         modifier to be used in explicit interface implementations.
18386
18387         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18388         override modifiers in method declarations in structs
18389
18390 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18391
18392         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18393         integer or real overflow, report an error
18394
18395 2002-07-02  Martin Baulig  <martin@gnome.org>
18396
18397         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18398         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18399         to tell the runtime about our newly created System.Object and
18400         System.ValueType types.
18401
18402 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18403
18404         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18405         struct instead of Ldarg/Starg.
18406
18407 2002-07-02  Martin Baulig  <martin@gnome.org>
18408
18409         * expression.cs (Indirection.Indirection): Call
18410         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18411
18412 2002-07-02  Martin Baulig  <martin@gnome.org>
18413
18414         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18415         ValueType, call TypeManager.TypeToCoreType() on it.
18416         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18417         the OpCodes.Newarr argument.
18418
18419 2002-07-02  Martin Baulig  <martin@gnome.org>
18420
18421         * expression.cs (Invocation.EmitCall): When compiling corlib,
18422         replace all calls to the system's System.Array type to calls to
18423         the newly created one.
18424
18425         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18426         System.Array methods.
18427         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18428         from the system's System.Array type which must be replaced.
18429
18430 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18431
18432         * typemanager.cs: load unverifiable_code_ctor so we can build
18433         corlib using the correct type. Avoid using GetTypeCode() with
18434         TypeBuilders.
18435         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18436         TypeManager.object_type to allow building corlib.
18437
18438 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18439
18440         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18441
18442 2002-07-01  Martin Baulig  <martin@gnome.org>
18443
18444         * class.cs: Make the last change actually work, we need to check
18445         whether `ifaces != null' to avoid a crash.
18446
18447 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18448
18449         * class.cs: when we build structs without fields that implement
18450         interfaces, we need to add the interfaces separately, since there is
18451         no API to both set the size and add the interfaces at type creation
18452         time.
18453
18454 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18455
18456         * expression.cs: the dimension arguments to the array constructors
18457         need to be converted if they are a long.
18458
18459 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18460
18461         * class.cs: don't emit ldarg.0 if there is no parent constructor
18462         (fixes showstopper for corlib).
18463
18464 2002-06-29  Martin Baulig  <martin@gnome.org>
18465
18466         MCS now compiles corlib on GNU/Linux :-)
18467
18468         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18469         ie. check for MethodImplOptions.InternalCall.
18470
18471         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18472         and TypeManager.attribute_type are null, so we must explicitly check
18473         whether parent is not null to find out whether it's an attribute type.
18474         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18475         and SetBuilder, not only if the property is neither abstract nor external.
18476         This is necessary to set the MethodImplOptions on the accessor methods.
18477         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18478         SetBuilder, see Property.Emit().
18479
18480         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18481         populate "System.Object", "System.ValueType" and "System.Attribute" since
18482         they've already been populated from BootCorlib_PopulateCoreTypes().
18483
18484 2002-06-29  Martin Baulig  <martin@gnome.org>
18485
18486         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18487         is the NullLiteral, we also need to make sure that target_type is not
18488         an enum type.   
18489
18490 2002-06-29  Martin Baulig  <martin@gnome.org>
18491
18492         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18493         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18494         before calling BootstrapCorlib_ResolveDelegate ().
18495
18496 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18497
18498         * statement.cs: fixed build-breaker. All tests passed ok.
18499
18500 2002-06-27  Martin Baulig  <martin@gnome.org>
18501
18502         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18503         for System.Decimal when compiling corlib.
18504
18505 2002-06-27  Martin Baulig  <martin@gnome.org>
18506
18507         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18508         switch blocks which contain nothing but a default clause.
18509
18510 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18511
18512        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18513
18514 2002-06-27  Martin Baulig  <martin@gnome.org>
18515
18516         * ecore.cs (PropertyExpr.PropertyExpr): Call
18517         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18518
18519         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18520         is already a TypeBuilder.
18521
18522 2002-06-27  Martin Baulig  <martin@gnome.org>
18523
18524         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18525         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18526         the "from an array-type to System.Array" case.  This makes it work
18527         when compiling corlib.
18528
18529 2002-06-27  Martin Baulig  <martin@gnome.org>
18530
18531         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18532         non-static PropertyExpr, set its InstanceExpression.  This makes
18533         the `ICollection.Count' property work in System/Array.cs.
18534
18535 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18536
18537         * driver.cs: Made error handling more consistent.  Errors now
18538         tracked by Report class, so many methods which used to return int
18539         now return void.  Main() now prints success/failure and 
18540         errors/warnings message.
18541
18542         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18543         the magic number return values (123 and 124).  Now, if the
18544         expected error occurs, the compiler exits with success (exit value
18545         0).  If the compilation completes without seeing that particular
18546         error, the compiler exits with failure (exit value 1).  The
18547         makefile in mcs/errors has been changed to handle the new behaviour.
18548
18549         * report.cs: Made 'expected error' number a property and renamed
18550         it from 'Probe' to 'ExpectedError'.
18551
18552         * genericparser.cs: Removed error handling support, since it is
18553         now all done by Report class.
18554
18555         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18556         class, so parse() no longer returns an int.
18557
18558         * namespace.cs: Use Report.Error instead of GenericParser.error
18559
18560 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18561
18562         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18563         TypeContainer.AddOperator): At the front of the list put the
18564         explicit implementations, so they get resolved/defined first. 
18565
18566 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18567
18568         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18569         interface type is implemented by this TypeContainer.  Used during
18570         explicit interface implementation.
18571
18572         (Property.Define, Indexer.Define, Method.Define): Validate that
18573         the given interface in the explicit implementation is one of the
18574         base classes for the containing type.
18575
18576         Also if we are explicitly implementing an interface, but there is
18577         no match in the pending implementation table, report an error.
18578
18579         (Property.Define): Only define the property if we are
18580         not explicitly implementing a property from an interface.  Use the
18581         correct name also for those properties (the same CSC uses,
18582         although that is really not needed).
18583
18584         (Property.Emit): Do not emit attributes for explicitly implemented
18585         properties, as there is no TypeBuilder.
18586
18587         (Indexer.Emit): ditto.
18588
18589         Hiding then means that we do not really *implement* a pending
18590         implementation, which makes code fail.
18591
18592 2002-06-22  Martin Baulig  <martin@gnome.org>
18593
18594         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18595         the return value of Object.GetType().  [FIXME: we need to do this whenever
18596         we get a type back from the reflection library].
18597
18598 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18599
18600         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18601
18602 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18603
18604         * attribute.cs: Return null if we can not look up the type.
18605
18606         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18607         the interface types found.
18608
18609         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18610         interface types found.
18611
18612         * typemanager.cs (GetInterfaces): Make this routine returns alll
18613         the interfaces and work around the lame differences between
18614         System.Type and System.Reflection.Emit.TypeBuilder in the results
18615         result for GetInterfaces.
18616
18617         (ExpandInterfaces): Given an array of interface types, expand and
18618         eliminate repeated ocurrences of an interface.  This expands in
18619         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18620         be IA, IB, IC.
18621
18622 2002-06-21  Martin Baulig  <martin@gnome.org>
18623
18624         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18625         on System.Enum.
18626
18627 2002-06-21  Martin Baulig  <martin@gnome.org>
18628
18629         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18630         and called with one of the core types, return the corresponding typebuilder for
18631         that type.
18632
18633         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18634         element type.
18635
18636 2002-06-21  Martin Baulig  <martin@gnome.org>
18637
18638         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18639         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18640         (Expression.ConvertReferenceExplicit): Likewise.
18641
18642         * expression.cs (ElementAccess.DoResolve): Likewise.
18643         (ElementAccess.DoResolveLValue): Likewise.
18644
18645 2002-06-10  Martin Baulig  <martin@gnome.org>
18646
18647         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18648         add the "value" parameter to the parameter list.
18649
18650         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18651         to our caller.
18652
18653 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18654
18655         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18656         the argument to an int, uint, long or ulong, per the spec.  Also
18657         catch negative constants in array creation.
18658
18659 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18660
18661         * class.cs: do not allow the same interface to appear twice in
18662         the definition list.
18663
18664 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18665
18666         * ecore.cs: don't use ldlen with System.Array.
18667
18668 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18669
18670         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18671
18672 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18673
18674         * modifiers.cs: produce correct field attributes for protected
18675         internal. Easy fix so miguel can work on ther harder stuff:-)
18676
18677 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * pending.cs: New file.  Move the code from class.cs here.
18680         Support clearning the pending flag for all methods (when not doing
18681         explicit interface implementation).
18682
18683 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18684
18685         * rootcontext.cs: added a couple more types needed to bootstrap.
18686
18687 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18690         constructor in the type, instead of any constructor in the type
18691         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18692         a bug in the Mono runtime when applying the params attribute). 
18693
18694 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18695         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18696
18697 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18698
18699         * expression.cs (Unary.ResolveOperator): Use TypeManager
18700         to resolve the type.
18701
18702 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18703
18704         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18705         attached.
18706
18707         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18708         with each member too.
18709
18710         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18711         field builders too - this takes care of the enum member case.
18712
18713 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18714
18715         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18716         address-of operator on both value types and pointers.
18717
18718 2002-06-10  Martin Baulig  <martin@gnome.org>
18719
18720         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18721         PropertyBuilder to the `property_builders' list.
18722
18723         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18724         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18725         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18726         find any indexers which are inherited from an interface.
18727
18728 2002-06-09  Martin Baulig  <martin@gnome.org>
18729
18730         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18731         the same type as the constant if necessary.  There's also a test-130.cs
18732         for this.
18733
18734         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18735
18736         * typemanager.cs (TypeManager.ChangeType): Previously known as
18737         Enum.ChangeEnumType().
18738
18739 2002-06-09  Martin Baulig  <martin@gnome.org>
18740
18741         * expression.cs (Cast.TryReduce): Added support for consts.
18742
18743 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18744
18745         * class.cs (Accessor): Hold attributes information so we can pass
18746         it along.
18747
18748         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18749         Modify to pass in attributes attached to the methods.
18750
18751         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18752
18753         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18754         to handle the Accessor kind :-)
18755
18756         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18757
18758 2002-06-08  Martin Baulig  <martin@gnome.org>
18759
18760         * expression.cs (Unary.TryReduceNegative): Added support for
18761         ULongConstants.
18762
18763 2002-06-08  Martin Baulig  <martin@gnome.org>
18764
18765         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18766         name can't be found in the `defined_names' - the caller will do a
18767         MemberLookup in this case and thus find methods in System.Enum
18768         such as Enum.IsDefined().
18769
18770 2002-06-08  Martin Baulig  <martin@gnome.org>
18771
18772         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18773         Convert.ChangeType() which works with TypeBuilder created types.
18774         (Enum.LookupEnumValue, Enum.Define): Use it here.
18775
18776         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18777         `TypeBuilder.BaseType != null' check.
18778         (TypeContainer.FindMembers): Only lookup parent members if we
18779         actually have a parent.
18780         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18781         (ConstructorInitializer.Resolve): Likewise.
18782
18783         * interface.cs (Interface.FindMembers): Added
18784         `TypeBuilder.BaseType != null' check.
18785
18786         * rootcontext.cs (RootContext.ResolveCore): Added
18787         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18788         classes_second_stage.
18789
18790         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18791         debug_type and trace_type when compiling with --nostdlib.       
18792
18793 2002-06-07  Martin Baulig  <martin@gnome.org>
18794
18795         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18796         (AddField): Set it to true when adding a non-static field.
18797         (DefineType): Use `have_nonstatic_fields' to find out whether we
18798         have non-static fields, not `Fields != null'.
18799
18800 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18801
18802         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18803         dereferencing a null on the static-field code path)
18804
18805 2002-05-30  Martin Baulig  <martin@gnome.org>
18806
18807         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18808         to take command line arguments.  Use reflection to call the new
18809         custom `Initialize' function on the symbol writer and pass it the
18810         command line arguments.
18811
18812         * driver.cs (--debug-args): New command line argument to pass command
18813         line arguments to the symbol writer.
18814
18815 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18816
18817         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18818         the target type for indexers and properties.  Thanks to Joe for
18819         catching this.
18820
18821 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18822
18823         * typemanager.cs (MethodFlags): returns the method flags
18824         (Obsolete/ShouldIgnore) that control warning emission and whether
18825         the invocation should be made, or ignored. 
18826
18827         * expression.cs (Invocation.Emit): Remove previous hack, we should
18828         not do this on matching a base type, we should do this based on an attribute
18829
18830         Only emit calls to System.Diagnostics.Debug and
18831         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18832         on the command line.
18833
18834         * rootcontext.cs: Global settings for tracing and debugging.
18835
18836         * cs-tokenizer.cs (define): New utility function to track
18837         defines.   Set the global settings for TRACE and DEBUG if found.
18838
18839 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18840
18841         * interface.cs (Populate*): Pass in the TypeContainer as well as
18842         the DeclSpace as parameters so that we can create EmitContexts and
18843         then use that to apply attributes etc.
18844
18845         (PopulateMethod, PopulateEvent, PopulateProperty)
18846         (PopulateIndexer): Apply attributes everywhere.
18847
18848         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18849         etc.
18850
18851         (ApplyAttributes): Update accordingly.
18852
18853         We now apply interface attributes for all members too.
18854
18855 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18856
18857         * class.cs (Indexer.Define); Correctly check if we are explicit
18858         implementation (instead of checking the Name for a ".", we
18859         directly look up if the InterfaceType was specified).
18860
18861         Delay the creation of the PropertyBuilder.
18862
18863         Only create the PropertyBuilder if we are not an explicit
18864         interface implementation.   This means that explicit interface
18865         implementation members do not participate in regular function
18866         lookups, and hence fixes another major ambiguity problem in
18867         overload resolution (that was the visible effect).
18868
18869         (DefineMethod): Return whether we are doing an interface
18870         implementation. 
18871
18872         * typemanager.cs: Temporary hack until we get attributes in
18873         interfaces (Ravi is working on that) and we get IndexerName
18874         support in interfaces.
18875
18876         * interface.cs: Register the indexers as properties.
18877
18878         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18879         warning, I have verified that this is a bug in the .NET runtime
18880         (JavaScript suffers of the same problem).
18881
18882         * typemanager.cs (MemberLookup): When looking up members for
18883         interfaces, the parent of an interface is the implicit
18884         System.Object (so we succeed in searches of Object methods in an
18885         interface method invocation.  Example:  IEnumerable x;  x.ToString
18886         ()) 
18887
18888 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18889
18890         * class.cs (Event): Events should also register if they do
18891         implement the methods that an interface requires.
18892
18893         * typemanager.cs (MemberLookup); use the new GetInterfaces
18894         method. 
18895
18896         (GetInterfaces): The code used to lookup interfaces for a type is
18897         used in more than one place, factor it here. 
18898
18899         * driver.cs: Track the errors at the bottom of the file, we kept
18900         on going.
18901
18902         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18903         instance if the method we are calling is static!
18904
18905 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18906
18907         * attribute.cs (ApplyAttributes): Make this function filter out
18908         the IndexerName attribute (as that attribute in reality is never
18909         applied) and return the string constant for the IndexerName
18910         attribute. 
18911
18912         * class.cs (TypeContainer.Emit): Validate that all the indexers
18913         have the same IndexerName attribute, and if so, set the
18914         DefaultName attribute on the class. 
18915
18916         * typemanager.cs: The return value might contain other stuff (not
18917         only methods).  For instance, consider a method with an "Item"
18918         property and an Item method.
18919
18920         * class.cs: If there is a problem with the parameter types,
18921         return. 
18922
18923 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18924
18925         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18926         looks at user defined conversion after making a call to 
18927         StandardConversionExists - we need this for overload resolution.
18928
18929         * expression.cs : Update accordingly the various method calls.
18930
18931         This fixes 2 bugs filed against implicit user defined conversions 
18932
18933 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18934
18935         * statement.cs: Track the result of the assignment.
18936
18937 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * expression.cs (MemberAccess): Improved error reporting for
18940         inaccessible members.
18941
18942 2002-05-22  Martin Baulig  <martin@gnome.org>
18943
18944         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18945         itself with debugging support.
18946
18947 2002-05-22  Martin Baulig  <martin@gnome.org>
18948
18949         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18950         Removed, this isn't needed anymore.
18951
18952 2002-05-20  Martin Baulig  <martin@gnome.org>
18953
18954         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18955         be underlying type for an enum.
18956
18957 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18958
18959         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18960         that splits out the loading of just the core types.
18961
18962         * rootcontext.cs (ResolveCore): Split the struct resolution in
18963         two, so we can load the enumeration underlying types before any
18964         enums are used.
18965
18966         * expression.cs (Is): Bandaid until we fix properly Switch (see
18967         bug #24985 for details).
18968
18969         * typemanager.cs (ImplementsInterface): The hashtable will contain
18970         a null if there are no interfaces implemented.
18971
18972 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18973
18974         * cs-parser.jay (indexer_declarator): It is fine to have array
18975         parameters
18976
18977 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18978
18979         * typemanager.cs: (RegisterBuilder): New function used to register
18980         TypeBuilders that implement interfaces.  Since
18981         TypeBuilder.GetInterfaces (as usual) does not work with lame
18982         Reflection.Emit. 
18983         (AddUserType): register interfaces.
18984
18985         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18986         dealing with TypeBuilder.  Also, arrays are showing up as
18987         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18988         methods can not be invoked on them!
18989
18990         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18991         (ImplicitReferenceConversionExists): Split out from
18992         StandardConversionExists. 
18993
18994         * expression.cs (As): We were only implementing one of the three
18995         cases for the as operator.  We now implement them all.
18996         (Is): Implement the various other cases for Is as well.
18997
18998         * typemanager.cs (CACHE): New define used to control if we want or
18999         not the FindMembers cache.  Seems to have a negative impact on
19000         performance currently
19001
19002         (MemberLookup): Nested types have full acess to
19003         enclosing type members
19004
19005         Remove code that coped with instance/static returns for events, we
19006         now catch this in RealFindMembers.
19007
19008         (RealFindMembers): only perform static lookup if the instance
19009         lookup did not return a type or an event.  
19010
19011 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19012
19013         * assign.cs (CompoundAssign): We pass more semantic information
19014         now to Compound Assignments than we did before: now we have all
19015         the information at hand, and now we resolve the target *before* we
19016         do the expression expansion, which allows the "CacheValue" method
19017         to have the effect we intended (before, a [x] += 1 would generate
19018         two differen ArrayAccess expressions from the ElementAccess,
19019         during the resolution process).
19020
19021         (CompoundAssign.DoResolve): Resolve target and original_source here.
19022
19023 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19024
19025         * expression.cs (ArrayAccess): dropped debugging information. 
19026
19027         * typemanager.cs: Small bug fix: I was always returning i_members,
19028         instead of one of i_members or s_members (depending on which had
19029         the content).
19030
19031         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19032         method is invoked before any code generation takes place, and it
19033         is a mechanism to inform that the expression will be invoked more
19034         than once, and that the method should use temporary values to
19035         avoid having side effects
19036
19037         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19038
19039         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19040         implementation.
19041
19042         * expression.cs (Indirection, ArrayAccess): Add support for
19043         CacheTemporaries in these two bad boys. 
19044
19045         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19046         ldobj or ldind_ref.  
19047         (StoreFromPtr): Handle stobj as well.
19048
19049         * expression.cs (UnaryMutator): Share more code.
19050
19051         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19052         down: I was not tracking the Filter function as well, which
19053         was affecting the results of the cache.
19054
19055 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19056
19057         * attribute.cs: Remove the hack to handle the CharSet property on
19058         StructLayouts. 
19059
19060 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19061
19062         * attribute.cs (DoResolve): More uglyness, we now only try to
19063         resolve the attribute partially, to extract the CharSet
19064         information (only if we are a StructLayout attribute).  Otherwise 
19065
19066         (GetExtraTypeInfo): Add some code to conditionally kill in the
19067         future this.   I am more and more convinced that the .NET
19068         framework has special code to handle the attribute setting on
19069         certain elements.
19070
19071         * expression.cs (IsParamsMethodApplicable): Revert my previous
19072         foreach change here, it was wrong.
19073
19074 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19075
19076         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19077         (pp_expr): do not abort on unknown input, just return.
19078         (eval): abort if there are pending chars.
19079
19080         * attribute.cs (Attribute.Resolve): Positional parameters are
19081         optional.  Deal with that case.
19082
19083         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19084         the Ansi/Unicode/Auto information for the type.
19085
19086         (TypeContainer.DefineType): instantiate the EmitContext here, as
19087         we will be using it during the type definition (to resolve
19088         attributes) and during the emit phase.
19089
19090         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19091         to pull type information out of the attributes
19092
19093         (Attribute.Resolve): track the constructor builder, and allow for
19094         multiple invocations (structs and classes will use this).
19095
19096         * ecore.cs (MemberLookupFinal): new version with all the
19097         parameters customizable.
19098
19099         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19100         constructors.  Return if the result value is null (as the error
19101         would have been flagged already by MemberLookupFinal)
19102
19103         Do not allow instances of abstract classes or interfaces to be
19104         created.
19105
19106         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19107         We have to compare the assembly property here when dealing with
19108         FamANDAssem and Assembly access modifiers, because we might be
19109         creating an assembly from *modules* (that means that we are not
19110         getting TypeBuilders for types defined in other modules that are
19111         part of this assembly).
19112
19113         (Method.Emit): If the method is marked abstract and has a body,
19114         emit an error. 
19115
19116         (TypeContainer.DefineMembers): If both the defined member and the
19117         parent name match are methods, then do not emit any warnings: let
19118         the Method.Define routine take care of flagging warnings.  But if
19119         there is a mismatch (method overrides something else, or method is
19120         overriwritten by something, then emit warning).
19121
19122         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19123         set to null, this means `do not check for the return type on the
19124         signature'. 
19125
19126         (Method.Define): set the return type for the method signature to
19127         null, so that we get methods with the same name and parameters and
19128         different return types.  This is used to flag warning 114 (you are
19129         hiding a method, and you probably want to use the new/override
19130         keywords instead).
19131
19132         * typemanager.cs (MemberLookup): Implemented proper access
19133         control, closing a long standing set of bug reports.  The problem
19134         was that the Framework only has two bits: Public and NonPublic,
19135         and NonPublic includes private and protected methods, but we need
19136         to enforce the FamANDAssem, FamOrAssem and Family. 
19137
19138 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19139
19140         * statement.cs (GotoCase): Return true: Ammounts to giving up
19141         knowledge on whether we return or not, and letting the other case
19142         be responsible for it.
19143
19144 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19145
19146         * driver.cs: Do not load directories for each file processed, only
19147         do it if there is a pattern.
19148
19149         * ecore.cs: Report readonly assigns here as well, as we might have
19150         been resolved only by MemberAccess.
19151
19152         (SimpleName.SimpleNameResolve): Also be useful for LValue
19153         resolution.   We need this to propagate assign to local readonly variables
19154
19155         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19156         do not want to reuse potential criteria memory.
19157
19158         * class.cs (MyEventBuilder): Set reflected_type;
19159
19160         * ecore.cs (Constantify): Added support for constifying bools.
19161
19162         (RootContext.LookupType): Added a cache for values looked up in
19163         the declaration space.
19164
19165         * typemanager.cs (FindMembers): Now is a front-end to
19166         RealFindMembers, and provides a two-level hashtable-based cache to
19167         the request.  
19168
19169         15% performance improvement: from 22.5 to 19.2 seconds.
19170
19171         * expression.cs (IsParamsMethodApplicable): use foreach.
19172         (Invocation.DoResolve): ditto.
19173         (New.DoResolve): ditto.
19174         (ArrayCreation.DoResolve): ditto.
19175
19176         * ecore.cs (FindMostEncompassingType): use foreach.
19177
19178         * delegate.cs (NewDelegate.DoResolve): Use foreach
19179
19180         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19181         (RemoveMethods): use foreach.
19182
19183         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19184         nested foreach statements instead of for, and also break out of
19185         the inner loop once a match is found.
19186
19187         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19188
19189 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19190
19191         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19192         we actually unwrap the expression to allow for extra information
19193         to be extracted. 
19194
19195         * expression.cs: Use Shr_Un on unsigned operations. 
19196
19197 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19198
19199         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19200         applicable operators was not being considered correctly. This closes
19201         the bug Miguel reported.
19202
19203 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19204
19205         * attribute.cs: check that the type derives from System.Attribute
19206         and report the correct error in that case (moved the duplicate code to
19207         its own method, too).
19208
19209 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19210
19211         * attribute.cs: lookup attribute type name as the spec says: first the
19212         bare attribute name and then name + "Attribute" (nant compiles with
19213         mcs after this fix).
19214
19215 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19216
19217         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19218         Because of the way we parse things, we should try to see if a
19219         UIntConstant can fit in an integer.
19220
19221 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19222
19223         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19224         when we are in an explicit context.
19225
19226         (ConvertReferenceExplicit): When converting from Iface type S to Class
19227         T make sure the rules are implemented as an OR.
19228
19229         * parameter.cs (ParameterType): Make it a property for now although the
19230         purpose really isn't anything immediate.
19231
19232         * expression.cs (Is*Applicable): Do better checking on the parameter type
19233         of a ref/out parameter. The ones from the system assemblies are already 
19234         marked with the correct type so we don't need to do any correction.
19235
19236         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19237         the object type is standard too so include that.
19238
19239 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19240
19241         * ecore.cs (StandardConversionExists): Augment with missing code:
19242         deal with IntConstant, LongConstants and Enumerations.
19243
19244         * assign.cs: Report the error, instead of failing silently
19245
19246         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19247         typecontainer that they are declared, because the
19248         typecontainer/namespace will have the list of using clauses that
19249         need to be applied.
19250
19251         Assembly Attributes were escaping the normal registration
19252         mechanism. 
19253
19254         (EmitCode): Apply attributes within an EmitContext that represents
19255         the container they were declared on.
19256
19257         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19258
19259 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19260
19261         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19262         Revamp completely - make much cleaner as we now operate only
19263         on a set of Types.
19264
19265         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19266         to implement the logic detailed in the spec more correctly.
19267
19268         (UserDefinedConversion): Update accordingly.
19269
19270 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19271
19272         * statement.cs: Return flow analysis information up.
19273
19274         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19275         and the default.
19276
19277         (token): Do not consume an extra character before calling
19278         decimal_digits.
19279
19280 2002-05-06  Piers Haken <piersh@friskit.com>
19281
19282         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19283
19284 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19285
19286         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19287         EmitContext during the instance constructor initializer
19288         resolution, to stop access to instance variables.
19289
19290         This is mandated by the spec, last paragraph of the `constructor
19291         initializers' section. 
19292
19293 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19294
19295         * cs-parser.jay, class.cs (Accessor): new class used to represent
19296         an accessor (get or set).  In the past we used `null' to represent
19297         a missing accessor.  But this is ambiguous because there was no
19298         way to tell in abstract indexers/properties if one of them was
19299         specified.
19300
19301         Now there is a way of addressing that.
19302
19303         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19304         instead of FindMembers.
19305
19306         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19307         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19308
19309         * attribute.cs: Treat indexers and properties as the same in terms
19310         of applying attributes
19311
19312         * ecore.cs (FindMostEncompassedType): Use statically initialized
19313         EmptyExpressions()s like we do elsewhere to avoid creating useless
19314         objects (and we take this out of the tight loop).
19315
19316         (GetConversionOperators): Move the code to extract the actual
19317         operators to a separate routine to clean things up.
19318
19319 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19320
19321         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19322         events are always registered FieldBuilders.
19323
19324         * class.cs (FieldBase): New class shared by Fields 
19325
19326         * delegate.cs: If we are a toplevel delegate, use our full name.
19327         If we are a nested delegate, then only use our tail name.
19328
19329 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19330
19331         * expression.cs (IsApplicable): Ensure that we add the "&" to
19332         ref/out types before comparing it with the type of the argument.
19333
19334         (IsParamsMethodApplicable): Ditto.
19335
19336         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19337         silly me ;-)
19338
19339         * delegate.cs : Handle the case when we have more than one applicable
19340         method. Flag an error only when we finish checking all.
19341
19342 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19343
19344         * expression.cs: Add support for boolean static initializers.
19345
19346 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19347
19348         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19349
19350         * parameter.cs (ComputeParameterTypes,
19351         ComputeAndDefineParameterTypes): Better error handling: now we
19352         clear the `types' cache if we fail during any of the type lookups.
19353         We also return the status code correctly to our caller
19354
19355         * delegate.cs: If we fail to define a delegate, abort the extra
19356         steps. 
19357
19358         * expression.cs (Binary.ResolveOperator): for
19359         operator==(object,object) and operator !=(object, object) we also
19360         have to verify that there is an implicit conversion from one to
19361         the other.
19362
19363         (ArrayAccess.DoResolve): Array Access can operate on
19364         non-variables. 
19365
19366 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19367
19368         * assign.cs (CompoundAssign): A new class used as a "flag" that
19369         the assignment actually is happening as part of a compound
19370         assignment operator.
19371
19372         During compound assignment, a few new rules exist to enable things
19373         like:
19374
19375         byte b |= 1 + 2
19376
19377         From the spec:
19378
19379         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19380         to the type of x) if y is implicitly convertible to the type of x,
19381         and the operator is a builtin operator and the return type of the
19382         operator is explicitly convertible to the type of x. 
19383
19384         * rootcontext.cs: Reset warning level to 2.  4 catches various
19385         "interesting" features in mcs, we must clean this up at some
19386         point, but currently am trying to kill other bugs ;-)
19387
19388         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19389         in container classes as well.  
19390
19391         * expression.cs (Binary.ResolveOperator): Handle string case
19392         before anything else (as operator overloading does emit an error
19393         before doing anything else).
19394
19395         This code could go away when we move to a table driven model, but
19396         i could not come up with a good plan last night.
19397
19398 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19399
19400         * typemanager.cs (CSharpName): reimplementation using regex.
19401         * class.cs: added null check for fields in Emit
19402         * rootcontext.cs: set warninglevel to 4
19403
19404 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19405
19406         * typemanager.cs (CSharpName): reimplemented with Lupus
19407         suggestion.
19408
19409 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19410
19411         * statement.cs (If): correclty implement Resolve, because we were
19412         not catching sem errors in there.  The same process is needed
19413         everywhere else. 
19414         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19415
19416
19417         (Statement.Warning_DeadCodeFound): Factorize code.
19418         (While): Report dead code here too.
19419
19420         (Statement): Added Resolve virtual method to allow
19421         for resolution split from the emit code.
19422
19423 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19424
19425         * statement.cs (EmitBoolExpression): No longer try to resolve the
19426         expression here.    
19427         (MakeBoolean): New utility function that resolve, implicitly
19428         converts to boolean and tags the expression. 
19429
19430
19431         (If, Do): Implement dead code elimination.
19432         (While): Implement loop inversion
19433
19434         (Do, While, For, If): Resolve the expression prior to calling our
19435         code generation.
19436
19437 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19438
19439         * class.cs:
19440           - added method Report28 (warning: program has more than one entry point)
19441           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19442           - modified method Method.Define, the part at the end of the method
19443
19444         * rootcontext.cs: added static public Location EntryPointLocation;
19445           
19446         * ../errors/cs0028.cs : Add test case for the above warning.              
19447
19448         * typemanager.cs:
19449           - modified method CSharpName to allow arrays of primitive type to
19450             be printed nicely (e.g. instead of System.Int32[][] it now prints
19451             int[][])
19452           - added method CSharpSignature: returns the signature of a method
19453             in string format to be used in reporting errors, warnings, etc.
19454
19455         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19456         with String.Empty.
19457
19458 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19459
19460         * delegate.cs (Define): Fix extremely silly bug where I was
19461         setting the type of the 'object' parameter of the BeginInvoke
19462         method to System.IAsyncResult instead of System.Object ;-)
19463
19464 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19465
19466         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19467         here. 
19468
19469         (Constructor.Emit): return if we fail to initialize the
19470         constructor.  Another door closed!  
19471
19472         * expression.cs (New.DoResolve): Improve error message (from -6 to
19473         1501).  Use DeclaredOnly lookup to find the exact constructor.
19474
19475         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19476         loop.  This is useful.
19477
19478         * cs-parser.jay: Adjust the default parameters so that destructors
19479         have the proper signature.
19480
19481 2002-04-26  Martin Baulig  <martin@gnome.org>
19482
19483         * driver.cs (LoadAssembly): If `assembly' contains any characters
19484         which are only valid in path names and not in assembly names
19485         (currently slash, backslash and point), use Assembly.LoadFrom ()
19486         instead of Assembly.Load () on the `assembly' (before iteration
19487         over the link_paths).
19488
19489 2002-04-26  Martin Baulig  <martin@gnome.org>
19490
19491         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19492
19493 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19494
19495         * class.cs (Property): use the new typemanager.MemberLookup
19496
19497         (TypeContainer.MemberLookup): Implement using the
19498         TypeManager.MemberLookup now. 
19499
19500         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19501         and return MemberInfos, so that these can be used without an
19502         EmitContext (what we had before).
19503
19504 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19505
19506         * expression.cs: Fix the case where the argument to params if the
19507         type of the params.  I omitted handling this before.   Fixed
19508
19509 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19510
19511         * driver.cs: Call BootCorlib_PopulateCoreType
19512
19513         * class.cs (Property.CheckBase): Check for properties only, not
19514         for all members. 
19515
19516         * interface.cs: Temporary hack: try/catch around the
19517         CustomAttributeBuilder, because I am getting an exception that I
19518         do not understand.
19519
19520         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19521         types whose definitions are required to be there (attributes are
19522         defined before standard types).
19523
19524         Compute definitions as we boot the various types, as they are used
19525         immediately (value_type class will need object_type, but if we do
19526         not initialize object_type, we will pass a null, which will let
19527         the runtime pick the System.Object from the existing corlib, which
19528         is not what we want).
19529
19530 2002-04-22  Patrik Torstensson <totte@labs2.com>
19531
19532         * cs-tokenizer.cs: fixed a number of trim() issues.
19533
19534 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19535
19536         * expression.cs (Argument.Type): Ensure that we return the correct
19537         type when we have out or ref parameters [in which case we 
19538         append a "&"].
19539
19540 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19541
19542         * class.cs (Property, Indexer): Allow extern modifier in there. 
19543
19544         * typemanager.cs (InitBaseTypes): Initializes object_type and
19545         value_type, since those will be used early on during the bootstrap
19546         process to compile corlib.
19547
19548         (InitCoreTypes): Move code from here to InitBaseTypes.
19549
19550 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19551
19552         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19553         single-dimension arrays as using the ldlen opcode.  
19554
19555         Daniel Lewis discovered this optimization.  
19556
19557         * typemanager.cs: Add signature for System.Array::get_Length
19558
19559 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19560
19561         * statement.cs: report the error when the foreach does not apply to an
19562         array nor a collection.
19563
19564 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19565
19566         * expression.cs: Add implicit conversions to the operator ~.
19567
19568         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19569
19570         * typemanager.cs: Locate the decimal constructor.
19571
19572 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19573
19574         * attribute.cs: use the new property of TypeOf.
19575         * expression.cs: added 'get' property around typearg.
19576
19577         These changes fix a build breaker reported by NickD. Is this the
19578         correct way to fix?  If not, please, revert my changes and make it
19579         work :-).
19580
19581 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19582
19583         * attribute.cs: Add support for typeof in attribute invocations.
19584         I am not sure that this is right though.
19585
19586 2002-04-14  Duncan Mak  <duncan@ximian.com>
19587
19588         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19589         Binary.Operator.Division case.
19590
19591 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19592
19593         * class.cs (DefineType): Ensure that we do a proper check on
19594         attribute types and also register it with the TypeManager.
19595
19596         (TypeContainer.Targets): The default for attribute types is
19597         AttributeTargets.All.
19598
19599         * attribute.cs (ApplyAttributes): Registering the attribute type
19600         is done elsewhere, not when we discover we have a Usage attribute.
19601
19602 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19603
19604         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19605         and get rid of is_delegate parameter.
19606
19607         * everywhere : update.
19608
19609 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19610
19611         * cs-parser.jay (compilation_unit): Revamp completely to use
19612         some new ideas that I got from Rhys' grammar to solve the problems
19613         with assembly level attributes.
19614
19615         (outer_declaration): New grammar production.
19616
19617         (attribute_sections): Add.
19618
19619         (opt_attributes): Base on attribute_sections
19620
19621         (namespace_declaration): Allow opt_attributes to tackle the case
19622         when we have assembly level attributes - we are clever in this
19623         regard now ;-)
19624
19625         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19626         attributes in the non-global context.
19627
19628         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19629         instead of SetGlobalAttributes.
19630
19631         * class.cs, rootcontext.cs : Ensure we define and generate 
19632         attribute types before anything else.
19633
19634         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19635         and flag the new error -20 for the case when the attribute type
19636         does not have valid targets specified. csc does not catch this.
19637
19638         * ../errors/errors.txt : update for error # -20
19639
19640 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19641
19642         * support.cs (InternalParameters.ParameterModifier): Do some null
19643         checking and return sane values.
19644
19645         * class.cs (Method.Define): If we are a PInvoke method, ensure
19646         that we are static and extern. Report error # 601
19647
19648         * ../errors/cs0601.cs : Add test case for the above error.
19649
19650 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19651
19652         * rootcontext.cs (attribute_types): We need to keep type of
19653         all attribute types separately and emit code for them first.
19654
19655         (RegisterAttribute) : Implement.
19656
19657         * class.cs (DefineType): Check if the current Type is a custom
19658         attribute type and register it accordingly.
19659
19660         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19661         adding the first attribute twice and rename to
19662
19663         (SetGlobalAttributes): this.
19664
19665         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19666         lookups.
19667
19668         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19669         if we are processing global arguments. Hmm, I am unsure of this.
19670
19671 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19672
19673         * expression.cs: added static array of strings to avoid calling
19674         Enum.ToString () for Operator in Binary. Significant recover of
19675         performance.
19676
19677 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * class.cs (FindMembers): Allow the Builders of the various
19680         members to be null.  If they are skip them.  This only happens
19681         during the PInvoke declaration.
19682
19683 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19684
19685         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19686         failure, so we do not keep going afterwards.
19687
19688         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19689         wanted to pass `false' as the `is_delegate' argument.  If this is
19690         the case, why not use delegate_type == null to mean `is_delegate =
19691         false' and anything else as is_delegate = true.
19692
19693 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19694
19695         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19696         code for the section, not the beginning of the tests.
19697
19698 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19699
19700         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19701
19702         * expression.cs (Binary): same.  Warn about errors where we have
19703         Enum/Enum in operator + as well.
19704
19705 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19706
19707         * statement.cs:
19708                 - added support for switch(bool)
19709                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19710                 - add TableSwitchEmit() to handle table-based switch statements
19711
19712 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19713
19714         * expression.cs (Invocation.OverloadResolve): Factor out code which
19715         does parameter compatibility checking with arguments so that we can 
19716         re-use the code even from Delegate.VerifyApplicability
19717
19718         (VerifyArgumentsCompat): Move above code here.
19719
19720         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19721         and instead make a call to the above method.
19722
19723 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19724
19725         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19726         We use it to keep track of classes which are attribute types.
19727
19728 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19729
19730         * delegate.cs (Delegate.Define): Correctly define the types in the
19731         presence of fixed and array parameters.
19732
19733         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19734         doing FindMembers.
19735
19736         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19737         include NonPublic after the first iteration.
19738
19739         * class.cs (Indexer.CheckBase): Only check if both parents are
19740         non-null. 
19741
19742         * cs-parser.jay (accessor_body): If empty, set to null.
19743
19744         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19745         same code path here to resolve constants names that we did have in
19746         MemberAccess.DoResolve.  There is too much code duplicated here.
19747
19748 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19749
19750         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19751
19752         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19753         to MakeUnionSet.
19754
19755         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19756         tokens, numbers and strings.
19757
19758         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19759         parenthesis.
19760
19761         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19762         asyncronous parameters and the regular parameters.  
19763
19764         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19765         specify the target directory.
19766
19767         * expression.cs: (This.DoResolve): Simplify
19768         (As.Emit): Optimize, do not generate IsInst if the expression is
19769         always of the given type.
19770
19771         (Is.DoResolve): Bug fix, we were reporting both always/never for
19772         the is expression.
19773
19774         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19775         creating too many unnecessary arrays.
19776
19777 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19778
19779         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19780         fields instead of rolling our own initializer.   Takes care of all
19781         implicit conversions, and drops unnecessary static checks/argument.
19782
19783 2002-03-31  Dick Porter  <dick@ximian.com>
19784
19785         * driver.cs: use the GetDirectories() return values properly, and
19786         use "/" as path separator.
19787
19788 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19789
19790         * expression.cs (Unary): Optimize - - expr into expr.
19791         (Binary): Optimize a + (-b) into a -b.
19792
19793         * codegen.cs (CodeGen): Made all methods static.
19794
19795 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19796
19797         * rootcontext.cs: 
19798
19799         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19800         TypeBuilder property.
19801
19802         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19803         instead. 
19804
19805         * tree.cs: Removed the various RecordXXXX, and replaced with a
19806         single RecordDecl.  Removed all the accessor methods, and just
19807         left a single access point Type 
19808
19809         * enum.cs: Rename DefineEnum to DefineType.
19810
19811         * decl.cs: New abstract method `DefineType' used to unify the
19812         Defines for Enumerations, Interfaces, TypeContainers and
19813         Delegates.
19814
19815         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19816         LookupBaseClasses method that used to live in class.cs and
19817         interface.cs here, and renamed to FindType.
19818
19819         * delegate.cs: Implement DefineType.  Take advantage of the
19820         refactored pattern for locating the parent builder without taking
19821         the parent_builder argument (which we know does not work if we are
19822         nested, and triggering a toplevel definition).
19823
19824 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19825
19826         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19827         accessibility of a member has changed during override and report
19828         an error if so.
19829
19830         * class.cs (Method.Define, Property.Define): Only complain on
19831         overrides if the method is private, any other accessibility is
19832         fine (and since we just checked the permission is the same, we are
19833         good to go).
19834
19835         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19836         and elif are processed always.  The other pre-processing
19837         directives are only processed if we are "taking" the path
19838
19839 2002-03-29  Martin Baulig  <martin@gnome.org>
19840
19841         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19842         current location is not Null.
19843
19844         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19845         a separate method so we can profile it.
19846
19847         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19848         `span.Seconds' are just seconds, but no minutes or hours.
19849         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19850
19851 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19852
19853         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19854         Remove the gratuitous set of Final:
19855
19856                                 // If an interface implementation, then we can set Final.
19857                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19858                                     implementing.DeclaringType.IsInterface)
19859                                         flags |= MethodAttributes.Final;
19860
19861         I do not know what I was smoking when I used that.
19862
19863
19864         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19865         step into fixing the name resolution issues for delegates and
19866         unifying the toplevel name resolution.
19867
19868 2002-03-28  Martin Baulig  <martin@gnome.org>
19869
19870         * class.cs (Method.Emit): If we have a symbol writer, call its
19871         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19872         tell it about the current method.
19873
19874         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19875         writer that we're going to emit the first byte of IL code for a new
19876         statement (a new source line).
19877         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19878         EmitContext.Mark() before emitting any code.
19879
19880         * location.cs (SymbolDocument): Return null when we're Null.
19881
19882         * statement.cs (Statement): Moved the `Location loc' variable here.
19883         (Statement.EmitBoolExpression): If we have a symbol writer, call
19884         ec.Mark() before emitting any code to tell it that we're at the
19885         beginning of a new statement.
19886         (StatementExpression): Added `Location' argument to the constructor.
19887         (Block): Added public readonly variable `StartLocation' and public
19888         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19889         (Block): Added constructor which takes a start and end location.
19890         (Block.SetEndLocation): New method. This sets the end location.
19891         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19892         local variables we create.
19893         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19894         each statement and do also mark the begin and end of the block.
19895
19896         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19897         tell it the current lexer.Location, use Location.Null for the end of the
19898         block.
19899         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19900         current block, set its end location using SetEndLocation().
19901         (statement_expression): StatementExpression constructor now takes the
19902         lexer.Location as additional argument.
19903         (for_statement, declare_local_variables): Likewise.
19904         (declare_local_variables): When creating a new implicit block, use the
19905         new Block constructor and pass it the lexer.Location.
19906
19907 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19908
19909         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19910         members also on the parent interfaces recursively.
19911
19912 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19913
19914         * report.cs: Use new formats, since Gonzalo finished the missing
19915         bits. 
19916
19917         * expression.cs (Binary.ResolveOperator): added missing operator|
19918         operator& and operator^ for bool/bool.
19919
19920         * cs-parser.jay: CheckDef now takes a Location argument that is
19921         used to report errors more precisly (instead of reporting the end
19922         of a definition, we try to track something which is a lot closer
19923         to the source of the problem).
19924
19925         * cs-tokenizer.cs: Track global token use, so we can properly flag
19926         the use of #define/#undef after the first token has been seen.
19927
19928         Also, rename the reportXXXX to Error_DescriptiveName
19929
19930         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19931         TypeContainer, so that Enum and Interface can use this too.
19932
19933         * class.cs (TypeContainer.LookupInterfaceOrClass,
19934         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19935         `builder' argument.  Typically this was used to pass the parent
19936         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19937         the definition).  
19938
19939         The problem is that a nested class could trigger the definition of
19940         a toplevel class, and the builder would be obviously wrong in that
19941         case. 
19942
19943         So we drop this argument, and we compute dynamically the
19944         TypeBuilder/ModuleBuilder (the correct information was available
19945         to us anyways from DeclSpace.Parent)
19946
19947         * interface.cs (Interface.DefineInterface): Drop builder
19948         parameter cleanup like class.cs
19949
19950         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19951         like class.cs
19952
19953         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19954         values. 
19955
19956         (Try.Emit): Propagate the returns value from the statement.
19957
19958         (Return.Emit): Even if we are leavning 
19959
19960         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19961
19962         * modifiers.cs: Fix the computation of MethodAttributes flags.
19963
19964 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19965
19966         * driver.cs: allow compilation of files that start with '/'.
19967         Add a default case when checking the argument of --target.
19968
19969 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19970
19971         * interface.cs: Implement the same search algorithm for types in
19972         the interface code.
19973
19974         * delegate.cs: Do not allow multiple definition.
19975
19976         * Recovered ChangeLog that got accidentally amputated
19977
19978         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19979
19980         * rootcontext.cs: Load manually enum to allow core classes to
19981         contain enumerations.
19982
19983         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19984         Update to new static methods in TypeManager.
19985
19986         * typemanager.cs (GetMethod, GetConstructor): Use our
19987         implementation of FindMembers to find the members, since during
19988         corlib compilation, the types are TypeBuilders and GetMethod and
19989         GetConstructor do not work.
19990
19991         Make all methods in TypeManager static.
19992
19993         (InitCodeHelpers): Split the functionality from
19994         the InitCodeTypes function.
19995
19996         * driver.cs: Call InitCodeHelpers after we have populated the
19997         types. 
19998
19999         * cs-parser.jay (delegate_declaration): we did not used to compute
20000         the delegate name correctly for void delegates.
20001
20002 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20003
20004         * rootcontext.cs (RootContext): Init the interface_resolve_order
20005         and type_container_resolve_order always.
20006
20007         (ResolveCore, BootstrapCorlib_ResolveClass,
20008         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20009         compiler when compiling with --nostdlib
20010
20011         * class.cs (TypeContainer.DefineType): Check that our parent is
20012         not null.  This test is most important when we are bootstraping
20013         the core types.
20014
20015         * codegen.cs: Split out the symbol writing code.
20016
20017 2002-03-25  Martin Baulig  <martin@gnome.org>
20018
20019         * driver.cs (-g): Made -g an alias for --debug.
20020
20021 2002-03-24  Martin Baulig  <martin@gnome.org>
20022
20023         * codegen.cs (SymbolWriter): New public variable. Returns the
20024         current symbol writer.
20025         (CodeGen): Added `bool want_debugging_support' argument to the
20026          constructor. If true, tell the ModuleBuild that we want debugging
20027         support and ask it for the ISymbolWriter.
20028         (Save): If we have a symbol writer, call it's Close() method after
20029         saving the assembly.
20030
20031         * driver.c (--debug): New command line argument to create a
20032         debugger information file.
20033
20034         * location.cs (SymbolDocument): New public property. Returns an
20035         ISymbolDocumentWriter object for the current source file or null
20036         if we don't have a symbol writer.
20037
20038 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20039
20040         * driver.cs (LoadAssembly): Correctly return when all the paths
20041         have been tried and not before.
20042
20043         * statement.cs (Switch.Emit): return the actual coverage for this
20044         statement (returns/not-returns)
20045
20046         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20047         switch of the statement if we are the last switch section.  That
20048         kills two problems: try/catch problems (we used to emit an empty
20049         nop at the end) and switch statements where all branches would
20050         return. 
20051
20052 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20053
20054         * driver.cs: Add default assemblies (the equivalent to the
20055         Microsoft CSC.RSP file)
20056
20057         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20058         also update tokens_seen and set it to false.
20059
20060         * driver.cs: Implement --recurse for Mike.
20061
20062         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20063         correctly splitting out the paths.
20064
20065 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20066
20067         * interface.cs (Interface.PopulateProperty): Instead of using
20068         `parent' as the declaration space for the set parameters, use
20069         `this' 
20070
20071         * support.cs (InternalParameters): InternalParameters constructor
20072         takes a DeclSpace instead of a TypeContainer.
20073
20074         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20075         types are being initialized, load the address of it before calling
20076         the function.  
20077
20078         (New): Provide a mechanism to disable the generation of local
20079         value type temporaries when the caller will be providing us with
20080         an address to store it.
20081
20082         (ArrayCreation.EmitDynamicInitializers): Use it.
20083
20084 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20085
20086         * expression.cs (Invocation.EmitArguments): Only probe for array
20087         property if there is more than one argument.  Sorry about that.
20088
20089         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20090         empty param arrays.
20091
20092         * class.cs (Method.LabelParameters): Fix incorrect code path that
20093         prevented the `ParamArrayAttribute' from being applied to the
20094         params attribute.
20095
20096 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20097
20098         * support.cs (ReflectionParameters): Correctly compute whether the
20099         last argument is a params array.  Fixes the problem with
20100         string.Split ('a')
20101
20102         * typemanager.cs: Make the assemblies array always be non-null
20103         (empty, but non-null)
20104
20105         * tree.cs (RecordDecl): New function that abstracts the recording
20106         of names.  This reports error 101, and provides a pointer to the
20107         previous declaration.  Fixes a crash in the compiler.
20108
20109         * cs-parser.jay (constructor_declaration): Update to new grammar,
20110         and provide a constructor_body that can be empty.
20111
20112 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20113
20114         * driver.cs: Add support for --resources.
20115
20116         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20117         Make all types for the various array helper methods be integer.
20118
20119         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20120         CheckState to ConvCast.
20121
20122         (ConvCast): Now it takes a `checked' state argument, to avoid
20123         depending on the emit context for the conversion, and just using
20124         the resolve time setting.
20125
20126         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20127         instead of Invocation.EmitArguments.  We do not emit the original
20128         arguments, instead we emit those which have been converted to
20129         unsigned int expressions.
20130
20131         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20132
20133         * codegen.cs: ditto.
20134
20135         * expression.cs (LocalVariableReference): Drop the use of the
20136         Store function that depended on the variable index.
20137
20138         * statement.cs (VariableInfo): Drop the `Idx' property from this
20139         class, as this is not taking into account the indexes for
20140         temporaries tat we generate during the execution, getting the
20141         indexes wrong.
20142
20143         * class.cs: First emit class initializers, then call the parent
20144         constructor. 
20145
20146         * expression.cs (Binary): Fix opcode emision.
20147         (UnaryMutator.EmitCode): Support checked code generation
20148
20149         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20150         matches for events for both the Static and Instance scans,
20151         pointing to the same element.   Fix that.
20152
20153 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20154
20155         * rootcontext.cs (ResolveTree): Always set the
20156         interface_resolve_order, because nested interfaces will be calling
20157         into us.
20158
20159         * class.cs (GetInterfaceOrClass): Track the same resolution
20160         process used by TypeManager.LookupType.  This fixes the nested
20161         type lookups in class declarations (separate path from
20162         LookupType). 
20163
20164         (TypeContainer.DefineType): Also define nested interfaces.
20165         (TypeContainer.RegisterOrder): New public function used to
20166         register the order in which child interfaces need to be closed.
20167
20168         Nested interfaces need to be closed after their parents have been
20169         created. 
20170
20171         * interface.cs (InterfaceAttr): Put all the logic for computing
20172         the interface attribute here. 
20173
20174         (DefineInterface): Register our interface order with the
20175         RootContext or with the TypeContainer depending on the case.
20176
20177 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20178
20179         * cs-parser.jay: rework foreach statement to work with the new
20180         changes to the policy on SimpleNames.
20181
20182         * report.cs: support Stacktrace on warnings as well.
20183
20184         * makefile: drop --unsafe and /unsafe from the compile.
20185
20186 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20187
20188         * ecore.cs (StandardConversionExists): Modify to take an Expression
20189         as the first parameter. Ensure we do null -> reference type conversion
20190         checking.
20191
20192         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20193         temporary Expression objects.
20194
20195 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20196
20197         * interface.cs: workaround bug in method overloading resolution
20198         (there is already a bugzilla bug for it).
20199
20200 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20201
20202         We could also solve this problem by having a separate path for
20203         performing type lookups, instead of DoResolve, we could have a
20204         ResolveType entry point, and only participating pieces of the
20205         production (simplename, deref, array) would implement this. 
20206
20207         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20208         signal SimpleName to only resolve type names and not attempt to
20209         resolve anything else.
20210
20211         * expression.cs (Cast): Set the flag.
20212
20213         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20214
20215         * class.cs: Only report 108 if there is no `new' modifier.
20216
20217         * cs-parser.jay: rework foreach statement to work with the new
20218         changes to the policy on SimpleNames.
20219         
20220         * report.cs: support Stacktrace on warnings as well.
20221
20222         * makefile: drop --unsafe and /unsafe from the compile.
20223
20224 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20225
20226         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20227         lookups here, instead of doing that at parse time.  This means
20228         that our grammar will not introduce `LocalVariableReferences' as
20229         expressions at this point.  That solves the problem of code like
20230         this:
20231
20232         class X {
20233            static void Main ()
20234            { int X = 1;
20235             { X x = null }}}
20236
20237         This is only half the fix.  The full fix requires parameters to
20238         also be handled in this way.
20239
20240         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20241         makes the use more obvious of the DeclSpace.  The
20242         ec.TypeContainer.TypeBuilder is now only used to pull the
20243         TypeBuilder for it.
20244
20245         My theory is that I can get rid of the TypeBuilder completely from
20246         the EmitContext, and have typecasts where it is used (from
20247         DeclSpace to where it matters).  
20248
20249         The only pending problem is that the code that implements Aliases
20250         is on TypeContainer, and probably should go in DeclSpace.
20251
20252         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20253         lookups here, instead of doing that at parse time.  This means
20254         that our grammar will not introduce `LocalVariableReferences' as
20255         expressions at this point.  That solves the problem of code like
20256         this:
20257
20258         class X {
20259            static void Main ()
20260            { int X = 1;
20261             { X x = null }}}
20262
20263         This is only half the fix.  The full fix requires parameters to
20264         also be handled in this way.
20265
20266         * class.cs (Property.DefineMethod): When implementing an interface
20267         method, set newslot, when implementing an abstract method, do not
20268         set the flag (before we tried never setting it, or always setting
20269         it, which is the difference).
20270         (Indexer.DefineMethod): same.
20271         (Method.DefineMethod): same.
20272
20273         * ecore.cs: Only set the status used flag if we get back a Field.
20274
20275         * attribute.cs: Temporary hack, so Paolo can keep working.
20276
20277 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20278
20279         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20280         the unmanaged type in the case we have a MarshalAs attribute.
20281
20282         (Resolve): Handle the case when we are parsing the special MarshalAs
20283         attribute [we need to store the unmanaged type to use later]
20284
20285         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20286         MarshalAs Attribute.
20287
20288         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20289         on parameters and accordingly set the marshalling info.
20290
20291 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20292
20293         * class.cs: Optimizing slightly by removing redundant code after
20294         we switched to the `NoTypes' return value.
20295         (Property.DefineMethod): use NoTypes here too.
20296
20297         This fixes the bug I introduced in my last batch of changes.
20298
20299 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20300
20301         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20302
20303         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20304         Enums since those are types too. 
20305
20306         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20307
20308         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20309         thanks to a call during the lookup process.
20310
20311 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20312
20313         * statement.cs (Foreach): Lots of work to accomodate a particular
20314         kind of foreach statement that I had not kept in mind.  It is
20315         possible to have foreachs on classes that provide a GetEnumerator
20316         method that return objects that implement the "pattern" for using
20317         a foreach, there is no need to support GetEnumerator
20318         specifically. 
20319
20320         This is needed to compile nant.
20321
20322         * decl.cs: Only report 114 if the member is not `Finalize' and if
20323         the warning level is at least 2.
20324
20325         * class.cs: Moved the compare function from Method to
20326         MethodSignature. 
20327
20328         (MethodSignature.InheritableMemberSignatureCompare): Add new
20329         filter function that is used to extract inheritable methods from a
20330         class. 
20331
20332         (Method.Define): Use the new `inheritable_method_signature_filter'
20333         delegate
20334
20335         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20336         command. 
20337
20338 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20339
20340         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20341
20342         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20343
20344         * expression.cs: Pass location information to
20345         ConvertImplicitStandard. 
20346
20347         * class.cs: Added debugging code to track return values from
20348         interfaces. 
20349
20350 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20351
20352         * expression.cs (Is.DoResolve): If either side of the `is' is an
20353         interface, do not flag the warning.
20354
20355         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20356         for interfaces
20357
20358         * report.cs: Allow for --fatal to be used with --probe.
20359
20360         * typemanager.cs (NoTypes): Move the definition for the empty Type
20361         array here. 
20362
20363         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20364         properties. 
20365         (TypeContainer.DefineProxy): New function used to proxy to parent
20366         implementations when implementing interfaces.
20367         (TypeContainer.ParentImplements): used to lookup if our parent
20368         implements a public function that is required by an interface.
20369         (TypeContainer.VerifyPendingMethods): Hook this up.
20370
20371         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20372         `modules' and `assemblies' arraylists into arrays.  We only grow
20373         these are the very early start up of the program, so this improves
20374         the speedof LookupType (nicely measured).
20375
20376         * expression.cs (MakeByteBlob): Replaced unsafe code with
20377         BitConverter, as suggested by Paolo.
20378
20379         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20380         folding of string concatenation, but if either side is a string,
20381         and the other is not, then return null, and let the runtime use
20382         the concatenation on the string plus the object (using
20383         `Object.ToString'). 
20384
20385 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20386
20387         Constant Folding has been implemented now.
20388
20389         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20390         the error instead on types that are not supported in one's
20391         complement. 
20392
20393         * constant.cs (Constant and all children): New set of functions to
20394         perform implict and explicit conversions.
20395
20396         * ecore.cs (EnumConstant): Implement the new functions to perform
20397         conversion by proxying to the child expression.
20398
20399         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20400         own separate setting that can not be turned off from the command
20401         line using --unchecked or --checked and is only controlled using
20402         the checked/unchecked statements and expressions.  This setting is
20403         used by the constant folder to flag errors.
20404
20405         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20406         ConstantCheckState as well.   
20407
20408         During Resolve, they also have to flag the state, because the
20409         constant folder runs completely in the Resolve phase.
20410
20411         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20412         well.
20413
20414 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20415
20416         * cfold.cs: New file, this file contains the constant folder.
20417
20418         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20419         argument to track whether we are using the resulting address to
20420         load or store a value and provide better error messages. 
20421
20422         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20423         new AddressOf arguments.
20424
20425         * statement.cs (Foreach.EmitCollectionForeach): Update
20426
20427         * expression.cs (Argument.Emit): Call AddressOf with proper
20428         arguments to track usage.
20429
20430         (New.DoEmit): Call AddressOf with new arguments.
20431
20432         (Unary.Emit): Adjust AddressOf call.
20433
20434 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20435
20436         * cs-parser.jay (member_access): Change the case for pre-defined types
20437         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20438         this suggestion.
20439
20440         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20441         a method body.
20442
20443         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20444         essentially like methods and apply attributes like MethodImplOptions to them too.
20445
20446         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20447         not being null.
20448
20449         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20450         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20451         is the DeclSpace.
20452
20453         * Update code everywhere accordingly.
20454
20455         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20456
20457         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20458
20459 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20460
20461         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20462         try performing lookups against those instead of jumping straight into using
20463         the 'using' clauses.
20464
20465         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20466
20467         (LookupType): Perform lookups in implicit parents too.
20468
20469         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20470         sequence as RootContext.LookupType. 
20471
20472         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20473         the various cases of namespace lookups into this method.
20474
20475 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20476
20477         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20478         in positional arguments)
20479
20480         * class.cs (Operator): Update the AllowedModifiers to contain
20481         extern. 
20482
20483         * cs-parser.jay: Update operator declaration to allow for the
20484         operator body to be empty.
20485
20486         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20487         values. 
20488
20489 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20490
20491         * class.cs (Method.Emit): Label parameters.
20492
20493         * driver.cs: Return 1 or 0 as the program exit code.
20494
20495 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20496
20497         * expression.cs: Special case the `null' object when trying to
20498         auto-compute the type, as anything can be explicitly converted to
20499         that. 
20500
20501         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20502         spotting this Paolo.
20503
20504         (Expression.ImplicitNumericConversion): Perform comparissions of
20505         the type using the underlying type in the case of an enumeration
20506         rather than using the enumeration type for the compare.
20507
20508         Cope with the underlying == type case, which is not possible to
20509         catch before. 
20510
20511         (Expression.ConvertNumericExplicit): Perform comparissions of
20512         the type using the underlying type in the case of an enumeration
20513         rather than using the enumeration type for the compare.
20514
20515         * driver.cs: If the user does not supply an extension, assume .exe
20516
20517         * cs-parser.jay (if_statement): Rewrote so that we can track the
20518         location for the if statement.
20519
20520         * expression.cs (Binary.ConstantFold): Only concat strings when
20521         the operation is "+", not everything ;-)
20522
20523         * statement.cs (Statement.EmitBoolExpression): Take a location
20524         argument. 
20525         (If, While, Do): Track location.
20526
20527         * expression.cs (Binary.ResolveOperator): In the object + string
20528         case, I was missing a call to ConvertImplicit
20529
20530 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20531
20532         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20533         Location arguments. Ensure we use RootContext.LookupType to do our work
20534         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20535
20536         * interface.cs (PopulateMethod): Handle the type of the parameter being
20537         null gracefully.
20538
20539         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20540         have a params method with no fixed arguments and a call is made with no
20541         arguments.
20542
20543 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20544
20545         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20546         the verbatim-string-literal
20547
20548         * support.cs (InternalParameters.ParameterModifier): handle null
20549         fixed parameters.
20550         (InternalParameters.ParameterType): ditto.
20551
20552         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20553         duplicating the name of the variable parameter.
20554         (GetParameterByName): Fix bug where we were not looking up array
20555         paramters if they were the only present (thanks Paolo!).
20556         (GetParameterInfo): We only have an empty set of types if both
20557         fixed and array are set to null.
20558         (GetParameterInfo-idx): Handle FixedParameter == null
20559
20560         * cs-parser.jay: Handle the case where there is no catch
20561         statements (missing null test).
20562
20563 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20564
20565         * driver.cs (MainDriver): Be conservative on our command line
20566         handling.
20567
20568         Catch DirectoryNotFoundException when calling GetFiles.
20569
20570         (SplitPathAndPattern): Used to split the input specification into
20571         a path and a pattern that we can feed to Directory.GetFiles.
20572
20573 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20574
20575         * statement.cs (Fixed): Implement the last case of the Fixed
20576         statement (string handling).
20577
20578         * expression.cs (StringPtr): New class used to return a char * to
20579         a string;  Used by the Fixed statement.
20580
20581         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20582
20583         * expression.cs (Binary.ResolveOperator): Remove redundant
20584         MemberLookup pn parent type.
20585         Optimize union call, we do not need a union if the types are the same.
20586         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20587         type.
20588
20589         Specialize the use of MemberLookup everywhere, instead of using
20590         the default settings. 
20591
20592         (StackAlloc): Implement stackalloc keyword.
20593
20594         * cs-parser.jay: Add rule to parse stackalloc.
20595
20596         * driver.cs: Handle /h, /help, /?
20597
20598         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20599         before we supported unsafe code.
20600
20601         * makefile: add --unsafe to the self compilation of mcs.
20602
20603 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * expression.cs (PointerArithmetic): New class that is used to
20606         perform pointer arithmetic.
20607         (Binary.Resolve): Handle pointer arithmetic
20608         Handle pointer comparission.
20609         (ArrayPtr): Utility expression class that is used to take the
20610         address of an array.
20611
20612         (ElementAccess): Implement array access for pointers
20613
20614         * statement.cs (Fixed): Implement fixed statement for arrays, we
20615         are missing one more case before we are done.
20616
20617         * expression.cs (Indirection): Implement EmitAssign and set the
20618         ExprClass to Variable.  This allows pointer dereferences to be
20619         treated as variables, and to have values assigned to them.
20620
20621         * ecore.cs (Expression.StoreFromPtr): New utility function to
20622         store values dereferencing.
20623
20624 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20625
20626         * expression.cs (Binary.ResolveOperator): Ensure that we are
20627         not trying to operate on a void type - this fixes the reported
20628         bug.
20629
20630         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20631         the parent implementation is sealed.
20632
20633         * ../errors/cs0239.cs : Add.
20634
20635         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20636
20637         * typemanager.cs (unverifiable_code_type): Corresponds to 
20638         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20639         which have unsafe code in them.
20640
20641         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20642         unsafe context.
20643
20644 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20645
20646         * cs-tokenizer.cs: Add support for @"litreal strings"
20647
20648         Make tokenizer accept pre-processor directives
20649         on any column (remove the old C-like limitation). 
20650
20651         * rootcontext.cs (EmitCode): Emit any global attributes.
20652         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20653
20654         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20655
20656         * cs-parser.jay: Add support for global attributes.  
20657
20658 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20659
20660         * expression.cs (Indirection): New helper class.  Unary will
20661         create Indirection classes to be able to implement the
20662         IMemoryLocation interface on it.
20663
20664 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20665
20666         * cs-parser.jay (fixed_statement): reference the right statement.
20667
20668         * statement.cs (Fixed.Emit): Finish implementing the fixed
20669         statement for the &x case.
20670
20671 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20672
20673         * class.cs (Property.Define, Method.Define): Remove newslot when
20674         `implementing'.  
20675
20676         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20677         wrong.  NewSlot should only be used if the `new' keyword is present.
20678
20679         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20680         locating our system dir.  Sorry about this.
20681
20682 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20683
20684         * driver.cs (GetSystemDir): Compute correctly the location of our
20685         system assemblies.  I was using the compiler directory instead of
20686         the library directory.
20687
20688 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20689
20690         * expression.cs (BetterFunction): Put back in what Miguel commented out
20691         since it is the correct fix. The problem is elsewhere ;-)
20692
20693         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20694         parameters of the parms method are themselves compatible or not !
20695
20696         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20697         to check that a class implements an interface before saying that an implicit
20698         conversion was allowed. Use ImplementsInterface to do the checking.
20699
20700 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20701
20702         * class.cs (Method.Define): Track whether we are an explicit
20703         implementation or not.  And only call DefineMethodOverride if we
20704         are an explicit implementation.
20705
20706         (Property.DefineMethod): Ditto.
20707
20708 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20709
20710         * expression.cs (BetterFunction): Catch hideous bug which was
20711          preventing us from detecting ambiguous calls due to implicit casts i.e
20712         cs0121.
20713
20714 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20715
20716         * support.cs (Pair): Remove un-needed method.  I figured why I was
20717         getting the error in cs-parser.jay, the variable in a foreach loop
20718         is readonly, and the compiler does not really treat this as a variable.
20719
20720         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20721         instead of EQUALS in grammar.  
20722
20723         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20724
20725         * expression.cs (Unary.DoResolve): Check whether the argument is
20726         managed or not.
20727
20728 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20729
20730         * support.cs: Api for Pair to set a value.  Despite the fact that
20731         the variables are public the MS C# compiler refuses to compile
20732         code that accesses the field if the variable is part of a foreach
20733         statement. 
20734
20735         * statement.cs (Fixed): Begin implementation of the fixed
20736         statement.
20737
20738         (Block.AddVariable): Return the VariableInfo on success and null
20739         on failure instead of true/false. 
20740
20741         * cs-parser.jay (foreach): Catch errors on variables already
20742         defined (we were ignoring this value before) and properly unwind
20743         the block hierarchy
20744
20745         (fixed_statement): grammar for the fixed statement.
20746
20747 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20748
20749         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20750         pointer types to be incretemented.
20751
20752         (SizeOf): Implement.
20753
20754         * cs-parser.jay (pointer_member_access): Implement
20755         expr->IDENTIFIER production.
20756
20757         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20758         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20759         on safe contexts.
20760
20761         (Unary): Implement indirection.
20762
20763         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20764         use in non-unsafe context).
20765
20766         (SimpleName.DoResolve): Check for pointers in field access on safe
20767         contexts. 
20768
20769         (Expression.LoadFromPtr): Factor the load-indirect code in this
20770         function.  This was duplicated in UnboxCast and ParameterReference
20771
20772 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20773
20774         * expression.cs (ComposedCast): report an error if a pointer cast
20775         is used in a safe region.
20776
20777         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20778         pointer type casts in unsafe context.
20779
20780         * codegen.cs (EmitContext): Set up IsUnsafe.
20781
20782         * cs-parser.jay (non_expression_type): Add productions for pointer
20783         casts. 
20784
20785         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20786         code.  We should not use force into static mode if the method is
20787         not virtual.  Fixes bug in MIS
20788
20789         * statement.cs (Do.Emit, While.Emit, For.Emit,
20790         Statement.EmitBoolExpression): Add support to Do and While to
20791         propagate infinite loop as `I do return' semantics.
20792
20793         Improve the For case to also test for boolean constants.
20794
20795         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20796         to the list of attributes we can add.
20797
20798         Remove `EmitContext' argument.
20799
20800         * class.cs (Method.Define): Apply parameter attributes.
20801         (Constructor.Define): Apply parameter attributes.
20802         (MethodCore.LabelParameters): Move here the core of labeling
20803         parameters. 
20804
20805         * support.cs (ReflectionParameters.ParameterModifier,
20806         InternalParameters.ParameterModifier): Use IsByRef on the type and
20807         only return the OUT bit for these parameters instead of in/out/ref
20808         flags.
20809
20810         This is because I miss-understood things.  The ParameterInfo.IsIn
20811         and IsOut represent whether the parameter has the [In] and [Out]
20812         attributes set.  
20813
20814 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20815
20816         * ecore.cs (FieldExpr.Emit): Release temporaries.
20817
20818         * assign.cs (LocalTemporary.Release): new function.
20819
20820         * codegen.cs (EmitContext.GetTemporaryStorage,
20821         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20822         temporary storage.  Now we can "put back" localbuilders when we
20823         are done with them
20824
20825 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20826
20827         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20828         need to make a copy of the variable to generate verifiable code.
20829
20830 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20831
20832         * driver.cs: Compute dynamically the system directory.
20833
20834         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20835         Slower, but more generally useful.  Used by the abstract
20836         registering implementation. 
20837
20838         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20839         the rules for the special rule on Type/instances.  First check if
20840         we have the same name, and if so, try that special static path
20841         rather than the instance path.
20842
20843 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20844
20845         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20846         for, while and if.
20847
20848         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20849         Enum, ValueType, Delegate or Array for non-corlib compiles.
20850
20851         * cs-tokenizer.cs: Catch long identifiers (645)
20852
20853         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20854         piece of code.
20855
20856         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20857         fix, we were returning too early, so we were not registering
20858         pending methods from abstract classes.
20859
20860         Do not register pending methods if the class is abstract.
20861
20862         * expression.cs (Conditional.DoResolve): Report circular implicit
20863         conversions when we neecd to compute it for conditional
20864         expressions. 
20865
20866         (Is.DoResolve): If the expression is always of the provided type,
20867         flag warning 183.  If the expression can not ever be of the
20868         provided type flag warning 184.
20869
20870         * class.cs: Catch 169 as well.
20871
20872         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20873         read. 
20874
20875 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20876
20877         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20878
20879 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20880
20881         * interface.cs: (PopulateMethod): Check for pointers being defined
20882         only if the unsafe context is active.
20883         (PopulateProperty): ditto.
20884         (PopulateIndexer): ditto.
20885
20886         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20887         specified.  If pointers are present, make sure that they are
20888         present in an unsafe context.
20889         (Constructor, Constructor.Define): ditto.
20890         (Field, Field.Define): ditto.
20891         (Property, Property.Define): ditto.
20892         (Event, Event.Define): ditto.
20893
20894         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20895         hashtable if there are classes or structs defined.
20896
20897         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20898         code, as the constant resolution moved.
20899
20900         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20901         the metadata, so we can flag error 133. 
20902
20903         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20904         pointer is being declared in an unsafe context.
20905
20906 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20907
20908         * modifiers.cs (Modifiers.Check): Require a Location argument.
20909         Report error 227 for Unsafe use.
20910
20911         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20912
20913         * statement.cs (For.Emit): If the test is null, then report that
20914         we do `return', as we wont reach anything afterwards.
20915
20916         (Switch.SwitchGoverningType): Track the expression that matched
20917         the conversion.
20918
20919         * driver.cs: Allow negative numbers as an error code to flag.
20920
20921         * cs-parser.jay: Handle 1551.
20922
20923         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20924
20925 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20926
20927         * cs-parser.jay: Report 1518 (type declaration can only contain
20928         class, struct, interface, enum or delegate)
20929
20930         (switch_label): Report 1523 (keywords `case' or `default' must
20931         preced code)
20932
20933         (opt_switch_sections): Report 1522 (empty switch)
20934
20935         * driver.cs: Report 1515 (response file specified multiple times)
20936         Report 1516 (Source file specified multiple times).
20937
20938         * expression.cs (Argument.Resolve): Signal 1510
20939
20940         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20941         access not allowed in static code)
20942
20943 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20944
20945         * typemanager.cs (IsPointerType): Utility method which we are going
20946         to need a lot.
20947
20948         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20949         the object type, so we take care of that.
20950
20951         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20952
20953         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20954         added to non-params parameters :-)
20955
20956         * typemanager.cs (CSharpName): Include 'void' type too. 
20957
20958         (void_ptr_type): Include in the set of core types.
20959
20960         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20961         duplicating code.
20962
20963         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20964         an unsafe context.
20965
20966         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20967         completely forgotten about it.
20968
20969 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20970
20971         * cs-parser.jay (pointer_type): Add. This begins our implementation
20972         of parsing rules for unsafe code.
20973
20974         (unsafe_statement): Implement.
20975
20976         (embedded_statement): Modify to include the above.
20977
20978         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20979
20980         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20981         if the current context is an unsafe one.
20982
20983         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20984         are handled differently, we need separate rules for them.
20985
20986         (local_variable_declaration): Update to use local_variable_pointer_type
20987         to allow variable declarations of unmanaged pointer types.
20988
20989         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20990         in unsafe contexts.
20991
20992         * ../errors/cs0214.cs : Add.
20993
20994 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20995
20996         * makefile: remove 'response' file when cleaning.
20997
20998 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20999
21000         * cs-parser.jay: Report 1524.
21001
21002 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21003
21004         * typemanager.cs (RegisterMethod): drop checking if we have
21005         registered this from here
21006
21007 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21008
21009         * class.cs (Method.EmitDestructor): Implement calling our base
21010         destructor. 
21011
21012         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21013         value of InFinally.
21014
21015         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21016         this routine and will wrap the call in a try/catch block.  Deal
21017         with the case.
21018
21019 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21020
21021         * ecore.cs (Expression.MemberLookup): instead of taking a
21022         parameter `same_type' that was used to tell whether we could
21023         access private members we compute our containing type from the
21024         EmitContext.
21025
21026         (FieldExpr): Added partial support for volatile fields.  This does
21027         not work for volatile fields exposed from assemblies, as I can not
21028         figure out how to extract the modreq from it.
21029
21030         Updated all the source files to use this.
21031
21032         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21033         because it is referenced by MemberLookup very often. 
21034
21035 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21036
21037         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21038         TypeBuilder.GetCustomAttributes to retrieve what we need.
21039
21040         Get rid of redundant default_member_attr_type as this is the same as
21041         default_member_type which already exists.
21042
21043         * interface.cs, attribute.cs : Update accordingly.
21044
21045 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21046
21047         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21048         work for TYpeBuilders though.  Ravi, can you please fix this?
21049
21050         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21051
21052         * expression.cs (Argument.Emit): Handle the case of ref objects
21053         being passed to ref functions;  
21054
21055         (ParameterReference.EmitLoad): Loads the content of the pointer
21056         without dereferencing.
21057
21058 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21059
21060         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21061
21062 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21063
21064         * class.cs (Indexer.DefineMethod): Incorporate the interface
21065         type in the name of the method if we are doing explicit interface
21066         implementation.
21067
21068         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21069
21070         (BetterConversion): Fix extremely trivial bug where we were referring to
21071         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21072         again !
21073
21074         * ../errors/bug16.cs : Add although we have fixed it.
21075
21076 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21077
21078         * expression.cs (BaseIndexer): Begin implementation.
21079
21080         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21081
21082         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21083         production directly to remove a shift/reduce, and implement
21084         explicit interface implementation.
21085
21086         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21087         after a floating point suffix.
21088
21089         * expression.cs (DoNumericPromotions): Improved the conversion for
21090         uint/uint.  If we have a constant, we avoid doing a typecast to a
21091         larger type.
21092
21093         * class.cs (Indexer): Implement explicit interface implementation
21094         for indexers.
21095
21096 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21097
21098         * class.cs: make the default instance constructor public and hidebysig.
21099
21100 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21101
21102         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21103         so we can call it from elsewhere.
21104
21105         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21106         we emit it internally if the class has a defined indexer; otherwise the user
21107         emits it by decorating the class definition with the DefaultMemberAttribute.
21108
21109         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21110         attribute is not used on a type which defines an indexer.
21111
21112         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21113         character when we skip whitespace.
21114
21115         * ../errors/cs0646.cs : Add.
21116
21117 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21118
21119         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21120         again. 
21121
21122         * makefile: Add practical target `mcs3.exe' which builds the third
21123         generation compiler. 
21124
21125         * expression.cs (New): Fix structures constructor calling.
21126
21127         * class.cs (Property, Method, Indexer): Emit Final flag on the
21128         method if we are an interface implementation and we are not
21129         abstract. 
21130
21131         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21132         whether this property is referencing a `base' method.
21133
21134         * expression.cs (Invocation.EmitCall): take an extra argument:
21135         is_base, this is used to determine whether the `call' or
21136         `callvirt' opcode should be used.
21137
21138
21139         * delegate.cs: update EmitCall.
21140
21141         * class.cs (Method.Define): Set NewSlot for the cases where we are
21142         not implementing an interface method.
21143
21144         (Property.Define): ditto.
21145
21146 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21147
21148         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21149         'r'.  Allows mcs to parse itself fully.
21150
21151 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21152
21153         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21154         of the number of initializers that require the InitializeArray method.
21155
21156         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21157         update the above field where necessary.
21158
21159         (MakeByteBlob): Update accordingly.
21160
21161         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21162         greater than 2.
21163
21164         (EmitDynamicInitializers): Update in accordance with the new optimization.
21165
21166         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21167         same OpCode applies.
21168
21169         * cs-parser.jay : Fix some glaring errors I introduced.
21170
21171 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21172
21173         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21174         so that we can check for name clashes there too.
21175
21176         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21177         for interface indexers.
21178
21179         * interfaces.cs (Define): Emit the default member attribute.
21180
21181         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21182         variable was being referred to while setting the value ;-)
21183
21184 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21185
21186         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21187         byte-by-byte information when we know the data is zero.
21188
21189         Make the block always a multiple of 4, because
21190         DefineInitializedData has a bug.
21191
21192         * assign.cs: Fix, we should assign from the temporary, not from
21193         the source. 
21194
21195         * expression.cs (MakeByteBlob): Fix my incorrect code.
21196
21197 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21198
21199         * typemanager.cs (EnumToUnderlying): This function is used to get
21200         the underlying type from an enumeration, because it does not
21201         always work. 
21202
21203         * constant.cs: Use the I4_S form for values between -128 and 127.
21204
21205         * statement.cs (Block.LookupLabel): Looks up a label.
21206         (Block): Drop support for labeled blocks.
21207
21208         (LabeledStatement): New kind of statement that represents a label
21209         only.
21210
21211         (Goto): Finally implement this bad boy.
21212
21213         * cs-parser.jay: Update to reflect new mechanism to implement
21214         labels.
21215
21216 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21217
21218         * codegen.cs (EmitContext.This): a codegen property that keeps the
21219         a single instance of this instead of creating many different this
21220         instances. 
21221
21222         * delegate.cs (Delegate.DoResolve): Update to use the property;
21223
21224         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21225
21226         * expression.cs (BaseAccess.DoResolve): Ditto.
21227
21228 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21229
21230         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21231         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21232
21233         (InitCoreTypes): Update accordingly.
21234
21235         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21236         so we can quickly store the state.
21237
21238         (ApplyAttributes): Set the correct implementation flags
21239         for InternalCall methods.
21240
21241 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21242
21243         * expression.cs (EmitCall): if a method is not virtual, then do
21244         not use callvirt on it.
21245
21246         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21247         user defined stuff) requires the use of stobj, which takes an
21248         address on the stack instead of an array and an index.  So emit
21249         the Ldelema operation for it.
21250
21251         (EmitStoreOpcode): Use stobj for valuetypes.
21252
21253         (UnaryMutator.EmitCode): Use the right 1 value depending on
21254         whether we are dealing with int64/uint64, float or doubles.
21255
21256         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21257         constructors that I implemented last night.
21258
21259         (Constructor.IsDefault): Fix to work properly for static
21260         constructors.
21261
21262         * cs-parser.jay (CheckDef): report method signature errors.
21263         Update error number 103 to be 132.
21264
21265         * decl.cs: New AdditionResult enumeration value: MethodExists.
21266         Although we do this check for methods later on in the semantic
21267         analysis, catching repeated default constructors is so easy that
21268         we catch these here. 
21269
21270         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21271         promotions code.
21272
21273         (ParameterReference.EmitAssign, Emit): handle
21274         bools as bytes.
21275
21276         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21277         (ArrayAccess.EmitStoreOpcode): ditto.
21278
21279         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21280
21281         * expression.cs (MakeByteBlob): Complete all the missing types
21282         (uint, short, ushort, byte, sbyte)
21283
21284         * class.cs: Only init instance field initializers on instance
21285         constructors. 
21286
21287         Rename `constructors' to instance_constructors. 
21288
21289         (TypeContainer.AddConstructor): Only add constructors to the list
21290         if it is not static.
21291
21292         Make sure that we handle default_static_constructor independently
21293         everywhere where we handle instance_constructors
21294
21295 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21296
21297         * class.cs: Do not lookup or create a base initializer for a
21298         static constructor.
21299
21300         (ConstructorInitializer.Resolve): use the proper type to lookup
21301         for constructors.
21302
21303         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21304
21305         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21306         in DeclSpace. 
21307
21308         * decl.cs: CloseType is now an virtual method, the default
21309         implementation just closes this type.
21310
21311 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21312
21313         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21314         to PreserveSig by default. Also emit HideBySig on such methods.
21315
21316         Basically, set the defaults to standard values.
21317
21318         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21319         argument, if candidate is better, it can't be worse than the best !
21320
21321         (Invocation): Re-write bits to differentiate between methods being
21322         applicable in their expanded form and their normal form - for params
21323         methods of course.
21324
21325         Get rid of use_standard everywhere as only standard conversions are allowed
21326         in overload resolution. 
21327
21328         More spec conformance.
21329
21330 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21331
21332         * driver.cs: Add --timestamp, to see where the compiler spends
21333         most of its time.
21334
21335         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21336         `this' in static code.
21337
21338         (SimpleName.DoResolve): Implement in terms of a helper function
21339         that allows static-references to be passed upstream to
21340         MemberAccess.
21341
21342         (Expression.ResolveWithSimpleName): Resolve specially simple
21343         names when called by MemberAccess to implement the special
21344         semantics. 
21345
21346         (Expression.ImplicitReferenceConversion): Handle conversions from
21347         Null to reference types before others, as Null's type is
21348         System.Object. 
21349
21350         * expression.cs (Invocation.EmitCall): Handle the special case of
21351         calling methods declared on a reference type from a ValueType
21352         (Base classes System.Object and System.Enum)
21353
21354         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21355         the left hand side is a TypeExpr, not on every enumeration. 
21356
21357         (Binary.Resolve): If types are reference types, then do a cast to
21358         object on operators != and == of both arguments.
21359
21360         * typemanager.cs (FindMembers): Extract instance and static
21361         members if requested.
21362
21363         * interface.cs (PopulateProperty): Use void_type instead of null
21364         as the return type for the setter method.
21365
21366         (PopulateIndexer): ditto.
21367
21368 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21369
21370         * support.cs (ReflectionParameters): Fix minor bug where we
21371         were examining the wrong parameter for the ParamArray attribute.
21372
21373         Cope with requests for the type of the parameter at position
21374         greater than the params parameter's. We now return the element
21375         type of the params array as that makes more sense.
21376
21377         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21378         accordingly as we no longer have to extract the element type
21379         ourselves.
21380
21381         (Invocation.OverloadResolve): Update.
21382
21383 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21384
21385         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21386         against IEnumerator, test whether the return value is a descendant
21387         of the IEnumerator interface.
21388
21389         * class.cs (Indexer.Define): Use an auxiliary method to implement
21390         the other bits of the method definition.  Begin support for
21391         explicit interface implementation.
21392
21393         (Property.DefineMethod): Use TypeManager.void_type instead of null
21394         for an empty return value.
21395
21396 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21397
21398         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21399         dealing with a FieldExpr which is composed of a FieldBuilder, in
21400         the code path we did extract the constant, but we should have
21401         obtained the underlying value to be able to cast it (otherwise we
21402         end up in an infinite loop, this is what Ravi was running into).
21403
21404         (ArrayCreation.UpdateIndices): Arrays might be empty.
21405
21406         (MemberAccess.ResolveMemberAccess): Add support for section
21407         14.5.4.1 that deals with the special case of E.I when E is a type
21408         and something else, that I can be a reference to a static member.
21409
21410         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21411         handle a particular array type to create byte blobs, it is just
21412         something we dont generate byteblobs for.
21413
21414         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21415         arguments. 
21416
21417         * location.cs (Push): remove the key from the hashtable that we
21418         are about to add.   This happens for empty files.
21419
21420         * driver.cs: Dispose files after we have parsed them.
21421
21422         (tokenize): new function that only runs the tokenizer on its
21423         input, for speed testing.
21424
21425 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21426
21427         * class.cs (Event.Define): Define the private field only if there
21428         are no accessors defined.
21429
21430         * expression.cs (ResolveMemberAccess): If there is no associated
21431         field with the event, that means we have an event defined with its
21432         own accessors and we should flag error cs0070 since transforming
21433         ourselves into a field is not valid in that case.
21434
21435         * ecore.cs (SimpleName.DoResolve): Same as above.
21436
21437         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21438         and charset to sane values.
21439
21440 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21441
21442         * assign.cs (DoResolve): Perform check on events only if they 
21443         are being accessed outside the declaring type.
21444
21445         * cs-parser.jay (event_declarations): Update rules to correctly
21446         set the type of the implicit parameter etc.
21447
21448         (add_accessor, remove_accessor): Set current local parameters.
21449
21450         * expression.cs (Binary): For delegate addition and subtraction,
21451         cast the return value from the method into the appropriate delegate
21452         type.
21453
21454 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21455
21456         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21457         of these as the workaround is unnecessary.
21458
21459         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21460         delegate data - none of that is needed at all.
21461
21462         Re-write bits to extract the instance expression and the delegate method
21463         correctly.
21464
21465         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21466         on delegates too.
21467
21468         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21469         of attaching attributes instead of duplicating code everywhere.
21470
21471         * everywhere : Update code to do attribute emission using the above method.
21472
21473 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21474
21475         * expression.cs (IsParamsMethodApplicable): if there are not
21476         parameters, return immediately.
21477
21478         * ecore.cs: The 0 literal can be implicity converted to an enum
21479         type. 
21480
21481         (SimpleName.DoResolve): First lookup the type, then lookup the
21482         members. 
21483
21484         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21485         want to get its address.  If the InstanceExpression is not
21486         addressable, store the result in a temporary variable, then get
21487         the address of it.
21488
21489         * codegen.cs: Only display 219 errors on warning level or above. 
21490
21491         * expression.cs (ArrayAccess): Make it implement the
21492         IMemoryLocation interface.
21493
21494         (Binary.DoResolve): handle the operator == (object a, object b)
21495         and operator != (object a, object b) without incurring into a
21496         BoxedCast (because 5 != o should never be performed).
21497
21498         Handle binary enumerator operators.
21499
21500         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21501         value type, otherwise use Ldelem_ref.
21502
21503         Use precomputed names;
21504
21505         (AddressOf): Implement address of
21506
21507         * cs-parser.jay (labeled_statement): Fix recursive block
21508         addition by reworking the production.
21509
21510         * expression.cs (New.DoEmit): New has a special case:
21511                 
21512                  If we are dealing with a ValueType, we have a few
21513                  situations to deal with:
21514                 
21515                     * The target of New is a ValueType variable, that is
21516                       easy, we just pass this as the variable reference
21517                 
21518                     * The target of New is being passed as an argument,
21519                       to a boxing operation or a function that takes a
21520                       ValueType.
21521                 
21522                       In this case, we need to create a temporary variable
21523                       that is the argument of New.
21524
21525
21526 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21527
21528         * rootcontext.cs (LookupType): Check that current_type is not null before
21529         going about looking at nested types.
21530
21531         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21532         not implement the IAssignMethod interface any more.
21533
21534         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21535         where we tranform them into FieldExprs if they are being resolved from within
21536         the declaring type.
21537
21538         * ecore.cs (SimpleName.DoResolve): Do the same here.
21539
21540         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21541
21542         * ../errors/bug10.cs : Add.
21543
21544         * ../errors/cs0070.cs : Add.
21545
21546         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21547
21548         * assign.cs : Get rid of EventIsLocal everywhere.
21549
21550 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21551
21552         * ecore.cs (ConvertIntLiteral): finished the implementation.
21553
21554         * statement.cs (SwitchLabel): Convert the value we are using as a
21555         key before looking up the table.
21556
21557 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21558
21559         * codegen.cs (EmitTopBlock): Require a Location argument now.
21560
21561         * cs-parser.jay (constructor_declarator): We need to setup
21562         current_local_parameters before we parse the
21563         opt_constructor_initializer, to allow the variables to be bound
21564         to the constructor arguments.
21565
21566         * rootcontext.cs (LookupType): First lookup nested classes in our
21567         class and our parents before we go looking outside our class.
21568
21569         * expression.cs (ConstantFold): Extract/debox the values at the
21570         beginnning. 
21571
21572         * rootcontext.cs (EmitCode): Resolve the constants first before we
21573         resolve the types.  This is not really needed, but it helps debugging.
21574
21575         * statement.cs: report location.
21576
21577         * cs-parser.jay: pass location to throw statement.
21578
21579         * driver.cs: Small bug fix.
21580
21581         * report.cs: Updated format to be 4-zero filled digits.
21582
21583 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21584
21585         * expression.cs (CheckIndices): Fix minor bug where the wrong
21586         variable was being referred to ;-)
21587
21588         (DoEmit): Do not call EmitStaticInitializers when the 
21589         underlying type is System.Object.
21590
21591 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21592
21593         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21594         and do the usual workaround for SRE.
21595
21596         * class.cs (MyEventBuilder.EventType): New member to get at the type
21597         of the event, quickly.
21598
21599         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21600
21601         * assign.cs (Assign.DoResolve): Handle the case when the target
21602         is an EventExpr and perform the necessary checks.
21603
21604         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21605         interface.
21606
21607         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21608
21609         (EventExpr): Set the type in the constructor itself since we 
21610         are meant to be born fully resolved.
21611
21612         (EventExpr.Define): Revert code I wrote earlier.
21613                 
21614         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21615         instance expression is null. The instance expression is a This in that case
21616         or a null, depending on whether it is a static method or not.
21617
21618         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21619         refers to more than one method.
21620
21621         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21622         and accordingly flag errors.
21623
21624 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21625
21626         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21627
21628 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21629
21630         * location.cs (ToString): Provide useful rutine.
21631
21632 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21633
21634         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21635         objects, return the actual integral boxed.
21636
21637         * statement.cs (SwitchLabel): define an ILLabel for each
21638         SwitchLabel. 
21639
21640         (Switch.CheckSwitch): If the value is a Literal, extract
21641         the underlying literal.
21642
21643         Also in the unused hashtable we had, add the SwitchLabel so we can
21644         quickly look this value up.
21645
21646         * constant.cs: Implement a bunch of new constants.  Rewrite
21647         Literal based on this.  Made changes everywhere to adapt to this.
21648
21649         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21650         dereferencing array only once, and also copes with enumrations.
21651
21652         bytes are two bytes wide, not one.
21653
21654         (Cast): Perform constant conversions.
21655
21656         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21657         wrappers to the literals here.
21658
21659         * expression.cs (DoNumericPromotions): long literals can converted
21660         to ulong implicity (this is taken care of elsewhere, but I was
21661         missing this spot).
21662
21663         * ecore.cs (Expression.Literalize): Make the return type Literal,
21664         to improve type checking.
21665
21666         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21667
21668 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21669
21670         * literal.cs: Revert code from ravi that checked the bounds.  The
21671         bounds are sane by the definition of the type itself. 
21672
21673         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21674         need to actually look up in our parent hierarchy for interfaces
21675         implemented. 
21676
21677         * const.cs: Use the underlying type for enumerations
21678
21679         * delegate.cs: Compute the basename for the delegate creation,
21680         that should fix the delegate test case, and restore the correct
21681         Type Lookup semantics in rootcontext
21682
21683         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21684         referencing a nested type with the Reflection API is using the "+"
21685         sign. 
21686
21687         * cs-parser.jay: Do not require EOF token at the end.
21688
21689 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21690
21691         * rootcontext.cs (LookupType): Concatenate type names with
21692         a '.' instead of a '+' The test suite passes again.
21693
21694         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21695         field of the enumeration.
21696
21697         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21698         the case when the member is an EventExpr.
21699
21700         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21701         static has an associated instance expression.
21702
21703         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21704
21705         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21706
21707         * class.cs (Event.Define): Register event and perform appropriate checks
21708         for error #111.
21709
21710         We define the Add and Remove methods even if the use provides none because
21711         in that case, we provide default implementations ourselves.
21712
21713         Define a private field of the type of the event. This is done by the CSC compiler
21714         and we should be doing it too ;-)
21715
21716         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21717         More methods we use in code we generate.
21718
21719         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21720         is important.
21721
21722         (InitCoreTypes): Update accordingly for the above.
21723
21724         * class.cs (Event.Emit): Generate code for default accessors that we provide
21725
21726         (EmitDefaultMethod): Do the job in the above.
21727
21728         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21729         appropriate place.
21730
21731 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21732
21733         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21734         builders even if we were missing one.
21735
21736         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21737         pass the Basename as our class name instead of the Name.  The
21738         basename will be correctly composed for us.
21739
21740         * parameter.cs (Paramters): Now takes a Location argument.
21741
21742         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21743         make all the code call directly LookupType in RootContext and take
21744         this chance to pass the Location information everywhere.
21745
21746         * Everywhere: pass Location information.
21747
21748 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21749
21750         * class.cs (Constructor.Define): Updated way of detecting the
21751         length of the parameters.
21752
21753         (TypeContainer.DefineType): Use basename as the type name for
21754         nested types.
21755
21756         (TypeContainer.Define): Do not recursively define types here, as
21757         definition is taken care in order by the RootContext.
21758
21759         * tree.cs: Keep track of namespaces in a per-file basis.
21760
21761         * parameter.cs (Parameter.ComputeSignature): Update to use
21762         DeclSpace. 
21763
21764         (Parameters.GetSignature): ditto.
21765
21766         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21767         instead of a TypeContainer.
21768
21769         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21770         resolve names.  Because we need to be resolve in our context, not
21771         our parents.
21772
21773         * driver.cs: Implement response files.
21774
21775         * class.cs (TypeContainer.DefineType): If we are defined, do not
21776         redefine ourselves.
21777
21778         (Event.Emit): Emit the code for add/remove handlers.
21779         (Event.Define): Save the MethodBuilders for add/remove.
21780
21781         * typemanager.cs: Use pair here too.
21782
21783         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21784         DictionaryEntry requires the first argument to be non-null.  
21785
21786         (enum_declaration): Compute full name for registering the
21787         enumeration.
21788
21789         (delegate_declaration): Instead of using
21790         formal_parameter_list, use opt_formal_parameter_list as the list
21791         can be empty.
21792
21793         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21794         (EventParsing): New property that controls whether `add' and
21795         `remove' are returned as tokens or identifiers (for events);
21796
21797 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21798
21799         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21800         use MyEventBuilder only and let it wrap the real builder for us.
21801
21802         (MyEventBuilder): Revamp constructor etc.
21803
21804         Implement all operations that we perform on EventBuilder in precisely the same
21805         way here too.
21806
21807         (FindMembers): Update to use the EventBuilder member.
21808
21809         (Event.Emit): Update accordingly.
21810
21811 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21812
21813         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21814         by calling the appropriate methods.
21815
21816         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21817         useful.
21818
21819         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21820
21821 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21822
21823         * delegate.cs (Delegate.Populate): Check that the return type
21824         and various parameters types are indeed accessible.
21825
21826         * class.cs (Constructor.Define): Same here.
21827
21828         (Field.Define): Ditto.
21829
21830         (Event.Define): Ditto.
21831
21832         (Operator.Define): Check that the underlying Method defined itself
21833         correctly - so it's MethodBuilder should not be null.
21834
21835         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21836         expression happens to be null.
21837
21838         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21839         members but as of now we don't seem to be able to do anything really useful with it.
21840
21841         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21842         not the EventBuilder.
21843
21844 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21845
21846         * cs-tokenizer.cs: Add support for defines.
21847         Add support for #if, #elif, #else, #endif
21848
21849         (eval_var): evaluates a variable.
21850         (eval): stubbed for evaluating functions.
21851
21852         * cs-parser.jay: Pass the defines information
21853
21854         * driver.cs: Add --define command line option.
21855
21856         * decl.cs: Move MemberCore here.
21857
21858         Make it the base class for DeclSpace.  This allows us to catch and
21859         report 108 and 109 for everything now.
21860
21861         * class.cs (TypeContainer.Define): Extract all the members
21862         before populating and emit the warning 108 (new keyword required
21863         to override) instead of having each member implement this.
21864
21865         (MemberCore.Define): New abstract method, we will be using this in
21866         the warning reporting engine in Populate.
21867
21868         (Operator.Define): Adjust to new MemberCore protocol. 
21869
21870         * const.cs (Const): This does not derive from Expression, it is a
21871         temporary object we use to create fields, it is a MemberCore. 
21872
21873         * class.cs (Method.Define): Allow the entry point to be in a
21874         specific class.
21875
21876         * driver.cs: Rewrite the argument handler to clean it up a bit.
21877
21878         * rootcontext.cs: Made it just an auxiliary namespace feature by
21879         making everything static.
21880
21881         * driver.cs: Adapt code to use RootContext type name instead of
21882         instance variable.
21883
21884         * delegate.cs: Remove RootContext argument.
21885
21886         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21887         argument. 
21888
21889         * class.cs (Event.Define): The lookup can fail.
21890
21891         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21892
21893         * expression.cs: Resolve the this instance before invoking the code.
21894
21895 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21896
21897         * cs-parser.jay: Add a production in element_access that allows
21898         the thing to become a "type" reference.  This way we can parse
21899         things like "(string [])" as a type.
21900
21901         Note that this still does not handle the more complex rules of
21902         casts. 
21903
21904
21905         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21906
21907         * ecore.cs: (CopyNewMethods): new utility function used to
21908         assemble the list of methods from running FindMembers.
21909
21910         (MemberLookup): Rework FindMembers so that 
21911
21912 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21913
21914         * class.cs (TypeContainer): Remove Delegates who fail to be
21915         defined.
21916
21917         * delegate.cs (Populate): Verify that we dont get null return
21918         values.   TODO: Check for AsAccessible.
21919
21920         * cs-parser.jay: Use basename to emit error 574 (destructor should
21921         have the same name as container class), not the full name.
21922
21923         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21924         possible representation.  
21925
21926         Also implements integer type suffixes U and L.
21927
21928 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21929
21930         * expression.cs (ArrayCreation.DoResolve): We need to do the
21931         argument resolution *always*.
21932
21933         * decl.cs: Make this hold the namespace.  Hold the root context as
21934         well.
21935         (LookupType): Move here.
21936
21937         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21938
21939         * location.cs (Row, Name): Fixed the code, it was always returning
21940         references to the first file.
21941
21942         * interface.cs: Register properties defined through interfaces.
21943
21944         * driver.cs: Add support for globbing on the command line
21945
21946         * class.cs (Field): Make it derive from MemberCore as well.
21947         (Event): ditto.
21948
21949 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21950
21951         * class.cs (Event::Define): Check that the type of the event is a delegate
21952         type else flag error #66.
21953
21954         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21955         same.
21956
21957         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21958         values of EntryPoint, CharSet etc etc.
21959
21960         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21961
21962         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21963         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21964         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21965         which needs this to do its work.
21966
21967         * ../errors/cs0066.cs : Add.
21968
21969 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21970
21971         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21972         helper functions.
21973
21974         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21975         clears out the parameters field.
21976         (MemberSignatureCompare): Cleanup
21977
21978         (MemberCore): New base class used to share code between MethodCore
21979         and Property.
21980
21981         (RegisterRequiredImplementations) BindingFlags.Public requires
21982         either BindingFlags.Instace or Static.  Use instance here.
21983
21984         (Property): Refactored code to cope better with the full spec.
21985
21986         * parameter.cs (GetParameterInfo): Return an empty array instead
21987         of null on error.
21988
21989         * class.cs (Property): Abstract or extern properties have no bodies.
21990
21991         * parameter.cs (GetParameterInfo): return a zero-sized array.
21992
21993         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21994         method modifier validation to the typecontainer so we can reuse
21995         this on properties.
21996
21997         (MethodCore.ParameterTypes): return an empty sized array of types.
21998
21999         (Property.Define): Test property modifier validity.
22000
22001         Add tests for sealed/override too.
22002
22003         (Method.Emit): abstract or extern methods have no bodies.
22004
22005 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22006
22007         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22008         thing.
22009
22010         (Method::Define, ::Emit): Modify accordingly.
22011
22012         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22013
22014         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22015
22016         * makefile: Pass in /unsafe.
22017
22018 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22019
22020         * class.cs (MakeKey): Kill routine.
22021
22022         * class.cs (TypeContainer.Define): Correctly define explicit
22023         method implementations (they require the full interface name plus
22024         the method name).
22025
22026         * typemanager.cs: Deply the PtrHashtable here and stop using the
22027         lame keys.  Things work so much better.
22028
22029         This of course broke everyone who depended on `RegisterMethod' to
22030         do the `test for existance' test.  This has to be done elsewhere.
22031
22032         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22033         the object stupid Equals method (because, that like fails all over
22034         the place).  We still do not use it.
22035
22036         * class.cs (TypeContainer.SetRequiredInterface,
22037         TypeContainer.RequireMethods): Killed these two routines and moved
22038         all the functionality to RegisterRequiredImplementations.
22039
22040         (TypeContainer.RegisterRequiredImplementations): This routine now
22041         registers all the implementations required in an array for the
22042         interfaces and abstract methods.  We use an array of structures
22043         which can be computed ahead of time to reduce memory usage and we
22044         also assume that lookups are cheap as most classes will not
22045         implement too many interfaces.
22046
22047         We also avoid creating too many MethodSignatures.
22048
22049         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22050         clear the "pending" bit if we find that there are problems with
22051         the declaration.
22052
22053         (TypeContainer.VerifyPendingMethods): Update to report errors of
22054         methods that look like implementations but are not.
22055
22056         (TypeContainer.Define): Add support for explicit interface method
22057         implementation. 
22058
22059 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22060
22061         * typemanager.cs: Keep track of the parameters here instead of
22062         being a feature of the TypeContainer.
22063
22064         * class.cs: Drop the registration of parameters here, as
22065         InterfaceMethods are also interface declarations.
22066
22067         * delegate.cs: Register methods with the TypeManager not only with
22068         the TypeContainer.  This code was buggy.
22069
22070         * interface.cs: Full registation here.
22071
22072 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22073
22074         * expression.cs: Remove reducer for binary expressions, it can not
22075         be done this way.
22076
22077         * const.cs: Put here the code that used to go into constant.cs
22078
22079         * constant.cs: Put here the code for constants, this is a new base
22080         class for Literals.
22081
22082         * literal.cs: Make Literal derive from Constant.
22083
22084 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22085
22086         * statement.cs (Return.Emit): Report error 157 if the user
22087         attempts to return from a finally block.
22088
22089         (Return.Emit): Instead of emitting a return, jump to the end of
22090         the function.
22091
22092         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22093         LocalBuilder to store the result of the function.  ReturnLabel is
22094         the target where we jump.
22095
22096
22097 2001-12-09  Radek Doulik  <rodo@ximian.com>
22098
22099         * cs-parser.jay: remember alias in current namespace
22100
22101         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22102         namespaces
22103
22104         * class.cs (LookupAlias): lookup alias in my_namespace
22105
22106         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22107         aliases hashtable
22108         (LookupAlias): lookup alias in this and if needed in parent
22109         namespaces
22110
22111 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22112
22113         * support.cs: 
22114
22115         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22116         making things static.  I need this to avoid passing the
22117         TypeContainer when calling ParameterType.
22118
22119         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22120         that did string manipulation to compute the type and then call
22121         GetType.  Use Parameter.ParameterType instead.
22122
22123         * cs-tokenizer.cs: Consume the suffix for floating values.
22124
22125         * expression.cs (ParameterReference): figure out whether this is a
22126         reference parameter or not.  Kill an extra variable by computing
22127         the arg_idx during emission.
22128
22129         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22130         function that returns whether a parameter is an out/ref value or not.
22131
22132         (Parameter.ParameterType): The type of the parameter (base,
22133         without ref/out applied).
22134
22135         (Parameter.Resolve): Perform resolution here.
22136         (Parameter.ExternalType): The full type (with ref/out applied).
22137
22138         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22139         support for expressions on the using statement.
22140
22141 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22142
22143         * statement.cs (Using.EmitLocalVariableDecls): Split the
22144         localvariable handling of the using statement.
22145
22146         (Block.EmitMeta): Keep track of variable count across blocks.  We
22147         were reusing slots on separate branches of blocks.
22148
22149         (Try.Emit): Emit the general code block, we were not emitting it. 
22150
22151         Check the type of the declaration to be an IDisposable or
22152         something that can be implicity converted to it. 
22153
22154         Emit conversions if required.
22155
22156         * ecore.cs (EmptyExpression): New utility class.
22157         (Expression.ImplicitConversionExists): New utility function.
22158
22159 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22160
22161         * statement.cs (Using): Implement.
22162
22163         * expression.cs (LocalVariableReference): Support read only variables.
22164
22165         * statement.cs: Remove the explicit emit for the Leave opcode.
22166         (VariableInfo): Add a readonly field.
22167
22168 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22169
22170         * ecore.cs (ConvCast): new class used to encapsulate the various
22171         explicit integer conversions that works in both checked and
22172         unchecked contexts.
22173
22174         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22175         properly generate the overflow opcodes.
22176
22177 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22178
22179         * statement.cs: The correct type for the EmptyExpression is the
22180         element_type, not the variable type.  Ravi pointed this out.
22181
22182 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22183
22184         * class.cs (Method::Define): Handle PInvoke methods specially
22185         by using DefinePInvokeMethod instead of the usual one.
22186
22187         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22188         above to do the task of extracting information and defining the method.
22189
22190 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22191
22192         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22193         of the condition for string type.
22194
22195         (Emit): Move that here. 
22196
22197         (ArrayCreation::CheckIndices): Keep string literals in their expression
22198         form.
22199
22200         (EmitDynamicInitializers): Handle strings appropriately.
22201
22202 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22203
22204         * codegen.cs (EmitContext): Replace multiple variables with a
22205         single pointer to the current Switch statement.
22206
22207         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22208         EmitContext.
22209
22210 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22211
22212         * statement.cs 
22213
22214         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22215         default'.
22216
22217         (Foreach.Emit): Foreach on arrays was not setting
22218         up the loop variables (for break/continue).
22219
22220         (GotoCase): Semi-implented.
22221
22222 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22223
22224         * attribute.cs (CheckAttribute): Handle system attributes by using
22225         Attribute.GetAttributes to examine information we need.
22226
22227         (GetValidPlaces): Same here.
22228
22229         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22230
22231         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22232
22233         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22234
22235         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22236
22237         (Method::Emit): Handle the case when we are a PInvoke method.
22238
22239 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22240
22241         * expression.cs: Use ResolveWithSimpleName on compound names.
22242
22243 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22244
22245         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22246         before trying to reduce it.
22247
22248         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22249
22250         * constant.cs (LookupConstantValue): Implement.
22251
22252         (EmitConstant): Use the above in emitting the constant.
22253
22254         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22255         that are user-defined by doing a LookupConstantValue on them.
22256
22257         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22258         too, like above.
22259
22260 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22261
22262         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22263
22264         (BaseAccess.DoResolve): Implement.
22265
22266         (MemberAccess.DoResolve): Split this routine into a
22267         ResolveMemberAccess routine that can be used independently
22268
22269 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22270
22271         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22272         As that share bits of the implementation.  Is returns a boolean,
22273         while As returns the Type that is being probed.
22274
22275 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22276
22277         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22278         instead of a Literal - much easier.
22279
22280         (EnumInTransit): Remove - utterly useless :-)
22281
22282         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22283
22284         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22285
22286         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22287         chain when we have no associated expression.
22288
22289 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22290
22291         * constant.cs (Define): Use Location while reporting the errror.
22292
22293         Also emit a warning when 'new' is used and there is no inherited
22294         member to hide.
22295
22296         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22297         populated.
22298
22299         (LookupEnumValue): Implement to lookup an enum member's value and define it
22300         if necessary.
22301
22302         (Populate): Re-write accordingly to use the above routine.
22303
22304 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22305
22306         * expression.cs (This): Fix prototype for DoResolveLValue to
22307         override the base class DoResolveLValue.
22308
22309         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22310         declarations) 
22311
22312         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22313         (we need to load the address of the field here).  This fixes
22314         test-22. 
22315
22316         (FieldExpr.DoResolveLValue): Call the DoResolve
22317         function to initialize the Instance expression.
22318
22319         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22320         correctly the GetEnumerator operation on a value type.
22321
22322         * cs-parser.jay: Add more simple parsing error catches.
22323
22324         * statement.cs (Switch): Add support for string switches.
22325         Handle null specially.
22326
22327         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22328
22329 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22330
22331         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22332
22333         (declare_local_constant): New helper function.
22334
22335         * statement.cs (AddConstant): Keep a separate record of constants
22336
22337         (IsConstant): Implement to determine if a variable is a constant.
22338
22339         (GetConstantExpression): Implement.
22340
22341         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22342
22343         * statement.cs (IsVariableDefined): Re-write.
22344
22345 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22346
22347         * class.cs (TypeContainer::FindMembers): Look for constants
22348         in the case when we are looking for MemberTypes.Field
22349
22350         * expression.cs (MemberAccess::DoResolve): Check that in the
22351         case we are a FieldExpr and a Literal, we are not being accessed
22352         by an instance reference.
22353
22354         * cs-parser.jay (local_constant_declaration): Implement.
22355
22356         (declaration_statement): Implement for constant declarations.
22357
22358 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22359
22360         * statement.cs (Switch): Catch double defaults.
22361
22362         (Switch): More work on the switch() statement
22363         implementation.  It works for integral values now, need to finish
22364         string support.
22365
22366
22367 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22368
22369         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22370         integer literals into other integer literals.  To be used by
22371         switch. 
22372
22373 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22374
22375         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22376         some memory.
22377
22378         (EmitDynamicInitializers): Cope with the above since we extract data
22379         directly from ArrayData now.
22380
22381         (ExpectInitializers): Keep track of whether initializers are mandatory
22382         or not.
22383
22384         (Bounds): Make it a hashtable to prevent the same dimension being 
22385         recorded for every element in that dimension.
22386
22387         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22388         from being found.
22389
22390         Also fix bug which was causing the indices to be emitted in the reverse
22391         order.
22392
22393 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22394
22395         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22396         unfinished.  They do not work, because the underlying code is
22397         sloppy.
22398
22399 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22400
22401         * cs-parser.jay: Remove bogus fixme.
22402
22403         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22404         on Switch statement.
22405
22406 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22407
22408         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22409         the same. 
22410
22411         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22412         parameter. Apparently, any expression is allowed. 
22413
22414         (ValidateInitializers): Update accordingly.
22415
22416         (CheckIndices): Fix some tricky bugs thanks to recursion.
22417
22418         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22419         I was being completely brain-dead.
22420
22421         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22422         and re-write acordingly.
22423
22424         (DelegateInvocation): Re-write accordingly.
22425
22426         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22427
22428         (MakeByteBlob): Handle types more correctly.
22429
22430         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22431         initialization from expressions but it is incomplete because I am a complete
22432         Dodo :-|
22433
22434 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22435
22436         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22437         on If.  Basically, we have to return `true' (ie, we do return to
22438         our caller) only if both branches of the if return.
22439
22440         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22441         short-circuit operators, handle them as short circuit operators. 
22442
22443         (Cast.DoResolve): Resolve type.
22444         (Cast.Cast): Take an expression as the target type.
22445
22446         * cs-parser.jay (cast_expression): Remove old hack that only
22447         allowed a limited set of types to be handled.  Now we take a
22448         unary_expression and we resolve to a type during semantic
22449         analysis.
22450
22451         Use the grammar productions from Rhys to handle casts (this is
22452         not complete like Rhys syntax yet, we fail to handle that corner
22453         case that C# has regarding (-x), but we will get there.
22454
22455 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22456
22457         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22458         field which is an array type.
22459
22460         * cs-parser.jay (declare_local_variables): Support array initialization too.
22461
22462         * typemanager.cs (MakeKey): Implement.
22463
22464         (everywhere): Use the above appropriately.
22465
22466         * cs-parser.jay (for_statement): Update for array initialization while
22467         declaring variables.
22468
22469         * ecore.cs : The error message was correct, it's the variable's names that
22470         were misleading ;-) Make the code more readable.
22471
22472         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22473         the correct type etc.
22474
22475         (ConvertExplicit): Handle Enum types by examining the underlying type.
22476
22477 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22478
22479         * parameter.cs (GetCallingConvention): Always return
22480         CallingConventions.Standard for now.
22481
22482 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22483
22484         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22485         and `r' after calling DoNumericPromotions.
22486
22487         * ecore.cs: Fix error message (the types were in the wrong order).
22488
22489         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22490         BindingFlags.Instance as well 
22491
22492         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22493         implicit int literal conversion in an empty cast so that we
22494         propagate the right type upstream.
22495
22496         (UnboxCast): new class used to unbox value types.
22497         (Expression.ConvertExplicit): Add explicit type conversions done
22498         by unboxing.
22499
22500         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22501         the target type before applying the implicit LongLiterals to ULong
22502         literal cast.
22503
22504 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22505
22506         * cs-parser.jay (for_statement): Reworked the way For works: now
22507         we declare manually any variables that are introduced in
22508         for_initializer to solve the problem of having out-of-band code
22509         emition (that is what got for broken).
22510
22511         (declaration_statement): Perform the actual variable declaration
22512         that used to be done in local_variable_declaration here.
22513
22514         (local_variable_declaration): Do not declare anything, just pass
22515         the information on a DictionaryEntry
22516
22517 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22518
22519         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22520         re-write of the logic to now make it recursive.
22521
22522         (UpdateIndices): Re-write accordingly.
22523
22524         Store element data in a separate ArrayData list in the above methods.
22525
22526         (MakeByteBlob): Implement to dump the array data into a byte array.
22527
22528 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22529
22530         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22531         into CheckIndices.
22532
22533         * constant.cs (Define): Implement.
22534
22535         (EmitConstant): Re-write fully.
22536
22537         Pass in location info.
22538
22539         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22540         respectively.
22541
22542         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22543         DictionaryEntry since we need location info too.
22544
22545         (constant_declaration): Update accordingly.
22546
22547         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22548         code into another method : UpdateIndices.
22549
22550 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22551
22552         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22553         some type checking etc.
22554
22555 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22556
22557         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22558         bits to provide dimension info if the user skips doing that.
22559
22560         Update second constructor to store the rank correctly.
22561
22562 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22563
22564         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22565         and try to implement.
22566
22567         * ../errors/cs0150.cs : Add.
22568
22569         * ../errors/cs0178.cs : Add.
22570
22571 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22572
22573         * statement.cs: Implement foreach on multi-dimensional arrays. 
22574
22575         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22576         name of the params argument.
22577
22578         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22579         initializing the array.
22580
22581         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22582         we can use this elsewhere.
22583
22584         * statement.cs: Finish implementation of foreach for single
22585         dimension arrays.
22586
22587         * cs-parser.jay: Use an out-of-band stack to pass information
22588         around, I wonder why I need this.
22589
22590         foreach_block: Make the new foreach_block the current_block.
22591
22592         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22593         function used to return a static Parameters structure.  Used for
22594         empty parameters, as those are created very frequently.
22595
22596         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22597
22598 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22599
22600         * interface.cs : Default modifier is private, not public. The
22601         make verify test passes again.
22602
22603 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22604
22605         * support.cs (ReflectionParameters): Fix logic to determine
22606         whether the last parameter is a params one. Test 9 passes again.
22607
22608         * delegate.cs (Populate): Register the builders we define with
22609         RegisterParameterForBuilder. Test 19 passes again.
22610
22611         * cs-parser.jay (property_declaration): Reference $6 instead
22612         of $$ to get at the location.
22613
22614         (indexer_declaration): Similar stuff.
22615
22616         (attribute): Ditto.
22617
22618         * class.cs (Property): Register parameters for the Get and Set methods
22619         if they exist. Test 23 passes again.
22620
22621         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22622         call to EmitArguments as we are sure there aren't any params arguments. 
22623         Test 32 passes again.
22624
22625         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22626         IndexOutOfRangeException. 
22627
22628         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22629         Test 33 now passes again.
22630
22631 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22632
22633         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22634         broke a bunch of things.  Will have to come up with a better way
22635         of tracking locations.
22636
22637         * statement.cs: Implemented foreach for single dimension arrays.
22638
22639 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22640
22641         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22642         an error.  This removes the lookup from the critical path.
22643
22644         * cs-parser.jay: Removed use of temporary_loc, which is completely
22645         broken. 
22646
22647 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22648
22649         * support.cs (ReflectionParameters.ParameterModifier): Report
22650         whether the argument is a PARAMS argument or not.
22651
22652         * class.cs: Set the attribute `ParamArrayAttribute' on the
22653         parameter argument.
22654
22655         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22656         and cons_param_array_attribute (ConstructorInfo for
22657         ParamArrayAttribute)., 
22658
22659         * codegen.cs: Emit the return using the `Return' statement, that
22660         way we can report the error correctly for missing return values. 
22661
22662         * class.cs (Method.Emit): Clean up.
22663
22664         * expression.cs (Argument.Resolve): Take another argument: the
22665         location where this argument is used.  Notice that this is not
22666         part of the "Argument" class as to reduce the size of the
22667         structure (we know the approximate location anyways).
22668
22669         Test if the argument is a variable-reference, if not, then
22670         complain with a 206.
22671
22672         (Argument.Emit): Emit addresses of variables.
22673
22674         (Argument.FullDesc): Simplify.
22675
22676         (Invocation.DoResolve): Update for Argument.Resolve.
22677
22678         (ElementAccess.DoResolve): ditto.
22679
22680         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22681         method should be virtual, as this method is always virtual.
22682
22683         (NewDelegate.DoResolve): Update for Argument.Resolve.
22684
22685         * class.cs (ConstructorInitializer.DoResolve): ditto.
22686
22687         * attribute.cs (Attribute.Resolve): ditto.
22688
22689 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22690
22691         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22692
22693         * expression.cs (ParameterReference): Drop IStackStorage and implement
22694         IAssignMethod instead. 
22695
22696         (LocalVariableReference): ditto.
22697
22698         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22699         IAssignMethod instead. 
22700
22701 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22702
22703         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22704         enumerations that are used in heavily used structures derive from
22705         byte in a laughable and pathetic attempt to reduce memory usage.
22706         This is the kind of pre-optimzations that you should not do at
22707         home without adult supervision.
22708
22709         * expression.cs (UnaryMutator): New class, used to handle ++ and
22710         -- separatedly from the other unary operators.  Cleans up the
22711         code, and kills the ExpressionStatement dependency in Unary.
22712
22713         (Unary): Removed `method' and `Arguments' from this class, making
22714         it smaller, and moving it all to SimpleCall, so I can reuse this
22715         code in other locations and avoid creating a lot of transient data
22716         strucutres when not required.
22717
22718         * cs-parser.jay: Adjust for new changes.
22719
22720 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22721
22722         * enum.cs (Enum.Populate): If there is a failure during
22723         definition, return
22724
22725         * cs-parser.jay (opt_enum_base): we used to catch type errors
22726         here, but this is really incorrect.  The type error should be
22727         catched during semantic analysis.
22728
22729 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22730
22731         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22732         current_local_parameters as expected since I, in my stupidity, had forgotten
22733         to do this :-)
22734
22735         * attribute.cs (GetValidPlaces): Fix stupid bug.
22736
22737         * class.cs (Method::Emit): Perform check on applicability of attributes.
22738
22739         (Constructor::Emit): Ditto.
22740
22741         (Field::Emit): Ditto.
22742
22743         (Field.Location): Store location information.
22744
22745         (Property, Event, Indexer, Operator): Ditto.
22746
22747         * cs-parser.jay (field_declaration): Pass in location for each field.
22748
22749         * ../errors/cs0592.cs : Add.
22750
22751 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22752
22753         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22754
22755         (InitCoreTypes): Update accordingly.
22756
22757         (RegisterAttrType, LookupAttr): Implement.
22758
22759         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22760         info about the same.
22761
22762         (Resolve): Update to populate the above as necessary.
22763
22764         (Error592): Helper.
22765
22766         (GetValidPlaces): Helper to the above.
22767
22768         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22769
22770         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22771
22772 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22773
22774         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22775
22776         * ../errors/cs0617.cs : Add.
22777
22778 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22779
22780         * enum.cs (Emit): Rename to Populate to be more consistent with what
22781         we expect it to do and when exactly it is called.
22782
22783         * class.cs, rootcontext.cs : Update accordingly.
22784
22785         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22786         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22787
22788         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22789
22790         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22791         of a fieldinfo using the above, when dealing with a FieldBuilder.
22792
22793 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22794
22795         * ../errors/cs0031.cs : Add.
22796
22797         * ../errors/cs1008.cs : Add.
22798
22799         * ../errrors/cs0543.cs : Add.
22800
22801         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22802         enum type.
22803
22804         (FindMembers): Implement.
22805
22806         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22807         enums and delegates too.
22808
22809         (enum_types): Rename to builder_to_enum.
22810
22811         (delegate_types): Rename to builder_to_delegate.
22812
22813         * delegate.cs (FindMembers): Implement.
22814
22815 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22816
22817         * typemanager.cs (IsEnumType): Implement.
22818
22819         * enum.cs (Emit): Re-write parts to account for the underlying type
22820         better and perform checking etc.
22821
22822         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22823         of the underlying type.
22824
22825         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22826         value
22827
22828         * enum.cs (error31): Helper to report error #31.
22829
22830         * cs-parser.jay (enum_declaration): Store location of each member too.
22831
22832         * enum.cs (member_to_location): New hashtable. 
22833
22834         (AddEnumMember): Update location hashtable.
22835
22836         (Emit): Use the location of each member while reporting errors.
22837
22838 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22839
22840         * cs-parser.jay: A for_initializer if is a
22841         local_variable_declaration really ammount to have an implicit
22842         block with the variable declaration and no initializer for for.
22843
22844         * statement.cs (For.Emit): Cope with null initializers.
22845
22846         This fixes the infinite loop on for initializers.
22847
22848 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22849
22850         * enum.cs: More cleanup.
22851
22852         * ecore.cs: Remove dead code.
22853
22854         * class.cs (Property.Emit): More simplification.
22855         (Event.Emit): ditto.
22856
22857         Reworked to have less levels of indentation.
22858
22859 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22860
22861         * class.cs (Property): Emit attributes.
22862
22863         (Field): Ditto.
22864
22865         (Event): Ditto.
22866
22867         (Indexer): Ditto.
22868
22869         (Operator): Ditto.
22870
22871         * enum.cs (Emit): Ditto.
22872
22873         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22874         Enums too.
22875
22876         * class.cs (Field, Event, etc.): Move attribute generation into the
22877         Emit method everywhere.
22878
22879         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22880         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22881         as we had no way of defining nested enums !
22882
22883         * rootcontext.cs : Adjust code accordingly.
22884
22885         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22886
22887 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22888
22889         * expression.cs (EvalConstantExpression): Move into ecore.cs
22890
22891         * enum.cs (Enum): Rename some members and make them public and readonly
22892         according to our convention.
22893
22894         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22895         nothing else.
22896
22897         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22898
22899         (Enum::Emit): Write a simple version for now which doesn't try to compute
22900         expressions. I shall modify this to be more robust in just a while.
22901
22902         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22903
22904         (TypeContainer::CloseType): Create the Enum types too.
22905
22906         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22907
22908         * expression.cs (EvalConstantExpression): Get rid of completely.
22909
22910         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22911         user-defined values and other cases.
22912
22913         (IsValidEnumLiteral): Helper function.
22914
22915         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22916         out there in the case we had a literal FieldExpr.
22917
22918         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22919
22920         (Literalize): Revamp a bit to take two arguments.
22921
22922         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22923
22924 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22925
22926         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22927
22928         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22929
22930         (Resolve): Use the above to ensure we have proper initializers.
22931
22932 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22933
22934         * expression.cs (Expression::EvalConstantExpression): New method to 
22935         evaluate constant expressions.
22936
22937         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22938
22939 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22940
22941         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22942         in an array.
22943
22944         (Binary.ResolveOperator): Handle operator != (object a, object b)
22945         and operator == (object a, object b);
22946
22947         (Binary.DoNumericPromotions): Indicate whether the numeric
22948         promotion was possible.
22949
22950         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22951         Implement.  
22952
22953         Made the ArrayAccess implement interface IAssignMethod instead of
22954         IStackStore as the order in which arguments are passed reflects
22955         this.
22956
22957         * assign.cs: Instead of using expr.ExprClass to select the way of
22958         assinging, probe for the IStackStore/IAssignMethod interfaces.
22959
22960         * typemanager.cs: Load InitializeArray definition.
22961
22962         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22963         static data that can be used to initialize arrays. 
22964
22965 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22966
22967         * expression.cs: Handle operator== and operator!= for booleans.
22968
22969         (Conditioal.Reduce): Implement reducer for the ?: operator.
22970
22971         (Conditional.Resolve): Implement dead code elimination.
22972
22973         (Binary.Resolve): Catch string literals and return a new
22974         concatenated string.
22975
22976         (Unary.Reduce): Implement reduction of unary expressions.
22977
22978         * ecore.cs: Split out the expression core handling here.
22979
22980         (Expression.Reduce): New method used to perform constant folding
22981         and CSE.  This is needed to support constant-expressions. 
22982
22983         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22984         targets, and optimize for !x.
22985
22986 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22987
22988         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22989         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22990         set custom atttributes.
22991
22992         * literal.cs (Literal::GetValue): New abstract method to return the actual
22993         value of the literal, cast as an object.
22994
22995         (*Literal): Implement GetValue method.
22996
22997         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22998         expressions to the arraylist but objects of type Argument.
22999
23000         * class.cs (TypeContainer::Emit): Emit our attributes too.
23001
23002         (Method::Emit, Constructor::Emit): Ditto.
23003
23004         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23005         to be ignoring earlier.
23006
23007 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23008
23009         * attribute.cs (AttributeSection::Define): Implement to do the business
23010         of constructing a CustomAttributeBuilder.
23011
23012         (Attribute): New trivial class. Increases readability of code.  
23013
23014         * cs-parser.jay : Update accordingly.
23015
23016         (positional_argument_list, named_argument_list, named_argument): New rules
23017
23018         (attribute_arguments): Use the above so that we are more correct.
23019
23020 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23021
23022         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23023         to perform all checks for a method with a params parameter.
23024
23025         (Invocation::OverloadResolve): Update to use the above method and therefore
23026         cope correctly with params method invocations.
23027
23028         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23029         params too.
23030
23031         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23032         constructors in our parent too because we can't afford to miss out on 
23033         protected ones ;-)
23034
23035         * attribute.cs (AttributeSection): New name for the class Attribute
23036
23037         Other trivial changes to improve readability.
23038
23039         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23040         use the new class names.
23041
23042 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23043
23044         * class.cs (Method::Define): Complete definition for params types too
23045
23046         (Indexer::Define): Ditto.
23047
23048         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23049         Cope everywhere with a request for info about the array parameter.
23050
23051 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23052
23053         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23054
23055         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23056         local_variable_type to extract the string corresponding to the type.
23057
23058         (local_variable_type): Fixup the action to use the new helper method.
23059
23060         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23061         go.
23062
23063         * expression.cs : Clean out code which uses the above.
23064
23065 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23066
23067         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23068         and bale out if necessary by returning a false.
23069
23070         (RegisterProperty): Ditto.
23071
23072         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23073         and print out appropriate error messages.
23074
23075         * interface.cs (everywhere): Ditto.
23076
23077         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23078         location to constructor.
23079
23080         * class.cs (Property, Event, Indexer): Update accordingly.
23081
23082         * ../errors/cs111.cs : Added.
23083
23084         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23085         of a method, as laid down by the spec.
23086
23087         (Invocation::OverloadResolve): Use the above method.
23088
23089 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23090
23091         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23092         now take a TypeContainer and a Parameters object.
23093
23094         (ParameterData): Modify return type of ParameterModifier method to be 
23095         Parameter.Modifier and not a string.
23096
23097         (ReflectionParameters, InternalParameters): Update accordingly.
23098
23099         * expression.cs (Argument::GetParameterModifier): Same here.
23100
23101         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23102         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23103         symbol in it at all so maybe this is only for now.
23104
23105 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23106
23107         * support.cs (InternalParameters): Constructor now takes an extra argument 
23108         which is the actual Parameters class.
23109
23110         (ParameterDesc): Update to provide info on ref/out modifiers.
23111
23112         * class.cs (everywhere): Update call to InternalParameters to pass in
23113         the second argument too.
23114
23115         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23116         to return the modifier info [ref/out etc]
23117
23118         (InternalParameters, ReflectionParameters): Implement the above.
23119
23120         * expression.cs (Argument::ParameterModifier): Similar function to return
23121         info about the argument's modifiers.
23122
23123         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23124         too.
23125
23126         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23127         a new SetFormalParameters object which we pass to InternalParameters.
23128
23129 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23130
23131         * expression.cs (NewArray): Merge into the ArrayCreation class.
23132
23133 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23134
23135         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23136         NewUserdefinedArray into one as there wasn't much of a use in having
23137         two separate ones.
23138
23139         * expression.cs (Argument): Change field's name to ArgType from Type.
23140
23141         (Type): New readonly property which returns the proper type, taking into 
23142         account ref/out modifiers.
23143
23144         (everywhere): Adjust code accordingly for the above.
23145
23146         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23147         whether we are emitting for a ref or out parameter.
23148
23149         * expression.cs (Argument::Emit): Use the above field to set the state.
23150
23151         (LocalVariableReference::Emit): Update to honour the flag and emit the
23152         right stuff.
23153
23154         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23155
23156         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23157
23158         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23159
23160         (ReflectionParameters, InternalParameters): Implement the above method.
23161
23162         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23163         reporting errors.
23164
23165         (Invocation::FullMethodDesc): Ditto. 
23166
23167 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23168
23169         * cs-parser.jay: Add extra production for the second form of array
23170         creation. 
23171
23172         * expression.cs (ArrayCreation): Update to reflect the above
23173         change. 
23174
23175         * Small changes to prepare for Array initialization.
23176
23177 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23178
23179         * typemanager.cs (ImplementsInterface): interface might be null;
23180         Deal with this problem;
23181
23182         Also, we do store negative hits on the cache (null values), so use
23183         this instead of calling t.GetInterfaces on the type everytime.
23184
23185 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23186
23187         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23188
23189         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23190         split functionality out into different classes.
23191
23192         (New::FormArrayType): Move into NewBuiltinArray.
23193
23194         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23195         quite useless.
23196
23197         (NewBuiltinArray): New class to handle creation of built-in arrays.
23198
23199         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23200         account creation of one-dimensional arrays.
23201
23202         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23203
23204         (NewUserdefinedArray::DoResolve): Implement.
23205
23206         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23207
23208         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23209         we maintain inside the TypeManager. This is necessary to perform lookups on the
23210         module builder.
23211
23212         (LookupType): Update to perform GetType on the module builders too.     
23213
23214         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23215
23216         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23217
23218 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23219
23220         * expression.cs (New::DoResolve): Implement guts of array creation.
23221
23222         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23223
23224 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23225
23226         * expression.cs: Fix bug I introduced lsat night that broke
23227         Delegates. 
23228
23229         (Expression.Resolve): Report a 246 error (can not resolve name)
23230         if we find a SimpleName in the stream.
23231
23232         (Expression.ResolveLValue): Ditto.
23233
23234         (Expression.ResolveWithSimpleName): This function is a variant of
23235         ResolveName, this one allows SimpleNames to be returned without a
23236         warning.  The only consumer of SimpleNames is MemberAccess
23237
23238 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23239
23240         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23241         might arrive here.  I have my doubts that this is correct.
23242
23243         * statement.cs (Lock): Implement lock statement.
23244
23245         * cs-parser.jay: Small fixes to support `lock' and `using'
23246
23247         * cs-tokenizer.cs: Remove extra space
23248
23249         * driver.cs: New flag --checked, allows to turn on integer math
23250         checking. 
23251
23252         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23253         Threading.Monitor.Exit 
23254
23255 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23256
23257         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23258         Expression Class to be IndexerAccess.
23259
23260         Notice that Indexer::DoResolve sets the eclass to Value.
23261
23262 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23263
23264         * class.cs (TypeContainer::Emit): Emit code for indexers.
23265
23266         * assign.cs (IAssignMethod): New interface implemented by Indexers
23267         and Properties for handling assignment.
23268
23269         (Assign::Emit): Simplify and reuse code. 
23270
23271         * expression.cs (IndexerAccess, PropertyExpr): Implement
23272         IAssignMethod, clean up old code. 
23273
23274 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23275
23276         * typemanager.cs (ImplementsInterface): New method to determine if a type
23277         implements a given interface. Provides a nice cache too.
23278
23279         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23280         method.
23281
23282         (ConvertReferenceExplicit): Ditto.
23283
23284         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23285         various methods, with correct names etc.
23286
23287         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23288         Operator.UnaryNegation.
23289
23290         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23291         we have a unary plus or minus operator.
23292
23293         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23294         UnaryMinus.
23295
23296         * everywhere : update accordingly.
23297
23298         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23299         respectively.
23300
23301         * class.cs (Method::Define): For the case where we are implementing a method
23302         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23303         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23304
23305 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23306
23307         * interface.cs (FindMembers): Implement to work around S.R.E
23308         lameness.
23309
23310         * typemanager.cs (IsInterfaceType): Implement.
23311
23312         (FindMembers): Update to handle interface types too.
23313
23314         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23315         use IsAssignableFrom as that is not correct - it doesn't work.
23316
23317         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23318         and accordingly override EmitStatement.
23319
23320         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23321         using the correct logic :-)
23322
23323 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23324
23325         * ../errors/cs-11.cs : Add to demonstrate error -11 
23326
23327 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23328
23329         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23330         then pass this as a hint to ResolveLValue.
23331
23332         * expression.cs (FieldExpr): Add Location information
23333
23334         (FieldExpr::LValueResolve): Report assignment to readonly
23335         variable. 
23336
23337         (Expression::ExprClassFromMemberInfo): Pass location information.
23338
23339         (Expression::ResolveLValue): Add new method that resolves an
23340         LValue. 
23341
23342         (Expression::DoResolveLValue): Default invocation calls
23343         DoResolve. 
23344
23345         (Indexers): New class used to keep track of indexers in a given
23346         Type. 
23347
23348         (IStackStore): Renamed from LValue, as it did not really describe
23349         what this did.  Also ResolveLValue is gone from this interface and
23350         now is part of Expression.
23351
23352         (ElementAccess): Depending on the element access type
23353
23354         * typemanager.cs: Add `indexer_name_type' as a Core type
23355         (System.Runtime.CompilerServices.IndexerNameAttribute)
23356
23357         * statement.cs (Goto): Take a location.
23358
23359 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23360
23361         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23362         if two delegates are compatible.
23363
23364         (NewDelegate::DoResolve): Update to take care of the case when
23365         we instantiate a delegate from another delegate.
23366
23367         * typemanager.cs (FindMembers): Don't even try to look up members
23368         of Delegate types for now.
23369
23370 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23371
23372         * delegate.cs (NewDelegate): New class to take care of delegate
23373         instantiation.
23374
23375         * expression.cs (New): Split the delegate related code out into 
23376         the NewDelegate class.
23377
23378         * delegate.cs (DelegateInvocation): New class to handle delegate 
23379         invocation.
23380
23381         * expression.cs (Invocation): Split out delegate related code into
23382         the DelegateInvocation class.
23383
23384 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23385
23386         * expression.cs (New::DoResolve): Implement delegate creation fully
23387         and according to the spec.
23388
23389         (New::DoEmit): Update to handle delegates differently.
23390
23391         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23392         because of which we were printing out arguments in reverse order !
23393
23394         * delegate.cs (VerifyMethod): Implement to check if the given method
23395         matches the delegate.
23396
23397         (FullDelegateDesc): Implement.
23398
23399         (VerifyApplicability): Implement.
23400
23401         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23402         delegate invocations too.
23403
23404         (Invocation::Emit): Ditto.
23405
23406         * ../errors/cs1593.cs : Added.
23407
23408         * ../errors/cs1594.cs : Added.
23409
23410         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23411
23412 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23413
23414         * typemanager.cs (intptr_type): Core type for System.IntPtr
23415
23416         (InitCoreTypes): Update for the same.
23417
23418         (iasyncresult_type, asynccallback_type): Ditto.
23419
23420         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23421         correct.
23422
23423         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23424         too.
23425
23426         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23427         the builders for the 4 members of a delegate type :-)
23428
23429         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23430         type.
23431
23432         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23433
23434         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23435
23436 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23437
23438         * statement.cs (Break::Emit): Implement.   
23439         (Continue::Emit): Implement.
23440
23441         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23442         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23443         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23444         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23445         end loop
23446
23447         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23448         properties that track the label for the current loop (begin of the
23449         loop and end of the loop).
23450
23451 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23452
23453         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23454         use of emitting anything at all.
23455
23456         * class.cs, rootcontext.cs : Get rid of calls to the same.
23457
23458         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23459
23460         (Populate): Define the constructor correctly and set the implementation
23461         attributes.
23462
23463         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23464         have been defined.
23465
23466         (AddDelegateType): Implement.
23467
23468         (IsDelegateType): Implement helper method.
23469
23470         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23471
23472         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23473         and accordingly handle it.
23474
23475         * delegate.cs (Populate): Take TypeContainer argument.
23476         Implement bits to define the Invoke method. However, I still haven't figured out
23477         how to take care of the native int bit :-(
23478
23479         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23480         Qualify the name of the delegate, not its return type !
23481
23482         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23483         conversion.
23484
23485         (StandardConversionExists): Checking for array types turns out to be recursive.
23486
23487         (ConvertReferenceExplicit): Implement array conversion.
23488
23489         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23490
23491 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23492
23493         * cs-parser.jay (delegate_declaration): Store the fully qualified
23494         name as it is a type declaration.
23495
23496         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23497         readonly.
23498
23499         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23500         as TypeContainer::DefineType.
23501
23502         (Populate): Method in which all the definition of the various methods (Invoke)
23503         etc is done.
23504
23505         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23506         see.
23507
23508         (CloseDelegate): Finally creates the delegate.
23509
23510         * class.cs (TypeContainer::DefineType): Update to define delegates.
23511         (Populate, Emit and CloseType): Do the same thing here too.
23512
23513         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23514         delegates in all these operations.
23515
23516 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23517
23518         * expression.cs: LocalTemporary: a new expression used to
23519         reference a temporary that has been created.
23520
23521         * assign.cs: Handle PropertyAccess back here, so that we can
23522         provide the proper semantic access to properties.
23523
23524         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23525         a few more explicit conversions. 
23526
23527         * modifiers.cs: `NEW' modifier maps to HideBySig.
23528
23529         * expression.cs (PropertyExpr): Make this into an
23530         ExpressionStatement, and support the EmitStatement code path. 
23531
23532         Perform get/set error checking, clean up the interface.
23533
23534         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23535         them into toplevel access objects.
23536
23537 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23538
23539         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23540         SRE.
23541
23542         * typemanager.cs: Keep track here of our PropertyBuilders again to
23543         work around lameness in SRE.
23544
23545 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23546
23547         * expression.cs (LValue::LValueResolve): New method in the
23548         interface, used to perform a second resolution pass for LValues. 
23549
23550         (This::DoResolve): Catch the use of this in static methods.
23551
23552         (This::LValueResolve): Implement.
23553
23554         (This::Store): Remove warning, assigning to `this' in structures
23555         is 
23556
23557         (Invocation::Emit): Deal with invocation of
23558         methods on value types.  We need to pass the address to structure
23559         methods rather than the object itself.  (The equivalent code to
23560         emit "this" for structures leaves the entire structure on the
23561         stack instead of a pointer to it). 
23562
23563         (ParameterReference::DoResolve): Compute the real index for the
23564         argument based on whether the method takes or not a `this' pointer
23565         (ie, the method is static).
23566
23567         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23568         value types returned from functions when we need to invoke a
23569         method on the sturcture.
23570
23571
23572 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23573
23574         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23575         defining the type in the Modulebuilder or Typebuilder. This is to take
23576         care of nested types which need to be defined on the TypeBuilder using
23577         DefineNestedMethod.
23578
23579         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23580         methods in RootContext, only ported to be part of TypeContainer.
23581
23582         (TypeContainer::GetInterfaceOrClass): Ditto.
23583
23584         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23585
23586         * interface.cs (Interface::DefineInterface): New method. Does exactly
23587         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23588         too.
23589
23590         (Interface::GetInterfaces): Move from RootContext here and port.
23591
23592         (Interface::GetInterfaceByName): Same here.
23593
23594         * rootcontext.cs (ResolveTree): Re-write.
23595
23596         (PopulateTypes): Re-write.
23597
23598         * class.cs (TypeContainer::Populate): Populate nested types too.
23599         (TypeContainer::Emit): Emit nested members too.
23600
23601         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23602         instead just use the name argument passed in as it is already fully
23603         qualified.
23604
23605         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23606         to TypeContainer mapping to see if a type is user-defined.
23607
23608         * class.cs (TypeContainer::CloseType): Implement. 
23609
23610         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23611         the default constructor.
23612
23613         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23614         twice.
23615
23616         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23617
23618         * interface.cs (CloseType): Create the type here.
23619
23620         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23621         the hierarchy.
23622
23623         Remove all the methods which are now in TypeContainer.
23624
23625 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23626
23627         * delegate.cs (Define): Re-write bits to define the delegate
23628         correctly.
23629
23630 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23631
23632         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23633
23634         * expression.cs (ImplicitReferenceConversion): handle null as well
23635         as a source to convert to any reference type.
23636
23637         * statement.cs (Return): Perform any implicit conversions to
23638         expected return type.  
23639
23640         Validate use of return statement.  
23641
23642         * codegen.cs (EmitContext): Pass the expected return type here.
23643
23644         * class.cs (Method, Constructor, Property): Pass expected return
23645         type to EmitContext.
23646
23647 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23648
23649         * expression.cs: Make DoResolve take an EmitContext instead of a
23650         TypeContainer.
23651
23652         Replaced `l' and `location' for `loc', for consistency.
23653
23654         (Error, Warning): Remove unneeded Tc argument.
23655
23656         * assign.cs, literal.cs, constant.cs: Update to new calling
23657         convention. 
23658
23659         * codegen.cs: EmitContext now contains a flag indicating whether
23660         code is being generated in a static method or not.
23661
23662         * cs-parser.jay: DecomposeQI, new function that replaces the old
23663         QualifiedIdentifier.  Now we always decompose the assembled
23664         strings from qualified_identifier productions into a group of
23665         memberaccesses.
23666
23667 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23668
23669         * rootcontext.cs: Deal with field-less struct types correctly now
23670         by passing the size option to Define Type.
23671
23672         * class.cs: Removed hack that created one static field. 
23673
23674 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23675
23676         * statement.cs: Moved most of the code generation here. 
23677
23678 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23679
23680         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23681         seem very right.
23682
23683         (ElementAccess): Remove useless bits for now - keep checks as the spec
23684         says.
23685
23686 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23687
23688         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23689         and start performing checks according to the spec.
23690
23691 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23692
23693         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23694         rank_specifiers instead.
23695
23696         (rank_specifiers): Change the order in which the rank specifiers are stored
23697
23698         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23699
23700         * expression.cs (ElementAccess): Implement the LValue interface too.
23701
23702 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23703
23704         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23705         except that user defined conversions are not included.
23706
23707         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23708         perform the conversion of the return type, if necessary.
23709
23710         (New::DoResolve): Check whether we are creating an array or an object
23711         and accordingly do the needful.
23712
23713         (New::Emit): Same here.
23714
23715         (New::DoResolve): Implement guts of array creation.
23716
23717         (New::FormLookupType): Helper function.
23718
23719 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23720
23721         * codegen.cs: Removed most of the code generation here, and move the
23722         corresponding code generation bits to the statement classes. 
23723
23724         Added support for try/catch/finalize and throw.
23725
23726         * cs-parser.jay: Added support for try/catch/finalize.
23727
23728         * class.cs: Catch static methods having the flags override,
23729         virtual or abstract.
23730
23731         * expression.cs (UserCast): This user cast was not really doing
23732         what it was supposed to do.  Which is to be born in fully resolved
23733         state.  Parts of the resolution were being performed at Emit time! 
23734
23735         Fixed this code.
23736
23737 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23738
23739         * expression.cs: Implicity convert the result from UserCast.
23740
23741 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23742
23743         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23744         prevented it from working correctly. 
23745
23746         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23747         merely ConvertImplicit.
23748
23749 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23750
23751         * typemanager.cs: Make the LookupTypeContainer function static,
23752         and not per-instance.  
23753
23754         * class.cs: Make static FindMembers (the one that takes a Type
23755         argument). 
23756
23757         * codegen.cs: Add EmitForeach here.
23758
23759         * cs-parser.jay: Make foreach a toplevel object instead of the
23760         inline expansion, as we need to perform semantic analysis on it. 
23761
23762 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23763
23764         * expression.cs (Expression::ImplicitUserConversion): Rename to
23765         UserDefinedConversion.
23766
23767         (Expression::UserDefinedConversion): Take an extra argument specifying 
23768         whether we look for explicit user conversions too.
23769
23770         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23771
23772         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23773
23774         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23775         with the appropriate arguments.
23776
23777         * cs-parser.jay (cast_expression): Record location too.
23778
23779         * expression.cs (Cast): Record location info.
23780
23781         (Expression::ConvertExplicit): Take location argument.
23782
23783         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23784         to determine if we are doing explicit conversions.
23785
23786         (UserCast::Emit): Update accordingly.
23787
23788         (Expression::ConvertExplicit): Report an error if everything fails.
23789
23790         * ../errors/cs0030.cs : Add.
23791
23792 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23793
23794         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23795         virtual and newslot bits. 
23796
23797         * class.cs (TypeContainer::RegisterRequiredImplementations):
23798         Record methods we need.
23799
23800         (TypeContainer::MakeKey): Helper function to make keys for
23801         MethodBases, since the Methodbase key is useless.
23802
23803         (TypeContainer::Populate): Call RegisterRequiredImplementations
23804         before defining the methods.   
23805
23806         Create a mapping for method_builders_to_methods ahead of time
23807         instead of inside a tight loop.
23808
23809         (::RequireMethods):  Accept an object as the data to set into the
23810         hashtable so we can report interface vs abstract method mismatch.
23811
23812 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23813
23814         * report.cs: Make all of it static.
23815
23816         * rootcontext.cs: Drop object_type and value_type computations, as
23817         we have those in the TypeManager anyways.
23818
23819         Drop report instance variable too, now it is a global.
23820
23821         * driver.cs: Use try/catch on command line handling.
23822
23823         Add --probe option to debug the error reporting system with a test
23824         suite. 
23825
23826         * report.cs: Add support for exiting program when a probe
23827         condition is reached.
23828
23829 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23830
23831         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23832         we do a forcible conversion regardless of type, to check if 
23833         ForceConversion returns a null.
23834
23835         (Binary::error19): Use location to report error.
23836
23837         (Unary::error23): Use location here too.
23838
23839         * ../errors/cs0019.cs : Check in.
23840
23841         * ../errors/cs0023.cs : Check in.
23842
23843         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23844         case of a non-null MethodInfo object with a length of 0 !
23845
23846         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23847         an applicable member - according to the spec :-)
23848         Also fix logic to find members in base types.
23849
23850         (Unary::ResolveOperator): Same here.
23851
23852         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23853         as I was getting thoroughly confused between this and error19 :-)
23854
23855         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23856         (::FindMostEncompassedType): Implement.
23857         (::FindMostEncompassingType): Implement.
23858         (::StandardConversionExists): Implement.
23859
23860         (UserImplicitCast): Re-vamp. We now need info about most specific
23861         source and target types so that we can do the necessary conversions.
23862
23863         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23864         mathematical union with no duplicates.
23865
23866 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23867
23868         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23869         in order from base classes to child classes, so that we can in
23870         child classes look up in our parent for method names and
23871         attributes (required for handling abstract, virtual, new, override
23872         constructs: we need to instrospect our base class, and if we dont
23873         populate the classes in order, the introspection might be
23874         incorrect.  For example, a method could query its parent before
23875         the parent has any methods and would determine that the parent has
23876         no abstract methods (while it could have had them)).
23877
23878         (RootContext::CreateType): Record the order in which we define the
23879         classes.
23880
23881 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23882
23883         * class.cs (TypeContainer::Populate): Also method definitions can
23884         fail now, keep track of this.
23885
23886         (TypeContainer::FindMembers): Implement support for
23887         DeclaredOnly/noDeclaredOnly flag.
23888
23889         (Constructor::Emit) Return the ConstructorBuilder.
23890
23891         (Method::Emit) Return the MethodBuilder. 
23892         Check for abstract or virtual methods to be public.
23893
23894         * rootcontext.cs (RootContext::CreateType): Register all the
23895         abstract methods required for the class to be complete and the
23896         interface methods that must be implemented. 
23897
23898         * cs-parser.jay: Report error 501 (method requires body if it is
23899         not marked abstract or extern).
23900
23901         * expression.cs (TypeOf::Emit): Implement.
23902
23903         * typemanager.cs: runtime_handle_type, new global type.
23904
23905         * class.cs (Property::Emit): Generate code for properties.
23906
23907 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23908
23909         * expression.cs (Unary::ResolveOperator): Find operators on base type
23910         too - we now conform exactly to the spec.
23911
23912         (Binary::ResolveOperator): Same here.
23913
23914         * class.cs (Operator::Define): Fix minor quirk in the tests.
23915
23916         * ../errors/cs0215.cs : Added.
23917
23918         * ../errors/cs0556.cs : Added.
23919
23920         * ../errors/cs0555.cs : Added.
23921
23922 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23923
23924         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23925         single integer which is really efficient
23926
23927 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23928
23929         *  expression.cs (Expression::ImplicitUserConversion): Use location
23930         even in the case when we are examining True operators.
23931  
23932         * class.cs (Operator::Define): Perform extensive checks to conform
23933         with the rules for operator overloading in the spec.
23934
23935         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23936         some of the other conversions mentioned in the spec.
23937
23938         * typemanager.cs (array_type): New static member for the System.Array built-in
23939         type.
23940
23941         (cloneable_interface): For System.ICloneable interface.
23942
23943         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23944         we start resolving the tree and populating types.
23945
23946         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23947  
23948 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23949
23950         * expression.cs (Expression::ExprClassFromMemberInfo,
23951         Expression::Literalize): Create literal expressions from
23952         FieldInfos which are literals.
23953
23954         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23955         type casts, because they were wrong.  The test suite in tests
23956         caught these ones.
23957
23958         (ImplicitNumericConversion): ushort to ulong requires a widening
23959         cast. 
23960
23961         Int32 constant to long requires widening cast as well.
23962
23963         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23964         for integers because the type on the stack is not i4.
23965
23966 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23967
23968         * expression.cs (report118): require location argument. 
23969
23970         * parameter.cs: Do not dereference potential null value.
23971
23972         * class.cs: Catch methods that lack the `new' keyword when
23973         overriding a name.  Report warnings when `new' is used without
23974         anything being there to override.
23975
23976         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23977
23978         * class.cs: Only add constructor to hashtable if it is non-null
23979         (as now constructors can fail on define).
23980
23981         (TypeManager, Class, Struct): Take location arguments.
23982
23983         Catch field instance initialization in structs as errors.
23984
23985         accepting_filter: a new filter for FindMembers that is static so
23986         that we dont create an instance per invocation.
23987
23988         (Constructor::Define): Catch errors where a struct constructor is
23989         parameterless 
23990
23991         * cs-parser.jay: Pass location information for various new
23992         constructs. 
23993
23994         * delegate.cs (Delegate): take a location argument.
23995
23996         * driver.cs: Do not call EmitCode if there were problesm in the
23997         Definition of the types, as many Builders wont be there. 
23998
23999         * decl.cs (Decl::Decl): Require a location argument.
24000
24001         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24002         into integers, and find the most appropiate integer for it.
24003
24004         * literal.cs: Implement ULongLiteral.
24005
24006         * rootcontext.cs: Provide better information about the location of
24007         failure when CreateType fails.
24008
24009 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24010
24011         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24012         as well.
24013
24014         * expression.cs (Binary::CheckShiftArguments): Add missing type
24015         computation.
24016         (Binary::ResolveOperator): Add type to the logical and and logical
24017         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24018         before.
24019
24020         (Binary::DoNumericPromotions): In the case where either argument
24021         is ulong (and most signed types combined with ulong cause an
24022         error) perform implicit integer constant conversions as well.
24023
24024 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24025
24026         * expression.cs (UserImplicitCast): Method should always be
24027         non-null. 
24028         (Invocation::BetterConversion): Simplified test for IntLiteral.
24029
24030         (Expression::ImplicitNumericConversion): Split this routine out.
24031         Put the code that performs implicit constant integer conversions
24032         here. 
24033
24034         (Expression::Resolve): Become a wrapper around DoResolve so we can
24035         check eclass and type being set after resolve.
24036
24037         (Invocation::Badness): Remove this dead function
24038
24039         (Binary::ResolveOperator): Do not compute the expensive argumnets
24040         unless we have a union for it.
24041
24042         (Probe::Emit): Is needs to do an isinst and then
24043         compare against null.
24044
24045         (::CanConvert): Added Location argument.  If the Location argument
24046         is null (Location.Null), then we do not report errors.  This is
24047         used by the `probe' mechanism of the Explicit conversion.  We do
24048         not want to generate an error for something that the user
24049         explicitly requested to be casted.  But the pipeline for an
24050         explicit cast first tests for potential implicit casts.
24051
24052         So for now, if the Location is null, it means `Probe only' to
24053         avoid adding another argument.   Might have to revise this
24054         strategy later.
24055
24056         (ClassCast): New class used to type cast objects into arbitrary
24057         classes (used in Explicit Reference Conversions).
24058
24059         Implement `as' as well.
24060
24061         Reverted all the patches from Ravi below: they were broken:
24062
24063                 * The use of `level' as a mechanism to stop recursive
24064                   invocations is wrong.  That was there just to catch the
24065                   bug with a strack trace but not as a way of addressing
24066                   the problem.
24067
24068                   To fix the problem we have to *understand* what is going
24069                   on and the interactions and come up with a plan, not
24070                   just get things going.
24071
24072                 * The use of the type conversion cache that I proposed
24073                   last night had an open topic: How does this work across
24074                   protection domains.  A user defined conversion might not
24075                   be public in the location where we are applying the
24076                   conversion, a different conversion might be selected
24077                   (ie, private A->B (better) but public B->A (worse),
24078                   inside A, A->B applies, but outside it, B->A will
24079                   apply).
24080
24081                 * On top of that (ie, even if the above is solved),
24082                   conversions in a cache need to be abstract.  Ie, `To
24083                   convert from an Int to a Short use an OpcodeCast', not
24084                   `To convert from an Int to a Short use the OpcodeCast on
24085                   the variable 5' (which is what this patch was doing).
24086
24087 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24088
24089         * expression.cs (Invocation::ConversionExists): Re-write to use
24090         the conversion cache
24091
24092         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24093         cache all conversions done, not just user-defined ones.
24094
24095         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24096         to determine if a conversion exists instead of acutually trying to 
24097         perform the conversion. It's faster too.
24098
24099         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24100         and only then attempt the implicit conversion.
24101
24102 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24103
24104         * expression.cs (ConvertImplicit): Use a cache for conversions
24105         already found. Check level of recursion and bail out if necessary.
24106
24107 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24108
24109         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24110         Export standard methods that we expect for string operations.
24111
24112         * statement.cs (Block::UsageWarning): Track usage of variables and
24113         report the errors for not used variables.
24114
24115         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24116         operator. 
24117
24118 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24119
24120         * codegen.cs: remove unnneded code 
24121
24122         * expression.cs: Removed BuiltinTypeAccess class
24123
24124         Fix the order in which implicit conversions are
24125         done.  
24126
24127         The previous fixed dropped support for boxed conversions (adding a
24128         test to the test suite now)
24129
24130         (UserImplicitCast::CanConvert): Remove test for source being null,
24131         that code is broken.  We should not feed a null to begin with, if
24132         we do, then we should track the bug where the problem originates
24133         and not try to cover it up here.
24134
24135         Return a resolved expression of type UserImplicitCast on success
24136         rather than true/false.  Ravi: this is what I was talking about,
24137         the pattern is to use a static method as a "constructor" for
24138         objects. 
24139
24140         Also, do not create arguments until the very last minute,
24141         otherwise we always create the arguments even for lookups that
24142         will never be performed. 
24143
24144         (UserImplicitCast::Resolve): Eliminate, objects of type
24145         UserImplicitCast are born in a fully resolved state. 
24146
24147         * typemanager.cs (InitCoreTypes): Init also value_type
24148         (System.ValueType). 
24149
24150         * expression.cs (Cast::Resolve): First resolve the child expression.
24151
24152         (LValue): Add new method AddressOf to be used by
24153         the `&' operator.  
24154
24155         Change the argument of Store to take an EmitContext instead of an
24156         ILGenerator, because things like FieldExpr need to be able to call
24157         their children expression to generate the instance code. 
24158
24159         (Expression::Error, Expression::Warning): Sugar functions for
24160         reporting errors.
24161
24162         (Expression::MemberLookup): Accept a TypeContainer instead of a
24163         Report as the first argument.
24164
24165         (Expression::ResolvePrimary): Killed.  I still want to improve
24166         this as currently the code is just not right.
24167
24168         (Expression::ResolveMemberAccess): Simplify, but it is still
24169         wrong. 
24170
24171         (Unary::Resolve): Catch errors in AddressOf operators.
24172
24173         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24174         index to a byte for the short-version, or the compiler will choose
24175         the wrong Emit call, which generates the wrong data.
24176
24177         (ParameterReference::Emit, ::Store): same.
24178
24179         (FieldExpr::AddressOf): Implement.
24180
24181         * typemanager.cs: TypeManager: made public variable instead of
24182         property.
24183
24184         * driver.cs: document --fatal.
24185
24186         * report.cs (ErrorMessage, WarningMessage): new names for the old
24187         Error and Warning classes.
24188
24189         * cs-parser.jay (member_access): Turn built-in access to types
24190         into a normal simplename
24191
24192 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24193
24194         * expression.cs (Invocation::BetterConversion): Fix to cope
24195         with q being null, since this was introducing a bug.
24196
24197         * expression.cs (ConvertImplicit): Do built-in conversions first.
24198
24199 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24200
24201         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24202
24203 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24204
24205         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24206         I had introduced long ago (what's new ?).
24207
24208         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24209         the work of all the checking. 
24210         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24211         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24212
24213         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24214         that is the right way. 
24215
24216         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24217         overloading resolution. Use everywhere instead of cutting and pasting code.
24218
24219         (Binary::ResolveOperator): Use MakeUnionSet.
24220
24221         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24222         we have to convert to bool types. Not complete yet.
24223
24224 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24225
24226         * typemanager.cs (TypeManager::CSharpName): support ushort.
24227
24228         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24229         to provide an expression that performsn an implicit constant int
24230         conversion (section 6.1.6).
24231         (Expression::ConvertImplicitRequired): Reworked to include
24232         implicit constant expression conversions.
24233
24234         (Expression::ConvertNumericExplicit): Finished.
24235
24236         (Invocation::Emit): If InstanceExpression is null, then it means
24237         that we perform a call on this.
24238
24239 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24240
24241         * expression.cs (Unary::Emit): Remove some dead code.
24242         (Probe): Implement Resolve and Emit for `is'.
24243         (Expression::ConvertImplicitRequired): Attempt to do constant
24244         expression conversions here.  Maybe should be moved to
24245         ConvertImplicit, but I am not sure.
24246         (Expression::ImplicitLongConstantConversionPossible,
24247         Expression::ImplicitIntConstantConversionPossible): New functions
24248         that tell whether is it possible to apply an implicit constant
24249         expression conversion.
24250
24251         (ConvertNumericExplicit): Started work on explicit numeric
24252         conversions.
24253
24254         * cs-parser.jay: Update operator constants.
24255
24256         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24257         (Parameters::GetSignature): Hook up VerifyArgs here.
24258         (Parameters::VerifyArgs): Verifies that no two arguments have the
24259         same name. 
24260
24261         * class.cs (Operator): Update the operator names to reflect the
24262         ones that the spec expects (as we are just stringizing the
24263         operator names).
24264
24265         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24266         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24267         previous usage did only work for our methods.
24268         (Expression::ConvertImplicit): Handle decimal implicit numeric
24269         conversions as well.
24270         (Expression::InternalTypeConstructor): Used to invoke constructors
24271         on internal types for default promotions.
24272
24273         (Unary::Emit): Implement special handling for the pre/post
24274         increment/decrement for overloaded operators, as they need to have
24275         the same semantics as the other operators.
24276
24277         (Binary::ResolveOperator): ditto.
24278         (Invocation::ConversionExists): ditto.
24279         (UserImplicitCast::Resolve): ditto.
24280
24281 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24282
24283         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24284         operator, return after emitting body. Regression tests pass again !
24285
24286         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24287         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24288         (Invocation::OverloadResolve): Ditto.
24289         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24290
24291         * everywhere : update calls to the above methods accordingly.
24292
24293 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24294
24295         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24296
24297         * expression.cs (ExpressionStatement): New base class used for
24298         expressions that can appear in statements, so that we can provide
24299         an alternate path to generate expression that do not leave a value
24300         on the stack.
24301
24302         (Expression::Emit, and all the derivatives): We no longer return
24303         whether a value is left on the stack or not.  Every expression
24304         after being emitted leaves a single value on the stack.
24305
24306         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24307         facilties of ExpressionStatement if possible.
24308
24309         * cs-parser.jay: Update statement_expression.
24310
24311 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24312
24313         * driver.cs: Change the wording of message
24314
24315 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24316
24317         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24318         the type of the expression to the return type of the method if
24319         we have an overloaded operator match ! The regression tests pass again !
24320         (Unary::ResolveOperator): Ditto.
24321
24322         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24323         to find "op_Implicit", not "implicit" ;-)
24324         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24325         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24326
24327         * everywhere : Correct calls to the above accordingly.
24328
24329         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24330         (ConvertImplicit): Do user-defined conversion if it exists.
24331
24332 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24333
24334         * assign.cs: track location.
24335         (Resolve): Use implicit conversions on assignment.
24336
24337         * literal.cs: Oops.  Not good, Emit of short access values should
24338         pass (Bytes) or the wrong argument will be selected.
24339
24340         * expression.cs (Unary::Emit): Emit code for -expr.
24341
24342         (Unary::ResolveOperator): Handle `Substract' for non-constants
24343         (substract from zero from the non-constants).
24344         Deal with Doubles as well. 
24345
24346         (Expression::ConvertImplicitRequired): New routine that reports an
24347         error if no implicit conversion exists. 
24348
24349         (Invocation::OverloadResolve): Store the converted implicit
24350         expressions if we make them
24351
24352 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24353
24354         * class.cs (ConstructorInitializer): Take a Location argument.
24355         (ConstructorBaseInitializer): Same here.
24356         (ConstructorThisInitializer): Same here.
24357
24358         * cs-parser.jay : Update all calls accordingly.
24359
24360         * expression.cs (Unary, Binary, New): Take location argument.
24361         Update accordingly everywhere.
24362
24363         * cs-parser.jay : Update all calls to the above to take a location
24364         argument.
24365
24366         * class.cs : Ditto.
24367
24368 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24369
24370         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24371         (Invocation::BetterConversion): Same here
24372         (Invocation::ConversionExists): Ditto.
24373
24374         (Invocation::ConversionExists): Implement.
24375
24376 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24377
24378         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24379         Also take an additional TypeContainer argument.
24380
24381         * All over : Pass in TypeContainer as argument to OverloadResolve.
24382
24383         * typemanager.cs (CSharpName): Update to check for the string type and return
24384         that too.
24385
24386         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24387         a given method.
24388
24389 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24390
24391         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24392         (Invocation::BetterFunction): Implement.
24393         (Invocation::BetterConversion): Implement.
24394         (Invocation::ConversionExists): Skeleton, no implementation yet.
24395
24396         Okay, things work fine !
24397
24398 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24399
24400         * typemanager.cs: declare and load enum_type, delegate_type and
24401         void_type. 
24402
24403         * expression.cs (Expression::Emit): Now emit returns a value that
24404         tells whether a value is left on the stack or not.  This strategy
24405         might be reveted tomorrow with a mechanism that would address
24406         multiple assignments.
24407         (Expression::report118): Utility routine to report mismatches on
24408         the ExprClass.
24409
24410         (Unary::Report23): Report impossible type/operator combination
24411         utility function.
24412
24413         (Unary::IsIncrementableNumber): Whether the type can be
24414         incremented or decremented with add.
24415         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24416         complemented. 
24417         (Unary::ResolveOperator): Implement ++, !, ~,
24418
24419         (Invocation::Emit): Deal with new Emit convetion.
24420
24421         * All Expression derivatives: Updated their Emit method to return
24422         whether they leave values on the stack or not.
24423
24424         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24425         stack for expressions that are statements. 
24426
24427 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24428
24429         * expression.cs (LValue): New interface.  Must be implemented by
24430         LValue objects.
24431         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24432         LValue interface.
24433
24434         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24435         interface for generating code, simplifies the code.
24436
24437 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24438
24439         * expression.cs (everywhere): Comment out return statements in ::Resolve
24440         methods to avoid the warnings.
24441
24442 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24443
24444         * driver.cs (parse): Report error 2001 if we can not open the
24445         source file.
24446
24447         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24448         not resolve it.
24449
24450         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24451         object. 
24452
24453         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24454         otherwise nested blocks end up with the same index.
24455
24456         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24457
24458         * expression.cs:  Instead of having FIXMEs in the Resolve
24459         functions, throw exceptions so it is obvious that we are facing a
24460         bug. 
24461
24462         * cs-parser.jay (invocation_expression): Pass Location information.
24463
24464         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24465         Use a basename for those routines because .NET does not like paths
24466         on them. 
24467
24468         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24469         already defined.
24470
24471 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24472
24473         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24474         are loading the correct data types (throws an exception if not).
24475         (TypeManager::InitCoreTypes): Use CoreLookupType
24476
24477         * expression.cs (Unary::ResolveOperator): return the child
24478         expression for expressions which are just +expr.
24479         (Unary::ResolveOperator): Return negative literals for -LITERAL
24480         expressions (otherwise they are Unary {Literal}).
24481         (Invocation::Badness): Take into account `Implicit constant
24482         expression conversions'.
24483
24484         * literal.cs (LongLiteral): Implement long literal class.
24485         (IntLiteral): export the `Value' of the intliteral. 
24486
24487 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24488
24489         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24490
24491         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24492         instead of 'Operator'
24493
24494         * expression.cs (Binary::ResolveOperator): Update accordingly.
24495         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24496         and 'Minus'
24497
24498         * cs-parser.jay (unary_expression): Update to use the new names.
24499
24500         * gen-treedump.cs (GetUnary): Same here.
24501
24502         * expression.cs (Unary::Resolve): Implement.
24503         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24504         operators are found instead of making noise ;-)
24505         (Unary::ResolveOperator): New method to do precisely the same thing which
24506         Binary::ResolveOperator does for Binary expressions.
24507         (Unary.method, .Arguments): Add.
24508         (Unary::OperName): Implement.   
24509         (Unary::ForceConversion): Copy and Paste !
24510
24511         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24512         a unary operator.
24513
24514         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24515         for the inbuilt operators. Only overloading works for now ;-)
24516
24517 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24518
24519         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24520         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24521
24522         * expression.cs (This::Emit): Implement. 
24523         (This::Resolve): Implement.
24524         (TypeOf:Resolve): Implement.
24525         (Expression::ResolveSimpleName): Add an implicit this to instance
24526         field references. 
24527         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24528         Bind instance variable to Field expressions.
24529         (FieldExpr::Instance): New field used to track the expression that
24530         represents the object instance.
24531         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24532         binding 
24533         (FieldExpr::Emit): Implement.
24534
24535         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24536         the last instruction contains a return opcode to avoid generating
24537         the last `ret' instruction (this generates correct code, and it is
24538         nice to pass the peverify output).
24539
24540         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24541         initializer for static and instance variables.
24542         (Constructor::Emit): Allow initializer to be null in the case of
24543         static constructors.  Only emit initializer for instance
24544         constructors. 
24545
24546         (TypeContainer::FindMembers): Return a null array if there are no
24547         matches.
24548
24549         Also fix the code for the MemberTypes.Method branch, as it was not
24550         scanning that for operators (or tried to access null variables before).
24551
24552         * assign.cs (Assign::Emit): Handle instance and static fields. 
24553
24554         * TODO: Updated.
24555
24556         * driver.cs: Stop compilation if there are parse errors.
24557
24558         * cs-parser.jay (constructor_declaration): Provide default base
24559         initializer for non-static constructors.
24560         (constructor_declarator): Do not provide a default base
24561         initializers if none was specified.
24562         Catch the fact that constructors should not have parameters.
24563
24564         * class.cs: Do not emit parent class initializers for static
24565         constructors, that should be flagged as an error.
24566
24567 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24568
24569         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24570         Move back code into TypeContainer::Populate.
24571
24572 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24573
24574         * class.cs (TypeContainer::AddConstructor): Fix the check to
24575         compare against Name, not Basename. 
24576         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24577
24578         * cs-parser.jay : Update accordingly.
24579
24580         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24581         for methods, don't forget to look into the operators too.
24582         (RegisterMethodBuilder): Helper method to take care of this for
24583         methods, constructors and operators.
24584         (Operator::Define): Completely revamp.
24585         (Operator.OperatorMethod, MethodName): New fields.
24586         (TypeContainer::Populate): Move the registering of builders into
24587         RegisterMethodBuilder.
24588         (Operator::Emit): Re-write.
24589
24590         * expression.cs (Binary::Emit): Comment out code path to emit method
24591         invocation stuff for the case when we have a user defined operator. I am
24592         just not able to get it right !
24593
24594 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24595
24596         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24597         argument. 
24598
24599         (Expression::MemberLookup): Provide a version that allows to
24600         specify the MemberTypes and BindingFlags. 
24601
24602         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24603         so it was not fetching variable information from outer blocks.
24604
24605         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24606         Beforefieldinit as it was buggy.
24607
24608         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24609         that Ravi put here.  
24610
24611         * class.cs (Constructor::Emit): Only emit if block is not null.
24612         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24613         deal with this by semantically definining it as if the user had
24614         done it.
24615
24616         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24617         constructors as we now "emit" them at a higher level.
24618
24619         (TypeContainer::DefineDefaultConstructor): Used to define the
24620         default constructors if none was provided.
24621
24622         (ConstructorInitializer): Add methods Resolve and Emit. 
24623
24624         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24625
24626 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24627
24628         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24629         the default constructor builder with our hashtable for methodbuilders
24630         to methodcores.
24631
24632         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24633         and argument_count is 0 in which case we have a match.
24634         (Binary::ResolveOperator): More null checking and miscellaneous coding
24635         style cleanup.
24636
24637 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24638
24639         * rootcontext.cs (IsNameSpace): Compare against null.
24640
24641         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24642
24643         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24644         and Unary::Operator.
24645
24646         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24647         accordingly.
24648
24649         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24650         we have overloaded operators.
24651         (Binary::ResolveOperator): Implement the part which does the operator overload
24652         resolution.
24653
24654         * class.cs (Operator::Emit): Implement.
24655         (TypeContainer::Emit): Emit the operators we have too.
24656
24657         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24658         the case when we have a user-defined operator.
24659
24660 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24661
24662         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24663
24664 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24665
24666         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24667         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24668         (Constructor::Emit): Implement.
24669         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24670         if we have no work to do. 
24671         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24672         Emit method.
24673
24674         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24675         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24676
24677         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24678         of parent.parent.
24679
24680 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24681
24682         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24683         in the source.
24684         (Tree::RecordNamespace): Method to do what the name says ;-)
24685         (Tree::Namespaces): Property to get at the namespaces hashtable.
24686
24687         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24688         keep track.
24689
24690         * rootcontext.cs (IsNamespace): Fixed it :-)
24691
24692 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24693
24694         * class.cs (TypeContainer::FindMembers): Add support for
24695         constructors. 
24696         (MethodCore): New class that encapsulates both the shared aspects
24697         of a Constructor and a Method.  
24698         (Method, Constructor): Factored pieces into MethodCore.
24699
24700         * driver.cs: Added --fatal which makes errors throw exceptions.
24701         Load System assembly as well as part of the standard library.
24702
24703         * report.cs: Allow throwing exceptions on errors for debugging.
24704
24705         * modifiers.cs: Do not use `parent', instead use the real type
24706         container to evaluate permission settings.
24707
24708         * class.cs: Put Ravi's patch back in.  He is right, and we will
24709         have to cope with the
24710
24711 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24712
24713         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24714         FamORAssem, not FamANDAssem.
24715
24716 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24717
24718         * driver.cs: Added --parse option that only parses its input files
24719         and terminates.
24720
24721         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24722         incorrect.  IsTopLevel is not used to tell whether an object is
24723         root_types or not (that can be achieved by testing this ==
24724         root_types).  But to see if this is a top-level *class* (not
24725         necessarly our "toplevel" container). 
24726
24727 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24728
24729         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24730         parent instead of a direct call to GetType.
24731
24732 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24733
24734         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24735         Modifiers.TypeAttr. This should just be a call to that method.
24736
24737         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24738         object so that we can determine if we are top-level or not.
24739
24740         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24741         TypeContainer too.
24742
24743         * enum.cs (Enum::Define): Ditto.
24744
24745         * modifiers.cs (FieldAttr): Re-write.
24746
24747         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24748         (TypeContainer::HaveStaticConstructor): New property to provide access
24749         to precisely that info.
24750
24751         * modifiers.cs (MethodAttr): Re-write.
24752         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24753
24754         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24755         of top-level types as claimed.
24756
24757 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24758
24759         * expression.cs (MemberLookup): Fruitless attempt to lookup
24760         constructors.  Maybe I need to emit default constructors?  That
24761         might be it (currently .NET emits this for me automatically).
24762         (Invocation::OverloadResolve): Cope with Arguments == null.
24763         (Invocation::EmitArguments): new function, shared by the new
24764         constructor and us.
24765         (Invocation::Emit): Handle static and instance methods.  Emit
24766         proper call instruction for virtual or non-virtual invocations.
24767         (New::Emit): Implement.
24768         (New::Resolve): Implement.
24769         (MemberAccess:Resolve): Implement.
24770         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24771         to track instances.
24772         (FieldExpr::Resolve): Set type.
24773
24774         * support.cs: Handle empty arguments.
24775                 
24776         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24777         SimpleLookup): Auxiliary routines to help parse a qualifier
24778         identifier.  
24779
24780         Update qualifier_identifier rule.
24781
24782         * codegen.cs: Removed debugging messages.
24783
24784         * class.cs: Make this a global thing, this acts just as a "key" to
24785         objects that we might have around.
24786
24787         (Populate): Only initialize method_builders_to_methods once.
24788
24789         * expression.cs (PropertyExpr): Initialize type from the
24790         PropertyType. 
24791
24792         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24793         Resolve pattern.  Attempt to implicitly convert value to boolean.
24794         Emit code.
24795
24796         * expression.cs: Set the type for the int32/int32 argument case.
24797         (Binary::ResolveOperator): Set the return type to boolean for
24798         comparission operators
24799
24800         * typemanager.cs: Remove debugging print code.
24801
24802         (Invocation::Resolve): resolve type.
24803
24804         * class.cs: Allocate a MemberInfo of the correct size, as the code
24805         elsewhere depends on the test to reflect the correct contents.
24806
24807         (Method::) Keep track of parameters, due to System.Reflection holes
24808
24809         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24810         mapping here.
24811
24812         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24813         of the exact size and return that.
24814
24815         (Class::LookupMethodByBuilder): New function that maps
24816         MethodBuilders to its methods.  Required to locate the information
24817         on methods because System.Reflection bit us again.
24818
24819         * support.cs: New file, contains an interface ParameterData and
24820         two implementations: ReflectionParameters and InternalParameters
24821         used to access Parameter information.  We will need to grow this
24822         as required.
24823
24824         * expression.cs (Invocation::GetParameterData): implement a cache
24825         and a wrapper around the ParameterData creation for methods. 
24826         (Invocation::OverloadResolve): Use new code.
24827
24828 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24829
24830         * class.cs (TypeContainer::EmitField): Remove and move into 
24831         (Field::Define): here and modify accordingly.
24832         (Field.FieldBuilder): New member.
24833         (TypeContainer::Populate): Update accordingly.
24834         (TypeContainer::FindMembers): Implement.
24835
24836 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24837
24838         * statement.cs: (VariableInfo::VariableType): New field to be
24839         initialized with the full type once it is resolved. 
24840
24841 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24842
24843         * parameter.cs (GetParameterInfo): Use a type cache to compute
24844         things only once, and to reuse this information
24845
24846         * expression.cs (LocalVariableReference::Emit): Implement.
24847         (OpcodeCast::Emit): fix.
24848
24849         (ParameterReference::Resolve): Implement.
24850         (ParameterReference::Emit): Implement.
24851
24852         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24853         that are expressions need to stay as Expressions.
24854
24855         * typemanager.cs (CSharpName): Returns the C# name of a type if
24856         possible. 
24857
24858         * expression.cs (Expression::ConvertImplicit): New function that
24859         implements implicit type conversions.
24860
24861         (Expression::ImplicitReferenceConversion): Implements implicit
24862         reference conversions.
24863
24864         (EmptyCast): New type for transparent casts.
24865
24866         (OpcodeCast): New type for casts of types that are performed with
24867         a sequence of bytecodes.
24868
24869         (BoxedCast): New type used for casting value types into reference
24870         types.  Emits a box opcode.
24871
24872         (Binary::DoNumericPromotions): Implements numeric promotions of
24873         and computation of the Binary::Type.
24874
24875         (Binary::EmitBranchable): Optimization.
24876
24877         (Binary::Emit): Implement code emission for expressions.
24878
24879         * typemanager.cs (TypeManager): Added two new core types: sbyte
24880         and byte.
24881
24882 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24883
24884         * class.cs (TypeContainer::FindMembers): Method which does exactly
24885         what Type.FindMembers does, only we don't have to use reflection. No
24886         implementation yet.
24887
24888         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24889         typecontainer objects as we need to get at them.
24890         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24891
24892         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24893         typecontainer object.
24894
24895         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24896         of just a Report object.
24897
24898 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24899
24900         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24901         "remove_"
24902         (TypeContainer::Populate): Now define the delegates of the type too.
24903         (TypeContainer.Delegates): Property to access the list of delegates defined
24904         in the type.
24905
24906         * delegates.cs (Delegate::Define): Implement partially.
24907
24908         * modifiers.cs (TypeAttr): Handle more flags.
24909
24910 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24911
24912         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24913         and not <=
24914         (Operator::Define): Re-write logic to get types by using the LookupType method
24915         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24916         (Indexer::Define): Ditto.
24917         (Event::Define): Ditto.
24918         (Property::Define): Ditto.
24919
24920 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24921
24922         * class.cs (TypeContainer::Populate): Now define operators too. 
24923         (TypeContainer.Operators): New property to access the list of operators
24924         in a type.
24925         (Operator.OperatorMethodBuilder): New member to hold the method builder
24926         for the operator we are defining.
24927         (Operator::Define): Implement.
24928
24929 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24930
24931         * class.cs (Event::Define): Make the prefixes of the accessor methods
24932         addOn_ and removeOn_ 
24933
24934         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24935         of the location being passed in too. Ideally, this should go later since all
24936         error reporting should be done through the Report object.
24937
24938         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24939         (Populate): Iterate thru the indexers we have and define them too.
24940         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24941         for the get and set accessors.
24942         (Indexer::Define): Implement.
24943
24944 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24945
24946         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24947         my previous implementation, did not work.
24948
24949         * typemanager.cs: Add a couple of missing types (the longs).
24950
24951         * literal.cs: Use TypeManager.bool_type instead of getting it.
24952
24953         * expression.cs (EventExpr): New kind of expressions.
24954         (Expressio::ExprClassFromMemberInfo): finish
24955
24956 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24957
24958         * assign.cs: Emit stores to static fields differently.
24959
24960 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24961
24962         * Merge in changes and adjust code to tackle conflicts. Backed out my
24963         code in Assign::Resolve ;-) 
24964
24965 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24966
24967         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24968         instead Report.Error and also pass in the location.
24969         (CSharpParser::Lexer): New readonly property to return the reference
24970         to the Tokenizer object.
24971         (declare_local_variables): Use Report.Error with location instead of plain 
24972         old error.
24973         (CheckDef): Ditto.
24974
24975         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24976         (Operator.CheckBinaryOperator): Ditto.
24977
24978         * cs-parser.jay (operator_declarator): Update accordingly.
24979
24980         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24981         (CheckBinaryOperator): Same here.
24982
24983         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24984         on the name without any prefixes of namespace names etc. This is because we
24985         already might have something already fully qualified like 
24986         'System.Console.WriteLine'
24987
24988         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24989
24990 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24991
24992         * cs-tokenizer.cs (location): Return a string which also contains
24993         the file name.
24994
24995         * expression.cs (ElementAccess): New class for expressions of the
24996         type 'element access.'
24997         (BaseAccess): New class for expressions of the type 'base access.'
24998         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24999         respectively.
25000
25001         * cs-parser.jay (element_access): Implement action.
25002         (base_access): Implement actions.
25003         (checked_expression, unchecked_expression): Implement.
25004
25005         * cs-parser.jay (local_variable_type): Correct and implement.
25006         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25007
25008         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25009
25010         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25011         name and the specifiers.
25012
25013         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25014
25015         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25016         making them all public ;-)
25017
25018         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25019         class anyways.
25020
25021 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25022
25023         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25024         PropertyExprs.
25025         (FieldExpr, PropertyExprs): New resolved expressions.
25026         (SimpleName::MemberStaticCheck): Perform static checks for access
25027         to non-static fields on static methods. Maybe this should be
25028         generalized for MemberAccesses. 
25029         (SimpleName::ResolveSimpleName): More work on simple name
25030         resolution. 
25031
25032         * cs-parser.jay (primary_expression/qualified_identifier): track
25033         the parameter index.
25034
25035         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25036         (EmitContext::EmitBoolExpression): Chain to expression generation
25037         instead of temporary hack.
25038         (::EmitStatementExpression): Put generic expression code generation.
25039
25040         * assign.cs (Assign::Emit): Implement variable assignments to
25041         local variables, parameters and fields.
25042
25043 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25044
25045         * statement.cs (Block::GetVariableInfo): New method, returns the
25046         VariableInfo for a variable name in a block.
25047         (Block::GetVariableType): Implement in terms of GetVariableInfo
25048
25049         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25050         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25051
25052 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25053
25054         * cs-parser.jay (operator_declaration): Continue on my quest : update
25055         to take attributes argument.
25056         (event_declaration): Ditto.
25057         (enum_declaration): Ditto.
25058         (indexer_declaration): Ditto.
25059
25060         * class.cs (Operator::Operator): Update constructor accordingly.
25061         (Event::Event): Ditto.
25062
25063         * delegate.cs (Delegate::Delegate): Same here.
25064
25065         * enum.cs (Enum::Enum): Same here.
25066
25067 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25068
25069         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25070
25071         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25072
25073         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25074         being passed around as an arraylist.
25075         (Attributes::AddAttribute): Method to add attribute sections.
25076
25077         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25078         (struct_declaration): Update accordingly.
25079         (constant_declaration): Update.
25080         (field_declaration): Update.
25081         (method_header): Update.
25082         (fixed_parameter): Update.
25083         (parameter_array): Ditto.
25084         (property_declaration): Ditto.
25085         (destructor_declaration): Ditto.
25086
25087         * class.cs (Struct::Struct): Update constructors accordingly.
25088         (Class::Class): Ditto.
25089         (Field::Field): Ditto.
25090         (Method::Method): Ditto.
25091         (Property::Property): Ditto.
25092         (TypeContainer::OptAttribute): update property's return type.
25093
25094         * interface.cs (Interface.opt_attributes): New member.
25095         (Interface::Interface): Update to take the extra Attributes argument.
25096
25097         * parameter.cs (Parameter::Parameter): Ditto.
25098
25099         * constant.cs (Constant::Constant): Ditto.
25100
25101         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25102         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25103         the attributes as a parameter.
25104         (InterfaceProperty): Update constructor call.
25105         (InterfaceEvent): Ditto.
25106         (InterfaceMethod): Ditto.
25107         (InterfaceIndexer): Ditto.
25108
25109         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25110         pass the attributes too.
25111         (interface_event_declaration): Ditto.
25112         (interface_property_declaration): Ditto.
25113         (interface_method_declaration): Ditto.
25114         (interface_declaration): Ditto.
25115
25116 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25117
25118         * class.cs (Method::Define): Track the "static Main" definition to
25119         create an entry point. 
25120
25121         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25122         EntryPoint if we find it. 
25123
25124         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25125         (EmitContext::ig): Make this variable public.
25126
25127         * driver.cs: Make the default output file be the first file name
25128         with the .exe extension.  
25129
25130         Detect empty compilations
25131
25132         Handle various kinds of output targets.  Handle --target and
25133         rename -t to --dumper.
25134
25135         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25136         methods inherited from Expression return now an Expression.  This
25137         will is used during the tree rewriting as we resolve them during
25138         semantic analysis.
25139
25140         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25141         the spec.  Missing entirely is the information about
25142         accessability of elements of it.
25143
25144         (Expression::ExprClassFromMemberInfo): New constructor for
25145         Expressions that creates a fully initialized Expression based on
25146         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25147         a Type.
25148
25149         (Invocation::Resolve): Begin implementing resolution of invocations.
25150
25151         * literal.cs (StringLiteral):  Implement Emit.
25152
25153 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25154
25155         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25156         member.
25157
25158 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25159
25160         * cs-parser.jay (attribute_arguments): Implement actions.
25161         (attribute): Fix bug in production. Implement action.
25162         (attribute_list): Implement.
25163         (attribute_target): Implement.
25164         (attribute_target_specifier, opt_target_specifier): Implement
25165         (CheckAttributeTarget): New method to check if the attribute target
25166         is valid.
25167         (attribute_section): Implement.
25168         (opt_attributes): Implement.
25169
25170         * attribute.cs : New file to handle attributes.
25171         (Attribute): Class to hold attribute info.
25172
25173         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25174         (attribute_section): Modify production to use 2 different rules to 
25175         achieve the same thing. 1 s/r conflict down !
25176         Clean out commented, useless, non-reducing dimension_separator rules.
25177
25178         * class.cs (TypeContainer.attributes): New member to hold list
25179         of attributes for a type.
25180         (Struct::Struct): Modify to take one more argument, the attribute list.
25181         (Class::Class): Ditto.
25182         (Field::Field): Ditto.
25183         (Method::Method): Ditto.
25184         (Property::Property): Ditto.
25185
25186         * cs-parser.jay (struct_declaration): Update constructor call to
25187         pass in the attributes too.
25188         (class_declaration): Ditto.
25189         (constant_declaration): Ditto.
25190         (field_declaration): Ditto.
25191         (method_header): Ditto.
25192         (fixed_parameter): Ditto.
25193         (parameter_array): Ditto.
25194         (property_declaration): Ditto.
25195
25196         * constant.cs (Constant::Constant): Update constructor similarly.
25197         Use System.Collections.
25198
25199         * parameter.cs (Parameter::Parameter): Update as above.
25200
25201 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25202
25203         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25204         (TypeContainer.delegates): New member to hold list of delegates.
25205
25206         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25207         this time as I seem to be on crack ;-)
25208
25209 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25210
25211         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25212         tell whether an identifier represents a namespace.
25213
25214         * expression.cs (NamespaceExpr): A namespace expression, used only
25215         temporarly during expression resolution.
25216         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25217         utility functions to resolve names on expressions.
25218
25219 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25220
25221         * codegen.cs: Add hook for StatementExpressions. 
25222
25223         * class.cs: Fix inverted test for static flag in methods.
25224
25225 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25226
25227         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25228         to make it coincide with MS' number.
25229         (Operator::CheckBinaryOperator): Ditto.
25230
25231         * ../errors/errors.txt : Remove error numbers added earlier.
25232
25233         * ../errors/cs1019.cs : Test case for error # 1019
25234
25235         * ../errros/cs1020.cs : Test case for error # 1020
25236
25237         * cs-parser.jay : Clean out commented cruft.
25238         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25239         used anywhere - non-reducing rule.
25240         (namespace_declarations): Non-reducing rule - comment out.
25241
25242         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25243         with TypeContainer::AddEnum.
25244
25245         * delegate.cs : New file for delegate handling classes.
25246         (Delegate): Class for declaring delegates.
25247
25248         * makefile : Update.
25249
25250         * cs-parser.jay (delegate_declaration): Implement.
25251
25252 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25253
25254         * class.cs (Event::Define): Implement.
25255         (Event.EventBuilder): New member.
25256
25257         * class.cs (TypeContainer::Populate): Update to define all enums and events
25258         we have.
25259         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25260         readonly fields for all these cases ?
25261
25262 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25263
25264         * class.cs (Property): Revamp to use the convention of making fields readonly.
25265         Accordingly modify code elsewhere.
25266
25267         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25268         the Define method of the Property class.
25269
25270         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25271         trivial bug.
25272         (TypeContainer::Populate): Update to define all the properties we have. Also
25273         define all enumerations.
25274
25275         * enum.cs (Define): Implement.
25276
25277 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25278
25279         * cs-parser.jay (overloadable_operator): The semantic value is an
25280         enum of the Operator class.
25281         (operator_declarator): Implement actions.
25282         (operator_declaration): Implement.
25283
25284         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25285         validity of definitions.
25286         (Operator::CheckBinaryOperator): Static method to check for binary operators
25287         (TypeContainer::AddOperator): New method to add an operator to a type.
25288
25289         * cs-parser.jay (indexer_declaration): Added line to actually call the
25290         AddIndexer method so it gets added ;-)
25291
25292         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25293         already taken care of by the MS compiler ?  
25294
25295 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25296
25297         * class.cs (Operator): New class for operator declarations.
25298         (Operator::OpType): Enum for the various operators.
25299
25300 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25301
25302         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25303         ostensibly handle this in semantic analysis.
25304
25305         * cs-parser.jay (general_catch_clause): Comment out
25306         (specific_catch_clauses, specific_catch_clause): Ditto.
25307         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25308         (catch_args, opt_catch_args): New productions.
25309         (catch_clause): Rewrite to use the new productions above
25310         (catch_clauses): Modify accordingly.
25311         (opt_catch_clauses): New production to use in try_statement
25312         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25313         and re-write the code in the actions to extract the specific and
25314         general catch clauses by being a little smart ;-)
25315
25316         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25317         Hooray, try and catch statements parse fine !
25318
25319 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25320
25321         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25322         string from the hashtable of variables.
25323
25324         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25325         I end up making that mistake ;-)
25326         (catch_clauses): Fixed gross error which made Key and Value of the 
25327         DictionaryEntry the same : $1 !!
25328
25329 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25330
25331         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25332
25333         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25334         when the add and remove accessors are specified. 
25335
25336 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25337
25338         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25339         information about indexer_declarator.
25340         (indexer_declarator): Implement actions.
25341         (parsing_indexer): New local boolean used to keep track of whether
25342         we are parsing indexers or properties. This is necessary because 
25343         implicit_parameters come into picture even for the get accessor in the 
25344         case of an indexer.
25345         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25346
25347         * class.cs (Indexer): New class for indexer declarations.
25348         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25349         (TypeContainer::indexers): New member to hold list of indexers for the
25350         type.
25351
25352 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25353
25354         * cs-parser.jay (add_accessor_declaration): Implement action.
25355         (remove_accessor_declaration): Implement action.
25356         (event_accessors_declaration): Implement
25357         (variable_declarators): swap statements for first rule - trivial.
25358
25359         * class.cs (Event): New class to hold information about event
25360         declarations.
25361         (TypeContainer::AddEvent): New method to add an event to a type
25362         (TypeContainer::events): New member to hold list of events.
25363
25364         * cs-parser.jay (event_declaration): Implement actions.
25365
25366 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25367
25368         * cs-parser.jay (dim_separators): Implement. Make it a string
25369         concatenating all the commas together, just as they appear.
25370         (opt_dim_separators): Modify accordingly
25371         (rank_specifiers): Update accordingly. Basically do the same
25372         thing - instead, collect the brackets here.
25373         (opt_rank_sepcifiers): Modify accordingly.
25374         (array_type): Modify to actually return the complete type string
25375         instead of ignoring the rank_specifiers.
25376         (expression_list): Implement to collect the expressions
25377         (variable_initializer): Implement. We make it a list of expressions
25378         essentially so that we can handle the array_initializer case neatly too.
25379         (variable_initializer_list): Implement.
25380         (array_initializer): Make it a list of variable_initializers
25381         (opt_array_initializer): Modify accordingly.
25382
25383         * expression.cs (New::NType): Add enumeration to help us
25384         keep track of whether we have an object/delegate creation
25385         or an array creation.
25386         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25387         members to hold data about array creation.
25388         (New:New): Modify to update NewType
25389         (New:New): New Overloaded contructor for the array creation
25390         case.
25391
25392         * cs-parser.jay (array_creation_expression): Implement to call
25393         the overloaded New constructor.
25394
25395 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25396
25397         * class.cs (TypeContainer::Constructors): Return member
25398         constructors instead of returning null.
25399
25400 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25401
25402         * typemanager.cs (InitCoreTypes): Initialize the various core
25403         types after we have populated the type manager with the user
25404         defined types (this distinction will be important later while
25405         compiling corlib.dll)
25406
25407         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25408         on Expression Classification.  Now all expressions have a method
25409         `Resolve' and a method `Emit'.
25410
25411         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25412         generation from working.     Also add some temporary debugging
25413         code. 
25414
25415 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25416
25417         * codegen.cs: Lots of code generation pieces.  This is only the
25418         beginning, will continue tomorrow with more touches of polish.  We
25419         handle the fundamentals of if, while, do, for, return.  Others are
25420         trickier and I need to start working on invocations soon.
25421
25422         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25423         s.InitStatement. 
25424
25425         * codegen.cs (EmitContext): New struct, used during code
25426         emission to keep a context.   Most of the code generation will be
25427         here. 
25428
25429         * cs-parser.jay: Add embedded blocks to the list of statements of
25430         this block.  So code generation proceeds in a top down fashion.
25431
25432 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25433
25434         * statement.cs: Add support for multiple child blocks.
25435
25436 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25437
25438         * codegen.cs (EmitCode): New function, will emit the code for a
25439         Block of code given a TypeContainer and its ILGenerator. 
25440
25441         * statement.cs (Block): Standard public readonly optimization.
25442         (Block::Block constructors): Link children. 
25443         (Block::Child): Child Linker.
25444         (Block::EmitVariables): Emits IL variable declarations.
25445
25446         * class.cs: Drop support for MethodGroups here, delay until
25447         Semantic Analysis.
25448         (Method::): Applied the same simplification that I did before, and
25449         move from Properties to public readonly fields.
25450         (Method::ParameterTypes): Returns the parameter types for the
25451         function, and implements a cache that will be useful later when I
25452         do error checking and the semantic analysis on the methods is
25453         performed.
25454         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25455         and made a method, optional argument tells whether this is a class
25456         or a structure to apply the `has-this' bit.
25457         (Method::GetCallingConvention): Implement, returns the calling
25458         convention. 
25459         (Method::Define): Defines the type, a second pass is performed
25460         later to populate the methods.
25461
25462         (Constructor::ParameterTypes): implement a cache similar to the
25463         one on Method::ParameterTypes, useful later when we do semantic
25464         analysis. 
25465
25466         (TypeContainer::EmitMethod):  New method.  Emits methods.
25467
25468         * expression.cs: Removed MethodGroup class from here.
25469
25470         * parameter.cs (Parameters::GetCallingConvention): new method.
25471
25472 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25473
25474         * class.cs (TypeContainer::Populate): Drop RootContext from the
25475         argument. 
25476
25477         (Constructor::CallingConvention): Returns the calling convention.
25478         (Constructor::ParameterTypes): Returns the constructor parameter
25479         types. 
25480
25481         (TypeContainer::AddConstructor): Keep track of default constructor
25482         and the default static constructor.
25483
25484         (Constructor::) Another class that starts using `public readonly'
25485         instead of properties. 
25486
25487         (Constructor::IsDefault): Whether this is a default constructor. 
25488
25489         (Field::) use readonly public fields instead of properties also.
25490
25491         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25492         track of static constructors;  If none is used, turn on
25493         BeforeFieldInit in the TypeAttributes. 
25494
25495         * cs-parser.jay (opt_argument_list): now the return can be null
25496         for the cases where there are no arguments. 
25497
25498         (constructor_declarator): If there is no implicit `base' or
25499         `this', then invoke the default parent constructor. 
25500
25501         * modifiers.cs (MethodAttr): New static function maps a set of
25502         modifiers flags into a MethodAttributes enum
25503         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25504         MethodAttr, TypeAttr to represent the various mappings where the
25505         modifiers are used.
25506         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25507
25508 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25509
25510         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25511         method arguments.
25512
25513         * interface.cs (PopulateIndexer): Implemented the code generator
25514         for interface indexers.
25515
25516 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25517
25518         * interface.cs (InterfaceMemberBase): Now we track the new status
25519         here.  
25520
25521         (PopulateProperty): Implement property population.  Woohoo!  Got
25522         Methods and Properties going today. 
25523
25524         Removed all the properties for interfaces, and replaced them with
25525         `public readonly' fields. 
25526
25527 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25528
25529         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25530         initialize their hashtables/arraylists only when they are needed
25531         instead of doing this always.
25532
25533         * parameter.cs: Handle refs and out parameters.
25534
25535         * cs-parser.jay: Use an ArrayList to construct the arguments
25536         instead of the ParameterCollection, and then cast that to a
25537         Parameter[] array.
25538
25539         * parameter.cs: Drop the use of ParameterCollection and use
25540         instead arrays of Parameters.
25541
25542         (GetParameterInfo): Use the Type, not the Name when resolving
25543         types. 
25544
25545 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25546
25547         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25548         and instead use public readonly fields.
25549
25550         * class.cs: Put back walking code for type containers.
25551
25552 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25553
25554         * class.cs (MakeConstant): Code to define constants.
25555
25556         * rootcontext.cs (LookupType): New function.  Used to locate types 
25557
25558
25559 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25560
25561         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25562         this System.Reflection code is.  Kudos to Microsoft
25563
25564         * typemanager.cs: Implement a type cache and avoid loading all
25565         types at boot time.  Wrap in LookupType the internals.  This made
25566         the compiler so much faster.  Wow.  I rule!
25567
25568         * driver.cs: Make sure we always load mscorlib first (for
25569         debugging purposes, nothing really important).
25570
25571         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25572         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25573
25574         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25575         on namespaces that have been imported using the `using' keyword.
25576
25577         * class.cs (TypeContainer::TypeAttr): Virtualize.
25578         (Class::TypeAttr): Return attributes suitable for this bad boy.
25579         (Struct::TypeAttr): ditto.
25580         Handle nested classes.
25581         (TypeContainer::) Remove all the type visiting code, it is now
25582         replaced with the rootcontext.cs code
25583
25584         * rootcontext.cs (GetClassBases): Added support for structs. 
25585
25586 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25587
25588         * interface.cs, statement.cs, class.cs, parameter.cs,
25589         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25590         Drop use of TypeRefs, and use strings instead.
25591
25592 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25593
25594         * rootcontext.cs: 
25595
25596         * class.cs (Struct::Struct): set the SEALED flags after
25597         checking the modifiers.
25598         (TypeContainer::TypeAttr): new property, returns the
25599         TypeAttributes for a class.  
25600
25601         * cs-parser.jay (type_list): Oops, list production was creating a
25602         new list of base types.
25603
25604         * rootcontext.cs (StdLib): New property.
25605         (GetInterfaceTypeByName): returns an interface by type name, and
25606         encapsulates error handling here.
25607         (GetInterfaces): simplified.
25608         (ResolveTree): Encapsulated all the tree resolution here.
25609         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25610         types. 
25611
25612         * driver.cs: Add support for --nostdlib, to avoid loading the
25613         default assemblies.
25614         (Main): Do not put tree resolution here. 
25615
25616         * rootcontext.cs: Beginning of the class resolution.
25617
25618 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25619
25620         * rootcontext.cs: Provide better error reporting. 
25621
25622         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25623
25624         * rootcontext.cs (CreateInterface): Handle the case where there
25625         are no parent interfaces.
25626
25627         (CloseTypes): Routine to flush types at the end.
25628         (CreateInterface): Track types.
25629         (GetInterfaces): Returns an array of Types from the list of
25630         defined interfaces.
25631
25632         * typemanager.c (AddUserType): Mechanism to track user types (puts
25633         the type on the global type hash, and allows us to close it at the
25634         end). 
25635
25636 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25637
25638         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25639         RecordInterface instead.
25640
25641         * cs-parser.jay: Updated to reflect changes above.
25642
25643         * decl.cs (Definition): Keep track of the TypeBuilder type that
25644         represents this type here.  Not sure we will use it in the long
25645         run, but wont hurt for now.
25646
25647         * driver.cs: Smaller changes to accomodate the new code.
25648
25649         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25650         when done. 
25651
25652         * rootcontext.cs (CreateInterface):  New method, used to create
25653         the System.TypeBuilder type for interfaces.
25654         (ResolveInterfaces): new entry point to resolve the interface
25655         hierarchy. 
25656         (CodeGen): Property, used to keep track of the code generator.
25657
25658 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25659
25660         * cs-parser.jay: Add a second production for delegate_declaration
25661         with `VOID'.
25662
25663         (enum_body): Put an opt_comma here instead of putting it on
25664         enum_body or enum_member_declarations so we can handle trailing
25665         commas on enumeration members.  Gets rid of a shift/reduce.
25666
25667         (type_list): Need a COMMA in the middle.
25668
25669         (indexer_declaration): Tell tokenizer to recognize get/set
25670
25671         * Remove old targets.
25672
25673         * Re-add the parser target.
25674
25675 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25676
25677         * cs-parser.jay: Add precendence rules for a number of operators
25678         ot reduce the number of shift/reduce conflicts in the grammar.
25679
25680 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25681
25682         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25683         and put it here.
25684
25685         Get rid of old crufty code.
25686
25687         * rootcontext.cs: Use this to keep track of the parsed
25688         representation and the defined types available to the program. 
25689
25690         * gen-treedump.cs: adjust for new convention.
25691
25692         * type.cs: Split out the type manager, and the assembly builder
25693         from here. 
25694
25695         * typemanager.cs: the type manager will live here now.
25696
25697         * cil-codegen.cs: And the code generator here. 
25698
25699 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25700
25701         * makefile: Fixed up for easy making.
25702
25703 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25704
25705         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25706         the 
25707
25708         (unary_expression): Expand pre_increment_expression and
25709         post_decrement_expression to reduce a shift/reduce.
25710
25711 2001-07-11  Simon Cozens
25712
25713         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25714
25715         Improve allow_keyword_as_indent name.
25716
25717 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25718
25719         * Adjustments for Beta2. 
25720
25721 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25722
25723         * decl.cs: Added `Define' abstract method.
25724         (InTransit): new property, used to catch recursive definitions. 
25725
25726         * interface.cs: Implement `Define'. 
25727
25728         * modifiers.cs: Map Modifiers.constants to
25729         System.Reflection.TypeAttribute flags.
25730
25731         * class.cs: Keep track of types and user-defined types.
25732         (BuilderInit): New method for creating an assembly
25733         (ResolveType): New function to launch the resolution process, only
25734         used by interfaces for now.
25735
25736         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25737         that are inserted into the name space. 
25738
25739 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25740
25741         * ARGH.  I have screwed up my tree so many times due to the use of
25742         rsync rather than using CVS.  Going to fix this at once. 
25743
25744         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25745         load types.
25746
25747 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25748
25749         * Experiment successful: Use System.Type rather that our own
25750         version of Type.  
25751
25752 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25753
25754         * cs-parser.jay: Removed nsAliases from here.
25755
25756         Use new namespaces, handle `using XXX;' 
25757
25758         * namespace.cs: Reimplemented namespace handling, use a recursive
25759         definition of the class.  Now we can keep track of using clauses
25760         and catch invalid using clauses.
25761
25762 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25763
25764         * gen-treedump.cs: Adapted for all the renaming.
25765
25766         * expression.cs (Expression): this class now has a Type property
25767         which returns an expression Type.
25768
25769         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25770         `Type', as this has a different meaning now in the base
25771
25772 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25773
25774         * interface.cs, class.cs: Removed from all the sources the
25775         references to signature computation, as we can not do method
25776         signature computation during the parsing time, as we are not
25777         trying to solve at that point distinguishing:
25778
25779         class X {
25780                 void a (Blah x) {}
25781                 void a (NS.Blah x) {}
25782         }
25783
25784         Which depending on the context might be valid or not, as we do not
25785         know if Blah is the same thing as NS.Blah at that point.
25786
25787         * Redid everything so the code uses TypeRefs now instead of
25788         Types.  TypeRefs are just temporary type placeholders, that need
25789         to be resolved.  They initially have a pointer to a string and the
25790         current scope in which they are used.  This is used later by the
25791         compiler to resolve the reference to an actual Type. 
25792
25793         * DeclSpace is no longer a CIR.Type, and neither are
25794         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25795         are all DeclSpaces, but no Types. 
25796
25797         * type.cs (TypeRefManager): This implements the TypeRef manager,
25798         which keeps track of all the types that need to be resolved after
25799         the parsing has finished. 
25800
25801 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25802
25803         * ARGH.  We are going to have to store `foreach' as a class rather
25804         than resolving it, as we need to verify error 1579 after name
25805         resolution.   *OR* we could keep a flag that says `This request to
25806         IEnumerator comes from a foreach statement' which we can then use
25807         to generate the error.
25808
25809 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25810
25811         * class.cs (TypeContainer.AddMethod): we now add methods to the
25812         MethodGroup instead of the method hashtable.  
25813
25814         * expression.cs: Add MethodGroup abstraction, which gets us one
25815         step closer to the specification in the way we handle method
25816         declarations.  
25817
25818         * cs-parser.jay (primary_expression): qualified_identifier now
25819         tried to match up an identifier to a local variable reference or
25820         to a parameter reference.
25821
25822         current_local_parameters is now a parser global variable that
25823         points to the current parameters for the block, used during name
25824         lookup.
25825
25826         (property_declaration): Now creates an implicit `value' argument to
25827         the set accessor.
25828
25829 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25830
25831         * parameter.cs: Do not use `param' arguments as part of the
25832         signature, per the spec.
25833
25834 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25835
25836         * decl.cs: Base class for classes, structs and interfaces.  This
25837         is the "Declaration Space" 
25838
25839         * cs-parser.jay: Use CheckDef for checking declaration errors
25840         instead of having one on each function.
25841
25842         * class.cs: Factor out some code for handling error handling in
25843         accordance to the "Declarations" section in the "Basic Concepts"
25844         chapter in the ECMA C# spec.
25845
25846         * interface.cs: Make all interface member classes derive from
25847         InterfaceMemberBase.
25848
25849 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25850
25851         * Many things: all interfaces are parsed and generated in
25852         gen-treedump.  Support for member variables, constructors,
25853         destructors, properties, constants is there.
25854
25855         Beginning of the IL backend, but very little done, just there for
25856         testing purposes. 
25857
25858 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25859
25860         * cs-parser.jay: Fix labeled statement.
25861
25862         * cs-tokenizer.cs (escape): Escape " and ' always.
25863         ref_line, ref_name: keep track of the line/filename as instructed
25864         by #line by the compiler.
25865         Parse #line.
25866
25867 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25868
25869         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25870         to match the values in System.CodeDOM.
25871
25872         Divid renamed to Divide.
25873
25874         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25875         statements. 
25876         (Statements.set): remove.
25877
25878         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25879         statements. 
25880
25881         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25882         falseStatements always have valid values. 
25883
25884         * cs-parser.jay: Use System.CodeDOM now.
25885