* mcs/flowanalysis.cs (Reachability): Make 4-argument constructor private.
[mono.git] / mcs / gmcs / ChangeLog
1 2006-04-30  Raja R Harinath  <harinath@gmail.com>
2
3         * flowanalysis.cs (Reachability): Make 4-argument constructor
4         private.
5         (Reachability.Meet): Rename from 'And'.  Remove static variant.
6         (Reachability.Always): Rename from the highly misleading
7         'Reachability.Never'.
8         (FlowBranching.Merge): Update to changes.  Mark an impossible
9         situation with a 'throw'.
10         (*): Update to changes.
11
12 2006-04-29  Raja R Harinath  <harinath@gmail.com>
13
14         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
15         Remove 'Undefined'.
16         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
17         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
18         (*): Update to changes.
19         * statement.cs: Update to changes.
20
21 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
22
23         A fix for #78049
24         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
25
26 2006-04-28  Raja R Harinath  <harinath@gmail.com>
27
28         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
29         dummy UsageVector.
30
31         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
32         argument to two arguments: an usage-vector and a bool.  Move call
33         to FlowBranching.Merge () ...
34         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
35
36         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
37         handling of loop and switch reachability to ...
38         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
39
40 2006-04-27  Raja R Harinath  <harinath@gmail.com>
41
42         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
43         handling to FlowBranchingLoop.InLoop.
44         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
45
46 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
47
48         A fix for #78115
49         anonymous.cs.cs (AnonymousMethod.DoResolve): Moved the check whether
50         anonymous method  is allowed from AnonymousContainer here.
51
52         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
53
54 2006-04-24  Raja R Harinath  <rharinath@novell.com>
55
56         Fix #78156
57         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
58
59 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
60
61         A fix for #49011.
62         constant.cs (FloatConstant.Reduce): Add range checking for checked context.
63         (DoubleConstant.Reduce): Ditto.
64
65 2006-04-23  Raja R Harinath  <rharinath@novell.com>
66
67         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
68         Remove 'lvalue_right_side' argument.  Move parts to ...
69         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
70         (LocalVariable.DoResolveLValue): ... these.
71
72 2006-04-21  Raja R Harinath  <rharinath@novell.com>
73
74         Fix cs1655.cs
75         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
76         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
77         (LocalVariableReference.DoResolveBase): Use it to implement new
78         CS1655 check.
79         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
80         (Argument.Resolve): Simplify.  Move CS1510 check ...
81         * ecore.cs (Expression.ResolveLValue): ... here.
82         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
83         (PropertyExpr.DoResolveLValue): Likewise.
84         (FieldExpr.Report_AssignToReadonly): Likewise.
85         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
86         LValueMemberAccess or LValueMemberOutAccess on instance depending
87         on it.
88         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
89         DoResolve as appropriate.
90
91 2006-04-20  Raja R Harinath  <rharinath@novell.com>
92
93         Fix #75800
94         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
95         implicit conversions on 'out' and 'ref' arguments.
96
97         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
98         improve clarity.  Remove dead code.
99
100         Fix #66031
101         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
102         (Catch.Resolve): Resolve VarBlock if it exists.
103
104 2006-04-19  Miguel de Icaza  <miguel@novell.com>
105
106         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
107         twice, this was some residual code, the enumerator was emitted
108         properly in the two branche of if later.
109
110         Fixes #78031
111         
112         Thanks to Martin for finding the source of the problem
113         
114 2006-04-19  Raja R Harinath  <rharinath@novell.com>
115
116         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
117         cast is never an lvalue.
118         (Cast.DoResolve, Cast.ResolveRest): Combine.
119         (Argument.Emit): Simplify slightly.  Move 'Expr is
120         IMemoryLocation' check ...
121         (Argument.Resolve): ... here.
122         (Argument.Error_LValueRequired): Remove.  Inline into only user.
123
124         Simplifications.  Fix cs0191-2.cs
125         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
126         CS1649 and CS1651 to ...
127         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
128         the actual selection of the error code and message to a lookup
129         table.  Add a dummy return value to simplify callsites.
130         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
131         readonly fields of other instances of the same type.  Move CS0197
132         warning from ...
133         * expression.cs (Argument.Resolve): ... here.  Simplify code.
134         Ensure that ec.InRefOutArgumentResolving is only set during LValue
135         resolution of an out or ref argument.  The code simplification
136         above uses this invariant.
137
138 2006-04-18  Raja R Harinath  <rharinath@novell.com>
139
140         Possibly fix #77752.  Fix cs1690-[4-7].cs.
141         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
142         CheckMarshallByRefAccess.  Drop parameter.
143         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
144         warning.
145         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
146         InstanceExpression.
147         * report.cs (AllWarnings): Add CS1690.
148         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
149         for ref access too.
150         (LocalVariableReference.DoResolveBase): Update.
151
152 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
153
154         class.cs (MethodOrOperator): Moved common parts from method class.
155         detect obsolete attributes.
156         (Method.Define): Simplified as it reuses code from base.
157         (Constructor.ValidAttributeTargets): Fixed issue found during
158         refactoring.
159         (Destructor.ValidAttributeTargets): Fixed issue found during
160         refactoring.
161         (Operator): Finished refactoring set off by #78020. Operator class is now
162         ordinary method class.
163
164         * anonymous.cs: Updated.
165
166 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
167
168         (Constructor.Emit): Don't emit the attributes twice.
169
170 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
171
172         class.cs (Operator.Emit): Extracted code from MethodData to correctly
173         detect obsolete attributes.
174         (Method.CreateEmitContext): Moved to MethodOrOperator.
175
176 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
177
178         A fix for #78048.
179         class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
180         customized exception to make crash detection easier.
181         (MethodOrOperator): Started to work on new base class for methods and
182         operators.
183         (Method): Derives from MethodOrOperator.
184         (Constructor.Emit): Emits its own attributes.
185         (AbstractPropertyEventMethod.Emit): Ditto.
186         (Operator): Derives from MethodOrOperator, will refactor fully in extra
187         patch.
188         (Operator.Emit): It's temporary more tricky than should be.
189         
190         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
191
192         * report.cs (InternalErrorException): Add ctor with inner exception.
193
194 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
195
196         A fix for #76744.
197         ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
198         only not visible.
199
200 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
201
202         A fix for #77916.
203         expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
204         array.
205
206 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
207
208         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
209         attribute is present and Guid not.
210         (Interface.ApplyAttributeBuilder): Ditto.
211
212         * attribute.cs: Add error message.
213
214 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
215
216         A fix for #78020.
217
218         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
219         sources (it's composite) so hold them in extra array as they are used in
220         Emit phase only. It worked in the previous versions by mistake.
221         (Attribute.Emit): Emit attribute for more owners when exist.
222
223         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
224         it has now different behaviour.
225
226 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
227
228         * constant.cs (Constant.IsDefaultInitializer): New method.
229
230         * class.cs: Updated.
231
232         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
233         re-initialize default values. It saves KBs almost for every assembly.
234         Thanks Zoltan for the idea.
235         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
236         (ArrayCreation.DoResolve): Resolve only once.
237         (ArrayCreation.Emit): Emit static initializer only when it is faster.
238         (ArrayCreation.GetAttributableValue): Cope with optimized values.
239
240 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
241
242         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
243         From #77961.
244
245 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
246
247         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
248         in an embedded statement too.
249
250 2006-04-01  Raja R Harinath  <rharinath@novell.com>
251
252         Fix #77929
253         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
254         testing.
255
256         Fix #77958
257         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
258
259         Fix #77962
260         * report.cs (SymbolRelatedToPreviousError): Drop generic type
261         arguments before checking whether a type is reflected or not.
262
263         Fix #77954
264         * expression.cs (Invocation.IsApplicable): Ensure a generic method
265         definition doesn't take part in overload resolution.
266         (Invocation.IsParamsMethodApplicable): Likewise.
267         (Invocation.OverloadResolve): When replacing a reflected override
268         method with its base definition, ensure that type arguments are
269         applied.
270
271 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
272
273         A fix for #77966.
274
275         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
276         was not specified.
277
278         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
279
280 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
281
282         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
283         phase.
284
285         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
286         LocalTemporary change.
287
288         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
289         TypeContainer.
290         (ClassOrStruct.DefineFieldInitializers): Implemented static field
291         initializers optimization.
292         (ClassOrStruct.TypeAttr): Moved from modifiers.
293         (Constructor.CheckBase): Don't crash when static ctor has parameters.
294         (FieldBase.ResolveInitializer): Resolves initializer.
295         (FieldBase.HasDefaultInitializer): New property.
296
297         * cs-parser.jay: Removed message.
298
299         * expression.cs (CompilerGeneratedThis): New specialization.
300
301         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
302
303 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
304
305         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
306
307 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
308
309         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
310         be now EnumConstants only.
311
312 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
313
314         * attribute.cs, driver.cs: Reset more caches.
315
316 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
317
318         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
319
320 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
321
322         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
323         for easier reuse. Updated all overrides.
324         (IntegralConstant): New base class for all integral constants.
325         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
326         of the constant range, report custom error.
327         (UIntConstant.Reduce): Fixed uint conversion.
328
329         * ecore.cs, literal.cs: Reduce updates.
330
331 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
332
333         A fix for #75813.
334
335         * class.cs (Constructor.Define): Removed extra if for default ctors.
336         A patch from Atsushi Enomoto.
337
338 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
339
340         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
341         GetAttributableValue.
342
343         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
344         when required.
345
346         * convert.cs (ImplicitConversionRequired): Error message moved to
347         DoubleLiteral.
348
349         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
350         automatic implicit conversion of an output value.
351         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
352
353         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
354         conversion.
355         (TypeOf.GetAttributableValue): Add extra handling for object type.
356
357         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
358         special error message.
359
360 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
361
362         * class.cs (Constructor.Emit): Don't crash when struct ctor is
363         InternalCall.
364         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
365         compatible with MS runtime.
366
367 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
368
369         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
370         attribute arguments here.
371
372         * class.cs (Indexer.Define): The check was moved to attribute class.
373
374 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
375
376         * expression.cs (StringConcat.Append): Reverted back to no warning state.
377
378 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
379
380         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
381
382         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
383         the blocks too.
384
385 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
386
387         * doc-bootstrap.cs : fix build.
388
389 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
390
391         * expression.cs (StringConcat.Append): Issue a warning when empty string
392         is going to append.
393
394 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
395
396         * assign.cs (CompoundAssign.ResolveSource): Removed.
397
398         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
399         clean up.
400
401         * class.cs (TypeContainer.FindMethods): Removed.
402         (TypeContainer.CheckMemberUsage): Made static.
403
404         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
405
406         * constant.cs (CheckRange): Removed unused type argument.
407         (CheckUnsigned): Removed unused type argument.
408
409         * cs-parser.jay: Updated after MemberAccess clean up.
410         Uses Length for empty string test.
411
412         * cs-tokenizer.cs: Uses Length for empty string test.
413         (IsCastToken): Made static.
414         (is_hex): Made static.
415         (real_type_suffix): Made static.
416
417         * decl.cs (SetupCache): Made static.
418         (OnGenerateDocComment): Removed unused ds argument.
419
420         * delegate.cs (VerifyDelegate): Removed unused argument.
421
422         * doc.cs: Uses Length for empty string test.
423
424         * driver.cs: Uses Length for empty string test.
425
426         * enum.cs (IsValidEnumType): Made static
427
428         * expression.cs (EnumLiftUp): Removed unused argument.
429         (ResolveMethodGroup): Ditto.
430         (BetterConversion): Ditto.
431         (GetVarargsTypes): Ditto.
432         (UpdateIndices): Ditto.
433         (ValidateInitializers): Ditto.
434         (MemberAccess.ctor): Ditto.
435         (GetIndexersForType): Ditto.
436
437         * flowanalysis.cs: (MergeFinally): Removed unused argument.
438
439         * iterators.cs: Updated after MemberAccess clean up.
440
441         * location.cs: Uses Length for empty string test.
442
443         * namespace.cs: Uses Length for empty string test.
444
445          * report.cs (CheckWarningCode): Made static.
446
447         * statement.cs (LabeledStatement): Removed unused argument.
448
449         * typemanager.cs (FilterNone): Removed.
450
451 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
452
453         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
454         obsolete.
455
456         * class.cs: Updated.
457
458 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
459
460         * cs-parser.jay.cs: __arglist is not allowed for delegates.
461
462 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
463
464         A fix for #77816.
465
466         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
467         host container.
468         (AnonymousMethod.ImplicitStandardConversionExists): New method.
469         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
470         Add more error reporting; Fixed issue with params.
471
472         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
473
474         * cs-parser.jay: AnonymousMethod requires host container.
475
476         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
477
478 2006-03-18  Raja R Harinath  <harinath@gmail.com>
479
480         * class.cs: Change 'TypeContainer ds' constructor argument to
481         'DeclSpace parent'.  Some classes were missed below due to
482         different naming convention.
483
484         * class.cs (MemberCore.Parent): Delete.  This makes the
485         ParentContainer changes below enforceable by the compiler.
486
487         Treat pointers to enclosing declaration space as 'DeclSpace', not
488         'TypeContainer'.
489         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
490         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
491
492         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
493         of TypeContainer.
494         (Block.AddThisVariable): Likewise.
495         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
496         (AbstractPropertyEventMethod.Emit): Likewise.
497         (AbstractPropertyEventMethod.EmitMethod): Likewise.
498         (GetMethod.Define, SetMethod.Define): Likewise.
499         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
500         (DelegateMethod.EmitMethod): Likewise.
501
502         Fix regression test-partial-13.cs.
503         Rationalize use of PartialContainer.  Ensure that the partial
504         class semantics can be tied to type-correctness, i.e., any
505         violation will cause a compile error.
506         * class.cs, const.cs: Access all fields that belong to class
507         TypeContainer via ParentContainer.  Arguments of EmitContexts and
508         Resolve()-like functions still use 'Parent'.
509
510         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
511         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
512         (PropertyMethod.CheckModifiers): Remove unused argument.
513         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
514         DeclSpace.
515
516 2006-03-28  Raja R Harinath  <rharinath@novell.com>
517
518         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
519
520 2006-03-17  Raja R Harinath  <harinath@gmail.com>
521
522         Make semantics of PartialContainer simpler.
523         * decl.cs (DeclSpace.IsPartial): Remove.
524         * class.cs (TypeContainer.IsPartial): Likewise.
525         (TypeContainer..ctor): Set PartialContainer to point to self.
526         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
527         (TypeContainer.FindNestedType): Likewise.
528         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
529
530 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
531
532         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
533
534 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
535
536         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
537         classes.
538
539 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
540
541         * class.cs (Operator.Define): An error for base conversion was not
542         reported correctly.
543
544 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
545
546         A fix for #77593, #77574.
547
548         * class.cs (MethodCore.CheckBase): Another if for operator.
549
550 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
551
552         A fix for #77822.
553
554         * expression.cs (VerifyArgumentsCompat): Reverted to double error
555         reporting, it's more tricky than I thought.
556
557 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
558
559         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
560         were not resolved
561
562         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
563         (DelegateCreation.ImplicitStandardConversionExists): New method for just
564         conversion test.
565         
566         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
567         not needed.
568
569 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
570
571         A fix for #77353.
572
573         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
574         (Event.Define): ditto
575         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
576
577         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
578         Removed redundant code and set NewSlot for Invoke method too.
579
580         * parameter.cs (Parameters.ctor): Add custom, type ctor.
581         (Parameters.MergeGenerated): New method. Use this method when you merge
582         compiler generated argument with user arguments.
583
584 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
585
586         * attribute.cs (ResolveAsTypeTerminal): Removed.
587
588         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
589         specialization for predefined types; 30% speed up.
590         Finally placed obsolete check to right place.
591         (Expression.ResolveType): Removed.
592
593         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
594         Updated after ResolveType was removed.
595
596         * expression.cs (Cast.ctor): Check void cast.
597         (Binary.ResolveAsTypeTerminal): Is never type.
598         (Conditional.ResolveAsTypeTerminal): Is never type.
599
600         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
601
602 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
603
604         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
605
606 2006-03-23  Martin Baulig  <martin@ximian.com>
607
608         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
609         type check if either of the types is an open generic type.
610
611 2006-03-23  Martin Baulig  <martin@ximian.com>
612
613         * convert.cs
614         (Convert.ExplicitTypeParameterConversion): New method; implement
615         explicit type parameter conversions.
616
617 2006-03-23  Martin Baulig  <martin@ximian.com>
618
619         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
620         blindly allow all conversions if we do not have any constraints.
621
622 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
623
624         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
625         these two separated members to simplify the code.
626         (Attribute.Resolve): Refactored to use new fields and methods.
627         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
628         implemented obsolete attribute checking.
629         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
630         implemented obsolete checking again. It look line never ending quest ;-)
631         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
632
633         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
634
635         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
636
637         *class.cs (Property.Define): Add RegisterProperty call.
638
639         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
640         argument groups (only 2).
641
642         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
643         encoding expression to arguments.
644         (Expression.ExprClassToResolveFlags): Just turned to property.
645
646         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
647         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
648         optimized as well as implemented support for zero-length attributes.
649
650         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
651         Add caching of PropertyInfo's.
652
653 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
654
655         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
656         error multiple times.
657
658 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
659
660         New partial class implementation.
661         A fix for #77027, #77029, #77403
662
663         * attribute.cs (Attributable): Made attributes protected.
664
665         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
666         the replacements of ClassPart and PartialContainer.
667         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
668         (TypeContainer.AddInterface): Ditto.
669         (TypeContainer.AddPartial): The main method for partial classes. It checks
670         for errors and merges ModFlags and attributes. At the end class is added to
671         partial_parts list.
672         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
673         required here.
674         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
675         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
676         from the rest of partial classes.
677         (TypeContainer.GetClassBases): Simplified.
678         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
679         DefineType.
680         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
681         (TypeContainer.HasExplicitLayout): Uses Flags now.
682         (PartialContainer): Removed.
683         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
684         (StaticClass): Was merged with Class.
685         (Class.GetClassBases): class and static class bases are verified here.
686         (Class.TypeAttr): Added static attributes when class is static.
687         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
688         (MemberBase): In some cases we need to call parent container for partial
689         class. It should be eliminated but it's not easy now.
690
691         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
692
693         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
694         partial classed to accumulate class comments.
695         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
696
697         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
698
699         * driver.cs (MainDriver): Tree.GetDecl was removed.
700
701         * modifiers.cs (Modifiers): Add partial modifier.
702
703         * tree.cs (Tree.decl): Removed.
704         (RootTypes): Started to use this class more often for root types
705         specializations.
706
707 2006-03-23  Raja R Harinath  <rharinath@novell.com>
708
709         * generic.cs (TypeParameter.UpdateConstraints): Update
710         'constraints' if null.
711
712 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
713
714         A fix for #77615
715
716         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
717         external interface does not have an attribute.
718
719 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
720
721         Another prerequisites for new partial classs implementation.
722         
723         * attribute.cs (Attribute.Equal): Implemented.
724         (Attribute.Emit): Changed as attributes can be applied more than twice.
725         (Attributes.Emit): Check for duplicate attributes here.
726
727         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
728         as a parameter, clean-up.
729
730 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
731
732         A fix for #77485
733
734         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
735         contains obsolete attribute check which can in some cases look for base
736         type of current class which is not initialized yet.
737         (TypeContainer.BaseType): Replacement of ptype.
738
739         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
740
741 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
742
743         First of prerequisites for new partial classs implemention.
744         
745         * attribute.cs (Attributable): Extended by ResolveContext;
746         Attributes finally have correct context for resolving in all cases.
747         (AttachTo): Attribute owner is assigned here.
748
749         * codegen.cs (IResolveContext): Introduce new interface to hold
750         all information needed in resolving phase.
751         (EmitContext): Implements IResolveContext; more clean-up needed here.
752         
753         * decl.cs (MemberCore): Implemented IResolveContext.
754
755         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
756         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
757         parameter.cs, statement.cs, tree.cs, typemanager.cs:
758         Refactored to use new IResolveContext instead of EmitContext; cleanup
759
760 2006-03-22  Raja R Harinath  <rharinath@novell.com>
761
762         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
763         mcs to keep code differences small.
764         * attribute.cs (Attribute.GetParameterDefaultValue): New.
765         * typemanager.cs (parameter_default_value_attribute_type): New.
766         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
767         CS1908 check.
768
769 2006-03-22  Martin Baulig  <martin@ximian.com>
770
771         * generic.cs
772         (Nullable.NullableLiteral): Derive from `NullLiteral'.
773
774         * convert.cs
775         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
776         instead of the normal `NullLiteral'.
777
778 2006-03-21  Martin Baulig  <martin@ximian.com>
779
780         Fix #77583.
781         * generic.cs (TypeManager.InferType): If `pt' is a generic
782         parameter, don't check whether `pt == at'.
783
784 2006-03-20  Raja R Harinath  <rharinath@novell.com>
785
786         Fix #77852
787         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
788         (TypeParameter.Resolve): Update to change.
789         (ConstraintChecker.CheckConstraints): Resolve type-argument
790         constraints before use.
791
792 2006-03-16  Martin Baulig  <martin@ximian.com>
793
794         * generic.cs
795         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
796         and don't have any instance constructors, also lookup in the base class.
797         (TypeManager.IsNullableValueType): New public method.
798
799         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
800         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
801         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
802
803         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
804         instead of just TypeManager.IsNullableType() to determine whether
805         a lifted operator exists.
806         (UnaryMutator.DoResolve): Likewise.
807         (Conditional.DoResolve): Likewise.
808         (Binary.DoResolve): A lifted operator only exists if both operands
809         are valuetypes and at least one of them is a nullable type.
810
811 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
812
813         * iterator.cs : yield break is allowed in try statement which has
814           catch clauses. Fixed bug #77767.
815
816 2006-03-12  Martin Baulig  <martin@ximian.com>
817
818         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
819         private IsSignatureEqual() to compare types; see the comment in
820         that method; fixes #77674.
821
822 2006-03-10  Raja R Harinath  <rharinath@novell.com>
823
824         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
825         (Expression.ResolveAsTypeTerminal): Likewise.
826         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
827         * expression.cs, generic.cs, iterators.cs: Likewise.
828         * parameter.cs, statement.cs, typemanager.cs: Likewise.
829
830 2006-03-09  Martin Baulig  <martin@ximian.com>
831
832         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
833         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
834
835 2006-03-09  Martin Baulig  <martin@ximian.com>
836
837         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
838         `prepared' flag is set.
839
840         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
841         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
842         issues; see gtest-254.cs.
843
844 2006-03-07  Martin Baulig  <martin@ximian.com>
845
846         * generic.cs (TypeManager.InferType): Allow infering
847         `IEnumerable<T>' with an array of T; see gtest-251.cs.
848
849 2006-03-06  Martin Baulig  <martin@ximian.com>
850
851         * generic.cs
852         (TypeManager.InferType): Fix gtest-250.cs.
853
854         * typemanager.cs
855         (TypeManager.IsSubclassOf): Also check the base class.
856
857         * expression.cs
858         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
859         fixes gtest-249.cs.
860
861 2006-03-01  Raja R Harinath  <rharinath@novell.com>
862
863         Fix #77679.
864         * expression.cs (ParameterReference.DoResolveBase): Change return
865         type to bool.
866         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
867         Update.
868
869         Fix #77628.
870         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
871
872         Fix #77642.
873         * typemanager.cs (GetFullNameSignature): Don't nullref on
874         protected accessors.
875
876 2006-02-16  Martin Baulig  <martin@ximian.com>
877
878         * generic.cs
879         (TypeManager.GetGenericFieldDefinition): New public method; use it
880         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
881
882 2006-02-14  Martin Baulig  <martin@ximian.com>
883
884         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
885
886 2006-02-14  Martin Baulig  <martin@ximian.com>
887
888         * generic.cs
889         (TypeManager.DropGenericMethodArguments): New public method; don't
890         use GetGenericMethodDefinition() on something which is not a
891         generic method.
892
893 2006-02-14  Martin Baulig  <martin@ximian.com>
894
895         * generic.cs
896         (ConstraintChecker.CheckConstraints): If a type parameter has the
897         `struct' constraint, the type must be a non-nullable valuetype.
898
899 2006-02-10  Martin Baulig  <martin@ximian.com>
900
901         * typemanager.cs
902         (TypeManager.IsOverride): Make this work for instantiated methods
903         in a generic class; fixes #77509.
904         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
905         rather than calling it directly; fixes #77488.  
906
907 2006-02-08  Martin Baulig  <martin@ximian.com>
908
909         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
910         reporting into CheckConstraint() so we can use the correctly
911         instantiated type.
912
913 2006-02-08  Martin Baulig  <martin@ximian.com>
914
915         * expression.cs (BaseAccess): Add support for generic methods.
916
917         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
918         the new MethodGroupExpr.
919
920 2006-02-07  Martin Baulig  <martin@ximian.com>
921
922         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
923         also reference types; fixes #77483.
924
925 2006-02-07  Martin Baulig  <martin@ximian.com>
926
927         * generic.cs
928         (TypeManager.IsGenericMethod): We now return whether something is
929         an instantiated generic method (and not a generic method def).
930         (TypeManager.IsGenericMethodDefinition): New public method.
931
932         * typemanager.cs
933         (TypeManager.CSharpSignature): Only include type arguments for
934         "real" generic methods, not for any instantiated method.
935         (TypeManager.GetMethodName): Likewise, but also allow generic
936         method definitions here.
937
938 2006-02-06  Miguel de Icaza  <miguel@novell.com>
939
940         * codegen.cs (EmitScopeInitFromBlock): check here the
941         capture_context, there is no need to make two calls to the
942         EmitContext. 
943
944         * anonymous.cs: Add some debugging messages that might help me
945         track other instances of this problem in the future (the
946         regression of test 467).
947
948         * cs-parser.jay: track the variable block, as we need to initalize
949         any captured variables declared in this block for the "catch"
950         portion of the "Try" statement.
951
952         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
953         scope initialization for captured variables. 
954
955         Also, move the emit for the variables after the block location has
956         been marked.
957
958 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
959
960        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
961         
962 2006-02-06  Martin Baulig  <martin@ximian.com>
963
964         * class.cs (TypeContainer.DefineType): If we're a struct, pass
965         `TypeManager.value_type' as parent type to
966         ModuleBuilder.DefineType().  Fixes #77358.      
967
968 2006-02-02  Miguel de Icaza  <miguel@novell.com>
969
970         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
971         commit yesterday, the initialization for the roots is necessary.
972         What is not necessary is the scope activation.
973
974 2006-02-02  Raja R Harinath  <rharinath@novell.com>
975
976         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
977         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
978         CS0206 checks.
979         (Argument.Resolve): Remove CS0206 checks.
980
981 2006-02-01  Miguel de Icaza  <miguel@novell.com>
982
983         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
984         scopes for all the roots, the scopes will now be emitted when the
985         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
986
987         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
988         code.  This reduces a lot of existing cruft.
989         
990         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
991         that the ScopeInfo is generated as we enter the scope, not at the
992         time of use, which is what we used to do before.
993
994         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
995         every time a Block is about to be emitted if we have a
996         CaptureContext. 
997
998 2006-02-01  Raja R Harinath  <rharinath@novell.com>
999
1000         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1001         attribute for mscorlib too.
1002
1003         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1004         (Reset): Update.
1005         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1006
1007         * typemanager.cs (cons_param_array_attribute): Make private.
1008         (Reset): Set it to null.
1009         (InitCoreHelpers): Don't initialize it.
1010         (ConsParamArrayAttribute): New.  Initialize it as needed.
1011         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1012
1013 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1014
1015         * expression.cs: There might be errors reported during the
1016         selection of applicable methods.  If there are errors, do not
1017         continue execution as it will lead the compiler to crash.
1018
1019 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1020
1021         * expression.cs: Member access is not allowed on anonymous
1022         methods.  Fixes #77402.
1023
1024 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1025
1026         Fix #77401
1027         * cs-parser.jay (VariableDeclaration): Don't set
1028         current_array_type to null.
1029         (field_declaration, event_declaration, declaration_statement):
1030         Set it to null here.
1031
1032 2006-01-29  Raja R Harinath  <harinath@gmail.com>
1033
1034         Fix part of #77397
1035         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1036
1037 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1038
1039         * typemanager.cs (GenericParameterPosition): New.
1040         * doc.cs: Use it.
1041
1042 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1043
1044         * doc.cs : To process "include" elements, first we should create
1045           another list than XmlNodeList, because it could result in node
1046           removal, which could result in that the XmlNodeList gives up
1047           yielding next node.
1048
1049 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1050
1051         * expression.cs: Introduce an error report that we were not
1052         catching before.   Gonzalo ran into it.
1053
1054 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1055
1056         A fix for bug: #76957
1057         
1058         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1059         ComputeMethodHost before creating the method, this is a new
1060         requirement. 
1061
1062         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1063         that this method references (RegisterScope).  The actual scope
1064         where the method is hosted is computed with the ComputeMethodHost
1065         before we create the method.
1066
1067         Moved the Deepest routine here.
1068
1069         (AnonymousContainer.ComputeMethodHost): New routine used to
1070         compute the proper ScopeInfo that will host the anonymous method.
1071
1072         (ScopeInfo): Deal with multiple roots.  The problem was that we
1073         did not have a unique root where all ScopeInfos could be hanged
1074         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1075         of roots.  
1076
1077         Remove AdjustMethodScope which is now computed at the end.  Remove
1078         LinkScope which did a partial link, instead link all ScopeInfos
1079         before code generation from the new "LinkScopes" routine. 
1080
1081         Simplify all the Add* routines as they no longer need to maintain
1082         the tree, they just need to record that they are using variables
1083         from a ScopeInfo.
1084
1085         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1086         routines to produce the forest of ScopeInfo trees.
1087
1088         * class.cs (TypeContainer.AppendMethod): This is just like
1089         AddMethod, but ensures that an interface implementation method
1090         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1091         methods, but at the end.
1092
1093         We use this functionality to ensure that the generated MoveNext
1094         method in the iterator class is resolved/emitted before the
1095         enumerator methods created.   
1096
1097         This is required because the MoveNext method computes the right
1098         ScopeInfo for the method.  And the other methods will eventually
1099         need to resolve and fetch information computed from the anonymous
1100         method. 
1101
1102         
1103 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1104
1105         Improve implementation of section 14.4.2.2 (Better function member).
1106         * expression.cs (Invocation.MoreSpecific): Compare all type
1107         arguments before deciding if one type is more specific than
1108         another.  Handle array types too.  Return the more specific type.
1109         (Invocation.BetterFunction): Add more tie-breaking rules from
1110         section 14.4.2.2.  Perform "more specific" check after
1111         other tie-breaking rules.  Compare all parameter types before
1112         choosing the "more specific" method.
1113
1114 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1115             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1116
1117         Fix rest of #76995.
1118         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1119         the 'aliases' hash.
1120         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1121         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1122
1123 2006-01-18  Martin Baulig  <martin@ximian.com>
1124
1125         * class.cs (TypeContainer.AddToMemberContainer): Use
1126         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1127         fixes #77124.
1128
1129 2006-01-18  Martin Baulig  <martin@ximian.com>
1130
1131         Fix #76417: a generic class may now have methods which may unify
1132         for some type parameter substitutions.
1133
1134         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1135         for methods which may unify anymore.
1136
1137         * expression.cs (Invocation.MoreSpecific): New private static
1138         method; checks whether one method is more specific than another
1139         according to 14.4.2.2 of the spec.
1140         (Invocation.BetterFunction): Implement the tie-breaking rules from
1141         14.4.2.2 of the spec: if two methods unify for some type parameter
1142         substitution, we need to pick the more specific one.
1143
1144 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1145
1146         Fix #76656, cs0231-2.cs.
1147         * cs-parser.jay (formal_parameter_list): Make error case catch
1148         more issues.
1149         (parenthesized_expression_0): Add CS1026 check.
1150         (invocation_expression): Remove unused { $$ = lexer.Location }.
1151
1152 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1153
1154         Fix #76824.
1155         * cs-parser.jay (statement_expression): Don't list out the
1156         individual statement-expressions.  Convert syntax error into
1157         CS0201 check.
1158
1159 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1160
1161         Fix #76874.
1162         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1163         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1164         CheckIntermediateModification.
1165         (FieldExpr.DoResolve): Add new two-argument version that
1166         allows us to resolve the InstanceExpression as an lvalue.
1167         The one-argument variant is now just a wrapper.
1168         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1169         Resolve the lhs as an lvalue if the it has a value type.
1170         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1171         from Assign.DoResolve.
1172         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1173         resolved as an lvalue.
1174         (PropertyExpr.DoResolve): Update.
1175         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1176         has a value type.  Move CS1612 check here from
1177         CheckIntermediateModification.
1178         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1179         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1180         'right_side' of a ResolveLValue on an 'out' argument.
1181         (EmptyExpression.LValueMemberAccess): New.  Used as the
1182         'right_side' of a propagated ResolveLValue on a value type.
1183         (LocalVariableReference.DoResolveBase): Recognize
1184         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1185         Add CS1654 check.
1186         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1187         EmptyExpression.Null.
1188
1189 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1190
1191         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1192           Type.IsGenericParameter(). Fixed bug #77183.
1193         * doc.cs : it is now identical to doc.cs in mcs.
1194
1195 2006-01-16  Martin Baulig  <martin@ximian.com>
1196
1197         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1198
1199 2006-01-16  Martin Baulig  <martin@ximian.com>
1200
1201         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1202         ctors; fixes #77250.
1203
1204 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1205
1206         This fixes the problem where we used ldfld instead of ldflda to
1207         load the "THIS" pointer on captured parameters, when THIS is a
1208         value type.  See bug #77205.
1209         
1210         * iterators.cs (CapturedThisReference.Emit): Pass false to
1211         EmitThis (we do not need the address).
1212
1213         * codegen.cs (EmitThis): it needs to know whether we need the
1214         address of `this' or not.  This is used by value types.  
1215
1216         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1217         every other call passes false.
1218
1219 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1220
1221         Fix #77221.
1222         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1223         GetOverride.
1224         * expression.cs (Invocation.OverloadResolve): Update.
1225         (Invocation.DoResolve): Avoid double resolution of invocation.
1226
1227 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1228
1229         Fix #77180.
1230         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1231         unary negation of floating point types as 0-expr; negation cannot
1232         overflow in floating point types.
1233
1234         Fix #77204.
1235         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1236         on operands of 'void' type.
1237
1238         Fix #77200.
1239         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1240         and ExclusiveOr for boolean constants too.
1241
1242 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1243
1244         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1245
1246 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1247
1248         * cs-tokenizer.cs (Position): New class used to save and restore
1249         the position state in the tokenizer.  Before this patch the save
1250         and restore was not complete enough so the line and columns would
1251         start to drift and the debugger and stack traces will get the
1252         wrong data.
1253
1254 2006-01-10  Martin Baulig  <martin@ximian.com>
1255
1256         * generic.cs
1257         (TypeParameter.InflateConstraints): New public method.
1258
1259         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1260         constraints; fixes #77042.
1261
1262 2006-01-10  Martin Baulig  <martin@ximian.com>
1263
1264         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1265         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1266         #77061. 
1267
1268 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1269
1270         Fix #75636.
1271         * expression.cs (Invocation.OverloadResolve): Replace reflected
1272         override methods with their base virtual methods, rather than
1273         skipping over them.
1274         * typemanager.cs (TypeManager.GetOverride): New.
1275
1276 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1277
1278         * driver.cs: Report the case of no source files and no -out:
1279         argument provided.
1280
1281 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1282
1283         Fix #77035.
1284         * expression.cs (ComposedCast.GetSignatureForError): Define.
1285
1286 2006-01-05  Jb Evain  <jbevain@gmail.com>
1287
1288         * class.cs (Property.Define, Indexer.Define): do not tag the
1289         properties as SpecialName | RTSpecialName.
1290
1291 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1292
1293         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1294         doing a low-level comparission of parameter types.  It was lacking
1295         a check for __argslist. 
1296
1297 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1298
1299         * expression.cs (ParameterReference.DoResolveBase): Allow
1300         reference parameters if they are local to this block. 
1301
1302         This allows the ref and out parameters of a delegate to be used in
1303         an anonymous method, for example:
1304
1305         delegate void set (out int x);
1306
1307         set s = delegate (out int x){
1308                 x = 0;
1309         };
1310
1311         This is used by functionality introduced late in the C# language.
1312         
1313         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1314         method that take ref and out parameters. 
1315
1316         Fixes #77119 which was a late change in the spec.
1317
1318 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1319
1320         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1321         parent if its the same scope.  Fixes #77060.
1322
1323 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1324
1325         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1326
1327 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1328
1329         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1330         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1331         that doesn't contain the full public key. This is a update of the
1332         friend assemblies in .Net 2.0 release.
1333         
1334 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1335
1336         Fix #76995
1337
1338         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1339         ListDictionary, to contain the ExternAliasEntry entries (in
1340         addition to the NamespaceEntry.aliases hashtable). This field is
1341         shared between the original entry and its doppelganger (bodyless 
1342         copy of it).
1343         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1344         extern_aliases field.
1345         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1346         lookup in extern_aliases.
1347
1348 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1349
1350         Fix #77006.
1351         * class.cs (TypeContainer.Mark_HasEquals): New.
1352         (TypeContainer.Mark_HasGetHashCode): New.
1353         (ClassPart): Override them.
1354         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1355
1356         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1357         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1358         DeclSpace.
1359
1360         Fix #77008.
1361         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1362         'parent' argument to the base constructor.
1363
1364         Remove all mention of TypeContainer from decl.cs.
1365         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1366         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1367         (DeclSpace.DeclSpace): Likewise.
1368         (DeclSpace.DefineMembers): Remove unused argument.
1369         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1370         debugging check -- we don't care if the debug code throws an
1371         InvalidCastException instead of an InternalErrorException.
1372         * class.cs (TypeContainer.DefineMembers): Update to changes.
1373         (TypeContainer.DoDefineMembers): Likewise.
1374         (TypeContainer.GetMethods): Likewise.
1375         (PropertyMember.Define): Likewise.
1376         (MemberBase.Parent): New property that forwards to
1377         MemberCore.Parent, but ensures that we get a TypeContainer.
1378         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1379         (RootContext.PopulateTypes): Likewise.  Remove special case code
1380         for !RootContext.StdLib: DefineMembers is idempotent.
1381
1382 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1383
1384         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1385
1386 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1387
1388         * doc.cs : The search for referenced namespace was insufficient to
1389           get global one as it used to do. Fixed bug #76965.
1390
1391 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1392
1393         * doc.cs : check name in cref in the last phase that whether it is
1394           namespace or not.
1395
1396 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1397
1398         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1399           Mono.C5.
1400
1401 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1402
1403         * doc.cs : so it turned out that we cannot skip override check for 
1404           interface members. Fixed bug #76954.
1405
1406 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1407
1408         * cs-tokenizer.cs : fixed bug #75984:
1409           - #warning and #error should not be handled when the source line
1410             is disabled.
1411           - #line is not checked strictly when the source line is disabled.
1412           - #define and #undef is on the other hand checked strictly at any
1413             state.
1414
1415 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1416
1417         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1418           CS1027 report.
1419
1420 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1421
1422         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1423
1424         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1425         nested types.
1426
1427 2005-12-14  Martin Baulig  <martin@ximian.com>
1428
1429         * typemanager.cs (TypeManager.GetFullName): Make this public;
1430         `Type.Fullname' now never returns null.
1431
1432         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1433         explicit interface implementations; we're now using the same
1434         naming convention than csc does.
1435
1436 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1437
1438         * convert.cs (ExplicitConversionCore): Check the return value from
1439         ExplicitConversionCore which can return null on failure.  Fixes #76914
1440
1441 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1442
1443         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1444         instead of IsGenericInstance.
1445         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1446         code that's now covered by the more general test.
1447         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1448
1449         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1450         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1451         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1452         * generic.cs, report.cs, typemanager.cs: Likewise.
1453
1454 2005-12-08  Martin Baulig  <martin@ximian.com>
1455
1456         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1457
1458         * typemanager.cs (TypeManager.CSharpSignature): Include type
1459         arguments in the signature of a generic method.
1460
1461 2005-12-07  Martin Baulig  <martin@ximian.com>
1462
1463         Add support for custom attributes on type parameters.
1464
1465         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1466
1467         * generic.cs (TypeParameterName): New public class; we use this
1468         instead of a `string' to store the name of a type parameter, so we
1469         can also have `Attributes'.
1470         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1471         array instead of a `string[]' array.
1472         (TypeParameter.ctor): We now also take an `Attributes' argument.
1473         (TypeParameter.EmitAttributes): New public method; emit our
1474         `OptAttributes' here.
1475         (GenericMethod.EmitAttributes): New public method; emit the custom
1476         attributes on all our type parameters.
1477
1478         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1479         our type parameters.
1480         (MethodData.Define): If we're a generic method, call
1481         EmitAttributes() on it.
1482
1483 2005-12-07  Martin Baulig  <martin@ximian.com>
1484
1485         * generic.cs
1486         (ConstraintChecker): New public abstract class; move the
1487         constraint checking here from `ConstructedType' and also do
1488         constraint checking for generic methods here.
1489
1490         * expression.cs (Invocation.OverloadResolve): Use
1491         ConstraintChecker.CheckConstraints() if we resolved to a generic
1492         method.  Fix #76806.
1493
1494 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1495
1496         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1497
1498         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1499         event initializers.
1500         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1501         (FieldBase.Initializer): Initializer is now optional.
1502         (EventField.Define): Only event field can have initializer.
1503
1504         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1505
1506         * const.cs (Const): Reuse initializer.
1507
1508         * cs-parser.jay: Updated after FieldBase changes.
1509         Added current_array_type to simplify array initializers.
1510
1511         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1512
1513         * expression.cs, iterators.cs: Updated.
1514
1515         * namespace.cs (NamespaceEntry): Made UsingFound private.
1516
1517 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1518
1519         * parameterCollection.cs: Obsolete, removed.
1520         * parser.cs: Obsolete, removed.
1521
1522 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1523
1524         Fix #76849.
1525         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1526
1527         * enum.cs (Enum.Define): Set obsolete context here.
1528
1529 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1530
1531         * doc.cs :
1532           - FindDocumentedMember() now expects 1) paramList as null
1533             when "we don't have to check the number of parameters" and
1534             2) Type.EmptyTypes when "there is no arguments".
1535           - Introduced FoundMember struct to hold the exact type which was
1536             used to find the documented member (the above change broke
1537             test-xml-044; it might be better just to use DeclaringType than
1538             what MS does, like this change does, but it depends on usage.)
1539
1540 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1541
1542         * doc.cs : documented member might be from DeclaringType for nested
1543           types. Fixed bug #76782.
1544
1545 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1546
1547         * anonymous.cs: Have the param code handle leaving copies on the
1548         stack etc. Allows anonymous params to take part in the assignment
1549         code (++, +=, etc). Fixes bug #76550
1550
1551         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1552         it down to the anon code.
1553
1554         * iterators.cs: Use dummy var here
1555
1556         * codegen.cs: Handle new vars
1557
1558 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1559
1560         Fix #76849.
1561         * class.cs (MethodData.Define): Set proper Obsolete context.
1562
1563         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1564         obsolete context.
1565         (FieldExpr.DoResolve): Ditto.
1566
1567 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1568
1569         Fix #76849.
1570         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1571         parent is not obsolete.
1572
1573 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1574
1575         * doc.cs : (FindDocumentedMember) find parameterless members first
1576           and get CS0419 in the early stage. Fixed first case of bug #76727.
1577
1578 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1579
1580         Fix #76859.
1581         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1582         no error was reported.
1583
1584         *expression.cs (Binary.DoResolve): left can be null.
1585
1586 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1587
1588         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1589         abstract method and all overrides.
1590         * support.cs (ParameterData.GenericConstraints): Delete.
1591         (ReflectionParameters.type_params): Delete.
1592         (ReflectionParameters.ReflectionParameters): Make private.
1593         (ReflectionParameters.GetConstaints): New factory method.
1594         * generic.cs (TypeParameterDefineType): Use it.
1595         (TypeManager.GetTypeParameterConstraints): Likewise.
1596
1597 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1598
1599         Fix #76783.
1600         * class.cs (MethodData.Emit): Parameters should be labeled first.
1601
1602 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1603
1604         Fix #76761.
1605         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1606
1607 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1608
1609         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1610
1611         * class.cs (MethodCore): Parameter clean up.
1612         (IMethodData): Added ParameterInfo.
1613         (MethodData): Parameter clean up.
1614         (Indexer.Define): Parameter clean up.
1615
1616         * anonymous.cs,
1617         * codegen.cs,
1618         * cs-parser.jay,
1619         * decl.cs,
1620         * doc.cs,
1621         * ecore.cs,
1622         * flowanalysis.cs,
1623         * iterators.cs,
1624         * pending.cs,
1625         * statement.cs,
1626         * typemanager.cs: Parameter clean up.
1627
1628         * delegate.cs (Define): Get rid of duplicated code.
1629
1630         * expression.cs (ParameterReference): Removed useless parameters
1631         and simplified.
1632         (Invocation): Ditto.
1633
1634         * parameter.cs (ParamsParameter): New class, params specialization.
1635         (ArglistParameter): Attemp to separate arglist.
1636         (Parameter): Refactored to be reusable and faster.
1637         (Parameter.Modifier): Made understandable.
1638         (Parameters): Changed to be used as a class for `this' assembly
1639         parameters. Refactored to use new specialized classes.
1640
1641         * support.cs (ParameterData): Added Types property.
1642         (InternalParameters): Deleted.
1643
1644 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1645
1646         * doc.cs : the previous patch does not actually fix the bug.
1647           PropertyInfo override check is now implemented and really fixed it.
1648         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1649
1650 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1651
1652         * doc.cs : apply "override filter" also to properties.
1653           Fixed bug #76730.
1654
1655 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1656
1657         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1658           no need to check overrides. For classes, omit those results from 
1659           interfaces since they must exist in the class. Fixed bug #76726.
1660
1661 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1662
1663         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1664           with different parameters. Fixed the second problem in #76685.
1665
1666 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1667
1668         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1669           get expected 'protected' access in CheckValidFamilyAccess()).
1670           Fixed bug #76692.
1671
1672 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1673
1674         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1675           Fixed bug #76705.  CS1569 was incorrectly commented out.
1676
1677 2005-11-23  Martin Baulig  <martin@ximian.com>
1678
1679         * generic.cs (Constraints.Define): Removed.
1680         (TypeParameter.DefineConstraints): Removed.
1681         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1682         on the GenericTypeParameterBuilder here.
1683
1684 2005-11-23  Martin Baulig  <martin@ximian.com>
1685
1686         * typemanager.cs (TypeManager.GetProperty): Make this public.
1687
1688         * generic.cs (Nullable.NullableInfo.ctor): Use
1689         TypeManager.GetProperty() rather than using reflection directly.
1690
1691 2005-11-17  Martin Baulig  <martin@ximian.com>
1692
1693         * expression.cs (Indexers.GetIndexersForType): Added support for
1694         generic parameters; fixes #76587.
1695
1696 2005-11-17  Martin Baulig  <martin@ximian.com>
1697
1698         * anonymous.cs
1699         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1700         inherit the scope from our parent.  Fixes #76653.
1701
1702 2005-11-15  Martin Baulig  <martin@ximian.com>
1703
1704         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1705         instead of `ScopeTypeBuilder' to refer to the "current" type.
1706         (AnonymousMethod.CreateScopeType): Correctly create the helper
1707         class if we're inside a generic type definition.
1708
1709 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1710
1711         * doc.cs : use Invocation.IsOverride() to do real override check.
1712         * expression.cs : made Invocation.IsOverride() internal.
1713
1714 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1715
1716         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1717           TypeBuilder.FindMembers() and filter overriden base members out.
1718           Fixed bug #76990.
1719
1720 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1721
1722         * doc.cs : ref/out parameters are represented as '@' (instead of
1723           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1724
1725 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1726
1727         * doc.cs : when there was no '.' in cref to methods in doc comment,
1728           then parameters were missing in the output. Fixed bug #76691.
1729
1730 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1731
1732         * driver.cs : don't output docs when there is an error.
1733           Fixed bug #76693.
1734
1735 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1736
1737         * doc.cs :
1738           Now it should detect indexers. Fixed primary concern in bug #76685.
1739           Fixed CS0419 message to not show the identical member signature in
1740           the message.
1741
1742 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1743
1744         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1745           instead of Type.FindMembers() since it does not handle events.
1746           Fixed bug #71604.
1747
1748 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1749
1750         * codegen.cs: Fixed typo (speficied -> specified).
1751
1752 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1753
1754         Fix #76369.
1755         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1756
1757 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1758
1759         * attribute.cs: Changed error message.
1760
1761         * cs-tokenizer.cs: One more check.
1762
1763 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1764
1765         * statement.cs (Block.Resolve): Ignore empty statement.
1766
1767 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1768
1769         * report.cs: Made error/warning methods more strict to avoid
1770         their misuse.
1771
1772         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1773         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1774         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1775         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1776
1777 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1778
1779         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1780         Use the more explicit AssemblyName.FullName instead of 
1781         AssemblyName.Name to report errors.
1782         
1783 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1784
1785         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1786         with mcs.
1787
1788 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1789
1790         * class.cs,
1791         * convert.cs,
1792         * cs-parser.jay,
1793         * decl.cs,
1794         * enum.cs,
1795         * expression.cs,
1796         * generic.cs,
1797         * pending.cs,
1798         * report.cs: Fixed error reporting and typos.
1799
1800         * generic.cs (TypeParameter.GetSignatureForError): New method.
1801         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1802
1803         * typemanager.cs (GetFullName): Refactored.
1804
1805 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1806
1807         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1808         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1809
1810         * class.cs (TypeContainer.IsComImport): New property.
1811         (Constructor.Define): Create proper ctor for ComImport types.
1812
1813         * expression.cs (New.CheckComImport): Fixed.
1814
1815 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1816
1817         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1818         that a parameter has been captured does not mean that we do not
1819         have to do the rest of the processing.  This fixes the second part
1820         of #76592.  If there was another anonymous method capturing
1821         values in the past, the Scope would never be set for the second
1822         method that captured the same parameter.
1823
1824         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1825         properly manipulate the stack.   Second part of fix for #76592.
1826
1827         * expression.cs (New): Add support for invoking "new" on
1828         interfaces that have been flagged with the ComImport attribute and
1829         the CoClass.  Fixes #76637 
1830
1831         * statement.cs (Try.DoEmit): When a variable is captured, do not
1832         try to emit the vi.LocalBuilder variable as it has been captured.
1833         Create a temporary variable and store the results on the
1834         FieldBuilder.  Fixes #76642
1835
1836 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1837
1838         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1839
1840         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1841
1842         * expression.cs (Binary.DoResolve): Added && optimalization.
1843     
1844         * typemanager.cs (AddUserType): Removed useless argument.
1845
1846 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1847
1848         * statement.cs (Block.variables): Uses ListDictionary.
1849
1850 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1851
1852         Fix #75969.
1853         * class.cs (PartialContainer.EmitType): Customized to emit
1854         security attributes.
1855         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1856         for partial classes.
1857
1858 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1859
1860         Fix #76599.
1861         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1862         access has to be fixed.
1863         
1864         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1865
1866 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1867
1868         Fix #76590.
1869         * ecore.cs (NullCast.Reduce): Implemented.
1870
1871         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1872         constant type.
1873         
1874         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1875         properly.
1876         (Foreach.Resolve): Catch null properly.
1877
1878 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1879  
1880         * cs-tokenizer.cs: Warning text fix.
1881
1882         * driver.cs: AllWarningNumbers exposed on public interface.
1883
1884         * report.cs (): Reviewed warning numbers.
1885         (IsValidWarning): Use binary search.
1886
1887 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1888  
1889         * driver.cs: Implemeted resource visibility.
1890         (Resources): New class for code sharing between /res: and
1891         /linkres:
1892  
1893 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1894
1895         decl.cs (CurrentTypeParameters): Fixed to be public.
1896
1897 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1898
1899         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1900
1901 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1902
1903         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1904
1905 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1906
1907         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1908
1909 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1910
1911         Add friend assembly access support.
1912         * typemanager.cs: assembly_internals_vis_attrs
1913         cache for friend assembly access. 
1914         (TypeManager.IsFriendAssembly): New method for
1915         checking friend assembly access.
1916         (TypeManager.Error_FriendAccessNameNotMatching): New
1917         helper method.
1918         (TypeManager.CompareKeyTokens): Likewise.
1919         (TypeManager.Filter): Handle friend accessible
1920         members.
1921
1922         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1923         friend accessible types.
1924
1925         * ecore.cs (Expression.IsAccessorAccessible): Handle
1926         friend accessible properties.
1927
1928         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1929         accessible types.
1930         
1931 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1932
1933         Fix #76568.
1934         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1935         folding.
1936         
1937         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1938         contants only.
1939         
1940         * ecore.cs (NullCast): Child is contant only.
1941         
1942         * literal.cs (NullLiteral.Reduce): null can be converted to any
1943         reference type.
1944
1945 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1946
1947         * driver.cs: Use Encoding.Default as default code page instead
1948           of ISO-28591.
1949
1950 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1951
1952         Fix #76085.
1953         * expression.cs (Invocation.Error_InvalidArguments): Handle
1954         __arglist parameters.
1955         (Invocation.VerifyArgumentsCompat): Likewise.
1956         * support.cs (ReflectionParameters.GetSignatureForError): Print
1957         __arglist parameters.
1958         (InternalParamters.GetSignatureForError): Likewise.
1959         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1960
1961 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1962
1963         * attribute.cs (GetPropertyValue): Made public.
1964
1965         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1966         Resolve.
1967         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1968         attribute.
1969         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1970         is not defined.
1971         
1972         * driver.cs: Reflect method name change.
1973         
1974         * statement.cs (Try.Resolve): Warn when try has both general
1975         exception handlers.
1976         
1977         * typemanager.cs: runtime_compatibility_attr_type new predefined
1978         type.
1979
1980 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1981
1982         Fix #76419.
1983         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1984         treat it as an empty parameter list.
1985
1986 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1987
1988         Fix #76271.     
1989         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1990         ResolveAsTypeStep silent.
1991         * statement.cs (Block.AddConstant): Mark block as used.
1992         (Block.ResolveMeta): Avoid piling on error messages
1993         if a constant initializer resolution fails.
1994
1995 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1996
1997         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1998         Remove.
1999         (NamespaceEntry.VerifyAllUsing): New.
2000         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2001         behaviour.  Delegates actual resolution of alias to ...
2002         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2003         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2004         Update.
2005         * driver.cs (Driver.MainDriver): Update.
2006         
2007         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2008         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2009         property.
2010         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2011         Remove.
2012         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2013         RootNamespace.DefineNamespacesForAll.
2014
2015 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2016
2017         * typemanager.cs (assemblies, external_aliases, modules)
2018         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2019         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2020         overhead.  Move resposibility ...
2021         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2022         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2023
2024 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2025
2026         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2027         cached_namespaces.  Improve usage.
2028         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2029         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2030         Move from GlobalRootNamespace and simplify.
2031         (RootNamespace.Global): Make instance variable.
2032         (RootNamespace.RootNamespace): Add "alias name" parameter.
2033         (GlobalRootNamespace): Simplify drastically.
2034         (Namespace.Lookup): Don't use GetNamespace.
2035         * typemanager.cs (GetRootNamespace): Rename from
2036         ComputeNamespaceForAlias.
2037         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2038
2039 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2040
2041         * anonymous.cs (AnonymousContainer): Don't crash when container
2042         doesn't exist.
2043
2044 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2045
2046         * expression.cs (Binary.DoResolve): Warn when comparing same
2047         values.
2048
2049 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2050
2051         Fix #76486.
2052         * expression.cs (Binary.DoResolve): It looks like there are no
2053         convetsion rules in enum context.
2054
2055 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2056
2057         Add support for extern alias qualifiers.
2058         * typemanager.cs: Move some LookupTypeReflection code
2059         to namespace.cs, to have cleaner code. Added some methods
2060         to help us keep track of the extern aliased references.
2061         * driver.cs: Add suport for extern alias assemblies on command
2062         line and check for their warnings/errors. Also keep track of the
2063         extern aliased assemblies.
2064         * namespace.cs: Move the global functionality of Namespace
2065         to GlobalRootNamespace/RootNamespace. Now the global namespace
2066         is GlobalRootNamespace.Globa. Also the code moved from 
2067         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2068         Finally added LocalAliasEntry (AliasEntry before) and
2069         ExternAliasEntry, to handle alias statements.
2070         * cs-parser.jay: Add support in the grammar for extern alias
2071         statement.
2072         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2073         Update callings to Namespace (now in GlobalRootNamespace).
2074
2075 2005-10-25  Martin Baulig  <martin@ximian.com>
2076
2077         * convert.cs (ImplicitTypeParameterConversion): Make base
2078         interfaces actually work; fixes #76557.
2079
2080 2005-10-25  Martin Baulig  <martin@ximian.com>
2081
2082         * generic.cs
2083         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2084         all the type parameters; fixes #76551.
2085
2086 2005-10-25  Martin Baulig  <martin@ximian.com>
2087
2088         Fix #76472.
2089
2090         * generic.cs
2091         (GenericMethod.ctor): Added `Expression return_type' and
2092         `Parameters parameters' arguments.
2093         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2094         parameter and return types to check their constraints if they're
2095         generic types.
2096
2097         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2098         boolean field.
2099
2100         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2101         constraints of a generic type if `ec.ResolvingGenericMethod'.
2102
2103         * class.cs (MethodCore.DoDefineParameters): Set
2104         `ec.ResolvingGenericMethod' if we're a generic method.
2105         (MemberBase.MemberType): Likewise.
2106
2107 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2108
2109         * typemanager.cs (TypeManager): Added 
2110         TypeManager.internals_visible_attr_type to cache
2111         S.R.CompilerServices.InternalsVisibleToAttribute.
2112
2113         * codegen.cs (AssemblyClass): Added checks for 
2114         InternalsVisibleToAttribute in new method 
2115         CheckInternalsVisibleAttribute () and also cache the
2116         AssemblyName in AssemblyClass.Name.
2117         
2118 2005-10-24  Martin Baulig  <martin@ximian.com>
2119
2120         * typemanager.cs
2121         (TypeManager.ExpandInterfaces): Added overloaded version which
2122         just takes a `Type[]' array.
2123
2124         * generic.cs
2125         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2126         just use the interfaces which were explicitly specified and not
2127         the interfaces they inherit.  Fixes #76482.
2128         (TypeParameter.FindMembers): Expand the interfaces here.
2129
2130 2005-10-21  Martin Baulig  <martin@ximian.com>
2131
2132         * generic.cs
2133         (Constraints.Resolve): Also resolve the actual types here.
2134         (Constraints.ResolveTypes): Just check the constraints here.
2135         Fixes #76363; see gtest-218.cs.
2136
2137 2005-10-21  Martin Baulig  <martin@ximian.com>
2138
2139         * convert.cs
2140         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2141         instead of a `BoxedCast'; fixes gtest-217.cs.
2142
2143 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2144
2145         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2146           1) "new()" is specified as generic parameter constraint and 2) the
2147           type is TypeBuilder and 3) the type is abstract even if it has a
2148           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2149
2150 2005-10-20  Martin Baulig  <martin@ximian.com>
2151
2152         * generic.cs
2153         (GenericConstraints.TypeParameter): New public property.
2154         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2155         (TypeParameter.DeclSpace): New public property.
2156         (TypeParameter.DefineType): Inflate the constraints if our
2157         `DeclSpace' is an `Iterator'.   
2158
2159 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2160
2161         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2162           GenericMethod argument to compare methods' generic type arguments.
2163           Fixed bug #76382.
2164
2165 2005-10-19  Martin Baulig  <martin@ximian.com>
2166
2167         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2168         not ResolveType() when resolving the base type, so we're not
2169         checking the constraints here.
2170         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2171         if we have any.
2172
2173 2005-10-19  Martin Baulig  <martin@ximian.com>
2174
2175         * generic.cs (ConstructedType.CheckConstraints): Committing
2176         untested fix for #76441.
2177
2178 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2179
2180         Fix #76371.
2181         * class.cs (TypeContainer.DefineType): Move updating of
2182         topological sort earlier in the code.
2183         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2184
2185 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2186
2187         Fix #76273.
2188         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2189         
2190         * constant.cs (Constant.TryReduce): Moved from Cast class.
2191         (Reduce): Made little bit more OO and fixed missing conversions.
2192         
2193         * ecore.cs (Reduce): Implemented.
2194         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2195         
2196         * literal.cs (Reduce): Implemented.
2197         
2198         * class.cs: Reverted Miguel's wrong commit.
2199
2200 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2201
2202         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2203
2204 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2205
2206         * cs-parser.jay, expression.cs : CS0214 was missing error location
2207           for constants. Fixed bug #76404.
2208
2209 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2210
2211         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2212         InstanceExpression.
2213         (PropertyExpr.EmitCall): Likewise.
2214         * expression.cs (Invocation.EmitArguments): Handle case where
2215         arguments == null.
2216         (Invocation.EmitCall): Avoid allocating temporary variable if
2217         there are no arguments.
2218
2219 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2220
2221         Fix #76370.
2222         * convert.cs (ExplicitConversionCore): Fixed object->enum
2223         conversion.
2224
2225 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2226
2227         Fix #76323.
2228         * convert.cs (ImplicitConversionStandard): Move conversion of
2229         void* to arbitrary pointer types ...
2230         (ExplicitConversionStandard): .. here.
2231         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2232         error to always print typenames.
2233
2234 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2235
2236         * convert.cs (GetConversionOperator): Rename from
2237         GetConversionOperators.  Move operator selection code from ...
2238         (UserDefinedConversion): ... here.
2239
2240 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2241
2242         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2243         conversion.
2244
2245 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2246
2247         * assign.cs (Assign.DoResolve): Error method changed.
2248
2249         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2250         
2251         * const.cs (ResolveValue): Reset in_transit immediately.
2252         
2253         * constant.cs: Error method changed.
2254         
2255         * convert.cs: Removed useless location parameter.
2256         (ExplicitNumericConversion): Don't do double enum check.
2257         (ExplicitConversionCore): Renamed from ExplicitConversion.
2258         (ExplicitUnsafe): Extracted from ExplicitConversion.
2259         (ExplicitConversion): Uses for error reporting.
2260         
2261         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2262         error messages.
2263         (ResolveBoolean): Uses common error method.
2264         (CastToDecimal): Get rid of ec.
2265         (CastFromDecimal): Optimized.
2266         (ConvCast): Get rid of ec.
2267         
2268         * enum.cs (ResolveValue): Reset in_transit immediately.
2269         (Emit): Return after first error.
2270         
2271         * expression.cs: Convert changes.
2272         
2273         * literal.cs: Error method changed.
2274         
2275         * statement.cs: Error method changed.
2276
2277 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2278
2279         Fix gtest-131.cs and gtest-211.cs.
2280         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2281         Only emit code for a label if it is used.  Unreachable code can
2282         violate ECMA evaluation stack invariants.
2283
2284 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2285
2286         * anonymous.cs: Implemented ExprClassName.
2287         
2288         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2289         delegate.
2290         
2291         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2292         check.
2293         
2294         * class.cs (StaticClass.DefineContainerMembers): Report protected
2295         members as error.
2296         
2297         * codegen.cs: if(ed) PRODUCTION.
2298         
2299         * convert.cs (Error_CannotImplicitConversion): Better error
2300         distinction.
2301         
2302         * cs-parser.jay: More error checks.
2303         
2304         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2305         
2306         * driver.cs (CSCParseOption): Enabled wrong option check.
2307         
2308         * ecore.cs (Expression.ExprClassName): Turned to property.
2309         (MemberExpr.CheckIntermediateModification): For checking boxed
2310         value types     modification.
2311         
2312         * statement.cs (Fixed.Resolve): Expression type must be
2313         convertible to fixed type.
2314         (CollectionForeach.GetEnumeratorFilter,TryType):
2315         Small refactoring for easier error checking.
2316
2317 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2318
2319         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2320         attributes.
2321         
2322         * class.cs (GeneratedBaseInitializer): New class for customization
2323         compiler generated initializers.
2324         (MemberBase.DoDefine): Check Obsolete attribute here.
2325         (FieldMember.DoDefine): Ditto.
2326         
2327         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2328         constants.
2329         
2330         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2331         (MemberCore.GetObsoleteAttribute): Removed argument.
2332         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2333         (MemberCore.CheckObsoleteType): New helper.
2334         
2335         * delegate.cs,
2336         * enum.cs,
2337         * statement.cs: Updates after MemberCore changes.
2338         
2339         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2340         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2341         
2342         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2343         obsolete attribute for compiler construct.
2344         (As.DoResolve): Cache result.
2345         
2346         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2347
2348 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2349
2350         * expression.cs (Probe): instead of having a "Type probe_type"
2351         keep the extra information as a TypeExpr probe_type_expr since the
2352         "As" operator needs to perform some type checks.
2353
2354         * (As.DoResolve): If the type is a type parameter, ensure that it
2355         is constrained by a class.
2356
2357 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2358
2359         * statement.cs (Lock): Use the TemporaryVariable class instead of
2360         manually using local variables as those do not work when variables
2361         are captured.
2362
2363         * ecore.cs: Moved the TemporaryVariable class from being a nested
2364         class inside Foreach to be a public class that can be employed in
2365         other places. 
2366
2367 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2368
2369         * cs-parser.jay: interface_accessors replaced by
2370         accessor_declarations.
2371
2372         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2373         location.
2374         
2375         * statement.cs (GotoCase.Resolve): Convert null constant to
2376         null case.
2377         (SwitchLabel.ResolveAndReduce): Ditto.
2378         (SwitchLabel.NullStringCase): Custom null stamp.
2379         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2380         
2381         typemanager.cs (CSharpSignature): Don't skip first argument
2382         for full names.
2383
2384 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2385
2386         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2387         expression.cs, iterators.cs, literal.cs: Store constants and
2388         literals location.
2389         
2390         * class.cs (MemberBase.ShortName): Pass location.
2391         
2392         * cs-parser.jay: Some location fixes.
2393         
2394         * ecore.cs (Expression.Location): Made virtual.
2395
2396 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2397
2398         Fix #72930.
2399         * const.cs (Const.ResolveValue): Check for assigning non-null
2400         value to reference type.
2401
2402 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2403
2404         Fix #76133.
2405         * expression.cs (This.VerifyFixed): In a value type T, the type of
2406         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2407         value type R, 'this' is treated as a value parameter.
2408
2409 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2410
2411         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2412         if the underlying types are the same, otherwise we need to produce
2413         code that will do the proper cast.
2414
2415         This was exposed by Marek's constant rewrite which produced
2416         invalid code for the call site:
2417
2418         enum X : long { a }
2419         void Method (X v) {}
2420
2421         Method ((X) 5)
2422
2423         This fixes test-49.cs
2424
2425 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2426
2427         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2428           Type/Object should be allowed as well. Fixed bug #75968.
2429
2430 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2431
2432         * expression.cs : (Binary.DoResolve): when one is enum constant and
2433           another is constant 0, then return enum one *as enum type*.
2434           Fixed bug 74846.
2435
2436 2005-10-04  Martin Baulig  <martin@ximian.com>
2437
2438         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2439         `SetMemberIsUsed()' work for generics, too.
2440
2441 2005-10-04  Martin Baulig  <martin@ximian.com>
2442
2443         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2444         for corlib.  Fixes #75691.
2445
2446 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2447
2448         Fix #76255.
2449         * driver.cs: Fix compilation files with full root path.
2450
2451 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2452
2453         * report.cs (SymbolRelatedToPreviousError): Format the output so
2454         it does not use an open parenthesis that is never closed. 
2455
2456         * driver.cs: Follow coding guidelines
2457
2458 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2459
2460         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2461
2462         * location.cs (InEmacs): in this mode, do not report column
2463         location as it confuses Emacs.
2464
2465 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2466
2467         * support.cs (SeekableStreamReader.Position): Don't error out when
2468         the requested position is just beyond the end of the current
2469         buffered data.
2470
2471 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2472
2473         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2474         try to keep in sync with the byte count of the underlying Stream.
2475         However, this limits us to a window size of 2048 characters: i.e.,
2476         the maximum lookahead of our lexer/parser can be 2048 characters.
2477
2478 2005-09-22  Martin Baulig  <martin@ximian.com>
2479
2480         * driver.cs: Removed a debugging FIXME.
2481
2482 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2483
2484         * cs-parser.jay (type_arguments): Add CS1644 check.
2485         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2486
2487 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2488
2489         * Makefile (PROGRAM): Make profile specific.
2490         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2491         the current directory.
2492
2493         Fix test-455.cs.
2494         * expression.cs (Invocation.EmitCall): Remove optimization on
2495         this_call since it doesn't handle 'this' being a value type.
2496
2497 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2498
2499         * driver.cs: Ensure file handles are closed after parsing
2500
2501 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2502
2503         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2504         if the underlying types are the same, otherwise we need to produce
2505         code that will do the proper cast.
2506
2507         This was exposed by Marek's constant rewrite which produced
2508         invalid code for the call site:
2509
2510         enum X : long { a }
2511         void Method (X v) {}
2512
2513         Method ((X) 5)
2514
2515         This fixes test-49.cs
2516
2517 2005-09-05  Martin Baulig  <martin@ximian.com>
2518
2519         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2520         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2521
2522         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2523
2524 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2525
2526         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2527           to be a pointer type due to the spec 25.2, so check if declaring
2528           type is generic type definition. Fixed bug #75772.
2529
2530 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2531
2532         Fixed bug #75957.
2533         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2534           both types are not defined by methods.
2535         * expression.cs : (Invocation.IsApplicable): it should work when
2536           the argument type is equal to the parameter type, not only when
2537           ImplicitConversionExists() returns true.
2538
2539 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2540
2541         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2542         internal.
2543
2544         Fix #75941.
2545         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2546         flow-branching for LocalVariableReferences in case we were invoked
2547         from a MemberAccess.
2548         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2549         Carved out of ...
2550         (LocalVariableReference.DoResolveBase): ... this.
2551         (MemberAccess.Resolve): Do the check that was disabled during
2552         SimpleNameResolve.
2553
2554 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2555
2556         * class.cs :
2557           (PartialContainer.Create): check abstract/sealed/static strictly
2558           but abstract/sealed can exist only at one side. Fixed bug #75883.
2559
2560 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2561
2562         Fix #75945.
2563         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2564         specified, don't default to UnmanagedType.I4.
2565
2566 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2567
2568         * expression.cs : conditional operator should check possibly
2569           incorrect assign expression. Fixed bug #75946.
2570
2571 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2572
2573         Fix #75934.
2574         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2575         (ScopeInfo.EmitScopeType): Use it to construct field names from
2576         names of captured locals.
2577
2578         Fix #75929.
2579         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2580         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2581         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2582         (ExplicitConversion): Remove enum cases already handled by
2583         implicit conversion.  Move implicit conversion check to the beginning.
2584         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2585         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2586         Don't treat System.Enum as a struct.
2587
2588 2005-08-30  Jb Evain  <jbevain@gmail.com>
2589
2590         * attribute.cs: handles as expression in parameters.
2591
2592 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2593
2594         Fix #75802.
2595         * class.cs (TypeContainer.VerifyClsName): Don't use a
2596         PartialContainer when verifying CLS compliance.
2597         (AbstractPropertyEventMethod): Set Parent here, ...
2598         (PropertyMethod): ... not here.
2599
2600 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2601
2602         * attribute.cs : escaped attribute name should not be allowed to be
2603           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2604
2605 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2606
2607         Fix #75927.
2608         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2609         when converting a long constant to unsigned long.
2610         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2611         detect where IsApplicable and VerifyArgumentsCompat disagree.
2612
2613 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2614         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2615
2616         Fix #75848.
2617         * class.cs (TypeContainer.CanElideInitializer): New helper.
2618         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2619         can safely emitting the initializer of a field.
2620
2621 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2622
2623         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2624           allowed inside a switch (without loop). Fixed bug #75433.
2625
2626 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2627
2628         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2629         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2630
2631 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2632
2633         * driver.cs : kinda reverting the default encoding changes (not exact 
2634           revert since I noticed that "codepage:reset" might not work fine).
2635
2636 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2637
2638         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2639           Location. Now getter and setter store location correctly.
2640           (errors/cs0111-12.cs now reports the expected location.)
2641
2642 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2643
2644         * driver.cs : Use default encoding on the environment.
2645           Removed (now that) extra parameter for SeekableStreamReader.
2646         * support.cs : (SeekableStreamReader) third .ctor() argument for
2647           StreamReader is not required (always true). preamble size could
2648           be acquired in simpler and safe way.
2649
2650 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2651
2652         * cs-parser.jay: report CS0642 at warning level 3
2653           and report CS0642 for an if else statement also
2654           fixes bug #74745. Patch by John Luke (and a bit
2655           modified by me).
2656           Removed extra CS0642 warning check for "while",
2657           "for" and "fixed".
2658         * statement.cs: In Block.Resolve(), CS0642 check
2659           is reimplemented to check a sequence of an empty
2660           statement and a block.
2661
2662           Both fix bug #66777.
2663
2664 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2665
2666         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2667         detection until I fix it.
2668         
2669         * cs-tokenizer.cs: Changed error message.
2670         
2671         * cs-parser.jay: Fixed 2 error locations.
2672         
2673         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2674         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2675         properties.
2676         
2677         * enum.cs (GetSignatureForError): Fixed.
2678         
2679         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2680         method detection.
2681         
2682         * class.cs,
2683         * typemanager.cs (RegisterProperty): Removed.
2684         
2685         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2686
2687 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2688
2689         Fix #75874.
2690         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2691         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2692
2693 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2694
2695         * expression.cs : tiny fix is required for not warning positive ulong.
2696           See test-441.cs.
2697
2698 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2699
2700         * expression.cs : add CS0652 check for constant and integral
2701           expression. Fixed bug #53974.
2702
2703 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2704
2705         * expression.cs : in DoNumericPromotions(), check if there is implicit
2706           conversion overload for string (to check CS0034). Fixed bug #52492.
2707
2708 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2709
2710         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2711
2712 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2713
2714         * ecore.cs : report location when it is *not* Null.
2715
2716 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2717
2718         * codegen.cs,
2719           ecore.cs,
2720           flowanalysis.cs,
2721           expression.cs:
2722           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2723           correctly. Fixed bug #75721.
2724
2725 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2726
2727         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2728         loop that performs 'min (pos, char_count)'.
2729
2730         Fix #75862.
2731         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2732         converted value in Operator.OnesComplement.
2733
2734 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2735
2736         * anonymous.cs: If the anon method is pulled into a helper class,
2737         it needs to be `internal' not `private'. Fixes runtime behavior on
2738         msft. bug #75704
2739
2740 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2741
2742         Fix #75803
2743         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2744         is a partial class.
2745
2746 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2747
2748         The big constants rewrite
2749         Fix #75746, #75685 and more
2750         As a side effect saved 1MB for MWF ;-)
2751         
2752         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2753         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2754         enum based for corlib compilation.
2755         
2756         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2757         subtractions.
2758         
2759         * class.cs (FixedField.Define): Use ResolveAsConstant.
2760         
2761         * const.cs (IConstant): Interface constants and enums.
2762         (Const.ResolveValue): New method for constant resolvning.
2763         (ExternalConstant): Constants from imported assemblies.
2764         
2765         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2766         conversion; like enums.
2767         (Constant.ToType): Converts this constant to different type.
2768         (Constant.Increment): Adds 1.
2769         
2770         * convert.cs (ImplicitConversionRequired): Simplified.
2771         
2772         * cs-parser.jay: Create EnumMember directly.
2773         
2774         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2775         
2776         * doc.cs (GenerateEnumDocComment): Removed.
2777         
2778         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2779         (ConvertIntLiteral): Removed.
2780         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2781         
2782         * enum.cs (EnumMember): Implement IConstant.
2783         (Enum.IsValidEnumConstant): Removed.
2784         (Enum.GetNextDefaultValue): Removed.
2785         (Enum.FindMembers): Updated.
2786         (Enum.GenerateDocComment): Iterate enum members.
2787         
2788         * expression.cs (Cast.TryReduce): Handle enums correctly.
2789         (New.Constantify): Made public.
2790         (MemberAccess.DoResolve): Removed contant specific if(s).
2791         
2792         * literal.cs (NullLiteral): Implement new abstract methods.
2793         
2794         * statement.cs (GotoCase.Resolve): Use new constant methods.
2795         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2796         
2797         * typemanager.cs (LookupEnum): Removed.
2798         (IsEnumType): Fixed to work with corlib.
2799         (RegisterConstant): Removed.
2800         (LookupConstant): Removed.
2801         (GetConstant): Changed to work with IConstant.
2802
2803 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2804
2805         * location.cs : Fixed overflown (>255) column number.
2806
2807 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2808
2809         First cut of the qualified-alias-member feature.
2810         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2811         token.
2812         * cs-parser.jay (DOUBLE_COLON): New token.
2813         (namespace_or_type_name): Add rule for recognizing
2814         qualified-alias-members.
2815         (primary_expression): Likewise.
2816         (element_access): Allow QualifiedAliasMember as a possible
2817         type-bearing expression.
2818         (local_variable_type, local_variable_pointer_type): Likewise.
2819         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2820         aliases in the current and enclosing namespace declarations.
2821         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2822         * decl.cs (MemberName.is_double_colon): New.
2823         (MemberName.MemberName): Add new constructor for alias-member.
2824         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2825         * expression.cs (QualifiedAliasMember): New expression type.
2826
2827 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2828
2829         * location.cs : it borked when no argument was specified.
2830
2831 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2832
2833         * location.cs : tiny ToString() format fix.
2834
2835 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2836
2837         * statement.cs : oops, it was missing.
2838
2839 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2840
2841         A set of fixes for precise line/column location.
2842
2843         * location.cs :
2844           "token" field now holds a file/line "delta", a line number offset 
2845           from the segment, and a column number. See also:
2846           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2847           December/009508.html
2848           Removed static IsNull. Use instance IsNull property instead.
2849         * cs-tokenizer.cs :
2850           For some tokens it stores Location. For Identifier it stores
2851           LocatedToken which is a pair of string name and location.
2852           Column numbers are adjusted only at getChar().
2853         * report.cs :
2854           Use Location.ToString() for reporting (it now contains column).
2855         * cs-parser.jay :
2856           Largely modified to use LocatedToken instead of
2857           string (IDENTIFIER), and to acquire Location from some tokens.
2858         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2859           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2860           codegen.cs :
2861           Now MemberName holds Location. DeclSpace.ctor() receives Location
2862           as a parameter. Removed extra parameters to all derived classes.
2863           Replaced Location.IsNull() with instance property.
2864         * assign.cs, expression.cs :
2865           Added .ctor() overload that omits Location.
2866         * attribute.cs :
2867           Added "nameEscaped" flag that indicates the identifier was escaped
2868           in the source file. This fixes bug #57047.
2869
2870 2005-09-02  Martin Baulig  <martin@ximian.com>
2871
2872         * class.cs: Make CS3005 a warning, not an error.
2873
2874 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2875
2876         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2877         New method, looking for lo-case imported cls type.
2878
2879         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2880         here.
2881
2882         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2883
2884         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2885
2886         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2887         all_imported_types.
2888         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2889
2890         Optimized to save 3.5 MB for SWF compilation.
2891
2892 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2893
2894         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2895         (PartialContainer.Create): Moved logic AddToContainer.
2896         (PartialContainer.MarkForDuplicationCheck): Shares name.
2897         
2898         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2899         place.
2900         
2901         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2902         initialization.
2903         (Namespace.GetSignatureForError): New method.
2904         
2905         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2906         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2907
2908 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2909
2910         Fix #75669.
2911         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2912         member lookup rather than qualifier_type, since qualifier_type can
2913         be null.
2914
2915 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2916
2917         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2918         enum member.
2919
2920 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2921
2922         * statement.cs: Copy the local exception into the exception
2923         captured local.  Fixes 75674
2924
2925 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2926
2927         Fix #75658.
2928         * expression.cs (Invocation.OverloadResolve): Don't report error
2929         CS1501 if error CS1502 has been reported.
2930         (New.DoResolve): Delegate CS1501 reporting to
2931         Invocation.OverloadResolve.
2932
2933         Fix #75656.
2934         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2935         invariant-meaning-in-block property in an enclosing block if
2936         necessary.
2937
2938 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2939
2940         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2941         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2942         (Switch.CheckSwitch): Just save 50kb for SWF.
2943
2944 2005-07-27  Martin Baulig  <martin@ximian.com>
2945
2946         * anonymous.cs (CaptureContext.AddField): Added
2947         `AnonymousContainer am' argument; compute its toplevel scope if
2948         it's not already computed.  Fixes #75649.
2949
2950 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2951
2952         Fix #75628.
2953         * class.cs (Constructor.Emit): Reset block to null if the block
2954         resolve fails.
2955
2956 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2957
2958         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2959
2960 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2961
2962         * class.cs (MethodData.Define): Check whether accessor implementing
2963         interface is public.
2964
2965         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2966
2967 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2968
2969         Fix #57245
2970         * namespace.cs (LookupType): Moved same type check to...
2971         
2972         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2973         with the same name.
2974
2975 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2976
2977         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2978         already found a typebuilder.
2979         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2980         MemberNames, not strings.
2981
2982         * const.cs (Error_ExpressionMustBeConst): 
2983         Rename from Error_EpressionMustBeConst.
2984         * const.cs, class.cs, statement.cd: Update.
2985
2986 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2987
2988         Fix #65573
2989
2990         * const.cs (Const.LookupConstantValue): Report missing contant expression
2991         everytime.
2992         (Error_EpressionMustBeConstant): Only one error method.
2993
2994         * class.cs, statement.c: Updated.
2995
2996 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2997
2998         * statement.cs (Block.Flags): Add back HasVarargs.
2999         (Block.flags): Make protected.
3000         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3001
3002         * typemanager.cs (types, typecontainers, user_types): Remove.
3003         (UserTypes, TypeContainers): Likewise.
3004         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3005         (CleanUp, Reset): Update.
3006         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3007         (GetNestedType): Use Type.GetNestedType.
3008         (CoreLookupType): Take two arguments, the namespace and the
3009         basename of the type.  Update to use the Namespace.Lookup
3010         mechanism.
3011         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3012         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3013         string concatenation and substring matches.
3014         * class.cs, enum.cs, delegate.cs: Update to changes.
3015
3016 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3017
3018         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3019         Expression and made virtual.
3020
3021         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3022         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3023
3024         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3025
3026         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3027         error message.
3028
3029         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3030         change.
3031
3032 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3033
3034         Fix #57707
3035         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3036         AssemblyCultureAttribute is not used on executable.
3037
3038         * rootcontext.cs,
3039         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3040
3041 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3042
3043         Fix #60638.
3044         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3045         New.  Reports CS0252/CS0253.
3046         Mostly taken from preliminary patch by Duncak Mak.
3047         (Binary.DoResolveOperator): Store results of operator lookup.
3048         Use them to detect if we need to warn about unintended reference
3049         comparisons.
3050
3051 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3052
3053         Fix #72969.
3054         * namespace.cs (Namespace.Lookup): Add back location parameter.
3055         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3056         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3057
3058         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3059         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3060         (Namespace.LookupType): ... this.
3061         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3062         of namespaces.
3063         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3064         purported to handle pointers.
3065         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3066         CoreLookupType.
3067
3068 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3069
3070         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3071         type as namespace.
3072
3073 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3074
3075         * namespace.cs (Namespace.Lookup): Drop location parameter.
3076         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3077         (NamespaceEntry.Lookup): ... this.
3078         (NamespaceEntry.Error_AmbiguousTypeReference):
3079         Move here from DeclSpace.
3080         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3081         names ...
3082         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3083         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3084         Move to NamespaceEntry.
3085         * delegate.cs, expression.cs: Update to changes.
3086
3087 2005-08-31  Martin Baulig  <martin@ximian.com>
3088
3089         Committing a patch from Atsushi Enomoto for #75850.
3090
3091         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3092         Prefer a generic enumerator over a non-generic one.
3093
3094 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3095
3096         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3097         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3098
3099 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3100
3101         * driver.cs : reverting default encoding change as well as mcs.
3102
3103 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3104
3105         * driver.cs, support.cs : merged r48826.
3106           Marek Safer wrote:
3107           > could you integrate your mcs changes to gmcs otherwise
3108           > gmcs cannot compile some files.
3109
3110 2005-08-20  Martin Baulig  <martin@ximian.com>
3111
3112         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3113         scope if we don't already have it.
3114
3115         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3116         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3117         fixes #75867.
3118
3119 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3120
3121         * statement.cs: Copy the local exception into the exception
3122         captured local.  Fixes 75674
3123
3124 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3125
3126         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3127         type as namespace.
3128
3129 2005-08-12  Martin Baulig  <martin@ximian.com>
3130
3131         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3132         for nested types here to avoid hitting the cache too early.
3133
3134 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3135
3136         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3137         an error. 
3138
3139 2005-08-03  Martin Baulig  <martin@ximian.com>
3140
3141         Make iterators in generic methods work; see gtest-191.cs.
3142
3143         * generic.cs
3144         (Constraints.Resolve): Protect against being called twice.
3145
3146         * class.cs
3147         (TypeContainer.GetClassBases): Make this `protected virtual'.
3148
3149         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3150         (Iterator.GetClassBases): Override this and compute the base
3151         classes here.
3152         (Iterator.DefineNestedTypes): If we're a generic method, all our
3153         method type parameters become class type parameters on the proxy
3154         class.
3155
3156         * statement.cs
3157         (ToplevelBlock.Parameters): Make this a property, not a field.
3158         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3159
3160 2005-08-03  Martin Baulig  <martin@ximian.com>
3161
3162         * typemanager.cs (TypeManager.IsSubclassOf): Use
3163         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3164         (TypeManager.GetFullName_recursed): Improved.
3165
3166 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3167
3168         Fix #75417
3169         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3170         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3171         invocation_type == mi.DeclaringType, since the first one also checks
3172         other condition used by generic instances.
3173         
3174 2005-07-27  Martin Baulig  <martin@ximian.com>
3175
3176         * anonymous.cs (CaptureContext.AddField): Added
3177         `AnonymousContainer am' argument; compute its toplevel scope if
3178         it's not already computed.  Fixes #75649.
3179
3180 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3181
3182         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3183         CheckAttributeType and refactored.
3184         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3185         ResolveAsTypeTerminal error handling.
3186         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3187         handling.
3188         (GetSignatureForError): Print errors in same way.
3189
3190         * class.cs,
3191         * codegen.cs: Reflect attribute GetSignatureForError change.
3192
3193         * ecore.cs,
3194         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3195
3196         * namespace.cs (UsingEntry): Refactored to make fields private.
3197
3198         * assign.cs,
3199         statement.cs: Error_UnexpectedKind has extra parameter.
3200
3201 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3202
3203         * ecore.cs (IAlias): Remove.
3204         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3205         that implement the interface.
3206         * namespace.cs (Namespace): Likewise.
3207         (Namespace.declspaces): Renamed from 'defined_names'.
3208         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3209         DeclSpace instead of an IAlias.
3210         * tree.cs (Tree.AddDecl): Update.
3211
3212 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3213
3214         * statement.cs (Block.Flags); Remove HasVarargs.
3215         (Block.HasVarargs): Move to ToplevelBlock.
3216         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3217         (Block.Variables): Make protected.  Initialize variable hashtable
3218         if necessary.
3219         (Block.AddVariable): Update.
3220         (Block.Resolve): Update to changes.
3221         (ToplevelBlock.HasVarargs): New boolean.
3222         (ToplevelBlock.ThisVariable): Move here from Block.
3223         (ToplevelBlock.AddThisVariable): Likewise.
3224         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3225         * expression.cs (This.ResolveBase): Update to changes.
3226         (ArglistAccess.DoResolve): Likewise.
3227
3228 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3229
3230         Fix #75321
3231         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3232
3233         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3234         not used and not used & assigned.
3235         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3236
3237 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3238
3239         Fix #75053
3240         * expression.cs (Is.DoResolve): null is never provided type.
3241
3242 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3243
3244         Fix #52496
3245         * cs-parser.jay: Less strict event error rule to catch more errors.
3246
3247 2005-07-11  Martin Baulig  <martin@ximian.com>
3248
3249         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3250         for the constructor constraint: we do not only have to check
3251         whether the class has a public constructor, but also ensure that
3252         it's parameterless.  Fixes #75492.
3253
3254 2005-07-11  Martin Baulig  <martin@ximian.com>
3255
3256         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3257         between type parameters if they either have the reference type
3258         constraint or the class constraint.
3259
3260 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3261
3262         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3263
3264 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3265
3266         Fix #74975
3267         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3268         (ExtractSecurityPermissionSet): Cope with self referencing security
3269         attributes properly.
3270
3271         * driver.cs (SetOutputFile): Made public property OutputFile.
3272
3273 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3274
3275         Fix #75486.
3276         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3277         has_nonstatic_fields.  Make into a FieldBase pointer.
3278         (TypeContainer.AddField): Add CS0282 check.
3279         (TypeContainer.EmitType): Update.
3280
3281 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3282
3283         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3284         compare if they start with __.
3285
3286 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3287
3288         * statement.cs (Switch.SwitchGoverningType): Only look at
3289         UserCasts that don't need implicit standard conversions to one of
3290         the allowed switch types (Fixes test-322.cs).
3291         (LocalInfo.Resolve): Re-enable sanity-test.
3292
3293 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3294
3295         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3296         
3297         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3298         
3299         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3300
3301 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3302
3303         Fix #75472.
3304         * ecore.cs (SimpleName.GetSignatureForError): Add.
3305         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3306         (MemberAccess.GetSignatureForError): Add.
3307
3308 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3309  
3310         The big error and warning messages review.
3311         
3312         * anonymous.cs,
3313         * assign.cs,
3314         * attribute.cs,
3315         * class.cs,
3316         * codegen.cs,
3317         * convert.cs,
3318         * cs-parser.jay,
3319         * cs-tokenizer.cs,
3320         * decl.cs,
3321         * delegate.cs,
3322         * doc.cs,
3323         * driver.cs,
3324         * ecore.cs,
3325         * enum.cs,
3326         * expression.cs,
3327         * flowanalysis.cs,
3328         * iterators.cs,
3329         * literal.cs,
3330         * location.cs,
3331         * modifiers.cs,
3332         * namespace.cs,
3333         * parameter.cs,
3334         * pending.cs,
3335         * report.cs,
3336         * rootcontext.cs,
3337         * statement.cs,
3338         * support.cs,
3339         * tree.cs,
3340         * typemanager.cs: Updated.
3341         
3342         * class.cs: (MethodCore.SetYields): Moved here to share.
3343         (PropertyMethod.Define): Moved iterator setup here.
3344         
3345         * iterators.cs: Add orig_method to have full access to parent
3346         container.
3347
3348 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3349
3350         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3351         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3352         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3353         variable of struct type.
3354         * expression.cs (Unary.ResolveOperator): Update to change.
3355         (Indirection.VerifyFixed): Likewise.
3356         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3357         (ParameterReference.VerifyFixed): Value parameters are fixed.
3358         (This.VerifyFixed): Treat 'this' as a value parameter.
3359         * statement.cs (LocalInfo.IsFixed): Remove.
3360
3361 2005-07-01  Martin Baulig  <martin@ximian.com>
3362
3363         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3364         `ec.EmitThis ()' to get the correct scope.
3365
3366 2005-07-01  Martin Baulig  <martin@ximian.com>
3367
3368         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3369         instance is a ParameterReference; fixes #75299.
3370
3371 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3372
3373         Fix #75412.
3374         * expression.cs (Indexers.map): Remove.
3375         (Indexers.Append): Filter out inaccessible setters and getters.
3376         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3377
3378         Fix #75283.
3379         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3380         Refactored from ...
3381         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3382         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3383         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3384         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3385
3386 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3387
3388         Fix #75322
3389         * class.cs (FieldBase.GetInitializerExpression): One more field
3390         for backup.
3391
3392 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3393
3394         * pending.cs: Do not define a proxy if the base method is virtual,
3395         it will be picked up by the runtime (bug 75270).
3396
3397 2005-07-08  Martin Baulig  <martin@ximian.com>
3398
3399         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3400         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3401
3402 2005-07-07  Martin Baulig  <martin@ximian.com>
3403
3404         * generic.cs (ConstructedType.CheckConstraint): Use
3405         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3406         called recursively; fixes #75329.
3407
3408 2005-07-06  Martin Baulig  <martin@ximian.com>
3409
3410         * generic.cs (TypeManager.InferTypeArguments): Added support for
3411         anonymous methods; fixes #75461.
3412
3413 2005-07-01  Martin Baulig  <martin@ximian.com>
3414
3415         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3416         `ec.EmitThis ()' to get the correct scope.
3417
3418 2005-07-01  Martin Baulig  <martin@ximian.com>
3419
3420         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3421         instance is `This'; fixes #75299.
3422
3423 2005-06-30  Martin Baulig  <martin@ximian.com>
3424
3425         * class.cs (Indexer): Implement IIteratorContainer; added support
3426         for iterators in indexers.
3427
3428         * codegen.cs
3429         (EmitContext.CurrentIterator): Make this a property, not a field.
3430
3431         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3432
3433 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3434
3435         * pending.cs: Do not define a proxy if the base method is virtual,
3436         it will be picked up by the runtime (bug 75270).
3437
3438 2005-06-28  Martin Baulig  <martin@ximian.com>
3439
3440         * cs-parser.jay (interface_method_declaration): Avoid a
3441         reduce/reduce conflict by moving some of the code into a separate
3442         `interface_method_declaration_body' rule; fixes #75368.
3443
3444 2005-06-28  Martin Baulig  <martin@ximian.com>
3445
3446         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3447         array check after the check for TypeBuilder's.
3448
3449 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3450
3451         * convert.cs (FindMostEncompassedType): Add two trivial special
3452         cases (number_of_types == 0 || number_of_types == 1).
3453         (FindMostEncompasingType): Likewise.
3454
3455 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3456
3457         Some cleanups preparing for the fix of #75283.
3458         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3459         error testing.
3460         (EventExpr.InstanceResolve): Likewise.
3461         (EventExpr.DoResolve): Remove redundant checks.
3462
3463 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3464
3465         * class.cs: Small fix.
3466
3467 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3468
3469         Fix #75160.
3470         * class.cs (GetPartialBases): Fix return value check of
3471         part.GetClassBases.
3472
3473 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3474
3475         Ensure that partial classes are registered in their enclosing
3476         namespace.  Initial part of fix of #75160.
3477         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3478         Register declspace with namespace here, not in
3479         DeclSpace.RecordDecl.
3480         * cs-parser.jay: Pass namespace to RecordDecl.
3481         * class.cs (PartialContainer.Create): Likewise.
3482         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3483         called.
3484         * decl.cs (Declspace.RecordDecl): Remove.
3485         * namespace.cs (NamespaceEntry.DefineName): Remove.
3486
3487 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3488
3489         * rootcontext.cs: Reset TargetExt as well.
3490
3491 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3492
3493         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3494         -langversion:ISO-1.
3495
3496 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3497
3498         Fix #75080, cs0119.cs.
3499         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3500         of ...
3501         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3502         allowing ExprClass.Type and ExprClass.Namespace for
3503         ResolveFlags.VariableOrValue.
3504         (Expression.Resolve) [1-argument variant]: Change default resolve
3505         flags based on language version.
3506         (Expression.Error_UnexpectedKind): Use a simple string array
3507         rather than an ArrayList.
3508         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3509         not ExprClass.Type.
3510         (TypeOfVoid.DoResolve): Likewise.
3511         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3512         flags argument -- it always has the same value.
3513
3514 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3515
3516         Fix #75081.
3517         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3518         Use it in the error message.
3519         * assign.cs, expression.cs, statement.cs: Update.
3520
3521 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3522
3523         Fix #75088.
3524         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3525         the "almostMatchedMember" case too.
3526         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3527         that failed the accessibility checks to 'almost_match'.
3528
3529 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3530
3531         * attribute.cs: Use internal MethodBuilder methods to set
3532         ExactSpelling and SetLastError on PInvoke methods, instead
3533         of passing them via charset.  Fixes #75060.
3534
3535 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3536
3537         * parameter.cs (Parameter): Remove TODO comment.
3538         (Parameter.DefineParameter): Remove Location parameter.
3539         (Parameters.LabelParameters): Likewise.
3540         * class.cs (Constructor.Emit): Update to change.
3541         (MethodData.Emit): Likewise.
3542         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3543         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3544
3545 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3546
3547         * parameter.cs,
3548           Removed Parameters.Location and added Parameter.Location instead.
3549           Removed Location parameter from Emit() and GetSignature().
3550         * anonymous.cs,
3551           class.cs,
3552           cs-parser.jay,
3553           delegate.cs,
3554           iterators.cs,
3555           statement.cs :
3556           Modified all related calls.
3557
3558 2005-06-21  Martin Baulig  <martin@ximian.com>
3559
3560         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3561         left-hand side is not a nullable type; fixes #75328.
3562
3563 2005-06-21  Martin Baulig  <martin@ximian.com>
3564
3565         * typemanager.cs
3566         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3567         (TypeManager.GetFullNameSignature): Likewise.
3568
3569         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3570         `source.FullName' and `target.FullName' to check whether there are
3571         two conflicting definitions.
3572
3573 2005-06-21  Martin Baulig  <martin@ximian.com>
3574
3575         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3576         a BoxedCast - also for reference types - to be compatible with csc.
3577
3578 2005-06-21  Martin Baulig  <martin@ximian.com>
3579
3580         * expression.cs (MemberAccess.DoResolve): Add support for nested
3581         types in a generic instance; fixes #75320.
3582
3583 2005-06-20  Martin Baulig  <martin@ximian.com>
3584
3585         * generic.cs (TypeManager.InferType): Also walk the class
3586         hierarchy for generic instances; fixes #75261.
3587
3588 2005-06-17  Martin Baulig  <martin@ximian.com>
3589
3590         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3591         to make things work for corlib.
3592
3593 2005-06-15  Martin Baulig  <martin@ximian.com>
3594
3595         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3596         obsolete `SecurityAction' values.
3597
3598 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3599
3600         * rootcontext.cs: Reset TargetExt as well.
3601         
3602 2005-06-09  Martin Baulig  <martin@ximian.com>
3603
3604         * delegate.cs (Delegate.VerifyMethod): Added
3605         `MethodGroupExpr old_mg' argument; inherit its
3606         `HasTypeParameters'; fix #75085.
3607
3608 2005-06-09  Martin Baulig  <martin@ximian.com>
3609
3610         * expression.cs (Invocation.OverloadResolve): Correctly handle
3611         generic methods for the SetMemberIsUsed(); fix #75064.
3612
3613 2005-06-09  Martin Baulig  <martin@ximian.com>
3614
3615         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3616         fixes #75062.
3617
3618 2005-06-08  Martin Baulig  <martin@ximian.com>
3619
3620         * cs-parser.jay (nullable_type_or_conditional): If we put the
3621         nullable back and our `type' is a `ComposedCast', remove the
3622         nullable from it.  Fixes #75156.
3623
3624         * expression.cs (ComposedCast.RemoveNullable): New public method.
3625
3626 2005-06-08  Martin Baulig  <martin@ximian.com>
3627
3628         The big Iterators rewrite :-)
3629
3630         * iterators.cs: Rewrite this to use the anonymous methods framework.
3631
3632         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3633         before the TypeContainers; see 2test-21.cs.
3634
3635         * class.cs
3636         (TypeContainer.DefineType): Don't create a new EmitContext if we
3637         already have one (this only happens if we're an Iterator).
3638         (TypeContainer.Define): Also call Define() on all our iterators.
3639         (Method.CreateEmitContext): Added support for iterators.
3640
3641         * anonymous.cs
3642         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3643         (AnonymousContainer.CreateMethodHost): Moved here from
3644         AnonymousMethod and made abstract.
3645         (AnonymousContainer.CreateScopeType): New abstract method.
3646         (AnonymousContainer.IsIterator): New public property.
3647         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3648         get the ScopeTypeBuilder rather than manually defining it here. 
3649         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3650         iterators here.
3651
3652         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3653         before RootContext.DefineTypes().
3654
3655         * codegen.cs (EmitContext.RemapToProxy): Removed.
3656         (EmitContext.CurrentAnonymousMethod): Changed type from
3657         AnonymousMethod -> AnonymousContainer.
3658         (EmitContext.ResolveTopBlock): Protect from being called twice.
3659         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3660         (EmitContext.EmitThis): Removed the iterators hacks; use the
3661         anonymous methods framework for that.
3662
3663         * statement.cs
3664         (ToplevelBlock.Container): Make this a property, not a field.
3665         (ToplevelBlock.ReParent): New public method; move the
3666         ToplevelBlock into a new container.
3667         (Foreach.TemporaryVariable): Simplify.
3668
3669 2005-06-05  Martin Baulig  <martin@ximian.com>
3670
3671         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3672         (Block.AddTemporaryVariable): New public method; creates a new
3673         `LocalInfo' for a temporary variable.
3674         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3675         variables here.
3676         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3677         non-iterator variables.
3678
3679 2005-06-05  Martin Baulig  <martin@ximian.com>
3680
3681         * statement.cs (Foreach.TemporaryVariable): Create the
3682         LocalBuilder in the Emit phase and not in Resolve since in some
3683         situations, we don't have an ILGenerator during Resolve; see
3684         2test-19.cs for an example.
3685
3686 2005-06-04  Martin Baulig  <martin@ximian.com>
3687
3688         The big Foreach rewrite - Part II.
3689
3690         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3691         with `PropertyInfo ienumerator_getcurrent'.
3692
3693         * codegen.cs (VariableStorage): Removed.
3694
3695         * statement.cs
3696         (Foreach): Derive from Statement, not ExceptionStatement.
3697         (Foreach.CollectionForeach): New nested class.  Moved all the code
3698         dealing with collection foreach here.
3699         (Foreach.ForeachHelperMethods): Removed.
3700         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3701
3702 2005-05-23  Martin Baulig  <martin@ximian.com>
3703
3704         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3705         don't need to.  Fix #75014.
3706
3707 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3708
3709         Improve user-defined conversion handling.
3710         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3711         applicable operators.
3712         (AddConversionOperators): New.  Helper for GetConversionOperators.
3713         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3714         there is only one most encompassed/encompassing type.
3715         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3716         "applicable operator" handling.
3717         (UserConversion): Move cache here from GetConversionOperators.
3718         Directly cache the chosen operator, rather than the whole
3719         MethodGroup.
3720         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3721         case.  Allow conversion of decimal to sbyte and byte too.
3722         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3723         New static methods.  Used to avoid allocating EmptyExpressions in
3724         convert.cs.
3725
3726 2005-05-24  Duncan Mak  <duncan@novell.com>
3727
3728         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3729         another class, used in Convert.ExplicitNumericConversion.
3730         (CastToDecimal): New class, similar to above, but casts to
3731         System.Decimal, used in Convert.ImplicitNumericConversion and also
3732         in explicit convesion from double/float to decimal.
3733
3734         * convert.cs (ImplicitNumericConversion): Handle implicit
3735         conversions to System.Decimal.
3736         (ExplicitNumericConversion): handle explicit conversions to
3737         System.Decimal.
3738
3739         This fixes #68711.
3740         
3741 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3742
3743         * typemanager.cs: Do not throw an exception in the TypeBuilder
3744         case, we take care of it on the TypeCode.
3745
3746 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3747         
3748         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3749         is back.
3750         
3751         * cs-parser.jay: Catch more lexical errors.
3752         
3753         * report.cs: Add one more Error method.
3754         
3755         * rootcontext.cs,
3756         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3757
3758 2005-05-20  Martin Baulig  <martin@ximian.com>
3759
3760         * class.cs (TypeContainer.CircularDepException): Removed.
3761         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3762         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3763         (CS0146) and interface (CS0529) dependencies here.
3764
3765 2005-05-20  Martin Baulig  <martin@ximian.com>
3766
3767         * expression.cs (New.DoResolve): Move the CS0712 check above the
3768         CS0144 check; otherwise it can never be reached.
3769
3770 2005-05-20  Martin Baulig  <martin@ximian.com>
3771
3772         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3773
3774 2005-05-20  Martin Baulig  <martin@ximian.com>
3775
3776         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3777
3778         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3779
3780 2005-05-19  Martin Baulig  <martin@ximian.com>
3781
3782         * delegate.cs
3783         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3784         to disable error reporting.
3785
3786         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3787         here since we don't want to report an error; see the new test-336.cs.
3788
3789 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3790
3791         * statement.cs (ToplevelBlock.GetParameterReference)
3792         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3793         Move here from class Block.
3794         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3795         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3796
3797 2005-05-18  Martin Baulig  <martin@ximian.com>
3798
3799         Fix #74978.
3800
3801         * flowanalysis.cs
3802         (FlowBranching.Reachability): Add non-static public And() and Or()
3803         methods.
3804         (FlowBranchingSwitch): New class; do the `break_origins' thing
3805         like in FlowBranchingLoop.
3806         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3807         reachability, not just locals and parameters.
3808         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3809         switch; MergeBreakOrigins() now takes care of that.
3810
3811 2005-05-18  Martin Baulig  <martin@ximian.com>
3812
3813         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3814         a loop and may leave it, reset the barrier; fixes #74974.
3815
3816 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3817
3818         Fix test-382.cs.  Emit values of decimal constants.
3819         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3820         Carved out of ...
3821         (TypeContainer.AddField): ... this.
3822         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3823         with initializers to include 'Const's.
3824         (ClassPart.RegisterFieldForInitialization): Forward to
3825         PartialContainer.
3826         * const.cs (Const.Const): Pass initializer to base class.
3827         (Const.Define): In case of decimal constants, register them for
3828         initialization in a static constructor.
3829
3830 2005-05-14  Martin Baulig  <martin@ximian.com>
3831
3832         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3833         do not call ResolveUnreachable() on unreachable statements in
3834         here, see the comment in the source code.
3835
3836 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3837
3838         Fix #74934.
3839         * expression.cs (BinaryResolveOperator): If one of the operands of
3840         an equality comparison is 'null' and the other is a pointer type,
3841         convert the null to a NullPointer.
3842         * convert.cs (ImplicitReferenceConversion): If the expression is a
3843         NullLiteral and the target type is a pointer type, return a
3844         NullPointer instead.
3845         (ImplicitConversionStandard): Likewise.
3846
3847 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3848         
3849         * cs-parser.jay: Set readonly context based on special constructs.
3850         
3851         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3852         readonly variable error handling.
3853         
3854         * rootcontext.cs (EmitCode): Don't verify members when error
3855         occurred.
3856         
3857         * statement.cs (LocalInfo): Add reaodnly context information.
3858         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3859
3860 2005-05-17  Martin Baulig  <martin@ximian.com>
3861
3862         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3863         #70970. 
3864
3865 2005-05-13  Martin Baulig  <martin@ximian.com>
3866
3867         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3868         handle unreachable blocks.
3869
3870 2005-05-13  Martin Baulig  <martin@ximian.com>
3871
3872         * class.cs
3873         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3874         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3875         #74905. 
3876
3877 2005-05-13  Martin Baulig  <martin@ximian.com>
3878
3879         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3880         instance variable, not a local.  Fix #74873.
3881         (Block.ResolveUnreachable): Set it to true here.
3882
3883 2005-05-12  Martin Baulig  <martin@ximian.com>
3884
3885         * cs-parser.jay (property_declaration): Pass the `current_class',
3886         not the `current_container' to Property's .ctor.  Fixes #74912.
3887
3888 2005-05-11  Martin Baulig  <martin@ximian.com>
3889
3890         * typemanager.cs (Closure): Copy this from MCS and merge all the
3891         GMCS-specific changes into it.
3892
3893 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3894
3895         Fix #74920.
3896         * typemanager.cs (unmanaged_enclosing_types): New.
3897         (IsUnmanagedType): Avoid infloops by using
3898         'unmanaged_enclosing_types' to talk with recursive invocations.
3899
3900 2005-05-11  Duncan Mak  <duncan@novell.com>
3901
3902         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3903         continuing to process for 'arg'.
3904         (handle_preprocessing_directive): Check the argument of the #endif
3905         directive and report error CS1025 if there are any trailing
3906         characters.
3907
3908         According to the C# spec, having even whitespace after the #endif
3909         directive is illegal; however, because we call arg.TrimEnd ()
3910         beforehand, we have the same behavior as csc, allowing whitespace
3911         after the directive.
3912
3913         Fixes #74892.
3914
3915 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3916
3917         Fix #74863.
3918         
3919         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3920         (Constructor.GetObsoleteAttribute): Implemented correctly.
3921
3922 2005-05-10  Martin Baulig  <martin@ximian.com>
3923
3924         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3925         resolve the type; fixes #74864.
3926         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3927         in DoResolve(); fixes #74862.
3928
3929 2005-05-10  Martin Baulig  <martin@ximian.com>
3930
3931         * support.cs (ReflectionParameters.ParameterModifier): Use
3932         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3933         and `ParameterAttributes.In'.  Fixes #74884.
3934
3935 2005-05-10  Martin Baulig  <martin@ximian.com>
3936
3937         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3938         the cache if we're just looking for `MemberTypes.NestedType' in a
3939         generic instance.
3940
3941         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3942         constraints if we're still resolving the type tree.
3943         (Expression.MemberLookup): If we're resolving the type tree, only
3944         look for `MemberTypes.NestedType' since we're only interested in
3945         getting types.
3946
3947         * class.cs (TypeContainer.DefineType): Don't resolve the type
3948         parameters here; do this later in ResolveType() after the type
3949         tree has been resolved.
3950         (TypeContainer.ResolveType): New public method; this is called
3951         after the type tree is resolved and before the types are being
3952         populated.  We resolve the generic constraints here.
3953         (TypeContainer.DoDefineMember): Check the constraints on our base
3954         class and interfaces.
3955
3956         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3957         set the `ResolvingTypeTree' flag on the EmitContext.
3958
3959         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3960
3961 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3962
3963         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3964         
3965         * expression.cs (Argument.GetParameterModifier): Turned to property.
3966         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3967         
3968         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3969         its C# equivalent.
3970         
3971 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3972
3973         Fix #74852.
3974         * decl.cs (MemberCache.AddMethods): Register override methods,
3975         rather than non-override methods.
3976         * typemanager.cs (RegisterOverride): New.
3977         (IsOverride): Update.
3978
3979 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3980
3981         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3982
3983 2005-05-06  Martin Baulig  <martin@ximian.com>
3984
3985         * attribute.cs
3986         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3987         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3988
3989 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3990
3991         Fix #73105.
3992         
3993         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3994         recursive declaration.
3995         
3996         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3997         
3998 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3999
4000         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4001         
4002         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4003
4004 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4005
4006         Fix #74797.
4007         * decl.cs (DeclSpace.FamilyAccessible): 
4008         Use TypeManager.IsNestedFamilyAccessible.
4009
4010         Fix reopened #64812.
4011         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4012         internal'.
4013
4014 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4015             Abin Thomas  <projectmonokochi@rediffmail.com>
4016             Anoob V E  <projectmonokochi@rediffmail.com>
4017             Harilal P R  <projectmonokochi@rediffmail.com>
4018
4019         Fix #64812.
4020         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4021         allow access to all static members.
4022
4023 2005-05-04  Martin Baulig  <martin@ximian.com>
4024
4025         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4026
4027 2005-05-04  Martin Baulig  <martin@ximian.com>
4028
4029         Fix #74655.
4030
4031         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4032         section at the end; make things work if `default' is not the last
4033         section.        
4034
4035 2005-05-04  Martin Baulig  <martin@ximian.com>
4036
4037         Fix #70400.
4038
4039         * statement.cs (Switch): Replaced the `got_default' field with a
4040         `default_section' one.
4041         (Switch.CheckSwitch): Set `default_section' here.
4042         (Switch.Resolve): If we're a constant switch and the constant is
4043         not found, use the default section.
4044
4045 2005-05-03  Martin Baulig  <martin@ximian.com>
4046
4047         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4048
4049         * statement.cs (Foreach.ArrayForeach): New nested class.
4050         (Foreach.TemporaryVariable): New nested class.
4051         (Foreach.EmitArrayForeach): Removed; this is now in the new
4052         ArrayForeach class.
4053
4054 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4055
4056         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4057         more conservative.
4058         (VerifyPendingMethods): Revert change below.
4059
4060         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4061         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4062         that used to trigger warning -28.  Remove warning -28.
4063         * expression.cs (Invocation.OverloadResolve): Use
4064         TypeManager.IsOverride to distinguish override methods.
4065
4066         Fix #74773.
4067         * pending.cs (VerifyPendingMethods): If a base type implements the
4068         requested interface, don't bother checking individual methods of
4069         the base type.  As a side-effect, this prevents the creation of
4070         unnecessary proxies.
4071
4072 2005-05-02  Martin Baulig  <martin@ximian.com>
4073
4074         Fix #70182.
4075
4076         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4077         Also `And' the locals if the old vector is null.
4078         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4079         null; in this case we basically reset all the variables.        
4080
4081 2005-05-02  Martin Baulig  <martin@ximian.com>
4082
4083         Fix #74529.
4084
4085         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4086         Added `FlowBranching branching' argument; always `and' the
4087         variables instead of `or'ing them unless we're an infinite loop.
4088
4089         * statement.cs (While.Resolve): Create a new sibling unless we're
4090         infinite.       
4091
4092 2005-05-02  Martin Baulig  <martin@ximian.com>
4093
4094         Fix #70140.
4095
4096         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4097         arguments; use it instead of creating a new TopLevelBlock.
4098         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4099         our ConstructorInitializer.
4100
4101         * statement.cs
4102         (TopLevelBlock.TopLevelBranching): New public property.
4103         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4104         and create our `TopLevelBranching'.
4105
4106         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4107         anonymous method host, use `block.TopLevelBranching' rather than
4108         creating a new branching.
4109
4110 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4111
4112         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4113         a ScopeInfo, if any of the current children is a child of the new
4114         entry, move those children there.
4115
4116 2005-04-30  Martin Baulig  <martin@ximian.com>
4117
4118         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4119         at the beginning of a SwitchSection.  Fix #73335.
4120
4121 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4122
4123         Fix #74378
4124         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4125         
4126         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4127         (FieldExpr.DoResolve): Obsolete members are ignored for field
4128         initializers.
4129         
4130 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4131
4132         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4133         of arrays detection.
4134
4135         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4136         verification.
4137         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4138
4139         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4140         arrays report.
4141
4142 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4143
4144         * cs-parser.jay: Use the prefered version of -unsafe in error
4145         message.
4146
4147 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4148
4149         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4150         circumstances.
4151
4152 2005-04-20  John Luke  <john.luke@gmail.com>
4153
4154         * driver.cs: fix typo in error message, --outout to --output
4155
4156 2005-04-30  Martin Baulig  <martin@ximian.com>
4157
4158         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4159         handle the .NET 2.x security attributes.
4160
4161 2005-04-30  Martin Baulig  <martin@ximian.com>
4162
4163         * typemanager.cs
4164         (TypeManager.ExpandInterfaces): Don't add things twice.
4165
4166         * class.cs
4167         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4168
4169 2005-04-29  Martin Baulig  <martin@ximian.com>
4170
4171         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4172
4173         * anonymous.cs: Added support for anonymous generic methods.
4174
4175 2005-04-29  Martin Baulig  <martin@ximian.com>
4176
4177         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4178         generic instances.
4179
4180 2005-04-29  Martin Baulig  <martin@ximian.com>
4181
4182         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4183
4184         * expression.cs (New.DoResolve): Fix the CS0304 check.
4185
4186 2005-04-29  Martin Baulig  <martin@ximian.com>
4187
4188         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4189         naming schema.
4190
4191         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4192         explicit interface implementation, compare the interface types.
4193         (MethodData.Define): Use the new naming scheme from the latest
4194         .NET 2.x beta2.
4195         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4196
4197         * decl.cs (MemberName.GetMemberName): Removed.
4198         (MemberName.MethodName, FullName): New properties.
4199
4200 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4201
4202         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4203
4204 2005-04-22  Martin Baulig  <martin@ximian.com>
4205
4206         * generic.cs (GenericMethod): Create the EmitContext in the
4207         `Define()'; in `Define(MethodBuilder)', create the type parameters
4208         before calling `Define()'.  Fixes #73933.
4209
4210 2005-04-22  Martin Baulig  <martin@ximian.com>
4211
4212         * generic.cs
4213         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4214         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4215
4216         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4217         ConstructedType, check its constraints.
4218
4219 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4220
4221         * codegen.cs (InRefOutArgumentResolving): New field.
4222         
4223         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4224         fields outside contructor.
4225         
4226         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4227         
4228 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4229
4230         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4231         parameter code was not completed ever, so it was not as up-to-date
4232         as local variables.  Must finish it.
4233
4234         The bug fix was to compare the Toplevel of the block, not the
4235         current block.  Thanks for Ben for pointing this out. 
4236
4237 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4238
4239         * decl.cs (AddMethods): Use the declaring type of the problem
4240         method to determine if we want to squash a warning.
4241
4242 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4243
4244         * attribute.cs: Removed debug output.
4245
4246         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4247         
4248         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4249         Report.Stderr.
4250         
4251 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4252
4253         Fix #74481.
4254         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4255         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4256         all null comparisons against reference types.
4257
4258 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4259
4260         Fix# 74565
4261         * class.cs (TypeContainer.CircularDepException) New nested
4262         exception class.
4263         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4264         (TypeContainer.DefineType): Removed error, reset InTransit before
4265         exit.
4266         (Class.DefineType): Throw exception when is in Transit.
4267         Catch exception and report error.
4268         (Struct.DefineType): Throw exception when is in Transit.
4269         Catch exception and report error.
4270         (Interface.DefineType): Throw exception when is in Transit.
4271         Catch exception and report error.
4272
4273         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4274         handle nested exception handlers.
4275
4276         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4277         a catch.
4278
4279         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4280         InFinally and InCatch storage.
4281
4282         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4283         (Catch.Resolve): Set and Restore ec.InCatch.
4284         (Try.Resolve): Set and Restore ec.InFinally.
4285         (Try.HasCatch): True when try has catch.
4286
4287 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4288
4289         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4290           for the same event member, so exclude such cases from warning 419.
4291           Fixed bug #74633.
4292
4293 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4294
4295         * expression.cs (Binary.ResolveOperator): Apply patch from John
4296         Luke to fix bug 59864: operators &, | and ^ on enumerations
4297         require that the same enum type on both sides.
4298
4299         * driver.cs: Add warnings to old flag usage, this is to assist
4300         people who produce Makefiles and hope that the Makefiles will be
4301         used on Windows.
4302
4303         * class.cs (TypeContainer.EmitType): Moved the definition of the
4304         special $PRIVATE$ field from the resolve phase to the Emit phase.
4305         During resolve we do not know if we are a struct with
4306         HasExplicitLayout, we know this only after the attributes for the
4307         type are emitted.
4308
4309         Set the FieldOffset to zero on the dummy field that we create for
4310         the class.   Fixes 74590.
4311
4312 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4313
4314         Fix #73834.
4315         * ecore.cs (PropertyExpr.resolved): New.
4316         (DoResolve): Use it to handle a case of double resolution here.
4317         Handle a case of identical-name-and-type-name.
4318         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4319         resolution by storing the results of expression resolution back
4320         into the "probes" array.
4321
4322 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4323
4324         Fix cs0208-7.cs and cs0208-8.cs.
4325         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4326         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4327         error reporting to point out the reason a struct is not unmanaged.
4328
4329 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4330
4331         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4332           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4333
4334 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4335
4336         Fix #74528.
4337         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4338         IdenticalNameAndTypeName here.
4339         (EventExpr.InstanceResolve): Likewise.
4340
4341 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4342
4343         C# 2.0 DefaultCharSetAttribute implementation
4344         
4345         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4346         which allows us to set GlobalNamespace for every resolve.
4347         (Attribute.ResolveArguments): Cut from Resolve.
4348         (Attribute.GetCharSetValue): Returns CharSet named argument.
4349         (Attribute.DefinePInvokeMethod): Gets default charset from
4350         module settings.
4351         (GlobalAttribute.ResolveAsTypeStep): Override.
4352         (GlobalAttribute.ResolveArguments): Override.
4353         
4354         * class.cs (TypeAttr): Is protected.
4355         
4356         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4357         (ModuleClass.DefaultCharSetType): New memeber.
4358         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4359         
4360         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4361         charset from module.
4362         
4363         * delegate.cs (TypeAttr): Override.
4364         (Delegate.DefineType): Use this TypeAttr.
4365         
4366         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4367         at very early stage (before types are defined) to resolve model
4368         module attributes. It will probably not work with corlib but it
4369         should be ok.
4370         
4371         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4372         charset from module.
4373         
4374         * typemanager.cs (default_charset_type): New type.
4375
4376 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4377
4378         * decl.cs (MemberCache.AddMethods): Don't warn if
4379         System.Object.Finalize has buggy MethodAttributes.
4380
4381         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4382         removed below.
4383
4384 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4385
4386         * doc.cs : detect ambiguous reference to overloaded members.
4387           Fixed bug #71603. MS 1.1 csc does not detect it.
4388
4389 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4390
4391         * doc.cs : delegates must not be referenced with parameters.
4392           Fixed bug #71605.
4393
4394 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4395
4396         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4397
4398 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4399
4400         * driver.cs (MainDriver): Stop processing if the CLS stage found
4401         errors. 
4402
4403         (CompilerCallableEntryPoint.InvokeCompiler): Always
4404         reset after execution;   Take a TextWriter argument for the
4405         output.
4406
4407         * report.cs: Use the error stream instead of hardcoding stderr. 
4408
4409 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4410
4411         * class.cs: Reduce code paths to test, too small of an
4412         optimization to make it worth the extra testing.  Always perform
4413         it. 
4414
4415 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4416
4417         Fix #74510.
4418         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4419         operators that had errors reported on them.
4420
4421 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4422
4423         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4424         argument types.
4425         (Attribute.Resolve): Add named argument type checking.
4426         
4427         * class.cs (FixedField.Define): Use IsPrimitiveType
4428         
4429         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4430         
4431         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4432         unsafe parameter types.
4433         
4434         * statement.cs (Using.ResolveExpression): Add better error description.
4435         
4436         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4437         
4438 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4439
4440         Fix #74484.
4441         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4442         AttributeUsageAttribute in the emitcontext of the attribute class,
4443         not in the emitcontext of the attributable entity it was attached to.
4444         * cs-parser.jay: Use 'current_class', not 'current_container',
4445         when creating a GlobalAttribute.
4446
4447 2005-04-08  Alp Toker  <alp@atoker.com>
4448
4449         * pending.cs: The fix to #58413 failed to compile methods implementing
4450         interfaces with/without params modifiers and vice versa, even though
4451         params modifiers aren't part of the signature. Make the modifier check
4452         less strict as in csc.
4453
4454 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4455             Anoob V E  <projectmonokochi@rediffmail.com>
4456             Harilal P R  <projectmonokochi@rediffmail.com>
4457
4458         Fix #58413.
4459         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4460         modifiers of pending methods.
4461         (PendingImplementation.PendingImplementation): Initialize it.
4462         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4463         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4464         with ParameterData.  Add check for modifiers.
4465         * class.cs (MethodData.Define): Update to changes.
4466
4467 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4468
4469         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4470
4471 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4472
4473         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4474         property.
4475         
4476         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4477         
4478         * rootcontext.cs,
4479         * typemanager.cs: Registered RequiredAttributeAttribute.
4480         
4481 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4482
4483         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4484         Warning CS0169 is back at level 3.
4485         (IMethodData.SetMemberIsUsed): New method.
4486         
4487         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4488         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4489         
4490         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4491
4492         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4493         contants.
4494         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4495         is used.
4496         
4497         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4498         is used.
4499         
4500         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4501         to avoid the problems with nested types.
4502
4503 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4504             Anoob V.E  <projectmonokochi@rediffmail.com>
4505             Harilal P.R  <projectmonokochi@rediffmail.com>
4506             Raja R Harinath  <rharinath@novell.com>
4507
4508         Fix #73820.
4509         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4510         attribute.
4511         * typemanager (GetConstructor): Make public.
4512
4513 2005-04-05  John Luke  <john.luke@gmail.com>
4514             Raja R Harinath  <rharinath@novell.com>
4515
4516         Fix #62232.
4517         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4518         struct too.  Return false quicker in a few cases.
4519         (VerifyUnManaged): Use it.
4520
4521 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4522
4523         Fix #74041.
4524         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4525         not 'unreachable_seen'.
4526
4527 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4528
4529         * attribute.cs (Attribute.GetValue): Removed unused.
4530         
4531         * codegen.cs (CodeGen.TrimExt): Removed unused.
4532         
4533         * cs-parser.jay (output): Removed unused.
4534         
4535         * cs-tokenizer.cs (hex_digits): Removed unused.
4536         
4537         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4538         
4539         * expression.cs (Indirection.LoadExprValue): Removed unused.
4540         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4541         
4542         * iterators.cs (Iterator.param_types): Removed unused.
4543         
4544         * statement.cs (Goto.block): Removed unused.
4545         (ToplevelBlock.did): Removed unused.
4546         (Switch.ResolveConstantSwitch): Removed unused.
4547
4548 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4549
4550         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4551         resetting thingy.
4552
4553 2005-04-19  Martin Baulig  <martin@ximian.com>
4554
4555         Merged r42462 from MCS and made it work for GMCS.
4556
4557         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4558
4559         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4560
4561 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4562
4563         Fix #74232 and cs0208-3.cs.
4564         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4565         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4566         unmanaged type.  Don't use FieldBuilders when 't' is a
4567         TypeBuilder.  Use ModFlags and MemberType fields.
4568         * class.cs (MemberBase.member_type): Rename from MemberType.
4569         (MemberBase.MemberType): New property.  Determines member_type on
4570         demand.
4571         (MemberBase.DoDefine): Don't initialize MemberType here.
4572         (FieldMember.Define): Likewise.
4573
4574 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4575
4576         Fix #74241
4577         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4578         Attributes are emitted there.
4579         
4580 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4581
4582         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4583         keyword in 'partial enum' too.
4584         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4585         is not allowed).
4586         Report from Kamil Skalski <nazgul@omega.pl>.
4587
4588         Fix #74309.
4589         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4590         have partial containers too.
4591
4592         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4593         in block' checks to Block.CheckInvariantMeaningInBlock.
4594         * statement.cs (Block.GetKnownVariableInfo): Make private.
4595         (Block.IsVariableUsedInChildBlock): Remove.
4596         (Block.IsVariableUsedInBlock): Likewise.
4597         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4598         conflicting declaration.
4599         (Block.AddVariable): Make error messages less long-winded and more
4600         specific.  Show location of conflicting declaration.
4601         * parameter.cs (Parameters.Location): New readonly property.
4602
4603 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4604
4605         Clean up semantics of invoking ResolveMemberAccess.
4606         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4607         can have an instance, ensure that we pass in a non-TypeExpression
4608         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4609         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4610         argument.  Update to changes and simplify.
4611         (FieldExpr.Emitinstance): Remove CS0120 check.
4612         (PropertyExpr.EmitInstance): Likewise.
4613         * expression.cs (Argument.Resolve): Likewise.
4614         (Invocation.DoResolve): Update to changes in semantics of
4615         InstanceExpression.
4616
4617 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4618
4619         Fix #74241
4620         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4621         customization.
4622         
4623         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4624
4625 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4626
4627         Fix difference in behaviour with commandline invocation.
4628         * driver.cs (Driver.Reset): New.
4629         (CompilerCallableEntryPoint): Call it.
4630
4631         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4632         variable" warnings if the boolean expression failed to resolve.
4633
4634 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4635
4636         * attribute.cs: Fix the union of several permissions when some of them
4637         are unrestricted (so the result isn't an unrestricted permission set).
4638         Fix #74036.
4639
4640 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4641
4642         * ecore.cs (MemberExpr): New class.  Convert from interface
4643         IMemberExpr.
4644         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4645         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4646         error checks.
4647         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4648         (MethodGroupExpr.IsExplicitImpl): Remove.
4649         (Expression.GetFieldFromEvent): Remove.
4650         (SimpleName.MemberStaticCheck): Remove.
4651         (SimpleName.DoSimpleNameResolve): Update to changes.
4652         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4653         (MemberAccess.IdenticalNameAndTypeName): Remove.
4654         (MemberAccess.error176): Move to MemberExpr.
4655         (MemberAccess.DoResolve): Update to changes.
4656         (BaseAccess.DoResolve): Likewise.
4657
4658 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4659
4660         C# 2.0 Conditional attribute class implementation
4661         
4662         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4663         Analyzes class whether it has attribute which has ConditionalAttribute
4664         and its condition is not defined.
4665         
4666         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4667         (Class.IsExcluded): New method. Search for at least one defined
4668         condition in ConditionalAttribute of attribute class.
4669
4670 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4671
4672         * ecore.cs (PropertyExpr): Derive from Expression, not
4673         ExpressionStatement.
4674         (PropertyExpr.EmitStatement): Remove.
4675
4676 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4677
4678         Fix #74060.
4679         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4680         internal field "value__" of an enum be private.  The examples for
4681         "value__" that I found on MSDN all used FieldAttributes.Private.
4682
4683         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4684         Don't mention IL method attribute names.
4685
4686         Fix #47991.  Remove a TODO.
4687         * statement.cs (Block.Toplevel): Make into a field.
4688         (Block.Parameters): Move into ToplevelBlock.
4689         (Block.known_variables): Rename from child_variable_names.
4690         (Block.Block): Remove variants that take Parameters.  Initialize
4691         'Toplevel' with the immediately surrounding toplevel block.
4692         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4693         LocalInfo parameter.
4694         (Block.GetKnownVariableInfo): New.
4695         (Block.IsVariableNameUsedInChildBlock): Update.
4696         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4697         the block, even though it may not be in scope.
4698         (Block.AddVariable): Remove Parameters parameter.  Use
4699         Toplevel.Parameters instead.
4700         (Block.AddConstant): Remove Parameters parameter.
4701         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4702         (Block.IsParamaterReference): Likewise.
4703         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4704         (ToplevelBlock.Parameters): New.  Moved from Block.
4705         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4706         initialize Parameters to a non-null value.
4707         * cs-parser.jay: Update to changes.
4708         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4709         simple names that mean different things in the same block.  Use
4710         Block.IsVariableNameUsedInBlock.
4711
4712 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4713
4714         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4715
4716 2005-03-26  Raja R Harinath  <harinath@acm.org>
4717
4718         Fix #73038.
4719         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4720         fails to resolve, ensure that the LHS is still resolved as an
4721         lvalue.
4722
4723 2005-03-25  Raja R Harinath  <harinath@acm.org>
4724
4725         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4726         ec.ContainerType.
4727         (Enum.current_ec): Remove.
4728         (Enum.LookupEnumValue): Remove EmitContext argument.
4729         Just uses the one created during DefineType.
4730         (Enum.FindMembers): Update.
4731         * expression.cs (MemberAccess.DoResolve): Update.
4732
4733 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4734
4735         * assign.cs (Assign.DoResolve): Check for CS1717 when
4736         source and target are same (uses Equals).
4737
4738         * expression.cs (LocalVariableReference, ParameterReference,
4739         This): Implemented Equals, GetHashCode.
4740
4741         * statement.cs (Block.GetParameterReference): Removed useless
4742         local variable.
4743
4744 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4745
4746         Fix cs0128.cs
4747         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4748         blocks before deciding whether the error is cs0136 or cs0128.
4749
4750         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4751         (using_alias_directive, using_namespace_directive): Pass
4752         MemberName, not an expression to Namespace.UsingAlias and
4753         Namespace.Using.
4754         (MakeName): Use the MemberName of the namespace.
4755         * namespace.cs (Namespace.MemberName): New.
4756         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4757         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4758         Likewise.
4759         * decl.cs (MemberName.Name): Make readonly.
4760         (MemberName.FromDotted): New "constructor".
4761         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4762         (MemberCore.Name): Compute from MemberName on demand.
4763         (MemberCore.SetMemberName): Provide a way to change the
4764         MemberName.
4765         (MemberCore.AddToContainer): Don't take a fullname parameter.
4766         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4767         fully qualified name of the container to the member name.
4768         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4769         only if the type is a member of the root container.
4770         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4771         MemberName.Left rather than searching for an embedded ".".
4772         (PartialContainer.CreatePart): Update to changes in RootContext.
4773         (MemberBase.ShortName): Turn into a property.  Use
4774         MemberCore.SetMemberName.
4775         (MemberBase.ExplicitInterfaceName): Remove.
4776         (MemberBase.UpdateMemberName): Remove.
4777         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4778         (PropertyBase.SetMemberName): New override.
4779         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4780         (Tree.GetDecl): New.
4781         (Tree.AllDecls): Rename from Decls.
4782         * attribute.cs, enum.cs, report.cs: Update to changes.
4783         * driver.cs (MainDriver): Use MemberName.FromDotted on
4784         RootContext.MainClass.
4785
4786 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4787
4788         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4789         checks.
4790
4791         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4792
4793 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4794
4795         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4796         property accessor modifiers.
4797
4798         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4799         fixed buffer attribute (CS1716).
4800         (PropertyMethod.HasCustomAccessModifier): When property accessor
4801         has custom modifier.
4802
4803         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4804         modifiers.
4805         (PropertyExpr.DoResolveLValue): Add CS0272.
4806
4807 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4808
4809         * convert.cs: When converting to a pointer, use the proper Conv.U
4810         or Conv.I depending on the source data type.
4811
4812         * cs-tokenizer.cs: Make the size for large decimal constants,
4813         fixes #72957.
4814
4815 2005-03-17  Martin Baulig  <martin@ximian.com>
4816
4817         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4818         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4819
4820 2005-03-17  Martin Baulig  <martin@ximian.com>
4821
4822         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4823         to bool so we can return an error condition.
4824         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4825         returned an error.
4826
4827 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4828
4829         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4830         attributes.
4831
4832 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4833
4834         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4835         Refactor to avoid traversing the list of assemblies, and to avoid
4836         string concatenation.
4837         * typemanager.cs (guid_attr_type): Remove.
4838         (negative_hits, pointers, references): Remove hashes.
4839         (type_hash): New.
4840         (GetConstructedType): New.  Uses type_hash to handle constructed
4841         types (arrays, references, pointers).
4842         (GetReferenceType, GetPointerType): Use it.
4843         (GetNestedType): New.  Uses type_hash to handle nested types of
4844         reflected types.
4845         (LookupType, LookupTypeDirect): Remove.
4846         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4847         'types' hash and LookupTypeReflection directly.
4848         (params_string, params_object): Use GetConstructedType.
4849         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4850         top-level types.
4851         (Namespace.Lookup): Use cached_types.
4852         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4853         provided by old TypeManager.LookupType.
4854         * rootcontext.cs (MakeFQN): Remove.
4855         * decl.cs (DeclSpace.MakeFQN): Likewise.
4856         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4857         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4858         TypeManager.GetConstructedType.
4859         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4860
4861 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4862
4863         * cs-parser.jay: Fix build.
4864
4865 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4866
4867         * class.cs (TypeContainer.CircularDepException) New nested
4868         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4869
4870         * cs-parser.jay: Reports CS1527 for any namespace element.
4871
4872         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4873         Added CS0407.
4874
4875         * expression.cs (ParameterReference.IsAssigned): Changed error to
4876         CS0269.
4877         (Error_WrongNumArguments): Moved CS0245 detection here.
4878
4879         * statement.cs (Return.Resolve): Add CS1622 report.
4880
4881 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4882
4883         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4884
4885 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4886
4887         * attribute.cs expression.cs: Get rid of some allocations.
4888
4889 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4890
4891         * doc.cs : just eliminate the latest change.
4892
4893 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4894
4895         * doc.cs : commented out the latest change. It breaks xml-030.cs
4896
4897 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4898
4899         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4900           fail. So invoke CreateType() in FindDocumentedType().
4901
4902 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4903
4904         * cs-tokenizer.cs : added IsKeyword().
4905         * doc.cs : Detect keyword incorrectly used as identifier.
4906           Allow identifiers prefixed by @.
4907
4908 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4909
4910         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4911         It caused exception in namespace resolving (again!).
4912         
4913         * class.cs (Class.ctor): Removed exit.
4914         (PropertyMethod.ctor): ditto.
4915         
4916         * codegen.cs (Codegen.Reset): Reset static data.
4917         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4918         
4919         * cs-tokenizer.cs (Cleanup): Removed.
4920         
4921         * driver.cs (GetSystemDir): Rewrote to one line command.
4922         It caused problem with unloaded dynamic modules.
4923         (UnixParseOption): Removed Exit.
4924         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4925         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4926         Now can be mcs used as library.
4927         
4928         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4929         empty location.
4930         
4931         * location.cs (Reset): Reset static data.
4932         
4933         * namespace.cs (Reset): Reset static data.
4934         
4935         * report.cs (Report.Reset): Reset static data.
4936         
4937         * rootcontext.cs (RootContext.Reset): Reset static data.
4938         
4939         * tree.cs (RootTypes.ctor): Use Location.Null
4940         
4941         * typemanager.cs (TypeManager.Reset): Reset static data.
4942         (CoreLookupType): Removed Exit.
4943         (TypeHandle.Reset): Reset static data.
4944         
4945 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4946
4947         Fix #73516.
4948         * typemanager.cs (ComputeNamespaces): Import namespaces from
4949         referenced modules too.
4950
4951 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4952
4953         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4954         than '.'.
4955
4956 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4957
4958         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4959         enclosing DeclSpace.  This ensures that a name-lookup populates
4960         more caches and there are fewer 'TypeExpression's.  Carve out
4961         nested type lookup into ...
4962         (LookupNestedTypeInHierarchy): ... this.
4963
4964 2005-04-15  Martin Baulig  <martin@ximian.com>
4965
4966         Merged r41590 from MCS and make it work in the generics land.
4967
4968         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4969         `check' argument.
4970
4971         * class.cs (PartialContainer.UpdateConstraints): Removed.
4972         (PartialContainer.CheckConstraints): Removed.
4973         (PartialContainer.SetParameterInfo): Store the constraints here.
4974         (PartialContainer.DefineTypeParameters): New public method;
4975         resolve the type parameter's constraints here.  Note that the
4976         PartialContainer doesn't have an EmitContext anymore, so we must
4977         do this in the ClassPart.
4978
4979 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4980
4981         Clean up a few partial-class semantics.  
4982         Fixes test-357.cs and cs1618-2.cs.
4983         * cs-parser.jay (struct_declaration): Use 'current_class' as
4984         parent of newly-created struct.  Remove call to Register ().
4985         Use 'pop_current_class' to complete handing the current struct.
4986         (interface_declaration): Likewise.
4987         (class_declaration): Likewise.
4988         (enum_declaration): Use 'current_class' as parent of newly created
4989         enum.
4990         (delegate_declaration): Likewise.
4991         (pop_current_class): New function.  This is used to handle closing
4992         up the 'current_class' and 'current_container', and pointing them
4993         to the enclosing class/container.
4994         (CSharpParser): Initialize 'current_class' too.
4995         * decl.cs (MemberCore): Add check for invariant: a partial
4996         container is not a parsed entity, and thus does not enclose any
4997         parsed members.
4998         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4999         (DeclSpace.BaseTypeExpr): Use it.
5000         (DeclSpace.LookupType): Add check for invariant.
5001         * class.cs (TypeContainer): Add check for invariant: a nested
5002         class should have the same NamespaceEntry as its enclosing class.
5003         (TypeContainer.EmitFieldInitializers): Make virtual.
5004         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5005         MemberCore.
5006         (TypeContainer.Register): Remove.
5007         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5008         null.  Use TypeResolveEmitContext for resolving base types and
5009         interfaces.  Move initialization of Parts.TypeBuilder here from
5010         ...
5011         (TypeContainer.DefineNestedTypes): ... here.
5012         (PartialContainer): Take a Namespace not a NamespaceEntry.
5013         (PartialContainer.Create): Don't use Register.  Call the
5014         appropriate Add... function directly.
5015         (ClassPart): Take both the PartialContainer and the enclosing
5016         class as constructor arguments.
5017         (ClassPart.EmitFieldInitializers): Override.
5018         (ClassPart.PartFindNestedTypes): Remove.
5019         (FieldBase.GetInitializerExpression): Resolve the initializer
5020         expression in the emit context of the enclosing class.
5021         * tree.cs (RootTypes): Remove Register ().
5022         
5023 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5024
5025         * cs-parser.jay: Removed CS0134.
5026         
5027         * driver.cs: Removed CS1901.
5028         
5029         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5030         for predefined types.
5031
5032 2005-03-07  Duncan Mak  <duncan@novell.com>
5033
5034         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5035         well. Fixes bug #73454.
5036
5037 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5038
5039         * cs-tokenizer.cs (xtoken): Add CS1035.
5040         
5041         * class.cs (MethodData.Define): Add CS0683.
5042         (FieldMember.ctor): Add CS0681.
5043
5044 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5045
5046         * ecore.cs (SimpleName.DoResolve): Rename from
5047         SimpleName.DoResolveAllowStatic.
5048         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5049         Pass 'intermediate' flag to MemberStaticCheck.
5050         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5051         of "intermediate" lookups via MemberAccess.
5052         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5053         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5054
5055 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5056
5057         Fix #73394.
5058         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5059         slipped in because of variable names that are identical to a
5060         builtin type's BCL equivalent ('string String;', 'int Int32;').
5061         (PropertyExpr.EmitInstance): Likewise.
5062
5063 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5064
5065         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5066         
5067         * report.cs (warning_ignore_table): Made public.
5068
5069 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5070
5071         Fix #73282.
5072         * class.cs (MethodData.Emit): Pass 'container' to
5073         container.GetObsoleteAttribute instead of 'container.Parent'.
5074
5075 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5076
5077         * cs-parser.jay: Add 1534 error test.
5078
5079         * iterators.cs (Yield.CheckContext): Add error 1629.
5080         (Iterator.ctor): Save unsafe modifier.
5081         (MoveNextMethod.DoEmit): Restore unsafe context.
5082
5083         * namespace.cs (UsingAlias): Better error message.
5084
5085 2005-03-03  Dan Winship  <danw@novell.com>
5086
5087         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5088         the warning message [#73219]
5089
5090 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5091
5092         Fix compile with MCS 1.0.0.0.
5093         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5094         w_restore to not depend on string constant folding.
5095
5096 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5097
5098         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5099         CS0246 check to users who passed 'silent = false'.
5100         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5101         check.
5102         (SimpleName.SimpleNameResolve): Update.
5103         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5104         (MemberAccess.IdenticalNameAndTypeName): Update.
5105         * doc.cs (FindDocumentedTypeNonArray): Update.
5106
5107 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5108
5109         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5110         * parameters.cs (ComputeAndDefineParameters): Remove.
5111         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5112         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5113         Use GetParameterInfo.
5114
5115 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5116
5117         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5118
5119 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5120
5121         Unify DeclSpace.LookupType and DeclSpace.FindType.
5122         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5123         is in charge of defining nested types on demand.
5124         (DeclSpace.LookupType): Use it when the current_type is a
5125         TypeBuilder.  Use LookupTypeDirect for reflected types.
5126         (DeclSpace.FindType): Remove.
5127         (DeclSpace.LookupInterfaceOrClass): Likewise.
5128         (DeclSpace.DefineTypeAndParents): Likewise.
5129         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5130         DeclSpace.LookupType.
5131         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5132         * typemanager.cs (LookupType): Simplify.
5133         (AddUserType): Remove type from negative_hits.
5134         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5135         * class.cs (TypeContainer.FindMembers): Move handling of nested
5136         types ...
5137         (TypeContainer.FindMembers_NestedTypes): ... here.
5138         (TypeContainer.FindNestedType): Implement override.
5139         (ClassPart.FindNestedType): Delegate to PartialContainer.
5140         (ClassPart.PartFindNestedType): Looks up the nested types of the
5141         part alone.
5142
5143 2005-04-14  Martin Baulig  <martin@ximian.com>
5144
5145         * generic.cs (ConstructedType): Moved all the type lookup and
5146         nested class logic into SimpleName.
5147         (ConstructedType.ResolveConstructedType): Our underlying type is
5148         already fully resolved; all the type lookup stuff is in
5149         SimpleName.
5150
5151         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5152         constructed types here instead of in ConstructedType.
5153
5154         * decl.cs (MemberName.GetTypeExpression): Always create a
5155         SimpleName, not a ConstructedType.
5156         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5157
5158 2005-03-02  Martin Baulig  <martin@ximian.com>
5159
5160         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5161         static constructor in static classes.
5162
5163 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5164
5165         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5166         sizeParamIndex is not specified.
5167
5168 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5169
5170         Fix #73117
5171         * report.cs (WarningMessage.IsEnabled): Missing null check.
5172
5173 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5174
5175         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5176         in the fields and not in the properties.
5177
5178 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5179
5180         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5181         fields as well.
5182
5183 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5184
5185         * attribute.cs: Small refactoring (improved robustness).
5186         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5187         (ValidateGuid): Removed.
5188         (Resolve): Removed referenced to above mentioned.
5189         (GetAttributeUsage): Made private and changed to work without
5190         class assistance.
5191         (GetIndexerAttributeValue): Don't crash.
5192         (GetConditionalAttributeValue): Ditto.
5193         (GetClsCompliantAttributeValue): Ditto.
5194         (ExtractSecurityPermissionSet): All attributes exceptions are
5195         error 648.
5196         (GetPropertyValue): New helper.
5197         (GetMethodImplOptions): New method.
5198         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5199         some missing properties.
5200         
5201         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5202         (Method.ApplyAttributeBuilder): Updated.
5203         
5204         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5205         exception.
5206
5207 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5208
5209         Fix #73052.
5210         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5211         non-simple types (array, pointer, reference).
5212
5213 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5214
5215         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5216
5217         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5218         for operators.
5219         (Method.CheckBase): Catch wrong destructor here.
5220         (MethodData.Define): Add errors 550, 668.
5221
5222         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5223
5224         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5225
5226         * pending.cs (VerifyPendingMethods): Add error 551.
5227
5228         * typemanager.cs (CSharpName): Next error report helper.
5229
5230 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5231
5232         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5233         attributes. Removed useless attribute double check.
5234         It saves almost 2MBs for corlib.
5235
5236 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5237
5238         Fix #72924.
5239         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5240         called twice in case of error.
5241
5242 2005-02-23  Chris Toshok  <toshok@ximian.com>
5243
5244         Fix compiler portions of #72827.
5245         * statement.cs (Block.Emit): call Begin/EndScope on the
5246         EmitContext instead of the ILGenerator.
5247
5248         * codegen.cs (EmitContext.BeginScope): new method, call
5249         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5250         we have one.)
5251         (EmitContext.BeginScope): same, but EndScope and CloseScope
5252
5253         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5254         offset and call the superclass's OpenScope(int) with it.
5255         (SymbolWriter.CloseScope): get the current il
5256         offset and call superclass's CloseScope(int) with it.
5257
5258 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5259
5260         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5261         CS1677 for out and ref as well.
5262
5263         * class.cs (Method.Define): Add error CS1599 detection.
5264         
5265         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5266         
5267         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5268         
5269         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5270         
5271         * support.cs.cs (ModifierDesc): New helper method.
5272
5273 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5274             Abin Thomas  <projectmonokochi@rediffmail.com>
5275             Anoob V E  <projectmonokochi@rediffmail.com>
5276             Harilal P R  <projectmonokochi@rediffmail.com>
5277
5278         Fix #57851, #72718.
5279         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5280         MemberLookup (used for error reporting) actually returns a result.
5281         Fix error report number (122, not 112).
5282
5283 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5284             Anoob V E  <projectmonokochi@rediffmail.com>
5285             Harilal P R  <projectmonokochi@rediffmail.com>
5286
5287         Fix #71134.
5288         * pending.cs (PendingImplementation.GetAbstractMethods):
5289         Find NonPublic members too.
5290
5291 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5292
5293         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5294         Fixed error 217.
5295         
5296         * class.cs (MethodCore.CheckMethodAgainstBase):
5297         Add error 239 report.
5298
5299 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5300
5301         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5302         
5303         * class.cs (Operator.Define): Add error 217 report.
5304         
5305 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5306
5307         Fix #68955.
5308         * expression.cs (Invocation.IsApplicable): Make public.
5309         (Invocation.IsParamsMethodApplicable): Likewise.
5310         * delegate.cs (Delegate.VerifyApplicability): Don't use
5311         Invocation.VerifyArgumentCompat for parameter applicability
5312         testing.  Use Invocation.IsApplicable and
5313         Invocation.IsParamsMethodApplicable.
5314
5315 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5316
5317         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5318         
5319         * class.cs (Operator.Define): Add error 217 report.
5320         
5321 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5322
5323         * namespace.cs (UsingEntry.Resolve): Undo change below.
5324
5325 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5326
5327         Fix #72756.
5328         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5329         disable the error message when the extended MemberLookup also
5330         fails.
5331         (Expression.MemberLookupFinal): Update.
5332         (SimpleName.DoSimpleNameResolve): Update.
5333         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5334         Don't use MemberLookupFinal.
5335         (New.DoResolve): Update.
5336         (BaseAccess.CommonResolve): Update.
5337
5338 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5339
5340         Fix #72732.
5341         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5342         occured previously, don't resolve again.
5343
5344 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5345
5346         Fix #69949
5347         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5348         argument. Call ResolveAttributeUsage for unresolved.
5349         when types doesn't match ctor arguments.
5350         
5351         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5352         for nested attribute classes.
5353         (Class.attribute_usage): Removed.
5354         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5355         for attribute class.
5356         
5357         * ecore.cs (IsAttribute): Removed.
5358         
5359         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5360         
5361         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5362         now normal types.
5363         (attribute_types): Removed.
5364         (EmitCode): Global attributes are emited as the latest.
5365
5366 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5367
5368         * class.cs (EmitFieldInitializers): Don't emit field initializer
5369         for default values when optimilization is on.
5370         
5371         * constant.cs (Constant.IsDefaultValue): New property.
5372         
5373         * driver.cs: Add /optimize handling.
5374         
5375         * constant.cs,
5376         * ecore.cs,
5377         * literal.cs: Implement new IsDefaultValue property.
5378         
5379         * rootcontext.cs (Optimize): New field, holds /optimize option.
5380
5381 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5382
5383         Fix crasher in re-opened #72347.
5384         * namespace.cs (Namespace.Lookup): Return null if
5385         DeclSpace.DefineType returns null.
5386
5387         Fix #72678.
5388         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5389
5390 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5391
5392         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5393         now returns null if it cannot resolve to an lvalue.
5394         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5395         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5396         returned null.  Remove check for SimpleName.
5397         (EventExpr.DoResolveLValue): New.
5398         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5399         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5400         error from ...
5401         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5402         avoid CS0131 error.
5403         (Unary.ResolveOperator): Move CS0211 check ...
5404         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5405         CS0131 error.
5406         (Unary.DoResolveLValue): Simplify.
5407         (AddressOf.DoResolveLValue): New.
5408         (ArrayAccess.DoResolveLValue): New.
5409
5410 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5411
5412         * attribute.cs (Attribute.Resolve): Add arguments casting for
5413         when types doesn't match ctor arguments.
5414
5415 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5416
5417         Fix parts of #63202.
5418         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5419         lookup of operator in base type.  Ensure that all checks happen
5420         when the operator resolves to an "op_..." method.
5421
5422 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5423
5424         Fix #71992.
5425         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5426         'ignore_cs0104' parameter.  Pass it to ...
5427         (NamespaceEntry.Lookup): ... this.
5428         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5429         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5430         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5431         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5432         Update.  Request that cs0104 errors be ignored.
5433         (ComposedCast.ResolveAsTypeStep): Update.
5434
5435 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5436
5437         Fix #59209.
5438         * expression.cs (Invocation.BetterFunction): Remove support for
5439         comparing virtual functions and their overrides.
5440         (Invocation.IsOverride): New.
5441         (Invocation.OverloadResolve): Don't consider 'override' functions
5442         during candidate selection.  Store them in a lookaside list.
5443         If the selected method is a 'virtual' function, use the list to
5444         find any overrides that are closer to the LHS type.
5445
5446 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5447
5448         * expression.cs (New.DoResolve): Add complex core type reduction.
5449         (New.Constantify): Converts complex core type syntax like 'new int ()'
5450         to simple constant.
5451         
5452 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5453
5454         * decl.cs (EntryType.EntryType): New constructor to create an
5455         updated copy of a cache entry.
5456         (MemberCache.AddMethods): Use it.
5457         (MemberCache.ClearDeclaredOnly): Remove.
5458         (MemberCache.MemberCache): Update.
5459
5460 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5461
5462         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5463         variable.  This one is represents the actual low-level declaration
5464         of the method, as opposed to the semantic level `IsStatic'.   
5465
5466         An anonymous method which is hosted into a static method might be
5467         actually an instance method.  IsStatic would reflect the
5468         container, while MethodIsStatic represents the actual code
5469         generated.
5470
5471         * expression.cs (ParameterReference): Use the new MethodIsStatic
5472         instead of IsStatic.
5473
5474         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5475         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5476         set on the current EmitContext. 
5477
5478         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5479         resolve our casted expression as an LValue.  This triggers the
5480         proper LValue processing that is later required by Assign.
5481
5482         This fixes 72347.
5483
5484         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5485
5486 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5487
5488         C# 2.0 Fixed buffer implementation
5489
5490         * anonymous.cs: Update after RegisterHelperClass renaming.
5491
5492         * attribute.cs (AttributeTester.fixed_buffer_cache):
5493         Cache of external fixed buffers.
5494         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5495         implementation if field is fixed buffer else null.
5496
5497         * class.cs
5498         (TypeContainer.AddField): Accept FieldMember instead of Field.
5499         (FieldBase.IsFieldClsCompliant): Extracted code from
5500         VerifyClsCompliance descendant customization.
5501         (FixedField): New class handles fixed buffer fields.
5502         (FixedFieldExternal): Keeps information about imported fixed
5503         buffer.
5504         (IFixedField): Make access to internal or external fixed buffer
5505         same.
5506
5507         * cs-parser.jay: Add fixed buffer parsing.
5508
5509         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5510         buffer.
5511
5512         * expression.cs (Indirection): Extended implementation to accept
5513         fixed buffer field.
5514         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5515         (ElementAccess.MakePointerAccess): Get type as parameter.
5516         (DoResolve): Add fixed buffer field expression conversion.
5517         (DoResolveLValue): Ditto.
5518         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5519         (ArrayPtr): Derives from FixedBufferPtr.
5520         (ArrayPtr.Emit): Add extra emit for array elements.
5521
5522         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5523
5524         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5525         for compiler generated types.
5526         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5527
5528         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5529         and consume less memory.
5530         (Fixed.Resolve): Add fixed buffer case.
5531
5532         * typemanager.cs (compiler_generated_attr_ctor,
5533         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5534         (HasElementType): Add our own implementation to work on every
5535         runtime.
5536
5537 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5538
5539         * anonymous.cs (CaptureContext): Track whether `this' has been
5540         referenced.   
5541
5542         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5543         only captured `this' if it was implicitly done (instance
5544         methods/variables were used). 
5545
5546         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5547         `this' must be captured.
5548
5549 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5550  
5551         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5552         is null it means that there has been no need to capture anything,
5553         so we just create a sibling.
5554
5555         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5556
5557         Just a partial fix.  The other half is fairly elusive.
5558         
5559 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5560
5561         Fix #52586, cs0121-4.cs.
5562         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5563         and return a hashtable.
5564         (MemberCache.ClearDeclaredOnly): New.
5565         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5566         the method_hash of a base type too.
5567         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5568         type methods.  Overwrite entries with the same MethodHandle so
5569         that the ReflectedType is correct.  The process leaves in base
5570         virtual functions and their overrides as distinct entries.
5571         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5572         matters since it was boxed in a ArrayList before.
5573         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5574         modifier.
5575         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5576         case of a virtual function and its override (choose the overload
5577         as better).
5578         (Invocation.OverloadResolve): Avoid 'override' members during
5579         'applicable_type' calculation.
5580
5581 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5582
5583         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5584         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5585         GetTypeHandle.  It is possible for a reflected type to derive from
5586         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5587         System.Array during mscorlib compilation).
5588         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5589         contain a method_hash, don't create one either.  Don't create a
5590         deep copy of the base cache's method_hash.
5591         (MemberCache.SetupCache): Rename back from DeepCopy.
5592         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5593         already initialized.  If we see an override function, add its
5594         underlying base virtual function to the member_hash too.
5595
5596 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5597
5598         Combine two near-redundant caches.
5599         * typemanager.cs (method_params): Rename from method_internal_params.
5600         (TypeManager.GetParameterData): New.  Replace
5601         Invocation.GetParameterData.
5602         (TypeManager.LookupParametersByBuilder): Remove.
5603         * expression.cs (Invocation.method_parameter_cache): Remove.
5604         (Invocation.GetParameterData): Remove.
5605         Update to changes.
5606         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5607         Update to changes.
5608
5609 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5610
5611         Fix #72015.
5612         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5613         TypeManager.multicast_delegate_type is null, resolve it by looking
5614         up "System.MulticastDelegate".
5615         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5616
5617 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5618             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5619             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5620
5621         Fix cs0164.cs.
5622         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5623         (LabeledStatement.AddReference): New.  Set 'referenced'.
5624         (Goto.Resolve): Use it.
5625
5626 2005-02-05  John Luke  <john.luke@gmail.com>
5627
5628         * driver.cs: remove duplicate -doc line in Usage ()
5629
5630 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5631
5632         * location.cs (Location.AddFile): Fix CS2002 error report.
5633
5634 2005-02-02  Martin Baulig  <martin@ximian.com>
5635
5636         * delegate.cs (Delegate.DefineType): Report an internal error if
5637         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5638         details.        
5639
5640 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5641
5642         Fix a crasher in a variant of #31984.
5643         * const.cs (Constant.CheckBase): New override that defers the
5644         new-or-override check in case the base type hasn't been populated
5645         yet.
5646         (Constant.Define): Ensure the new-or-override check is performed.
5647
5648 2005-02-01  Duncan Mak  <duncan@ximian.com>
5649
5650         * const.cs (LookupConstantValue): Check that `ce' is not null
5651         before calling GetValue ().
5652
5653 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5654
5655         Fix test-334.cs (#69519).
5656         * cs-parser.jay (using_alias_directive): Pass in an expression to
5657         NamespaceEntry.UsingAlias.
5658         (using_namespace_directive): Pass in an expression to
5659         NamespaceEntry.Using.
5660         (namespace_name): Don't flatten to a string.
5661         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5662         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5663         ResolveAsTypeStep.
5664         (NamespaceEntry.UsingEntry): Likewise.
5665         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5666         changes.
5667         (NamespaceEntry.LookupForUsing): Remove.
5668         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5669         names.
5670         (NamespaceEntry.Lookup): Remove support for dotted names.
5671
5672 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5673
5674         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5675         split into two.
5676         (NamespaceEntry.ImplicitParent): Compute on demand.
5677         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5678         parallels the current.
5679         (NamespaceEntry.LookupForUsing): Use it.
5680         (NamespaceEntry.Lookup): If the current namespace-entry is
5681         implicit, don't search aliases and using tables.
5682
5683 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5684
5685         Fix #31984.
5686         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5687         BaseCache here.
5688         (TypeContainer.BaseCache): Compute on demand.
5689         (TypeContainer.FindMembers): Define constants and types if they're
5690         not already created.
5691         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5692         check.
5693         * const.cs (Constant.Define): Make idempotent.
5694
5695 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5696
5697         * pending.cs: Produce better code (no nops produced by using Ldarg
5698         + value).
5699         
5700         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5701         i - 1' it should be arg + 1.
5702
5703         Fixes bug #71819.
5704
5705 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5706
5707         * attribute.cs (Attribute.CheckAttributeType): Make private
5708         non-virtual.
5709         (Attribute.ResolveType): Make virtual.
5710         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5711         handling of RootContext.Tree.Types.
5712
5713 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5714
5715         Update attribute-handling to use the SimpleName/MemberAccess
5716         mechanisms.
5717         * cs-parser.jay (attribute): Pass in an expression to the
5718         constructors of Attribute and GlobalAttribute.
5719         * attribute.cs (Attribute): Take an expression for the name.
5720         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5721         passed in attribute name expression.
5722         (Attribute.CheckAttributeType): Use it.
5723         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5724         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5725         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5726         argument to prevent error messages if the lookup fails.
5727
5728 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5729
5730         * expression.cs (Indirection): Implemented IVariable interface
5731         to support indirection in AddressOf operator.
5732         (PointerArithmetic.Emit): Add optimalization for case where
5733         result can be precomputed.
5734
5735 2005-01-26  Martin Baulig  <martin@ximian.com>
5736
5737         * class.cs (TypeContainer.AttributeTargets): Return the correct
5738         AttributeTargets depending on our `Kind' instead of throwing an
5739         exception; fixes #71632.
5740
5741 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5742
5743         Fix #71257
5744         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5745         constant members.
5746
5747 2005-03-17  Martin Baulig  <martin@ximian.com>
5748
5749         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5750         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5751
5752 2005-03-17  Martin Baulig  <martin@ximian.com>
5753
5754         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5755         to bool so we can return an error condition.
5756         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5757         returned an error.
5758
5759 2005-03-17  Martin Baulig  <martin@ximian.com>
5760
5761         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5762
5763         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5764         converting from an array-type of T to `IEnumerable<T>'.
5765
5766 2005-03-16  Martin Baulig  <martin@ximian.com>
5767
5768         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5769         (Nullable.LiftedUnaryMutator): New public class.
5770
5771         * expression.cs (UnaryMutator.DoResolve): Added support for
5772         Nullable Types.
5773
5774 2005-03-14  Martin Baulig  <martin@ximian.com>
5775
5776         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5777
5778 2005-03-14  Martin Baulig  <martin@ximian.com>
5779
5780         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5781         the comparision operators `<', `>', `<=' and `>='.
5782
5783 2005-03-13  Martin Baulig  <martin@ximian.com>
5784
5785         * generic.cs
5786         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5787         avoid confusion with the `NullLiteral'.
5788         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5789
5790 2005-03-13  Martin Baulig  <martin@ximian.com>
5791
5792         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5793         comparing arbitrary types with the null literal.
5794
5795 2005-03-13  Martin Baulig  <martin@ximian.com>
5796
5797         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5798         boolean operators '&&', '||', '&' and '|'.
5799         (Nullable.OperatorTrueOrFalse): New public class.
5800
5801         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5802         instead of a `StaticCallExpr'; added support for nullables.
5803
5804 2005-03-10  Martin Baulig  <martin@ximian.com>
5805
5806         * expression.cs
5807         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5808         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5809
5810 2005-03-07  Martin Baulig  <martin@ximian.com>
5811
5812         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5813         it work if `expr' is not an IMemoryLocation.
5814         (Nullable.Lifted): Implement IMemoryLocation.
5815         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5816         target type.
5817
5818 2005-03-05  Martin Baulig  <martin@ximian.com>
5819
5820         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5821         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5822         (Nullable): Added support for lifted unary and binary operators.
5823
5824         * expression.cs (Unary.DoResolve): Added support for nullable types.
5825         (Binary.DoResolve): Likewise.
5826         (Conditional.DoResolve): Likewise.
5827
5828 2005-03-02  Martin Baulig  <martin@ximian.com>
5829
5830         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5831
5832         * class.cs (ClassPart.SetParameterInfo): Override this.
5833         (PartialContainer.SetParameterInfo): Override this.
5834         (TypeContainer.CheckConstraints): New protected method.
5835         (PartialContainer.CheckConstraints): Override this and check
5836         whether the same contraints were specified in all parts of a
5837         partial generic type definition.
5838         (PartialContainer.UpdateConstraints): New public method.
5839
5840         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5841
5842 2005-03-02  Martin Baulig  <martin@ximian.com>
5843
5844         Committing a patch from Carlos Alberto Cortez to fix #72887.
5845
5846         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5847         casts from `T []' to `int []'.
5848
5849 2005-03-02  Martin Baulig  <martin@ximian.com>
5850
5851         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5852
5853         * expression.cs (Binary.ResolveOperator): When resolving a
5854         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5855         `=='.  Fixes #71866.  See gen-127.cs.
5856
5857 2005-03-02  Martin Baulig  <martin@ximian.com>
5858
5859         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5860         static constructor in static classes.
5861
5862 2005-03-02  Martin Baulig  <martin@ximian.com>
5863
5864         * generic.cs
5865         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5866         (Nullable.LiftedConversion): Added support for user-defined
5867         conversions.
5868
5869         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5870
5871         * cs-parser.jay: Use ComposedCast everywhere instead of
5872         NullableType, so we don't need to check for NullableType
5873         everywhere.
5874         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5875         case where we'll be resolved into a `parenthesized_expression_0'
5876         afterwards.
5877
5878         * convert.cs
5879         (Convert.UserDefinedConversion): Added nullable conversions.
5880
5881 2005-02-28  Martin Baulig  <martin@ximian.com>
5882
5883         * generic.cs (TypeManager.IsNullableType): New static method.
5884         (Nullable): New abstract class.
5885         (Nullable.NullLiteral): New public class.
5886         (Nullable.LiftedConversion): New public class.
5887
5888         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5889         `builtin_types opt_nullable'.
5890
5891         * convert.cs
5892         (Convert.ImplicitConversionStandard): Added nullable conversions.
5893         (Convert.ExplicitConversionStandard): Likewise.
5894         (Convert.ExplicitConversion): Likewise.
5895
5896 2005-02-26  Martin Baulig  <martin@ximian.com>
5897
5898         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5899         begin with a "?", for instance "?[]".  Don't do a type lookup if
5900         `dim' is empty.
5901
5902 2005-02-25  Martin Baulig  <martin@ximian.com>
5903
5904         The first part of Nullable Types :-)
5905
5906         * generic.cs (NullableType): New public class.
5907         (NullCoalescingOperator): New public class.
5908         (TypeArguments.Resolve): Add a CS0306 check.
5909
5910         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5911         (opt_nullable): New rule.
5912         (type): Added `opt_nullable' to `namespace_or_type_name',
5913         `builtin_types' and `pointer_type'.
5914         (array_type): Added `opt_nullable'.
5915         (opt_rank_specifier_or_nullable): New rule; this is the
5916         combination of `opt_rank_specifier' and `opt_nullable'.
5917         (opt_error): New rule; catch errors here.
5918         (nullable_type_or_conditional): New rule; we use this to check for
5919         nullable and still detect the conditional operator.
5920         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5921         instead `opt_rank_specifier'.
5922
5923         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5924         for nullables.
5925
5926 2005-02-24  Martin Baulig  <martin@ximian.com>
5927
5928         * README, README.Changes: Removed; they're old and obsolete.
5929
5930 2005-02-22  Martin Baulig  <martin@ximian.com>
5931
5932         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5933         returned an error, set `constraints' to null to avoid a crash
5934         later on.
5935         (TypeParameter.ResolveType): Likewise.
5936
5937 2005-02-22  Martin Baulig  <martin@ximian.com>
5938
5939         * generic.cs
5940         (Constraints.ResolveTypes): Protect against being called twice.
5941         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5942         (TypeParameter.ResolveType): New public method; calls
5943         constraints.ResolveTypes().
5944         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5945         into the new ResolveType().
5946         (GenericMethod.Define): Call ResolveType() on all our
5947         TypeParameter's.        
5948
5949 2005-02-21  Martin Baulig  <martin@ximian.com>
5950
5951         * generic.cs
5952         (TypeManager.generic_nullable_type): New static public field.
5953         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5954
5955         * rootcontext.cs
5956         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5957
5958 2005-02-15  Martin Baulig  <martin@ximian.com>
5959
5960         * generic.cs (ConstructedType.Constraints): Correctly check
5961         constraints if the argument type is a type parameter; fixes
5962         #72326. 
5963
5964 2005-02-02  Martin Baulig  <martin@ximian.com>
5965
5966         * delegate.cs (Delegate.DefineType): Report an internal error if
5967         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5968         details.        
5969
5970 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5971
5972         * pending.cs: Produce better code (no nops produced by using Ldarg
5973         + value).
5974         
5975         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5976         i - 1' it should be arg + 1.
5977
5978         Fixes bug #71819.
5979         
5980 2005-01-26  Martin Baulig  <martin@ximian.com>
5981
5982         * cs-parser.jay (indexer_declarator): Don't report an error if we
5983         have type parameters since we can be an explicit interface
5984         implementation; fixes #71449.
5985
5986 2005-01-26  Martin Baulig  <martin@ximian.com>
5987
5988         * class.cs (TypeContainer.AttributeTargets): Return the correct
5989         AttributeTargets depending on our `Kind' instead of throwing an
5990         exception; fixes #71632.
5991
5992 2005-01-26  Martin Baulig  <martin@ximian.com>
5993
5994         * delegate.cs (Delegate.DefineType): Correctly define our type
5995         parameters.  Fixes #71483.
5996
5997 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5998
5999         Fix #71602.
6000         * expression.cs (MemberAccess.DoResolve): Don't complain with
6001         cs0572 when the LHS of a member access has identical name and type
6002         name.
6003
6004 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6005
6006         Fix #71651, #71675
6007         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6008         CreatePermission.
6009         Create custom PermissionSet only for PermissionSetAttribute.
6010
6011 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6012
6013         Fix #71649
6014         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6015         delegates in static class.
6016
6017 2005-01-24  Martin Baulig  <martin@ximian.com>
6018
6019         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6020         merging an implicit block, just use its reachability.
6021
6022         * statement.cs (Block.Resolve): Make the unreachable code check
6023         work wrt. implicit blocks; see test-337 from #63842.
6024
6025 2005-01-21  Alp Toker  <alp@atoker.com>
6026  
6027         * cs-parser.jay: destructor_declaration's container is PartialContainer
6028         not Class when partial types are used, so use Kind prop instead of
6029         'is'.
6030         
6031 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6032
6033         * cs-parser.jay: Improve error reporting when an interface
6034         declares new types.
6035
6036 2005-01-20  Dick Porter  <dick@ximian.com>
6037
6038         * support.cs: SeekableStreamReader fix from Sandor Dobos
6039         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6040         chars are read.  Fixes bug 70369.
6041
6042 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6043
6044         * cs-parser.jay (catch_clause): Simplify current_block handling
6045         somewhat.
6046
6047 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6048
6049         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6050         code with ImplicitStandardConversion to handle the implicit
6051         conversion of method groups into valid delegate invocations. 
6052
6053         The problem is that in parameter handling we were using this code
6054         path.  Fixes bug #64698
6055
6056 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6057
6058         * cs-parser.jay: Fix several infelicities.
6059         - Avoid assigning to the parser value stack.  Code like 
6060           '$3 = null' is unclean.  Synthesize a value for the code block
6061           instead. 
6062         - Avoid using oob_stack for storing location information.  Use ...
6063         (_mark_): ... this.  New (empty) rule.  Saves the current location
6064         in $$.
6065         (foreach_statement): Avoid using oob_stack for current_block
6066         handling.  Use technique used in for_statement and
6067         using_statement.  Synthesize a value for the code block to store
6068         additional intermediate information.
6069
6070 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6071
6072         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6073         of a different type is only allowed to private fields of a
6074         containing type, not on fields of a base class.
6075
6076         See test-174.cs and error cs0122-9.cs
6077
6078 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6079
6080         Fix test-335.cs (bug #58126).
6081         * cs-parser.jay (argument): Split out non-expression parts of the
6082         rule into 'non_simple_argument'.
6083         (invocation_expression): Support parenthesized invocations with
6084         multiple arguments, and with single non-simple arguments.
6085
6086 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6087
6088         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6089         places.
6090
6091 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6092
6093         Fix cs0038-1.cs, cs1640-6.cs.
6094         * ecore.cs (Expression.Resolve): Remove special-case for
6095         SimpleName in error-handling.
6096         (Expression.almostMatchedMembers): Relax access permission to
6097         protected.
6098         (Expression.MemberLookupFailed): Handle duplicates in
6099         almostMatchedMembers list.
6100         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6101         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6102         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6103         overload if the passed in MemberInfo is a MethodBase.
6104
6105 2005-01-25  Martin Baulig  <martin@ximian.com>
6106
6107         * doc.cs
6108         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6109
6110 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6111
6112         Fix #70749
6113         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6114         for non-CAS & merge permission sets properly.
6115
6116 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6117
6118         Improve standard-compliance of simple name and member access 
6119         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6120         * ecore.cs (FullNamedExpression): New abstract base class 
6121         for Namespaces and TypeExpressions.
6122         (ResolveFlags.SimpleName): Remove.
6123         (SimpleName): Remove support for dotted names.
6124         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6125         DeclSpace.FindType and DeclSpace.LookupType.
6126         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6127         (Expression.ExprClassName): Make member function.
6128         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6129         a namespace.  Remove creation of dotted "SimpleName"s.
6130         (MemberAccess.DoResolve): Likewise.
6131         * decl.cs (DeclSpace.Cache): Make private.
6132         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6133         (DeclSpace.FindType): Update.
6134         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6135         FullNamedExpression.
6136         * namespace.cs (Namespace): Derive from FullNamedExpression
6137         so that it can be part of expression resolution.
6138         (Namespace.Lookup): Return an FullNamedExpression.
6139         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6140         namespace.
6141         * rootcontext.cs (NamespaceLookup): Remove.
6142         (LookupType): Move to DeclSpace.
6143         * attribute.cs (CheckAttributeType): Update.
6144         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6145         (FindDocumentedTypeNonArray): Likewise.
6146
6147 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6148
6149         Fix cs0509.cs, cs1632.cs.
6150         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6151         is the same as IsInterface.
6152         (TypeContainer.GetClassBases): Likewise.
6153         * statement.cs (LabeledStatement.ig): New field.
6154         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6155         label.
6156         (LabeledStatement.DoEmit): Check that the label was created with
6157         the same ILGenerator.
6158
6159 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6160
6161         Fix #71058
6162         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6163         accessors to its properties.
6164
6165         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6166         from accessors to property.
6167         
6168 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6169
6170         Fix #70722
6171         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6172         only for overrides.
6173         
6174 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6175
6176         * attribute.cs: Check for null and empty strings.  
6177
6178         I have lost another battle to Paolo.
6179
6180 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6181
6182         Fix #70942
6183         * class.cs (PropertyMethod): Set Parent field in ctors.
6184         (SetMethod.InternalParameters): Add unsafe switch hack.
6185         Override MarkForDuplicationCheck where it is appropriate.
6186
6187         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6188         It says whether container allows members with the same name.
6189         Base default is no.
6190         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6191         Removed is_method parameter.
6192
6193 2005-01-06  Duncan Mak  <duncan@ximian.com>
6194
6195         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6196         because the previous change led to incorrect reporting of CS1032
6197         ("Cannot define/undefine preprocessor symbols after first token in
6198         file"). Instead of using `tokens_seen' as the only flag that
6199         triggers CS1040, introduce `comments_seen'. This new flag is used
6200         to signify having seen comments on the current line, so it is
6201         unset after a newline.
6202
6203 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6204
6205         * doc.cs : When searching for a type, find nested type too.
6206           This fixes bug #71040.
6207
6208 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6209
6210         * doc.cs :
6211           - Warn missing member comment on those classes which also does not
6212             have doc comments. Fixed bug #71041.
6213           - Don't warn missing doc comment on default constructor.
6214             Fixed bug #71042.
6215
6216 2005-01-06  Duncan Mak  <duncan@ximian.com>
6217
6218         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6219         comments, set `tokens_seen' to true. This allows us to detect
6220         misplaced preprocessor directives (i.e. not at the beginning of
6221         the a line, nor after whitespaces). In that case, report error
6222         CS1040. This fixes bug #56460.
6223
6224         * cs-parser.jay (interface_member_declaration): Add checks for
6225         IsExplicitImpl, and report CS0541 error if an interface member is
6226         defined as an explicit interface declaration.
6227
6228 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6229
6230         Fix #70817
6231         * class.cs (PropertyMethod): Set Parent field in ctors.
6232         (SetMethod.InternalParameters): Add unsafe switch hack.
6233         
6234         * decl.cs (MemberCore.Parent): Cannot be readonly.
6235
6236 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6237
6238         * decl.cs (DeclSpace.ResolveType): Remove.
6239         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6240         Merge in code from ...
6241         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6242         * class.cs, enum.cs: Update to changes.
6243
6244 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6245
6246         * anonymous.cs: Ensure that we init the scope of our parent if it
6247         has not been initialized yet.
6248
6249 2004-12-30  Duncan Mak  <duncan@ximian.com>
6250
6251         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6252         if field.FieldBuilder is null. Fixes #70758.
6253
6254         * convert.cs: Fixed some typos and updated some of the comments.
6255         (ImplicitStandardConversionExists):
6256         (TryImplicitIntConversion): If `target_type' is an interface and
6257         the type of `ic' implements this interface, return true or a new
6258         BoxedCast instead of null. This fixes #70468.
6259
6260 2004-12-29  Duncan Mak  <duncan@ximian.com>
6261
6262         * expression.cs (Argument.Emit): Check that Expr is
6263         IMemoryLocation before casting to it, and report CS1510 otherwise.
6264
6265         This fixes #70402.
6266
6267 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6268
6269         * statement.cs (Block.ThisVariable): remove the recursion here, to
6270         make the --profile more sane.
6271
6272 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6273
6274         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6275         assembly, by JB Evain.
6276
6277 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6278
6279         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6280           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6281         "parent" refers to enclosing type/class.  "base" refers to superclass.
6282
6283 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6284
6285         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6286         Ensure that we only have GlobalAttributes.
6287         * attribute.cs (Attribute.Emit): Make non-virtual.
6288         (GlobalAttribute.Emit): Remove.
6289         (Attribute.Resolve): Make virtual.
6290         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6291         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6292         the argument. Don't create one.
6293         (Attribute.GetObsoleteAttribute): Likewise.
6294         (Attribute.GetClsCompliantAttributeValue): Likewise.
6295         * class.cs, decl.cs: Update to changes.
6296
6297 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6298
6299         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6300         
6301         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6302         
6303         * statement.cs (Foreach.Resolve): Add error 186 report.
6304
6305 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6306
6307         * expression.cs (Conditional.DoResolve): Add warning 429.
6308         
6309         * statement.cs (If.Resolve): Add warning 665.
6310
6311 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6312
6313         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6314         except when in the parser, and in GlobalAttribute.
6315         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6316         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6317         RootContext.Tree.Types.NamespaceEntry once work is done.
6318         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6319         and resets RootContext.Tree.Types.NamespaceEntry.
6320
6321 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6322
6323         * cs-parser.jay: Don't create a block for every variable.
6324
6325 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6326
6327         * location.cs: Provide extra information.
6328
6329         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6330         variables from the captured environment, it is the ldarg_0.
6331
6332 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6333
6334         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6335         find a conclusion.
6336         
6337         * class.cs: Changed warning level for 169 to avoid developer
6338         displeasure from warning flooding. It will be changed back when they
6339         fix most of current BCL warnings.
6340         
6341         * RootContext.cs: Pushed default WarningLevel to 3.
6342         
6343         * statement.cs: Removed unused variable.
6344
6345 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6346
6347         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6348         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6349         Add error 502 report.
6350         (StaticClass.DefineType): Add error 441 report.
6351         (Class.AllowedModifiersProp): New virtual property as temporary
6352         extension to AllowedModifiers.
6353         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6354         to share implementation with StaticClass and don't call virtual
6355         methods from ctor.
6356         
6357         * driver.cs (MainDriver): Add error 1558 test.
6358
6359         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6360         report. Moved error 36 test here.
6361
6362         * statement.cs (Throw.Resolve): Add error 724 report.
6363
6364         * typemanager.cs: Add out_attribute_type core type.
6365         
6366 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6367
6368         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6369         3018 report.
6370         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6371
6372         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6373         3017 report.
6374         
6375         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6376
6377         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6378         Add error 3023 report.
6379         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6380
6381         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6382         implementation.
6383
6384 2004-12-12  John Luke  <john.luke@gmail.com>
6385
6386         * driver.cs (AddArgs): take -- into account when
6387         adding arguments, fixes bug 65710 
6388
6389 2004-12-12  Martin Baulig  <martin@ximian.com>
6390
6391         * expression.cs (Unary.TryReduceNegative): Added support for
6392         SByteConstant and ByteConstant.
6393         (Unary.Reduce): Check error values from TryReduceNegative().
6394
6395 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6396
6397         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6398         and report exception as error 182.
6399
6400 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6401
6402         * driver.cs (Main): Fix message when there are warnings.
6403
6404 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6405
6406         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6407
6408 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6409
6410         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6411         Reduced number of warnings.
6412         
6413         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6414
6415 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6416
6417         * driver.cs: Removed message.
6418
6419         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6420
6421 2004-12-08    <vargaz@freemail.hu>
6422
6423         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6424
6425 2004-12-08  Martin Baulig  <martin@ximian.com>
6426
6427         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6428         instead of a CS3002 for properties and indexer.
6429
6430 2004-12-08  Martin Baulig  <martin@ximian.com>
6431
6432         * decl.cs (MemberName.ToString): Make this work again.
6433
6434 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6435
6436         * attribute.cs (Resolve): Add error 591 detection.
6437
6438         * class.cs (FieldMember.Define): Add error 1547 detection.
6439         (Indexer.Define): Add error 620 detection.
6440         (Operator.Define): Add error 590 detection.
6441
6442         * ecore.cs: Missing argument for error 79.
6443
6444         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6445         detection.
6446
6447 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6448
6449         Fix #70106
6450         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6451         only.
6452
6453 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6454
6455         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6456           Some operator comments were suppressed.
6457         * doc.cs : Implicit/explicit operator name in doc comments are like
6458           "op_Explicit(type)~returnType", so added suffix handling.
6459
6460 2005-01-21  Alp Toker  <alp@atoker.com>
6461
6462         * cs-parser.jay: destructor_declaration's container is PartialContainer
6463         not Class when partial types are used, so use Kind prop instead of 'is'.
6464
6465 2004-12-12  Martin Baulig  <martin@ximian.com>
6466
6467         * expression.cs (Unary.TryReduceNegative): Added support for
6468         SByteConstant and ByteConstant.
6469         (Unary.Reduce): Check error values from TryReduceNegative().
6470
6471 2004-12-11  Martin Baulig  <martin@ximian.com>
6472
6473         * support.cs (ReflectionParameters.ParameterName): If we have a
6474         `gpd', call `ParameterName' on it.
6475
6476         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6477
6478         * pending.cs (PendingImplementation.DefineProxy): Call
6479         DefineParameter() for all of the MethodBuilder's arguments.
6480
6481 2004-12-09  Martin Baulig  <martin@ximian.com>
6482
6483         * doc.cs (DocUtil): Make this a static class.
6484
6485 2004-12-09  Martin Baulig  <martin@ximian.com>
6486
6487         * expression.cs (Invocation.InferType): Moved the type inference
6488         implementation into TypeManager.
6489
6490         * generics.cs (TypeManager): Moved the type inference
6491         implementation here.
6492
6493 2004-12-09  Martin Baulig  <martin@ximian.com>
6494
6495         * typemanager.cs (TypeManager): Make this a partial class.
6496
6497         * generics.cs
6498         (TypeManager): Move the generics part of `TypeManager' here.
6499
6500 2004-12-08  Martin Baulig  <martin@ximian.com>
6501
6502         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6503         instead of a CS3002 for properties and indexer.  Added CS3024
6504         check for generic interfaces.
6505
6506         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6507         instances are not CLS-compliant.
6508
6509 2004-12-08  Martin Baulig  <martin@ximian.com>
6510
6511         * cs-parser.jay
6512         (void_pointer_expression): New rule for `void*', `void**' etc.
6513         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6514
6515 2004-12-08  Martin Baulig  <martin@ximian.com>
6516
6517         * expression.cs (Invocation.InferType): Removed the hack for
6518         MethodCore.MayUnify().  
6519
6520         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6521         this actually work.
6522
6523         * class.cs (MethodCore.MayUnify): Use
6524         TypeManager.MayBecomeEqualGenericTypes().       
6525
6526 2004-12-08  Martin Baulig  <martin@ximian.com>
6527
6528         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6529         parameter, box it.  Fixes #69233.
6530
6531 2004-12-08  Martin Baulig  <martin@ximian.com>
6532
6533         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6534         have the ctor constraint.  Fixes #68326.
6535
6536 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6537
6538         * cs-parser.jay : interface comment was not consumed because of
6539           extra opt_semicolon before doc handling.
6540
6541 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6542
6543         Fix test-327.cs, test-328.cs, and put in early infrastructure
6544         for eventually fixing #52697.
6545         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6546         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6547         from other methods.
6548         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6549         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6550         (VerifyUsing, error246): Update.
6551         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6552         'NamespaceEntry.LookupNamespaceOrType'.
6553
6554 2004-12-07  Martin Baulig  <martin@ximian.com>
6555
6556         * driver.cs: Call it "BETA SOFTWARE" :-)
6557
6558 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6559
6560         Fix crash on cs0657-17.cs.
6561         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6562         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6563         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6564         the case where the NamespaceEntry gets overwritten.
6565
6566 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6567
6568         Fixed #69195, #56821
6569         * ecore.cs (ResolveBoolean): Tiny refactoring.
6570
6571         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6572         of right expression resolving when left is false constant and
6573         operator is LogicalAnd OR true constant and operator is LogicalOr.
6574
6575         * statement.cs (ResolveUnreachable): Always reports warning.
6576
6577 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6578
6579         * class.cs: Distinguish between 1721 and 1722 (just a little help
6580         for the programmer).
6581
6582 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6583
6584         * delegate.cs: Only allow this on new versions of the language. 
6585
6586 2004-12-02  Duncan Mak  <duncan@ximian.com>
6587
6588         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6589         Expression class.
6590         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6591         here as a static method. Take an additional bool out parameter
6592         `must_do_cs1540_check' for signaling to InstanceResolve.
6593         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6594         member field from PropertyExpr class and made it an argument of
6595         the method instead.
6596         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6597         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6598         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6599         and `remove_accessor' as well as InstanceResolve: report CS0122
6600         where applicable.
6601
6602         Fixes #70129.
6603
6604 2004-12-07  Martin Baulig  <martin@ximian.com>
6605
6606         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6607         and CS0692 where appropriate.
6608
6609 2004-12-06  Martin Baulig  <martin@ximian.com>
6610
6611         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6612         IsDuplicateImplementation() and improved it.
6613
6614         * expression.cs (Invocation.InferTypeArguments): Added
6615         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6616         and removed the "ref" modifier from `infered_types'.
6617
6618         * decl.cs (MemberName.ToString): Removed the exception.
6619
6620 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6621
6622         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6623           comments are allowed.
6624
6625 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6626
6627         * delegate.cs: Add checks for subtypes in paramaters and return values
6628         in VerifyMethod () to add support for Covariance/Contravariance
6629         in delegates.
6630         
6631 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6632
6633         * report.cs: Remove extra closing parenthesis.
6634
6635         * convert.cs (Error_CannotImplicitConversion): If the name of the
6636         types are the same, provide some extra information.
6637
6638 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6639
6640         Fix bug #70102
6641         * attribute.cs (Resolve): Improved implementation of params
6642         attribute arguments.
6643
6644         * support.cs (ParameterData): Add HasParams to be faster.
6645
6646 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6647
6648         all things are for /doc support:
6649
6650         * doc.cs: new file that supports XML documentation generation.
6651         * mcs.exe.sources: added doc.cs.
6652         * driver.cs:
6653           Handle /doc command line option.
6654           Report error 2006 instead of 5 for missing file name for /doc.
6655           Generate XML documentation when required, after type resolution.
6656         * cs-tokenizer.cs:
6657           Added support for picking up documentation (/// and /** ... */),
6658           including a new XmlCommentState enumeration.
6659         * cs-parser.jay:
6660           Added lines to fill Documentation element for field, constant,
6661           property, indexer, method, constructor, destructor, operator, event
6662           and class, struct, interface, delegate, enum.
6663           Added lines to warn incorrect comment.
6664         * rootcontext.cs :
6665           Added Documentation field (passed only when /doc was specified).
6666         * decl.cs:
6667           Added DocComment, DocCommentHeader, GenerateDocComment() and
6668           OnGenerateDocComment() and some supporting private members for
6669           /doc feature to MemberCore.
6670         * class.cs:
6671           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6672         * delegate.cs:
6673           Added overriden DocCommentHeader.
6674         * enum.cs:
6675           Added overriden DocCommentHeader and GenerateDocComment().
6676
6677 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6678
6679         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6680         unwrapping the enumeration values, chain to
6681         DoConstantNumericPromotions again, so we can promote things to the
6682         fundamental types (takes care of enums that are bytes, sbytes).
6683
6684         Fixes bug #62054.
6685
6686 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6687
6688         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6689         Fix long-standing bug in type-lookup.  Use FindType instead of
6690         LookupType when ec.ResolvingTypeTree.
6691         (Attribute.ResolveType, Attribute.Resolve)
6692         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6693         Update to changes.
6694         (Attributes.Search): Remove internal version.  Update.
6695         (Attributes.SearchMulti): Update.
6696         (Attributes.GetClsCompliantAttribute): Remove.
6697         (Attributes.GetIndexerNameAttribute): Remove.
6698         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6699         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6700         * class.cs (Indexer.Define): Likewise.
6701
6702 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6703
6704         Fix bug #68790
6705         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6706         MarshallByReference members access.
6707
6708         * expression.cs: Use CheckMarshallByRefAccess;
6709         Better error CS0197 message.
6710
6711         * report.cs: Print whole related error message.
6712
6713 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6714
6715         * class (GetClassBases): Better error 60 report.
6716         (EventProperty): Disabled warning 67 detection.
6717
6718 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6719
6720         Fix bug #60324
6721         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6722
6723         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6724         precise values.
6725
6726 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6727
6728         Fix bug #49488
6729         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6730
6731         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6732
6733 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6734
6735         * attribute.cs (Attribute.Resolve): Refine error reporting and
6736         report a cs0117 if the identifier does not exist, to distinguish
6737         from 0617 which is a miss-use of the actual identifier.
6738
6739         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6740         between cs0070 and cs0079.
6741
6742         * class.cs (MemberBase.DoDefine): When reporting a wrong
6743         accessibility level, we use MethodCore to compare instead of
6744         Method (this was a regression in some refactoring effort).
6745
6746         So now we correctly report cs0056 again.
6747
6748         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6749         testing the target_type (which was known to be object_type) and
6750         not the source type (which is anonymous_method).
6751
6752         Fixed reporting of error cs1660.
6753
6754         * expression.cs (UserCast.Source): Expose the underlying cast.
6755
6756         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6757         allowed types to find a match to int32 first (most common).
6758
6759         In addition, it ignores any ImplicitUserConversions that did an
6760         internal implicit conversion (as the switch statement allows only
6761         one integral conversion to exist).
6762
6763         * class.cs (PartialContainer.Create): rename `name' to
6764         `member_name' for clarity.  Then replace the string calls with a
6765         call to MemberName.GetPartialName, as now using
6766         MemberName.ToString is an error (this is due to the side effects
6767         it had, that were fixed in the past).
6768
6769         This will restore the error reporting on a number of partial class
6770         errors that were missusing this (and getting an exception as a
6771         results, which is now just a plain textual warning, because
6772         yyparse debug output would crash otherwise).
6773
6774 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6775
6776         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6777
6778 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6779
6780         * rootcontext.cs (LookupType): Make sure to cache lookups that
6781         don't give us a negative result. This saves about 5% of corlib
6782         compilation time.
6783
6784 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6785
6786         * report.cs (AbstractMessage.Print): messages are sent to stderr
6787
6788         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6789         non-interface in the list of interfaces (at this point, either
6790         parent was properly set, or a base class is being listed in the
6791         interfaces section).
6792
6793         This flags error 1722, and resolves the crash from bug 69259.
6794
6795 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6796
6797         * statement.cs (Using.EmitExpressionFinally): make this work right
6798         for valuetypes. Fixes 69926.
6799
6800 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6801
6802         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6803         converted to an enum" here, before we try to change the underlying
6804         type.  This code exists, but it is a different code path than the
6805         one used while encoding constants.
6806
6807         (ImplicitReferenceConversionExists): In addition, resynchronized
6808         the code here, so it matches the same code in
6809         ImplicitReferenceConversionExists for the `from any class-type S
6810         to any interface-type T'.       
6811
6812 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6813
6814         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6815
6816 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6817
6818         * cs-parser.jay: Use verbosity accordingly. 
6819
6820 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6821
6822         * expression.cs (Unary.ResolveOperator): Do not report warning;
6823         AddressOf reads from variable.
6824         
6825         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6826
6827 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6828
6829         Fix bug #69462
6830
6831         * attribute.cs (Attributable): Removed CheckTargets.
6832         (Attributes.Emit): Explicit attribute targets are tested here.
6833
6834         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6835         not enabled for interfaces.
6836
6837         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6838         (GetAssemblyName): Ouch next bug there.
6839
6840 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6841
6842         * expression.cs: Error 275 added.
6843         
6844 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6845
6846         Fix bug #69177 (Implemented decimal constant support)
6847
6848         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6849         (BinaryFold): Add DecimalConstant.
6850
6851         * const.cs (Define): Decimal constant 
6852         (is not constant.
6853         (ChangeType): Add decimal type handling.
6854         (LookupConstantValue): Don't set value for decimal type but
6855         emit DecimalConstantAttribute. Needed for constant optimization.
6856
6857         * constant.cs (ToDecimal): New method.
6858         (ConvertToDecimal): New method.
6859         (IntConstant): Implemented ConvertToDecimal.
6860         (DecimalConstant.Emit): Emit optimized version for decimals in
6861         int range.
6862
6863         * expression.cs (ResolveOperator): Changed order of constant
6864         reduction to work correctly with native types which have
6865         overloaded operators.
6866         (ResolveMemberAccess): Extract constant value from attribute
6867         for decimal type.
6868
6869         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6870
6871         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6872         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6873         (ChangeType): Decimal is special.
6874         (TypeToCoreType): Add decimal type.
6875
6876 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6877
6878         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6879         decimal types.
6880
6881 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6882
6883         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6884         test cs1667-5.cs.
6885
6886 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6887
6888         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6889
6890         * pending.cs (PendingImplementation): Grab only interfaces.
6891
6892 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6893
6894         * statement.cs (ForeachHelperMethods): Add location member and
6895         error 202 detection.
6896
6897 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6898
6899         * expression.cs (DoResolveBase): Fixed wrong warning for out
6900         variables.
6901
6902 2004-12-04  Martin Baulig  <martin@ximian.com>
6903
6904         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6905         to check whether the conversion is ok.
6906
6907         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6908         `Type.EmptyTypes' if we're not a generic TypeContainer.
6909
6910 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6911
6912         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6913         old bug: when converting from the null literal to a pointer,
6914         return an EmptyCast, not the NullLiteral.
6915
6916         This fixes #69921, the recent null_type changes probably made this
6917         bug more prominent.
6918
6919 2004-12-03  Martin Baulig  <martin@ximian.com>
6920
6921         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6922         method as our child, call AnonymousMethod.Compatible() on it.
6923
6924 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6925
6926         * class.cs (FieldBase): Use an unused bit field from the field to
6927         encode the `has_offset' property from the FieldMember.  This saves
6928         a couple of Ks on bootstrap compilation.
6929
6930         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6931         method as our child, return the AnonymousMethod resolved
6932         expression.
6933
6934         * expression.cs (New.DoResolve): Allow return values from
6935         NewDelegate to also include AnonymousMethods.
6936
6937         Fixes #70150.
6938
6939 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6940
6941         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6942         cs1648 report.
6943         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6944         System.Runtime.InteropServices._Exception, since it's a base
6945         interface of the core type System.Exception in the net_2_0 profile.
6946
6947 2004-11-27  Martin Baulig  <martin@ximian.com>
6948
6949         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6950
6951 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6952
6953         * Makefile: Convert to use executable.make.
6954         * gmcs.exe.sources: New.
6955
6956 2004-11-25  Martin Baulig  <martin@ximian.com>
6957
6958         * expression.cs (Invocation.InferType): Added support for byref types.
6959
6960 2004-11-25  Martin Baulig  <martin@ximian.com>
6961
6962         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6963         in TypeManager.TypeToCoreType().
6964
6965 2004-11-25  Martin Baulig  <martin@ximian.com>
6966
6967         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6968         "Dispose" method from the `current_type'.
6969         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6970         DoDefineMembers() instead of using the MethodBuilder; this is
6971         required for generic iterators.
6972
6973         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6974
6975 2004-11-24  Martin Baulig  <martin@ximian.com>
6976
6977         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6978
6979 2004-11-20  Martin Baulig  <martin@ximian.com>
6980
6981         * expression.cs (Invocation.InferType): Correctly infer generic
6982         instances; see gen-103.cs.
6983         (Invocation.InferTypeArguments): If a generic method doesn't have
6984         any unbound type parameters, we don't need to infer anything.
6985
6986 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6987
6988         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6989
6990 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6991
6992         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6993         (TypeHandle.GetMemberCache): New.
6994         (TypeHandle.TypeHandle): Update.
6995         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6996         (TypeManager.LookupParentInterfacesCache):
6997         Rename from LookupInterfaceCache.  Optimize slightly.
6998         (TypeManager.MemberLookup_FindMembers): Update.
6999         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7000         multi-type variant.
7001         (AddCacheContents): Rename from AddHashtable.
7002         * class.cs (TypeContainer.parent_container): Remove.
7003         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7004         (TypeContainer.DoDefineMembers): Don't initialize it.
7005         Update to name changes.
7006         
7007 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7008
7009         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7010         that factors the code to check access modifiers on override.  
7011
7012         (PropertyBase): Use the code here.
7013
7014         Patch from Lluis S'anchez, fixes bug #69361.
7015
7016 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7017
7018         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7019         routine that is used to report the use of a captured variable
7020         whose address has been taken.
7021
7022         There are two checks: one when variables are being captured and
7023         the other check is when the address of a variable is taken. 
7024         
7025         (because an anonymous methods might be resolved before *or* after
7026         the address has been taken) and 
7027
7028         * expression.cs (Conditional.DoResolve): Remove the special
7029         casing that Martin added to trueExpr and falseExpr being both
7030         NullLiteral.  We get the right behavior now just by introducing
7031         the null_type into the compiler. 
7032
7033         * convert.cs (ExplicitConversion): Change the code to use
7034         null_type instead of testing `expr is NullLiteral'.
7035         (ImplicitConversionStandard): use null_type too.
7036         (ImplicitReferenceConversionExists): use null_type too.
7037         (ImplicitReferenceConversion): use null_type too.
7038
7039         * literal.cs: The type of `NullLiteral' is now null_type instead
7040         of object_type. 
7041         (Resolve): Set the type here.
7042
7043         * typemanager.cs: Introduce null_type.
7044
7045 2004-11-18  Martin Baulig  <martin@ximian.com>
7046
7047         * rootcontext.cs
7048         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7049
7050 2004-11-18  Martin Baulig  <martin@ximian.com>
7051
7052         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7053
7054 2004-11-18  Martin Baulig  <martin@ximian.com>
7055
7056         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7057         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7058         call ResolveConstructedType() on it to resolve it without checking
7059         constraints.
7060         (Constraints.ResolveTypes): Check them here.
7061         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7062         but don't check constraints.
7063         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7064         check constraints here.
7065         (ConstructedType.ResolveConstructedType): New public method.  This
7066         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7067         resolve ourselves without checking constraints.
7068
7069         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7070
7071 2004-11-18  Martin Baulig  <martin@ximian.com>
7072
7073         * decl.cs
7074         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7075
7076         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7077
7078 2004-11-18  Martin Baulig  <martin@ximian.com>
7079
7080         * ecore.cs (TypeExpr.ResolveType): Removed.
7081         (Expression.ResolveAsTypeTerminal): We always return a fully
7082         resolved `TypeExpr', so we can just access its `Type'.
7083
7084         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7085
7086 2004-11-17  Martin Baulig  <martin@ximian.com>
7087
7088         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7089         sure we don't return any unresolved TypeExpr's.
7090         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7091         a `TypeExpr'.
7092         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7093
7094         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7095         unresolved `ConstructedType's.
7096
7097 2004-11-17  Martin Baulig  <martin@ximian.com>
7098
7099         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7100
7101 2004-11-17  Martin Baulig  <martin@ximian.com>
7102
7103         * ecore.cs
7104         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7105
7106         * decl.cs (DeclSpace.ResolveType): Removed.
7107         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7108
7109 2004-11-17  Martin Baulig  <martin@ximian.com>
7110
7111         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7112         direction, like FindMembers() does.  Fixes #69546, testcase is in
7113         test-315.cs.    
7114
7115 2004-11-16  Martin Baulig  <martin@ximian.com>
7116
7117         This is based on a patch from Marek Safar, see bug #69082.
7118         Fixes bugs #63705 and #67130.
7119
7120         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7121         method; create a MemberCache for an interface type and cache the
7122         result.
7123
7124         * decl.cs (IMemberContainer.ParentContainer): Removed.
7125         (IMemberContainer.ParentCache): New property.
7126         (MemberCache.SetupCacheForInterface): Removed.
7127         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7128         to create a cache for an interface's "parent".
7129
7130         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7131         interfaces too.
7132
7133 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7134
7135         * statement.cs: Avoid adding bools to a hashtable.
7136
7137 2004-11-15  Martin Baulig  <martin@ximian.com>
7138
7139         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7140
7141 2004-11-11  Martin Baulig  <martin@ximian.com>
7142
7143         * typemanager.cs (TypeManager.GetMethodName): New method.
7144
7145         * class.cs (MethodData.Define): Include the generic arity in the
7146         name of an explicit interface; also add it to the method name.
7147
7148         * pending.cs (PendingImplementation.InterfaceMethod): The method
7149         name now includes the generic arity.
7150
7151 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7152
7153         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7154         calling an unsafe method from a safe location.
7155
7156 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7157
7158         Fix #69167
7159         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7160
7161 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7162
7163         * namespace.cs (VerifyUsing): use GetPartialName instead of
7164         ToString. 
7165
7166 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7167
7168         * statement.cs (Return.Resolve): Fix regression in typo: if
7169         `in_exc', we have to request a NeedReturnLabel, this was a typo
7170         introduced in the anonymous method check-in.  Fixes #69131.
7171
7172         * Indexers were using the ShortName when defining themselves,
7173         causing a regression in the compiler bootstrap when applying the
7174         patch from 2004-11-02 (first part), now they use their full name
7175         and the bug is gone.
7176
7177 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7178
7179         * driver.cs: Strip the path from the names of embedded resources. Fixes
7180         #68519.
7181
7182 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7183
7184         Fix error message regression: cs0104-2.cs.
7185         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7186         (AliasEntry.Resolve): Update.
7187         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7188         'silent' flag.
7189         (RootContext.LookupType): Update.
7190
7191 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7192
7193         * cs-parser.jay: Add support for handling accessor modifiers
7194         * class: Add support port accessor modifiers and error checking,
7195         define PropertyMethod.Define as virtual (not abstract anymore)
7196         * ecore.cs: Add checking for proeprties access with access modifiers
7197         * iterators.cs: Modify Accessor constructor call based in the modified
7198         constructor
7199 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7200
7201         * expression.cs (StringConcat): Handle being called twice,
7202         as when we have a concat in a field init with more than two
7203         ctors in the class
7204
7205 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7206
7207         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7208         special case explicit implementations, we should always produce
7209         the .property or .event declaration.
7210         
7211         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7212         since it will not return correct data if people use this
7213         unresolved in the presence of using statements (see test-313).
7214
7215         * class.cs (MethodData.Define): If we are an explicit interface
7216         implementation, set the method name to the full name of the
7217         interface plus the name of the method.  
7218
7219         Notice that using the method.MethodName.GetFullName() does not
7220         work, as it will only contain the name as declared on the source
7221         file (it can be a shorthand in the presence of using statements)
7222         and not the fully qualifed type name, for example:
7223
7224         using System;
7225
7226         class D : ICloneable {
7227                 object ICloneable.Clone ()  {
7228                 }
7229         }
7230
7231         Would produce a method called `ICloneable.Clone' instead of
7232         `System.ICloneable.Clone'.
7233
7234         * namespace.cs (Alias.Resolve): Use GetPartialName.
7235         
7236 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7237
7238         * cs-parser.jay: Add error 1055 report.
7239
7240 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7241
7242         * assign.cs (Assign.DoResolve): Only do the transform of
7243         assignment into a New if the types are compatible, if not, fall
7244         through and let the implicit code deal with the errors and with
7245         the necessary conversions. 
7246
7247 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7248
7249         * cs-parser.jay: Add error 1031 report.
7250
7251         * cs-tokenizer.cs: Add location for error 1038.
7252
7253 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7254
7255         * cs-parser.jay: Add error 1016 report.
7256
7257 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7258
7259         * cs-parser.jay: Add errors 1575,1611 report.
7260
7261 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7262
7263         * cs-parser.jay: Add error 1001 report.
7264
7265 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7266
7267         Fix #68850
7268         * attribute.cs (GetMarshal): Add method argument for
7269         caller identification.
7270
7271         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7272         agument for GetMarshal and RuntimeMissingSupport.
7273
7274 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7275
7276         * attribute.cs (ExtractSecurityPermissionSet): Removed
7277         TypeManager.code_access_permission_type.
7278
7279         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7280
7281 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7282
7283         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7284         for obsolete use of a variable here.   Fixes regression on errors
7285         cs0619-25 and cs0619-26.
7286
7287 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7288
7289         Fix #62358, implemented security attribute encoding.
7290
7291         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7292         Tests permitted SecurityAction for assembly or other types.
7293         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7294         data from SecurityPermissionAttribute to PermisionSet class.
7295
7296         * class.cs (ApplyAttributeBuilder): Added special handling
7297         for System.Security.Permissions.SecurityAttribute based types.
7298
7299         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7300         special handling for System.Security.Permissions.SecurityAttribute
7301         based types.
7302
7303         * enum.cs (ApplyAttributeBuilder): Added special handling
7304         for System.Security.Permissions.SecurityAttribute based types.
7305
7306         * parameter.cs (ApplyAttributeBuilder): Added special handling
7307         for System.Security.Permissions.SecurityAttribute based types.
7308
7309         * rootcontext.cs: Next 2 core types.
7310
7311         * typemanager.cs (TypeManager.security_permission_attr_type):
7312         Built in type for the SecurityPermission Attribute.
7313         (code_access_permission_type): Build in type.
7314
7315 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7316
7317         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7318         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7319         all of this information into
7320         EmitContext.EmitCapturedVariableInstance.
7321         
7322         * codegen.cs (EmitCapturedVariableInstance): move here the
7323         funcionality of emitting an ldarg.0 in the presence of a
7324         remapping.   This centralizes the instance emit code.
7325
7326         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7327         then emit a load of this: it means that we have reached the
7328         topmost ScopeInfo: the one that contains the pointer to the
7329         instance of the class hosting the anonymous method.
7330
7331         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7332         captures to the topmost CaptureContext.
7333
7334 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7335
7336         * expression.cs (LocalVariableReference): Move the knowledge about
7337         the iterators into codegen's EmitCapturedVariableInstance.
7338
7339 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7340
7341         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7342         all code paths return a value from an anonymous method (it is the
7343         same as the 161 error, but for anonymous methods).
7344
7345 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7346
7347         The introduction of anonymous methods in the compiler changed
7348         various ways of doing things in the compiler.  The most
7349         significant one is the hard split between the resolution phase
7350         and the emission phases of the compiler.
7351
7352         For instance, routines that referenced local variables no
7353         longer can safely create temporary variables during the
7354         resolution phase: they must do so from the emission phase,
7355         since the variable might have been "captured", hence access to
7356         it can not be done with the local-variable operations from the runtime.
7357         
7358         * statement.cs 
7359
7360         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7361         is a toplevel block.
7362
7363         (ToplevelBlock): A new kind of Block, these are the blocks that
7364         are created by the parser for all toplevel method bodies.  These
7365         include methods, accessors and anonymous methods.
7366
7367         These contain some extra information not found in regular blocks:
7368         A pointer to an optional CaptureContext (for tracking captured
7369         local variables and parameters).  A pointer to the parent
7370         ToplevelBlock.
7371         
7372         (Return.Resolve): Catch missmatches when returning a value from an
7373         anonymous method (error 1662).
7374         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7375         phase.
7376
7377         (Break.Resolve): ditto.
7378
7379         (SwitchLabel): instead of defining the labels during the
7380         resolution phase, we now turned the public ILLabel and ILLabelCode
7381         labels into methods called GetILLabelCode() and GetILLabel() that
7382         only define the label during the Emit phase.
7383
7384         (GotoCase): Track the SwitchLabel instead of the computed label
7385         (its contained therein).  Emit the code by using
7386         SwitchLabel.GetILLabelCode ().
7387
7388         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7389         whether the Local has been captured or not.
7390
7391         (LocalInfo.IsCaptured): New property, used to tell whether the
7392         local has been captured.
7393         
7394         * anonymous.cs: Vastly updated to contain the anonymous method
7395         support.
7396
7397         The main classes here are: CaptureContext which tracks any
7398         captured information for a toplevel block and ScopeInfo used to
7399         track the activation frames for various local variables.   
7400
7401         Each toplevel block has an optional capture context associated
7402         with it.  When a method contains an anonymous method both the
7403         toplevel method and the anonymous method will create a capture
7404         context.   When variables or parameters are captured, they are
7405         recorded on the CaptureContext that owns them, for example:
7406
7407         void Demo () {
7408              int a;
7409              MyDelegate d = delegate {
7410                  a = 1;
7411              }
7412         }
7413
7414         Here `a' will be recorded as captured on the toplevel
7415         CapturedContext, the inner captured context will not have anything
7416         (it will only have data if local variables or parameters from it
7417         are captured in a nested anonymous method.
7418
7419         The ScopeInfo is used to track the activation frames for local
7420         variables, for example:
7421
7422         for (int i = 0; i < 10; i++)
7423                 for (int j = 0; j < 10; j++){
7424                    MyDelegate d = delegate {
7425                         call (i, j);
7426                    }
7427                 }
7428
7429         At runtime this captures a single captured variable `i', but it
7430         captures 10 different versions of the variable `j'.  The variable
7431         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7432         recorded on a child.  
7433
7434         The toplevel ScopeInfo will also track information like the `this'
7435         pointer if instance variables were referenced (this is necessary
7436         as the anonymous method lives inside a nested class in the host
7437         type of the method). 
7438
7439         (AnonymousMethod): Expanded to track the Toplevel, implement
7440         `AnonymousMethod.Compatible' to tell whether an anonymous method
7441         can be converted to a target delegate type. 
7442
7443         The routine now also produces the anonymous method content
7444
7445         (AnonymousDelegate): A helper class that derives from
7446         DelegateCreation, this is used to generate the code necessary to
7447         produce the delegate for the anonymous method that was created. 
7448
7449         * assign.cs: API adjustments for new changes in
7450         Convert.ImplicitStandardConversionExists.
7451
7452         * class.cs: Adjustments to cope with the fact that now toplevel
7453         blocks are of type `ToplevelBlock'. 
7454
7455         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7456         insteda of standard blocks.
7457
7458         Flag errors if params arguments are passed to anonymous methods.
7459
7460         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7461         `CurrentAnonymousMethod' which points to the current Anonymous
7462         Method.  The variable points to the AnonymousMethod class that
7463         holds the code being compiled.  It is set in the new EmitContext
7464         created for the anonymous method.
7465
7466         (EmitContext.Phase): Introduce a variable and an enumeration to
7467         assist in enforcing some rules about when and where we are allowed
7468         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7469         only one that enfonces this right now).
7470
7471         (EmitContext.HaveCaptureInfo): new helper method that returns
7472         whether we have a CapturedContext initialized.
7473
7474         (EmitContext.CaptureVariable): New method used to register that a
7475         LocalInfo must be flagged for capturing. 
7476
7477         (EmitContext.CapturedParameter): New method used to register that a
7478         parameters must be flagged for capturing. 
7479         
7480         (EmitContext.CapturedField): New method used to register that a
7481         field must be flagged for capturing. 
7482
7483         (EmitContext.HaveCapturedVariables,
7484         EmitContext.HaveCapturedFields): Return whether there are captured
7485         variables or fields. 
7486
7487         (EmitContext.EmitMethodHostInstance): This is used to emit the
7488         instance for the anonymous method.  The instance might be null
7489         (static methods), this (for anonymous methods that capture nothing
7490         and happen to live side-by-side with the current method body) or a
7491         more complicated expression if the method has a CaptureContext.
7492
7493         (EmitContext.EmitTopBlock): Routine that drives the emission of
7494         code: it will first resolve the top block, then emit any metadata
7495         and then emit the code.  The split is done so that we can extract
7496         any anonymous methods and flag any captured variables/parameters.
7497         
7498         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7499         during this phase, the ILGenerator should not be used as labels
7500         and local variables declared here might not be accessible to any
7501         code that is part of an anonymous method.  
7502
7503         Exceptions to this include the temporary variables that are
7504         created by some statements internally for holding temporary
7505         variables. 
7506         
7507         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7508         metadata for a cb
7509
7510         (EmitContext.TemporaryReturn): This method is typically called
7511         from the Emit phase, and its the only place where we allow the
7512         ReturnLabel to be defined other than the EmitMeta.  The reason is
7513         that otherwise we would have to duplicate a lot of logic in the
7514         Resolve phases of various methods that today is on the Emit
7515         phase. 
7516
7517         (EmitContext.NeedReturnLabel): This no longer creates the label,
7518         as the ILGenerator is not valid during the resolve phase.
7519
7520         (EmitContext.EmitThis): Extended the knowledge in this class to
7521         work in anonymous methods in addition to iterators. 
7522
7523         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7524         code is necessary on the stack to access the instance to a local
7525         variable (the variable will be accessed as a field).
7526
7527         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7528         EmitContext.EmitAddressOfParameter): Routines to support
7529         parameters (not completed at this point). 
7530         
7531         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7532         will also remove the parameters.
7533
7534         * convert.cs (Convert): Define a `ConstantEC' which points to a
7535         null.  This is just to prefity some code that uses
7536         ImplicitStandardConversion code and do not have an EmitContext
7537         handy.
7538
7539         The idea is to flag explicitly that at that point in time, it is
7540         known that the conversion will not trigger the delegate checking
7541         code in implicit conversions (which requires a valid
7542         EmitContext). 
7543
7544         Everywhere: pass new EmitContext parameter since
7545         ImplicitStandardConversionExists now requires it to check for
7546         anonymous method conversions. 
7547
7548         (Convert.ImplicitStandardConversionExists): If the type of an
7549         expression is the anonymous_method_type, and the type is a
7550         delegate, we invoke the AnonymousMethod.Compatible method to check
7551         whether an implicit conversion is possible. 
7552
7553         (Convert.ImplicitConversionStandard): Only do implicit method
7554         group conversions if the language level is not ISO_1.
7555
7556         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7557         MethodInfo for the Invoke method.  used by Delegate and
7558         AnonymousDelegate.
7559
7560         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7561         method conversions if the target type is a delegate.
7562
7563         Removed extra debugging nops.
7564
7565         (LocalVariableReference): Turn the `local_info' into a public
7566         field. 
7567
7568         Add `prepared' field, the same hack used for FieldExprs to cope
7569         with composed assignments, as Local variables do not necessarily
7570         operate purely on the stack as they used to: they can be captured
7571         fields. 
7572
7573         Add `temp' for a temporary result, like fields.
7574
7575         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7576
7577         It now copes with Local variables that are captured and emits the
7578         proper instance variable to load it from a field in the captured
7579         case. 
7580
7581         (ParameterReference.DoResolveBase): During the resolve phase,
7582         capture parameters if we are in an anonymous method.
7583
7584         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7585         anonymous method, use the EmitContext helper routines to emit the
7586         parameter reference.
7587
7588         * iterators.cs: Set RemapToProxy to true/false during the
7589         EmitDispose class.
7590
7591         * parameters.cs (GetParameterByName): New helper method. 
7592
7593         * typemanager.cs (anonymous_method_type) a new type that
7594         represents an anonyous method.  This is always an internal type,
7595         used as a fencepost to test against the anonymous-methodness of an
7596         expression. 
7597         
7598 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7599
7600         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7601         561 report.
7602         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7603
7604 2004-11-10  Martin Baulig  <martin@ximian.com>
7605
7606         * expression.cs (Invocation.BetterFunction): If two methods have
7607         equal parameter types, but only one of them is generic, the
7608         non-generic one wins.
7609         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7610         instance; just use `Type.IsValueType' to determine whether
7611         something is a struct or not.
7612         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7613         so we can be called multiple times.
7614
7615 2004-11-10  Martin Baulig  <martin@ximian.com>
7616
7617         * generic.cs (TypeParameter.DefineConstraints): New public method.
7618         (TypeParameter.CheckAccessLevel): Override this and return true.
7619         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7620         override ResolveType() anymore.
7621         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7622
7623 2004-11-10  Martin Baulig  <martin@ximian.com>
7624
7625         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7626         call DeclSpace.ResolveNestedType() on it.
7627
7628 2004-11-10  Martin Baulig  <martin@ximian.com>
7629
7630         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7631         non-null, call ParameterModifier() on it.
7632
7633 2004-11-10  Martin Baulig  <martin@ximian.com>
7634
7635         * iterators.cs
7636         (Iterators): Added `current_type' and `this_type' fields.
7637         (Iterators.DefineIterator): Create a new EmitContext and store it
7638         in `ec'; compute `this_type'.
7639
7640 2004-11-10  Martin Baulig  <martin@ximian.com>
7641
7642         * typemanager.cs
7643         (TypeManager.IsPrivateAccessible): New public method.
7644         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7645
7646 2004-11-10  Martin Baulig  <martin@ximian.com>
7647
7648         * class.cs (TypeContainer.DefineType): Call
7649         TypeBuilder.DefineGenericParameters() before resolving the type
7650         parameters.
7651         (MethodData.parent_method): New protected field.
7652         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7653         (MethodData.Define): Compute `parent_method'.
7654
7655         * decl.cs
7656         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7657         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7658         (DeclSpace.ec): New protected field; store the EmitContext here.
7659         (DeclSpace.EmitContext): New public property.
7660         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7661         (DeclSpace.ResolveNestedType): New public method.
7662         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7663         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7664         (DeclSpace.FamilyAccessible): Likewise.
7665         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7666         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7667         EmitContext.
7668
7669         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7670         field.
7671
7672         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7673         (Enum.Emit): Don't create a new EmitContext.
7674
7675 2004-10-18  Martin Baulig  <martin@ximian.com>
7676
7677         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7678         `Type' directly, but call ResolveType() on it.
7679         (Catch.Resolve): Likewise.
7680         (Foreach.Resolve): Likewise.
7681
7682 2004-10-18  Martin Baulig  <martin@ximian.com>
7683
7684         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7685         `Type' directly, but call ResolveType() on it.
7686         (Probe.DoResolve): Likewise.
7687         (ArrayCreation.LookupType): Likewise.
7688         (TypeOf.DoResolve): Likewise.
7689         (SizeOf.DoResolve): Likewise.
7690
7691 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7692
7693         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7694         the ResolveType.
7695
7696 2004-10-17  John Luke  <john.luke@gmail.com>
7697
7698         * class.cs (Operator.GetSignatureForError): use CSharpName
7699
7700         * parameter.cs (Parameter.GetSignatureForError): Returns
7701         correct name even if was not defined.
7702
7703 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7704
7705         Fix #65816.
7706         * class.cs (TypeContainer.EmitContext): New property.
7707         (DefineNestedTypes): Create an emitcontext for each part.
7708         (MethodCore.DoDefineParameters): Use container's emitcontext.
7709         Pass type array to InternalParameters.
7710         (MemberBase.DoDefine): Use container's emitcontext.
7711         (FieldMember.Define): Likewise.
7712         (Event.Define): Likewise.
7713         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7714         Pass type array to InternalParameters.
7715         (SetIndexerMethod.GetParameterInfo): Likewise.
7716         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7717         * delegate.cs (Define): Pass emitcontext to
7718         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7719         array to InternalParameters.
7720         * expression.cs (ParameterReference.DoResolveBase): Pass
7721         emitcontext to GetParameterInfo.
7722         (ComposedCast.DoResolveAsTypeStep): Remove check on
7723         ec.ResolvingTypeTree.
7724         * parameter.cs (Parameter.Resolve): Change argument to
7725         EmitContext.  Use ResolveAsTypeTerminal.
7726         (Parameter.GetSignature): Change argument to EmitContext.
7727         (Parameters.ComputeSignature): Likewise.
7728         (Parameters.ComputeParameterTypes): Likewise.
7729         (Parameters.GetParameterInfo): Likewise.
7730         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7731         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7732         * support.cs (InternalParameters..ctor): Remove variant that takes
7733         a DeclSpace.
7734         * typemanager.cs (system_intptr_expr): New.
7735         (InitExpressionTypes): Initialize it.
7736
7737 2004-10-12  Chris Toshok  <toshok@ximian.com>
7738
7739         * cs-parser.jay: fix location for try_statement and catch_clause.
7740
7741 2004-10-18  Martin Baulig  <martin@ximian.com>
7742
7743         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7744         `Type' directly, but call ResolveType() on it.
7745         (MemberBase.DoDefine): Likewise.
7746
7747         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7748         `Type' directly, but call ResolveType() on it.
7749         (ComposedCast.DoResolveAsTypeStep): Likewise.
7750
7751         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7752         `Type' directly, but call ResolveType() on it.
7753
7754 2004-10-17  John Luke  <john.luke@gmail.com>
7755
7756         * class.cs (Operator.GetSignatureForError): use CSharpName
7757
7758         * parameter.cs (Parameter.GetSignatureForError): Returns
7759         correct name even if was not defined.
7760
7761 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7762
7763         Fix #65816.
7764         * class.cs (TypeContainer.EmitContext): New property.
7765         (DefineNestedTypes): Create an emitcontext for each part.
7766         (MethodCore.DoDefineParameters): Use container's emitcontext.
7767         Pass type array to InternalParameters.
7768         (MemberBase.DoDefine): Use container's emitcontext.
7769         (FieldMember.Define): Likewise.
7770         (Event.Define): Likewise.
7771         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7772         Pass type array to InternalParameters.
7773         (SetIndexerMethod.GetParameterInfo): Likewise.
7774         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7775         * delegate.cs (Define): Pass emitcontext to
7776         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7777         array to InternalParameters.
7778         * expression.cs (ParameterReference.DoResolveBase): Pass
7779         emitcontext to GetParameterInfo.
7780         (ComposedCast.DoResolveAsTypeStep): Remove check on
7781         ec.ResolvingTypeTree.
7782         * parameter.cs (Parameter.Resolve): Change argument to
7783         EmitContext.  Use ResolveAsTypeTerminal.
7784         (Parameter.GetSignature): Change argument to EmitContext.
7785         (Parameters.ComputeSignature): Likewise.
7786         (Parameters.ComputeParameterTypes): Likewise.
7787         (Parameters.GetParameterInfo): Likewise.
7788         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7789         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7790         * support.cs (InternalParameters..ctor): Remove variant that takes
7791         a DeclSpace.
7792         * typemanager.cs (system_intptr_expr): New.
7793         (InitExpressionTypes): Initialize it.
7794
7795 2004-10-12  Chris Toshok  <toshok@ximian.com>
7796
7797         * cs-parser.jay: fix location for try_statement and catch_clause.
7798
7799 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7800
7801         More DeclSpace.ResolveType avoidance.
7802         * decl.cs (MemberCore.InUnsafe): New property.
7803         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7804         with newly created EmitContext.
7805         (FieldMember.Define): Likewise.
7806         * delegate.cs (Delegate.Define): Likewise.
7807         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7808         only if normal name-lookup fails.
7809         (TypeExpr.DoResolve): Enable error-checking.
7810         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7811         (SizeOf.DoResolve): Likewise.
7812         (ComposedCast.DoResolveAsTypeStep): Likewise.
7813         (StackAlloc.DoResolve): Likewise.
7814         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7815         (Block.Unsafe): New property.
7816         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7817         (Unsafe): Set 'unsafe' flag of contained block.
7818         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7819         (Fixed.Resolve): Likewise.
7820         (Catch.Resolve): Likewise.
7821         (Using.ResolveLocalVariableDecls): Likewise.
7822         (Foreach.Resolve): Likewise.
7823
7824 2004-10-05  John Luke <john.luke@gmail.com>
7825
7826         * cs-parser.jay: add location to error CS0175
7827
7828 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7829
7830         * ecore.cs (Expression.Constantity): Add support for turning null
7831         into a constant.
7832
7833         * const.cs (Const.Define): Allow constants to be reference types
7834         as long as the value is Null.
7835
7836 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7837
7838         * namespace.cs (NamespaceEntry.Using): No matter which warning
7839         level is set, check if this namespace name has already been added.
7840
7841 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7842
7843         * expression.cs: reftype [!=]= null should always use br[true,false].
7844         # 67410
7845
7846 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7847
7848         Fix #67108
7849         * attribute.cs: Enum conversion moved to 
7850         GetAttributeArgumentExpression to be applied to the all
7851         expressions.
7852
7853 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7854
7855         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7856         * class.c (TypeContainer.DefineType): Flag error if
7857         base types aren't accessible due to access permissions.
7858         * decl.cs (DeclSpace.ResolveType): Move logic to
7859         Expression.ResolveAsTypeTerminal.
7860         (DeclSpace.ResolveTypeExpr): Thin layer over
7861         Expression.ResolveAsTypeTerminal.
7862         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7863         Refactor code into NestedAccess.  Use it.
7864         (DeclSpace.NestedAccess): New.
7865         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7866         argument to silence errors.  Check access permissions.
7867         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7868         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7869         (Cast.DoResolve): Likewise.
7870         (New.DoResolve): Likewise.
7871         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7872         (TypeOf.DoResolve): Likewise.
7873
7874         * expression.cs (Invocation.BetterConversion): Return the Type of
7875         the better conversion.  Implement section 14.4.2.3 more faithfully.
7876         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7877         section 14.4.2.2 explicit.
7878         (Invocation.OverloadResolve): Update.
7879         (Invocation): Remove is_base field.
7880         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7881         (Invocation.Emit): Likewise.
7882
7883 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7884
7885         * cs-parser.jay: Reverted 642 warning fix.
7886
7887 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7888
7889         Fix bug #66615
7890         * decl.cs (FindMemberWithSameName): Indexer can have more than
7891         1 argument.
7892
7893 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7894
7895         * expression.cs (LocalVariableReference.DoResolveLValue):
7896         Do not report warning 219 for out values.
7897         (EmptyExpression.Null): New member to avoid extra allocations.
7898
7899 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7900
7901         * cs-parser.jay: Fix wrong warning 642 report.
7902
7903         * cs-tokenizer.cs (CheckNextToken): New helper;
7904         Inspect next character if is same as expected.
7905
7906 2004-09-23  Martin Baulig  <martin@ximian.com>
7907
7908         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7909         (Convert.ImplicitReferenceConversionExists): Likewise.
7910
7911 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7912
7913         * Makefile (DISTFILES): Comment out a few missing files.
7914
7915 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7916
7917         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7918         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7919         (gmcs.exe): Invoke bootstrap-libs.
7920         (clean-local): Clean the net_2_0_bootstrap profile too.
7921         (PROGRAM_INSTALL_DIR): New.
7922         (install-local): Use it.
7923
7924 2004-10-13  Martin Baulig  <martin@ximian.com>
7925
7926         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7927         (TypeParameter.DefineType): If we're a method type parameter and
7928         that method is overriding something, "inflate" its constraints.
7929
7930 2004-10-12  Martin Baulig  <martin@ximian.com>
7931
7932         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7933         and have type arguments, create and resolve a ConstructedType.
7934
7935 2004-10-12  Martin Baulig  <martin@ximian.com>
7936
7937         * decl.cs (MemberCache.FindMemberToOverride): Use
7938         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7939         to compare the invocationType.
7940
7941         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7942         When comparing two type parameters, only do the signature-only
7943         comparision for method type parameters.
7944
7945 2004-10-11  Martin Baulig  <martin@ximian.com>
7946
7947         * report.cs: Don't make --fatal abort on warnings, we have
7948         -warnaserror for that.
7949
7950 2004-10-11  Martin Baulig  <martin@ximian.com>
7951
7952         * typemanager.cs
7953         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7954         (TypeManager.IsEqual): Call ourself recursively instead of using
7955         Type.IsEqual(). 
7956
7957 2004-10-11  Martin Baulig  <martin@ximian.com>
7958
7959         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7960         on our own type parameters, not on the ones we inherit from a containing
7961         class.
7962
7963         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7964         the comparision.
7965
7966         * generic.cs (TypeParameter.Define): We may only be called once.
7967
7968         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7969         instead of TypeManager.IsEqual().
7970
7971 2004-09-28  Martin Baulig  <martin@ximian.com>
7972
7973         * generic.cs
7974         (GenericConstraints.EffectiveBaseClass): New public property.
7975         (TypeParameter.GenericConstraints): New public property.
7976         (ConstructedType.CheckConstraints): Improved.
7977
7978         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7979         (Convert.TypeParameterConversion): New private method; use this in
7980         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7981         for all conversions related to type parameters.
7982
7983 2004-09-24  Martin Baulig  <martin@ximian.com>
7984
7985         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7986         type parameter conversions for type parameters which are known to
7987         be reference types.
7988
7989 2004-09-24  Martin Baulig  <martin@ximian.com>
7990
7991         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7992         `IsValueType' properties.
7993
7994         * support.cs (ReflectionConstraints): Use
7995         Type.GetGenericParameterConstraints() instead of the old hack.
7996
7997 2004-09-24  Martin Baulig  <martin@ximian.com>
7998
7999         * generic.cs (GenericConstraints): Moved here and made it an
8000         abstract class.
8001
8002         * support.cs (GenericConstraints): Moved to generic.cs.
8003
8004 2004-09-24  Martin Baulig  <martin@ximian.com>
8005
8006         * support.cs
8007         (ReflectionConstraints): Un-nested this class and made it public.
8008
8009         * typemanager.cs
8010         (TypeManager.GetTypeParameterConstraints): New public method.
8011         (TypeManager.HasConstructorConstraint): Use the attributes.
8012
8013 2004-09-24  Martin Baulig  <martin@ximian.com>
8014
8015         * support.cs (GenericConstraints): Replaced `HasConstructor',
8016         `IsReferenceType' and `IsValueType' with `Attributes'.
8017         (ReflectionParameters.ReflectionConstraints): Removed the Create()
8018         method and made the .ctor public.
8019
8020         * generic.cs (Constraints.Attributes): New public property.
8021         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8022         `IsReferenceType' -> `HasReferenceTypeConstraint' and
8023         `IsValueType' -> `HasValueTypeConstraint'.
8024
8025 2004-09-23  Martin Baulig  <martin@ximian.com>
8026
8027         * generic.cs (Constraints): Reflect latest runtime changes.
8028
8029 2004-09-23  Martin Baulig  <martin@ximian.com>
8030
8031         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8032         (Convert.ImplicitReferenceConversionExists): Likewise.
8033
8034 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8035
8036         * class.cs (Operator.Define): Add error 448 and 559 report.
8037         
8038 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8039
8040         * class.cs (MemberBase.IsTypePermitted): New protected
8041         method for checking error CS0610.
8042
8043 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8044
8045         * class.cs (TypeContainer.HasExplicitLayout): New property
8046         Returns whether container has StructLayout attribute set Explicit.
8047         (FieldMember): New abstract class for consts and fields.
8048         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8049         (Field): Reuse FieldMember.
8050
8051         * const.cs (Const): Reuse FieldMember.
8052
8053         * rootcontext.cs: EmitConstants call moved to class.
8054
8055 2004-09-22  Martin Baulig  <martin@ximian.com>
8056
8057         Marek and me just fixed one of our oldest bugs: #28562 :-)
8058
8059         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8060
8061         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8062         we're an EnumConstant, just return that.
8063         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8064         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8065         to get the value which'll actually be written into the attribute.
8066         However, we have to use GetValue() to access the attribute's value
8067         in the compiler.        
8068
8069 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8070
8071         * constant.cs (Constant.IsNegative): New abstract property
8072         IsNegative.
8073
8074         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8075         (StackAlloc.DoResolve): Reused IsNegative.
8076
8077 2004-09-22  Martin Baulig  <martin@ximian.com>
8078
8079         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8080         public method; like LookupTypeContainer, but also works for
8081         generic instances.
8082
8083         * report.cs (Report.SymbolRelatedToPreviousError): Use
8084         TypeManager.LookupGenericTypeContainer().       
8085
8086 2004-09-22  Martin Baulig  <martin@ximian.com>
8087
8088         Thanks to Peter Sestoft for this bug report.
8089
8090         * expression.cs (Conditional): If both the `trueExpr' and the
8091         `falseExpr' is a NullLiteral, return a NullLiteral.
8092
8093 2004-09-22  Martin Baulig  <martin@ximian.com>
8094
8095         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8096         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8097         for the "get_Current" call.
8098
8099 2004-09-21  Martin Baulig  <martin@ximian.com>
8100
8101         * convert.cs (Convert.ImplicitReferenceConversion): When
8102         converting to an interface type, first check whether we're
8103         converting from a reference type.
8104
8105 2004-09-14  Martin Baulig  <martin@ximian.com>
8106
8107         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8108
8109 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8110
8111         Fixed bug #61902
8112         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8113         called and is obsolete then this member suppress message
8114         when call is inside next [Obsolete] method or type.
8115
8116         * expression.cs: Use TestObsoleteMethodUsage member.
8117
8118 2004-09-14  Martin Baulig  <martin@ximian.com>
8119
8120         * genericparser.cs: Removed.
8121
8122 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8123
8124         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8125
8126 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8127
8128         * attribute.cs (Attribute.Resolve): Add error 653 report.
8129
8130         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8131         report.
8132         (Method.ApplyAttributeBuilder): Add error 685 report.
8133         (Operator.Define): Add error 564 report.
8134
8135         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8136
8137         * expression.cs (Invocation.DoResolve): Add error
8138         245 and 250 report.
8139
8140         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8141         error 674 report.
8142
8143 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8144
8145         * class.cs (ConstructorInitializer.Resolve):
8146         Wrong error number (515->516).
8147
8148 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8149
8150         * class.cs (Indexer.Define): Add error 631 report.
8151
8152 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8153
8154         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8155
8156 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8157
8158         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8159
8160 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8161
8162         * cs-parser.jay: Added error CS0241 report.
8163
8164 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8165
8166         * cs-parser.jay (fixed_statement): Introduce a scope for the
8167         declaration in the 'fixed' statement.
8168
8169 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8170
8171         * cs-parser.jay: Added CS0230 error report.
8172
8173 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8174
8175         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8176
8177 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8178
8179         * expression.cs (Argument.Resolve): Added error CS0192 and
8180         CS0199 report.
8181
8182 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8183
8184         C# 2.0 #pragma warning feature
8185
8186         * cs-tokenizer.cs (PreProcessPragma): New method; 
8187         Handles #pragma directive.
8188
8189         * report.cs (WarningRegions): New class; Support
8190         class for #pragma warning directive. It tests whether
8191         warning is enabled for a given line.
8192
8193 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8194
8195         * const.cs: Add more descriptive error report, tahnks to
8196         Sebastien. 
8197
8198 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8199
8200         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8201
8202 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8203
8204         * expression.cs: Apply patch from Ben: Remove dead code from
8205         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8206         as that code just threw an exception anwyays.
8207
8208         * const.cs: Remove the call to the turnintoconstant, for details
8209         see bug: #63144
8210         
8211         * literal.cs: The type of the null-literal is the null type;  So
8212         we use a placeholder type (literal.cs:System.Null, defined here)
8213         for it.
8214
8215         * expression.cs (Conditional.DoResolve): Remove some old code that
8216         is no longer needed, conversions have been fixed.
8217
8218         (ArrayCreationExpression.DoResolve): Return false if we fail to
8219         resolve the inner expression.
8220
8221 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8222
8223         Fix test-290.cs.
8224         * cs-parser.jay (delegate_declaration): Record a delegate
8225         declaration as a type declaration.
8226         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8227
8228 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8229
8230         * parameter.cs: Do not crash if the type can not be resolved. 
8231
8232         * expression.cs: Report errors with unsafe pointers, fixes #64896
8233
8234 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8235
8236         * expression.cs: Pointer arith always needs to do a conv.i
8237         if the operand is a long. fix 65320
8238
8239 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8240
8241         Fixed cs0619-37.cs, cs0619-38.cs
8242
8243         * enum.cs (GetObsoleteAttribute): Removed.
8244
8245         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8246         on Enum member is double staged. The first is tested member
8247         and then enum.
8248
8249 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8250
8251         Fixed #56986, #63631, #65231
8252
8253         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8254         adds member to name container.
8255         (TypeContainer.AddToTypeContainer): New method, adds type to
8256         name container.
8257         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8258         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8259         AddOperator): Simplified by reusing AddToMemberContainer.
8260         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8261         instead of field.
8262         (Method.CheckForDuplications): Fixed implementation to test all
8263         possibilities.
8264         (MemberBase): Detection whether member is explicit interface
8265         implementation is now in constructor.
8266         (MemberBase.UpdateMemberName): Handles IndexerName.
8267         (Accessor): Changed to keep also location information.
8268         (AbstractPropertyEventMethod): Is derived from MemberCore.
8269         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8270         will be emited or not.
8271         (PropertyBase.AreAccessorsDuplicateImplementation):
8272         Tests whether accessors are not in collision with some method.
8273         (Operator): Is derived from MethodCore to simplify common
8274         operations.
8275
8276         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8277         must be performed.
8278         (DeclSpace.AddToContainer): Adds the member to defined_names
8279         table. It tests for duplications and enclosing name conflicts.
8280
8281         * enum.cs (EnumMember): Clean up to reuse the base structures
8282
8283 2004-09-03  Martin Baulig  <martin@ximian.com>
8284
8285         Merged latest changes into gmcs.  Please keep this comment in
8286         here, it makes it easier for me to see what changed in MCS since
8287         the last time I merged.
8288
8289 2004-09-03  Martin Baulig  <martin@ximian.com>
8290
8291         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8292         into TypeContainer, to make partial classes work again.
8293
8294 2004-09-03  Martin Baulig  <martin@ximian.com>
8295
8296         * rootcontext.cs (RootContext.V2): Removed.
8297
8298 2004-03-23  Martin Baulig  <martin@ximian.com>
8299
8300         * expression.cs (Invocation.OverloadResolve): Added `bool
8301         may_fail' argument and use it instead of the Location.IsNull() hack.
8302
8303 2004-09-09  Martin Baulig  <martin@ximian.com>
8304
8305         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8306
8307 2004-09-09  Martin Baulig  <martin@ximian.com>
8308
8309         * generic.cs (TypeParameter.DefineType): Added support for
8310         explicit interface methods.
8311
8312 2004-09-09  Martin Baulig  <martin@ximian.com>
8313
8314         * README.Changes: New document.  Started to list important changes
8315         between MCS and GMCS here.
8316
8317 2004-09-08  Martin Baulig  <martin@ximian.com>
8318
8319         * class.cs
8320         (TypeContainer.CheckRecursiveDefinition): New protected method.
8321         (TypeContainer.DefineType): Move the CS0146 check into
8322         CheckRecursiveDefinition().     
8323
8324 2004-09-06  Martin Baulig  <martin@ximian.com>
8325
8326         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8327         types for the constructor constraint.
8328
8329 2004-09-03  Martin Baulig  <martin@ximian.com>
8330
8331         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8332         into TypeContainer, to make partial classes work again.
8333
8334 2004-09-03  Martin Baulig  <martin@ximian.com>
8335
8336         * rootcontext.cs (RootContext.V2): Removed.
8337
8338 2004-03-23  Martin Baulig  <martin@ximian.com>
8339
8340         * expression.cs (Invocation.OverloadResolve): Added `bool
8341         may_fail' argument and use it instead of the Location.IsNull() hack.
8342
8343 2004-09-03  Martin Baulig  <martin@ximian.com>
8344
8345         Merged latest changes into gmcs.  Please keep this comment in
8346         here, it makes it easier for me to see what changed in MCS since
8347         the last time I merged.
8348
8349 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8350
8351         Fix #61128.
8352         * expression.cs (BetterConversion): Don't allow either conversion 
8353         to be null.  Remove redundant implicit conversion test when 'q ==
8354         null' -- when this function is invoked, we already know that the
8355         implicit conversion exists.
8356         (BetterFunction): Assume that 'best' is non-null.  Remove
8357         redundant reimplementation of IsApplicable when 'best' is null.
8358         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8359         number of arguments.
8360         (IsAncestralType): Extract from OverloadResolve.
8361         (OverloadResolve): Make robust to the MethodGroupExpr being
8362         unsorted.  Implement all the logic of Section 14.5.5.1, and
8363         support overloading of methods from multiple applicable types.
8364         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8365
8366         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8367         (RealError, Warning): Append type of report to related symbol.
8368
8369 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8370
8371         * enum.cs: Fixed CLS-Compliance checks for enum members.
8372         Error tests cs3008-8.cs, cs3014-8.cs
8373
8374 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8375
8376         Fixed bug #62342, #63102
8377         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8378         like ImplementMethod.
8379
8380 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8381
8382         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8383         Fixed bug #65170.
8384
8385 2004-09-02  Martin Baulig  <martin@ximian.com>
8386
8387         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8388         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8389         on the MethodBase.
8390
8391 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8392
8393         C# 2.0 Static classes implemented
8394
8395         * class.cs (TypeContainer): instance_constructors,
8396         initialized_fields, initialized_static_fields,
8397         default_constructor, base_inteface_types are protected to be
8398         accessible from StaticClass.
8399         (TypeContainer.DefineDefaultConstructor): New virtual method
8400         for custom default constructor generating
8401         (StaticClass): New class to handle "Static classes" feature.
8402
8403         * cs-parser.jay: Handle static keyword on class like instance
8404         of StaticClass.
8405
8406         * driver.cs: Added "/langversion" command line switch with two
8407         options (iso-1, default).
8408
8409 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8410
8411         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8412
8413 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8414
8415         * delegate.cs: Style.
8416
8417 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8418
8419         * delegate.cs: Add seperate instance expr field for miguel.
8420
8421 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8422
8423         * PointerArithmetic (Resolve): make sure we are not doing
8424         pointer arith on void*. Also, make sure we are resolved
8425         by not setting eclass until resolve.
8426
8427         All callers: Make sure that PointerArithmetic gets resolved.
8428
8429 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8430
8431         * ArrayCreation (LookupType): If the type does not resolve 
8432         to an array, give an error.
8433
8434 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8435
8436         * statement.cs (Try.Resolve): Fixed bug #64222
8437
8438 2004-08-27  Martin Baulig  <martin@ximian.com>
8439
8440         * class.cs
8441         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8442         crash here.     
8443
8444 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8445
8446         * ecore.cs (Constantify): Get underlying type via
8447         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8448         Windows in special cases.
8449
8450 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8451
8452         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8453         for obtaining also private methods.
8454         (GetRemoveMethod): Used GetRemoveMethod (true)
8455         for obtaining also private methods.
8456
8457 2004-09-02  Martin Baulig  <martin@ximian.com>
8458
8459         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8460         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8461         on the MethodBase.
8462
8463 2004-08-27  Martin Baulig  <martin@ximian.com>
8464
8465         * class.cs
8466         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8467         crash here.     
8468
8469 2004-08-25  Martin Baulig  <martin@ximian.com>
8470
8471         * support.cs (ReflectionParameters..ctor): If this is a generic
8472         method, retrieve and store its type parameters.
8473         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8474         (ReflectionParameters.GenericConstraints): The argument specifies
8475         the type parameter, not the method parameter.
8476         (InternalParameters.GenericConstraints): Likewise.
8477
8478         * generic.cs (TypeParameter.DefineType): Correctly handle
8479         constraints wrt. generic methods in interfaces and their
8480         implementations.        
8481
8482 2004-08-24  Martin Baulig  <martin@ximian.com>
8483
8484         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8485         (Constraints.IsSubclassOf): New internal method.
8486
8487         * typemanager.cs (TypeManager.FindMembers): Added special support
8488         for GenericTypeParameterBuilder's.      
8489         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8490         type parameters.
8491
8492 2004-08-24  Martin Baulig  <martin@ximian.com>
8493
8494         * typemanager.cs
8495         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8496         this for accessibility checks.
8497         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8498         IsNestedFamilyAccessible.
8499         (TypeManager.IsSubclassOf): New method, do what the name actually
8500         says.   
8501
8502 2004-08-24  Martin Baulig  <martin@ximian.com>
8503
8504         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8505         as a SimpleName, include the generic arity.
8506
8507 2004-08-24  Martin Baulig  <martin@ximian.com>
8508
8509         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8510         MethodAttributes.HideBySig for operators.
8511
8512 2004-08-23  Martin Baulig  <martin@ximian.com>
8513
8514         Back to the old error reporting system :-)
8515
8516         * report.cs (Message): Removed.
8517         (Report.MessageData, ErrorData, WarningData): Removed.
8518         (Report.Error, Warning): Back to the old system.
8519
8520 2004-08-23  Martin Baulig  <martin@ximian.com>
8521
8522         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8523
8524         * class.cs (TypeContainer.ParentContainer): New public virtual
8525         method; replaces the explicit interface implementation.
8526         (ClassPart.ParentContainer): Override.
8527
8528 2004-08-23  Martin Baulig  <martin@ximian.com>
8529
8530         * statement.cs (Switch): Added support for constant switches; see
8531         #59428 or test-285.cs.
8532
8533 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8534
8535         Fixed bug #62740.
8536         * statement.cs (GetEnumeratorFilter): Removed useless
8537         logic because C# specs is strict. GetEnumerator must be
8538         public.
8539
8540 2004-08-22  Martin Baulig  <martin@ximian.com>
8541
8542         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8543         a switch and may break, reset the barrier.  Fixes #59867.
8544
8545 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8546
8547         CLS-Compliance speed up (~5% for corlib)
8548
8549         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8550         New method. Tests container for CLS-Compliant names
8551
8552         * class.cs (TypeContainer.VerifyClsName): New method.
8553         Checks whether container name is CLS Compliant.
8554         (Constructor): Implements IMethodData.
8555
8556         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8557         low-case table for CLS Compliance test.
8558         (MemberCache.VerifyClsParameterConflict): New method.
8559         Checks method parameters for CS3006 error.
8560
8561         * enum.cs (EnumMember): Is derived from MemberCore.
8562         (Enum.VerifyClsName): Optimized for better performance.
8563
8564 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8565
8566         * report.cs: Renamed Error_T to Error and changed all
8567         references.
8568
8569 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8570
8571         * class.cs (TypeContainer.IndexerArrayList): New inner class
8572         container for indexers.
8573         (TypeContainer.DefaultIndexerName): New constant for default
8574         indexer name. Replaced all "Item" with this constant.
8575         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8576
8577         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8578         DefaultMemberAttribute constructor.
8579
8580 2004-08-05  Martin Baulig  <martin@ximian.com>
8581
8582         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8583         Fix bug #59429.
8584
8585 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8586
8587         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8588         multi platforms problem.
8589
8590         * compiler.csproj: Included shared files.
8591
8592 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8593
8594         Fix bug 60333, 55971 in the more general way
8595         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8596         Added arg_type argument for constant conversion.
8597         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8598
8599 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8600
8601         Fix bug #59760
8602         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8603         OperatorArrayList, MethodCoreArrayList for typecontainer
8604         containers. Changed class member types to these new types.
8605         (MethodArrayList.DefineMembers): Added test for CS0659.
8606
8607 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8608
8609         * cfold.cs: Synchronize the folding with the code in expression.cs
8610         Binary.DoNumericPromotions for uint operands.
8611
8612         * attribute.cs: Revert patch from Raja, it introduced a regression
8613         while building Blam-1.2.1 (hard to isolate a test case).
8614
8615 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8616
8617         Fix for #55382
8618         * class.cs:
8619         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8620         name collision.
8621         (MethodCore.parent_method): New member. The method we're overriding
8622         if this is an override method.
8623         (MethodCore.CheckBase): Moved from Method class and made common.
8624         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8625         private.
8626         (MethodCore.CheckForDuplications): New abstract method. For custom
8627         member duplication search in a container
8628         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8629         method and its return type.
8630         (Event.conflict_symbol): New member. Symbol with same name in the
8631         parent class.
8632
8633         * decl.cs:
8634         (MemberCache.FindMemberWithSameName): New method. The method
8635         is looking for conflict with inherited symbols.
8636
8637 2004-08-04  Martin Baulig  <martin@ximian.com>
8638
8639         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8640
8641         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8642
8643 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8644
8645         * report.cs (Message): New enum for better error, warning reference in
8646         the code.
8647         (MessageData): New inner abstract class. It generally handles printing of
8648         error and warning messages.
8649         Removed unused Error, Warning, Message methods.
8650
8651 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8652
8653         Fix for cs0592-8.cs test
8654         * attribute.cs
8655         (Attributable.ValidAttributeTargets): Made public.
8656         (Attribute.ExplicitTarget): New member for explicit target value.
8657         (Attribute.CheckTargets): Now we translate explicit attribute
8658         target to Target here.
8659
8660 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8661
8662         * ecore.cs (MethodGroupExpr): new IsBase property.
8663
8664         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8665
8666         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8667         rather than an instance expr.
8668
8669         (DelegateCreation.Emit): Use the method group rather than
8670         the instance expression. Also, if you have base.Foo as the
8671         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8672
8673         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8674
8675         (NewDelegate.DoResolve): Only check for the existance of Invoke
8676         if the method is going to be needed. Use MethodGroupExpr.
8677
8678         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8679
8680         * expression.cs: For pointer arith., make sure to use
8681         the size of the type, not the size of the pointer to
8682         the type.
8683
8684 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8685
8686         Fix for #60722
8687         * class.cs (Class): Added error CS0502 test.
8688
8689 2004-08-03  John Luke  <jluke@cfl.rr.com>
8690             Raja R Harinath  <rharinath@novell.com>
8691
8692         Fix for #60997.
8693         * attribute.cs (Attribute.complained_before): New flag.
8694         (Attribute.ResolveType, Attribute.Resolve),
8695         (Attribute.DefinePInvokeMethod): Set it.
8696         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8697         
8698 2004-08-03  Martin Baulig  <martin@ximian.com>
8699
8700         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8701         use a user-defined operator; we still need to do numeric
8702         promotions in case one argument is a builtin type and the other
8703         one has an implicit conversion to that type.  Fixes #62322.
8704
8705 2004-08-18  Martin Baulig  <martin@ximian.com>
8706
8707         * class.cs (Method.Define): Use the correct method name when
8708         creating the MethodBuilder for a generic method.
8709
8710 2004-08-17  Martin Baulig  <martin@ximian.com>
8711
8712         * generic.cs (Constraints): Support type parameter constraints.
8713
8714 2004-08-16  Martin Baulig  <martin@ximian.com>
8715
8716         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8717         (Token.GENERIC_DIMENSION): New token; this is returned if we
8718         encounter an unbound generic type in a typeof() expression.
8719
8720         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8721         this token is only generated while parsing a typeof() expression.
8722         (typeof_expression): Removed the old unbound_type hack.
8723
8724         * generic.cs (TypeArguments.IsUnbound): New public property.
8725
8726         * decl.cs (MemberName): Added support for unbound types.
8727
8728 2004-08-14  Martin Baulig  <martin@ximian.com>
8729
8730         * typemanager.cs
8731         (TypeManager.IsEqualGenericInstance): New static method.
8732         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8733         just used to check accessibility, so follow the rules of 26.1.6.        
8734
8735         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8736         ConstructedType instead of a TypeExpression if we have type arguments.
8737
8738         * cs-parser.jay (typeof_expression): Support unbound generic types.
8739
8740         * ecore.cs (UnboundTypeExpression): New public class.
8741
8742 2004-08-12  Martin Baulig  <martin@ximian.com>
8743
8744         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8745         TypeManager.IsEqual() rather than `=='.
8746
8747         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8748         generic instances as well.
8749
8750 2004-08-12  Martin Baulig  <martin@ximian.com>
8751
8752         * expression.cs (Invocation.InferType): We can only infer method
8753         type parameters.  Fixes #62647.
8754
8755 2004-08-11  Martin Baulig  <martin@ximian.com>
8756
8757         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8758         before resolving the base classes.
8759
8760 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8761
8762         * Makefile: install .mdb file too.
8763
8764 2004-08-05  Martin Baulig  <martin@ximian.com>
8765
8766         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8767         initializer, the current type is just the TypeBuilder, not the
8768         instantiated generic type.
8769         (FieldExpr.IsFieldInitializer): New public property.
8770
8771 2004-08-04  Martin Baulig  <martin@ximian.com>
8772
8773         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8774
8775         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8776
8777 2004-08-03  Martin Baulig  <martin@ximian.com>
8778
8779         * class.cs (MethodData.Define): If we're an explicit
8780         implementation, remove the generic arity from the type name.
8781
8782 2004-08-03  Martin Baulig  <martin@ximian.com>
8783
8784         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8785         use a user-defined operator; we still need to do numeric
8786         promotions in case one argument is a builtin type and the other
8787         one has an implicit conversion to that type.  Fixes #62322.
8788
8789 2004-08-02  Martin Baulig  <martin@ximian.com>
8790
8791         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8792         `TypeExpr[]' array.
8793         (TypeContainer.GetClassBases): Return the unexpanded list of
8794         interfaces; we expand them later.
8795         (TypeContainer.DefineType): After creating the TypeBuilder, call
8796         TypeManager.ExpandInterfaces() to get an expanded and resolved
8797         list of interfaces.
8798
8799         * ecore.cs (TypeExpr.GetInterfaces): Removed
8800
8801         * generics.cs (Constraints.InterfaceConstraints): Remove.
8802         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8803         register the interface constraints.
8804
8805         * typemanager.cs
8806         (TypeManager.AddUserType): Removed the `ifaces' argument.
8807         (TypeManager.AddTypeParameter): Likewise.
8808         (TypeManager.AddUserInterface): Removed, was unused.
8809         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8810         `TypeExpr[]' array for the interfaces.
8811         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8812         has been defined, returns a list of the resolved interfaces types.
8813         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8814         (TypeManager.GetExplicitInterfaces): Likewise.  
8815
8816 2004-08-02  Martin Baulig  <martin@ximian.com>
8817
8818         * expression.cs (Invocation.EmitCall): If we're invoking a method
8819         on a type parameter, use the new `Constrained' prefix opcode.
8820
8821 2004-08-02  Martin Baulig  <martin@ximian.com>
8822
8823         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8824         (LocalInfo.IsThis): New public property.
8825         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8826
8827 2004-08-01  Martin Baulig  <martin@ximian.com>
8828
8829         * class.cs (TypeContainer.GetClassBases): Don't set the default
8830         here since we may get called from GetPartialBases().
8831         (TypeContainer.DefineType): If GetClassBases() didn't return a
8832         parent, use the default one.
8833
8834 2004-07-30  Martin Baulig  <martin@ximian.com>
8835
8836         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8837
8838         * class.cs (SourceMethod): New public class, derive from the
8839         symbol writer's ISourceMethod.
8840         (Method): Use the new symbol writer API.
8841
8842         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8843         as argument and use the new symbol writer.
8844
8845         * location.cs
8846         (SourceFile): Implement the symbol writer's ISourceFile.
8847         (Location.SymbolDocument): Removed.
8848         (Location.SourceFile): New public property.
8849
8850         * symbolwriter.cs: Use the new symbol writer API.
8851
8852 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8853
8854         * Makefile (install-local): Remove.  Functionality moved to
8855         executable.make.
8856
8857 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8858
8859         * Makefile: Install mcs.exe.config file together with mcs.exe.
8860         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8861         correct runtime version.
8862         
8863 2004-07-25  Martin Baulig  <martin@ximian.com>
8864
8865         * class.cs
8866         (TypeContainer.RegisterOrder): Removed, this was unused.
8867         (TypeContainer, interface_order): Removed.
8868         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8869         TypeContainer as argument since we can also be called with a
8870         `PartialContainer' for a partial class/struct/interface.
8871         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8872         of checking whether we're an `Interface' - we could be a
8873         `PartialContainer'.
8874         (PartialContainer.Register): Override; call
8875         AddClass()/AddStruct()/AddInterface() on our parent.
8876
8877         * cs-parser.jay (interface_member_declaration): Add things to the
8878         `current_container', not the `current_class'.
8879
8880         * rootcontext.cs (RegisterOrder): The overloaded version which
8881         takes an `Interface' was unused, removed.
8882
8883         * typemanager.cs (TypeManager.LookupInterface): Return a
8884         `TypeContainer', not an `Interface'.
8885         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8886         contain a `PartialContainer' for an interface, so check it's
8887         `Kind' to figure out what it is.
8888
8889 2004-07-25  Martin Baulig  <martin@ximian.com>
8890
8891         * class.cs (Class.DefaultTypeAttributes): New public constant.
8892         (Struct.DefaultTypeAttributes): Likewise.
8893         (Interface.DefaultTypeAttributes): Likewise.
8894         (PartialContainer.TypeAttr): Override this and add the
8895         DefaultTypeAttributes.
8896
8897 2004-07-25  Martin Baulig  <martin@ximian.com>
8898
8899         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8900         we can just use the `Parent' field instead.
8901
8902 2004-07-25  Martin Baulig  <martin@ximian.com>
8903
8904         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8905
8906 2004-07-25  Martin Baulig  <martin@ximian.com>
8907
8908         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8909         our parts before defining any methods.
8910         (TypeContainer.VerifyImplements): Make this virtual.
8911         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8912         on our PartialContainer.
8913
8914 2004-07-25  Martin Baulig  <martin@ximian.com>
8915
8916         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8917
8918         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8919         argument, we can just use the `Parent' field instead.
8920
8921         * class.cs
8922         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8923         (MemberBase.DoDefine): Likewise.
8924
8925 2004-07-24  Martin Baulig  <martin@ximian.com>
8926
8927         * decl.cs (MemberCore.Parent): New public field.
8928         (DeclSpace.Parent): Moved to MemberCore.
8929
8930         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8931         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8932         parent's .ctor.
8933         (FieldBase, Field, Operator): Likewise.
8934         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8935         (EventField, Event): Likewise.
8936
8937 2004-07-23  Martin Baulig  <martin@ximian.com>
8938
8939         * class.cs (PartialContainer): New public class.
8940         (ClassPart): New public class.
8941         (TypeContainer): Added support for partial classes.
8942         (TypeContainer.GetClassBases): Splitted some of the functionality
8943         out into GetNormalBases() and GetPartialBases().
8944
8945         * cs-tokenizer.cs (Token.PARTIAL): New token.
8946         (Tokenizer.consume_identifier): Added some hacks to recognize
8947         `partial', but only if it's immediately followed by `class',
8948         `struct' or `interface'.
8949
8950         * cs-parser.jay: Added support for partial clases.
8951
8952 2004-07-23  Martin Baulig  <martin@ximian.com>
8953
8954         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8955         a `DeclSpace' and also made it readonly.
8956         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8957         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8958         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8959
8960         * cs-parser.jay: Pass the `current_class', not the
8961         `current_container' (at the moment, this is still the same thing)
8962         to a new Method, Property, Event, Indexer or Constructor.
8963
8964 2004-07-23  Martin Baulig  <martin@ximian.com>
8965
8966         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8967         and removed the `current_interface' one.
8968         (struct_declaration, class_declaration, interface_declaration):
8969         Set `current_class' to the newly created class/struct/interface;
8970         set their `Bases' and call Register() before parsing their body.
8971
8972 2004-07-23  Martin Baulig  <martin@ximian.com>
8973
8974         * class.cs (Kind): New public enum.
8975         (TypeContainer): Made this class abstract.
8976         (TypeContainer.Kind): New public readonly field.
8977         (TypeContainer.CheckDef): New public method; moved here from
8978         cs-parser.jay.
8979         (TypeContainer.Register): New public abstract method.
8980         (TypeContainer.GetPendingImplementations): New public abstract
8981         method.
8982         (TypeContainer.GetClassBases): Removed the `is_class' and
8983         `is_iface' parameters.
8984         (TypeContainer.DefineNestedTypes): Formerly known as
8985         DoDefineType().
8986         (ClassOrStruct): Made this class abstract.
8987
8988         * tree.cs (RootTypes): New public type. 
8989
8990 2004-07-20  Martin Baulig  <martin@ximian.com>
8991
8992         * tree.cs (Tree.RecordNamespace): Removed.
8993         (Tree.Namespaces): Removed.
8994
8995         * rootcontext.cs (RootContext.IsNamespace): Removed.
8996
8997         * cs-parser.jay (namespace_declaration): Just create a new
8998         NamespaceEntry here.
8999
9000 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
9001
9002         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9003         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9004         entry to make sure it runs in the correct runtime version.
9005         
9006 2004-07-18  Martin Baulig  <martin@ximian.com>
9007
9008         * generic.cs (ConstructedType.CheckConstraints): Improved
9009         constraints checking.
9010
9011 2004-07-18  Martin Baulig  <martin@ximian.com>
9012
9013         * expression.cs (Invocation.BetterMethod): Call
9014         TypeManager.TypeToCoreType() on all types and removed my previous
9015         hack; we're already doig the right thing here.
9016
9017 2004-07-17  Martin Baulig  <martin@ximian.com>
9018
9019         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9020
9021 2004-07-16  Martin Baulig  <martin@ximian.com>
9022
9023         * iterators.cs: Added generics support.
9024
9025 2004-07-16  Martin Baulig  <martin@ximian.com>
9026
9027         * iterators.cs: Rewrote this.  We're now using one single Proxy
9028         class for both the IEnumerable and the IEnumerator interface and
9029         `Iterator' derives from Class so we can use the high-level API.
9030
9031         * class.cs (TypeContainer.AddIterator): New method.
9032         (TypeContainer.DoDefineType): New protected virtual method, which
9033         is called from DefineType().
9034         (TypeContainer.DoDefineMembers): Call DefineType() and
9035         DefineMembers() on all our iterators.
9036         (TypeContainer.Emit): Call Emit() on all our iterators.
9037         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9038
9039         * codegen.cs (EmitContext.CurrentIterator): New public field.
9040
9041 2004-07-15  Martin Baulig  <martin@ximian.com>
9042
9043         * typemanager.cs
9044         (TypeManager.not_supported_exception_type): New type.   
9045
9046 2004-07-14  Martin Baulig  <martin@ximian.com>
9047
9048         * typemanager.cs
9049         (TypeManager.generic_ienumerable_type): New type.
9050         (TypeManager.generic_ienumerator_type): New type.
9051
9052         * rootcontext.cs
9053         (RootContext.interfaces_first_stage): Added
9054         "System.Collections.Generic.IEnumerator`1" and
9055         "System.Collections.Generic.IEnumerable`1".     
9056
9057 2004-07-14  Martin Baulig  <martin@ximian.com>
9058
9059         * iterators.cs: Use real error numbers.
9060
9061 2004-07-14  Martin Baulig  <martin@ximian.com>
9062
9063         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9064         requires this to be a System.Collection.IEnumerable and not a
9065         class implementing that interface.
9066         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9067
9068 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9069
9070         * class.cs: Fixed previous fix, it broke some error tests.
9071
9072 2004-07-12  Martin Baulig  <martin@ximian.com>
9073
9074         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9075         Fixes #61293.
9076
9077 2004-07-14  Martin Baulig  <martin@ximian.com>
9078
9079         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9080         an exclamation mark (!) for the generic arity to reflect the
9081         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9082
9083 2004-07-13  Martin Baulig  <martin@ximian.com>
9084
9085         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9086         specifiers being part of a type argument.
9087
9088 2004-07-13  Martin Baulig  <martin@ximian.com>
9089
9090         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9091         name for generic types.
9092
9093 2004-07-13  Martin Baulig  <martin@ximian.com>
9094
9095         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9096         bit to fix #60119.
9097
9098 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9099
9100         * assign.cs (LocalTemporary): Add new argument: is_address,If
9101         `is_address' is true, then the value that we store is the address
9102         to the real value, and not the value itself.
9103         
9104         * ecore.cs (PropertyExpr): use the new local temporary
9105         stuff to allow us to handle X.Y += z (where X is a struct)
9106
9107 2004-07-08  Martin Baulig  <martin@ximian.com>
9108
9109         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9110         not always return, just like we're doing in Using.Resolve().
9111
9112 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9113
9114         * cs-parser.jay (fixed_statement): flag this as Pinned.
9115
9116 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9117
9118         * typemanager.cs (TypeManager): Removed MakePinned method, this
9119         mechanism is replaced with the .NET 2.x compatible mechanism of
9120         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9121
9122         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9123         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9124         `IsFixed' property which has a different meaning.
9125
9126 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9127
9128         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9129         visible from inside a nested class, not just the names of the
9130         immediately enclosing class.
9131         Fix for bug #60730.
9132
9133 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9134
9135         * expression.cs (BetterConversion): Remove buggy special-case
9136         handling of "implicit constant expression conversions".  At this
9137         point, we already know that the conversion is possible -- we're
9138         only checking to see which is better.
9139
9140 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9141
9142         * cs-parser.jay: Added error CS0210 test.
9143
9144 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9145
9146         * cs-parser.jay: Added error CS0134 test.
9147
9148 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9149
9150         Fix bug #52507
9151         * cs-parser.jay: Added error CS0145 test.
9152
9153 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9154
9155         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9156
9157 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9158         
9159         * expression.cs (StackAlloc.Resolve): The argument may not
9160         be a constant; deal with this case.
9161         
9162 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9163
9164         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9165         GetIndexerAttributeValue.
9166         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9167
9168         * class.cs (Indexer.Define): Added error tests for CS0415,
9169         CS0609.
9170
9171 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9172
9173         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9174         property code.
9175
9176 2004-06-23  Martin Baulig  <martin@ximian.com>
9177
9178         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9179         neither return nor throw, reset the barrier as well.  Fixes #60457.
9180
9181 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9182
9183         * class.cs : EventAttributes is now set to None by default.
9184           This fixes bug #60459.
9185
9186 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9187
9188         Fix bug #60219
9189         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9190         Don't throw exception but return null (it's sufficient now).
9191
9192 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9193
9194         * typemanager.cs (GetArgumentTypes): Faster implementation.
9195
9196 2004-06-18  Martin Baulig  <martin@ximian.com>
9197
9198         * attribute.cs (Attribute.Resolve): Check whether we're an
9199         EmptyCast which a Constant child.  Fixes #60333.
9200
9201 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9202
9203         * statement.cs (EmitCollectionForeach): Account for the fact that
9204         not all valuetypes are in areas which we can take the address of.
9205         For these variables, we store to a temporary variable. Also, make
9206         sure that we dont emit a `callvirt' on a valuetype method.
9207
9208 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9209
9210         * expression.cs (StackAlloc.DoReSolve): Added test for
9211         negative parameter (CS0247).
9212
9213 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9214
9215         Fix bug #59792
9216         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9217
9218 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9219
9220         Fix bug #59781
9221         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9222         ulong.
9223
9224 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9225
9226         Fix bug #58254 & cs1555.cs, cs1556.cs
9227         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9228
9229 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9230
9231         * cs-parser.jay: Added error CS1669 test for indexers.
9232
9233 2004-06-18  Martin Baulig  <martin@ximian.com>
9234
9235         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9236         argument.  Fixes #60441.
9237
9238 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9239         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9240         The name needs to have the actual name of the method in order
9241         for other tests (such as the one in OverloadResolve for Invoke
9242         on a delegate) to work. As well, it does not really help
9243         error reporting because the method group had multiple methods.
9244         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9245         Make profiling work.
9246         
9247 2004-06-13  Martin Baulig  <martin@ximian.com>
9248
9249         * cs-parser.jay: Don't allow generic attributes.
9250
9251 2004-06-13  Martin Baulig  <martin@ximian.com>
9252
9253         * class.cs (MemberBase.DoDefineBase): New protected method.
9254         (MemberBase.DoDefine): Compute the `flags' in the new
9255         DoDefineBase() which must be called first.
9256         (Method.Define): Call DoDefineBase() first so we have the flags
9257         when defining the generic method.
9258
9259         * cs-parser.jay (interface_method_declaration): Support generic methods.
9260
9261 2004-06-13  Martin Baulig  <martin@ximian.com>
9262
9263         * decl.cs (TypeName): Removed.
9264         (MemberName): Removed TypeName and MemberNow; now we just have
9265         MemberName.
9266
9267         * cs-parser.jay: Don't distinguish between type arguments and type
9268         parameters in the grammar and simplified the rules a bit.  The
9269         reduce/reduce conflicts are now gone (except the one we inherited
9270         from mcs).
9271
9272 2004-06-11  Martin Baulig  <martin@ximian.com>
9273
9274         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9275         call this twice: for params and varargs methods.
9276
9277 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9278
9279         * class.cs:
9280         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9281
9282 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9283
9284         * attribute.cs (Attribute.GetValidTargets): Made public.
9285
9286         * class.cs: 
9287         (AbstractPropertyEventMethod): New class for better code sharing.
9288         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9289         CS1667 report.
9290         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9291
9292 2004-06-09  Martin Baulig  <martin@ximian.com>
9293
9294         * cs-parser.jay: Removed a reduce/reduce conflict.
9295
9296 2004-06-03  Martin Baulig  <martin@ximian.com>
9297
9298         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9299         GetSimpleName() and return a SimpleName.
9300
9301         * ecore.cs (SimpleName.Arguments): New public field.
9302         (SimpleName): Added overloaded ctor which takes an additional
9303         TypeArguments argument.
9304         (SimpleName.SimpleNameResolve): Added support for generic methods.
9305         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9306         formerly in MemberAccess.DoResolve(), but we also need it in
9307         SimpleNameResolve().
9308
9309         * expression.cs (MemberAccess.DoResolve): Use the new
9310         MethodGroupExpr.ResolveGeneric().       
9311
9312 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9313
9314         * decl.cs: If possible, use lookuptypedirect here. We can only do
9315         this if there is no `.' after the namespace. Avoids using
9316         LookupType, which does lots of slow processing.
9317         (FindNestedType) New method, does what it says :-).
9318         * namespace.cs: use LookupTypeDirect.
9319         * rootcontext.cs: use membercache, if possible.
9320         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9321
9322 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9323
9324         * expression.cs:
9325         According to the spec, 
9326
9327         In a member access of the form E.I, if E is a single identifier,
9328         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9329         field, property, localvariable, or parameter with the same type as
9330         the meaning of E as a type-name (§3.8), then both possible
9331         meanings of E are permitted.
9332
9333         We did not check that E as a simple-name had the same type as E as
9334         a type name.
9335
9336         This trivial check gives us 5-7% on bootstrap time.
9337
9338 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9339
9340         * expression.cs (Invocation.OverloadResolve): Avoid the
9341         use of hashtables and boxing here by allocating on demand.
9342
9343 2004-05-30  Martin Baulig  <martin@ximian.com>
9344
9345         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9346         we're doing a silent lookup.  Don't try to lookup nested types in
9347         TypeManager.object_type (thanks to Ben Maurer).
9348
9349 2004-05-30  Martin Baulig  <martin@ximian.com>
9350
9351         Committing a patch from Ben Maurer.
9352
9353         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9354
9355 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9356
9357         * convert.cs: add a trivial cache for overload operator resolution.
9358
9359 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9360
9361         * attribute.cs
9362         (AttributeTester.GetObsoleteAttribute): Returns instance of
9363         ObsoleteAttribute when type is obsolete.
9364
9365         * class.cs
9366         (TypeContainer.VerifyObsoleteAttribute): Override.
9367         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9368         (MethodCode.VerifyObsoleteAttribute): Override.
9369         (MemberBase.VerifyObsoleteAttribute): Override.
9370
9371         * decl.cs
9372         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9373         and report proper error.
9374
9375         *delegate.cs
9376         (Delegate.VerifyObsoleteAttribute): Override.
9377
9378         * ecore.cs
9379         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9380         and report proper error.
9381         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9382
9383         * enum.cs
9384         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9385         and enum member.
9386
9387         * expression.cs
9388         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9389         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9390         Added test for ObsoleteAttribute.
9391
9392         * statement.cs
9393         (Catch): Derived from Statement.
9394
9395 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9396
9397         * decl.cs: If possible, use lookuptypedirect here. We can only do
9398         this if there is no `.' after the namespace. Avoids using
9399         LookupType, which does lots of slow processing.
9400         (FindNestedType) New method, does what it says :-).
9401         * namespace.cs: use LookupTypeDirect.
9402         * rootcontext.cs: use membercache, if possible.
9403         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9404
9405 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9406
9407         * expression.cs:
9408         According to the spec, 
9409
9410         In a member access of the form E.I, if E is a single identifier,
9411         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9412         field, property, localvariable, or parameter with the same type as
9413         the meaning of E as a type-name (§3.8), then both possible
9414         meanings of E are permitted.
9415
9416         We did not check that E as a simple-name had the same type as E as
9417         a type name.
9418
9419         This trivial check gives us 5-7% on bootstrap time.
9420
9421 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9422
9423         Fixed bug #59071 & cs0160.cs
9424         * statement.cs (Try.Resolve): Check here whether order of catch
9425         clauses matches their dependencies.
9426
9427 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9428
9429         Fixed bug #58624
9430         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9431         unsafe type.
9432
9433 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9434
9435         * expression.cs (Invocation.OverloadResolve): Avoid the
9436         use of hashtables and boxing here by allocating on demand.
9437
9438 2004-05-30  Martin Baulig  <martin@ximian.com>
9439
9440         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9441         we're doing a silent lookup.  Don't try to lookup nested types in
9442         TypeManager.object_type (thanks to Ben Maurer).
9443
9444 2004-05-30  Martin Baulig  <martin@ximian.com>
9445
9446         Committing a patch from Ben Maurer.
9447
9448         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9449
9450 2004-05-29  Martin Baulig  <martin@ximian.com>
9451
9452         * class.cs (IMethodData.ShouldIgnore): New method.
9453
9454         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9455         `Location' argument, we don't need it anywhere.  Use
9456         `IMethodData.ShouldIgnore ()' instead of
9457         `MethodData.GetMethodFlags ()'.
9458         (TypeManager.AddMethod): Removed.
9459         (TypeManager.AddMethod2): Renamed to AddMethod.
9460
9461 2004-05-29  Martin Baulig  <martin@ximian.com>
9462
9463         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9464
9465         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9466         converting from a class type S to an interface type and we already
9467         have an object on the stack, don't box it again.  Fixes #52578.
9468
9469 2004-05-29  Martin Baulig  <martin@ximian.com>
9470
9471         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9472         Added support for `params' parameters.  Fixes #59267.
9473
9474 2004-05-29  Martin Baulig  <martin@ximian.com>
9475
9476         * literal.cs (NullPointer): Provide a private .ctor which sets
9477         `type' to TypeManager.object_type.  Fixes #59048.
9478
9479 2004-05-29  Martin Baulig  <martin@ximian.com>
9480
9481         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9482         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9483
9484         * ecore.cs (EventExpr.instance_expr): Make the field private.
9485
9486 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9487
9488         Fixed bug #50080 & cs0214-2.cs
9489         * expression.cs (Cast.DoResolve): Check unsafe context here.
9490         
9491         * statement.cs (Resolve.DoResolve): Likewise.
9492
9493 2004-05-26  Martin Baulig  <martin@ximian.com>
9494
9495         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9496
9497         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9498         (RootContext.LookupType): Pass down the `silent' flag.
9499
9500 2004-05-25  Martin Baulig  <martin@ximian.com>
9501
9502         * expression.cs
9503         (MethodGroupExpr.IdenticalTypeName): New public property.
9504         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9505         expression actually refers to a type.
9506
9507 2004-05-25  Martin Baulig  <martin@ximian.com>
9508
9509         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9510         for #56176 and made it actually work.
9511
9512 2004-05-25  Martin Baulig  <martin@ximian.com>
9513
9514         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9515         (FieldExpr, PropertyExpr): Override and implement
9516         CacheTemporaries.  Fixes #52279.
9517
9518 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9519
9520         * location.cs: In the new compiler listing a file twice is a
9521         warning, not an error.
9522
9523 2004-05-24  Martin Baulig  <martin@ximian.com>
9524
9525         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9526         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9527
9528 2004-05-24  Martin Baulig  <martin@ximian.com>
9529
9530         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9531         walking the `using' list.  Fixes #53921.
9532
9533 2004-05-24  Martin Baulig  <martin@ximian.com>
9534
9535         * const.cs (Const.LookupConstantValue): Added support for
9536         EmptyCast's; fixes #55251.
9537
9538 2004-05-24  Martin Baulig  <martin@ximian.com>
9539
9540         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9541         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9542         which does the CS0135 check.  The reason is that we first need to
9543         check whether the variable actually exists.
9544
9545 2004-05-24  Martin Baulig  <martin@ximian.com>
9546
9547         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9548         than RootContext.LookupType() to find the explicit interface
9549         type.  Fixes #58584.
9550
9551 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9552
9553         * Makefile: Simplify.  Use executable.make.
9554         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9555
9556 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9557
9558         * decl.cs:
9559         * enum.cs:
9560         Use the invariant culture when doing String.Compare for CLS case
9561         sensitivity.
9562         
9563 2004-05-23  Martin Baulig  <martin@ximian.com>
9564
9565         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9566         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9567
9568         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9569
9570 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9571
9572         * class.cs (MemberBase.Define): Reuse MemberType member for 
9573         resolved type. Other methods can use it too.
9574
9575 2004-05-23  Martin Baulig  <martin@ximian.com>
9576
9577         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9578         the variable also exists in the current block (otherwise, we need
9579         to report a CS0103).  Fixes #58670.
9580
9581 2004-05-23  Martin Baulig  <martin@ximian.com>
9582
9583         * flowanalysis.cs (Reachability.Reachable): Compute this
9584         on-the-fly rather than storing it as a field.
9585
9586 2004-05-23  Martin Baulig  <martin@ximian.com>
9587
9588         * flowanalysis.cs (Reachability.And): Manually compute the
9589         resulting `barrier' from the reachability.      
9590        
9591 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9592
9593         Fix bug #57835
9594         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9595         instance of ObsoleteAttribute when symbol is obsolete.
9596
9597         * class.cs
9598         (IMethodData): Extended interface for ObsoleteAttribute support.
9599
9600 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9601
9602         * attribute.cs: Fix bug #55970
9603
9604 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9605
9606         Fix bug #52705
9607         * attribute.cs
9608         (GetObsoleteAttribute): New method. Creates the instance of
9609         ObsoleteAttribute.
9610         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9611         ObsoleteAttribute when member is obsolete.
9612         (AttributeTester.Report_ObsoleteMessage): Common method for
9613         Obsolete error/warning reporting.
9614
9615         * class.cs
9616         (TypeContainer.base_classs_type): New member for storing parent type.
9617
9618         * decl.cs
9619         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9620         for this MemberCore.
9621
9622 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9623
9624         * attribute.cs, const.cs: Fix bug #58590
9625
9626 2004-05-21  Martin Baulig  <martin@ximian.com>
9627
9628         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9629         out parameters if the end of the method is unreachable.  Fixes
9630         #58098. 
9631
9632 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9633
9634         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9635         Hari was right, why extra method.
9636
9637 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9638
9639         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9640
9641 2004-05-20  Martin Baulig  <martin@ximian.com>
9642
9643         * delegate.cs: Convert this file to Unix mode - like the original
9644         version in mcs is.
9645
9646 2004-05-20  Martin Baulig  <martin@ximian.com>
9647
9648         * attribute.cs: Convert this file to Unix mode - like the original
9649         version in mcs is.
9650
9651 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9652
9653        Fix bug #58688 (MCS does not report error when the same attribute
9654        is assigned twice)
9655
9656        * attribute.cs (Attribute.Emit): Distinction between null and default.
9657
9658 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9659
9660        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9661        of a top-level attribute without an attribute target.
9662        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9663        Make non-static.
9664        (Attribute.Conditional_GetConditionName), 
9665        (Attribute.Obsolete_GetObsoleteMessage): Update.
9666        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9667        part of ScanForIndexerName.
9668        (Attribute.CanIgnoreInvalidAttribute): New function.
9669        (Attribute.ScanForIndexerName): Move to ...
9670        (Attributes.ScanForIndexerName): ... here.
9671        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9672        (Attributes.Search): New internal variant that can choose not to
9673        complain if types aren't resolved.  The original signature now
9674        complains.
9675        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9676        complaints suppressed.
9677        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9678        only if it not useful.
9679        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9680        top-level for attributes that are shared between the assembly
9681        and a top-level class.
9682        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9683        * class.cs: Update to reflect changes.
9684        (DefineIndexers): Fuse loops.
9685        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9686        a couple more variants of attribute names.
9687
9688 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9689
9690         Fix bug #52585 (Implemented explicit attribute declaration)
9691
9692         * attribute.cs:
9693         (Attributable.ValidAttributeTargets): New abstract method. It gets
9694         list of valid attribute targets for explicit target declaration.
9695         (Attribute.Target): It holds target itself.
9696         (AttributeSection): Removed.
9697         (Attribute.CheckTargets): New method. It checks whether attribute
9698         target is valid for the current element.
9699
9700         * class.cs:
9701         (EventProperty): New class. For events that are declared like
9702         property (with add and remove accessors).
9703         (EventField): New class. For events that are declared like field.
9704         class.cs
9705
9706         * cs-parser.jay: Implemented explicit attribute target declaration.
9707
9708         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9709         Override ValidAttributeTargets.
9710
9711         * parameter.cs:
9712         (ReturnParameter): Class for applying custom attributes on 
9713         the return type.
9714         (ParameterAtribute): New class. Class for applying custom
9715         attributes on the parameter type.
9716
9717 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9718
9719         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9720         definitions. 
9721
9722         (Method): Allow UNSAFE here.
9723
9724         * modifiers.cs: Support unsafe reporting.
9725
9726 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9727
9728         * decl.cs: Fix bug #58478.
9729
9730 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9731
9732         * statement.cs: When checking for unreachable code on an EmptyStatement,
9733         set the location. Fixes bug #58488.
9734
9735 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9736
9737         * driver.cs: Add -pkg handling.
9738
9739         From Gonzalo: UseShelLExecute=false
9740
9741 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9742
9743         * attribute.cs:
9744         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9745         for attribute.
9746         (Attribute.IsClsCompliaceRequired): Moved to base for better
9747         accesibility.
9748         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9749         when attribute is AttributeUsageAttribute.
9750         (Attribute.GetValidTargets): Simplified.
9751         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9752         attribute for this type.
9753         (Attribute.ApplyAttributes): Method renamed to Emit and make
9754         non-static.
9755         (GlobalAttributeSection): New class for special handling of global
9756         attributes (assembly, module).
9757         (AttributeSection.Emit): New method.
9758
9759         * class.cs: Implemented Attributable abstract methods.
9760         (MethodCore.LabelParameters): Moved to Parameter class.
9761         (Accessor): Is back simple class.
9762         (PropertyMethod): Implemented Attributable abstract class.
9763         (DelegateMethod): Implemented Attributable abstract class.
9764         (Event): New constructor for disctintion between normal Event
9765         and Event with accessors.
9766
9767         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9768
9769         * codegen.cs, const.cs, decl.cs, delegate.cs:
9770         (CommonAssemblyModulClass): Implemented Attributable abstract class
9771         and simplified.
9772
9773         * enum.cs: Implement IAttributeSupport interface.
9774         (EnumMember): New class for emum members. Implemented Attributable
9775         abstract class
9776
9777         * parameter.cs:
9778         (ParameterBase): Is abstract.
9779         (ReturnParameter): New class for easier [return:] attribute handling.
9780
9781         * typemanager.cs: Removed builder_to_attr.
9782
9783 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9784
9785         Fix bug #57151.
9786         * attribute.cs (Attribute.GetPositionalValue): New function.
9787         * class.cs (TypeContainer.VerifyMembers): New function.
9788         (TypeContainer.Emit): Use it.
9789         (ClassOrStruct): New base class for Class and Struct.
9790         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9791         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9792         class.
9793         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9794         then each non-static field should have a FieldOffset attribute.
9795         Otherwise, none of the fields should have a FieldOffset attribute.
9796         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9797         and FieldOffset attributes.
9798         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9799         (TypeManager.field_offset_attribute_type): New core types.
9800         (TypeManager.InitCoreTypes): Initialize them.
9801
9802 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9803
9804         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9805         Return correct type.
9806         From bug #58270.
9807
9808 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9809
9810         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9811         be implicitly converted to ulong.
9812         
9813         * expression.cs: The logic for allowing operator &, | and ^ worked
9814         was wrong, it worked before because we did not report an error in
9815         an else branch.  Fixes 57895.
9816
9817         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9818         allow volatile fields to be reference types.
9819
9820 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9821
9822         * driver.cs: Add support for /debug-
9823
9824 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9825
9826         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9827         Add a 'complain' parameter to silence errors.
9828         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9829         silently overlooked type-resolutions.
9830         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9831         to reflect changes.
9832         (Attributes.Search): New function.
9833         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9834         (Attributes.GetAttributeFullName): Remove hack.
9835         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9836         Update to reflect changes.
9837         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9838         Use Attributes.Search instead of nested loops.
9839
9840 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9841
9842         * decl.cs:
9843         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9844         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9845         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9846
9847         * report.cs: (Report.Warning): Renamed to Warning_T because of
9848         parameter collision.
9849
9850 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9851
9852         * expression.cs (MemberAccess.ResolveMemberAccess):
9853         Exit with non-zero status after Report.Error.
9854         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9855         Likewise.
9856         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9857
9858 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9859
9860         * support.cs: Don't hang when the file is empty.
9861
9862 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9863
9864         * support.cs: In SeekableStreamReader, compute the preamble size of the
9865           underlying stream. Position changes should take into account that initial
9866           count of bytes.
9867
9868 2004-05-03  Todd Berman  <tberman@sevenl.net>
9869
9870         * driver.cs: remove unused GetSysVersion function.
9871
9872 2004-05-03  Todd Berman  <tberman@sevenl.net>
9873
9874         * driver.cs: Remove the hack from saturday, as well as the hack
9875         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9876         link_paths to get that bit proper.
9877
9878 2004-05-01  Todd Berman  <tberman@sevenl.net>
9879
9880         * driver.cs: Try a LoadFrom before a Load, this checks the current
9881         path. This is currently a bug in mono that is be fixed, however, this
9882         provides a workaround for now. This will be removed when the bug
9883         is fixed.
9884
9885 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9886
9887         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9888         incomplete key pairs (#57941).
9889
9890 2004-05-01  Todd Berman  <tberman@sevenl.net>
9891
9892         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9893         from the GAC
9894
9895 2004-04-30  Jackson Harper  <jackson@ximian.com>
9896
9897         * codegen.cs: Open keys readonly.
9898         
9899 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9900
9901         * typemanager.cs: don't report cyclic struct layout when a struct
9902         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9903         which has 2 Pango.Rectangle fields.
9904
9905 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9906
9907         * expression.cs: Handle IntPtr comparisons with IL code
9908         rather than a method call.
9909
9910 2004-04-29  Martin Baulig  <martin@ximian.com>
9911
9912         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9913         the list of PropertyInfo's in class hierarchy and find the
9914         accessor.  Fixes #56013.
9915
9916 2004-04-29  Martin Baulig  <martin@ximian.com>
9917
9918         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9919
9920 2004-04-29  Martin Baulig  <martin@ximian.com>
9921
9922         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9923
9924         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9925
9926 2004-04-29  Martin Baulig  <martin@ximian.com>
9927
9928         * class.cs (ConstructorInitializer.Resolve): Check whether the
9929         parent .ctor is accessible.  Fixes #52146.
9930
9931 2004-04-29  Martin Baulig  <martin@ximian.com>
9932
9933         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9934
9935         * statement.cs (Using.EmitLocalVariableDecls): Use
9936         TypeManager.idisposable_type, not typeof (IDisposable).
9937         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9938
9939 2004-04-29  Martin Baulig  <martin@ximian.com>
9940
9941         * class.cs (Event.Define): Don't emit the field and don't set
9942         RTSpecialName and SpecialName for events on interfaces.  Fixes
9943         #57703. 
9944
9945 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9946
9947         Refactor Attribute.ApplyAttributes.
9948         * attribute.cs (Attributable): New base class for objects that can
9949         have Attributes applied on them.
9950         (Attribute): Make AttributeUsage fields public.
9951         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9952         (Attribute.IsInternalCall): New property.
9953         (Attribute.UsageAttr): Convert to a public read-only property.
9954         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9955         (Attribute.ResolveType, Attribute.Resolve)
9956         (Attribute.ScanForIndexerName): Update to reflect changes.
9957         (Attribute.CheckAttributeTarget): Re-format.
9958         (Attribute.ApplyAttributes): Refactor, to various
9959         Attributable.ApplyAttributeBuilder methods.
9960         * decl.cs (MemberCore): Make Attributable.
9961         * class.cs (Accessor): Make Attributable.
9962         (MethodData.ApplyAttributes): Use proper attribute types, not
9963         attribute names.
9964         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9965         (TypeContainer.ApplyAttributeBuilder)
9966         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9967         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9968         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9969         (Operator.ApplyAttributeBuilder): New factored-out methods.
9970         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9971         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9972         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9973         * parameter.cs (ParameterBase): New Attributable base class
9974         that can also represent Return types.
9975         (Parameter): Update to the changes.
9976
9977 2004-04-29  Jackson Harper  <jackson@ximian.com>
9978
9979         * driver.cs: Prefer the corlib system version when looking for
9980         assemblies in the GAC. This is still a hack, but its a better hack
9981         now.
9982         
9983 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9984
9985         * decl.cs, enum.cs: Improved error 3005 reporting.
9986   
9987         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9988         (related_symbols): New private member for list of symbols
9989         related to reported error/warning.
9990         
9991         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9992
9993 2004-04-29  Martin Baulig  <martin@ximian.com>
9994
9995         * ecore.cs (Expression.Constantify): If we're an enum and
9996         TypeManager.TypeToCoreType() doesn't give us another type, use
9997         t.UnderlyingSystemType.  Fixes #56178.  
9998
9999 2004-04-29  Martin Baulig  <martin@ximian.com>
10000
10001         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10002         interfaces and for each interface, only add members directly
10003         declared in that interface.  Fixes #53255.
10004
10005 2004-04-28  Martin Baulig  <martin@ximian.com>
10006
10007         * expression.cs (ConditionalLogicalOperator): Use a temporary
10008         variable for `left' to avoid that we evaluate it more than once;
10009         bug #52588.
10010
10011 2004-04-28  Martin Baulig  <martin@ximian.com>
10012
10013         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10014         `void[]' (CS1547).
10015
10016 2004-04-28  Martin Baulig  <martin@ximian.com>
10017
10018         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10019         void (CS1547).
10020
10021         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10022         whether the type is not void (CS1547).
10023
10024 2004-04-28  Martin Baulig  <martin@ximian.com>
10025
10026         * expression.cs (Unary.DoResolveLValue): Override this and report
10027         CS0131 for anything but Operator.Indirection.
10028
10029 2004-04-28  Martin Baulig  <martin@ximian.com>
10030
10031         Committing a patch from Ben Maurer; see bug #50820.
10032
10033         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10034         check for classes.
10035
10036         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10037         classes.        
10038
10039 2004-04-28  Martin Baulig  <martin@ximian.com>
10040
10041         Committing a patch from Ben Maurer; see bug #50820.
10042
10043         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10044         check for classes.
10045
10046         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10047         classes.        
10048
10049 2004-04-28  Martin Baulig  <martin@ximian.com>
10050
10051         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10052         (Block.AddLabel): Call DoLookupLabel() to only search in the
10053         current block.
10054
10055 2004-04-28  Martin Baulig  <martin@ximian.com>
10056
10057         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10058         comparing StringConstants and NullLiterals in Equality and Inequality.
10059
10060 2004-04-28  Jackson Harper  <jackson@ximian.com>
10061
10062         * driver.cs: Attempt to load referenced assemblies from the
10063         GAC. This is the quick and dirty version of this method that
10064         doesnt take into account versions and just takes the first
10065         canidate found. Will be good enough for now as we will not have more
10066         then one version installed into the GAC until I update this method.
10067
10068 2004-04-28  Martin Baulig  <martin@ximian.com>
10069
10070         * typemanager.cs (TypeManager.CheckStructCycles): New public
10071         static method to check for cycles in the struct layout.
10072
10073         * rootcontext.cs (RootContext.PopulateTypes): Call
10074         TypeManager.CheckStructCycles() for each TypeContainer.
10075         [Note: We only need to visit each type once.]
10076
10077 2004-04-28  Martin Baulig  <martin@ximian.com>
10078
10079         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10080
10081         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10082         success and added `out object value'.  Use a `bool resolved' field
10083         to check whether we've already been called rather than
10084         `ConstantValue != null' since this breaks for NullLiterals.
10085
10086 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10087
10088         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10089         setting of this flag, since the 'set' method may be non-public.
10090
10091 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10092
10093         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10094         check on current_vector.Block.
10095
10096 2004-04-27  Martin Baulig  <martin@ximian.com>
10097
10098         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10099         a field initializer.  Fixes #56459.
10100
10101 2004-04-27  Martin Baulig  <martin@ximian.com>
10102
10103         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10104         we're not attempting to use an indexer.  Fixes #52154.
10105
10106 2004-04-27  Martin Baulig  <martin@ximian.com>
10107
10108         * statement.cs (Return): Don't create a return label if we don't
10109         need it; reverts my change from January 20th.  Thanks to Ben
10110         Maurer for this.
10111
10112 2004-04-27  Martin Baulig  <martin@ximian.com>
10113
10114         According to the spec, `goto' can only leave a nested scope, but
10115         never enter it.
10116
10117         * statement.cs (Block.LookupLabel): Only lookup in the current
10118         block, don't recurse into parent or child blocks.
10119         (Block.AddLabel): Check in parent and child blocks, report
10120         CS0140/CS0158 if we find a duplicate.
10121         (Block): Removed this indexer for label lookups.
10122         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10123         this already does the error reporting for us.
10124
10125         * flowanalysis.cs
10126         (FlowBranching.UsageVector.Block): New public variable; may be null.
10127         (FlowBranching.CreateSibling): Added `Block' argument.
10128         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10129         label for the target of a `goto' and check whether we're not
10130         leaving a `finally'.
10131
10132 2004-04-27  Martin Baulig  <martin@ximian.com>
10133
10134         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10135         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10136         just for returns).
10137
10138 2004-04-27  Martin Baulig  <martin@ximian.com>
10139
10140         * statement.cs (Block.AddLabel): Also check for implicit blocks
10141         and added a CS0158 check.
10142
10143 2004-04-27  Martin Baulig  <martin@ximian.com>
10144
10145         * flowanalysis.cs (FlowBranchingLoop): New class.
10146         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10147         UsageVector's instead of an ArrayList.
10148         (FlowBranching.Label): Likewise.
10149         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10150         (FlowBranching.AddBreakVector): New method.
10151
10152 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10153
10154         * attribute.cs: Small regression fix: only convert the type if we
10155         the type is different, fixes System.Drawing build.
10156
10157 2004-04-27  Martin Baulig  <martin@ximian.com>
10158
10159         * attribute.cs (Attribute.Resolve): If we have a constant value
10160         for a named field or property, implicity convert it to the correct
10161         type.
10162
10163 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10164
10165         * statement.cs (Block.Block): Implicit blocks share
10166         'child_variable_names' fields with parent blocks.
10167         (Block.AddChildVariableNames): Remove.
10168         (Block.AddVariable): Mark variable as "used by a child block" in
10169         every surrounding block.
10170         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10171         been used in a child block, complain about violation of "Invariant
10172         meaning in blocks" rule.
10173         * cs-parser.jay (declare_local_variables): Don't use
10174         AddChildVariableNames.
10175         (foreach_statement): Don't create an implicit block: 'foreach'
10176         introduces a scope.
10177
10178 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10179
10180         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10181         converting from 0L to ulong.  Fixes 57522.
10182
10183 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10184
10185         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10186         derived class hides via 'new' keyword field from base class (test-242.cs).
10187         TODO: Handle this in the more general way.
10188         
10189         * class.cs (CheckBase): Ditto.
10190
10191 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10192
10193         * decl.cs (caching_flags): New member for storing cached values
10194         as bit flags.
10195         (MemberCore.Flags): New enum where bit flags for caching_flags
10196         are defined.
10197         (MemberCore.cls_compliance): Moved to caching_flags.
10198         (DeclSpace.Created): Moved to caching_flags.
10199
10200         * class.cs: Use caching_flags instead of DeclSpace.Created
10201         
10202 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10203
10204         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10205         if we are only a derived class, not a nested class.
10206
10207         * typemanager.cs: Same as above, but do this at the MemberLookup
10208         level (used by field and methods, properties are handled in
10209         PropertyExpr).   Allow for the qualified access if we are a nested
10210         method. 
10211
10212 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10213
10214         * class.cs: Refactoring.
10215         (IMethodData): New inteface; Holds links to parent members
10216         to avoid member duplication (reduced memory allocation).
10217         (Method): Implemented IMethodData interface.
10218         (PropertyBase): New inner classes for get/set methods.
10219         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10220         (Event): New inner classes for add/remove methods.
10221         (Event.DelegateMethod): Implemented IMethodData interface.
10222
10223         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10224         EmitContext (related to class.cs refactoring).
10225
10226 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10227
10228         * delegate.cs (Delegate.VerifyApplicability): If the number of
10229         arguments are the same as the number of parameters, first try to
10230         verify applicability ignoring  any 'params' modifier on the last
10231         parameter.
10232         Fixes #56442.
10233
10234 2004-04-08  Martin Baulig  <martin@ximian.com>
10235
10236         Merged latest changes into gmcs.  Please keep this comment in
10237         here, it makes it easier for me to see what changed in MCS since
10238         the last time I merged.
10239
10240 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10241
10242         * class.cs (TypeContainer.AddIndexer): Use
10243         'ExplicitInterfaceName' to determine if interface name was
10244         explicitly specified.  'InterfaceType' is not initialized at this time.
10245         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10246         Indexers array is already in the required order.  Initialize
10247         'IndexerName' only if there are normal indexers.
10248         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10249         (TypeContainer.Emit): Emit DefaultMember attribute only if
10250         IndexerName is initialized.
10251         Fixes #56300.
10252
10253 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10254
10255         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10256         Fixes #57007
10257
10258 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10259
10260         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10261         attributes.
10262         Fix for #56456.
10263
10264         * attribute.cs (Attribute.Resolve): Check for duplicate named
10265         attributes.
10266         Fix for #56463.
10267
10268 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10269
10270         * iterators.cs (MarkYield): track whether we are in an exception,
10271         and generate code accordingly.  Use a temporary value to store the
10272         result for our state.
10273
10274         I had ignored a bit the interaction of try/catch with iterators
10275         since their behavior was not entirely obvious, but now it is
10276         possible to verify that our behavior is the same as MS .NET 2.0
10277
10278         Fixes 54814
10279
10280 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10281
10282         * iterators.cs: Avoid creating temporaries if there is no work to
10283         do. 
10284
10285         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10286         Enumerations, use TypeManager.EnumToUnderlying and call
10287         recursively. 
10288
10289         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10290         bug #57013
10291
10292         (This.Emit): Use EmitContext.EmitThis to emit our
10293         instance variable.
10294
10295         (This.EmitAssign): Ditto.
10296
10297         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10298         codepaths, we will move all the functionality into
10299         Mono.CSharp.This 
10300
10301         (FieldExpr.EmitAssign): Ditto.
10302
10303         This fixes several hidden bugs that I uncovered while doing a code
10304         review of this today.
10305
10306         * codegen.cs (EmitThis): reworked so the semantics are more clear
10307         and also support value types "this" instances.
10308
10309         * iterators.cs: Changed so that for iterators in value types, we
10310         do not pass the value type as a parameter.  
10311
10312         Initialization of the enumerator helpers is now done in the caller
10313         instead of passing the parameters to the constructors and having
10314         the constructor set the fields.
10315
10316         The fields have now `assembly' visibility instead of private.
10317
10318 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10319
10320         * expression.cs (Argument.Resolve): Check if fields passed as ref
10321         or out are contained in a MarshalByRefObject.
10322
10323         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10324         another compiler type.
10325
10326 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10327
10328         * class.cs (Indexer.Define): use the new name checking method.
10329         Also, return false on an error.
10330         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10331         (is_identifier_[start/part]_character): make static.
10332
10333 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10334
10335         * expression.cs (Binary.ResolveOperator): Do no append strings
10336         twice: since we can be invoked more than once (array evaluation)
10337         on the same concatenation, take care of this here.  Based on a fix
10338         from Ben (bug #56454)
10339
10340 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10341
10342         * codegen.cs: Fix another case where CS1548 must be reported (when 
10343         delay-sign isn't specified and no private is available #56564). Fix
10344         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10345         error when MCS is used on the MS runtime and we need to delay-sign 
10346         (which seems unsupported by AssemblyBuilder - see #56621).
10347
10348 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10349
10350         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10351         (TypeManager.ComputeNamespaces): Faster implementation for
10352         Microsoft runtime.
10353
10354         * compiler.csproj: Updated AssemblyName to mcs.
10355
10356 2004-05-11  Jackson Harper  <jackson@ximian.com>
10357
10358         * Makefile: Preserve MONO_PATH
10359         
10360 2004-05-11  Jackson Harper  <jackson@ximian.com>
10361
10362         * Makefile: Use mono and mcs to build gmcs
10363         
10364 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10365
10366         * codegen.cs: Add patch from Robert Shade
10367         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10368         sync with mcs.
10369
10370 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10371
10372         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10373         incomplete key pairs (#57941).
10374
10375 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10376
10377         * codegen.cs: Fix another case where CS1548 must be reported (when 
10378         delay-sign isn't specified and no private is available #56564). Fix
10379         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10380         error when MCS is used on the MS runtime and we need to delay-sign 
10381         (which seems unsupported by AssemblyBuilder - see #56621).
10382
10383 2004-04-29  Jackson Harper  <jackson@ximian.com>
10384
10385         * Makefile: Set MONO_PATH to use the bootstrap corlib
10386         * driver.cs: Check the GAC for referenced assemblies.
10387                 
10388 2004-04-29  Martin Baulig  <martin@ximian.com>
10389
10390         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10391
10392 2004-04-07  Martin Baulig  <martin@ximian.com>
10393
10394         * expression.cs (Binary.ResolveOperator): Added special case for
10395         Equality/Inequality between a type parameter and a null literal.
10396
10397 2004-04-07  Martin Baulig  <martin@ximian.com>
10398
10399         * convert.cs: Check null literal -> type parameter conversions.
10400
10401 2004-04-07  Martin Baulig  <martin@ximian.com>
10402
10403         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10404         `class' and `struct' constraints.
10405
10406 2004-04-07  Martin Baulig  <martin@ximian.com>
10407
10408         * generic.cs (SpecialConstraint): New public enum.
10409         (Constraints.Resolve): Added support for the `class' and `struct'
10410         constraints.
10411
10412         * cs-parser.jay (type_parameter_constraint): Added support for the
10413         `class' and `struct' constraints.
10414
10415 2004-04-07  Martin Baulig  <martin@ximian.com>
10416
10417         * support.cs (GenericConstraints): Replaced `Types' by
10418         `ClassConstraint' and `InterfaceConstraints'; added
10419         `HasClassConstraint'.   
10420
10421 2004-04-07  Martin Baulig  <martin@ximian.com>
10422
10423         * generic.cs
10424         (Constraints.InterfaceConstraints): New public property.
10425         (Constraints.Types): Make this property public
10426         (TypeParameter): Implement IMemberContainer.
10427         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10428         instead of a TypeBuilder/MethodBuilder; pass the interface
10429         constraints to TypeManager.AddTypeParameter().
10430         (TypeParameter.DefineType): Just take an EmitContext and no
10431         TypeBuilder/MethodBuilder.  Use the new public API.
10432
10433         * typemanager.cs (TypeManager.AddTypeParameter): Added
10434         `TypeExpr[]' argument; add the interfaces to the
10435         `builder_to_ifaces' hash.
10436         (TypeManager.LookupMemberContainer): For
10437         GenericTypeParameterBuilders, get the TypeParameter from the
10438         `builder_to_type_param'.
10439         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10440         the TypeParameter and call FindMembers on it.
10441
10442 2004-04-07  Martin Baulig  <martin@ximian.com>
10443
10444         * class.cs
10445         (MethodCore.GenericMethod): Moved this field here from Method.
10446         (MethodCore.IsDuplicateImplementation): Take the number of type
10447         parameters into account if we're a generic method.
10448
10449         * expression.cs (Invocation.InferTypeArguments): Don't return true
10450         if `arguments' is null; we still need to check whether we actually
10451         don't need to infer anything in this case.
10452         (MemberAccess): Merged the functionality from GenericMemberAccess
10453         into this class.
10454
10455         * generic.cs (GenericMemberAccess): Removed.
10456
10457 2004-04-05  Martin Baulig  <martin@ximian.com>
10458
10459         * decl.cs (MemberCore): For generic classes, interfaces and
10460         structs, `Name' now includes the number of type parameters
10461         ("Stack!1.Node!1").
10462         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10463         encode the number of type arguments in the type name.
10464
10465         * expression.cs (Expression.MemberLookup): Removed the
10466         `num_type_args' argument; we now encode the number of type
10467         arguments in the type name.
10468
10469         * ecore.cs (SimpleName): Encode the number of type arguments in
10470         the type name itself.
10471
10472         * generic.cs (ConstructedType): Likewise.
10473
10474         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10475         `MemberName'; we now include the number of type parameters in the
10476         type name.
10477
10478         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10479         (TypeManager.MemberLookup): Removed the
10480         `num_type_args' argument; we now encode the number of type
10481         arguments in the type name.     
10482
10483 2004-04-03  Martin Baulig  <martin@ximian.com>
10484
10485         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10486         (MemberCore.MemberName): Moved here from MemberBase.
10487         (DeclSpace.SetParameterInfo): Just take the constraints as an
10488         ArrayList; we already have the type parameters in our
10489         `MemberName'; also do the CS0080 reporting here.
10490
10491         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10492         `IDENTIFIER opt_type_parameter_list'; when constructing our
10493         `MemberName', it'll already include our type parameters.
10494         (class_declaration, interface_declaration): Likewise.
10495         (delegate_declaration): Likewise.
10496         (MakeName): Take a MemberName and return a MemberName.
10497         The following two changes are required to avoid shift/reduce conflicts:
10498         (member_name): Don't include a TypeName anymore; ie. this is now
10499         just 'IDENTIFIER opt_type_parameter_list'.
10500         (property_declaration, event_declaration): Use a
10501         `namespace_or_type_name' instead of a `member_name'.            
10502
10503 2004-04-03  Martin Baulig  <martin@ximian.com>
10504
10505         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10506         `MemberName' class.
10507         (TypeName): Formerly known as MemberName.
10508
10509         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10510         instead of a `MemberName'.
10511
10512         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10513         (member_name): New rule; create a MemberName.
10514
10515 2004-04-02  Martin Baulig  <martin@ximian.com>
10516
10517         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10518         (CS0305 and CS0308).
10519
10520 2004-04-02  Martin Baulig  <martin@ximian.com>
10521
10522         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10523         support for nested types.
10524
10525 2004-04-02  Martin Baulig  <martin@ximian.com>
10526
10527         * ecore.cs (IAlias): New public interface.
10528         (TypeExpr, TypeExpression): Implement IAlias.
10529         (TypeAliasExpression): New public class.
10530
10531         * namespace.cs (Namespace): Implement IAlias.
10532         (Namespace.Lookup): Return an IAlias instead on an object.
10533         (Namespace.DefineName): Take an IAlias instead of an object.
10534         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10535         an object.
10536         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10537         Expression.
10538         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10539         object.
10540         (NamespaceEntry.Lookup): Likewise.
10541
10542         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10543         instead of a Type.      
10544
10545         * decl.cs (DeclSpace): Implement IAlias.
10546         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10547
10548         * generic.cs (ConstructedType): Improved error checking.
10549
10550 2004-04-02  Martin Baulig  <martin@ximian.com>
10551
10552         * convert.cs: Added type parameter conversions.
10553
10554         * ecore.cs
10555         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10556         (ClassCast.Emit): If the source type is a type parameter, box it.
10557         If the target type is a type parameter, emit an `unbox.any'
10558         instead of a `classcast'.1      
10559
10560 2004-04-01  Martin Baulig  <martin@ximian.com>
10561
10562         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10563
10564 2004-04-01  Martin Baulig  <martin@ximian.com>
10565
10566         * generic.cs (ConstructedType.CheckConstraints): Use
10567         Convert.ImplicitStandardConversionExists(); user-defined implicit
10568         conversions are not allowed according to the spec.
10569
10570 2004-03-30  Martin Baulig  <martin@ximian.com>
10571
10572         * expression.cs (New): Added support for type parameters.
10573
10574         * typemanager.cs
10575         (TypeManager.activator_type): New public static field.
10576         (TypeManager.activator_create_instance): Likewise.
10577
10578 2004-03-30  Martin Baulig  <martin@ximian.com>
10579
10580         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10581         public method.
10582
10583 2004-03-30  Martin Baulig  <martin@ximian.com>
10584
10585         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10586         the spec here: the argument type must be convertible to the
10587         constraints.
10588
10589 2004-03-30  Martin Baulig  <martin@ximian.com>
10590
10591         * generic.cs
10592         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10593         TypeManager.AddTypeParameter().
10594         (ConstructedType.CheckConstraints): Re-enable this and actually
10595         check whether we have a constructor constraint.
10596
10597         * typemanager.cs
10598         (TypeManager.builder_to_type_param): New static field.
10599         (TypeManager.AddTypeParameter): New static method.
10600         (TypeManager.LookupTypeParameter): New public method.
10601
10602 2004-03-30  Martin Baulig  <martin@ximian.com>
10603
10604         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10605         the new API to actually define the constructor constraint.
10606
10607         * typemanager.cs
10608         (TypeManager.new_constraint_attr_type): New static field.
10609         (TypeManager.InitCoreTypes): Initialize it.
10610
10611 2004-03-30  Martin Baulig  <martin@ximian.com>
10612
10613         * generic.cs (Constraints): Completed error checking, use correct
10614         error numbers.
10615
10616 2004-03-29  Martin Baulig  <martin@ximian.com>
10617
10618         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10619
10620         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10621         public version which takes a `ParameterData pd' instead of an
10622         `ArrayList args'.
10623
10624 2004-03-29  Martin Baulig  <martin@ximian.com>
10625
10626         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10627         not a MethodInfo.       
10628
10629 2004-03-29  Martin Baulig  <martin@ximian.com>
10630
10631         * expression.cs (Argument.ResolveMethodGroup): If we're a
10632         ConstructedType, call GetMemberAccess() on it.  
10633
10634 2004-03-29  Martin Baulig  <martin@ximian.com>
10635
10636         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10637         (MethodCore.CheckGenericOverride): When overriding a generic
10638         method, check whether the constraints match.
10639
10640         * support.cs (GenericConstraints): New public interface.
10641         (ParameterData.GenericConstraints): New public method.
10642
10643         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10644         method parameter and compute our constraints if appropriate.
10645         (Parameter.GenericConstraints): New public property.
10646
10647         * generic.cs (Constraints): Implement GenericConstraints.
10648
10649 2004-03-29  Martin Baulig  <martin@ximian.com>
10650
10651         * decl.cs (MemberCache.FindMemberToOverride): Use
10652         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10653
10654 2004-03-29  Martin Baulig  <martin@ximian.com>
10655
10656         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10657
10658 2004-03-29  Martin Baulig  <martin@ximian.com>
10659
10660         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10661         not allowed on non-generic declarations").
10662
10663 2004-03-29  Martin Baulig  <martin@ximian.com>
10664
10665         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10666         public version of this method.
10667
10668         * class.cs (MethodCore.IsDuplicateImplementation): Use
10669         Invocation.InferTypeArguments() to check this.
10670
10671 2004-03-29  Martin Baulig  <martin@ximian.com>
10672
10673         * convert.cs: Use TypeManager.IsDelegateType() instead of
10674         comparing types correctly.
10675
10676 2004-03-29  Martin Baulig  <martin@ximian.com>
10677
10678         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10679         types directly to make it work for generic instances.
10680
10681         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10682
10683 2004-03-29  Martin Baulig  <martin@ximian.com>
10684
10685         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10686         support for arrays.     
10687
10688 2004-03-24  Martin Baulig  <martin@ximian.com>
10689
10690         * decl.cs (DeclSpace.FindType): Also use
10691         TypeManager.CheckGeneric() for types from the using clauses.
10692
10693 2004-03-23  Martin Baulig  <martin@ximian.com>
10694
10695         * expression.cs (Invocation.OverloadResolve): Added `bool
10696         may_fail' argument and use it instead of the Location.IsNull() hack.
10697
10698 2004-03-23  Martin Baulig  <martin@ximian.com>
10699
10700         * expression.cs (Invocation.InferType): Use correct type inference
10701         rules here.     
10702
10703 2004-03-23  Martin Baulig  <martin@ximian.com>
10704
10705         * ecore.cs (MethodGroupExpr.Name): Use
10706         TypeManager.CSharpSignature() instead of just the name.
10707
10708         * expression.cs (Invocation.OverloadResolve): Provide better error
10709         reporting.
10710         (Invocation.DoResolve): OverloadResolve() never returns null
10711         without reporting an error, so removed the error -6 reporting here.
10712
10713 2004-03-23  Martin Baulig  <martin@ximian.com>
10714
10715         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10716         generic methods.
10717
10718         * cs-parser.jay (delegate_declaration): Support generic delegates.
10719
10720         * delegate.cs: Support generic delegates.
10721
10722 2004-03-22  Martin Baulig  <martin@ximian.com>
10723
10724         * expression.cs (Invocation.InferParamsTypeArguments): New static
10725         method; does type inference for params arguments.
10726
10727 2004-03-21  Martin Baulig  <martin@ximian.com>
10728
10729         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10730         method; checks whether a method is a generic method.    
10731
10732         * expression.cs (Invocation.InferTypeArguments): New static method;
10733         infer type arguments for generic method invocation.
10734
10735         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10736         property; we set this to true if we're resolving a generic method
10737         invocation and the user specified type arguments, ie. we're not
10738         doing type inference.
10739
10740 2004-03-20  Martin Baulig  <martin@ximian.com>
10741
10742         * class.cs (MethodData.DeclaringType): New public property.
10743         (MethodData.Define): Set DeclaringType here.
10744         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10745         instead of OperatorMethodBuilder.DeclaringType.
10746
10747 2004-03-20  Martin Baulig  <martin@ximian.com>
10748
10749         * cs-tokenizer.cs (xtoken): Return a special
10750         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10751
10752         * cs-parser.jay (default_value_expression): Switch to the new
10753         syntax (14.5.13).
10754
10755 2004-03-19  Martin Baulig  <martin@ximian.com>
10756
10757         * decl.cs (MemberName): New class.  We use this to "construct"
10758         namespace_or_type_name's.
10759
10760         * generics.cs (TypeArguments.GetDeclarations): New public method;
10761         returns the type arguments as a string[] and reports a CS0081 if
10762         one of them is not an identifier.
10763
10764         * class.cs (MemberBase): The .ctor now takes the name as a
10765         MemberName instead of a string.
10766         (MemberBase.ExplicitInterfaceName): Changed type from string to
10767         Expression.
10768         (MemberBase.DoDefine): If we're an explicit implementation, the
10769         InterfaceType may be a generic instance.
10770
10771         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10772         (namespace_name): Call MemberName.GetName () to transform the
10773         MemberName into a string and ensure we don't have any type
10774         arguments.
10775         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10776         MemberName into an expression.
10777         (method_header): Use namespace_or_type_name instead of member_name.     
10778
10779 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10780
10781         * rootcontext.cs: Add new types to the boot resolution.
10782
10783         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10784         MulticastDelegate is not allowed.
10785
10786         * typemanager.cs: Add new types to lookup: System.TypedReference
10787         and ArgIterator.
10788
10789         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10790         check for TypedReference or ArgIterator, they are not allowed. 
10791
10792         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10793         makes us properly catch 1510 in some conditions (see bug 56016 for
10794         details). 
10795
10796 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10797
10798         * CryptoConvert.cs: update from corlib version
10799         with endian fixes.
10800
10801 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10802
10803         * class.cs (Indexer.Define): Check indexername declaration
10804
10805 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10806
10807         * attribute.cs (IsClsCompliant): Fixed problem with handling
10808         all three states (compliant, not-compliant, undetected).
10809
10810 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10811
10812         * attribute.cs (Attribute): Location is now public.
10813         (Resolve): Store resolved arguments (pos_values) in attribute class.
10814         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10815         (GetClsCompliantAttributeValue): New method that gets
10816         CLSCompliantAttribute value.
10817         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10818         if exists else null.
10819         (AttributeTester): New class for CLS-Compliant verification routines.
10820
10821         * class.cs (Emit): Add CLS-Compliant verification.
10822         (Method.GetSignatureForError): Implemented.
10823         (Constructor.GetSignatureForError): Implemented
10824         (Constructor.HasCompliantArgs): Returns if constructor has
10825         CLS-Compliant arguments.
10826         (Constructor.Emit): Override.
10827         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10828         is needed to test only parameters.
10829         (FieldBase.GetSignatureForError): Implemented.
10830         (TypeContainer): New member for storing base interfaces.
10831         (TypeContainer.FindMembers): Search in base interfaces too.
10832
10833         * codegen.cs (GetClsComplianceAttribute): New method that gets
10834         assembly or module CLSCompliantAttribute value.
10835         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10836         for assembly.
10837         (ModuleClass.Emit): Add error 3012 test.
10838
10839         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10840
10841         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10842         state for all decl types.
10843         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10844         if CLS-Compliant tests are required.
10845         (IsClsCompliaceRequired): New method. Analyze whether code
10846         must be CLS-Compliant.
10847         (IsExposedFromAssembly): New method. Returns true when MemberCore
10848         is exposed from assembly.
10849         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10850         value or gets cached value.
10851         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10852         is explicitly marked with CLSCompliantAttribute.
10853         (IsIdentifierClsCompliant): New abstract method. This method is
10854         used to testing error 3005.
10855         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10856         for identifier and parameters CLS-Compliant testing.
10857         (VerifyClsCompliance): New method. The main virtual method for
10858         CLS-Compliant verifications.
10859         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10860         null. I don't know why is null (too many public members !).
10861         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10862         and get value of first CLSCompliantAttribute that found.
10863
10864         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10865         (VerifyClsCompliance): Override and add extra tests.
10866
10867         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10868         clscheck- disable CLS-Compliant verification event if assembly is has
10869         CLSCompliantAttribute(true).
10870
10871         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10872         ApllyAttribute is now called in emit section as in the other cases.
10873         Possible future Emit integration.
10874         (IsIdentifierClsCompliant): New override.
10875         (VerifyClsCompliance): New override.
10876         (GetEnumeratorName): Returns full enum name.
10877
10878         * parameter.cs (GetSignatureForError): Implemented.
10879
10880         * report.cs (WarningData): New struct for Warning message information.
10881         (LocationOfPreviousError): New method.
10882         (Warning): New method. Reports warning based on the warning table.
10883         (Error_T): New method. Reports error based on the error table.
10884
10885         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10886         verifications are done here.
10887
10888         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10889
10890         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10891         CLSCompliantAttribute.
10892         (all_imported_types): New member holds all imported types from other
10893         assemblies.
10894         (LoadAllImportedTypes): New method fills static table with exported types
10895         from all referenced assemblies.
10896         (Modules): New property returns all assembly modules.
10897
10898 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10899
10900         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10901         throwing a parser error.
10902
10903         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10904         which removes the hardcoded get_/set_ prefixes for properties, as
10905         IL allows for the properties to be named something else.  
10906
10907         Bug #56013
10908
10909         * expression.cs: Do not override operand before we know if it is
10910         non-null.  Fix 56207
10911
10912 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10913
10914         * typemanager.cs: support for pinned variables.
10915
10916 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10917
10918         * decl.cs, typemanager.cs: Avoid using an arraylist
10919         as a buffer if there is only one result set.
10920
10921 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10922
10923         * expression.cs: Make sure you cant call a static method
10924         with an instance expression, bug #56174.
10925
10926 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10927
10928         * class.cs (IsDuplicateImplementation): Improve error reporting to
10929         flag 663 (method only differs in parameter modifier).
10930
10931         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10932         in preprocessor directives.
10933
10934         * location.cs (LookupFile): Allow for the empty path.
10935
10936         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10937         better approach for some of that patch, but its failing with the
10938         CharSet enumeration.  For now try/catch will do.
10939
10940         * typemanager.cs: Do not crash if a struct does not have fields.
10941         Fixes 56150.
10942
10943 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10944
10945         * expression.cs: cs0213, cant fix a fixed expression.
10946         fixes 50231.
10947
10948 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10949
10950         * cs-parser.jay: detect invalid embeded statements gracefully.
10951         bug #51113.
10952
10953 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10954
10955         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10956         As a regex:
10957         s/
10958         the invocation type may not be a subclass of the tye of the item/
10959         The type of the item must be a subclass of the invocation item.
10960         /g
10961
10962         Fixes bug #50820.
10963
10964 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10965
10966         * attribute.cs: Added methods to get a string and a bool from an
10967         attribute. Required to information from AssemblyKeyFileAttribute,
10968         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10969         * codegen.cs: Modified AssemblyName creation to include support for
10970         strongnames. Catch additional exceptions to report them as CS1548.
10971         * compiler.csproj: Updated include CryptoConvert.cs.
10972         * compiler.csproj.user: Removed file - user specific configuration.
10973         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10974         Mono.Security assembly. The original class is maintained and tested in
10975         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10976         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10977         like CSC 8.0 (C# v2) supports.
10978         * Makefile: Added CryptoConvert.cs to mcs sources.
10979         * rootcontext.cs: Added new options for strongnames.
10980
10981 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10982
10983         * driver.cs: For --expect-error, report error code `2'
10984         if the program compiled with no errors, error code `1' if
10985         it compiled with an error other than the one expected.
10986
10987 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10988
10989         * compiler.csproj: Updated for Visual Studio .NET 2003.
10990         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10991         * compiler.sln: Updated for Visual Studio .NET 2003.
10992
10993 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10994
10995         * expression.cs: Fix bug #47234. We basically need to apply the
10996         rule that we prefer the conversion of null to a reference type
10997         when faced with a conversion to 'object' (csc behaviour).
10998
10999 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11000
11001         * statement.cs: Shorter form for foreach, eliminates
11002         a local variable. r=Martin.
11003
11004 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11005
11006         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11007         checks if we can use brtrue/brfalse to test for 0.
11008         * expression.cs: use the above in the test for using brtrue/brfalse.
11009         cleanup code a bit.
11010
11011 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11012
11013         * expression.cs: Rewrite string concat stuff. Benefits:
11014
11015         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11016         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11017         rather than a concat chain.
11018
11019         * typemanager.cs: Add lookups for more concat overloads.
11020
11021 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11022
11023         * expression.cs: Emit shorter il code for array init.
11024
11025         newarr
11026         dup
11027         // set 1
11028
11029         // set 2
11030
11031         newarr
11032         stloc.x
11033
11034         ldloc.x
11035         // set 1
11036
11037         ldloc.x
11038         // set 2
11039
11040 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11041
11042         * statement.cs: Before, two switch blocks would be merged if the
11043         total size of the blocks (end_item - begin_item + 1) was less than
11044         two times the combined sizes of the blocks.
11045
11046         Now, it will only merge if after the merge at least half of the
11047         slots are filled.
11048
11049         fixes 55885.
11050
11051 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11052
11053         * class.cs : csc build fix for GetMethods(). See bug #52503.
11054
11055 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11056
11057         * expression.cs: Make sure fp comparisons work with NaN.
11058         This fixes bug #54303. Mig approved this patch a long
11059         time ago, but we were not able to test b/c the runtime
11060         had a related bug.
11061
11062 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11063
11064         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11065
11066 2004-03-19  Martin Baulig  <martin@ximian.com>
11067
11068         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11069         two overloads may unify for some type parameter substitutions and
11070         report a CS0408 if appropriate.
11071
11072 2004-03-19  Martin Baulig  <martin@ximian.com>
11073
11074         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11075         error here and not in our caller.
11076
11077 2004-03-19  Martin Baulig  <martin@ximian.com>
11078
11079         * interface.cs: Completely killed this file.
11080         (Interface): We're now a TypeContainer and live in class.cs.
11081
11082         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11083         argument; we're now also called for interfaces.
11084         (TypeContainer.DefineMembers): Allow this method being called
11085         multiple times.
11086         (TypeContainer.GetMethods): New public method; formerly known as
11087         Interface.GetMethod().  This is used by PendingImplementation.
11088         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11089         it's now private and non-static.
11090         (Interface): Moved this here; it's now implemented similar to
11091         Class and Struct.
11092         (Method, Property, Event, Indexer): Added `bool is_interface'
11093         argument to their .ctor's.
11094         (MemberBase.IsInterface): New public field.
11095
11096         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11097         instances instead of InterfaceMethod, InterfaceProperty, etc.
11098         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11099         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11100
11101 2004-03-19  Martin Baulig  <martin@ximian.com>
11102
11103         * class.cs (MethodCore.IsDuplicateImplementation): New private
11104         method which does the CS0111 checking.
11105         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11106         Use IsDuplicateImplementation().
11107
11108 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11109
11110         * decl.cs (FindMemberToOverride): New method to find the correct
11111         method or property to override in the base class.
11112         * class.cs
11113             - Make Method/Property use the above method to find the
11114               version in the base class.
11115             - Remove the InheritableMemberSignatureCompare as it is now
11116               dead code.
11117
11118         This patch makes large code bases much faster to compile, as it is
11119         O(n) rather than O(n^2) to do this validation.
11120
11121         Also, it fixes bug 52458 which is that nested classes are not
11122         taken into account when finding the base class member.
11123
11124         Reviewed/Approved by Martin.
11125
11126 2004-03-17  Martin Baulig  <martin@ximian.com>
11127
11128         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11129         of type arguments into account; use the `real_num_type_args'
11130         approach like in DoResolveAsTypeStep().
11131
11132         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11133         nested types.
11134
11135 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11136
11137         * interface.cs: In all interface classes removed redundant
11138         member initialization.
11139
11140 2004-03-16  Martin Baulig  <martin@ximian.com>
11141
11142         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11143
11144 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11145
11146         * decl.cs (DefineTypeAndParents): New helper method to define a
11147         type's containers before the type itself is defined;  This is a
11148         bug exposed by the recent changes to Windows.Forms when an
11149         implemented interface was defined inside a class that had not been
11150         built yet.   
11151
11152         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11153
11154         (Check): Loop correctly to report errors modifiers
11155         (UNSAFE was not in the loop, since it was the same as TOP).
11156
11157         * interface.cs: Every interface member now takes a ModFlags,
11158         instead of a "is_new" bool, which we set on the base MemberCore. 
11159
11160         Every place where we called "UnsafeOk" in the interface, now we
11161         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11162         the unsafe settings from the member declaration instead of the
11163         container interface. 
11164
11165         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11166
11167         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11168         `set_indexer_name' to the pending bits (one per type).
11169
11170         We fixed a bug today that was picking the wrong method to
11171         override, since for properties the existing InterfaceMethod code
11172         basically ignored the method name.  Now we make sure that the
11173         method name is one of the valid indexer names.
11174
11175 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11176  
11177         * support.cs (SeekableStreamReader): Keep track of stream byte
11178         positions and don't mix them with character offsets to the buffer.
11179
11180         Patch from Gustavo Giráldez
11181
11182 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11183
11184         * interface.cs (InterfaceSetGetBase): Removed double member
11185         initialization, base class does it as well.
11186
11187 2004-03-13  Martin Baulig  <martin@ximian.com>
11188
11189         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11190         when compiling corlib.
11191
11192 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11193
11194         * convert.cs (ExplicitConversion): We were reporting an error on
11195         certain conversions (object_type source to a value type, when the
11196         expression was `null') before we had a chance to pass it through
11197         the user defined conversions.
11198
11199         * driver.cs: Replace / and \ in resource specifications to dots.
11200         Fixes 50752
11201
11202         * class.cs: Add check for duplicate operators.  Fixes 52477
11203
11204 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11205
11206         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11207         that are in the middle of the statements, not only at the end.
11208         Fixes #54987
11209
11210         * class.cs (TypeContainer.AddField): No longer set the
11211         `HaveStaticConstructor' flag, now we call it
11212         `UserDefineStaticConstructor' to diferentiate the slightly
11213         semantic difference.
11214
11215         The situation is that we were not adding BeforeFieldInit (from
11216         Modifiers.TypeAttr) to classes that could have it.
11217         BeforeFieldInit should be set to classes that have no static
11218         constructor. 
11219
11220         See:
11221
11222         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11223
11224         And most importantly Zoltan's comment:
11225
11226         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11227
11228         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11229          before its static fields are used', i.e. initialization does not need
11230          to be triggered by the first access to the type. Setting this flag
11231          helps the JIT to compile better code, since it can run the static
11232          constructor at JIT time, and does not need to generate code to call it
11233          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11234          this flag for lots of classes like String. 
11235          
11236          csc sets this flag if the type does not have an explicit static 
11237          constructor. The reasoning seems to be that if there are only static
11238          initalizers for a type, and no static constructor, then the programmer
11239          does not care when this initialization happens, so beforefieldinit
11240          can be used.
11241          
11242          This bug prevents the AOT compiler from being usable, since it 
11243          generates so many calls to mono_runtime_class_init that the AOT code
11244          is much slower than the JITted code. The JITted code is faster, 
11245          because it does not generate these calls if the vtable is type is
11246          already initialized, which is true in the majority of cases. But the
11247          AOT compiler can't do this."
11248
11249 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11250
11251         * class.cs (MethodData.Emit): Refactor the code so symbolic
11252         information is generated for destructors;  For some reasons we
11253         were taking a code path that did not generate symbolic information
11254         before. 
11255
11256 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11257
11258         * class.cs: Create a Constructor.CheckBase method that
11259         takes care of all validation type code. The method
11260         contains some code that was moved from Define.
11261
11262         It also includes new code that checks for duplicate ctors.
11263         This fixes bug #55148.
11264
11265 2004-03-09  Joshua Tauberer <tauberer@for.net>
11266
11267         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11268         a { ... }-style array creation invokes EmitStaticInitializers
11269         which is not good for reference-type arrays.  String, decimal
11270         and now null constants (NullCast) are not counted toward
11271         static initializers.
11272
11273 2004-03-05  Martin Baulig  <martin@ximian.com>
11274
11275         * location.cs (SourceFile.HasLineDirective): New public field;
11276         specifies whether the file contains or is referenced by a "#line"
11277         directive.
11278         (Location.DefineSymbolDocuments): Ignore source files which
11279         either contain or are referenced by a "#line" directive.        
11280
11281 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11282
11283         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11284         direct access to our parent, so check the method inline there.
11285
11286 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11287
11288         * expression.cs (Invocation.EmitCall): Miguel's last commit
11289         caused a regression. If you had:
11290
11291             T t = null;
11292             t.Foo ();
11293
11294         In Foo the implict this would be null.
11295
11296 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11297
11298         * expression.cs (Invocation.EmitCall): If the method is not
11299         virtual, do not emit a CallVirt to it, use Call.
11300
11301         * typemanager.cs (GetFullNameSignature): Improve the method to
11302         cope with ".ctor" and replace it with the type name.
11303
11304         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11305         as an argument the ConstructorBuilder where it is being defined,
11306         to catch the recursive constructor invocations.
11307
11308 2004-03-16  Martin Baulig  <martin@ximian.com>
11309
11310         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11311         ConstructedType, call ResolveType() on it to get the type rather
11312         than just using `expr.Type'.
11313
11314 2004-03-16  Martin Baulig  <martin@ximian.com>
11315
11316         * generics.cs (ConstructedType.GetMemberAccess): Take the
11317         EmitContext instead on the TypeExpr and use
11318         ec.TypeContainer.CurrentType/ec.ContainerType.
11319
11320 2004-03-16  Martin Baulig  <martin@ximian.com>
11321
11322         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11323         parameters before aliases.
11324
11325 2004-03-16  Martin Baulig  <martin@ximian.com>
11326
11327         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11328         New oublic function; checks whether two generic instances may become
11329         equal under some instantiations (26.3.1).
11330
11331         * class.cs (TypeContainer.Define): Call
11332         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11333         error.
11334
11335 2004-03-16  Martin Baulig  <martin@ximian.com>
11336
11337         * class.cs (TypeContainer.GetClassBases): Moved
11338         Error_TypeParameterAsBase() here and also check whether the base
11339         class is not an attribute.
11340
11341 2004-03-16  Martin Baulig  <martin@ximian.com>
11342
11343         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11344
11345 2004-03-16  Martin Baulig  <martin@ximian.com>
11346
11347         * class.cs (Error_TypeParameterAsBase): Use correct error number
11348         here (CS0689).  
11349
11350 2004-03-16  Martin Baulig  <martin@ximian.com>
11351
11352         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11353         for generics.
11354
11355         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11356         error reporting.
11357
11358 2004-03-15  Martin Baulig  <martin@ximian.com>
11359
11360         * typemanager.cs (TypeManager.GetFullName): New public method.
11361         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11362         argument; only return members with the correct number of type
11363         arguments.
11364         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11365         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11366         whether the number of type arguments matches.
11367
11368         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11369         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11370
11371         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11372         field; it's set by the protected .ctor when we're actually a
11373         GenericMemberAccess.
11374         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11375         arguments and pass it to MemberLookupFinal ().
11376
11377         * ecore.cs (Expression.MemberLookup): Added `int
11378         num_type_arguments' argument; only return members with the correct
11379         number of type arguments.
11380         (Expression.MemberLookupFailed): Check whether the MemberLookup
11381         failed because we did not have the correct number of type
11382         arguments; report CS0305 in this case.
11383
11384         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11385         `e.ResolveAsTypeTerminal()' already did so.
11386
11387 2004-03-15  Martin Baulig  <martin@ximian.com>
11388
11389         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11390         we're a ConstructedType; in this case, the caller must report an
11391         error (for instance CS0131).
11392
11393         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11394         (TypeArguments.Resolve): Actually report errors here.
11395
11396 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11397
11398         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11399         `set_indexer_name' to the pending bits (one per type).
11400
11401         We fixed a bug today that was picking the wrong method to
11402         override, since for properties the existing InterfaceMethod code
11403         basically ignored the method name.  Now we make sure that the
11404         method name is one of the valid indexer names.
11405
11406 2004-03-15  Martin Baulig  <martin@ximian.com>
11407
11408         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11409         for generic instances.
11410
11411 2004-03-13  Martin Baulig  <martin@ximian.com>
11412
11413         * class.cs (TypeContainer.DefineType): Call
11414         TypeManager.AddUserType() immediately after creating the
11415         TypeBuilder; pass all type parameters when creating the
11416         CurrentType.
11417
11418         * decl.cs (DeclSpace.FindNestedType): New public method.
11419         (DeclSpace.FindType): Added `int num_type_args' argument; only
11420         return types with the correct number of type parameters.
11421         (DeclSpace.CountTypeParams): New public property.
11422
11423         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11424         the number of type parameters; defaults to zero.
11425
11426         * generic.cs (TypeArguments.Count): New public property.
11427         (ConstructedType.DoResolveAsTypeStep): First call
11428         ds.FindNestedType() to find out whether we're nested in the
11429         current generic type; in this case, we inherit all type parameters
11430         from the current class.
11431
11432         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11433         num_type_args' argument.
11434         (RootContext.LookupType): Added overloaded version which takes the
11435         number of type arguments; only return types with the correct
11436         number of type arguments.
11437
11438         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11439         checks whether `Type t' has `int num_type_args'.
11440
11441 2004-03-13  Martin Baulig  <martin@ximian.com>
11442
11443         * generic.cs (GenericMethod.DefineType): New method; calls
11444         DefineType() on all the type parameters.
11445
11446         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11447         (MethodData.Define): If we're a generic method, call
11448         GenericMethod.DefineType() to define the type parameters.       
11449
11450 2004-03-10  Martin Baulig  <martin@ximian.com>
11451
11452         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11453         instead of IsAssignableFrom.    
11454
11455 2004-03-10  Martin Baulig  <martin@ximian.com>
11456
11457         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11458
11459         * support.cs (ParameterData.HasArrayParameter): New property.
11460         (ReflectionParameters.ctor): Take a MethodBase instead of a
11461         ParameterInfo[].  If we have any type parameters, get the generic
11462         method definition and ask it whether we have variable arguments.
11463
11464 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11465
11466         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11467         routines to check if a type is an enumerable/enumerator allow
11468         classes that implement the IEnumerable or IEnumerator interfaces.
11469
11470         * class.cs (Property, Operator): Implement IIteratorContainer, and
11471         implement SetYields.
11472
11473         (Property.Define): Do the block swapping for get_methods in the
11474         context of iterators.   We need to check if Properties also
11475         include indexers or not.
11476
11477         (Operator): Assign the Block before invoking the
11478         OperatorMethod.Define, so we can trigger the Iterator code
11479         replacement. 
11480
11481         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11482         Property and Operator classes are not created when we parse the
11483         declarator but until we have the block completed, so we use a
11484         singleton SimpleIteratorContainer.Simple to flag whether the
11485         SetYields has been invoked.
11486
11487         We propagate this setting then to the Property or the Operator to
11488         allow the `yield' to function.
11489
11490 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11491
11492         * codegen.cs: Implemented attribute support for modules.
11493         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11494         Assembly/Module functionality.
11495
11496         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11497         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11498         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11499
11500 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11501
11502         * interface.cs (FindMembers): The operation is performed on all base
11503         interfaces and not only on the first. It is required for future CLS Compliance patch.
11504
11505 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11506
11507         * statement.cs, codegen.cs:
11508         This patch deals with patterns such as:
11509
11510         public class List : IEnumerable {
11511
11512                 public MyEnumerator GetEnumerator () {
11513                         return new MyEnumerator(this);
11514                 }
11515
11516                 IEnumerator IEnumerable.GetEnumerator () {
11517                         ...
11518                 }
11519                 
11520                 public struct MyEnumerator : IEnumerator {
11521                         ...
11522                 }
11523         }
11524
11525         Before, there were a few things we did wrong:
11526         1) we would emit callvirt on a struct, which is illegal
11527         2) we emited ldarg when we needed to emit ldarga
11528         3) we would mistakenly call the interface methods on an enumerator
11529         type that derived from IEnumerator and was in another assembly. For example:
11530
11531         public class MyEnumerator : IEnumerator
11532
11533         Would have the interface methods called, even if there were public impls of the
11534         method. In a struct, this lead to invalid IL code.
11535
11536 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11537
11538         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11539           renamed to Emit.
11540
11541         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11542
11543 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11544
11545         * cs-parser.jay: Fix small regression: we were not testing V2
11546         compiler features correctly.
11547
11548         * interface.cs: If the emit context is null, then create one
11549
11550 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11551
11552         * decl.cs (GetSignatureForError): New virtual method to get full name
11553           for error messages.
11554
11555         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11556           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11557
11558         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11559           Duplicated members and code in these classes has been removed.
11560           Better encapsulation in these classes.
11561
11562 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11563
11564         * assign.cs (Assign.DoResolve): When dealing with compound
11565         assignments, there is a new rule in ECMA C# 2.4 (might have been
11566         there before, but it is documented here) that states that in:
11567
11568         a op= b;
11569
11570         If b is of type int, and the `op' is a shift-operator, then the
11571         above is evaluated as:
11572
11573         a = (int) a op b 
11574
11575         * expression.cs (Binary.ResolveOperator): Instead of testing for
11576         int/uint/long/ulong, try to implicitly convert to any of those
11577         types and use that in pointer arithmetic.
11578
11579         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11580         method to print information for from the type, not from the
11581         null-method we were given.
11582
11583 2004-02-01  Duncan Mak  <duncan@ximian.com>
11584
11585         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11586         parsing for cmd, fixes bug #53694.
11587
11588 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11589
11590         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11591         in the member name duplication tests. Property and operator name duplication
11592         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11593
11594 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11595
11596         * interface.cs (PopulateMethod): Fixed crash when interface method
11597         returns not existing type (error test cs0246-3.cs).
11598
11599 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11600
11601         * cs-parser.jay (interface_accessors): Re-write actions to also
11602         store attributes attached to get and set methods. Fix spelling
11603         while at it.
11604
11605         (inteface_property_declaration): Modify accordingly.
11606
11607         (InterfaceAccessorInfo): New helper class to store information to pass
11608         around between rules that use interface_accessors.
11609
11610         * interface.cs (Emit): Apply attributes on the get and set
11611         accessors of properties and indexers too.
11612
11613         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11614         right MethodBuilder when applying attributes to the get and set accessors.
11615
11616 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11617
11618         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11619
11620 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11621
11622         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11623
11624 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11625
11626         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11627         changes that treat `yield' specially when present before `break'
11628         or `return' tokens.
11629
11630         * cs-tokenizer.cs: yield is no longer a keyword.
11631
11632 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11633
11634         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11635         setting for default constructors.
11636         For default constructors are almost every time set wrong Modifier. The
11637         generated IL code has been alright. But inside mcs this values was
11638         wrong and this was reason why several of my CLS Compliance tests
11639         failed.
11640
11641 2004-02-27  Martin Baulig  <martin@ximian.com>
11642
11643         * generics.cs (ConstructedType.ResolveType): Make the nested type
11644         stuff actually work.
11645
11646 2004-02-25  Martin Baulig  <martin@ximian.com>
11647
11648         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11649         property; returns the type parameters just from the current type,
11650         ie. with the ones from outer classes.
11651         (DeclSpace.LookupGeneric): First search in the current class, then
11652         in outer classes.
11653         (DeclSpace.initialize_type_params): When hiding a type parameter
11654         from an outer class, put it into the `type_param_list' anyways.
11655
11656         * expression.cs (MemberAccess.expr): Made this field protected.
11657
11658         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11659         the type parameters from the current class.
11660
11661         * generic.cs (ConstructedType.ResolveType): Support nested generic
11662         types by taking the type parameters which we inherit from outer
11663         classes into account.
11664         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11665         support for nested generic types.
11666
11667 2004-02-23  Martin Baulig  <martin@ximian.com>
11668
11669         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11670         field and check whether we're nested inside a generic type.
11671         (DeclSpace.ResolveType): If we're resolving to a generic type
11672         definition, create a ConstructedType and return its resolved type.
11673         (DeclSpace.initialize_type_params): New private method;
11674         initializes the `type_param_list' field from the type parameters
11675         from this and all enclosing classes.
11676         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11677         we're already initialized.
11678
11679 2004-02-23  Martin Baulig  <martin@ximian.com>
11680
11681         * class.cs (Method.Define): Create the generic method before
11682         calling DoDefine().
11683         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11684         the TypeContainer one); we use this for generic methods.
11685
11686         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11687         parent's TypeBuilder.
11688
11689 2004-02-18  Martin Baulig  <martin@ximian.com>
11690
11691         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11692         to check for equality.
11693
11694 2004-02-05  Martin Baulig  <martin@ximian.com>
11695
11696         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11697         `ec.TypeContainer.CurrentType', use it instead of
11698         `ec.ContainerType' to check whether we're in the type's ctor.
11699
11700 2004-01-29  Martin Baulig  <martin@ximian.com>
11701
11702         * expression.cs (Invocation.DoResolve): If we're a
11703         `ConstructedType', then we're actually a generic method, so
11704         rewrite the expr as a GenericMemberAccess.
11705
11706         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11707         here; manually parse it into a string.
11708
11709 2004-01-28  Martin Baulig  <martin@ximian.com>
11710
11711         * typemanager.cs (TypeManager.IsEqual): New static method.
11712         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11713         check for equality instead of using `=='.
11714
11715 2004-01-26  Martin Baulig  <martin@ximian.com>
11716
11717         * decl.cs (DeclSpace.CurrentType): New public field.
11718
11719         * expression.cs (This.ResolveBase): If we have an
11720         `ec.TypeContainer.CurrentType', use it instead of
11721         `ec.ContainerType'.
11722
11723         * class.cs (TypeContainer.DefineType): If we're a generic type,
11724         create the `CurrentType' (unresolved).
11725         (TypeContainer.GenericType): New private field.
11726         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11727         it and store it in `GenericType' before creating the MemberCache.
11728         (TypeContainer.GetMembers): If we have a `GenericType', call
11729         TypeManager.FindMembers() on it.
11730
11731         * interface.cs (Interface.GenericType): New private field.
11732         (Interface.DefineType): If we're a generic type, create the
11733         `CurrentType' (unresolved).
11734         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11735         and store it in `GenericType' before creating the MemberCache.
11736         (Interface.GetMembers): If we have a `GenericType', call
11737         TypeManager.FindMembers() on it.
11738
11739 2004-01-22  Martin Baulig  <martin@ximian.com>
11740
11741         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11742         not a QualifiedIdentifier.  This is what `type_name_expression'
11743         was previously doing.
11744         (type_name_expression): Removed; the code is now in
11745         `namespace_or_type_name'.
11746         (qualified_identifier): Removed, use `namespace_or_type_name'
11747         instead.
11748         (QualifiedIdentifier): Removed this class.      
11749
11750 2004-01-22  Martin Baulig  <martin@ximian.com>
11751
11752         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11753         not a string as alias name.
11754
11755 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11756
11757         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11758         #52730 bug, and instead compute correctly the need to use a
11759         temporary variable when requesting an address based on the
11760         static/instace modified of the field and the constructor.
11761  
11762 2004-01-21  Martin Baulig  <martin@ximian.com>
11763
11764         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11765         class and namespace before looking up aliases.  Fixes #52517.
11766
11767 2004-01-21  Martin Baulig  <martin@ximian.com>
11768
11769         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11770         assinged in a 'try'; fixes exception4.cs.
11771
11772 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11773         * class.cs : Implemented parameter-less constructor for TypeContainer
11774
11775         * decl.cs: Attributes are now stored here. New property OptAttributes
11776
11777         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11778
11779         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11780
11781 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11782
11783         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11784           (CSharpSignature): New method for indexer and property signature.
11785
11786 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11787
11788         * pending.cs (IsVirtualFilter): Faster implementation.
11789
11790 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11791
11792         * typemanager.cs: Avoid inclusion of same assembly more than once.
11793
11794 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11795
11796         * cs-parser.jay: Fixed problem where the last assembly attribute
11797           has been applied also to following declaration (class, struct, etc.)
11798           
11799 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11800
11801         * class.cs: Added error CS0538, CS0539 reporting.
11802         Fixed crash on Microsoft runtime when field type is void.
11803
11804         * cs-parser.jay: Added error CS0537 reporting.
11805
11806         * pending.cs: Added error CS0535 reporting.
11807         Improved error report for errors CS0536, CS0534.
11808
11809 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11810
11811         Merge a few bits from the Anonymous Method MCS tree.
11812
11813         * statement.cs (ToplevelBlock): New class for toplevel methods,
11814         will hold anonymous methods, lifted variables.
11815
11816         * cs-parser.jay: Create toplevel blocks for delegates and for
11817         regular blocks of code. 
11818
11819 2004-01-20  Martin Baulig  <martin@ximian.com>
11820
11821         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11822         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11823         and `NeedExplicitReturn'; added `IsLastStatement'.
11824         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11825         have a `ReturnLabel' or we're not unreachable.
11826
11827         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11828         child's reachability; don't just override ours with it.  Fixes
11829         #58058 (lluis's example).
11830         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11831         InFinally(), InLoop(), InSwitch() and
11832         BreakCrossesTryCatchBoundary() methods.
11833
11834         * statement.cs (Return): Do all error checking in Resolve().
11835         Unless we are the last statement in a top-level block, always
11836         create a return label and jump to it.
11837         (Break, Continue): Do all error checking in Resolve(); also make
11838         sure we aren't leaving a `finally'.
11839         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11840         statement in a top-level block.
11841         (Block.Flags): Added `IsDestructor'.
11842         (Block.IsDestructor): New public property.
11843
11844 2004-01-20  Martin Baulig  <martin@ximian.com>
11845
11846         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11847
11848 2004-01-20  Martin Baulig  <martin@ximian.com>
11849
11850         * statement.cs (Statement.ResolveUnreachable): New public method.
11851         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11852         (Block.Resolve): Resolve unreachable statements.
11853
11854 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11855
11856         * expression.cs: We need to fix the case where we do
11857         not have a temp variable here.
11858
11859         * assign.cs: Only expression compound assignments need
11860         temporary variables.
11861
11862 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11863
11864         * flowanalysis.cs: Reduce memory allocation in a few ways:
11865           - A block with no variables should not allocate a bit
11866             vector for itself.
11867           - A method with no out parameters does not need any tracking
11868             for assignment of the parameters, so we need not allocate
11869             any data for it.
11870           - The arrays:
11871                 public readonly Type[] VariableTypes;
11872                 public readonly string[] VariableNames;
11873             Are redundant. The data is already stored in the variable
11874             map, so we need not allocate another array for it.
11875           - We need to add alot of checks for if (params | locals) == null
11876             due to the first two changes.
11877
11878 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11879
11880         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11881         implement IMemoryLocation, we store a copy on a local variable and
11882         take the address of it.  Patch from Benjamin Jemlich
11883
11884         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11885         to use a special "type_name_expression" rule which reduces the
11886         number of "QualifiedIdentifier" classes created, and instead
11887         directly creates MemberAccess expressions.
11888
11889 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11892         that fixes #52853.  Null literal assignment to ValueType
11893
11894         * class.cs (MethodData.Emit): Instead of checking the name of the
11895         method to determine if its a destructor, create a new derived
11896         class from Method called Destructor, and test for that.  
11897
11898         * cs-parser.jay: Create a Destructor object instead of a Method.  
11899
11900         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11901
11902         Fixes: 52933
11903
11904 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11905
11906         * expression.cs (Binary.ResolveOperator): Perform an implicit
11907         conversion from MethodGroups to their delegate types on the
11908         Addition operation.
11909
11910         * delegate.cs: Introduce a new class DelegateCreation that is the
11911         base class for `NewDelegate' and `ImplicitDelegateCreation',
11912         factor some code in here.
11913
11914         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11915         conversion from MethodGroups to compatible delegate types. 
11916
11917         * ecore.cs (Expression.Resolve): Do not flag error 654
11918         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11919         we allow conversions from MethodGroups to delegate types now.
11920
11921         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11922         assignments in v2 either.
11923
11924 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11925
11926         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11927         static read-only fields in ctors.
11928
11929         Applied patch from Benjamin Jemlich 
11930
11931         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11932
11933 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11934
11935         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11936         here to return true, as they can be used like this:
11937
11938                 (XXX) int.MEMBER ()
11939
11940         Fixed 49836 and all the other dups
11941
11942 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11943
11944         * driver.cs: Implement /win32res and /win32icon.
11945
11946 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11947
11948         * cs-parser.jay: Add a rule to improve error handling for the
11949         common mistake of placing modifiers after the type.
11950
11951 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11952
11953         * cs-parser.jay (interface_event_declaration): Catch
11954         initialization of events on interfaces, and report cs0068
11955
11956         * cs-parser.jay (interface_event_declaration): Catch
11957         initialization of events. 
11958
11959         * ecore.cs: Better report missing constructors.
11960
11961         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11962         the error reporting done in the wrong place.  Fix.
11963
11964         * expression.cs (Binary.ResolveOperator): Catch the 
11965         operator + (E x, E y) error earlier, and later allow for implicit
11966         conversions in operator +/- (E e, U x) from U to the underlying
11967         type of E.
11968
11969         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11970         52596, if the container class is abstract, the default constructor
11971         is protected otherwise its public (before, we were always public).
11972
11973         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11974         fixed statement.
11975
11976         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11977         Jemlich that fixes bug #52597, MCS was generating invalid code for
11978         idisposable structs.   Thanks to Ben for following up with this
11979         bug as well.
11980
11981 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11982
11983         * driver.cs: Allow assemblies without code to be generated, fixes
11984         52230.
11985
11986 2004-01-07  Nick Drochak <ndrochak@gol.com>
11987
11988         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11989
11990 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11991
11992         * cs-parser.jay: Add rules to improve error reporting if fields or
11993         methods are declared at the namespace level (error 116)
11994
11995         * Add rules to catch event add/remove
11996
11997 2004-01-04  David Sheldon <dave-mono@earth.li>
11998
11999   * expression.cs: Added matching ")" to error message for 
12000   CS0077
12001
12002 2004-01-03 Todd Berman <tberman@gentoo.org>
12003
12004         * ecore.cs, attribute.cs:
12005         Applying fix from #52429.
12006
12007 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12008
12009         * ecore.cs, expression.cs, statement.cs:
12010         Total rewrite of how we handle branching. We
12011         now handle complex boolean expressions with fewer
12012         jumps. As well if (x == 0) no longer emits a ceq.
12013
12014         if (x is Foo) is much faster now, because we generate
12015         better code.
12016
12017         Overall, we get a pretty big improvement on our benchmark
12018         tests. The code we generate is smaller and more readable.
12019
12020         I did a full two-stage bootstrap. The patch was reviewed
12021         by Martin and Miguel.
12022
12023 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12024
12025         * cs-parser.jay: Make primary_expression not take a QI.
12026         we dont need this because the member_access rule covers
12027         us here. So we replace the rule with just IDENTIFIER.
12028
12029         This has two good effects. First, we remove a s/r conflict.
12030         Second, we allocate many fewer QualifiedIdentifier objects.
12031
12032 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12033
12034         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12035         set the correct information via SRE. This prevents
12036         hanging on the MS runtime. Fixes #29374.
12037
12038 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12039
12040         * convert.cs: correctly handle conversions to value types
12041         from Enum and ValueType as unboxing conversions.
12042
12043         Fixes bug #52569. Patch by Benjamin Jemlich.
12044
12045 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12046
12047         * expression.cs (BetterConversion): Prefer int -> uint
12048         over int -> ulong (csc's behaviour). This fixed bug #52046.
12049
12050 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12051
12052         * decl.cs (MemberCache.FindMembers): now returns a
12053         MemberInfo [].
12054
12055         * typemanager.cs: In general, go with with ^^.
12056         (CopyNewMethods): take an IList.
12057         (RealMemberLookup): Only allocate an arraylist
12058         if we copy from two sets of methods.
12059
12060         This change basically does two things:
12061         1) Fewer array lists allocated due to CopyNewMethods.
12062         2) the explicit cast in MemberList costed ALOT.
12063
12064 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12065
12066         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12067         a hashtable to avoid needless string allocations when an identifier is
12068         used more than once (the common case).
12069
12070 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12071
12072         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12073         is broken, it will not return anything. So, we
12074         have to use the information we have in mcs to
12075         do the task.
12076
12077         * typemanager.cs: Add a cache for GetInterfaces,
12078         since this will now be used more often (due to ^^)
12079
12080         (GetExplicitInterfaces) New method that gets the
12081         declared, not effective, interfaces on a type
12082         builder (eg, if you have interface IFoo, interface
12083         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12084         { IBar }.
12085
12086         This patch makes MCS able to bootstrap itself on
12087         Windows again.
12088
12089 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12090
12091         * expression.cs: Remove the Nop's that Miguel put
12092         in by mistake.
12093
12094 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12095
12096         * report.cs, codegen.cs: Give the real stack trace to
12097         the error when an exception is thrown.
12098
12099 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12100
12101         * decl.cs: only allocate hashtables for ifaces if 
12102         it is an iface!
12103
12104 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12105
12106         * expression.cs: fix the error from cs0121-2.cs
12107         (a parent interface has two child interfaces that
12108         have a function with the same name and 0 params
12109         and the function is called through the parent).
12110
12111 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12112
12113         * class.cs, rootcontext.cs, typmanager.cs: do not
12114         leak pointers.
12115
12116 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12117
12118         * codegen.cs: remove stack for the ec flow branching.
12119         It is already a linked list, so no need.
12120
12121 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12122
12123         * Makefile: Allow custom profiler here.
12124
12125 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12126
12127         * typemanager.cs (LookupType):
12128           - Use a static char [], because split takes
12129             a param array for args, so it was allocating
12130             every time.
12131           - Do not store true in a hashtable, it boxes.
12132
12133 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12134
12135         * flowanalysis.cs: bytify common enums.
12136
12137 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12138
12139         * modifiers.cs: Add a new set of flags for the
12140         flags allowed on explicit interface impls.
12141         * cs-parser.jay: catch the use of modifiers in
12142         interfaces correctly.
12143         * class.cs: catch private void IFoo.Blah ().
12144
12145         All related to bug #50572.
12146
12147 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12148
12149         * decl.cs: Rewrite the consistant accessability checking.
12150         Accessability is not linear, it must be implemented in
12151         a tableish way. Fixes #49704.
12152
12153 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12154
12155         * expression.cs: Handle negation in a checked context.
12156         We must use subtraction from zero. Fixes #38674.
12157
12158 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12159
12160         * class.cs: Ignore static void main in DLLs.
12161         * rootcontext.cs: Handle the target type here,
12162         since we are have to access it from class.cs
12163         * driver.cs: account for the above.
12164
12165 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12166
12167         * report.cs: Give line numbers and files if available.
12168
12169 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12170
12171         * driver.cs: Implement /addmodule.
12172
12173         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12174         ModuleBuilders.
12175
12176 2003-12-20  Martin Baulig  <martin@ximian.com>
12177
12178         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12179         (FieldBase.IsAssigned): Removed this field.
12180         (FieldBase.SetAssigned): New public method.
12181         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12182
12183 2003-12-20  Martin Baulig  <martin@ximian.com>
12184
12185         * expression.cs (LocalVariableReference.DoResolve): Don't set
12186         `vi.Used' if we're called from DoResolveLValue().
12187
12188         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12189         returns the usage vector it just merged into the current one -
12190         pass this one to UsageWarning().
12191         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12192         of the `EmitContext', don't call this recursively on our children.
12193
12194 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12195
12196         * driver.cs: Implement /target:module.
12197
12198 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12199
12200         * support.cs (CharArrayHashtable): New helper class.
12201
12202         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12203         char arrays, not strings, so we can avoid creating a string in
12204         consume_identifier if the identifier is a keyword.
12205
12206 2003-12-16  Martin Baulig  <martin@ximian.com>
12207
12208         * statement.cs (LocalInfo.Assigned): Removed this property.
12209         (LocalInfo.Flags): Removed `Assigned'.
12210         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12211         and uses flow analysis.
12212         (Block.UsageWarning): Made this method private.
12213         (Block.Resolve): Call UsageWarning() if appropriate.
12214
12215         * expression.cs (LocalVariableReference.DoResolve): Always set
12216         LocalInfo.Used here.
12217
12218 2003-12-13  Martin Baulig  <martin@ximian.com>
12219
12220         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12221         any value here; we're now using flow analysis to figure out
12222         whether a statement/block returns a value.
12223
12224 2003-12-13  Martin Baulig  <martin@ximian.com>
12225
12226         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12227         working again.
12228         (FlowBranching.MergeFinally): Don't call
12229         `branching.CheckOutParameters()' here, this is called in
12230         MergeTopBlock().
12231         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12232         when adding the `finally' vector.       
12233
12234 2003-12-13  Martin Baulig  <martin@ximian.com>
12235
12236         * flowanalysis.cs
12237         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12238         actually work and also fix #48962.
12239
12240 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12241
12242         * decl.cs: Do not check System.Object for nested types,
12243         since we know it does not have any. Big bang for buck:
12244
12245         BEFORE:
12246            Run 1:   8.35 seconds
12247            Run 2:   8.32 seconds
12248            corlib:  17.99 seconds
12249         AFTER:
12250            Run 1:   8.17 seconds
12251            Run 2:   8.17 seconds
12252            corlib:  17.39 seconds
12253
12254 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12255
12256         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12257         time we are returning 0 members, so we save alot here.
12258
12259 2003-12-11  Martin Baulig  <martin@ximian.com>
12260
12261         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12262         `MergeChild()', also just take the `FlowBranching' as argument;
12263         call Merge() on it and return the result.
12264         (FlowBranching.Merge): We don't need to do anything if we just
12265         have one sibling.
12266
12267 2003-12-11  Martin Baulig  <martin@ximian.com>
12268
12269         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12270         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12271         Maurer for this idea.
12272
12273 2003-12-11  Martin Baulig  <martin@ximian.com>
12274
12275         * flowanalysis.cs (MergeResult): This class is now gone; we now
12276         use the `UsageVector' for this.  The reason for this is that if a
12277         branching just has one sibling, we don't need to "merge" them at
12278         all - that's the next step to do.
12279         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12280         `MergeResult'.
12281
12282 2003-12-11  Martin Baulig  <martin@ximian.com>
12283
12284         Reworked flow analyis and made it more precise and bug-free.  The
12285         most important change is that we're now using a special `Reachability'
12286         class instead of having "magic" meanings of `FlowReturns'.  I'll
12287         do some more cleanups and optimizations and also add some more
12288         documentation this week.
12289
12290         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12291         largely reworked this class.
12292         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12293         the new `Reachability' class instead of having "magic" values here.
12294         (FlowBranching): We're now using an instance of `Reachability'
12295         instead of having separate `Returns', `Breaks' etc. fields.
12296
12297         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12298         based on flow analysis; ignore the return value of block.Emit ().
12299
12300 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12301
12302         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12303         if they are private.
12304
12305 2003-12-09  Martin Baulig  <martin@ximian.com>
12306
12307         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12308         call them directly on the UsageVector.
12309
12310 2003-12-09  Martin Baulig  <martin@ximian.com>
12311
12312         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12313         Changed return type from `FlowReturns' to `Reachability'.
12314
12315 2003-12-09  Martin Baulig  <martin@ximian.com>
12316
12317         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12318         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12319         `Reachable' fields with a single `Reachability' one.
12320
12321 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12322
12323         * class.cs (FindMembers): Remove foreach's.
12324
12325         Bootstrap times:
12326
12327         BEFORE
12328                 Run 1:   8.74 seconds
12329                 Run 2:   8.71 seconds
12330
12331         AFTER
12332                 Run 1:   8.64 seconds
12333                 Run 2:   8.58 seconds
12334
12335
12336 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12337
12338         * cs-parser.jay:
12339         * gen-treedump.cs:
12340         * statement.cs:
12341         This patch does a few things:
12342                 1. EmptyStatement is now a singleton, so it is never reallocated.
12343                 2. All blah is EmptyStatement constructs have been changed to
12344                    blah == EmptyStatement.Value, which is much faster and valid
12345                    now that EmptyStatement is a singleton.
12346                 3. When resolving a block, rather than allocating a new array for
12347                    the non-empty statements, empty statements are replaced with
12348                    EmptyStatement.Value
12349                 4. Some recursive functions have been made non-recursive.
12350         Mainly the performance impact is from (3), however (1) and (2) are needed for
12351         this to work. (4) does not make a big difference in normal situations, however
12352         it makes the profile look saner.
12353
12354         Bootstrap times:
12355
12356         BEFORE
12357         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12358         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12359         Total memory allocated: 56397 KB
12360
12361         AFTER
12362         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12363         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12364         Total memory allocated: 55666 KB
12365
12366 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12367
12368         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12369         than the hashtable in a hashtable version
12370
12371         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12372         we always end up concating a string. This results in a huge perf
12373         loss, because many strings have to be tracked by the GC. In this
12374         patch, we first use a hashtable that works with two keys, so that
12375         the strings do not need to be concat'ed.
12376
12377         Bootstrap times:
12378         BEFORE
12379                 Run 1:   8.74 seconds
12380                 Run 2:   8.71 seconds
12381
12382         AFTER
12383                 Run 1:   8.65 seconds
12384                 Run 2:   8.56 seconds
12385
12386 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12387
12388         * Makefile: Add a new target `do-time' that does a quick and simple
12389         profile, leaving easy to parse output.
12390
12391 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12392
12393         * codegen.cs (Init): Create the dynamic assembly with 
12394         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12395
12396 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12397
12398         * support.cs: Make the PtrHashtable use only one
12399         instance of its comparer.
12400
12401 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12402
12403         * typemanager.cs: Fix lookup of GetNamespaces.
12404
12405 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12406
12407         * expression.cs: Removed redundant line.
12408
12409         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12410         ArrayLists, use for loops with bounds.  
12411
12412         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12413         arraylist.
12414
12415         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12416         arraylists, use for loop with bounds.
12417
12418         The above three changes give us a 0.071 second performance
12419         improvement out of 3.294 seconds down to 3.223.  On my machine
12420         the above changes reduced the memory usage by 1,387 KB during
12421         compiler bootstrap.
12422
12423         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12424         QualifiedIdentifiers.  Before we created a new string through
12425         concatenation, and mostly later on, the result would be
12426         manipulated by DecomposeQI through string manipulation.
12427
12428         This reduced the compiler memory usage for bootstrapping from
12429         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12430         compile times in 0.05 seconds.
12431
12432 2003-11-28  Dick Porter  <dick@ximian.com>
12433
12434         * support.cs: Do string compares with the Invariant culture.
12435
12436         * rootcontext.cs: 
12437         * gen-treedump.cs: 
12438         * expression.cs: 
12439         * driver.cs: 
12440         * decl.cs: 
12441         * codegen.cs: 
12442         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12443         the comparison is done with the Invariant culture.
12444
12445 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12446
12447         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12448         GetEnumerator method.
12449
12450         (ProbeCollectionType): Iterate starting at the most specific type
12451         upwards looking for a GetEnumerator
12452
12453         * expression.cs: Shift count can be up to 31 for int/uint and 63
12454         for long/ulong.
12455
12456 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12457
12458         * statement.cs (Block.LookupLabel): Also look for the label on the
12459         children blocks.  Use a hash table to keep track of visited
12460         nodes. 
12461
12462         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12463         we actually did transform the other operand, otherwise fall back
12464         to the common codepath that casts to long.
12465
12466         * cs-tokenizer.cs: Use the same code pattern as the int case.
12467         Maybe I should do the parsing myself, and avoid depending on the
12468         Parse routines to get this done.
12469
12470 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12471
12472         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12473         which fixes bug 51347.  This time test it.
12474
12475         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12476         attributes for example can not tell the difference between these.
12477         The difference was only a syntax feature of the language. 
12478
12479         * attribute.cs: Apply attributes to delegates.
12480
12481         * delegate.cs: Call the apply attributes method.
12482
12483 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12484
12485         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12486         comparing 0 vs Byte.MinValue, not the value
12487
12488         (ImplicitConversionRequired): When reporting a conversion error,
12489         use error 31 to print out the constant error instead of the
12490         simpler 29.
12491
12492         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12493         which fixes bug 51347.
12494
12495 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12496
12497         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12498         which fixes the -warnaserror command line option.
12499
12500 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12501
12502         * cfold.cs (DoNumericPromotions): During constant folding of
12503         additions on UIntConstant, special case intconstants with
12504         IntConstants like we do on the expression binary operator. 
12505
12506 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12507
12508         * convert.cs (ImplicitReferenceConversion): We were missing a case
12509         (System.Enum are not value types or class types, so we need to
12510         classify them separatedly).
12511
12512         * driver.cs: We do not support error 2007.
12513
12514 2003-11-12 Jackson Harper <jackson@ximian.com>
12515
12516         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12517         system directory. Also use the full file name so users can
12518         libraries names mscorlib-o-tron.dll in a non system dir.
12519         
12520 2004-01-04  David Sheldon <dave-mono@earth.li>
12521
12522         * expression.cs: Added matching ")" to error message for CS0077.
12523
12524 2003-12-19  Martin Baulig  <martin@ximian.com>
12525
12526         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12527         static method; see documentation in the method.
12528         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12529
12530         * convert.cs (Convert.ImplicitReferenceConversion,
12531         Convert.ImplicitReferenceConversionExists): Add support for
12532         generic type declarations; see gen-36.cs.
12533
12534 2003-12-19  Martin Baulig  <martin@ximian.com>
12535
12536         * pending.cs (Pending.InterfaceMethod): Use
12537         `Type.IsAssignableFrom()' instead of `=='.
12538
12539 2003-12-18  Martin Baulig  <martin@ximian.com>
12540
12541         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12542         byref types first.
12543
12544         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12545         `expr_type.Equals (target_type)' instead of `=='.
12546
12547 2003-12-08  Martin Baulig  <martin@ximian.com>
12548
12549         * generics.cs (Constraints.Types): Removed.
12550         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12551         to Type's.
12552         (Constraints.ResolveTypes): New public method; resolves the
12553         TypeExpr's to Type's.
12554         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12555         longer takes the constraints.
12556         (TypeParameter.DefineMethod): Likewise.
12557         (TypeParameter.DefineType): New public method.  Calls
12558         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12559         the constraints.
12560
12561 2003-12-08  Martin Baulig  <martin@ximian.com>
12562
12563         * convert.cs (Convert.ImplicitConversionStandard): Use
12564         `expr_type.Equals (target_type)' instead of `=='.
12565
12566 2003-12-08  Martin Baulig  <martin@ximian.com>
12567
12568         * typemanager.cs (TypeManager.GetReferenceType): Call
12569         `Type.MakeByRefType ()'.
12570
12571 2003-12-08  Martin Baulig  <martin@ximian.com>
12572
12573         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12574         just has some special meaning in some situations.  For instance,
12575         it is allowed to use `where' as the name of a variable etc.
12576
12577 2003-12-04  Martin Baulig  <martin@ximian.com>
12578
12579         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12580         `Type.MakeArrayType()' for array types.
12581
12582 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12583
12584         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12585         debugging message.
12586
12587         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12588         corlib to compile.
12589
12590 2003-11-16  Martin Baulig  <martin@ximian.com>
12591
12592         * codegen.cs (EmitContext.IsGeneric): Removed.
12593
12594         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12595         ResolveGeneric() on the DeclSpace.
12596
12597 2003-11-16  Martin Baulig  <martin@ximian.com>
12598
12599         * generic.cs (TypeArguments.Resolve):
12600         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12601         `ResolveType()' on it to get the Type.
12602
12603 2003-11-15  Martin Baulig  <martin@ximian.com>
12604
12605         * generic.cs (ConstructedType.GetInterfaces): Override this.
12606
12607 2003-11-14  Martin Baulig  <martin@ximian.com>
12608
12609         * interface.cs (Interface.DefineType): Define all type parameters
12610         before adding the interfaces we inherit.
12611
12612 2003-11-11  Martin Baulig  <martin@ximian.com>
12613
12614         * generic.cs (ConstructedType.ResolveType): Always call
12615         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12616
12617 2003-11-10  Martin Baulig  <martin@ximian.com>
12618
12619         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12620         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12621         calling `ResolveType()' on them, directly assign their `Type'.
12622
12623 2003-11-08  Martin Baulig  <martin@ximian.com>
12624
12625         * generic.cs (ConstructedType): Override `IsClass' etc.
12626
12627 2003-11-08  Martin Baulig  <martin@ximian.com>
12628
12629         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12630         return value and the `out parent' parameter.
12631         (TypeContainer.DefineType): Moved the CS0644 check into
12632         GetClassBases().  Don't pass the interface types to the
12633         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12634         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12635
12636         * ecore.cs (TypeExpr.IsAttribute): New property.
12637         (TypeExpr.GetInterfaces): New method.
12638
12639         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12640         TypeExpr instead of a Type.
12641         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12642         (Interface.DefineType): Don't pass the interface types to the
12643         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12644         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12645
12646         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12647         instead of a `Type[]'.
12648         (TypeManager.RegisterBuilder): Likewise.
12649         (TypeManager.AddUserInterface): Likewise.
12650         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12651         `Type[]' and also return a `TypeExpr[]'.
12652         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12653
12654 2003-11-08  Martin Baulig  <martin@ximian.com>
12655
12656         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12657         Expression.     
12658
12659 2003-11-08  Martin Baulig  <martin@ximian.com>
12660
12661         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12662         TypeManager.ResolveExpressionTypes().
12663
12664         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12665         instead of an Expression.
12666         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12667         (TypeExpression): New public class; formerly known as `TypeExpr'.
12668
12669         * expression.cs (ComposedCast): Derive from TypeExpr.
12670
12671         * typemanager.cs (TypeManager.system_*_expr): These are now
12672         TypExpr's instead of Expression's.
12673         (TypeManager.ResolveExpressionTypes): New public static function;
12674         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12675         of them.        
12676
12677 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12678
12679         * expression.cs (New.DoResolve): Do not dereference value that
12680         might be a null return.
12681
12682         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12683         sure that the constant value has the right type.  Fixes an
12684         unreported bug, similar to 50425.
12685
12686         * const.cs (Const.LookupConstantValue): Call
12687         ImplicitStandardConversionExists before doing a conversion to
12688         avoid havng the TypeManager.ChangeType do conversions.
12689
12690         Reduced the number of casts used
12691
12692         (Const.ChangeType): New routine to enable reuse of the constant
12693         type changing code from statement.
12694
12695         * typemanager.cs (ChangeType): Move common initialization to
12696         static global variables.
12697
12698         Fixes #50425.
12699
12700         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12701         every value type to go through, even if it was void.  Fix that. 
12702
12703         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12704         character of the define, and the is_identifier_part_character for
12705         the rest of the string.
12706
12707 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12708
12709         * expression.cs (UnaryMutator.EmitCode): When I updated
12710         LocalVariableReference.DoResolve, I overdid it, and dropped an
12711         optimization done on local variable references.
12712
12713 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12714
12715         * ecore.cs: Convert the return from Ldlen into an int.
12716
12717 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12718
12719         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12720         the accessibility, this is a special case for toplevel non-public
12721         classes (internal for instance).
12722
12723 2003-10-20  Nick Drochak <ndrochak@gol.com>
12724
12725         * ecore.cs: Fix typo and build.  Needed another right paren.
12726
12727 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12728
12729         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12730         `internal' case regular and protected, but not allowing protected
12731         to be evaluated later.  Bug 49840
12732
12733 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12734
12735         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12736         to kb.Nlast, and not the kb.nFirst to isolate the switch
12737         statement.
12738
12739         Extract the underlying type, so enumerations of long/ulong are
12740         treated like long/ulong.
12741
12742 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12743
12744         * expression.cs (New): Overload the meaning of RequestedType to
12745         track the possible creation of the NewDelegate type, since
12746         DoResolve is invoked more than once for new constructors on field
12747         initialization.
12748
12749         See bugs: #48800 and #37014
12750
12751         * cs-parser.jay (declare_local_constants): Take an arraylist
12752         instead of a single constant.
12753
12754         (local_constant_declaration): It should take a
12755         constant_declarators, not a constant_declarator.  Fixes 49487
12756
12757         * convert.cs: Fix error report.
12758
12759 2003-10-13 Jackson Harper <jackson@ximian.com>
12760
12761         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12762         bug #49611
12763         
12764 2003-11-03  Martin Baulig  <martin@ximian.com>
12765
12766         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12767         `out bool has_type_arg'; if set, we need to pass the type to
12768         ig.Emit().
12769         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12770         Stelem_Any/Ldelem_Any for generic parameters.   
12771
12772 2003-11-02  Martin Baulig  <martin@ximian.com>
12773
12774         * expression.cs (Invocation.EmitCall): Use
12775         `TypeManager.IsValueType()' to check whether it's a value type.
12776         Don't set `struct_call' when calling a method on a type parameter.
12777
12778 2003-11-02  Martin Baulig  <martin@ximian.com>
12779
12780         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12781         and removed the TypeBuilder argument.
12782
12783         * typemanager.cs (TypeManager.IsValueType): Return
12784         `t.IsGenericParameter || t.IsValueType'.
12785
12786 2003-10-25  Martin Baulig  <martin@ximian.com>
12787
12788         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12789         call ConstructedType.Resolve() on it.
12790
12791         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12792
12793 2003-10-25  Martin Baulig  <martin@ximian.com>
12794
12795         * class.cs (TypeContainer.GetClassBases): Changed
12796         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12797         CS8214 reporting here.
12798         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12799         instead of a `Type' for our parent.  In case of a recursive
12800         declaration (see tests/gen-23.cs for an example), our parent is a
12801         ConstructedType and it doesn't have its type set.  So, first
12802         create our own TypeBuilder, then call constructed.Resolve() to get
12803         the parent's type and finally TypeBuilder.SetParent() it.
12804
12805         * ecore.cs (TypeExpr.Name): New public virtual property.
12806
12807         * generic.cs
12808         (ConstructedType): We're now a TypeExpr and not just an Expression.
12809         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12810         arguments here; this is done later.
12811         (ConstructedType.Resolve): New public method to resolve the type
12812         arguments and bind them.
12813
12814 2003-10-21  Martin Baulig  <martin@ximian.com>
12815
12816         * convert.cs: Use `TypeManager.IsValueType' instead of
12817         'type.IsValueType' everywhere.
12818
12819         * typemanager.cs (TypeManager.IsValueType): Return true for type
12820         parameters.  The reason for this is that we need to box a type
12821         parameter when converting it to a reference type.
12822
12823         * cs-parser.jay: Added support for default value expressions.
12824
12825         * generics.cs (DefaultValueExpression): New public class.       
12826
12827 2003-10-17  Martin Baulig  <martin@ximian.com>
12828
12829         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12830         TypeContainer so we can also use this for Interfaces.
12831         (TypeParameter.Resolve): Likewise.
12832
12833         * interface.cs (Interface.DefineType): Added support for generic
12834         interfaces.
12835
12836         * cs-parser.jay: Added support for generic structs and interfaces.
12837
12838 2003-10-17  Martin Baulig  <martin@ximian.com>
12839
12840         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12841         call generic methods :-)
12842
12843 2003-10-16  Martin Baulig  <martin@ximian.com>
12844
12845         * cs-parser.jay (namespace_or_type_name): Only create a
12846         GenericMemberAccess if we actually have type arguments.
12847
12848 2003-10-13  Martin Baulig  <martin@ximian.com>
12849
12850         * class.cs (Method.Define): If we're a generic method, call
12851         TypeBuilder.DefineGenericMethod () before resolving
12852         the parameters.
12853         (MethodData): Added .ctor which takes an additional MethodBuilder
12854         argument; this is used for generic methods.
12855         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12856         we already have a MethodBuilder.
12857
12858 2003-10-10  Martin Baulig  <martin@ximian.com>
12859
12860         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12861         instead of a `DeclSpace'.  This is used for generic methods.
12862
12863         * cs-parser.jay (method_header): Added support for generic
12864         methods; create a `GenericMethod' instance and pass it to the
12865         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12866         parameters and locals.
12867
12868         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12869         since we already have the location.  Check whether we're a generic
12870         type declaration or a generic method and create the correct type
12871         parameter.
12872
12873         * generic.cs (TypeParameter.DefineMethod): New public method.
12874         (GenericMethod): New public class; derives from DeclSpace and is
12875         used for generic methods.       
12876
12877 2003-10-09  Martin Baulig  <martin@ximian.com>
12878
12879         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12880         to the .ctor.
12881         (MethodCore.DoDefineParameters): Removed the TypeContainer
12882         argument; use the DeclSpace which was passed to the .ctor instead.
12883         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12884         TypeContainer; we only need a DeclSpace here.
12885
12886 2003-10-09  Martin Baulig  <martin@ximian.com>
12887
12888         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12889         to the .ctor.
12890         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12891         EmitContext's .ctor.    
12892
12893 2003-10-09  Martin Baulig  <martin@ximian.com>
12894
12895         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12896         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12897         AsAccessible(), moved them as well.
12898
12899         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12900
12901 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12902
12903         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12904         generation for >=, as spotted by Paolo, bug 48679.  
12905         Patch from David Waite.
12906
12907         * cs-tokenizer.cs: Add handling for #pragma.
12908
12909         * cs-parser.jay: Allow for both yield and yield return in the
12910         syntax.  The anti-cobolization of C# fight will go on!
12911
12912         * class.cs (TypeBuilder.DefineType): Catch error condition here
12913         (Parent.DefineType erroring out and returning null).
12914
12915         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12916         coping with enumerations variables, we were mistakenly processing
12917         them as a regular value type instead of built-in types.  Fixes the
12918         bug #48063
12919
12920         * typemanager.cs (IsBuiltinOrEnum): New method.
12921
12922 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12923
12924         * cs-parser.jay: Upgrade: yield now needs the return clause.
12925
12926 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12927
12928         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12929
12930 2003-09-29  Martin Baulig  <martin@ximian.com>
12931
12932         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12933         inflated generic methods.
12934
12935         * generics.cs (ConstructedType): Distinguish between open and
12936         closed constructed types; correctly resolve the arguments.
12937
12938 2003-09-22  Martin Baulig  <martin@ximian.com>
12939
12940         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12941         all type arguments meet their constraints.
12942
12943 2003-09-19  Martin Baulig  <martin@ximian.com>
12944
12945         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12946         `MemberCache parent' argument.  Normally, an interface doesn't
12947         have a parent type except System.Object, but we use this in gmcs
12948         for generic type parameters.
12949
12950 2003-09-18  Martin Baulig  <martin@ximian.com>
12951
12952         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12953         on `type.IsInterface'; don't check whether the type has a parent
12954         to determine whether it's an interface.
12955
12956 2003-09-17  Martin Baulig  <martin@ximian.com>
12957
12958         * generic.cs (ConstructedType.ToString): Always use `name' as the
12959         type name.
12960
12961 2003-09-15  Martin Baulig  <martin@ximian.com>
12962
12963         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12964
12965         * generic.cs (Constraints.Resolve): New public method; this is
12966         called to resolve the constraint types and to check whether all
12967         the constraints are correct.
12968         (Constraints.Types): New public property.
12969         (TypeParameter.Resolve): New public method; resolves all the
12970         type's constraints.
12971
12972         * class.cs (TypeContainer.DefineType): Call
12973         TypeParameter.Resolve() before actually defining the type.
12974
12975 2003-09-15  Martin Baulig  <martin@ximian.com>
12976
12977         * class.cs (TypeContainer.DefineType): Added an error flag to
12978         avoid reporting duplicate CS0146's ("class definition is
12979         circular.").
12980
12981         * driver.cs (Driver.MainDriver): Abort if
12982         RootContext.ResolveTree() reported any errors.
12983
12984 2003-09-07  Martin Baulig  <martin@ximian.com>
12985
12986         * report.cs (Error, Warning): Added overloaded versions which take
12987         a `params object[] args' and call String.Format().
12988
12989 2003-09-07  Martin Baulig  <martin@ximian.com>
12990
12991         * decl.cs (DeclSpace..ctor): Don't call
12992         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12993         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12994         (DeclSpace.RecordDecl): New method.
12995
12996         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12997
12998 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12999
13000         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13001         value attributes to be applied to ParameterBuilders.
13002
13003         * class.cs (MethodCore.LabelParameters): Make static and more
13004         generic so that it can be used from other places - like interface
13005         methods, for instance.
13006
13007         * interface.cs (Interface.Emit): Call LabelParameters before
13008         emitting attributes on the InterfaceMethod.
13009
13010 2003-09-07  Martin Baulig  <martin@ximian.com>
13011
13012         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13013         if the number of type parameters doesn't match.
13014
13015 2003-09-04  Martin Baulig  <martin@ximian.com>
13016
13017         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13018         for arrays of generic type params (ie. `!0[]').
13019
13020 2003-09-04  Martin Baulig  <martin@ximian.com>
13021
13022         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13023         for the moment.
13024
13025 2003-09-04  Martin Baulig  <martin@ximian.com>
13026
13027         * decl.cs (DeclSpace.LookupGeneric): New method.
13028         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13029         moment.
13030
13031         * generic.cs (TypeParameterExpr): Take a TypeParameter as
13032         argument, not just a string.
13033         (TypeParameter.Define): New public method; this is called to
13034         actually define the generic parameter; after this, you can use the
13035         new `Type' property to get the type.
13036
13037 2003-09-04  Martin Baulig  <martin@ximian.com>
13038
13039         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13040         is now an ArrayList; initialize the result of the `TypeParameters'
13041         property here.
13042         (DeclSpace.GetGenericData): Removed.
13043         (DeclSpace.LookupGeneric): Temporarily removed; we need to
13044         implement this in a different way.
13045         (DeclSpace.GetTypeParameters): Removed; there's now a
13046         `TypeParameters' property.
13047         (DeclSpace.TypeParameters): New public property.
13048
13049         * generic.cs (Constraints): Make this class public.
13050         (TypeParameter): New public class.
13051
13052 2003-09-04  Martin Baulig  <martin@ximian.com>
13053
13054         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13055         generic parameters.
13056
13057         * class.cs (TypeContainer.DefineType): Call
13058         TypeBuilder.DefineGenericParameter () on all generic parameters if
13059         this is a generic type.
13060
13061 2003-08-28  Martin Baulig  <martin@ximian.com>
13062
13063         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13064         sample-stack.il".
13065
13066         * sample-hello.cs: Compile this with gmcs: "gmcs
13067         /r:sample-stack.dll sample-hello.cs".
13068
13069 2003-08-28  Martin Baulig  <martin@ximian.com>
13070
13071         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13072         the parameters to the generic type.
13073
13074 2003-08-28  Martin Baulig  <martin@ximian.com>
13075
13076         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13077
13078 2003-08-28  Martin Baulig  <martin@ximian.com>
13079
13080         * cs-parser.jay (opt_type_argument_list): Use
13081         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13082         (primary_expression): Replace `qualified_identifier' with `type_name'.
13083         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13084
13085         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13086         parser to check whether it is syntactically a type parameter list;
13087         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13088         this case.
13089
13090 2003-08-26  Martin Baulig  <martin@ximian.com>
13091
13092         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13093         resolving aliases; fixes #47927.
13094
13095 2003-08-26  Martin Baulig  <martin@ximian.com>
13096
13097         * statement.cs (Using.DoResolve): This is internally emitting a
13098         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13099         do not always return.  Fixes #47681.
13100
13101 2003-08-26  Martin Baulig  <martin@ximian.com>
13102
13103         * decl.cs (MemberCore): Moved WarningNotHiding(),
13104         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13105         into MemberBase.
13106         (AdditionResult): Make this nested in DeclSpace.
13107         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13108         argument; call NamespaceEntry.Define() unless we're nested in a
13109         class or struct.
13110
13111         * namespace.cs (Namespace.DefineName): New public function.  This
13112         is called from DeclSpace's .ctor to add 
13113         (Namespace.Lookup): Include DeclSpaces in the lookup.
13114
13115         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13116
13117         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13118
13119 2003-08-25  Martin Baulig  <martin@ximian.com>
13120
13121         * convert.cs (Convert.ExplicitReferenceConversion): When
13122         converting from an interface type to a class, unbox if the target
13123         type is a struct type.  Fixes #47822.
13124
13125 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13126
13127         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13128         #47854.
13129
13130 2003-08-22  Martin Baulig  <martin@ximian.com>
13131
13132         * class.cs (TypeManager.DefineType): When defining a nested type,
13133         call DefineType() on our parent; fixes #47801.
13134
13135 2003-08-22  Martin Baulig  <martin@ximian.com>
13136
13137         * class.cs (MethodData.Define): While checking if a method is an
13138         interface implementation, improve the test a bit more to fix #47654.
13139
13140 2003-08-22  Martin Baulig  <martin@ximian.com>
13141
13142         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13143         correctly; fixes #47722.
13144
13145 2003-08-22  Martin Baulig  <martin@ximian.com>
13146
13147         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13148         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13149
13150         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13151
13152 2003-08-22  Martin Baulig  <martin@ximian.com>
13153
13154         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13155         can only be assigned in static constructors.  Fixes #47161.
13156
13157 2003-08-22  Martin Baulig  <martin@ximian.com>
13158
13159         Rewrote and improved the flow analysis code.
13160
13161         * flowbranching.cs (FlowBranching): Make this class abstract.
13162         (FlowBranching.CreateBranching): New static function to create a
13163         new flow branching.
13164         (FlowBranchingBlock, FlowBranchingException): New classes.
13165         (FlowBranching.UsageVector.Type): New public readonly field.
13166         (FlowBranching.UsageVector.Breaks): Removed the setter.
13167         (FlowBranching.UsageVector.Returns): Removed the setter.
13168         (FlowBranching.UsageVector): Added Break(), Return(),
13169         NeverReachable() and Throw() methods to modify the reachability.
13170         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13171         done by FlowBranching.Merge().
13172         (FlowBranching.UsageVector.MergeChild): New method; merges the
13173         merge result into the current vector.
13174         (FlowBranching.Merge): New abstract method to merge a branching.
13175
13176 2003-08-12  Martin Baulig  <martin@ximian.com>
13177
13178         * expression.cs (Indirection.CacheTemporaries): Create the
13179         LocalTemporary with the pointer type, not its element type.
13180
13181 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13182
13183         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13184         token was a keyword or not.
13185
13186         Add `error' options where an IDENTIFIER was expected;  Provide
13187         CheckToken and CheckIdentifierToken convenience error reporting
13188         functions. 
13189
13190         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13191
13192         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13193         NameSpaceEntry NameSpaceEntry.
13194
13195         (LookupInterfaceOrClass): Avoid creating a full qualified name
13196         from namespace and name: avoid doing lookups when we know the
13197         namespace is non-existant.   Use new Tree.LookupByNamespace which
13198         looks up DeclSpaces based on their namespace, name pair.
13199
13200         * driver.cs: Provide a new `parser verbose' to display the
13201         exception thrown during parsing.  This is turned off by default
13202         now, so the output of a failure from mcs is more graceful.
13203
13204         * namespace.cs: Track all the namespaces defined in a hashtable
13205         for quick lookup.
13206
13207         (IsNamespace): New method
13208
13209 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13210
13211         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13212         we know that we need to concatenate (full typename can never be
13213         null). 
13214
13215         * class.cs: ditto.
13216
13217         * statement.cs: Use a bitfield;  Do not initialize to null things
13218         which are done by the constructor by default.
13219
13220         * cs-parser.jay: bug fix, parameter was 4, not 3.
13221
13222         * expression.cs: Just use the property;
13223
13224         * statement.cs: No need for GetVariableInfo method.
13225
13226 2003-08-08  Martin Baulig  <martin@ximian.com>
13227
13228         * flowanalysis.cs (FlowReturns): This is now nested in the
13229         `FlowBranching' class.
13230         (MyBitVector): Moved this here from statement.cs.
13231         (FlowBranching.SiblingType): New enum type.
13232         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13233
13234 2003-08-07  Martin Baulig  <martin@ximian.com>
13235
13236         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13237         `FlowBranching' class and called `BranchingType'.
13238
13239 2003-08-07  Martin Baulig  <martin@ximian.com>
13240
13241         * flowanalysis.cs: Moved all the control flow analysis code into
13242         its own file.
13243
13244 2003-08-07  Martin Baulig  <martin@ximian.com>
13245
13246         * assign.cs (Assign.DoResolve): `target' must either be an
13247         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13248         #37319.
13249
13250 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13251
13252         * expression.cs (BinaryMethod): This kind of expression is created by the
13253         Binary class if it determines that the operator has to be handled
13254         by a method.
13255
13256         (BinaryDelegate): This kind of expression is created if we are
13257         dealing with a + or - operator on delegates.
13258
13259         (Binary): remove method, argumetns, and DelegateOperator: when
13260         dealing with methods, 
13261
13262         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13263
13264         * statement.cs (Block): use bitfields for the three extra booleans
13265         we had in use.   Remove unused topblock parameter.
13266
13267         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13268
13269         * assign.cs: Drop extra unneeded tests.
13270
13271 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13272
13273         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13274
13275         * statement.cs (Foreach): Use VariableStorage instead of
13276         LocalBuilders.   
13277
13278         * codegen.cs (VariableStorage): New class used by clients that
13279         require a variable stored: locals or fields for variables that
13280         need to live across yield.
13281
13282         Maybe provide a convenience api for EmitThis+EmitLoad?
13283
13284         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13285         these bad boys.
13286
13287 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13288
13289         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13290         RemapParameterLValue): New methods that are used to turn a
13291         precomputed FieldInfo into an expression like this:
13292
13293                 instance.FieldInfo
13294
13295         The idea is to use this instead of making LocalVariableReference
13296         have more than one meaning.
13297
13298         * cs-parser.jay: Add error production to BASE.
13299
13300         * ecore.cs: Deal with TypeManager.GetField returning null, which
13301         is now a valid return value.
13302
13303         (FieldExprNoAddress): New expression for Fields whose address can
13304         not be taken.
13305
13306         * expression.cs (LocalVariableReference): During the resolve
13307         phases, create new expressions if we are in a remapping context.
13308         Remove code that dealt with remapping here.
13309
13310         (ParameterReference): same.
13311
13312         (ProxyInstance): New expression, like the `This' expression, but
13313         it is born fully resolved.  We know what we are doing, so remove
13314         the errors that are targeted to user-provided uses of `this'.
13315
13316         * statement.cs (Foreach): our variable is now stored as an
13317         Expression;  During resolution, follow the protocol, dont just
13318         assume it will return this.
13319
13320 2003-08-06  Martin Baulig  <martin@ximian.com>
13321
13322         * support.cs (SeekableStreamReader.cs): New public class.
13323
13324         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13325         SeekableStreamReader instead of the normal StreamReader.
13326
13327 2003-08-04  Martin Baulig  <martin@ximian.com>
13328
13329         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13330         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13331         deambiguate casts and delegate invocations.
13332         (parenthesized_expression): Use the new tokens to ensure this is
13333         not a cast of method invocation.
13334
13335         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13336         when reading a `)' and Deambiguate_CloseParens () was previously
13337         called.
13338
13339         * expression.cs (ParenthesizedExpression): New class.  This is
13340         just used for the CS0075 test.
13341         (Binary.DoResolve): Check for CS0075.   
13342
13343 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13344
13345         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13346         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13347         reference comparison.
13348
13349         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13350         examine the ReturnType for equality - this is necessary in the
13351         cases of implicit and explicit operators whose signature also
13352         includes the return type.
13353
13354 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13355
13356         * namespace.cs: Cache the result of the namespace computation,
13357         instead of computing it every time.
13358
13359 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13360
13361         * decl.cs: Use a global arraylist that we reuse over invocations
13362         to avoid excesive memory consumption.  Reduces memory usage on an
13363         mcs compile by one meg (45 average).
13364
13365         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13366         private, work around that.
13367
13368 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13369
13370         * literal.cs (IntLiteral): Define Zero and One static literals. 
13371
13372         * cs-parser.jay (integer_literal): use static literals to reduce
13373         memory usage for the most used literals (0, 1 and -1).  211kb
13374         reduced in memory usage.
13375
13376         Replace all calls to `new ArrayList' with `new
13377         ArrayList(4)' which is a good average number for most allocations,
13378         and also requires only 16 bytes of memory for its buffer by
13379         default. 
13380
13381         This reduced MCS memory usage in seven megabytes for the RSS after
13382         bootstrapping.
13383
13384 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13385
13386         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13387         handle params methods the correct way by forming only one
13388         applicable set with params and normal methods in them. Earlier we
13389         were looking at params methods only if we found no normal methods
13390         which was not the correct thing to do.
13391
13392         (Invocation.BetterFunction): Take separate arguments indicating
13393         when candidate and the best method are params methods in their
13394         expanded form.
13395
13396         This fixes bugs #43367 and #46199.
13397
13398         * attribute.cs: Documentation updates.
13399
13400         (CheckAttribute): Rename to CheckAttributeTarget.
13401         (GetValidPlaces): Rename to GetValidTargets.
13402
13403         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13404         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13405
13406         Fixes bug #44468.
13407
13408 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13409
13410         * codegen.cs: Compute IsGeneric correctly.
13411
13412         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13413         resolution. 
13414
13415         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13416         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13417         regressions, and I was chasing more bugs than I required.
13418
13419         * interface.cs: Use expressions for base type names (like classes
13420         and structs have been doing for a while now), and resolve that.
13421         This patch should probably go into head as well.
13422
13423         This makes it one less user of FindType.
13424
13425 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13426
13427         This compiler can not self host currently.  Need to fix that.
13428         
13429         * Makefile: compile to `gmcs.exe'
13430
13431         * driver.cs: Turn on v2 by default on gmcs.
13432
13433         * generic.cs (ConstructedType): Does no longer take a container
13434         type argument;  That will be taken care of later.
13435
13436         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13437         Use SimpleName to resolve for now, so we can continue the work on
13438         the parser, until we get Type.GetType that understands generics.
13439
13440         (ConstructedType.ToString): Implement
13441
13442         (TypeArguments.Resolve): Resolve the child expressions as types. 
13443         
13444         * cs-parser.jay: Rename interface_constraints to
13445         type_parameter_constraints
13446
13447         (namespace_or_type_name): Only use constructed types for the basic
13448         construction, we will deal with identifier<...> later.
13449
13450         (type/type_name): No longer call DecomposeQI, as
13451         namespace_or_type_name is always decoded now.
13452         
13453 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13454
13455         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13456         closely: we eliminate methods in base types when we have an
13457         applicable method in a top-level type.
13458
13459         Please see section 14.5.5.1 for an exact description of what goes
13460         on. 
13461
13462         This fixes bug #45127 and a host of other related to corlib compilation.
13463
13464         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13465         array is the method corresponding to the top-level type (this is
13466         because of the changes made to icall.c) so we change this
13467         accordingly.
13468
13469         (MethodGroupExpr.Name): This too.
13470
13471         * typemanager.cs (GetElementType): New method which does the right
13472         thing when compiling corlib. 
13473
13474         * everywhere: Make use of the above in the relevant places.
13475
13476 2003-07-22  Martin Baulig  <martin@ximian.com>
13477
13478         * cs-parser.jay (invocation_expression): Moved
13479         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13480         `cast_expression', but create a InvocationOrCast which later
13481         resolves to either an Invocation or a Cast.
13482
13483         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13484         method; call this before EmitStatement() to make sure that this
13485         expression can be used as a statement.
13486
13487         * expression.cs (InvocationOrCast): New class; resolves to either
13488         an Invocation or a Cast.
13489
13490         * statement.cs (StatementExpression): Call ResolveStatement() on
13491         the ExpressionStatement before emitting it.
13492
13493 2003-07-21  Martin Baulig  <martin@ximian.com>
13494
13495         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13496         `ref' and `out' attributes match; fixes #46220.
13497         (MemberAccess.ResolveMemberAccess): You can't reference a type
13498         through an expression; fixes #33180.
13499         (Indexers.GetIndexersForType): Don't return the indexers from
13500         interfaces the class implements; fixes #46502.
13501
13502 2003-07-21  Martin Baulig  <martin@ximian.com>
13503
13504         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13505         CS0661 checks; fixes bug #30442.
13506
13507 2003-07-21  Martin Baulig  <martin@ximian.com>
13508
13509         * decl.cs (AdditionResult): Added `Error'.
13510
13511         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13512
13513         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13514         cs0031.cs actually work.
13515
13516  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13517  
13518         * cs-parser.jay (namespace_name): do not use
13519         namespace_or_type_name, use qualified_identifier, because
13520         namespace_or_type_name will soon return a composed expression
13521         instead of a string.
13522  
13523         (namespace_or_type_name): Instead of returning a string, now this
13524         production returns an expression.
13525  
13526         * codegen.cs (EmitContext): Setup IsGeneric property based on
13527         whether our DeclSpace is generic, our the method is generic.
13528  
13529         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13530         the method is generic.
13531  
13532         * cs-parser.jay (type_arguments, opt_type_argument_list,
13533         type_parameters, type_parameter_list, opt_type_parameter_list,
13534         type_parameter,, opt_type_parameter_constraints_clauses,
13535         type_parameter_constraints_clauses,
13536         type_parameter_constraint_clause, type_parameter_constraint,
13537         interface_constraints): Add new production
13538  
13539         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13540         DeclSpace is generic or not.
13541  
13542         (DeclSpace.SetParameterInfo): New routine, used to set the
13543         parameter info for a type.
13544  
13545         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13546         returns a GenericTypeExpr
13547  
13548         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13549         generic, lookup the generic argument.
13550  
13551         * attribute.cs: Do not allow TypeParameterExpressions in
13552         Attributes.
13553  
13554         * class.cs: Do not allow the Main method to be defined in a
13555         Generic container.
13556  
13557         * expression.cs (SizeOf): Do not allow generic types to be used as
13558         arguments to sizeof.
13559  
13560         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13561         it: whether a type is generic or not.  Only works for types we are
13562         currently building for now.
13563         
13564 2003-07-20  Martin Baulig  <martin@ximian.com>
13565
13566         * namespace.cs: Fixed that bug which caused a crash when compiling
13567         the debugger's GUI.
13568
13569 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13570
13571         * typemanager.cs (LookupTypeReflection): Never expose types which
13572         are NotPublic, NestedPrivate, NestedAssembly, or
13573         NestedFamANDAssem.  We used to return these, and later do a check
13574         that would report a meaningful error, but the problem is that we
13575         would not get the real match, if there was a name override.
13576
13577 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13578
13579         * namespace.cs (Namespace, Name): Do not compute the namespace
13580         name dynamically, compute it in the constructor.  This reduced
13581         memory usage by 1697 KB.
13582
13583         * driver.cs: Use --pause to pause at the end.
13584
13585 2003-07-17  Peter Williams  <peter@newton.cx>
13586
13587         * Makefile: Change the name of the test target so that it doesn't
13588         conflict with the recursive test target.
13589
13590 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13591
13592         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13593         AddressOf): Do not use EmitThis, that was wrong, use the actual
13594         this pointer.
13595
13596 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13597
13598         * class.cs (MethodData.Define): While checking if a method is an
13599         interface implementation, improve the test: If we are not public
13600         (use new test here: use the computed MethodAttributes directly,
13601         instead of the parsed modifier flags) check if the `implementing'
13602         method comes from an interface or not.
13603
13604         * pending.cs (VerifyPendingMethods): Slightly better error
13605         message.
13606
13607         * makefile: add test target that does the mcs bootstrap.
13608
13609 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13610
13611         * interface.cs (Define): Do nothing here since there are no
13612         members to populate etc. Move the attribute emission out of here
13613         since this was just totally the wrong place to put it. Attribute
13614         application happens during the 'Emit' phase, not in the 'Define'
13615         phase.
13616
13617         (Emit): Add this method and move the attribute emission here
13618
13619         * rootcontext.cs (EmitCode): Call the Emit method on interface
13620         types too.
13621
13622 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13623
13624         * expression.cs (OverloadResolve): Report error only if Location
13625         is not 'Null' which means that there was a probe going on.
13626
13627 2003-07-14  Martin Baulig  <martin@ximian.com>
13628
13629         * expression.cs (ConditionalLogicalOperator): New public class to
13630         implement user defined conditional logical operators.
13631         This is section 14.11.2 in the spec and bug #40505.
13632
13633 2003-07-14  Martin Baulig  <martin@ximian.com>
13634
13635         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13636
13637 2003-07-14  Martin Baulig  <martin@ximian.com>
13638
13639         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13640
13641         * ecore.cs (IVariable.VerifyFixed): New interface method.
13642
13643         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13644         operator, check whether the variable is actually fixed.  Fixes bug
13645         #36055.  Set a variable definitely assigned when taking its
13646         address as required by the spec.
13647
13648         * statement.cs (LocalInfo.IsFixed): New field.
13649         (LocalInfo.MakePinned): Set `IsFixed' to true.
13650
13651 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13652
13653         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13654         for .ctors, ensure that we only ask for members declared in the
13655         attribute type (BindingFlags.DeclaredOnly).
13656
13657         Fixes bug #43632.
13658
13659         * expression.cs (Error_WrongNumArguments): Report error 1501
13660         correctly the way CSC does.
13661
13662 2003-07-13  Martin Baulig  <martin@ximian.com>
13663
13664         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13665         lookup on the fully qualified name, to make things like "X.X" work
13666         where "X.X" is a fully qualified type name, but we also have a
13667         namespace "X" in the using list.  Fixes #41975.
13668
13669 2003-07-13  Martin Baulig  <martin@ximian.com>
13670
13671         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13672         function. If we're a CompoundAssign, we need to create an embedded
13673         CompoundAssign, not an embedded Assign.
13674         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13675         Fixes #45854.
13676
13677 2003-07-13  Martin Baulig  <martin@ximian.com>
13678
13679         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13680         work to fix bug #46088.
13681
13682 2003-07-13  Ravi Pratap <ravi@ximian.com>
13683
13684         * class.cs (Operator.Emit): Do not emit attributes here - it is
13685         taken care of by the Method class that we delegate too. This takes
13686         care of bug #45876.
13687
13688 2003-07-10  Martin Baulig  <martin@ximian.com>
13689
13690         * expression.cs (TypeOfVoid): New class.
13691         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13692
13693 2003-07-10  Martin Baulig  <martin@ximian.com>
13694
13695         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13696         bug #35957.
13697
13698 2003-07-10  Martin Baulig  <martin@ximian.com>
13699
13700         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13701         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13702
13703         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13704
13705         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13706
13707 2003-07-10  Martin Baulig  <martin@ximian.com>
13708
13709         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13710         of decimal.  Fixes #42850.
13711
13712         NOTE: I also fixed the created byte blob, but this doesn't work on
13713         the MS runtime and csc never produces any byte blobs for decimal
13714         arrays.
13715
13716 2003-07-10  Martin Baulig  <martin@ximian.com>
13717
13718         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13719         structs; fixes #32068.
13720         (Block.AddChildVariableNames): Fixed #44302.
13721
13722 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13723
13724         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13725
13726 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13727
13728         * attribute.cs: And this test is onger needed.
13729
13730 2003-07-08  Martin Baulig  <martin@ximian.com>
13731
13732         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13733         inaccessible types.  Fixes #36313.
13734
13735         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13736
13737         * namespace.cs (NamespaceEntry): Create implicit entries for all
13738         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13739         implicit entries for N1.N2 and N1.
13740
13741 2003-07-08  Martin Baulig  <martin@ximian.com>
13742
13743         Rewrote the handling of namespaces to fix a lot of the issues
13744         wrt. `using' aliases etc.
13745
13746         * namespace.cs (Namespace): Splitted this class into a
13747         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13748
13749         * typemanager.cs (TypeManager.IsNamespace): Removed.
13750         (TypeManager.ComputeNamespaces): Only compute namespaces from
13751         loaded assemblies here, not the namespaces from the assembly we're
13752         currently compiling.
13753
13754 2003-07-08  Martin Baulig  <martin@ximian.com>
13755
13756         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13757
13758 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13759
13760         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13761         already fixed it.  
13762
13763         I thought about the memory savings here, but LookupTypeReflection
13764         is used under already very constrained scenarios.  Compiling
13765         corlib or mcs only exposes one hit, so it would not really reduce
13766         any memory consumption.
13767
13768 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13769
13770         * typemanager.cs: fixes bug #45889 by only adding public types from
13771         other assemblies to the list of known types.
13772
13773 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13774
13775         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13776         on the type we resolved.
13777
13778 2003-07-05  Martin Baulig  <martin@ximian.com>
13779
13780         * pending.cs (PendingImplementation.ParentImplements): Don't
13781         create the proxy if the parent is abstract.
13782
13783         * class.cs (TypeContainer.DefineIndexers): Process explicit
13784         interface implementations first.  Fixes #37714.
13785
13786 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13787
13788         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13789         defined recursively;  but since we modify the input parameters
13790         (left is set to `this' temporarily), we reset this value if the
13791         left_is_explicit is false, which gives the original semantics to
13792         the code.  
13793
13794         * literal.cs (NullPointer): new class used to represent a null
13795         literal in a pointer context.
13796
13797         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13798         type is a pointer, use a NullPointer object instead of a
13799         NullLiteral.   Closes 43687
13800
13801         (ExplicitConversion): Convert pointer values using
13802         the conv opcode to the proper type.
13803
13804         * ecore.cs (New): change ValueTypeVariable property into a method,
13805         that returns whether the valuetype is suitable for being used.
13806
13807         * expression.cs (Binary.DoNumericPromotions): Only return if we
13808         the int constant was a valid uint, and we can return both left and
13809         right as uints.  If not, we continue processing, to trigger the
13810         type conversion.  This fixes 39018.
13811
13812         * statement.cs (Block.EmitMeta): During constant resolution, set
13813         the CurrentBlock property on the emitcontext, so that we resolve
13814         constants propertly.
13815
13816 2003-07-02  Martin Baulig  <martin@ximian.com>
13817
13818         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13819         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13820
13821         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13822         than emitting it here.
13823
13824         * statement.cs: Fixed some more flow analysis bugs.
13825
13826 2003-07-02  Martin Baulig  <martin@ximian.com>
13827
13828         * class.cs (MethodData.Define): When implementing interface
13829         methods, set Final unless we're Virtual.
13830
13831         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13832         check work for interface methods.
13833
13834 2003-07-01  Martin Baulig  <martin@ximian.com>
13835
13836         * ecore.cs (EmitContext.This): Replaced this property with a
13837         GetThis() method which takes a Location argument.  This ensures
13838         that we get the correct error location for a CS0188.
13839
13840 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13841
13842         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13843         ImplicitStandardConversion.
13844
13845         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13846
13847 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13848
13849         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13850         optimization.
13851
13852 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13853
13854         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13855         constructors.
13856
13857         (MethodData.Define): Turn off initlocals for unsafe methods.
13858
13859 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13860
13861         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13862         complete;  Fixes #37521.
13863
13864         * delegate.cs: Use Modifiers.TypeAttr to compute the
13865         TypeAttributes, instead of rolling our own.  This makes the flags
13866         correct for the delegates.
13867
13868 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13869
13870         * class.cs (Constructor.Define): Set the private flag for static
13871         constructors as well.
13872
13873         * cs-parser.jay (statement_expression): Set the return value to
13874         null, to avoid a crash when we catch an error.
13875
13876 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13877
13878         * cs-parser.jay: Applied patch from Jackson that adds support for
13879         extern and unsafe modifiers to destructor declarations.
13880
13881         * expression.cs: Report error 21 if the user is trying to index a
13882         System.Array.
13883
13884         * driver.cs: Add an error message, suggested by the bug report.
13885
13886         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13887         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13888
13889 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13890
13891         * namespace.cs: Add some information to reduce FAQs.
13892
13893 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13894
13895         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13896         underlying enumeration types.  Fixes #43915.
13897
13898         * expression.cs: Treat ushort/short as legal values to be used in
13899         bitwise operations.
13900
13901 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13902
13903         * delegate.cs: transfer custom attributes for paramenters from
13904         the delegate declaration to Invoke and BeginInvoke.
13905
13906 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13907
13908         * attribute.cs: handle custom marshalers and emit marshal info
13909         for fields, too.
13910
13911 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13912
13913         * makefile.gnu: Added anonymous.cs to the compiler sources.
13914
13915 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13916
13917         * iterators.cs: Change the name of the proxy class to include two
13918         underscores.
13919
13920         * cs-parser.jay: Update grammar to include anonymous methods.
13921
13922         * anonymous.cs: new file.
13923
13924 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * class.cs (Field.Define): Add missing test for pointers and
13927         safety. 
13928
13929 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13930
13931         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13932         we use the stobj opcode.
13933
13934         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13935         since it wasn't the correct fix. 
13936
13937         It still is puzzling that we are required to use stobj for IntPtr
13938         which seems to be a ValueType.
13939
13940 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13941
13942         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13943         during regular simple name resolution.   Now, the trick is that
13944         instead of returning for processing the simplename, we do a
13945         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13946         contextual lookup type).   If a match is found, return that, if
13947         not, return for further composition.
13948
13949         This fixes long-standing 30485.
13950
13951         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13952         using the address to initialize an object, do an Stobj instead of
13953         using the regular Stelem.
13954
13955         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13956         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13957         Because if we are a BaseIndexerAccess that value will be true.
13958         Fixes 43643.
13959
13960         * statement.cs (GotoCase.Resolve): Return after reporting an
13961         error, do not attempt to continue. 
13962
13963         * expression.cs (PointerArithmetic.Emit): If our operand is a
13964         long, convert our constants to match the operand before
13965         multiplying.  Convert to I type before adding.   Fixes 43670.
13966
13967 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13968
13969         * enum.cs (ImplicitConversionExists) : Rename to
13970         ImplicitEnumConversionExists to remove ambiguity. 
13971
13972         * ecore.cs (NullCast): New type of cast expression class which
13973         basically is very similar to EmptyCast with the difference being
13974         it still is a constant since it is used only to cast a null to
13975         something else
13976         (eg. (string) null)
13977
13978         * convert.cs (ImplicitReferenceConversion): When casting a null
13979         literal, we return a NullCast.
13980
13981         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13982         should be around anymore.
13983
13984         The renaming (reported was slightly wrong). Corrections:
13985
13986         ConvertImplicitStandard -> ImplicitConversionStandard
13987         ConvertExplicitStandard -> ExplicitConversionStandard
13988
13989         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13990         before passing them in !
13991
13992         * convert.cs (ImplicitConversionStandard): When comparing for
13993         equal expr and target types, ensure that expr is not a
13994         NullLiteral.
13995
13996         In general, we must not be checking (expr_type ==
13997         target_type) in the top level conversion methods
13998         (ImplicitConversion, ExplicitConversion etc). This checking is
13999         done in the methods that they delegate to.
14000
14001 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14002
14003         * convert.cs: Move Error_CannotConvertType,
14004         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14005         ImplicitNumericConversion, ImplicitConversionExists,
14006         ImplicitUserConversionExists, StandardConversionExists,
14007         FindMostEncompassedType, FindMostSpecificSource,
14008         FindMostSpecificTarget, ImplicitUserConversion,
14009         ExplicitUserConversion, GetConversionOperators,
14010         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14011         TryImplicitIntConversion, Error_CannotConvertImplicit,
14012         ConvertImplicitRequired, ConvertNumericExplicit,
14013         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14014         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14015         its own file.
14016
14017         Perform the following renames:
14018
14019         StandardConversionExists -> ImplicitStandardConversionExists
14020         ConvertImplicit -> ImplicitConversion
14021         ConvertImplicitStandard -> ImplicitStandardConversion
14022         TryImplicitIntConversion -> ImplicitIntConversion
14023         ConvertImplicitRequired -> ImplicitConversionRequired
14024         ConvertNumericExplicit -> ExplicitNumericConversion
14025         ConvertReferenceExplicit -> ExplicitReferenceConversion
14026         ConvertExplicit -> ExplicitConversion
14027         ConvertExplicitStandard -> ExplicitStandardConversion
14028
14029 2003-05-19  Martin Baulig  <martin@ximian.com>
14030
14031         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14032         (TypeInfo): Added support for structs having structs as fields.
14033
14034         * ecore.cs (FieldExpr): Implement IVariable.
14035         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14036         VariableInfo for the field.
14037
14038 2003-05-18  Martin Baulig  <martin@ximian.com>
14039
14040         * expression.cs (This.DoResolve): Report a CS0027 if we're
14041         emitting a field initializer.
14042
14043 2003-05-18  Martin Baulig  <martin@ximian.com>
14044
14045         * expression.cs (This.ResolveBase): New public function.
14046         (This.DoResolve): Check for CS0188.
14047
14048         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14049         This.Resolve().
14050
14051         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14052         `instance_expression' to null if we don't have any non-static
14053         methods.
14054
14055 2003-05-18  Martin Baulig  <martin@ximian.com>
14056
14057         Reworked the way how local variables and parameters are handled by
14058         the flow analysis code.
14059
14060         * statement.cs (TypeInfo, VariableMap): New public classes.
14061         (VariableInfo): New public class.  This is now responsible for
14062         checking whether a variable has been assigned.  It is used for
14063         parameters and local variables.
14064         (Block.EmitMeta): Take the InternalParameters as argument; compute
14065         the layout of the flow vectors here.
14066         (Block.LocalMap, Block.ParameterMap): New public properties.
14067         (FlowBranching): The .ctor doesn't get the InternalParameters
14068         anymore since Block.EmitMeta() now computes the layout of the flow
14069         vector.
14070         (MyStructInfo): This class is now known as `StructInfo' and nested
14071         in `TypeInfo'; we don't access this directly anymore.
14072
14073         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14074         property and removed IsAssigned(), IsFieldAssigned(),
14075         SetAssigned() and SetFieldAssigned(); we now call them on the
14076         VariableInfo so we don't need to duplicate this code everywhere.
14077
14078         * expression.cs (ParameterReference): Added `Block block' argument
14079         to the .ctor.
14080         (LocalVariableReference, ParameterReference, This): The new
14081         VariableInfo class is now responsible for all the definite
14082         assignment stuff.
14083
14084         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14085         IsParameterAssigned, SetParameterAssigned): Removed.
14086
14087 2003-05-18  Martin Baulig  <martin@ximian.com>
14088
14089         * typemanager.cs (InitCoreTypes): Try calling
14090         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14091         the 3-args-version.  Corlib now also needs our `void_type'.
14092         (GetMethod): Added overloaded version which takes an optional
14093         `bool report_errors' to allow lookups of optional methods.
14094
14095 2003-05-12  Martin Baulig  <martin@ximian.com>
14096
14097         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14098         only used for locals and not for parameters.
14099
14100 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14101
14102         * support.cs (InternalParameters.ParameterType): Return the
14103         ExternalType of the parameter.
14104
14105         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14106         they were unused.
14107
14108 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14109
14110         * class.cs (MethodData.Define): Do not set the `newslot' on
14111         interface members, if they are also flagged as "override".
14112
14113         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14114         better code for ++i and i++.  This only works for static fields
14115         and local variables.
14116
14117         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14118         want to pull the DeclSpace out of the builder_to_declspace instead
14119         of the TypeBuilder (like in TypeContainer.FindMembers).
14120
14121         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14122         instead of LookupTypeContainer.  Fixes the crash on .NET for
14123         looking up interface members.
14124
14125         * const.cs: Create our own emit context during the Definition
14126         stage, so that constants are evaluated in the proper context, when
14127         a recursive definition happens.
14128
14129 2003-05-11  Martin Baulig  <martin@ximian.com>
14130
14131         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14132         new block for a switch section.
14133         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14134         the adding/lookup in the switch block.  Fixes #39828.
14135
14136 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14137
14138         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14139         functionality: I needed to convert the data after I had performed
14140         the add/sub operation into the operands type size.
14141
14142         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14143         pass the type for the box operation, otherwise the resulting
14144         object would have been of type object.
14145
14146         (BoxedCast): Add constructor to specify the type to box as.
14147
14148 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14149
14150         * iterators.cs: I was reusing the `count' variable inadvertently,
14151         take steps to not allow this to happen.
14152
14153 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14154
14155         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14156         by creating an array at the point where the params starts and
14157         putting all those arguments there, then adjusting the size of the
14158         array.
14159
14160 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14161
14162         * expression.cs (New.AddressOf): Implement interface
14163         IMemoryLocation.  This is used when the `new' operator is used in
14164         the context of an invocation to a method on a value type.
14165
14166         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14167         example. 
14168
14169         * namespace.cs: Also check the using aliases here.
14170
14171         * driver.cs: Move the test for using validity after the types have
14172         been entered, so we do a single pass that also includes the using
14173         aliases. 
14174
14175         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14176         in the regular case.   CreateSiblingForFinally is doing extra
14177         error checking.
14178
14179         * attribute.cs (GetAttributeArgumentExpression): Store the result
14180         on an out value, and use the return value to indicate failure
14181         instead of using null (which is a valid return for Constant.GetValue).
14182
14183         * statement.cs: Perform the analysis flow for the increment
14184         portion after the statement, because this will be the real flow of
14185         execution.  Fixes #42385
14186
14187         * codegen.cs (EmitContext.EmitArgument,
14188         EmitContext.EmitStoreArgument): New helper functions when the
14189         RemapToProxy flag is set.
14190
14191         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14192         function.
14193
14194         Add support for remapping parameters. 
14195
14196         * iterators.cs: Propagate parameter values;  Store parameter
14197         values in the proxy classes.
14198
14199 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14200
14201         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14202         need a proxy reference;  I do not know what I was thinking
14203
14204         * cs-parser.jay (constructor_initializer): catch another error,
14205         and display nice message.
14206
14207         (field_declaration): catch void field declaration
14208         to flag a better error. 
14209
14210         * class.cs (MemberBase.CheckBase): Report an error instead of a
14211         warning if a new protected member is declared in a struct. 
14212         (Field.Define): catch the error of readonly/volatile.
14213
14214         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14215
14216         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14217         volatile variable is taken
14218
14219 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14220
14221         * statement.cs (Fixed.Resolve): Report an error if we are not in
14222         an unsafe context.
14223
14224 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14225
14226         * typemanager.cs: reuse the code that handles type clashes for
14227         delegates and enumerations.
14228
14229         * class.cs (Report28): Always report.
14230
14231         * expression.cs (EncodeAsAttribute): Allow nulls here.
14232
14233 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14234
14235         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14236         the functionality for testing whether an expression is valid for
14237         an attribute here.  Also handle the case of arrays of elements
14238         being stored. 
14239
14240         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14241         encoding a linear array into an array of objects that are suitable
14242         to be passed to an CustomAttributeBuilder.
14243
14244         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14245
14246         * ecore.cs: (FieldExpr): Handle field remapping here.
14247
14248         * iteratators.cs: Pass the instance variable (if the method is an
14249         instance method) to the constructors, so we can access the field
14250         variables on the class.
14251
14252         TODO: Test this with structs.  I think the THIS variable on
14253         structs might have to be a pointer, and not a refenrece
14254
14255 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14256
14257         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14258         local variables to fields in a proxy class.
14259
14260         * iterators.cs (PopulateProxy): Rename our internal fields to
14261         <XXX>.  
14262         Create a <THIS> field if we are an instance method, so we can
14263         reference our parent container variables.
14264         (MapVariable): Called back from the EmitContext code to enter a
14265         new variable to field mapping into the proxy class (we just create
14266         a FieldBuilder).
14267
14268         * expression.cs
14269         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14270         for using the remapped locals to fields.
14271
14272         I placed the code here, because that gives the same semantics to
14273         local variables, and only changes the Emit code.
14274
14275         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14276         statements inside iterators.
14277         (VariableInfo): Add a FieldBuilder for the cases when we are
14278         remapping local variables to fields in a proxy class
14279
14280         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14281         current_block != null.
14282
14283         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14284         not cope with strings, as it has been moved to the
14285         TableSwitchEmit.  Fixed bug in switch generation.
14286
14287         * expression.cs (New.DoResolve): Provide more context for the user
14288         when reporting an error.
14289
14290         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14291         pointers. 
14292
14293         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14294         check the permissions for it.  Note than in a type-resolution
14295         context the check was already present in DeclSpace.ResolveType,
14296         but was missing from the MemberAccess.
14297
14298         (ArrayCreation.CheckIndices): warn if the user has
14299         more nested levels of expressions, but there are no more
14300         dimensions specified.  Avoids crash on bug 41906.
14301
14302 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14303
14304         * statement.cs (Block): replace Implicit bool, for a generic
14305         flags.   
14306         New flag: `Unchecked'.  This is used during the EmitMeta phase
14307         (which is out-of-line with the regular Resolve/Emit process for a
14308         statement, as this is done ahead of time, but still gets a chance
14309         to call constant resolve).
14310
14311         (Block.Flags): new enum for adding a new flag.
14312
14313         (Block.EmitMeta): track the state of unchecked.
14314
14315         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14316         to enable constant resolution to work there as well.
14317
14318 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * typemanager.cs (ienumerable_type): Also look up
14321         System.Collections.IEnumerable. 
14322
14323 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14324
14325         TODO: Test more than one conditional per method.
14326
14327         * class.cs (Indexer.Define): Report the location where the user is
14328         referencing the unsupported feature.
14329
14330         (MethodData): Overload the use of `conditionals' to
14331         minimize the creation of needless ArrayLists.   This saves roughly
14332         212kb on my machine.
14333
14334         (Method): Implement the new IIteratorContainer interface.
14335         (Method.SetYields): Implement the method by setting the ModFlags
14336         to contain METHOD_YIELDS.
14337
14338         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14339         which just got set to null.
14340
14341         * iterators.cs: New file.
14342
14343         (Yield, YieldBreak): New statements.
14344
14345         * statement.cs (Return.Resolve): Flag an error if we are used in
14346         an iterator method.
14347
14348         * codegen.cs (InIterator): New flag set if the code is being
14349         compiled in an iterator method.
14350
14351         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14352         internal modifier, and we just use it to avoid adding extra
14353         fields, as this is seldom used.  
14354
14355         * cs-parser.jay: Add yield_statement (yield and yield break).
14356
14357         * driver.cs: New flag -v2 to turn on version 2 features. 
14358
14359         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14360         hashtable when v2 is enabled.
14361
14362 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14363
14364         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14365         there is already a namespace defined with this name.
14366
14367         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14368         people upgraded their corlibs.
14369
14370         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14371         always use fully qualified types, no need to use the compiler
14372         front end.
14373
14374         (TypeManager.IsNamespace): Use binarysearch.
14375
14376         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14377         AddDelegate): I did not quite use the new IsValid API properly: I
14378         have to pass the short-name and the fullname.  I was passing only
14379         the basename instead of the fullname sometimes. 
14380
14381         (TypeContainer.DefineType): call NamespaceClash.
14382
14383         * interface.cs (Interface.DefineType): use NamespaceClash before
14384         defining the type.
14385
14386         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14387         defining the type.
14388
14389         * enum.cs: (Enum.DefineType): use NamespaceClash before
14390         defining the type.
14391
14392         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14393         speed increase.  First, use the negative_hits cache when we get a
14394         negative.  Second, add the type with its full original name
14395         instead of the new . and + encoded name (reflection uses + to
14396         separate type from a nested type).  Use LookupTypeReflection
14397         directly which bypasses the type->name hashtable (that we already
14398         know does not contain the type.
14399
14400         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14401         location/container type. 
14402
14403         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14404
14405 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14406
14407         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14408
14409         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14410         method is being referenced in the method group from a static
14411         context, and report error 120 if so.
14412
14413         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14414         Error118. 
14415
14416         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14417         is created, we create the A namespace).
14418
14419         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14420         Fixes #41591
14421
14422 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14423
14424         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14425         invocation to ModuleBuilder.GetType with the same values will
14426         return a new type instance, so we need to cache its return
14427         values. 
14428
14429         * expression.cs (Binary.ResolveOperator): Only allow the compare
14430         operators on enums if they are of the same type.
14431
14432         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14433         types of ValueType on their own case.  Before we were giving them
14434         the same treatment as objects.
14435
14436         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14437         fullname.  Short name is used to compare against container name.
14438         Fullname is used to check against defined namespace names.
14439
14440         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14441         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14442
14443         (Method.CheckBase): Call parent.
14444         (MemberBase.CheckBase): Check for protected members on sealed
14445         classes.
14446         (PropertyBase.CheckBase): Call parent.
14447         (Field.Define): Call parent.
14448
14449         * report.cs: Negative error codes are now mapped to 8000 - code,
14450         so that the display is render more nicely.
14451
14452         * typemanager.cs: Do not use try/catch, instead report a regular
14453         error. 
14454
14455         (GetPointerType, GetReferenceType): These methods provide
14456         mechanisms to obtain the T* and T& from a T.  We had the code
14457         previously scattered around the code base, and it also used
14458         TypeManager.LookupType that would go through plenty of caches.
14459         This one goes directly to the type source.
14460
14461         In some places we did the Type.GetType followed by
14462         ModuleBuilder.GetType, but not in others, so this unifies the
14463         processing as well.
14464
14465         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14466         statements now that we have namespace information.
14467
14468         * typemanager.cs (IsNamespace): New method, returns whether the
14469         string presented is a namespace or not.
14470
14471         (ComputeNamespaces): New public entry point, computes the list of
14472         available namespaces, using the GetNamespaces API call in Mono, or
14473         the slower version in MS.NET.   
14474
14475         Now before we start the semantic analysis phase, we have a
14476         complete list of namespaces including everything that the user has
14477         provided.
14478
14479         Deleted old code to cache namespaces in .nsc files.
14480
14481 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14482
14483         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14484         class/struct location definition Location for the implicit
14485         constructor location.
14486
14487         (Operator.Define): Use the location of the operator for the
14488         implicit Method definition.
14489
14490         (Constructor.Emit): use the constructor location for the implicit
14491         base initializer constructor.
14492
14493         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14494         and the Expression class now contains two new methods:
14495
14496         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14497         isolate type lookup from the rest of the resolution process.
14498
14499         Since we use Expressions to hold type definitions due to the way
14500         we parse the input we have historically overloaded Resolve to
14501         perform the Type lookups if a special flag is passed.  Now this is
14502         eliminated and two methods take their place. 
14503
14504         The differences in the two methods between xStep and xTerminal is
14505         that xStep is involved in our current lookup system that uses
14506         SimpleNames to compose a name, while xTerminal is used just to
14507         catch the case where the simplename lookup failed.
14508
14509 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14510
14511         * expression.cs (ResolveMemberAccess): Remove redundant code.
14512         TypeExpr expressions are always born fully resolved.
14513
14514         * interface.cs (PopulateMethod): Do not lookup the types twice.
14515         We were doing it once during SemanticAnalysis and once during
14516         PopulateMethod.
14517
14518         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14519         in local variable type definitions, were being returned as a
14520         SimpleName (we decomposed everything into a string), that is
14521         because primary_expression was being used instead of a type in the
14522         grammar (reduce/reduce conflicts).
14523
14524         The part that was wrong is that we converted the expression into a
14525         string (an oversimplification in one hand, compounded with primary
14526         expressions doing string concatenation).
14527
14528         So things like:
14529
14530         A.B.C [] x;
14531
14532         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14533         using clauses from working on this particular context.  And a type
14534         was being matched directly against "A.B.C[]".
14535
14536         We now use the correct approach, and allow for ComposedCast to be
14537         part of the unary expression.  So the "A.B.C []" become a composed
14538         cast of "A.B.C" (as a nested group of MemberAccess with a
14539         SimpleName at the end) plus the rank composition "[]". 
14540
14541         Also fixes 35567
14542
14543 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14544
14545         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14546         for the access level checking.
14547
14548         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14549         `TypeContainer container', because I kept getting confused when I
14550         was debugging this code.
14551
14552         * expression.cs (Indexers): Instead of tracking getters/setters,
14553         we now track them in parallel.  We create one arraylist less, but
14554         most importantly it is possible now for the LValue code to find a
14555         matching get for a set.
14556
14557         (IndexerAccess.DoResolveLValue): Update the code.
14558         GetIndexersForType has been modified already to extract all the
14559         indexers from a type.  The code assumed it did not.
14560
14561         Also make the code set the correct return type for the indexer.
14562         This was fixed a long time ago for properties, but was missing for
14563         indexers.  It used to be void_type.
14564
14565         (Binary.Emit): Test first for doubles instead of
14566         floats, as they are more common.
14567
14568         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14569         when dealing with floats and the <=, >= operators.  This fixes bug
14570         #39314 
14571
14572         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14573         to load the array value by emitting a load on the foreach variable
14574         type.  This was incorrect.  
14575
14576         We now emit the code to load an element using the the array
14577         variable type, and then we emit the conversion operator.
14578
14579         Fixed #40176
14580
14581 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14582
14583         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14584
14585 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14586
14587         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14588         test for protection before we test for signatures. 
14589
14590         (MethodSignature.ToString): implement.
14591
14592         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14593         to the case where we reduced into a LongConstant.
14594
14595         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14596         depend on whether the information is acurrate, because the
14597         Microsoft runtime will always claim that the array type is public,
14598         regardless of the real state.
14599
14600         If the type is a pointer, another problem happens: the type is
14601         reported as non-public in Microsoft.  
14602
14603         In both cases we have to call CheckAccessLevel recursively with
14604         the underlying type as the argument to be tested.
14605
14606 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14607
14608         * assign.cs (Assign.Emit): If we are dealing with a compound
14609         assignment expression, we should use the code path that stores the
14610         intermediate result in a temporary value.  This fixes #40903.
14611
14612         *expression.cs (Indirection.ToString): Provide ToString method for
14613         debugging. 
14614
14615 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14616
14617         * class.cs: Null out fields holding references to Block objects so
14618         they can be garbage collected.
14619
14620         * expression.cs (OverloadResolve): Remove unused local.
14621
14622 2003-04-07  Martin Baulig  <martin@ximian.com>
14623
14624         * codegen.cs (EmitContext.CurrentFile): New public field.
14625         (EmitContext.Mark): Use the CurrentFile to check whether the
14626         location is in the correct file.
14627         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14628
14629 2003-04-07  Martin Baulig  <martin@ximian.com>
14630
14631         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14632
14633         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14634         location.  [FIXME: The location argument which gets passed to this
14635         method is sometimes wrong!]
14636
14637 2003-04-07  Nick Drochak <ndrochak@gol.com>
14638
14639         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14640
14641 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * expression.cs (Indirection.EmitAssign): We were using the
14644         temporary, but returning immediately instead of continuing the
14645         EmitAssing flow.
14646
14647 2003-04-06  Martin Baulig  <martin@ximian.com>
14648
14649         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14650         if it's a nested child, but also deriving from the outer class.
14651         See test 190.cs.
14652
14653         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14654         nested child, but also deriving from the outer class.  See
14655         test-190.cs.
14656         (FilterWithClosure): We may access private members of the outer
14657         class if we're a nested child and deriving from the outer class.
14658         (RealMemberLookup): Only set `closure_private_ok' if the
14659         `original_bf' contained BindingFlags.NonPublic.
14660
14661 2003-04-05  Martin Baulig  <martin@ximian.com>
14662
14663         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14664         probe if its a type parameter, and if so, flag an error.
14665
14666         * decl.cs: Move here the SetParameterInfo code from class.cs.
14667         Handle IsGeneric here.
14668
14669         Handle a variety of errors in the parameter info definition.
14670
14671         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14672         type parameters here.
14673
14674         * cs-parser.jay (class_declaration): report errors for parameters
14675         here as well.
14676
14677 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14678
14679         * generic.cs: New file, contains support code for generics.
14680
14681         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14682         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14683
14684         Update parser for the above removals.
14685
14686         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14687         now taken care of in the parser.
14688
14689 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14690
14691         * class.cs (Event.Define): Do not allow abstract events to have
14692         initializers. 
14693
14694 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14695
14696         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14697         block in event declarations.
14698
14699         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14700         value type, get its address.
14701
14702         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14703         leaving a class on the stack instead of a boolean value (int
14704         0/1).  Change the code so we compare against null, and then the
14705         result against zero.
14706
14707         * class.cs (TypeContainer.GetClassBases): We were checking for the
14708         parent class being sealed too late.
14709
14710         * expression.cs (Binary.Emit): For <= and >= when dealing with
14711         floating point values, use cgt.un and clt.un instead of cgt and
14712         clt alone.
14713
14714 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14715
14716         * statement.cs: Apply the same optimization as MS: skip the 
14717         GetEnumerator returning an IEnumerator, and use the one returning a 
14718         CharEnumerator instead. This allows us to avoid the try-finally block 
14719         and the boxing.
14720
14721 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14722
14723         * cs-parser.jay: Attributes cannot be applied to
14724                          namespaces. Fixes #40473
14725
14726 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14727
14728         * class.cs:
14729         (Add*): check if the name is valid using the full name for constants,
14730         fields, properties and events.
14731
14732 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14733
14734         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14735         char constants to be part of the enumeration.
14736
14737         * expression.cs (Conditional.DoResolve): Add support for operator
14738         true. Implements the missing functionality from 14.12
14739
14740         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14741         operator true/false as required by the spec.
14742
14743         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14744         implicit conversion to boolean.
14745
14746         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14747         also one where the type implements `operator true'. 
14748
14749         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14750         get an expression that will invoke operator true based on an
14751         expression.  
14752
14753         (GetConversionOperators): Removed the hack that called op_True
14754         here.  
14755
14756         (Expression.ResolveBoolean): Move this from Statement.
14757
14758 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14759
14760         * ecore.cs (FieldExpr): do not allow initialization of initonly
14761         fields on derived classes
14762
14763 2003-03-13  Martin Baulig  <martin@ximian.com>
14764
14765         * statement.cs (Block.Emit): Call ig.BeginScope() and
14766         ig.EndScope() when compiling with debugging info; call
14767         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14768
14769 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14770
14771         * expression.cs (Indexers): Do not construct immediately, allow
14772         for new members to be appended as we go.  Fixes 38143
14773
14774 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14775
14776         * expression.cs: save/restore context when resolving an unchecked
14777         expression.
14778
14779 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14780
14781         * cfold.cs: Catch division by zero in modulus operator during
14782         constant folding.
14783
14784 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14785
14786         * interface.cs (Interface.DefineMembers): Avoid defining members
14787         twice. 
14788
14789 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14790
14791         * driver.cs: handle the +/- options for -noconfig
14792
14793         * statement.cs (Unckeched.Resolve): Also track the state of
14794         unchecked in the Resolve phase.
14795
14796 2003-02-27  Martin Baulig  <martin@ximian.com>
14797
14798         * ecore.cs (Expression.MemberLookup): Don't create a
14799         MethodGroupExpr for something which is not a method.  Fixes #38291.
14800
14801 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14802
14803         * class.cs (MemberBase.CheckParameters): Also check that the type
14804         is unmanaged if it is a pointer.
14805
14806         * expression.cs (SizeOf.Resolve): Add location information.
14807
14808         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14809         a managed type is declared.
14810
14811         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14812         parameter modifiers as well.  Fixes bug 38606
14813
14814         * class.cs: Very sad.  Am backing out the speed up changes
14815         introduced by the ArrayList -> Array in the TypeContainer, as they
14816         were not actually that much faster, and introduced a bug (no error
14817         reports on duplicated methods).
14818
14819         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14820         source first, this will guarantee that we have a valid expression
14821         before calling in lower levels functions that will require a
14822         resolved object.  Then use this original_source in the
14823         target.ResolveLValue instead of the original source that was
14824         passed to us.
14825
14826         Another change.  Use target.Resolve instead of LValueResolve.
14827         Although we are resolving for LValues, we will let the Assign code
14828         take care of that (it will be called again from Resolve).  This
14829         basically allows code like this:
14830
14831         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14832         class Y { void A (X x) { x [0] += o; }
14833
14834         The problem was that the indexer was trying to resolve for
14835         set_Item (idx, object o) and never finding one.  The real set_Item
14836         was set_Item (idx, X).  By delaying the process we get the right
14837         semantics. 
14838
14839         Fixes bug 36505
14840
14841 2003-02-23  Martin Baulig  <martin@ximian.com>
14842
14843         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14844         while calling DoEmit ().
14845
14846         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14847         source files; if you use the #line directive inside a method, the
14848         compiler stops emitting line numbers for the debugger until it
14849         reaches the end of the method or another #line directive which
14850         restores the original file.
14851
14852 2003-02-23  Martin Baulig  <martin@ximian.com>
14853
14854         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14855
14856 2003-02-23  Martin Baulig  <martin@ximian.com>
14857
14858         * statement.cs (Block.AddChildVariableNames): We need to call this
14859         recursively, not just for our immediate children.
14860
14861 2003-02-23  Martin Baulig  <martin@ximian.com>
14862
14863         * class.cs (Event.Define): Always make the field private, like csc does.
14864
14865         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14866         actually work, fixes bug #37521.
14867
14868 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14869
14870         * delegate.cs: When creating the various temporary "Parameters"
14871         classes, make sure that we call the ComputeAndDefineParameterTypes
14872         on those new parameters (just like we do with the formal ones), to
14873         allow them to be resolved in the context of the DeclSpace.
14874
14875         This fixes the bug that Dick observed in Bugzilla #38530.
14876
14877 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14878
14879         * expression.cs (ResolveMemberAccess): When resolving a constant,
14880         do not attempt to pull a constant if the value was not able to
14881         generate a valid constant.
14882
14883         * const.cs (LookupConstantValue): Do not report more errors than required.
14884
14885 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14886
14887         * expression.cs: fixes bug #38328.
14888
14889 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14890
14891         * class.cs: Changed all the various members that can be part of a
14892         class from being an ArrayList to be an Array of the right type.
14893         During the DefineType type_list, interface_list, delegate_list and
14894         enum_list are turned into types, interfaces, delegates and enums
14895         arrays.  
14896
14897         And during the member population, indexer_list, event_list,
14898         constant_list, field_list, instance_constructor_list, method_list,
14899         operator_list and property_list are turned into their real arrays.
14900
14901         Although we could probably perform this operation earlier, for
14902         good error reporting we need to keep the lists and remove the
14903         lists for longer than required.
14904
14905         This optimization was triggered by Paolo profiling the compiler
14906         speed on the output of `gen-sample-program.pl' perl script. 
14907
14908         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14909         not crash in methods like MemberLookupFailed that use this field.  
14910
14911         This problem arises when the compiler fails to resolve a type
14912         during interface type definition for example.
14913
14914 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14915
14916         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14917         inherit from System.Object, so we have to stop at null, not only
14918         when reaching System.Object.
14919
14920 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14921
14922         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14923         DeclaredOnly because the parent indexer might have had a different
14924         name, but did not loop until the top of the hierarchy was reached.
14925
14926         The problem this one fixes is 35492: when a class implemented an
14927         indexer from an interface, we were getting the interface method
14928         (which was abstract) and we were flagging an error (can not invoke
14929         abstract method).
14930
14931         This also keeps bug 33089 functioning, and test-148 functioning.
14932
14933         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14934         out if a method is special is to see if it is declared in a
14935         property or event, or whether it is one of the predefined operator
14936         names.   This should fix correctly #36804.
14937
14938 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14939
14940         The goal here is to remove the dependency on EmptyCast.Peel ().
14941         Killing it completely.
14942
14943         The problem is that currently in a number of places where
14944         constants are expected, we have to "probe" for an EmptyCast, and
14945         Peel, which is not the correct thing to do, as this will be
14946         repetitive and will likely lead to errors. 
14947
14948         The idea is to remove any EmptyCasts that are used in casts that
14949         can be reduced to constants, so we only have to cope with
14950         constants. 
14951
14952         This bug hunt was triggered by Bug 37363 and the desire to remove
14953         the duplicate pattern where we were "peeling" emptycasts to check
14954         whether they were constants.  Now constants will always be
14955         constants.
14956
14957         * ecore.cs: Use an enumconstant here instead of wrapping with
14958         EmptyCast.  
14959
14960         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14961         throwing me off.  By handling this we can get rid of a few hacks.
14962
14963         * statement.cs (Switch): Removed Peel() code.
14964
14965 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14966
14967         * class.cs: Location information for error 508
14968
14969         * expression.cs (New.DoResolve): Add a guard against double
14970         resolution of an expression.  
14971
14972         The New DoResolve might be called twice when initializing field
14973         expressions (see EmitFieldInitializers, the call to
14974         GetInitializerExpression will perform a resolve on the expression,
14975         and later the assign will trigger another resolution
14976
14977         This leads to bugs (#37014)
14978
14979         * delegate.cs: The signature for EndInvoke should contain any ref
14980         or out parameters as well.  We were not doing this in the past. 
14981
14982         * class.cs (Field.Define): Do not overwrite the type definition
14983         inside the `volatile' group.  Turns out that volatile enumerations
14984         were changing the type here to perform a validity test, which
14985         broke conversions. 
14986
14987 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14988
14989         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14990         and structs, we do not want to load the instance variable
14991
14992         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14993         enum_type has to be handled like an object reference (implicit
14994         conversions exists from this to object), but the regular IsClass
14995         and IsValueType tests will never return true for this one.
14996
14997         Also we use TypeManager.IsValueType instead of type.IsValueType,
14998         just for consistency with the rest of the code (this is only
14999         needed if we ever use the construct exposed by test-180.cs inside
15000         corlib, which we dont today).
15001
15002 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15003
15004         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15005         just InternalCall.
15006
15007 2003-02-09  Martin Baulig  <martin@ximian.com>
15008
15009         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15010         (Namespace.DefineNamespaces): New static public method; this is
15011         called when we're compiling with debugging to add all namespaces
15012         to the symbol file.
15013
15014         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15015         pass it to the Namespace's .ctor.
15016
15017         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15018         and MethodBase arguments; pass the namespace ID to the symwriter;
15019         pass the MethodBase instead of the token to the symwriter.
15020         (SymbolWriter.DefineNamespace): New method to add a namespace to
15021         the symbol file.
15022
15023 2003-02-09  Martin Baulig  <martin@ximian.com>
15024
15025         * symbolwriter.cs: New file.  This is a wrapper around
15026         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15027         methods here in near future.
15028
15029 2003-02-09  Martin Baulig  <martin@ximian.com>
15030
15031         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15032         ILGenerator.MarkSequencePoint() which are actually used by the
15033         symbol writer.
15034
15035 2003-02-09  Martin Baulig  <martin@ximian.com>
15036
15037         * location.cs (SourceFile): New public sealed class.  This
15038         contains the name and an index which is used in the location's token.
15039         (Location): Reserve an appropriate number of bits in the token for
15040         the source file instead of walking over that list, this gives us a
15041         really huge performance improvement when compiling with debugging.
15042
15043         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15044         `SourceFile' argument instead of a string.
15045         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15046         but don't parse/tokenize here, we need to generate the list of all
15047         source files before we do that.
15048         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15049         the files.
15050
15051         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15052         instead of a string.
15053
15054         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15055         of a string.
15056
15057 2003-02-09  Martin Baulig  <martin@ximian.com>
15058
15059         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15060         filename on `#line default'.
15061
15062 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15063
15064         * statement.cs: don't clear the pinned var when the fixed statement
15065         returns from the method (fixes bug#37752).
15066
15067 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15068
15069         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15070         to IsValueType.
15071
15072 2003-02-07  Martin Baulig  <martin@ximian.com>
15073
15074         * driver.cs: Removed the `--debug-args' command line argument.
15075
15076         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15077         automatically by the AsssemblyBuilder.
15078         (CodeGen.InitializeSymbolWriter): We don't need to call any
15079         initialization function on the symbol writer anymore.  This method
15080         doesn't take any arguments.
15081
15082 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15083
15084         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15085         from referenced assemblies as well.
15086
15087 2003-02-02  Martin Baulig  <martin@ximian.com>
15088
15089         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15090
15091 2003-02-02  Martin Baulig  <martin@ximian.com>
15092
15093         * class.cs (Constructor.Emit): Open the symbol writer before
15094         emitting the constructor initializer.
15095         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15096         single-stepping through constructor initializers.
15097
15098 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15099
15100         * class.cs: Handle error 549: do not allow virtual methods in
15101         sealed classes. 
15102
15103 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15104
15105         * decl.cs: Check access levels when resolving types
15106
15107 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15108
15109         * statement.cs: Add parameters and locals set in catch blocks that might 
15110         return to set vector
15111
15112 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * class.cs (Operator): Set the SpecialName flags for operators.
15115
15116         * expression.cs (Invocation.DoResolve): Only block calls to
15117         accessors and operators on SpecialName methods.
15118
15119         (Cast.TryReduce): Handle conversions from char constants.
15120
15121
15122 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15123
15124         * statement.cs: small memory and time optimization in FlowBranching.
15125
15126 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15127
15128         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15129         problem that the last fix but in the other sid (Set).
15130
15131         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15132         access when there is no indexer in the hierarchy.
15133
15134 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15135
15136         * class.cs: Combine some if statements.
15137
15138 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15139
15140         * driver.cs: fixed bug #37187.
15141
15142 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15143
15144         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15145         any indexer, it's needed to build a list with all the indexers in the
15146         hierarchy (AllGetters), else we have problems. Fixes #35653.
15147
15148 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15149
15150         * class.cs (MethodData.Define): It is wrong for an interface
15151         implementation to be static in both cases: explicit and implicit.
15152         We were only handling this in one case.
15153
15154         Improve the if situation there to not have negations.
15155
15156         * class.cs (Field.Define): Turns out that we do not need to check
15157         the unsafe bit on field definition, only on usage.  Remove the test.
15158
15159 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15160
15161         * driver.cs: use assembly.Location instead of Codebase (the latest
15162         patch made mcs fail when using MS assemblies).
15163
15164 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15165
15166         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15167         get the path to *corlib.dll.
15168
15169 2003-01-21  Nick Drochak <ndrochak@gol.com>
15170
15171         * cs-tokenizer.cs:
15172         * pending.cs:
15173         * typemanager.cs: Remove compiler warnings
15174
15175 2003-01-20  Duncan Mak  <duncan@ximian.com>
15176
15177         * AssemblyInfo.cs: Bump the version number to 0.19.
15178
15179 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15180
15181         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15182
15183 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15184
15185         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15186
15187 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15188
15189         * cs-parser.jay: Small fix: we were not comparing the constructor
15190         name correctly.   Thanks to Zoltan for the initial pointer.
15191
15192 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15193
15194         * cs-tokenizer.cs: Set file name when specified with #line
15195
15196 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15197
15198         * cs-parser.jay: Only perform the constructor checks here if we
15199         are named like the class;  This will help provider a better
15200         error.  The constructor path is taken when a type definition is
15201         not found, but most likely the user forgot to add the type, so
15202         report that rather than the constructor error.
15203
15204 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15205
15206         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15207         allocations.
15208
15209 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15210
15211         * cs-parser.jay: Add cleanup call.
15212
15213 2003-01-13  Duncan Mak  <duncan@ximian.com>
15214
15215         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15216         consistent with other methods.
15217
15218 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15219
15220         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15221
15222 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15223
15224         * attribute.cs: only set GuidAttr to true when we have a
15225         GuidAttribute.
15226
15227 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15228
15229         * ecore.cs:
15230         * expression.cs:
15231         * typemanager.cs: fixes to allow mcs compile corlib with the new
15232         Type.IsSubclassOf fix.
15233
15234 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15235
15236         * expression.cs (LocalVariableReference.DoResolve): Classify a
15237         constant as a value, not as a variable.   Also, set the type for
15238         the variable.
15239
15240         * cs-parser.jay (fixed_statement): take a type instead of a
15241         pointer_type, so we can produce a better error message later.
15242
15243         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15244         as an error.  
15245
15246         (For.DoEmit): Make inifinite loops have a
15247         non-conditional branch back.
15248
15249         (Fixed.DoEmit): First populate the pinned variables, then emit the
15250         statement, then clear the variables.  Before I was emitting the
15251         code once for each fixed piece.
15252
15253
15254 2003-01-08  Martin Baulig  <martin@ximian.com>
15255
15256         * statement.cs (FlowBranching.MergeChild): A break in a
15257         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15258
15259 2003-01-08  Martin Baulig  <martin@ximian.com>
15260
15261         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15262         lives in the same number space than `param_map'.  Fixes #36154.
15263
15264 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15265
15266         * cs-parser.jay (constructor_declaration): Set the
15267         Constructor.ModFlags before probing for it.  This makes the
15268         compiler report 514, 515 and 132 (the code was there, but got
15269         broken). 
15270
15271         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15272         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15273         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15274
15275 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15276
15277         * enum.cs: create the enum static fields using the enum type.
15278
15279 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15280
15281         * class.cs: don't try to create the ParamBuilder for the return
15282         type if it's not needed (and handle it breaking for the ms runtime
15283         anyway).
15284
15285 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15286
15287         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15288
15289 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15290
15291         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15292         the command.   This showed up while compiling the JANET source
15293         code, which used \r as its only newline separator.
15294
15295 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15296
15297         * class.cs (Method.Define): If we are an operator (because it
15298         reuses our code), then set the SpecialName and HideBySig.  #36128
15299
15300 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15301
15302         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15303         exception, report error 120 `object reference required'.
15304
15305         * driver.cs: Add --pause option, used during to measure the size
15306         of the process as it goes with --timestamp.
15307
15308         * expression.cs (Invocation.DoResolve): Do not allow methods with
15309         SpecialName to be invoked.
15310
15311 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15312
15313         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15314         number before adding it.
15315
15316 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15317
15318         * ecore.cs (StandardImplicitConversion): When in an unsafe
15319         context, we allow conversion between void * to any other pointer
15320         type. This fixes bug #35973.
15321
15322 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15323
15324         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15325         is not thrown when extensionless outputs are used 
15326
15327 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15328
15329         * rootcontext.cs: fixed compilation of corlib.
15330
15331 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15332
15333         * attribute.cs (Attributes.Contains): Add new method.
15334
15335         * class.cs (MethodCore.LabelParameters): if the parameter is an
15336         `out' parameter, check that no attribute `[In]' has been passed.
15337
15338         * enum.cs: Handle the `value__' name in an enumeration.
15339
15340 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15341
15342         * decl.cs: Added special case to allow overrides on "protected
15343         internal" methods
15344
15345 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15346
15347         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15348         since it makes much more sense.
15349
15350         (Attributes.ctor): Don't require a Location parameter.
15351
15352         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15353
15354         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15355         since we already have that information per attribute.
15356
15357         * everywhere : make appropriate changes.
15358
15359         * class.cs (LabelParameters): Write the code which actually
15360         applies attributes to the return type. We can't do this on the MS
15361         .NET runtime so we flag a warning in the case an exception is
15362         thrown.
15363
15364 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15365
15366         * const.cs: Handle implicit null conversions here too.
15367
15368 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15369
15370         * class.cs (MethodCore.LabelParameters): Remove the extra
15371         Type [] parameter since it is completely unnecessary. Instead
15372         pass in the method's attributes so that we can extract
15373         the "return" attribute.
15374
15375 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15376
15377         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15378         of ignoring it and letting the compile continue.
15379
15380         * typemanager.cs (ChangeType): use an extra argument to return an
15381         error condition instead of throwing an exception.
15382
15383 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15384
15385         * expression.cs (Unary.TryReduce): mimic the code for the regular
15386         code path.  Perform an implicit cast in the cases where we can
15387         implicitly convert to one of the integral types, and then reduce
15388         based on that constant.   This fixes bug #35483.
15389
15390 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15391
15392         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15393
15394 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15395
15396         * namespace.cs: fixed bug #35489.
15397
15398 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15399
15400         * class.cs: Remove some dead code.
15401
15402         * cs-parser.jay: Estimate the number of methods needed
15403         (RootContext.MethodCount);
15404
15405         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15406         numbers instead of StringBuilders.
15407
15408         * support.cs (PtrHashtable): Add constructor with initial size;
15409         We can now reduce reallocations of the method table.
15410
15411 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15412
15413         * attribute.cs (ApplyAttributes): Keep track of the emitted
15414         attributes on a per-target basis. This fixes bug #35413.
15415
15416 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15417
15418         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15419         default to the Windows 1252 encoding.
15420
15421         (UnixParseOption): Support version, thanks to Alp for the missing
15422         pointer. 
15423
15424         * AssemblyInfo.cs: Add nice assembly information.
15425
15426         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15427         (bug 35169).
15428
15429         * cs-parser.jay: Allow a trailing comma before the close bracked
15430         in the attribute_section production.
15431
15432         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15433         address of the instance was being taken, I will take this out,
15434         because we take the address of the object immediately here.
15435
15436 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15437
15438         * typemanager.cs (AreMultipleAllowed): Take care of the most
15439         obvious case where attribute type is not in the current assembly -
15440         stupid me ;-)
15441
15442 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15443
15444         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15445         definitions, instead of doing that afterwards.  
15446
15447         Also we use a nice little hack, depending on the constructor, we
15448         know if we are a "composed" name or a simple name.  Hence, we
15449         avoid the IndexOf test, and we avoid 
15450
15451         * codegen.cs: Add code to assist in a bug reporter to track down
15452         the source of a compiler crash. 
15453
15454 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15455
15456         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15457         types have been emitted for a given element and flag an error
15458         if something which does not have AllowMultiple set is used more
15459         than once.
15460
15461         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15462         attribute types and their corresponding AllowMultiple properties
15463
15464         (AreMultipleAllowed): Check the property for a given type.
15465
15466         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15467         property in the case we have a TypeContainer.
15468
15469         (Attributes.AddAttribute): Detect duplicates and just skip on
15470         adding them. This trivial fix catches a pretty gross error in our
15471         attribute emission - global attributes were being emitted twice!
15472
15473         Bugzilla bug #33187 is now fixed.
15474
15475 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15476
15477         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15478         instead of pp_and).
15479
15480         * expression.cs (Binary.ResolveOperator): I can only use the
15481         Concat (string, string, string) and Concat (string, string,
15482         string, string) if the child is actually a concatenation of
15483         strings. 
15484
15485 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15486
15487         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15488         context where we need a 2-character lookahead.
15489
15490         * pending.cs (PendingImplementation): Rework so we can keep track
15491         of interface types all the time, and flag those which were
15492         implemented by parents as optional.
15493
15494 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15495
15496         * expression.cs (Binary.ResolveOperator): Use
15497         String.Concat(string,string,string) or
15498         String.Concat(string,string,string,string) when possible. 
15499
15500         * typemanager: More helper methods.
15501
15502
15503 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15504
15505         * pending.cs: remove the bogus return from GetMissingInterfaces()
15506         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15507
15508 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15509
15510         * namespace.cs: avoid duplicated 'using xxx' being added to
15511         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15512         when we get more than one 'using' statement for the same namespace.
15513         Report a CS0105 warning for it.
15514
15515 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15516
15517         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15518         of calling getChar/putback, uses internal knowledge of it.    
15519
15520         (xtoken): Reorder tokenizer so most common patterns are checked
15521         first.  This reduces the compilation time in another 5% (from 8.11s
15522         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15523
15524         The parsing time is 22% of the compilation in mcs, and from that
15525         64% is spent on the tokenization process.  
15526
15527         I tried using a binary search for keywords, but this is slower
15528         than the hashtable.  Another option would be to do a couple of
15529         things:
15530
15531                 * Not use a StringBuilder, instead use an array of chars,
15532                   with a set value.  Notice that this way we could catch
15533                   the 645 error without having to do it *afterwards*.
15534
15535                 * We could write a hand-parser to avoid the hashtable
15536                   compares altogether.
15537
15538         The identifier consumption process takes 37% of the tokenization
15539         time.  Another 15% is spent on is_number.  56% of the time spent
15540         on is_number is spent on Int64.Parse:
15541
15542                 * We could probably choose based on the string length to
15543                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15544                   computations. 
15545
15546         Another 3% is spend on wrapping `xtoken' in the `token' function.
15547
15548         Handle 0xa0 as whitespace (#34752)
15549
15550 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15551
15552         * typemanager.cs (IsCLRType): New routine to tell whether a type
15553         is one of the builtin types.  
15554
15555         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15556         typecode in more places instead of doing pointer comparissions.
15557         We could leverage some knowledge about the way the typecodes are
15558         laid out.
15559
15560         New code to cache namespaces in assemblies, it is currently not
15561         invoked, to be used soon.
15562
15563         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15564
15565         * expression.cs (Binary.ResolveOperator): specially handle
15566         strings, and do not perform user-defined operator overloading for
15567         built-in types.
15568
15569 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15572         internalcall as it is a pretty simple operation;  Avoid whenever
15573         possible to call Char.IsLetter.
15574
15575         (consume_identifier): Cut by half the number of
15576         hashtable calls by merging the is_keyword and GetKeyword behavior.
15577
15578         Do not short-circuit, because if we do, we
15579         report errors (ie, #if false && true would produce an invalid
15580         directive error);
15581
15582
15583 2002-11-24  Martin Baulig  <martin@ximian.com>
15584
15585         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15586         check constant ranges and report a CS0221.  Fixes #33186.
15587
15588 2002-11-24  Martin Baulig  <martin@ximian.com>
15589
15590         * cs-parser.jay: Make this work for uninitialized variable
15591         declarations in the `for' initializer.  Fixes #32416.
15592
15593 2002-11-24  Martin Baulig  <martin@ximian.com>
15594
15595         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15596         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15597
15598 2002-11-24  Martin Baulig  <martin@ximian.com>
15599
15600         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15601         argument; if true, we also check for user-defined conversions.
15602         This is only needed if both arguments are of a user-defined type.
15603         Fixes #30443, added test-175.cs.
15604         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15605
15606         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15607
15608 2002-11-24  Martin Baulig  <martin@ximian.com>
15609
15610         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15611         function to get the store opcode.
15612         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15613         only emit the Ldelema if the store opcode is Stobj.  You must run
15614         both test-34 and test-167 to test this.  Fixes #34529.
15615
15616 2002-11-23  Martin Baulig  <martin@ximian.com>
15617
15618         * ecore.cs (Expression.MemberLookup): Added additional
15619         `qualifier_type' argument which is used when we're being called
15620         from MemberAccess.DoResolve() and null if we're called from a
15621         SimpleName lookup.
15622         (Expression.MemberLookupFailed): New method to report errors; this
15623         does the CS1540 check and reports the correct error message.
15624
15625         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15626         argument for the CS1540 check and redone the way how we're dealing
15627         with private members.  See the comment in the source code for details.
15628         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15629         `closure_start_type' to `closure_qualifier_type' and check whether
15630         it's not null.  It was not this filter being broken, it was just
15631         being called with the wrong arguments.
15632
15633         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15634         and pass it the correct `qualifier_type'; this also does the error
15635         handling for us.
15636
15637 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15638
15639         * expression.cs (Invocation.EmitParams): If the we are dealing
15640         with a non-built-in value type, load its address as well.
15641
15642         (ArrayCreation): Use a a pretty constant instead
15643         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15644         static initializers.  
15645
15646         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15647         because they are not really value types, just glorified integers. 
15648
15649         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15650
15651         * ecore.cs: Remove redundant code for enumerations, make them use
15652         the same code path as everything else, fixes the casting issue
15653         with enumerations in Windows.Forms.
15654
15655         * attribute.cs: Do only cast to string if it is a string, the
15656         validation happens later.
15657
15658         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15659         people upgrade their corlibs.
15660
15661         * ecore.cs: Oops, enumerations were not following the entire code path
15662
15663 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15664
15665         * typemanager.cs (FilterWithClosure): Commented out the test for
15666         1540 in typemanager.cs, as it has problems when accessing
15667         protected methods from a parent class (see test-174.cs). 
15668
15669         * attribute.cs (Attribute.ValidateGuid): new method.
15670         (Attribute.Resolve): Use above.
15671
15672 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15673
15674         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15675
15676         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15677         handling for enumerations, as we only needed the TypeContainer
15678         functionality to begin with (this is required for the fix below to
15679         work for enums that reference constants in a container class for
15680         example). 
15681
15682         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15683
15684         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15685         a valid TypeBuilder to perform lookups on.o
15686
15687         * class.cs (InheritableMemberSignatureCompare): Use true in the
15688         call to GetGetMethod and GetSetMethod, because we are comparing
15689         the signature, and we need to get the methods *even* if they are
15690         private. 
15691
15692         (PropertyBase.CheckBase): ditto.
15693
15694         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15695         GotoCase.Resolve): Use Peel on EmpytCasts.
15696
15697         * ecore.cs (EmptyCast): drop child, add Peel method.
15698
15699 2002-11-17  Martin Baulig  <martin@ximian.com>
15700
15701         * ecore.cs (EmptyCast.Child): New public property.
15702
15703         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15704         label resolved to an EmptyCast.  Fixes #34162.
15705         (GotoCase.Resolve): Likewise.
15706         (Block.EmitMeta): Likewise.
15707
15708 2002-11-17  Martin Baulig  <martin@ximian.com>
15709
15710         * expression.cs (Invocation.BetterConversion): Prefer int over
15711         uint; short over ushort; long over ulong for integer literals.
15712         Use ImplicitConversionExists instead of StandardConversionExists
15713         since we also need to check for user-defined implicit conversions.
15714         Fixes #34165.  Added test-173.cs.
15715
15716 2002-11-16  Martin Baulig  <martin@ximian.com>
15717
15718         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15719         with the `true' and `false' literals.  Fixes #33151.
15720
15721 2002-11-16  Martin Baulig  <martin@ximian.com>
15722
15723         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15724         October 22nd; don't do the cs1540 check for static members.
15725
15726         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15727         now using our own filter here and doing the cs1540 check again.
15728
15729 2002-11-16  Martin Baulig  <martin@ximian.com>
15730
15731         * support.cs (InternalParameters): Don't crash if we don't have
15732         any fixed parameters.  Fixes #33532.
15733
15734 2002-11-16  Martin Baulig  <martin@ximian.com>
15735
15736         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15737         when looking up static methods to make this work on Windows.
15738         Fixes #33773.
15739
15740 2002-11-16  Martin Baulig  <martin@ximian.com>
15741
15742         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15743         a setter rather than using PropertyInfo.CanWrite.
15744
15745 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15746
15747         * class.cs: Allow acces to block member by subclasses. Fixes build
15748         breaker.
15749
15750 2002-11-14  Martin Baulig  <martin@ximian.com>
15751
15752         * class.cs (Constructor.Emit): Added the extern/block check.
15753         Fixes bug #33678.
15754
15755 2002-11-14  Martin Baulig  <martin@ximian.com>
15756
15757         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15758         iteration while looking for indexers, this is needed because the
15759         indexer may have a different name in our base classes.  Fixed the
15760         error reporting (no indexers at all, not get accessor, no
15761         overloaded match).  Fixes bug #33089.
15762         (IndexerAccess.DoResolveLValue): Likewise.
15763
15764 2002-11-14  Martin Baulig  <martin@ximian.com>
15765
15766         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15767         indexers.  Fixes the first part of bug #33089.
15768         (MethodSignature.InheritableMemberSignatureCompare): Added support
15769         for properties.
15770
15771 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15772
15773         * attribute.cs (Attribute.Resolve): Catch the
15774         NullReferenceException and report it since it isn't supposed to
15775         happen. 
15776
15777 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15778
15779         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15780         LogicalOr and LogicalAnd that can benefit from recursively
15781         handling EmitBranchable.  The code now should be nice for Paolo.
15782
15783 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15786         the Type lookups, as we perform quite a number of lookups on
15787         non-Types.  This can be removed once we can deterministically tell
15788         whether we have a type or a namespace in advance.
15789
15790         But this might require special hacks from our corlib.
15791
15792         * TODO: updated.
15793
15794         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15795         and double which avoids a conversion from an integer to a double.
15796
15797         * expression.cs: tiny optimization, avoid calling IsConstant,
15798         because it effectively performs the lookup twice.
15799
15800 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15801
15802         But a bogus return here to keep the semantics of the old code
15803         until the Mono runtime is fixed.
15804
15805         * pending.cs (GetMissingInterfaces): New method used to remove all
15806         the interfaces that are already implemented by our parent
15807         classes from the list of pending methods. 
15808
15809         * interface.cs: Add checks for calls after ResolveTypeExpr.
15810
15811 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15812
15813         * class.cs (Class.Emit): Report warning 67: event not used if the
15814         warning level is beyond 3.
15815
15816         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15817         being a NullLiteral.
15818
15819         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15820         specifiers. 
15821
15822         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15823         path that might fail if a type can not be resolved.
15824
15825         * expression.cs (Binary.Emit): Emit unsigned versions of the
15826         operators. 
15827
15828         * driver.cs: use error 5.
15829
15830 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15831
15832         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15833
15834 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * cs-parser.jay (switch_section): A beautiful patch from Martin
15837         Baulig that fixed 33094.
15838
15839 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15840
15841         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15842         Check whether the base is abstract and report an error if so.
15843
15844         * expression.cs (IndexerAccess.DoResolveLValue,
15845         IndexerAccess.DoResolve): ditto. 
15846
15847         (Invocation.DoResolve): ditto.
15848
15849         (Invocation.FullMethodDesc): Improve the report string.
15850
15851         * statement.cs (Block): Eliminate IsVariableDefined as it is
15852         basically just a wrapper for GetVariableInfo.
15853
15854         * ecore.cs (SimpleName): Use new 
15855
15856         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15857         type, as we return the actual parameter ref/unref state on a
15858         different call.
15859
15860 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * support.cs: Return proper flags REF/OUT fixing the previous
15863         commit.  
15864
15865         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15866         not used to mean `ref' but `ref or out' in ParameterReference
15867
15868         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15869         full type signature instead of calling TypeManger.CSharpName
15870         ourselves. 
15871
15872         * support.cs (InternalParameters.ParameterDesc): Do not compare
15873         directly to the modflags, because REF/OUT will actually be bitsets
15874         if set. 
15875
15876         * delegate.cs (VerifyMethod): Check also the modifiers.
15877
15878         * cs-tokenizer.cs: Fix bug where floating point values with an
15879         exponent where a sign was missing was ignored.
15880
15881         * driver.cs: Allow multiple assemblies to be specified in a single
15882         /r: argument
15883
15884 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15885
15886         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15887         because identifiers after a parenthesis would end up in this kind
15888         of production, and we needed to desamiguate it for having casts
15889         like:
15890
15891                 (UserDefinedType *) xxx
15892
15893 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15896         we should set on the Bindingflags.NonPublic, but not turn on
15897         private_ok.  private_ok controls whether a Private member is
15898         returned (this is chekced on the filter routine), while the
15899         BindingFlags.NonPublic just controls whether private/protected
15900         will be allowed.   This fixes the problem part of the problem of
15901         private properties being allowed to be used in derived classes.
15902
15903         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15904         so we can call the children DoResolveLValue method (this will
15905         properly signal errors on lvalue assignments to base properties)
15906
15907         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15908         getter are null, and we have a property info, we know that this
15909         happened because the lookup failed, so we report an error 122 for
15910         protection level violation.
15911
15912         We also silently return if setter and getter are null in the
15913         resolve functions, this condition only happens if we have flagged
15914         the error before.  This is the other half of the problem. 
15915
15916         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15917         not have accessibility information, that is why we were returning
15918         true in the filter function in typemanager.cs.
15919
15920         To properly report 122 (property is inaccessible because of its
15921         protection level) correctly, we report this error in ResolveAccess
15922         by failing if both the setter and the getter are lacking (ie, the
15923         lookup failed). 
15924
15925         DoResolve and DoLResolve have been modified to check for both
15926         setter/getter being null and returning silently, the reason being
15927         that I did not want to put the knowledge about this error in upper
15928         layers, like:
15929
15930         int old = Report.Errors;
15931         x = new PropertyExpr (...);
15932         if (old != Report.Errors)
15933                 return null;
15934         else
15935                 return x;
15936
15937         So the property expr is returned, but it is invalid, so the error
15938         will be flagged during the resolve process. 
15939
15940         * class.cs: Remove InheritablePropertySignatureCompare from the
15941         class, as we no longer depend on the property signature to compute
15942         whether it is possible to implement a method or not.
15943
15944         The reason is that calling PropertyInfo.GetGetMethod will return
15945         null (in .NET, in Mono it works, and we should change this), in
15946         cases where the Get Method does not exist in that particular
15947         class.
15948
15949         So this code:
15950
15951         class X { public virtual int A { get { return 1; } } }
15952         class Y : X { }
15953         class Z : Y { public override int A { get { return 2; } } }
15954
15955         Would fail in Z because the parent (Y) would not have the property
15956         defined.  So we avoid this completely now (because the alternative
15957         fix was ugly and slow), and we now depend exclusively on the
15958         method names.
15959
15960         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15961         reference method, instead of using the property.
15962
15963         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15964         routines are gone now.
15965
15966         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15967         names, they were incorrectly named.
15968
15969         * cs-tokenizer.cs: Return are more gentle token on failure. 
15970
15971         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15972         had an out-of-sync index variable, which caused it to remove from
15973         the list of pending methods the wrong method sometimes.
15974
15975 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15976
15977         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15978         CanWrite, because those refer to this particular instance of the
15979         property, and do not take into account the fact that we can
15980         override single members of a property.
15981
15982         Constructor requires an EmitContext.  The resolution process does
15983         not happen here, but we need to compute the accessors before,
15984         because the resolution does not always happen for properties.
15985
15986         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15987         subclass, before we did not update this flag, but we did update
15988         bindingflags. 
15989
15990         (GetAccessors): Drop this routine, as it did not work in the
15991         presence of partially overwritten set/get methods. 
15992
15993         Notice that this broke the cs1540 detection, but that will require
15994         more thinking. 
15995
15996 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15997
15998         * class.cs:
15999         * codegen.cs:
16000         * driver.cs: issue a warning instead of an error if we don't support
16001         debugging for the platform. Also ignore a couple of errors that may
16002         arise when trying to write the symbols. Undo my previous patch.
16003
16004 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16005
16006         * driver.cs: ignore /debug switch except for Unix platforms.
16007
16008 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16009
16010         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16011
16012 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * driver.cs: Do not make mcs-debug conditional, so we do not break
16015         builds that use it.
16016
16017         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16018         review this patch.  But basically after all the children variables
16019         have been merged, the value of "Breaks" was not being set to
16020         new_breaks for Switch blocks.  I think that it should be set after
16021         it has executed.  Currently I set this to the value of new_breaks,
16022         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16023         conservative, but I do not understand this code very well.
16024
16025         I did not break anything in the build, so that is good ;-)
16026
16027         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16028
16029 2002-10-20  Mark Crichton  <crichton@gimp.org>
16030
16031         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16032
16033 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16034
16035         * cfold.cs: Fixed compile blocker.
16036
16037 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16038
16039         * driver.cs: I was chekcing the key, not the file.
16040
16041 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16042
16043         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16044         message that we were generating - we just need to silently return
16045         a null.
16046
16047 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16048
16049         * class.cs (Event.Define): Change my previous commit, as this
16050         breaks the debugger.  This is a temporary hack, as it seems like
16051         the compiler is generating events incorrectly to begin with.
16052
16053         * expression.cs (Binary.ResolveOperator): Added support for 
16054         "U operator - (E x, E y)"
16055
16056         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16057         y)".
16058
16059         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16060         init-only variables, but this path did not take into account that
16061         there might be also instance readonly variables.  Correct this
16062         problem. 
16063
16064         This fixes bug 32253
16065
16066         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16067         delegates as well.
16068
16069         * driver.cs: Change the extension for modules to `netmodule'
16070
16071         * cs-parser.jay: Improved slightly the location tracking for
16072         the debugger symbols.
16073
16074         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16075         modifiers that were specified instead of the hardcoded value
16076         (FamAndAssem).  This was basically ignoring the static modifier,
16077         and others.  Fixes 32429.
16078
16079         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16080         fixed a bug in the process (32476)
16081
16082         * expression.cs (ArrayAccess.EmitAssign): Patch from
16083         hwang_rob@yahoo.ca that fixes bug 31834.3
16084
16085 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16086
16087         * driver.cs: Make the module extension .netmodule.
16088
16089 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16090
16091         * driver.cs: Report an error if the resource file is not found
16092         instead of crashing.
16093
16094         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16095         false, like Emit does.
16096
16097 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16098
16099         * typemanager.cs: Remove unused private member.  Also reported mcs
16100         bug to report this as a warning like csc.
16101
16102 2002-10-15  Martin Baulig  <martin@gnome.org>
16103
16104         * statement.cs (Statement.Emit): Made this a virtual method; emits
16105         the line number info and calls DoEmit().
16106         (Statement.DoEmit): New protected abstract method, formerly knows
16107         as Statement.Emit().
16108
16109         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16110
16111 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16112
16113         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16114         have fixed a remaining problem: not every AddXXXX was adding a
16115         fully qualified name.  
16116
16117         Now everyone registers a fully qualified name in the DeclSpace as
16118         being defined instead of the partial name.  
16119
16120         Downsides: we are slower than we need to be due to the excess
16121         copies and the names being registered this way.  
16122
16123         The reason for this is that we currently depend (on the corlib
16124         bootstrap for instance) that types are fully qualified, because
16125         we dump all the types in the namespace, and we should really have
16126         types inserted into the proper namespace, so we can only store the
16127         basenames in the defined_names array.
16128
16129 2002-10-10  Martin Baulig  <martin@gnome.org>
16130
16131         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16132         from bug #31834, see the bug report for a testcase which is
16133         miscompiled.
16134
16135 2002-10-10  Martin Baulig  <martin@gnome.org>
16136
16137         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16138         flow analysis code for this.
16139
16140         * statement.cs (Do, While, For): Tell the flow analysis code about
16141         infinite loops.
16142         (FlowBranching.UsageVector): Added support for infinite loops.
16143         (Block.Resolve): Moved the dead code elimination here and use flow
16144         analysis to do it.
16145
16146 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16147
16148         * class.cs (Field.Define): Catch cycles on struct type
16149         definitions. 
16150
16151         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16152         fields if the fields are static.  We only need to check instance
16153         fields. 
16154
16155         * expression.cs (As.DoResolve): Test for reference type.
16156
16157         * statement.cs (Using.ResolveExpression): Use
16158         ConvertImplicitRequired, not ConvertImplicit which reports an
16159         error on failture
16160         (Using.ResolveLocalVariableDecls): ditto.
16161
16162         * expression.cs (Binary.ResolveOperator): Report errors in a few
16163         places where we had to.
16164
16165         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16166
16167 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16168
16169         * expression.cs: Use StoreFromPtr instead of extracting the type
16170         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16171
16172         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16173         an enumeration value to a System.Enum, but System.Enum is not a
16174         value type, but an class type, so we need to box.
16175
16176         (Expression.ConvertExplicit): One codepath could return
16177         errors but not flag them.  Fix this.  Fixes #31853
16178
16179         * parameter.cs (Resolve): Do not allow void as a parameter type.
16180
16181 2002-10-06  Martin Baulig  <martin@gnome.org>
16182
16183         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16184         if it's a class type and not a struct.  Fixes #31815.
16185
16186 2002-10-06  Martin Baulig  <martin@gnome.org>
16187
16188         * statement.cs: Reworked the flow analysis code a bit to make it
16189         usable for dead code elimination.
16190
16191 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16192
16193         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16194
16195 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16196
16197         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16198         to fix the test 165, will investigate deeper.
16199
16200 2002-10-04  Martin Baulig  <martin@gnome.org>
16201
16202         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16203         finally blocks actually work.
16204         (Try.Resolve): We don't need to create a sibling for `finally' if
16205         there is no finally block.
16206
16207 2002-10-04  Martin Baulig  <martin@gnome.org>
16208
16209         * class.cs (Constructor.Define): The default accessibility for a
16210         non-default constructor is private, not public.
16211
16212 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16213
16214         * class.cs (Constructor): Make AllowedModifiers public, add
16215         EXTERN.
16216
16217         * cs-parser.jay: Perform the modifiers test here, as the
16218         constructor for the Constructor class usually receives a zero
16219         because of the way we create it (first we create, later we
16220         customize, and we were never checking the modifiers).
16221
16222         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16223         is a version of LookupTypeReflection that includes the type-name
16224         cache.  This can be used as a fast path for functions that know
16225         the fully qualified name and are only calling into *.GetType() to
16226         obtain a composed type.
16227
16228         This is also used by TypeManager.LookupType during its type
16229         composition.
16230
16231         (LookupType): We now also track the real type name, as sometimes
16232         we can get a quey for the real type name from things like
16233         ComposedCast.  This fixes bug 31422.
16234
16235         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16236         complete type fullname, it does not have to go through the type
16237         resolution system to obtain the composed version of the type (for
16238         obtaining arrays or pointers).
16239
16240         (Conditional.Emit): Use the EmitBoolExpression to
16241         generate nicer code, as requested by Paolo.
16242
16243         (ArrayCreation.CheckIndices): Use the patch from
16244         hwang_rob@yahoo.ca to validate the array initializers. 
16245
16246 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16247
16248         * class.cs (ConstructorInitializer.Emit): simplify code by using
16249         Invocation.EmitCall, and at the same time, fix the bugs in calling
16250         parent constructors that took variable arguments. 
16251
16252         * ecore.cs (Expression.ConvertNumericExplicit,
16253         Expression.ImplicitNumericConversion): Remove the code that
16254         manually wrapped decimal (InternalTypeConstructor call is now gone
16255         as well).
16256
16257         * expression.cs (Cast.TryReduce): Also handle decimal types when
16258         trying to perform a constant fold on the type.
16259
16260         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16261
16262         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16263         that only turned off an error report, and did nothing else. 
16264
16265 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16266
16267         * driver.cs: Handle and ignore /fullpaths
16268
16269 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16270
16271         * expression.cs (Binary.ResolveOperator): Catch the case where
16272         DoNumericPromotions returns true, 
16273
16274         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16275
16276 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16277
16278         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16279         report error 70.
16280
16281 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16282
16283         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16284         conversion exists, but it is also required that the conversion be
16285         performed.  This manifested in "(Type64Enum) 2".  
16286
16287         * class.cs (TypeManager.AddMethod): The fix is not to change
16288         AddEnum, because that one was using a fully qualified name (every
16289         DeclSpace derivative does), but to change the AddMethod routine
16290         that was using an un-namespaced name.  This now correctly reports
16291         the duplicated name.
16292
16293         Revert patch until I can properly fix it.  The issue
16294         is that we have a shared Type space across all namespaces
16295         currently, which is wrong.
16296
16297         Options include making the Namespace a DeclSpace, and merge
16298         current_namespace/current_container in the parser.
16299
16300 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16301
16302         * cs-parser.jay: Improve error reporting when we get a different
16303         kind of expression in local_variable_type and
16304         local_variable_pointer_type. 
16305
16306         Propagate this to avoid missleading errors being reported.
16307
16308         * ecore.cs (ImplicitReferenceConversion): treat
16309         TypeManager.value_type as a target just like object_type.   As
16310         code like this:
16311
16312         ValueType v = 1;
16313
16314         Is valid, and needs to result in the int 1 being boxed before it
16315         is assigned to the value type v.
16316
16317         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16318         to validate the enumeration name.
16319
16320         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16321         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16322         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16323
16324         * ecore.cs (TryImplicitIntConversion): When doing an
16325         implicit-enumeration-conversion, check if the type is 64-bits and
16326         perform a conversion before passing to EnumConstant.
16327
16328 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16329
16330         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16331         report ambiguous type references.  Unlike the MS version, we
16332         report what the ambiguity is.   Innovation at work ;-)
16333
16334         (DeclSpace.FindType): Require a location argument to
16335         display when we display an ambiguous error.
16336
16337         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16338
16339         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16340
16341         * expression.cs (EmitDynamicInitializers): Apply patch from
16342         hwang_rob@yahoo.ca that fixes the order in which we emit our
16343         initializers. 
16344
16345 2002-09-21  Martin Baulig  <martin@gnome.org>
16346
16347         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16348         delegate takes no arguments.
16349
16350 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16351
16352         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16353         from integers.
16354
16355         * expression.cs: Extract the underlying type.
16356
16357         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16358
16359         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16360
16361 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * class.cs (TypeContainer.DefineType): We can not use the nice
16364         PackingSize with the size set to 1 DefineType method, because it
16365         will not allow us to define the interfaces that the struct
16366         implements.
16367
16368         This completes the fixing of bug 27287
16369
16370         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16371         means also structs.  This fixes part of the problem. 
16372         (Expresion.ImplicitReferenceConversionExists): ditto.
16373
16374         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16375         error if there were no errors reported during the type lookup
16376         process, to avoid duplicates or redundant errors.  Without this
16377         you would get an ambiguous errors plus a type not found.  We have
16378         beaten the user enough with the first error.  
16379
16380         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16381         reference. 
16382
16383         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16384         during the resolution process, stop the lookup, this avoids
16385         repeated error reports (same error twice).
16386
16387         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16388
16389         * typemanager.cs (LookupType): Redo the type lookup code to match
16390         the needs of System.Reflection.  
16391
16392         The issue is that System.Reflection requires references to nested
16393         types to begin with a "+" sign instead of a dot.  So toplevel
16394         types look like: "NameSpace.TopLevelClass", and nested ones look
16395         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16396         levels. 
16397
16398 2002-09-19  Martin Baulig  <martin@gnome.org>
16399
16400         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16401         says that a method always returns or always throws an exception,
16402         don't report the CS0161.
16403
16404         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16405         set `Returns = new_returns'.
16406
16407 2002-09-19  Martin Baulig  <martin@gnome.org>
16408
16409         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16410         to an enum constant, check for a CS0176.
16411
16412 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16413
16414         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16415         for operators that must be in pairs and report errors.
16416
16417         * ecore.cs (SimpleName.DoResolveType): During the initial type
16418         resolution process, when we define types recursively, we must
16419         check first for types in our current scope before we perform
16420         lookups in the enclosing scopes.
16421
16422         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16423
16424         (Invocation.VerifyArgumentsCompat): Call
16425         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16426         I thought we were supposed to always call this, but there are a
16427         few places in the code where we dont do it.
16428
16429 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16430
16431         * driver.cs: Add support in -linkres and -resource to specify the
16432         name of the identifier.
16433
16434 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16435
16436         * ecore.cs (StandardConversionExists): Sync with the conversion
16437         code: allow anything-* to void* conversions.
16438
16439         (FindMostSpecificSource): Use an Expression argument
16440         instead of a Type, because we might be handed over a Literal which
16441         gets a few more implicit conversions that plain types do not.  So
16442         this information was being lost.
16443
16444         Also, we drop the temporary type-holder expression when not
16445         required.
16446
16447 2002-09-17  Martin Baulig  <martin@gnome.org>
16448
16449         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16450         this is an explicit interface implementation.
16451
16452 2002-09-17  Martin Baulig  <martin@gnome.org>
16453
16454         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16455         different `IndexerName' attributes.
16456
16457         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16458         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16459         virtual CommonResolve().
16460
16461 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16462
16463         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16464         and convert that to the UnderlyingType.
16465
16466         * statement.cs (Foreach.Resolve): Indexers are just like variables
16467         or PropertyAccesses.
16468
16469         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16470         inside quoted strings, we were not doing this before.
16471
16472 2002-09-16  Martin Baulig  <martin@gnome.org>
16473
16474         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16475         resolve it.  This is needed for the definite assignment check of the
16476         instance expression, fixes bug #29846.
16477         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16478
16479 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16480
16481         * parameter.cs: Fix compile error.  Cannot reference static member
16482         from an instance object.  Is this an mcs bug?
16483
16484 2002-09-14  Martin Baulig  <martin@gnome.org>
16485
16486         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16487         multiple times.  Fixes bug #30295, added test-166.cs.
16488
16489 2002-09-14  Martin Baulig  <martin@gnome.org>
16490
16491         * statement.cs (Block.Emit): Don't emit unreachable code.
16492         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16493         `break' statements.
16494         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16495
16496 2002-09-14  Martin Baulig  <martin@gnome.org>
16497
16498         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16499         is set.
16500
16501 2002-09-14  Martin Baulig  <martin@gnome.org>
16502
16503         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16504         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16505         be false on the ms runtime.
16506
16507 2002-09-13  Martin Baulig  <martin@gnome.org>
16508
16509         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16510         the CS0038 error message.
16511
16512 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16513
16514         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16515         constant inside, return it.
16516
16517 2002-09-12  Martin Baulig  <martin@gnome.org>
16518
16519         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16520         implicit conversion can be done between enum types.
16521
16522         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16523         check whether an implicit conversion to the current enum's UnderlyingType
16524         exists and report an error if not.
16525
16526         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16527         without debugging support.
16528
16529         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16530         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16531
16532 2002-09-12  Martin Baulig  <martin@gnome.org>
16533
16534         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16535
16536         * ecore.cs (IMemberExpr.DeclaringType): New property.
16537         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16538         nonstatic member of an outer type (CS0038).
16539
16540 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * driver.cs: Activate the using-error detector at warning level
16543         4 (at least for MS-compatible APIs).
16544
16545         * namespace.cs (VerifyUsing): Small buglett fix.
16546
16547         * pending.cs (PendingImplementation): pass the container pointer. 
16548
16549         * interface.cs (GetMethods): Allow for recursive definition.  Long
16550         term, I would like to move every type to support recursive
16551         definitions, not the current ordering mechanism that we have right
16552         now.
16553
16554         The situation is this: Attributes are handled before interfaces,
16555         so we can apply attributes to interfaces.  But some attributes
16556         implement interfaces, we will now handle the simple cases
16557         (recursive definitions will just get an error).  
16558
16559         * parameter.cs: Only invalidate types at the end if we fail to
16560         lookup all types.  
16561
16562 2002-09-09  Martin Baulig  <martin@gnome.org>
16563
16564         * ecore.cs (PropertyExpr.Emit): Also check for
16565         TypeManager.system_int_array_get_length so this'll also work when
16566         compiling corlib.  Fixes #30003.
16567
16568 2002-09-09  Martin Baulig  <martin@gnome.org>
16569
16570         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16571         and throw an exception if we can't get the type's size.  Fixed #30040,
16572         added test-165.cs.
16573
16574 2002-09-09  Martin Baulig  <martin@gnome.org>
16575
16576         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16577
16578         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16579         context.  Fixes bug #30027.
16580
16581         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16582         virtual functions.  Fixes bug #30043, added test-164.cs.
16583
16584 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16585
16586         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16587
16588 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16589
16590         * driver.cs: Use an object to get the windows codepage since it's not a
16591         static property.
16592
16593 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16594
16595         * statement.cs (For.Emit): for infinite loops (test == null)
16596         return whether there is a break inside, not always "true".
16597
16598         * namespace.cs (UsingEntry): New struct to hold the name of the
16599         using definition, the location where it is defined, and whether it
16600         has been used in a successful type lookup.
16601
16602         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16603         strings.
16604
16605         * decl.cs: ditto.
16606
16607 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16608
16609         * attribute.cs : Fix incorrect code which relied on catching
16610         a NullReferenceException to detect a null being passed in
16611         where an object was expected.
16612
16613 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16614
16615         * statement.cs (Try): flag the catch variable as assigned
16616
16617         * expression.cs (Cast): Simplified by using ResolveType instead of
16618         manually resolving.
16619
16620         * statement.cs (Catch): Fix bug by using ResolveType.
16621
16622 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16623
16624         * expression.cs (BetterConversion): Special case for when we have
16625         a NullLiteral as the argument and we have to choose between string
16626         and object types - we choose string the way csc does.
16627
16628         * attribute.cs (Attribute.Resolve): Catch the
16629         NullReferenceException and report error #182 since the Mono
16630         runtime no more has the bug and having this exception raised means
16631         we tried to select a constructor which takes an object and is
16632         passed a null.
16633
16634 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16635
16636         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16637         message (1502, 1503) when we can't locate a method after overload
16638         resolution. This is much more informative and closes the bug
16639         Miguel reported.
16640
16641         * interface.cs (PopulateMethod): Return if there are no argument
16642         types. Fixes a NullReferenceException bug.
16643
16644         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16645         expressions too. Previously we were checking only in one place for
16646         positional arguments leaving out named arguments.
16647
16648         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16649         type to the enum type is not allowed. Remove code corresponding to
16650         that.
16651
16652         (ConvertNumericExplicit): Allow explicit conversions from
16653         the underlying type to enum type. This precisely follows the spec
16654         and closes a bug filed by Gonzalo.
16655
16656 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16657
16658         * compiler.csproj:
16659         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16660
16661 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16662
16663         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16664         it was important that we stored the right value after the
16665         reduction in `converted'.
16666
16667 2002-09-04  Martin Baulig  <martin@gnome.org>
16668
16669         * location.cs (Location.SymbolDocument): Use full pathnames for the
16670         source files.
16671
16672 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16673
16674         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16675         of the expression resolve mechanism, because that will catch the
16676         SimpleName error failures.
16677
16678         (Conditional): If we can not resolve the
16679         expression, return, do not crash.
16680
16681 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16682
16683         * cs-tokenizer.cs:
16684         (location): display token name instead of its number.
16685
16686 2002-08-28  Martin Baulig  <martin@gnome.org>
16687
16688         * expression.cs (Binary.ResolveOperator): Don't silently return
16689         but return an error if an operator cannot be applied between two
16690         enum types.
16691
16692 2002-08-28  Martin Baulig  <martin@gnome.org>
16693
16694         * class.cs (Constructor.Define): Set the permission attributes
16695         correctly instead of making all constructors public.
16696
16697 2002-08-28  Martin Baulig  <martin@gnome.org>
16698
16699         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16700         for private members before reporting a CS0103; if we find anything,
16701         it's a CS0122.
16702
16703 2002-08-28  Martin Baulig  <martin@gnome.org>
16704
16705         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16706         to check whether `closure_start_type == closure_invocation_type',
16707         we also need to check whether `m.DeclaringType == closure_invocation_type'
16708         before bypassing the permission checks.  We might be accessing
16709         protected/private members from the base class.
16710         (TypeManager.RealMemberLookup): Only set private_ok if private
16711         members were requested via BindingFlags.NonPublic.
16712
16713         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16714
16715         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16716         MethodGroupExpr.IsExplicitImpl if appropriate.
16717         (Invocation.DoResolve): Don't report the CS0120 for explicit
16718         interface implementations.
16719
16720 2002-08-27  Martin Baulig  <martin@gnome.org>
16721
16722         * expression.cs (Invocation.DoResolve): If this is a static
16723         method and we don't have an InstanceExpression, we must report
16724         a CS0120.
16725
16726 2002-08-25  Martin Baulig  <martin@gnome.org>
16727
16728         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16729         `==' between a valuetype and an object.
16730
16731 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16732
16733         * ecore.cs (TypeExpr): Provide a ToString method.
16734
16735 2002-08-24  Martin Baulig  <martin@gnome.org>
16736
16737         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16738         now called proggie.dbg and it's a binary file.
16739
16740 2002-08-23  Martin Baulig  <martin@gnome.org>
16741
16742         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16743
16744 2002-08-23  Martin Baulig  <martin@gnome.org>
16745
16746         * struct.cs (MyStructInfo.ctor): Make this work with empty
16747         structs; it's not allowed to use foreach() on null.
16748
16749 2002-08-23  Martin Baulig  <martin@gnome.org>
16750
16751         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16752         writer the full pathname of the generated assembly.
16753
16754 2002-08-23  Martin Baulig  <martin@gnome.org>
16755
16756         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16757         A `finally' block never returns or breaks; improved handling of
16758         unreachable code.
16759
16760 2002-08-23  Martin Baulig  <martin@gnome.org>
16761
16762         * statement.cs (Throw.Resolve): Allow `throw null'.
16763
16764 2002-08-23  Martin Baulig  <martin@gnome.org>
16765
16766         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16767         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16768         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16769         MemberLookup would return a wrong event if this is an explicit
16770         interface implementation and the class has an event with the same
16771         name.
16772
16773 2002-08-23  Martin Baulig  <martin@gnome.org>
16774
16775         * statement.cs (Block.AddChildVariableNames): New public method.
16776         (Block.AddChildVariableName): Likewise.
16777         (Block.IsVariableNameUsedInChildBlock): Likewise.
16778         (Block.AddVariable): Check whether a variable name has already
16779         been used in a child block.
16780
16781         * cs-parser.jay (declare_local_variables): Mark all variable names
16782         from the current block as being used in a child block in the
16783         implicit block.
16784
16785 2002-08-23  Martin Baulig  <martin@gnome.org>
16786
16787         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16788         find the symbol writer.
16789
16790         * driver.cs: csc also allows the arguments to /define being
16791         separated by commas, not only by semicolons.
16792
16793 2002-08-23  Martin Baulig  <martin@gnome.org>
16794
16795         * interface.cs (Interface.GetMembers): Added static check for events.
16796
16797 2002-08-15  Martin Baulig  <martin@gnome.org>
16798
16799         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16800         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16801
16802         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16803         why the MethodData.EmitDestructor() change was necessary.
16804
16805 2002-08-20  Martin Baulig  <martin@gnome.org>
16806
16807         * class.cs (TypeContainer.FindMembers): Added static check for events.
16808
16809         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16810
16811         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16812         use Type.GetEvents(), not Type.FindMembers().
16813
16814 2002-08-20  Martin Baulig  <martin@gnome.org>
16815
16816         * decl.cs (MemberCache): Added a special method cache which will
16817         be used for method-only searched.  This ensures that a method
16818         search will return a MethodInfo with the correct ReflectedType for
16819         inherited methods.      
16820
16821 2002-08-20  Martin Baulig  <martin@gnome.org>
16822
16823         * decl.cs (DeclSpace.FindMembers): Made this public.
16824
16825 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16826
16827         * delegate.cs: fixed build on windows.
16828         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16829
16830 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16831
16832         * ecore.cs (StandardConversionExists): Return a false
16833         if we are trying to convert the void type to anything else
16834         since that is not allowed.
16835
16836         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16837         we flag error 70 in the event an event is trying to be accessed
16838         directly from outside the declaring type.
16839
16840 2002-08-20  Martin Baulig  <martin@gnome.org>
16841
16842         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16843         MemberCache from typemanager.cs to decl.cs.
16844
16845 2002-08-19  Martin Baulig  <martin@gnome.org>
16846
16847         * class.cs (TypeContainer): Implement IMemberContainer.
16848         (TypeContainer.DefineMembers): Create the MemberCache.
16849         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16850         return public members if BindingFlags.Public was given, check
16851         whether members are static.
16852
16853 2002-08-16  Martin Baulig  <martin@gnome.org>
16854
16855         * decl.cs (DeclSpace.Define): Splitted this in Define and
16856         DefineMembers.  DefineMembers is called first and initializes the
16857         MemberCache.
16858
16859         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16860         DefineMembers() on all our DeclSpaces.
16861
16862         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16863         but call DefineMembers() on all nested interfaces.  We call their
16864         Define() in our new Define() function.
16865
16866         * interface.cs (Interface): Implement IMemberContainer.
16867         (Interface.Define): Moved all code except the attribute stuf to
16868         DefineMembers().
16869         (Interface.DefineMembers): Initialize the member cache.
16870
16871         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16872         need this anymore since we can use MemberCache.FindMembers directly.
16873
16874 2002-08-19  Martin Baulig  <martin@gnome.org>
16875
16876         * typemanager.cs (MemberCache): When creating the cache for an
16877         interface type, add all inherited members.
16878         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16879         to `out bool used_cache' and documented it.
16880         (TypeManager.MemberLookup): If we already used the cache in the first
16881         iteration, we don't need to do the interfaces check.
16882
16883 2002-08-19  Martin Baulig  <martin@gnome.org>
16884
16885         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16886         here from IMemberFinder and don't implement this interface anymore.
16887         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16888
16889         * typemanager.cs (IMemberFinder): This interface is now only used by
16890         classes which actually support the member cache.
16891         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16892         since we only put DeclSpaces into this Hashtable.
16893         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16894         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16895
16896 2002-08-16  Martin Baulig  <martin@gnome.org>
16897
16898         * typemanager.cs (ICachingMemberFinder): Removed.
16899         (IMemberFinder.MemberCache): New property.
16900         (TypeManager.FindMembers): Merged this with RealFindMembers().
16901         This function will never be called from TypeManager.MemberLookup()
16902         so we can't use the cache here, just the IMemberFinder.
16903         (TypeManager.MemberLookup_FindMembers): Check whether the
16904         IMemberFinder has a MemberCache and call the cache's FindMembers
16905         function.
16906         (MemberCache): Rewrote larger parts of this yet another time and
16907         cleaned it up a bit.
16908
16909 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16910
16911         * driver.cs (LoadArgs): Support quoting.
16912
16913         (Usage): Show the CSC-like command line arguments.
16914
16915         Improved a few error messages.
16916
16917 2002-08-15  Martin Baulig  <martin@gnome.org>
16918
16919         * typemanager.cs (IMemberContainer.Type): New property.
16920         (IMemberContainer.IsInterface): New property.
16921
16922         The following changes are conditional to BROKEN_RUNTIME, which is
16923         defined at the top of the file.
16924
16925         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16926         class'es members, but add all members from TypeHandle.ObjectType
16927         if we're an interface.
16928         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16929         is the current type.
16930         (MemberCache.CacheEntry.Container): Removed this field.
16931         (TypeHandle.GetMembers): Include inherited members.
16932
16933 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16934
16935         * typemanager.cs: fixed compilation and added a comment on a field that
16936         is never used.
16937
16938 2002-08-15  Martin Baulig  <martin@gnome.org>
16939
16940         * class.cs (ConstructorInitializer.Resolve): In the
16941         Expression.MemberLookup call, use the queried_type as
16942         invocation_type.
16943
16944         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16945         declared' attribute, it's always true.
16946         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16947         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16948         temporary wrapper for FindMembers which tells MemberLookup whether
16949         members from the base classes are included in the return value.
16950         This will go away soon.
16951         (TypeManager.MemberLookup): Use this temporary hack here; once the
16952         new MemberCache is completed, we don't need to do the DeclaredOnly
16953         looping here anymore since the MemberCache will take care of this.
16954         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16955         (MemberCache): When creating the MemberCache for a class, get
16956         members from the current class and all its base classes.
16957         (MemberCache.CacheEntry.Container): New field.  This is a
16958         temporary hack until the Mono runtime is fixed to distinguish
16959         between ReflectedType and DeclaringType.  It allows us to use MCS
16960         with both the MS runtime and the unfixed Mono runtime without
16961         problems and without accecting performance.
16962         (MemberCache.SearchMembers): The DeclaredOnly looping from
16963         TypeManager.MemberLookup is now done here.      
16964
16965 2002-08-14  Martin Baulig  <martin@gnome.org>
16966
16967         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16968         Type.GetFields on dynamic types but get the fields from the
16969         corresponding TypeContainer.
16970         (MyStructInfo.GetStructInfo): Added check for enum types.
16971
16972         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16973         (MemberList.SyncRoot): Implemented.
16974         (TypeManager.FilterWithClosure): No need to check permissions if
16975         closure_start_type == closure_invocation_type, don't crash if
16976         closure_invocation_type is null.
16977
16978 2002-08-13  Martin Baulig  <martin@gnome.org>
16979
16980         Rewrote TypeContainer.FindMembers to use a member cache.  This
16981         gives us a speed increase of about 35% for the self-hosting MCS
16982         build and of about 15-20% for the class libs (both on GNU/Linux).
16983
16984         * report.cs (Timer): New class to get enhanced profiling.  This
16985         whole class is "TIMER" conditional since it remarkably slows down
16986         compilation speed.
16987
16988         * class.cs (MemberList): New class.  This is an IList wrapper
16989         which we're now using instead of passing MemberInfo[]'s around to
16990         avoid copying this array unnecessarily.
16991         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16992         (ICachingMemberFinder, IMemberContainer): New interface.
16993         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16994         has already been checked, otherwise use it for the name comparision.
16995         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16996         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16997         if possible.  Returns a MemberList, not a MemberInfo [].
16998         (TypeHandle): New class, implements IMemberContainer.  We create
16999         one instance of this class per type, it contains a MemberCache
17000         which is used to do the member lookups.
17001         (MemberCache): New class.  Each instance of this class contains
17002         all members of a type and a name-based hash table.
17003         (MemberCache.FindMembers): This is our new member lookup
17004         function.  First, it looks up all members of the requested name in
17005         the hash table.  Then, it walks this list and sorts out all
17006         applicable members and returns them.
17007
17008 2002-08-13  Martin Baulig  <martin@gnome.org>
17009
17010         In addition to a nice code cleanup, this gives us a performance
17011         increase of about 1.4% on GNU/Linux - not much, but it's already
17012         half a second for the self-hosting MCS compilation.
17013
17014         * typemanager.cs (IMemberFinder): New interface.  It is used by
17015         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17016         Enum, Delegate or Interface.
17017         (TypeManager.finder_to_member_finder): New PtrHashtable.
17018         (TypeManager.finder_to_container): Removed.
17019         (TypeManager.finder_to_delegate): Removed.
17020         (TypeManager.finder_to_interface): Removed.
17021         (TypeManager.finder_to_enum): Removed.
17022
17023         * interface.cs (Interface): Implement IMemberFinder.
17024
17025         * delegate.cs (Delegate): Implement IMemberFinder.
17026
17027         * enum.cs (Enum): Implement IMemberFinder.
17028
17029         * class.cs (TypeContainer): Implement IMemberFinder.
17030
17031 2002-08-12  Martin Baulig  <martin@gnome.org>
17032
17033         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17034
17035 2002-08-12  Martin Baulig  <martin@gnome.org>
17036
17037         * ecore.cs (ITypeExpression): New interface for expressions which
17038         resolve to a type.
17039         (TypeExpression): Renamed to TypeLookupExpression.
17040         (Expression.DoResolve): If we're doing a types-only lookup, the
17041         expression must implement the ITypeExpression interface and we
17042         call DoResolveType() on it.
17043         (SimpleName): Implement the new ITypeExpression interface.
17044         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17045         hack, the situation that we're only looking up types can't happen
17046         anymore when this method is called.  Moved the type lookup code to
17047         DoResolveType() and call it.
17048         (SimpleName.DoResolveType): This ITypeExpression interface method
17049         is now doing the types-only lookup.
17050         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17051         (ResolveFlags): Added MaskExprClass.
17052
17053         * expression.cs (MemberAccess): Implement the ITypeExpression
17054         interface.
17055         (MemberAccess.DoResolve): Added support for a types-only lookup
17056         when we're called via ITypeExpression.DoResolveType().
17057         (ComposedCast): Implement the ITypeExpression interface.
17058
17059         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17060         Expression.Resolve() with ResolveFlags.Type instead.
17061
17062 2002-08-12  Martin Baulig  <martin@gnome.org>
17063
17064         * interface.cs (Interface.Define): Apply attributes.
17065
17066         * attribute.cs (Attribute.ApplyAttributes): Added support for
17067         interface attributes.
17068
17069 2002-08-11  Martin Baulig  <martin@gnome.org>
17070
17071         * statement.cs (Block.Emit): Only check the "this" variable if we
17072         do not always throw an exception.
17073
17074         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17075         whether the property has a set accessor.
17076
17077 2002-08-11  Martin Baulig  <martin@gnome.org>
17078
17079         Added control flow analysis support for structs.
17080
17081         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17082         with control flow analysis turned off.
17083         (IVariable): New interface.
17084         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17085         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17086         (FieldExpr.DoResolve): Resolve the instance expression with flow
17087         analysis turned off and do the definite assignment check after the
17088         resolving when we know what the expression will resolve to.
17089
17090         * expression.cs (LocalVariableReference, ParameterReference):
17091         Implement the new IVariable interface, only call the flow analysis
17092         code if ec.DoFlowAnalysis is true.
17093         (This): Added constructor which takes a Block argument.  Implement
17094         the new IVariable interface.
17095         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17096         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17097         This does the definite assignment checks for struct members.
17098
17099         * class.cs (Constructor.Emit): If this is a non-static `struct'
17100         constructor which doesn't have any initializer, call
17101         Block.AddThisVariable() to tell the flow analysis code that all
17102         struct elements must be initialized before control returns from
17103         the constructor.
17104
17105         * statement.cs (MyStructInfo): New public class.
17106         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17107         argument to this indexer.  If non-zero, check an individual struct
17108         member, not the whole struct.
17109         (FlowBranching.CheckOutParameters): Check struct members.
17110         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17111         overloaded versions of these methods which take an additional
17112         `int field_idx' argument to check struct members.
17113         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17114         overloaded versions of these methods which take an additional
17115         `string field_name' argument to check struct member.s
17116         (VariableInfo): Implement the IVariable interface.
17117         (VariableInfo.StructInfo): New public property.  Returns the
17118         MyStructInfo instance of the variable if it's a struct or null.
17119         (Block.AddThisVariable): New public method.  This is called from
17120         Constructor.Emit() for non-static `struct' constructor which do
17121         not have any initializer.  It creates a special variable for the
17122         "this" instance variable which will be checked by the flow
17123         analysis code to ensure that all of the struct's fields are
17124         initialized before control returns from the constructor.
17125         (UsageVector): Added support for struct members.  If a
17126         variable/parameter is a struct with N members, we reserve a slot
17127         in the usage vector for each member.  A struct is considered fully
17128         initialized if either the struct itself (slot 0) or all its
17129         members are initialized.
17130
17131 2002-08-08  Martin Baulig  <martin@gnome.org>
17132
17133         * driver.cs (Driver.MainDriver): Only report an error CS5001
17134         if there were no compilation errors.
17135
17136         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17137         `UnsafeContext' property to determine whether the parent is in
17138         unsafe context rather than checking the parent's ModFlags:
17139         classes nested in an unsafe class are unsafe as well.
17140
17141 2002-08-08  Martin Baulig  <martin@gnome.org>
17142
17143         * statement.cs (UsageVector.MergeChildren): Distinguish between
17144         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17145         we return.  Added test17() and test18() to test-154.cs.
17146
17147 2002-08-08  Martin Baulig  <martin@gnome.org>
17148
17149         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17150         Family access, make sure the invoking type isn't a subclass of the
17151         queried type (that'd be a CS1540).
17152
17153         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17154         this method which takes an additional `Type invocation_type'.
17155
17156         * expression.cs (BaseAccess.DoResolve): Use the base type as
17157         invocation and query type.
17158         (MemberAccess.DoResolve): If the lookup failed and we're about to
17159         report a CS0122, try a lookup with the ec.ContainerType - if this
17160         succeeds, we must report a CS1540.
17161
17162 2002-08-08  Martin Baulig  <martin@gnome.org>
17163
17164         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17165         (MethodGroupExpr): Implement the IMemberExpr interface.
17166
17167         * expression (MemberAccess.ResolveMemberAccess): No need to have
17168         any special code for MethodGroupExprs anymore, they're now
17169         IMemberExprs.   
17170
17171 2002-08-08  Martin Baulig  <martin@gnome.org>
17172
17173         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17174         Family, FamANDAssem and FamORAssem permissions.
17175         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17176
17177 2002-08-08  Martin Baulig  <martin@gnome.org>
17178
17179         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17180         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17181         or loop block.
17182
17183 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17184
17185         * driver.cs: implemented /resource option to embed managed resources.
17186
17187 2002-08-07  Martin Baulig  <martin@gnome.org>
17188
17189         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17190         (FieldBase.HasFieldInitializer): New public property.
17191         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17192         returns the field initializer and makes sure it is only resolved once.
17193         (TypeContainer.EmitFieldInitializers): Call
17194         FieldBase.GetInitializerExpression to get the initializer, this ensures
17195         that it isn't resolved multiple times.
17196
17197         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17198         the resolving process (SimpleName/MemberLookup) that we're currently
17199         emitting a field initializer (which must not access any instance members,
17200         this is an error CS0236).
17201
17202         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17203         argument, if the `IsFieldInitializer' flag is set, we must report and
17204         error CS0236 and not an error CS0120.   
17205
17206 2002-08-07  Martin Baulig  <martin@gnome.org>
17207
17208         * ecore.cs (IMemberExpr): New public interface.
17209         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17210         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17211         if the expression is an IMemberExpr.
17212
17213         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17214         to be null, implicitly default to `this' if we're non-static in
17215         this case.  Simplified the code a lot by using the new IMemberExpr
17216         interface.  Also fixed bug #28176 here.
17217
17218 2002-08-06  Martin Baulig  <martin@gnome.org>
17219
17220         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17221         ParameterReferences during semantic analysis so that we can do a
17222         type-only search when resolving Cast, TypeOf and SizeOf.
17223         (block): Pass the `current_local_parameters' to the Block's
17224         constructor.
17225
17226         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17227         argument to the constructor.
17228         (ConstructorInitializer.Resolve): Create a temporary implicit
17229         block with the parameters.
17230
17231         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17232         references here if we aren't doing a type-only search.
17233
17234         * statement.cs (Block): Added constructor which takes a
17235         `Parameters parameters' argument.
17236         (Block.Parameters): New public property.
17237
17238         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17239         to `Parameters' and made it public readonly.
17240
17241 2002-08-06  Martin Baulig  <martin@gnome.org>
17242
17243         * ecore.cs (Expression.Warning): Made this public as well.
17244
17245         * report.cs (Report.Debug): Print the contents of collections.
17246
17247 2002-08-06  Martin Baulig  <martin@gnome.org>
17248
17249         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17250         used to tell Resolve() which kinds of expressions it may return.
17251         (Expression.Resolve): Added overloaded version of this method which
17252         takes a `ResolveFlags flags' argument.  This can be used to tell
17253         Resolve() which kinds of expressions it may return.  Reports a
17254         CS0118 on error.
17255         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17256         ResolveFlags.SimpleName.
17257         (Expression.Error118): Added overloaded version of this method which
17258         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17259         which kinds of expressions are allowed.
17260
17261         * expression.cs (Argument.ResolveMethodGroup): New public method.
17262         Resolves an argument, but allows a MethodGroup to be returned.
17263         This is used when invoking a delegate.
17264
17265         * TODO: Updated a bit.
17266
17267 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17268
17269         Fixed compilation with csc.
17270
17271         * ecore.cs: Expression.Error made public. Is this correct? Should
17272         Warning be made public too?
17273
17274         * expression.cs: use ea.Location instead of ea.loc.
17275         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17276
17277 2002-08-06  Martin Baulig  <martin@gnome.org>
17278
17279         * ecore.cs (Expression.loc): Moved the location here instead of
17280         duplicating it in all derived classes.
17281         (Expression.Location): New public property.
17282         (Expression.Error, Expression.Warning): Made them non-static and
17283         removed the location argument.
17284         (Expression.Warning): Added overloaded version which takes an
17285         `int level' argument.
17286         (Expression.Error118): Make this non-static and removed the
17287         expression and location arguments.
17288         (TypeExpr): Added location argument to the constructor.
17289
17290         * expression.cs (StaticCallExpr): Added location argument to
17291         the constructor.
17292         (Indirection, PointerArithmetic): Likewise.
17293         (CheckedExpr, UnCheckedExpr): Likewise.
17294         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17295         (StringPtr): Likewise.
17296
17297
17298 2002-08-05  Martin Baulig  <martin@gnome.org>
17299
17300         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17301
17302         * assign.cs (Assign.DoResolve): Check whether the source
17303         expression is a value or variable.
17304
17305         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17306         while resolving the corresponding blocks.
17307
17308         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17309         an error, don't silently return null.
17310
17311         * statement.cs (Block.AddVariable): Do the error reporting here
17312         and distinguish between CS0128 and CS0136.
17313         (Block.DoResolve): Report all unused labels (warning CS0164).
17314         (LabeledStatement): Pass the location to the constructor.
17315         (LabeledStatement.HasBeenReferenced): New property.
17316         (LabeledStatement.Resolve): Set it to true here.
17317
17318         * statement.cs (Return.Emit): Return success even after reporting
17319         a type mismatch error (CS0126 or CS0127), this is what csc does and
17320         it avoids confusing the users with any consecutive errors.
17321
17322 2002-08-05  Martin Baulig  <martin@gnome.org>
17323
17324         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17325
17326         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17327
17328         * expression.cs (MemberAccess.DoResolve): Silently return if an
17329         error has already been reported.
17330
17331         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17332         error has already been reported.
17333
17334 2002-08-05  Martin Baulig  <martin@gnome.org>
17335
17336         * statement.cs (UsageVector): Only initialize the `parameters'
17337         vector if we actually have any "out" parameters.
17338
17339 2002-08-05  Martin Baulig  <martin@gnome.org>
17340
17341         * expression.cs (Binary.ResolveOperator): When combining delegates,
17342         they must have the same type.
17343
17344 2002-08-05  Martin Baulig  <martin@gnome.org>
17345
17346         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17347         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17348         work with the ms runtime and we also don't need it: if we're a
17349         PropertyBuilder and not in the `indexer_arguments' hash, then we
17350         are a property and not an indexer.
17351
17352         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17353         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17354         since the latter one doesn't work with the ms runtime.
17355
17356 2002-08-03  Martin Baulig  <martin@gnome.org>
17357
17358         Fixed bugs #27998 and #22735.
17359
17360         * class.cs (Method.IsOperator): New public field.
17361         (Method.CheckBase): Report CS0111 if there's already a method
17362         with the same parameters in the current class.  Report CS0508 when
17363         attempting to change the return type of an inherited method.
17364         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17365         and it's not marked abstract or extern.
17366         (PropertyBase): New abstract base class for Property and Indexer.
17367         (PropertyBase.CheckBase): Moved here from Property and made it work
17368         for indexers.
17369         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17370         the same so we can reuse it there.
17371         (Property, Indexer): Derive from PropertyBase.
17372         (MethodSignature.inheritable_property_signature_filter): New delegate
17373         to find properties and indexers.
17374
17375         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17376         argument and improved error reporting.
17377
17378         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17379         EmptyReadOnlyParameters and made it a property.
17380
17381         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17382         version of this method which takes a `PropertyInfo indexer'.
17383         (TypeManager.RegisterIndexer): New method.
17384
17385         * class.cs: Added myself as author of this file :-)
17386
17387 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17388
17389         * class.cs: fixed compilation on windoze.
17390
17391 2002-08-03  Martin Baulig  <martin@gnome.org>
17392
17393         * interface.cs (Interface.GetInterfaceBases): Check whether all
17394         base interfaces are at least as accessible than the current one.
17395
17396         * class.cs (TypeContainer.GetClassBases): Check whether base types
17397         are at least as accessible than the current type.
17398         (TypeContainer.AsAccessible): Implemented and made non-static.
17399         (MemberBase.CheckParameters): Report errors if the accessibility
17400         checks fail.
17401
17402         * delegate.cs (Delegate.Delegate): The default visibility is
17403         internal for top-level types and private for nested types.
17404         (Delegate.Define): Report errors if the accessibility checks fail.
17405
17406         * enum.cs (Enum.Enum): The default visibility is internal for
17407         top-level types and private for nested types.
17408         (Enum.DefineType): Compute the correct visibility.
17409
17410         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17411         function which takes a `bool is_toplevel' instead of a TypeContainer.
17412
17413         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17414         builtin type.
17415
17416 2002-08-02  Martin Baulig  <martin@gnome.org>
17417
17418         * expression.cs (LocalVariableReferenc): Added constructor which
17419         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17420         (LocalVariableReference.IsReadOnly): New property.
17421         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17422         variable is readonly, use our own readonly flag to do this; you can
17423         use the new constructor to get a writable reference to a read-only
17424         variable.
17425
17426         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17427         reference to the local variable.
17428
17429 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17430
17431         * rootcontext.cs (ResolveCore): Also include System.Exception
17432
17433         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17434         we reach an EmptyStatement.
17435
17436         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17437         is also fine.
17438
17439         * expression.cs (Binary.ResolveOperator): Check error result in
17440         two places.
17441
17442         use brtrue/brfalse directly and avoid compares to null.
17443
17444 2002-08-02  Martin Baulig  <martin@gnome.org>
17445
17446         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17447         Fixes bug #28407, added test-155.cs.
17448
17449 2002-08-01  Martin Baulig  <martin@gnome.org>
17450
17451         * class.cs (Event.EmitDefaultMethod): Make this work with static
17452         events.  Fixes #28311, added verify-3.cs.
17453
17454 2002-08-01  Martin Baulig  <martin@gnome.org>
17455
17456         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17457         `is_disposable' fields.
17458         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17459         `hm.is_disposable' if we're using the collection pattern.
17460         (Foreach.EmitCollectionForeach): Use the correct type for the
17461         enumerator's local variable, only emit the try/finally block if
17462         necessary (fixes #27713).
17463
17464 2002-08-01  Martin Baulig  <martin@gnome.org>
17465
17466         * ecore.cs (Expression.report118): Renamed to Error118 and made
17467         it public static.
17468
17469         * statement.cs (Throw.Resolve): Check whether the expression is of
17470         the correct type (CS0118) and whether the type derives from
17471         System.Exception (CS0155).
17472         (Catch.Resolve): New method.  Do the type lookup here and check
17473         whether it derives from System.Exception (CS0155).
17474         (Catch.CatchType, Catch.IsGeneral): New public properties.
17475
17476         * typemanager.cs (TypeManager.exception_type): Added.
17477
17478 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17479
17480         * driver.cs: Updated About function.
17481
17482 2002-07-31  Martin Baulig  <martin@gnome.org>
17483
17484         Implemented Control Flow Analysis.
17485
17486         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17487         (EmitContext.CurrentBranching): Added.
17488         (EmitContext.StartFlowBranching): Added.
17489         (EmitContext.EndFlowBranching): Added.
17490         (EmitContext.KillFlowBranching): Added.
17491         (EmitContext.IsVariableAssigned): Added.
17492         (EmitContext.SetVariableAssigned): Added.
17493         (EmitContext.IsParameterAssigned): Added.
17494         (EmitContext.SetParameterAssigned): Added.
17495         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17496         Added control flow analysis stuff here.
17497
17498         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17499         resolve the expression as lvalue.
17500         (LocalVariableReference.DoResolve): Check whether the variable has
17501         already been assigned.
17502         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17503         the parameter as assigned here.
17504         (ParameterReference.DoResolve): Check whether the parameter has already
17505         been assigned.
17506         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17507         expression as lvalue.
17508
17509         * statement.cs (FlowBranching): New class for the flow analysis code.
17510         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17511         (LabeledStatement.IsDefined): New public property.
17512         (LabeledStatement.AddUsageVector): New public method to tell flow
17513         analyis that the label may be reached via a forward jump.
17514         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17515         flow analysis.
17516         (VariableInfo.Number): New public field.  This is used by flow analysis
17517         to number all locals of a block.
17518         (Block.CountVariables): New public property.  This is the number of
17519         local variables in this block (including the locals from all parent
17520         blocks).
17521         (Block.EmitMeta): Number all the variables.
17522
17523         * statement.cs: Added flow analysis support to all classes.
17524
17525 2002-07-31  Martin Baulig  <martin@gnome.org>
17526
17527         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17528         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17529         then use this argument.
17530
17531         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17532
17533         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17534         use this to specify /define options.
17535
17536 2002-07-29  Martin Baulig  <martin@gnome.org>
17537
17538         * statement.cs (Fixed): Moved all code that does variable lookups
17539         and resolvings from Emit to Resolve.
17540
17541         * statement.cs (For): Moved all code that does variable lookups
17542         and resolvings from Emit to Resolve.
17543
17544         * statement.cs (Using): Moved all code that does variable lookups
17545         and resolvings from Emit to Resolve.
17546
17547 2002-07-29  Martin Baulig  <martin@gnome.org>
17548
17549         * attribute.cs (Attribute.Resolve): Explicitly catch a
17550         System.NullReferenceException when creating the
17551         CustromAttributeBuilder and report a different warning message.
17552
17553 2002-07-29  Martin Baulig  <martin@gnome.org>
17554
17555         * support.cs (ParameterData.ParameterName): Added method to
17556         get the name of a parameter.
17557
17558         * typemanager.cs (TypeManager.IsValueType): New public method.
17559
17560 2002-07-29  Martin Baulig  <martin@gnome.org>
17561
17562         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17563         is a flag which specifies that it's either ref or out.
17564         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17565         the out parameter to `out Parameter.Modifier mod', also set the
17566         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17567
17568         * support.cs (InternalParameters.ParameterModifier): Distinguish
17569         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17570         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17571
17572         * expression.cs (Argument.GetParameterModifier): Distinguish
17573         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17574         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17575
17576 2002-07-29  Martin Baulig  <martin@gnome.org>
17577
17578         * expression.cs (ParameterReference.ParameterReference): Added
17579         `Location loc' argument to the constructor.
17580
17581         * cs-parser.jay: Pass location to ParameterReference.
17582
17583 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17584
17585         * statement.cs (Try): Initialize the location.
17586
17587         * cs-parser.jay: pass location to Try.
17588
17589         * expression.cs (Unary.Reduce): Change the prototype to return
17590         whether a constant fold could be performed or not.  The result is
17591         returned in an out parameters.  In the case of Indirection and
17592         AddressOf, we want to perform the full tests.
17593
17594 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17595
17596         * statement.cs (Statement.Emit): Flag dead code.
17597
17598 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17599
17600         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17601
17602 2002-07-27  Martin Baulig  <martin@gnome.org>
17603
17604         * class.cs (MethodData.Define): Put back call to
17605         TypeManager.AddMethod(), accidentally commented this out.
17606
17607         * report.cs (Debug): New public method to print debugging information,
17608         this is `[Conditional ("DEBUG")]'.
17609
17610 2002-07-26  Martin Baulig  <martin@gnome.org>
17611
17612         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17613         (switch_statement): Push the current_block to the switch_stack and
17614         pop it again when we're done with the switch.
17615         (switch_section): The new block is a child of the current_block.
17616         Fixes bug #24007, added test-152.cs.
17617
17618 2002-07-27  Martin Baulig  <martin@gnome.org>
17619
17620         * expression.cs (Invocation.EmitArguments): When calling a varargs
17621         function with only its fixed arguments, we need to pass an empty
17622         array.
17623
17624 2002-07-27  Martin Baulig  <martin@gnome.org>
17625
17626         Mono 0.13 has been released.
17627
17628 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17629
17630         * driver.cs: Rename --resource to --linkres, because that is what
17631         we do currently, we dont support --resource yet.
17632
17633         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17634
17635 2002-07-25  Martin Baulig  <martin@gnome.org>
17636
17637         * class.cs (MethodData): New public class.  This is a `method builder'
17638         class for a method or one accessor of a Property/Indexer/Event.
17639         (MethodData.GetMethodFlags): Moved here from MemberBase.
17640         (MethodData.ApplyAttributes): Likewise.
17641         (MethodData.ApplyObsoleteAttribute): Likewise.
17642         (MethodData.ApplyConditionalAttribute): Likewise.
17643         (MethodData.ApplyDllImportAttribute): Likewise.
17644         (MethodData.CheckAbstractAndExternal): Likewise.
17645         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17646         (MethodData.Emit): Formerly known as Method.Emit().
17647         (MemberBase): Moved everything which was specific to a single
17648         accessor/method to MethodData.
17649         (Method): Create a new MethodData and call Define() and Emit() on it.
17650         (Property, Indexer, Event): Create a new MethodData objects for each
17651         accessor and call Define() and Emit() on them.
17652
17653 2002-07-25  Martin Baulig  <martin@gnome.org>
17654
17655         Made MethodCore derive from MemberBase to reuse the code from there.
17656         MemberBase now also checks for attributes.
17657
17658         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17659         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17660         as virtual.
17661         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17662         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17663         (MemberBase.ApplyAttributes): New virtual method; applies the
17664         attributes to a method or accessor.
17665         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17666         (MemberBase.ApplyConditionalAttribute): Likewise.
17667         (MemberBase.ApplyDllImportAttribute): Likewise.
17668         (MemberBase.CheckAbstractAndExternal): Likewise.
17669         (MethodCore.ParameterTypes): This is now a property instead of a
17670         method, it's initialized from DoDefineParameters().
17671         (MethodCore.ParameterInfo): Removed the set accessor.
17672         (MethodCore.DoDefineParameters): New protected virtual method to
17673         initialize ParameterTypes and ParameterInfo.
17674         (Method.GetReturnType): We can now simply return the MemberType.
17675         (Method.GetMethodFlags): Override the MemberBase version and add
17676         the conditional flags.
17677         (Method.CheckBase): Moved some code from Define() here, call
17678         DoDefineParameters() here.
17679         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17680         here to avoid some larger code duplication.
17681         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17682         ensure that abstract and external accessors don't declare a body.
17683
17684         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17685         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17686         lookup in the attribute's parent classes, so we need to abort as soon
17687         as we found the first match.
17688         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17689         the attribute has no arguments.
17690
17691         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17692         of a Method.
17693
17694 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17695
17696         * cs-parser.jay: reverted previous patch.
17697
17698 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17699
17700         * cs-parser.jay: fixed bug #22119.
17701
17702 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17703
17704         * attribute.cs: fixed compilation. The error was:
17705         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17706         be assigned to before control leaves the current method."
17707         [FIXME:  Filed as bug #28186: MCS must report this error.]
17708
17709 2002-07-25  Martin Baulig  <martin@gnome.org>
17710
17711         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17712         method to pull the condition name ouf of a Conditional attribute.
17713         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17714         the obsolete message and error flag out of an Obsolete attribute.
17715
17716         * class.cs (Method.GetMethodFlags): New public method to get the
17717         TypeManager.MethodFlags for this method.
17718         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17719         private methods.
17720         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17721         if we're overriding a virtual function, set the new private variable
17722         `parent_method'; call the new TypeManager.AddMethod().
17723
17724         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17725         the MethodBuilder and the Method in a PtrHashtable.
17726         (TypeManager.builder_to_method): Added for this purpose.
17727         (TypeManager.MethodFlags): Added IsObsoleteError.
17728         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17729         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17730         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17731         the message from the attribute.
17732
17733 2002-07-24  Martin Baulig  <martin@gnome.org>
17734
17735         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17736         preprocessor directives, ensure that the argument to #define/#undef is
17737         exactly one identifier and that it's actually an identifier.
17738
17739         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17740         did not work ....
17741
17742 2002-07-24  Martin Baulig  <martin@gnome.org>
17743
17744         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17745         initialize it to TypeManager.object_type in the constructor.
17746         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17747         of the `hm.get_current' method if we're using the collection pattern.
17748         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17749         for the explicit conversion to make it work when we're using the collection
17750         pattern and the `Current' property has a different return type than `object'.
17751         Fixes #27713.
17752
17753 2002-07-24  Martin Baulig  <martin@gnome.org>
17754
17755         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17756         does not match, but don't report any errors.  This method is called in
17757         order for all methods in a MethodGroupExpr until a matching method is
17758         found, so we don't want to bail out if the first method doesn't match.
17759         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17760         matches, report the 123.  Fixes #28070.
17761
17762 2002-07-24  Martin Baulig  <martin@gnome.org>
17763
17764         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17765         TypeManager.TypeToCoreType() to the top of the method so the
17766         following equality checks will work.  Fixes #28107.
17767
17768 2002-07-24  Martin Baulig  <martin@gnome.org>
17769
17770         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17771         operand is of type uint, and the other operand is of type sbyte,
17772         short or int, the operands are converted to type long." -
17773         Actually do what this comment already told us.  Fixes bug #28106,
17774         added test-150.cs.
17775
17776 2002-07-24  Martin Baulig  <martin@gnome.org>
17777
17778         * class.cs (MethodBase): New abstract class.  This is now a base
17779         class for Property, Indexer and Event to avoid some code duplication
17780         in their Define() and DefineMethods() methods.
17781         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17782         generic methods for Define() and DefineMethods().
17783         (FieldBase): Derive from MemberBase, not MemberCore.
17784         (Property): Derive from MemberBase, not MemberCore.
17785         (Property.DefineMethod): Moved all the code from this method to the
17786         new MethodBase.DefineAccessor(), just call it with appropriate
17787         argumetnts.
17788         (Property.Define): Call the new Property.DoDefine(), this does some
17789         sanity checks and we don't need to duplicate the code everywhere.
17790         (Event): Derive from MemberBase, not MemberCore.
17791         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17792         accessors, this will also make them work with interface events.
17793         (Indexer): Derive from MemberBase, not MemberCore.
17794         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17795         (Indexer.Define): Use the new MethodBase functions.
17796
17797         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17798         argument to the constructor.
17799         (Interface.FindMembers): Added support for interface events.
17800         (Interface.PopluateEvent): Implemented.
17801
17802         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17803
17804 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17805
17806         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17807         but this is required to check for a method name being the same as
17808         the containing class.  
17809
17810         Handle this now.
17811
17812 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17813
17814         * interface.cs: initialize variable.
17815
17816 2002-07-23  Martin Baulig  <martin@gnome.org>
17817
17818         Implemented the IndexerName attribute in interfaces.
17819
17820         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17821         name if this is an explicit interface implementation.
17822         (Indexer.InterfaceIndexerName): New public variable.  If we're
17823         implementing an interface indexer, this is the IndexerName in that
17824         interface.  Otherwise, it's the IndexerName.
17825         (Indexer.DefineMethod): If we're implementing interface indexer,
17826         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17827         and Pending.ImplementIndexer methods.
17828         (Indexer.Define): Also define the PropertyBuilder if we're
17829         implementing an interface indexer and this is neither an explicit
17830         interface implementation nor do the IndexerName match the one in
17831         the interface.
17832
17833         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17834         If a method is defined here, then we always need to create a proxy
17835         for it.  This is used when implementing interface indexers.
17836         (Pending.IsInterfaceIndexer): New public method.
17837         (Pending.ImplementIndexer): New public method.
17838         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17839         This is used when implementing interface indexers to define a proxy
17840         if necessary.
17841         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17842         define a proxy if necessary.
17843
17844         * interface.cs (Interface.IndexerName): New public variable.
17845         (Interface.PopulateIndexer): Set the IndexerName.
17846         (Interface.DefineIndexers): New private method.  Populate all the
17847         indexers and make sure their IndexerNames match.
17848
17849         * typemanager.cs (IndexerPropertyName): Added support for interface
17850         indexers.
17851
17852 2002-07-22  Martin Baulig  <martin@gnome.org>
17853
17854         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17855         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17856         ret if HasReturnLabel.
17857         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17858         variables.
17859
17860         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17861         and set the ec.LoopBeginTryCatchLevel.
17862         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17863         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17864         the current ec.TryCatchLevel, the branch goes out of an exception
17865         block.  In this case, we need to use Leave and not Br.
17866
17867 2002-07-22  Martin Baulig  <martin@gnome.org>
17868
17869         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17870         block unless the block does not always return or it is contained in
17871         another try { ... } catch { ... } block.  Fixes bug #26506.
17872         Added verify-1.cs to the test suite.
17873
17874 2002-07-22  Martin Baulig  <martin@gnome.org>
17875
17876         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17877         then we do not always return.  Fixes bug #24985.
17878
17879 2002-07-22  Martin Baulig  <martin@gnome.org>
17880
17881         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17882         lookup on a per-class level; ie. walk up the class hierarchy until we
17883         found at least one applicable method, then choose the best among them.
17884         Fixes bug #24463 and test-29.cs.
17885
17886 2002-07-22  Martin Baulig  <martin@gnome.org>
17887
17888         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17889         return types of the methods.  The return type is not part of the
17890         signature and we must not check it to make the `new' modifier work.
17891         Fixes bug #27999, also added test-147.cs.
17892         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17893
17894         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17895         on the method's return type.
17896
17897 2002-07-21  Martin Baulig  <martin@gnome.org>
17898
17899         * assign.cs: Make this work if the rightmost source is a constant and
17900         we need to do an implicit type conversion.  Also adding a few more tests
17901         to test-38.cs which should have caught this.
17902
17903         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17904         target in the makefile for this.  The makefile.gnu is primarily intended
17905         for end-users who don't want to debug the compiler.
17906
17907 2002-07-21  Martin Baulig  <martin@gnome.org>
17908
17909         * assign.cs: Improved the Assign class so it can now handle embedded
17910         assignments (X = Y = Z = something).  As a side-effect this'll now also
17911         consume less local variables.  test-38.cs now passes with MCS, added
17912         a few new test cases to that test.
17913
17914 2002-07-20  Martin Baulig  <martin@gnome.org>
17915
17916         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17917         instructions.  Fixes bug #27977, also added test-146.cs.
17918
17919 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17920
17921         * cs-tokenizer.cs: fixed getHex ().
17922
17923 2002-07-19  Martin Baulig  <martin@gnome.org>
17924
17925         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17926         not Type.GetType() to lookup the array type.  This is needed when
17927         we're constructing an array of a user-defined type.
17928         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17929         single-dimensional arrays, but also for single-dimensial arrays of
17930         type decimal.
17931
17932 2002-07-19  Martin Baulig  <martin@gnome.org>
17933
17934         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17935         this function is called, it's not allowed to share LocalBuilders
17936         among ILGenerators.
17937
17938 2002-07-19  Martin Baulig  <martin@gnome.org>
17939
17940         * expression.cs (Argument.Resolve): Report an error 118 when trying
17941         to pass a type as argument.
17942
17943 2002-07-18  Martin Baulig  <martin@gnome.org>
17944
17945         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17946         Conv_R_Un for the signed `long' type.
17947
17948 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17949
17950         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17951         `expr' for the temporary result, as that will fail if we do
17952         multiple resolves on the same expression.
17953
17954 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17955
17956         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17957         ec.TypeContainer for looking up aliases. 
17958
17959         * class.cs (TypeContainer): Remove LookupAlias from here.
17960
17961         * decl.cs (DeclSpace); Move here.
17962
17963 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17964
17965         * class.cs (FindMembers): Only call filter if the constructor
17966         bulider is not null.
17967
17968         Also handle delegates in `NestedTypes' now.  Now we will perform
17969         type lookups using the standard resolution process.  This also
17970         fixes a bug.
17971
17972         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17973         This uses Expressions (the limited kind that can be parsed by the
17974         tree) instead of strings.
17975
17976         * expression.cs (ComposedCast.ToString): Implement, used to flag
17977         errors since now we have to render expressions.
17978
17979         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17980         FormArrayType. 
17981
17982         * ecore.cs (SimpleName.ToString): ditto.
17983
17984         * cs-parser.jay: Instead of using strings to assemble types, use
17985         Expressions to assemble the type (using SimpleName, ComposedCast,
17986         MemberAccess).  This should fix the type lookups in declarations,
17987         because we were using a different code path for this.
17988
17989         * statement.cs (Block.Resolve): Continue processing statements
17990         even when there is an error.
17991
17992 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17993
17994         * class.cs (Event.Define): Also remove the `remove' method from
17995         the list of pending items.
17996
17997         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17998         generate more compact code. 
17999
18000 2002-07-17  Martin Baulig  <martin@gnome.org>
18001
18002         * const.cs (Const.LookupConstantValue): Add support for constant
18003         `unchecked' and `checked' expressions.
18004         Also adding test case test-140.cs for this.
18005
18006 2002-07-17  Martin Baulig  <martin@gnome.org>
18007
18008         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18009         check whether mi.ReturnType implements the IEnumerator interface; the
18010         `==' and the IsAssignableFrom() will fail in this situation.
18011
18012 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18013
18014         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18015         here too.
18016
18017 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18018
18019         * expression.cs: fixed bug #27811.
18020
18021 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18022
18023         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18024         Molaro: when we are a ref, the value already contains a pointer
18025         value, do not take the address of it.
18026
18027 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18028         * removed mb-parser.jay and mb-tokenizer.cs
18029
18030 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18031
18032         * expression.cs: check against the building corlib void type.
18033
18034 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18035
18036         * ecore.cs: fix for valuetype static readonly fields: when 
18037         initializing them, we need their address, not the address of a copy.
18038
18039 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18040
18041         * typemanager.cs: register also enum_type in corlib.
18042
18043 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18044
18045         * class.cs: allow calling this (but not base) initializers in structs.
18046
18047 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18048
18049         * ecore.cs: make sure we compare against the building base types
18050         in GetTypeSize ().
18051
18052 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18053
18054         * typemanager.cs: fix TypeToCoreType() to handle void and object
18055         (corlib gets no more typerefs after this change).
18056
18057 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18058
18059         * expression.cs (ArrayCreation.EmitArrayArguments): use
18060         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18061
18062         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18063         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18064         array indexes, the runtime actually forbids them.
18065
18066         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18067         for array arguments here.
18068
18069         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18070         instead of the default for ValueTypes.
18071
18072         (New.DoEmit): Use IsValueType instead of
18073         IsSubclassOf (value_type)
18074         (New.DoResolve): ditto.
18075         (Invocation.EmitCall): ditto.
18076
18077         * assign.cs (Assign): ditto.
18078
18079         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18080         Statements *are* currently doing part of their resolution during
18081         Emit.  
18082
18083         Expressions do always resolve during resolve, but statements are
18084         only required to propagate resolution to their children.
18085
18086 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18087
18088         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18089
18090         (LoadAssembly): Do not add the dll if it is already specified
18091
18092         (MainDriver): Add the System directory to the link path at the end,
18093         after all the other -L arguments. 
18094
18095         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18096         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18097         ldelem.u1) and using the opposite for sbytes.
18098
18099         This fixes Digger, and we can finally run it.
18100
18101         * driver.cs (UnixParseOption): Move the option parsing here.  
18102         (CSCParseOption): Implement CSC-like parsing of options.
18103
18104         We now support both modes of operation, the old Unix way, and the
18105         new CSC-like way.  This should help those who wanted to make cross
18106         platform makefiles.
18107
18108         The only thing broken is that /r:, /reference: and /lib: are not
18109         implemented, because I want to make those have the same semantics
18110         as the CSC compiler has, and kill once and for all the confussion
18111         around this.   Will be doing this tomorrow.
18112
18113         * statement.cs (Unsafe.Resolve): The state is checked during
18114         resolve, not emit, so we have to set the flags for IsUnsfe here.
18115
18116 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18117
18118         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18119         not catch the Error_ObjectRefRequired in SimpleName (as it is
18120         possible to have a class/instance variable name that later gets
18121         deambiguated), we have to check this here.      
18122
18123 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18124
18125         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18126         make static and put into Expression.
18127
18128         (Event.Define): Register the private field of the event with the 
18129         TypeManager so that GetFieldFromEvent can get at it.
18130
18131         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18132         keep track of the private field associated with an event which
18133         has no accessors.
18134
18135         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18136         private field.
18137
18138         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18139
18140 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18141
18142         * expression.cs (Binary.EmitBranchable): this routine emits the
18143         Binary expression in a branchable context.  This basically means:
18144         we need to branch somewhere, not just get the value on the stack.
18145
18146         This works together with Statement.EmitBoolExpression.
18147
18148         * statement.cs (Statement.EmitBoolExpression): Use
18149         EmitBranchable. 
18150
18151 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18152
18153         * statement.cs (For): Reduce the number of jumps in loops.
18154
18155         (For): Implement loop inversion for the For statement.
18156
18157         (Break): We can be breaking out of a Try/Catch controlled section
18158         (foreach might have an implicit try/catch clause), so we need to
18159         use Leave instead of Br.
18160
18161         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18162         now).  If the instace expression supports IMemoryLocation, we use
18163         the AddressOf method from the IMemoryLocation to extract the
18164         address instead of emitting the instance.
18165
18166         This showed up with `This', as we were emitting the instance
18167         always (Emit) instead of the Address of This.  Particularly
18168         interesting when This is a value type, as we dont want the Emit
18169         effect (which was to load the object).
18170
18171 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18172
18173         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18174
18175         * statement.cs (Checked): Set the CheckedState during the resolve
18176         process too, as the ConvCast operations track the checked state on
18177         the resolve process, and not emit.
18178
18179         * cs-parser.jay (namespace_member_declaration): Flag that we have
18180         found a declaration when we do.  This is used to flag error 1529
18181
18182         * driver.cs: Report ok when we display the help only.
18183
18184 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18185
18186         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18187
18188 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18189
18190         * cs-tokenizer.cs (define): We also have to track locally the
18191         defines.  AllDefines is just used for the Conditional Attribute,
18192         but we also need the local defines for the current source code. 
18193
18194 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18195
18196         * statement.cs (While, For, Do): These loops can exit through a
18197         Break statement, use this information to tell whether the
18198         statement is the last piece of code.
18199
18200         (Break): Flag that we break.
18201
18202         * codegen.cs (EmitContexts): New `Breaks' state variable.
18203
18204 2002-07-03  Martin Baulig  <martin@gnome.org>
18205
18206         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18207         modifiers in method declarations in structs.  Otherwise, you won't
18208         be able to override things like Object.Equals().
18209
18210 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18211
18212         * class.cs (Method, Property, Indexer): Do not allow the public
18213         modifier to be used in explicit interface implementations.
18214
18215         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18216         override modifiers in method declarations in structs
18217
18218 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18219
18220         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18221         integer or real overflow, report an error
18222
18223 2002-07-02  Martin Baulig  <martin@gnome.org>
18224
18225         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18226         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18227         to tell the runtime about our newly created System.Object and
18228         System.ValueType types.
18229
18230 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18231
18232         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18233         struct instead of Ldarg/Starg.
18234
18235 2002-07-02  Martin Baulig  <martin@gnome.org>
18236
18237         * expression.cs (Indirection.Indirection): Call
18238         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18239
18240 2002-07-02  Martin Baulig  <martin@gnome.org>
18241
18242         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18243         ValueType, call TypeManager.TypeToCoreType() on it.
18244         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18245         the OpCodes.Newarr argument.
18246
18247 2002-07-02  Martin Baulig  <martin@gnome.org>
18248
18249         * expression.cs (Invocation.EmitCall): When compiling corlib,
18250         replace all calls to the system's System.Array type to calls to
18251         the newly created one.
18252
18253         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18254         System.Array methods.
18255         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18256         from the system's System.Array type which must be replaced.
18257
18258 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18259
18260         * typemanager.cs: load unverifiable_code_ctor so we can build
18261         corlib using the correct type. Avoid using GetTypeCode() with
18262         TypeBuilders.
18263         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18264         TypeManager.object_type to allow building corlib.
18265
18266 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18267
18268         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18269
18270 2002-07-01  Martin Baulig  <martin@gnome.org>
18271
18272         * class.cs: Make the last change actually work, we need to check
18273         whether `ifaces != null' to avoid a crash.
18274
18275 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18276
18277         * class.cs: when we build structs without fields that implement
18278         interfaces, we need to add the interfaces separately, since there is
18279         no API to both set the size and add the interfaces at type creation
18280         time.
18281
18282 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18283
18284         * expression.cs: the dimension arguments to the array constructors
18285         need to be converted if they are a long.
18286
18287 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18288
18289         * class.cs: don't emit ldarg.0 if there is no parent constructor
18290         (fixes showstopper for corlib).
18291
18292 2002-06-29  Martin Baulig  <martin@gnome.org>
18293
18294         MCS now compiles corlib on GNU/Linux :-)
18295
18296         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18297         ie. check for MethodImplOptions.InternalCall.
18298
18299         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18300         and TypeManager.attribute_type are null, so we must explicitly check
18301         whether parent is not null to find out whether it's an attribute type.
18302         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18303         and SetBuilder, not only if the property is neither abstract nor external.
18304         This is necessary to set the MethodImplOptions on the accessor methods.
18305         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18306         SetBuilder, see Property.Emit().
18307
18308         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18309         populate "System.Object", "System.ValueType" and "System.Attribute" since
18310         they've already been populated from BootCorlib_PopulateCoreTypes().
18311
18312 2002-06-29  Martin Baulig  <martin@gnome.org>
18313
18314         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18315         is the NullLiteral, we also need to make sure that target_type is not
18316         an enum type.   
18317
18318 2002-06-29  Martin Baulig  <martin@gnome.org>
18319
18320         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18321         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18322         before calling BootstrapCorlib_ResolveDelegate ().
18323
18324 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18325
18326         * statement.cs: fixed build-breaker. All tests passed ok.
18327
18328 2002-06-27  Martin Baulig  <martin@gnome.org>
18329
18330         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18331         for System.Decimal when compiling corlib.
18332
18333 2002-06-27  Martin Baulig  <martin@gnome.org>
18334
18335         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18336         switch blocks which contain nothing but a default clause.
18337
18338 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18339
18340        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18341
18342 2002-06-27  Martin Baulig  <martin@gnome.org>
18343
18344         * ecore.cs (PropertyExpr.PropertyExpr): Call
18345         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18346
18347         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18348         is already a TypeBuilder.
18349
18350 2002-06-27  Martin Baulig  <martin@gnome.org>
18351
18352         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18353         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18354         the "from an array-type to System.Array" case.  This makes it work
18355         when compiling corlib.
18356
18357 2002-06-27  Martin Baulig  <martin@gnome.org>
18358
18359         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18360         non-static PropertyExpr, set its InstanceExpression.  This makes
18361         the `ICollection.Count' property work in System/Array.cs.
18362
18363 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18364
18365         * driver.cs: Made error handling more consistent.  Errors now
18366         tracked by Report class, so many methods which used to return int
18367         now return void.  Main() now prints success/failure and 
18368         errors/warnings message.
18369
18370         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18371         the magic number return values (123 and 124).  Now, if the
18372         expected error occurs, the compiler exits with success (exit value
18373         0).  If the compilation completes without seeing that particular
18374         error, the compiler exits with failure (exit value 1).  The
18375         makefile in mcs/errors has been changed to handle the new behaviour.
18376
18377         * report.cs: Made 'expected error' number a property and renamed
18378         it from 'Probe' to 'ExpectedError'.
18379
18380         * genericparser.cs: Removed error handling support, since it is
18381         now all done by Report class.
18382
18383         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18384         class, so parse() no longer returns an int.
18385
18386         * namespace.cs: Use Report.Error instead of GenericParser.error
18387
18388 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18389
18390         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18391         TypeContainer.AddOperator): At the front of the list put the
18392         explicit implementations, so they get resolved/defined first. 
18393
18394 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18395
18396         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18397         interface type is implemented by this TypeContainer.  Used during
18398         explicit interface implementation.
18399
18400         (Property.Define, Indexer.Define, Method.Define): Validate that
18401         the given interface in the explicit implementation is one of the
18402         base classes for the containing type.
18403
18404         Also if we are explicitly implementing an interface, but there is
18405         no match in the pending implementation table, report an error.
18406
18407         (Property.Define): Only define the property if we are
18408         not explicitly implementing a property from an interface.  Use the
18409         correct name also for those properties (the same CSC uses,
18410         although that is really not needed).
18411
18412         (Property.Emit): Do not emit attributes for explicitly implemented
18413         properties, as there is no TypeBuilder.
18414
18415         (Indexer.Emit): ditto.
18416
18417         Hiding then means that we do not really *implement* a pending
18418         implementation, which makes code fail.
18419
18420 2002-06-22  Martin Baulig  <martin@gnome.org>
18421
18422         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18423         the return value of Object.GetType().  [FIXME: we need to do this whenever
18424         we get a type back from the reflection library].
18425
18426 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18427
18428         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18429
18430 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18431
18432         * attribute.cs: Return null if we can not look up the type.
18433
18434         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18435         the interface types found.
18436
18437         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18438         interface types found.
18439
18440         * typemanager.cs (GetInterfaces): Make this routine returns alll
18441         the interfaces and work around the lame differences between
18442         System.Type and System.Reflection.Emit.TypeBuilder in the results
18443         result for GetInterfaces.
18444
18445         (ExpandInterfaces): Given an array of interface types, expand and
18446         eliminate repeated ocurrences of an interface.  This expands in
18447         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18448         be IA, IB, IC.
18449
18450 2002-06-21  Martin Baulig  <martin@gnome.org>
18451
18452         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18453         on System.Enum.
18454
18455 2002-06-21  Martin Baulig  <martin@gnome.org>
18456
18457         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18458         and called with one of the core types, return the corresponding typebuilder for
18459         that type.
18460
18461         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18462         element type.
18463
18464 2002-06-21  Martin Baulig  <martin@gnome.org>
18465
18466         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18467         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18468         (Expression.ConvertReferenceExplicit): Likewise.
18469
18470         * expression.cs (ElementAccess.DoResolve): Likewise.
18471         (ElementAccess.DoResolveLValue): Likewise.
18472
18473 2002-06-10  Martin Baulig  <martin@gnome.org>
18474
18475         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18476         add the "value" parameter to the parameter list.
18477
18478         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18479         to our caller.
18480
18481 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18482
18483         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18484         the argument to an int, uint, long or ulong, per the spec.  Also
18485         catch negative constants in array creation.
18486
18487 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18488
18489         * class.cs: do not allow the same interface to appear twice in
18490         the definition list.
18491
18492 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18493
18494         * ecore.cs: don't use ldlen with System.Array.
18495
18496 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18497
18498         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18499
18500 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18501
18502         * modifiers.cs: produce correct field attributes for protected
18503         internal. Easy fix so miguel can work on ther harder stuff:-)
18504
18505 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18506
18507         * pending.cs: New file.  Move the code from class.cs here.
18508         Support clearning the pending flag for all methods (when not doing
18509         explicit interface implementation).
18510
18511 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18512
18513         * rootcontext.cs: added a couple more types needed to bootstrap.
18514
18515 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18516
18517         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18518         constructor in the type, instead of any constructor in the type
18519         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18520         a bug in the Mono runtime when applying the params attribute). 
18521
18522 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18523         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18524
18525 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18526
18527         * expression.cs (Unary.ResolveOperator): Use TypeManager
18528         to resolve the type.
18529
18530 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18531
18532         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18533         attached.
18534
18535         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18536         with each member too.
18537
18538         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18539         field builders too - this takes care of the enum member case.
18540
18541 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18542
18543         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18544         address-of operator on both value types and pointers.
18545
18546 2002-06-10  Martin Baulig  <martin@gnome.org>
18547
18548         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18549         PropertyBuilder to the `property_builders' list.
18550
18551         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18552         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18553         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18554         find any indexers which are inherited from an interface.
18555
18556 2002-06-09  Martin Baulig  <martin@gnome.org>
18557
18558         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18559         the same type as the constant if necessary.  There's also a test-130.cs
18560         for this.
18561
18562         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18563
18564         * typemanager.cs (TypeManager.ChangeType): Previously known as
18565         Enum.ChangeEnumType().
18566
18567 2002-06-09  Martin Baulig  <martin@gnome.org>
18568
18569         * expression.cs (Cast.TryReduce): Added support for consts.
18570
18571 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18572
18573         * class.cs (Accessor): Hold attributes information so we can pass
18574         it along.
18575
18576         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18577         Modify to pass in attributes attached to the methods.
18578
18579         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18580
18581         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18582         to handle the Accessor kind :-)
18583
18584         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18585
18586 2002-06-08  Martin Baulig  <martin@gnome.org>
18587
18588         * expression.cs (Unary.TryReduceNegative): Added support for
18589         ULongConstants.
18590
18591 2002-06-08  Martin Baulig  <martin@gnome.org>
18592
18593         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18594         name can't be found in the `defined_names' - the caller will do a
18595         MemberLookup in this case and thus find methods in System.Enum
18596         such as Enum.IsDefined().
18597
18598 2002-06-08  Martin Baulig  <martin@gnome.org>
18599
18600         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18601         Convert.ChangeType() which works with TypeBuilder created types.
18602         (Enum.LookupEnumValue, Enum.Define): Use it here.
18603
18604         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18605         `TypeBuilder.BaseType != null' check.
18606         (TypeContainer.FindMembers): Only lookup parent members if we
18607         actually have a parent.
18608         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18609         (ConstructorInitializer.Resolve): Likewise.
18610
18611         * interface.cs (Interface.FindMembers): Added
18612         `TypeBuilder.BaseType != null' check.
18613
18614         * rootcontext.cs (RootContext.ResolveCore): Added
18615         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18616         classes_second_stage.
18617
18618         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18619         debug_type and trace_type when compiling with --nostdlib.       
18620
18621 2002-06-07  Martin Baulig  <martin@gnome.org>
18622
18623         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18624         (AddField): Set it to true when adding a non-static field.
18625         (DefineType): Use `have_nonstatic_fields' to find out whether we
18626         have non-static fields, not `Fields != null'.
18627
18628 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18629
18630         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18631         dereferencing a null on the static-field code path)
18632
18633 2002-05-30  Martin Baulig  <martin@gnome.org>
18634
18635         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18636         to take command line arguments.  Use reflection to call the new
18637         custom `Initialize' function on the symbol writer and pass it the
18638         command line arguments.
18639
18640         * driver.cs (--debug-args): New command line argument to pass command
18641         line arguments to the symbol writer.
18642
18643 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18644
18645         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18646         the target type for indexers and properties.  Thanks to Joe for
18647         catching this.
18648
18649 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18650
18651         * typemanager.cs (MethodFlags): returns the method flags
18652         (Obsolete/ShouldIgnore) that control warning emission and whether
18653         the invocation should be made, or ignored. 
18654
18655         * expression.cs (Invocation.Emit): Remove previous hack, we should
18656         not do this on matching a base type, we should do this based on an attribute
18657
18658         Only emit calls to System.Diagnostics.Debug and
18659         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18660         on the command line.
18661
18662         * rootcontext.cs: Global settings for tracing and debugging.
18663
18664         * cs-tokenizer.cs (define): New utility function to track
18665         defines.   Set the global settings for TRACE and DEBUG if found.
18666
18667 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18668
18669         * interface.cs (Populate*): Pass in the TypeContainer as well as
18670         the DeclSpace as parameters so that we can create EmitContexts and
18671         then use that to apply attributes etc.
18672
18673         (PopulateMethod, PopulateEvent, PopulateProperty)
18674         (PopulateIndexer): Apply attributes everywhere.
18675
18676         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18677         etc.
18678
18679         (ApplyAttributes): Update accordingly.
18680
18681         We now apply interface attributes for all members too.
18682
18683 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18684
18685         * class.cs (Indexer.Define); Correctly check if we are explicit
18686         implementation (instead of checking the Name for a ".", we
18687         directly look up if the InterfaceType was specified).
18688
18689         Delay the creation of the PropertyBuilder.
18690
18691         Only create the PropertyBuilder if we are not an explicit
18692         interface implementation.   This means that explicit interface
18693         implementation members do not participate in regular function
18694         lookups, and hence fixes another major ambiguity problem in
18695         overload resolution (that was the visible effect).
18696
18697         (DefineMethod): Return whether we are doing an interface
18698         implementation. 
18699
18700         * typemanager.cs: Temporary hack until we get attributes in
18701         interfaces (Ravi is working on that) and we get IndexerName
18702         support in interfaces.
18703
18704         * interface.cs: Register the indexers as properties.
18705
18706         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18707         warning, I have verified that this is a bug in the .NET runtime
18708         (JavaScript suffers of the same problem).
18709
18710         * typemanager.cs (MemberLookup): When looking up members for
18711         interfaces, the parent of an interface is the implicit
18712         System.Object (so we succeed in searches of Object methods in an
18713         interface method invocation.  Example:  IEnumerable x;  x.ToString
18714         ()) 
18715
18716 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18717
18718         * class.cs (Event): Events should also register if they do
18719         implement the methods that an interface requires.
18720
18721         * typemanager.cs (MemberLookup); use the new GetInterfaces
18722         method. 
18723
18724         (GetInterfaces): The code used to lookup interfaces for a type is
18725         used in more than one place, factor it here. 
18726
18727         * driver.cs: Track the errors at the bottom of the file, we kept
18728         on going.
18729
18730         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18731         instance if the method we are calling is static!
18732
18733 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18734
18735         * attribute.cs (ApplyAttributes): Make this function filter out
18736         the IndexerName attribute (as that attribute in reality is never
18737         applied) and return the string constant for the IndexerName
18738         attribute. 
18739
18740         * class.cs (TypeContainer.Emit): Validate that all the indexers
18741         have the same IndexerName attribute, and if so, set the
18742         DefaultName attribute on the class. 
18743
18744         * typemanager.cs: The return value might contain other stuff (not
18745         only methods).  For instance, consider a method with an "Item"
18746         property and an Item method.
18747
18748         * class.cs: If there is a problem with the parameter types,
18749         return. 
18750
18751 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18752
18753         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18754         looks at user defined conversion after making a call to 
18755         StandardConversionExists - we need this for overload resolution.
18756
18757         * expression.cs : Update accordingly the various method calls.
18758
18759         This fixes 2 bugs filed against implicit user defined conversions 
18760
18761 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18762
18763         * statement.cs: Track the result of the assignment.
18764
18765 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18766
18767         * expression.cs (MemberAccess): Improved error reporting for
18768         inaccessible members.
18769
18770 2002-05-22  Martin Baulig  <martin@gnome.org>
18771
18772         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18773         itself with debugging support.
18774
18775 2002-05-22  Martin Baulig  <martin@gnome.org>
18776
18777         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18778         Removed, this isn't needed anymore.
18779
18780 2002-05-20  Martin Baulig  <martin@gnome.org>
18781
18782         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18783         be underlying type for an enum.
18784
18785 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18786
18787         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18788         that splits out the loading of just the core types.
18789
18790         * rootcontext.cs (ResolveCore): Split the struct resolution in
18791         two, so we can load the enumeration underlying types before any
18792         enums are used.
18793
18794         * expression.cs (Is): Bandaid until we fix properly Switch (see
18795         bug #24985 for details).
18796
18797         * typemanager.cs (ImplementsInterface): The hashtable will contain
18798         a null if there are no interfaces implemented.
18799
18800 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18801
18802         * cs-parser.jay (indexer_declarator): It is fine to have array
18803         parameters
18804
18805 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18806
18807         * typemanager.cs: (RegisterBuilder): New function used to register
18808         TypeBuilders that implement interfaces.  Since
18809         TypeBuilder.GetInterfaces (as usual) does not work with lame
18810         Reflection.Emit. 
18811         (AddUserType): register interfaces.
18812
18813         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18814         dealing with TypeBuilder.  Also, arrays are showing up as
18815         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18816         methods can not be invoked on them!
18817
18818         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18819         (ImplicitReferenceConversionExists): Split out from
18820         StandardConversionExists. 
18821
18822         * expression.cs (As): We were only implementing one of the three
18823         cases for the as operator.  We now implement them all.
18824         (Is): Implement the various other cases for Is as well.
18825
18826         * typemanager.cs (CACHE): New define used to control if we want or
18827         not the FindMembers cache.  Seems to have a negative impact on
18828         performance currently
18829
18830         (MemberLookup): Nested types have full acess to
18831         enclosing type members
18832
18833         Remove code that coped with instance/static returns for events, we
18834         now catch this in RealFindMembers.
18835
18836         (RealFindMembers): only perform static lookup if the instance
18837         lookup did not return a type or an event.  
18838
18839 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18840
18841         * assign.cs (CompoundAssign): We pass more semantic information
18842         now to Compound Assignments than we did before: now we have all
18843         the information at hand, and now we resolve the target *before* we
18844         do the expression expansion, which allows the "CacheValue" method
18845         to have the effect we intended (before, a [x] += 1 would generate
18846         two differen ArrayAccess expressions from the ElementAccess,
18847         during the resolution process).
18848
18849         (CompoundAssign.DoResolve): Resolve target and original_source here.
18850
18851 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18852
18853         * expression.cs (ArrayAccess): dropped debugging information. 
18854
18855         * typemanager.cs: Small bug fix: I was always returning i_members,
18856         instead of one of i_members or s_members (depending on which had
18857         the content).
18858
18859         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18860         method is invoked before any code generation takes place, and it
18861         is a mechanism to inform that the expression will be invoked more
18862         than once, and that the method should use temporary values to
18863         avoid having side effects
18864
18865         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18866
18867         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18868         implementation.
18869
18870         * expression.cs (Indirection, ArrayAccess): Add support for
18871         CacheTemporaries in these two bad boys. 
18872
18873         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18874         ldobj or ldind_ref.  
18875         (StoreFromPtr): Handle stobj as well.
18876
18877         * expression.cs (UnaryMutator): Share more code.
18878
18879         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18880         down: I was not tracking the Filter function as well, which
18881         was affecting the results of the cache.
18882
18883 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18884
18885         * attribute.cs: Remove the hack to handle the CharSet property on
18886         StructLayouts. 
18887
18888 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18889
18890         * attribute.cs (DoResolve): More uglyness, we now only try to
18891         resolve the attribute partially, to extract the CharSet
18892         information (only if we are a StructLayout attribute).  Otherwise 
18893
18894         (GetExtraTypeInfo): Add some code to conditionally kill in the
18895         future this.   I am more and more convinced that the .NET
18896         framework has special code to handle the attribute setting on
18897         certain elements.
18898
18899         * expression.cs (IsParamsMethodApplicable): Revert my previous
18900         foreach change here, it was wrong.
18901
18902 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18903
18904         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18905         (pp_expr): do not abort on unknown input, just return.
18906         (eval): abort if there are pending chars.
18907
18908         * attribute.cs (Attribute.Resolve): Positional parameters are
18909         optional.  Deal with that case.
18910
18911         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18912         the Ansi/Unicode/Auto information for the type.
18913
18914         (TypeContainer.DefineType): instantiate the EmitContext here, as
18915         we will be using it during the type definition (to resolve
18916         attributes) and during the emit phase.
18917
18918         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18919         to pull type information out of the attributes
18920
18921         (Attribute.Resolve): track the constructor builder, and allow for
18922         multiple invocations (structs and classes will use this).
18923
18924         * ecore.cs (MemberLookupFinal): new version with all the
18925         parameters customizable.
18926
18927         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18928         constructors.  Return if the result value is null (as the error
18929         would have been flagged already by MemberLookupFinal)
18930
18931         Do not allow instances of abstract classes or interfaces to be
18932         created.
18933
18934         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18935         We have to compare the assembly property here when dealing with
18936         FamANDAssem and Assembly access modifiers, because we might be
18937         creating an assembly from *modules* (that means that we are not
18938         getting TypeBuilders for types defined in other modules that are
18939         part of this assembly).
18940
18941         (Method.Emit): If the method is marked abstract and has a body,
18942         emit an error. 
18943
18944         (TypeContainer.DefineMembers): If both the defined member and the
18945         parent name match are methods, then do not emit any warnings: let
18946         the Method.Define routine take care of flagging warnings.  But if
18947         there is a mismatch (method overrides something else, or method is
18948         overriwritten by something, then emit warning).
18949
18950         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18951         set to null, this means `do not check for the return type on the
18952         signature'. 
18953
18954         (Method.Define): set the return type for the method signature to
18955         null, so that we get methods with the same name and parameters and
18956         different return types.  This is used to flag warning 114 (you are
18957         hiding a method, and you probably want to use the new/override
18958         keywords instead).
18959
18960         * typemanager.cs (MemberLookup): Implemented proper access
18961         control, closing a long standing set of bug reports.  The problem
18962         was that the Framework only has two bits: Public and NonPublic,
18963         and NonPublic includes private and protected methods, but we need
18964         to enforce the FamANDAssem, FamOrAssem and Family. 
18965
18966 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18967
18968         * statement.cs (GotoCase): Return true: Ammounts to giving up
18969         knowledge on whether we return or not, and letting the other case
18970         be responsible for it.
18971
18972 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18973
18974         * driver.cs: Do not load directories for each file processed, only
18975         do it if there is a pattern.
18976
18977         * ecore.cs: Report readonly assigns here as well, as we might have
18978         been resolved only by MemberAccess.
18979
18980         (SimpleName.SimpleNameResolve): Also be useful for LValue
18981         resolution.   We need this to propagate assign to local readonly variables
18982
18983         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18984         do not want to reuse potential criteria memory.
18985
18986         * class.cs (MyEventBuilder): Set reflected_type;
18987
18988         * ecore.cs (Constantify): Added support for constifying bools.
18989
18990         (RootContext.LookupType): Added a cache for values looked up in
18991         the declaration space.
18992
18993         * typemanager.cs (FindMembers): Now is a front-end to
18994         RealFindMembers, and provides a two-level hashtable-based cache to
18995         the request.  
18996
18997         15% performance improvement: from 22.5 to 19.2 seconds.
18998
18999         * expression.cs (IsParamsMethodApplicable): use foreach.
19000         (Invocation.DoResolve): ditto.
19001         (New.DoResolve): ditto.
19002         (ArrayCreation.DoResolve): ditto.
19003
19004         * ecore.cs (FindMostEncompassingType): use foreach.
19005
19006         * delegate.cs (NewDelegate.DoResolve): Use foreach
19007
19008         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19009         (RemoveMethods): use foreach.
19010
19011         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19012         nested foreach statements instead of for, and also break out of
19013         the inner loop once a match is found.
19014
19015         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19016
19017 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19018
19019         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19020         we actually unwrap the expression to allow for extra information
19021         to be extracted. 
19022
19023         * expression.cs: Use Shr_Un on unsigned operations. 
19024
19025 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19026
19027         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19028         applicable operators was not being considered correctly. This closes
19029         the bug Miguel reported.
19030
19031 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19032
19033         * attribute.cs: check that the type derives from System.Attribute
19034         and report the correct error in that case (moved the duplicate code to
19035         its own method, too).
19036
19037 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19038
19039         * attribute.cs: lookup attribute type name as the spec says: first the
19040         bare attribute name and then name + "Attribute" (nant compiles with
19041         mcs after this fix).
19042
19043 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19044
19045         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19046         Because of the way we parse things, we should try to see if a
19047         UIntConstant can fit in an integer.
19048
19049 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19050
19051         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19052         when we are in an explicit context.
19053
19054         (ConvertReferenceExplicit): When converting from Iface type S to Class
19055         T make sure the rules are implemented as an OR.
19056
19057         * parameter.cs (ParameterType): Make it a property for now although the
19058         purpose really isn't anything immediate.
19059
19060         * expression.cs (Is*Applicable): Do better checking on the parameter type
19061         of a ref/out parameter. The ones from the system assemblies are already 
19062         marked with the correct type so we don't need to do any correction.
19063
19064         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19065         the object type is standard too so include that.
19066
19067 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19068
19069         * ecore.cs (StandardConversionExists): Augment with missing code:
19070         deal with IntConstant, LongConstants and Enumerations.
19071
19072         * assign.cs: Report the error, instead of failing silently
19073
19074         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19075         typecontainer that they are declared, because the
19076         typecontainer/namespace will have the list of using clauses that
19077         need to be applied.
19078
19079         Assembly Attributes were escaping the normal registration
19080         mechanism. 
19081
19082         (EmitCode): Apply attributes within an EmitContext that represents
19083         the container they were declared on.
19084
19085         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19086
19087 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19088
19089         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19090         Revamp completely - make much cleaner as we now operate only
19091         on a set of Types.
19092
19093         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19094         to implement the logic detailed in the spec more correctly.
19095
19096         (UserDefinedConversion): Update accordingly.
19097
19098 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19099
19100         * statement.cs: Return flow analysis information up.
19101
19102         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19103         and the default.
19104
19105         (token): Do not consume an extra character before calling
19106         decimal_digits.
19107
19108 2002-05-06  Piers Haken <piersh@friskit.com>
19109
19110         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19111
19112 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19113
19114         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19115         EmitContext during the instance constructor initializer
19116         resolution, to stop access to instance variables.
19117
19118         This is mandated by the spec, last paragraph of the `constructor
19119         initializers' section. 
19120
19121 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19122
19123         * cs-parser.jay, class.cs (Accessor): new class used to represent
19124         an accessor (get or set).  In the past we used `null' to represent
19125         a missing accessor.  But this is ambiguous because there was no
19126         way to tell in abstract indexers/properties if one of them was
19127         specified.
19128
19129         Now there is a way of addressing that.
19130
19131         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19132         instead of FindMembers.
19133
19134         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19135         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19136
19137         * attribute.cs: Treat indexers and properties as the same in terms
19138         of applying attributes
19139
19140         * ecore.cs (FindMostEncompassedType): Use statically initialized
19141         EmptyExpressions()s like we do elsewhere to avoid creating useless
19142         objects (and we take this out of the tight loop).
19143
19144         (GetConversionOperators): Move the code to extract the actual
19145         operators to a separate routine to clean things up.
19146
19147 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19148
19149         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19150         events are always registered FieldBuilders.
19151
19152         * class.cs (FieldBase): New class shared by Fields 
19153
19154         * delegate.cs: If we are a toplevel delegate, use our full name.
19155         If we are a nested delegate, then only use our tail name.
19156
19157 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19158
19159         * expression.cs (IsApplicable): Ensure that we add the "&" to
19160         ref/out types before comparing it with the type of the argument.
19161
19162         (IsParamsMethodApplicable): Ditto.
19163
19164         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19165         silly me ;-)
19166
19167         * delegate.cs : Handle the case when we have more than one applicable
19168         method. Flag an error only when we finish checking all.
19169
19170 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19171
19172         * expression.cs: Add support for boolean static initializers.
19173
19174 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19175
19176         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19177
19178         * parameter.cs (ComputeParameterTypes,
19179         ComputeAndDefineParameterTypes): Better error handling: now we
19180         clear the `types' cache if we fail during any of the type lookups.
19181         We also return the status code correctly to our caller
19182
19183         * delegate.cs: If we fail to define a delegate, abort the extra
19184         steps. 
19185
19186         * expression.cs (Binary.ResolveOperator): for
19187         operator==(object,object) and operator !=(object, object) we also
19188         have to verify that there is an implicit conversion from one to
19189         the other.
19190
19191         (ArrayAccess.DoResolve): Array Access can operate on
19192         non-variables. 
19193
19194 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19195
19196         * assign.cs (CompoundAssign): A new class used as a "flag" that
19197         the assignment actually is happening as part of a compound
19198         assignment operator.
19199
19200         During compound assignment, a few new rules exist to enable things
19201         like:
19202
19203         byte b |= 1 + 2
19204
19205         From the spec:
19206
19207         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19208         to the type of x) if y is implicitly convertible to the type of x,
19209         and the operator is a builtin operator and the return type of the
19210         operator is explicitly convertible to the type of x. 
19211
19212         * rootcontext.cs: Reset warning level to 2.  4 catches various
19213         "interesting" features in mcs, we must clean this up at some
19214         point, but currently am trying to kill other bugs ;-)
19215
19216         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19217         in container classes as well.  
19218
19219         * expression.cs (Binary.ResolveOperator): Handle string case
19220         before anything else (as operator overloading does emit an error
19221         before doing anything else).
19222
19223         This code could go away when we move to a table driven model, but
19224         i could not come up with a good plan last night.
19225
19226 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19227
19228         * typemanager.cs (CSharpName): reimplementation using regex.
19229         * class.cs: added null check for fields in Emit
19230         * rootcontext.cs: set warninglevel to 4
19231
19232 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19233
19234         * typemanager.cs (CSharpName): reimplemented with Lupus
19235         suggestion.
19236
19237 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19238
19239         * statement.cs (If): correclty implement Resolve, because we were
19240         not catching sem errors in there.  The same process is needed
19241         everywhere else. 
19242         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19243
19244
19245         (Statement.Warning_DeadCodeFound): Factorize code.
19246         (While): Report dead code here too.
19247
19248         (Statement): Added Resolve virtual method to allow
19249         for resolution split from the emit code.
19250
19251 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19252
19253         * statement.cs (EmitBoolExpression): No longer try to resolve the
19254         expression here.    
19255         (MakeBoolean): New utility function that resolve, implicitly
19256         converts to boolean and tags the expression. 
19257
19258
19259         (If, Do): Implement dead code elimination.
19260         (While): Implement loop inversion
19261
19262         (Do, While, For, If): Resolve the expression prior to calling our
19263         code generation.
19264
19265 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19266
19267         * class.cs:
19268           - added method Report28 (warning: program has more than one entry point)
19269           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19270           - modified method Method.Define, the part at the end of the method
19271
19272         * rootcontext.cs: added static public Location EntryPointLocation;
19273           
19274         * ../errors/cs0028.cs : Add test case for the above warning.              
19275
19276         * typemanager.cs:
19277           - modified method CSharpName to allow arrays of primitive type to
19278             be printed nicely (e.g. instead of System.Int32[][] it now prints
19279             int[][])
19280           - added method CSharpSignature: returns the signature of a method
19281             in string format to be used in reporting errors, warnings, etc.
19282
19283         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19284         with String.Empty.
19285
19286 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19287
19288         * delegate.cs (Define): Fix extremely silly bug where I was
19289         setting the type of the 'object' parameter of the BeginInvoke
19290         method to System.IAsyncResult instead of System.Object ;-)
19291
19292 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19293
19294         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19295         here. 
19296
19297         (Constructor.Emit): return if we fail to initialize the
19298         constructor.  Another door closed!  
19299
19300         * expression.cs (New.DoResolve): Improve error message (from -6 to
19301         1501).  Use DeclaredOnly lookup to find the exact constructor.
19302
19303         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19304         loop.  This is useful.
19305
19306         * cs-parser.jay: Adjust the default parameters so that destructors
19307         have the proper signature.
19308
19309 2002-04-26  Martin Baulig  <martin@gnome.org>
19310
19311         * driver.cs (LoadAssembly): If `assembly' contains any characters
19312         which are only valid in path names and not in assembly names
19313         (currently slash, backslash and point), use Assembly.LoadFrom ()
19314         instead of Assembly.Load () on the `assembly' (before iteration
19315         over the link_paths).
19316
19317 2002-04-26  Martin Baulig  <martin@gnome.org>
19318
19319         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19320
19321 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19322
19323         * class.cs (Property): use the new typemanager.MemberLookup
19324
19325         (TypeContainer.MemberLookup): Implement using the
19326         TypeManager.MemberLookup now. 
19327
19328         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19329         and return MemberInfos, so that these can be used without an
19330         EmitContext (what we had before).
19331
19332 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19333
19334         * expression.cs: Fix the case where the argument to params if the
19335         type of the params.  I omitted handling this before.   Fixed
19336
19337 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19338
19339         * driver.cs: Call BootCorlib_PopulateCoreType
19340
19341         * class.cs (Property.CheckBase): Check for properties only, not
19342         for all members. 
19343
19344         * interface.cs: Temporary hack: try/catch around the
19345         CustomAttributeBuilder, because I am getting an exception that I
19346         do not understand.
19347
19348         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19349         types whose definitions are required to be there (attributes are
19350         defined before standard types).
19351
19352         Compute definitions as we boot the various types, as they are used
19353         immediately (value_type class will need object_type, but if we do
19354         not initialize object_type, we will pass a null, which will let
19355         the runtime pick the System.Object from the existing corlib, which
19356         is not what we want).
19357
19358 2002-04-22  Patrik Torstensson <totte@labs2.com>
19359
19360         * cs-tokenizer.cs: fixed a number of trim() issues.
19361
19362 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19363
19364         * expression.cs (Argument.Type): Ensure that we return the correct
19365         type when we have out or ref parameters [in which case we 
19366         append a "&"].
19367
19368 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19369
19370         * class.cs (Property, Indexer): Allow extern modifier in there. 
19371
19372         * typemanager.cs (InitBaseTypes): Initializes object_type and
19373         value_type, since those will be used early on during the bootstrap
19374         process to compile corlib.
19375
19376         (InitCoreTypes): Move code from here to InitBaseTypes.
19377
19378 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19379
19380         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19381         single-dimension arrays as using the ldlen opcode.  
19382
19383         Daniel Lewis discovered this optimization.  
19384
19385         * typemanager.cs: Add signature for System.Array::get_Length
19386
19387 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19388
19389         * statement.cs: report the error when the foreach does not apply to an
19390         array nor a collection.
19391
19392 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19393
19394         * expression.cs: Add implicit conversions to the operator ~.
19395
19396         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19397
19398         * typemanager.cs: Locate the decimal constructor.
19399
19400 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19401
19402         * attribute.cs: use the new property of TypeOf.
19403         * expression.cs: added 'get' property around typearg.
19404
19405         These changes fix a build breaker reported by NickD. Is this the
19406         correct way to fix?  If not, please, revert my changes and make it
19407         work :-).
19408
19409 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19410
19411         * attribute.cs: Add support for typeof in attribute invocations.
19412         I am not sure that this is right though.
19413
19414 2002-04-14  Duncan Mak  <duncan@ximian.com>
19415
19416         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19417         Binary.Operator.Division case.
19418
19419 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19420
19421         * class.cs (DefineType): Ensure that we do a proper check on
19422         attribute types and also register it with the TypeManager.
19423
19424         (TypeContainer.Targets): The default for attribute types is
19425         AttributeTargets.All.
19426
19427         * attribute.cs (ApplyAttributes): Registering the attribute type
19428         is done elsewhere, not when we discover we have a Usage attribute.
19429
19430 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19431
19432         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19433         and get rid of is_delegate parameter.
19434
19435         * everywhere : update.
19436
19437 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19438
19439         * cs-parser.jay (compilation_unit): Revamp completely to use
19440         some new ideas that I got from Rhys' grammar to solve the problems
19441         with assembly level attributes.
19442
19443         (outer_declaration): New grammar production.
19444
19445         (attribute_sections): Add.
19446
19447         (opt_attributes): Base on attribute_sections
19448
19449         (namespace_declaration): Allow opt_attributes to tackle the case
19450         when we have assembly level attributes - we are clever in this
19451         regard now ;-)
19452
19453         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19454         attributes in the non-global context.
19455
19456         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19457         instead of SetGlobalAttributes.
19458
19459         * class.cs, rootcontext.cs : Ensure we define and generate 
19460         attribute types before anything else.
19461
19462         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19463         and flag the new error -20 for the case when the attribute type
19464         does not have valid targets specified. csc does not catch this.
19465
19466         * ../errors/errors.txt : update for error # -20
19467
19468 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19469
19470         * support.cs (InternalParameters.ParameterModifier): Do some null
19471         checking and return sane values.
19472
19473         * class.cs (Method.Define): If we are a PInvoke method, ensure
19474         that we are static and extern. Report error # 601
19475
19476         * ../errors/cs0601.cs : Add test case for the above error.
19477
19478 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19479
19480         * rootcontext.cs (attribute_types): We need to keep type of
19481         all attribute types separately and emit code for them first.
19482
19483         (RegisterAttribute) : Implement.
19484
19485         * class.cs (DefineType): Check if the current Type is a custom
19486         attribute type and register it accordingly.
19487
19488         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19489         adding the first attribute twice and rename to
19490
19491         (SetGlobalAttributes): this.
19492
19493         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19494         lookups.
19495
19496         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19497         if we are processing global arguments. Hmm, I am unsure of this.
19498
19499 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19500
19501         * expression.cs: added static array of strings to avoid calling
19502         Enum.ToString () for Operator in Binary. Significant recover of
19503         performance.
19504
19505 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19506
19507         * class.cs (FindMembers): Allow the Builders of the various
19508         members to be null.  If they are skip them.  This only happens
19509         during the PInvoke declaration.
19510
19511 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19512
19513         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19514         failure, so we do not keep going afterwards.
19515
19516         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19517         wanted to pass `false' as the `is_delegate' argument.  If this is
19518         the case, why not use delegate_type == null to mean `is_delegate =
19519         false' and anything else as is_delegate = true.
19520
19521 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19522
19523         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19524         code for the section, not the beginning of the tests.
19525
19526 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19527
19528         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19529
19530         * expression.cs (Binary): same.  Warn about errors where we have
19531         Enum/Enum in operator + as well.
19532
19533 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19534
19535         * statement.cs:
19536                 - added support for switch(bool)
19537                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19538                 - add TableSwitchEmit() to handle table-based switch statements
19539
19540 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19541
19542         * expression.cs (Invocation.OverloadResolve): Factor out code which
19543         does parameter compatibility checking with arguments so that we can 
19544         re-use the code even from Delegate.VerifyApplicability
19545
19546         (VerifyArgumentsCompat): Move above code here.
19547
19548         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19549         and instead make a call to the above method.
19550
19551 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19552
19553         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19554         We use it to keep track of classes which are attribute types.
19555
19556 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19557
19558         * delegate.cs (Delegate.Define): Correctly define the types in the
19559         presence of fixed and array parameters.
19560
19561         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19562         doing FindMembers.
19563
19564         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19565         include NonPublic after the first iteration.
19566
19567         * class.cs (Indexer.CheckBase): Only check if both parents are
19568         non-null. 
19569
19570         * cs-parser.jay (accessor_body): If empty, set to null.
19571
19572         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19573         same code path here to resolve constants names that we did have in
19574         MemberAccess.DoResolve.  There is too much code duplicated here.
19575
19576 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19577
19578         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19579
19580         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19581         to MakeUnionSet.
19582
19583         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19584         tokens, numbers and strings.
19585
19586         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19587         parenthesis.
19588
19589         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19590         asyncronous parameters and the regular parameters.  
19591
19592         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19593         specify the target directory.
19594
19595         * expression.cs: (This.DoResolve): Simplify
19596         (As.Emit): Optimize, do not generate IsInst if the expression is
19597         always of the given type.
19598
19599         (Is.DoResolve): Bug fix, we were reporting both always/never for
19600         the is expression.
19601
19602         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19603         creating too many unnecessary arrays.
19604
19605 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19606
19607         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19608         fields instead of rolling our own initializer.   Takes care of all
19609         implicit conversions, and drops unnecessary static checks/argument.
19610
19611 2002-03-31  Dick Porter  <dick@ximian.com>
19612
19613         * driver.cs: use the GetDirectories() return values properly, and
19614         use "/" as path separator.
19615
19616 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19617
19618         * expression.cs (Unary): Optimize - - expr into expr.
19619         (Binary): Optimize a + (-b) into a -b.
19620
19621         * codegen.cs (CodeGen): Made all methods static.
19622
19623 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19624
19625         * rootcontext.cs: 
19626
19627         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19628         TypeBuilder property.
19629
19630         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19631         instead. 
19632
19633         * tree.cs: Removed the various RecordXXXX, and replaced with a
19634         single RecordDecl.  Removed all the accessor methods, and just
19635         left a single access point Type 
19636
19637         * enum.cs: Rename DefineEnum to DefineType.
19638
19639         * decl.cs: New abstract method `DefineType' used to unify the
19640         Defines for Enumerations, Interfaces, TypeContainers and
19641         Delegates.
19642
19643         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19644         LookupBaseClasses method that used to live in class.cs and
19645         interface.cs here, and renamed to FindType.
19646
19647         * delegate.cs: Implement DefineType.  Take advantage of the
19648         refactored pattern for locating the parent builder without taking
19649         the parent_builder argument (which we know does not work if we are
19650         nested, and triggering a toplevel definition).
19651
19652 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19653
19654         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19655         accessibility of a member has changed during override and report
19656         an error if so.
19657
19658         * class.cs (Method.Define, Property.Define): Only complain on
19659         overrides if the method is private, any other accessibility is
19660         fine (and since we just checked the permission is the same, we are
19661         good to go).
19662
19663         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19664         and elif are processed always.  The other pre-processing
19665         directives are only processed if we are "taking" the path
19666
19667 2002-03-29  Martin Baulig  <martin@gnome.org>
19668
19669         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19670         current location is not Null.
19671
19672         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19673         a separate method so we can profile it.
19674
19675         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19676         `span.Seconds' are just seconds, but no minutes or hours.
19677         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19678
19679 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19680
19681         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19682         Remove the gratuitous set of Final:
19683
19684                                 // If an interface implementation, then we can set Final.
19685                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19686                                     implementing.DeclaringType.IsInterface)
19687                                         flags |= MethodAttributes.Final;
19688
19689         I do not know what I was smoking when I used that.
19690
19691
19692         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19693         step into fixing the name resolution issues for delegates and
19694         unifying the toplevel name resolution.
19695
19696 2002-03-28  Martin Baulig  <martin@gnome.org>
19697
19698         * class.cs (Method.Emit): If we have a symbol writer, call its
19699         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19700         tell it about the current method.
19701
19702         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19703         writer that we're going to emit the first byte of IL code for a new
19704         statement (a new source line).
19705         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19706         EmitContext.Mark() before emitting any code.
19707
19708         * location.cs (SymbolDocument): Return null when we're Null.
19709
19710         * statement.cs (Statement): Moved the `Location loc' variable here.
19711         (Statement.EmitBoolExpression): If we have a symbol writer, call
19712         ec.Mark() before emitting any code to tell it that we're at the
19713         beginning of a new statement.
19714         (StatementExpression): Added `Location' argument to the constructor.
19715         (Block): Added public readonly variable `StartLocation' and public
19716         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19717         (Block): Added constructor which takes a start and end location.
19718         (Block.SetEndLocation): New method. This sets the end location.
19719         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19720         local variables we create.
19721         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19722         each statement and do also mark the begin and end of the block.
19723
19724         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19725         tell it the current lexer.Location, use Location.Null for the end of the
19726         block.
19727         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19728         current block, set its end location using SetEndLocation().
19729         (statement_expression): StatementExpression constructor now takes the
19730         lexer.Location as additional argument.
19731         (for_statement, declare_local_variables): Likewise.
19732         (declare_local_variables): When creating a new implicit block, use the
19733         new Block constructor and pass it the lexer.Location.
19734
19735 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19736
19737         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19738         members also on the parent interfaces recursively.
19739
19740 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19741
19742         * report.cs: Use new formats, since Gonzalo finished the missing
19743         bits. 
19744
19745         * expression.cs (Binary.ResolveOperator): added missing operator|
19746         operator& and operator^ for bool/bool.
19747
19748         * cs-parser.jay: CheckDef now takes a Location argument that is
19749         used to report errors more precisly (instead of reporting the end
19750         of a definition, we try to track something which is a lot closer
19751         to the source of the problem).
19752
19753         * cs-tokenizer.cs: Track global token use, so we can properly flag
19754         the use of #define/#undef after the first token has been seen.
19755
19756         Also, rename the reportXXXX to Error_DescriptiveName
19757
19758         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19759         TypeContainer, so that Enum and Interface can use this too.
19760
19761         * class.cs (TypeContainer.LookupInterfaceOrClass,
19762         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19763         `builder' argument.  Typically this was used to pass the parent
19764         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19765         the definition).  
19766
19767         The problem is that a nested class could trigger the definition of
19768         a toplevel class, and the builder would be obviously wrong in that
19769         case. 
19770
19771         So we drop this argument, and we compute dynamically the
19772         TypeBuilder/ModuleBuilder (the correct information was available
19773         to us anyways from DeclSpace.Parent)
19774
19775         * interface.cs (Interface.DefineInterface): Drop builder
19776         parameter cleanup like class.cs
19777
19778         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19779         like class.cs
19780
19781         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19782         values. 
19783
19784         (Try.Emit): Propagate the returns value from the statement.
19785
19786         (Return.Emit): Even if we are leavning 
19787
19788         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19789
19790         * modifiers.cs: Fix the computation of MethodAttributes flags.
19791
19792 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19793
19794         * driver.cs: allow compilation of files that start with '/'.
19795         Add a default case when checking the argument of --target.
19796
19797 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * interface.cs: Implement the same search algorithm for types in
19800         the interface code.
19801
19802         * delegate.cs: Do not allow multiple definition.
19803
19804         * Recovered ChangeLog that got accidentally amputated
19805
19806         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19807
19808         * rootcontext.cs: Load manually enum to allow core classes to
19809         contain enumerations.
19810
19811         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19812         Update to new static methods in TypeManager.
19813
19814         * typemanager.cs (GetMethod, GetConstructor): Use our
19815         implementation of FindMembers to find the members, since during
19816         corlib compilation, the types are TypeBuilders and GetMethod and
19817         GetConstructor do not work.
19818
19819         Make all methods in TypeManager static.
19820
19821         (InitCodeHelpers): Split the functionality from
19822         the InitCodeTypes function.
19823
19824         * driver.cs: Call InitCodeHelpers after we have populated the
19825         types. 
19826
19827         * cs-parser.jay (delegate_declaration): we did not used to compute
19828         the delegate name correctly for void delegates.
19829
19830 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19831
19832         * rootcontext.cs (RootContext): Init the interface_resolve_order
19833         and type_container_resolve_order always.
19834
19835         (ResolveCore, BootstrapCorlib_ResolveClass,
19836         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19837         compiler when compiling with --nostdlib
19838
19839         * class.cs (TypeContainer.DefineType): Check that our parent is
19840         not null.  This test is most important when we are bootstraping
19841         the core types.
19842
19843         * codegen.cs: Split out the symbol writing code.
19844
19845 2002-03-25  Martin Baulig  <martin@gnome.org>
19846
19847         * driver.cs (-g): Made -g an alias for --debug.
19848
19849 2002-03-24  Martin Baulig  <martin@gnome.org>
19850
19851         * codegen.cs (SymbolWriter): New public variable. Returns the
19852         current symbol writer.
19853         (CodeGen): Added `bool want_debugging_support' argument to the
19854          constructor. If true, tell the ModuleBuild that we want debugging
19855         support and ask it for the ISymbolWriter.
19856         (Save): If we have a symbol writer, call it's Close() method after
19857         saving the assembly.
19858
19859         * driver.c (--debug): New command line argument to create a
19860         debugger information file.
19861
19862         * location.cs (SymbolDocument): New public property. Returns an
19863         ISymbolDocumentWriter object for the current source file or null
19864         if we don't have a symbol writer.
19865
19866 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19867
19868         * driver.cs (LoadAssembly): Correctly return when all the paths
19869         have been tried and not before.
19870
19871         * statement.cs (Switch.Emit): return the actual coverage for this
19872         statement (returns/not-returns)
19873
19874         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19875         switch of the statement if we are the last switch section.  That
19876         kills two problems: try/catch problems (we used to emit an empty
19877         nop at the end) and switch statements where all branches would
19878         return. 
19879
19880 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19881
19882         * driver.cs: Add default assemblies (the equivalent to the
19883         Microsoft CSC.RSP file)
19884
19885         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19886         also update tokens_seen and set it to false.
19887
19888         * driver.cs: Implement --recurse for Mike.
19889
19890         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19891         correctly splitting out the paths.
19892
19893 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19894
19895         * interface.cs (Interface.PopulateProperty): Instead of using
19896         `parent' as the declaration space for the set parameters, use
19897         `this' 
19898
19899         * support.cs (InternalParameters): InternalParameters constructor
19900         takes a DeclSpace instead of a TypeContainer.
19901
19902         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19903         types are being initialized, load the address of it before calling
19904         the function.  
19905
19906         (New): Provide a mechanism to disable the generation of local
19907         value type temporaries when the caller will be providing us with
19908         an address to store it.
19909
19910         (ArrayCreation.EmitDynamicInitializers): Use it.
19911
19912 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19913
19914         * expression.cs (Invocation.EmitArguments): Only probe for array
19915         property if there is more than one argument.  Sorry about that.
19916
19917         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19918         empty param arrays.
19919
19920         * class.cs (Method.LabelParameters): Fix incorrect code path that
19921         prevented the `ParamArrayAttribute' from being applied to the
19922         params attribute.
19923
19924 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19925
19926         * support.cs (ReflectionParameters): Correctly compute whether the
19927         last argument is a params array.  Fixes the problem with
19928         string.Split ('a')
19929
19930         * typemanager.cs: Make the assemblies array always be non-null
19931         (empty, but non-null)
19932
19933         * tree.cs (RecordDecl): New function that abstracts the recording
19934         of names.  This reports error 101, and provides a pointer to the
19935         previous declaration.  Fixes a crash in the compiler.
19936
19937         * cs-parser.jay (constructor_declaration): Update to new grammar,
19938         and provide a constructor_body that can be empty.
19939
19940 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19941
19942         * driver.cs: Add support for --resources.
19943
19944         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19945         Make all types for the various array helper methods be integer.
19946
19947         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19948         CheckState to ConvCast.
19949
19950         (ConvCast): Now it takes a `checked' state argument, to avoid
19951         depending on the emit context for the conversion, and just using
19952         the resolve time setting.
19953
19954         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19955         instead of Invocation.EmitArguments.  We do not emit the original
19956         arguments, instead we emit those which have been converted to
19957         unsigned int expressions.
19958
19959         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19960
19961         * codegen.cs: ditto.
19962
19963         * expression.cs (LocalVariableReference): Drop the use of the
19964         Store function that depended on the variable index.
19965
19966         * statement.cs (VariableInfo): Drop the `Idx' property from this
19967         class, as this is not taking into account the indexes for
19968         temporaries tat we generate during the execution, getting the
19969         indexes wrong.
19970
19971         * class.cs: First emit class initializers, then call the parent
19972         constructor. 
19973
19974         * expression.cs (Binary): Fix opcode emision.
19975         (UnaryMutator.EmitCode): Support checked code generation
19976
19977         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19978         matches for events for both the Static and Instance scans,
19979         pointing to the same element.   Fix that.
19980
19981 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19982
19983         * rootcontext.cs (ResolveTree): Always set the
19984         interface_resolve_order, because nested interfaces will be calling
19985         into us.
19986
19987         * class.cs (GetInterfaceOrClass): Track the same resolution
19988         process used by TypeManager.LookupType.  This fixes the nested
19989         type lookups in class declarations (separate path from
19990         LookupType). 
19991
19992         (TypeContainer.DefineType): Also define nested interfaces.
19993         (TypeContainer.RegisterOrder): New public function used to
19994         register the order in which child interfaces need to be closed.
19995
19996         Nested interfaces need to be closed after their parents have been
19997         created. 
19998
19999         * interface.cs (InterfaceAttr): Put all the logic for computing
20000         the interface attribute here. 
20001
20002         (DefineInterface): Register our interface order with the
20003         RootContext or with the TypeContainer depending on the case.
20004
20005 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20006
20007         * cs-parser.jay: rework foreach statement to work with the new
20008         changes to the policy on SimpleNames.
20009
20010         * report.cs: support Stacktrace on warnings as well.
20011
20012         * makefile: drop --unsafe and /unsafe from the compile.
20013
20014 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20015
20016         * ecore.cs (StandardConversionExists): Modify to take an Expression
20017         as the first parameter. Ensure we do null -> reference type conversion
20018         checking.
20019
20020         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20021         temporary Expression objects.
20022
20023 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20024
20025         * interface.cs: workaround bug in method overloading resolution
20026         (there is already a bugzilla bug for it).
20027
20028 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20029
20030         We could also solve this problem by having a separate path for
20031         performing type lookups, instead of DoResolve, we could have a
20032         ResolveType entry point, and only participating pieces of the
20033         production (simplename, deref, array) would implement this. 
20034
20035         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20036         signal SimpleName to only resolve type names and not attempt to
20037         resolve anything else.
20038
20039         * expression.cs (Cast): Set the flag.
20040
20041         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20042
20043         * class.cs: Only report 108 if there is no `new' modifier.
20044
20045         * cs-parser.jay: rework foreach statement to work with the new
20046         changes to the policy on SimpleNames.
20047         
20048         * report.cs: support Stacktrace on warnings as well.
20049
20050         * makefile: drop --unsafe and /unsafe from the compile.
20051
20052 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20053
20054         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20055         lookups here, instead of doing that at parse time.  This means
20056         that our grammar will not introduce `LocalVariableReferences' as
20057         expressions at this point.  That solves the problem of code like
20058         this:
20059
20060         class X {
20061            static void Main ()
20062            { int X = 1;
20063             { X x = null }}}
20064
20065         This is only half the fix.  The full fix requires parameters to
20066         also be handled in this way.
20067
20068         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20069         makes the use more obvious of the DeclSpace.  The
20070         ec.TypeContainer.TypeBuilder is now only used to pull the
20071         TypeBuilder for it.
20072
20073         My theory is that I can get rid of the TypeBuilder completely from
20074         the EmitContext, and have typecasts where it is used (from
20075         DeclSpace to where it matters).  
20076
20077         The only pending problem is that the code that implements Aliases
20078         is on TypeContainer, and probably should go in DeclSpace.
20079
20080         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20081         lookups here, instead of doing that at parse time.  This means
20082         that our grammar will not introduce `LocalVariableReferences' as
20083         expressions at this point.  That solves the problem of code like
20084         this:
20085
20086         class X {
20087            static void Main ()
20088            { int X = 1;
20089             { X x = null }}}
20090
20091         This is only half the fix.  The full fix requires parameters to
20092         also be handled in this way.
20093
20094         * class.cs (Property.DefineMethod): When implementing an interface
20095         method, set newslot, when implementing an abstract method, do not
20096         set the flag (before we tried never setting it, or always setting
20097         it, which is the difference).
20098         (Indexer.DefineMethod): same.
20099         (Method.DefineMethod): same.
20100
20101         * ecore.cs: Only set the status used flag if we get back a Field.
20102
20103         * attribute.cs: Temporary hack, so Paolo can keep working.
20104
20105 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20106
20107         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20108         the unmanaged type in the case we have a MarshalAs attribute.
20109
20110         (Resolve): Handle the case when we are parsing the special MarshalAs
20111         attribute [we need to store the unmanaged type to use later]
20112
20113         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20114         MarshalAs Attribute.
20115
20116         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20117         on parameters and accordingly set the marshalling info.
20118
20119 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20120
20121         * class.cs: Optimizing slightly by removing redundant code after
20122         we switched to the `NoTypes' return value.
20123         (Property.DefineMethod): use NoTypes here too.
20124
20125         This fixes the bug I introduced in my last batch of changes.
20126
20127 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20128
20129         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20130
20131         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20132         Enums since those are types too. 
20133
20134         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20135
20136         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20137         thanks to a call during the lookup process.
20138
20139 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20140
20141         * statement.cs (Foreach): Lots of work to accomodate a particular
20142         kind of foreach statement that I had not kept in mind.  It is
20143         possible to have foreachs on classes that provide a GetEnumerator
20144         method that return objects that implement the "pattern" for using
20145         a foreach, there is no need to support GetEnumerator
20146         specifically. 
20147
20148         This is needed to compile nant.
20149
20150         * decl.cs: Only report 114 if the member is not `Finalize' and if
20151         the warning level is at least 2.
20152
20153         * class.cs: Moved the compare function from Method to
20154         MethodSignature. 
20155
20156         (MethodSignature.InheritableMemberSignatureCompare): Add new
20157         filter function that is used to extract inheritable methods from a
20158         class. 
20159
20160         (Method.Define): Use the new `inheritable_method_signature_filter'
20161         delegate
20162
20163         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20164         command. 
20165
20166 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20167
20168         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20169
20170         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20171
20172         * expression.cs: Pass location information to
20173         ConvertImplicitStandard. 
20174
20175         * class.cs: Added debugging code to track return values from
20176         interfaces. 
20177
20178 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20179
20180         * expression.cs (Is.DoResolve): If either side of the `is' is an
20181         interface, do not flag the warning.
20182
20183         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20184         for interfaces
20185
20186         * report.cs: Allow for --fatal to be used with --probe.
20187
20188         * typemanager.cs (NoTypes): Move the definition for the empty Type
20189         array here. 
20190
20191         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20192         properties. 
20193         (TypeContainer.DefineProxy): New function used to proxy to parent
20194         implementations when implementing interfaces.
20195         (TypeContainer.ParentImplements): used to lookup if our parent
20196         implements a public function that is required by an interface.
20197         (TypeContainer.VerifyPendingMethods): Hook this up.
20198
20199         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20200         `modules' and `assemblies' arraylists into arrays.  We only grow
20201         these are the very early start up of the program, so this improves
20202         the speedof LookupType (nicely measured).
20203
20204         * expression.cs (MakeByteBlob): Replaced unsafe code with
20205         BitConverter, as suggested by Paolo.
20206
20207         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20208         folding of string concatenation, but if either side is a string,
20209         and the other is not, then return null, and let the runtime use
20210         the concatenation on the string plus the object (using
20211         `Object.ToString'). 
20212
20213 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20214
20215         Constant Folding has been implemented now.
20216
20217         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20218         the error instead on types that are not supported in one's
20219         complement. 
20220
20221         * constant.cs (Constant and all children): New set of functions to
20222         perform implict and explicit conversions.
20223
20224         * ecore.cs (EnumConstant): Implement the new functions to perform
20225         conversion by proxying to the child expression.
20226
20227         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20228         own separate setting that can not be turned off from the command
20229         line using --unchecked or --checked and is only controlled using
20230         the checked/unchecked statements and expressions.  This setting is
20231         used by the constant folder to flag errors.
20232
20233         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20234         ConstantCheckState as well.   
20235
20236         During Resolve, they also have to flag the state, because the
20237         constant folder runs completely in the Resolve phase.
20238
20239         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20240         well.
20241
20242 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20243
20244         * cfold.cs: New file, this file contains the constant folder.
20245
20246         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20247         argument to track whether we are using the resulting address to
20248         load or store a value and provide better error messages. 
20249
20250         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20251         new AddressOf arguments.
20252
20253         * statement.cs (Foreach.EmitCollectionForeach): Update
20254
20255         * expression.cs (Argument.Emit): Call AddressOf with proper
20256         arguments to track usage.
20257
20258         (New.DoEmit): Call AddressOf with new arguments.
20259
20260         (Unary.Emit): Adjust AddressOf call.
20261
20262 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20263
20264         * cs-parser.jay (member_access): Change the case for pre-defined types
20265         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20266         this suggestion.
20267
20268         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20269         a method body.
20270
20271         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20272         essentially like methods and apply attributes like MethodImplOptions to them too.
20273
20274         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20275         not being null.
20276
20277         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20278         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20279         is the DeclSpace.
20280
20281         * Update code everywhere accordingly.
20282
20283         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20284
20285         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20286
20287 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20288
20289         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20290         try performing lookups against those instead of jumping straight into using
20291         the 'using' clauses.
20292
20293         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20294
20295         (LookupType): Perform lookups in implicit parents too.
20296
20297         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20298         sequence as RootContext.LookupType. 
20299
20300         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20301         the various cases of namespace lookups into this method.
20302
20303 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20304
20305         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20306         in positional arguments)
20307
20308         * class.cs (Operator): Update the AllowedModifiers to contain
20309         extern. 
20310
20311         * cs-parser.jay: Update operator declaration to allow for the
20312         operator body to be empty.
20313
20314         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20315         values. 
20316
20317 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20318
20319         * class.cs (Method.Emit): Label parameters.
20320
20321         * driver.cs: Return 1 or 0 as the program exit code.
20322
20323 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20324
20325         * expression.cs: Special case the `null' object when trying to
20326         auto-compute the type, as anything can be explicitly converted to
20327         that. 
20328
20329         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20330         spotting this Paolo.
20331
20332         (Expression.ImplicitNumericConversion): Perform comparissions of
20333         the type using the underlying type in the case of an enumeration
20334         rather than using the enumeration type for the compare.
20335
20336         Cope with the underlying == type case, which is not possible to
20337         catch before. 
20338
20339         (Expression.ConvertNumericExplicit): Perform comparissions of
20340         the type using the underlying type in the case of an enumeration
20341         rather than using the enumeration type for the compare.
20342
20343         * driver.cs: If the user does not supply an extension, assume .exe
20344
20345         * cs-parser.jay (if_statement): Rewrote so that we can track the
20346         location for the if statement.
20347
20348         * expression.cs (Binary.ConstantFold): Only concat strings when
20349         the operation is "+", not everything ;-)
20350
20351         * statement.cs (Statement.EmitBoolExpression): Take a location
20352         argument. 
20353         (If, While, Do): Track location.
20354
20355         * expression.cs (Binary.ResolveOperator): In the object + string
20356         case, I was missing a call to ConvertImplicit
20357
20358 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20359
20360         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20361         Location arguments. Ensure we use RootContext.LookupType to do our work
20362         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20363
20364         * interface.cs (PopulateMethod): Handle the type of the parameter being
20365         null gracefully.
20366
20367         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20368         have a params method with no fixed arguments and a call is made with no
20369         arguments.
20370
20371 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20372
20373         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20374         the verbatim-string-literal
20375
20376         * support.cs (InternalParameters.ParameterModifier): handle null
20377         fixed parameters.
20378         (InternalParameters.ParameterType): ditto.
20379
20380         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20381         duplicating the name of the variable parameter.
20382         (GetParameterByName): Fix bug where we were not looking up array
20383         paramters if they were the only present (thanks Paolo!).
20384         (GetParameterInfo): We only have an empty set of types if both
20385         fixed and array are set to null.
20386         (GetParameterInfo-idx): Handle FixedParameter == null
20387
20388         * cs-parser.jay: Handle the case where there is no catch
20389         statements (missing null test).
20390
20391 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20392
20393         * driver.cs (MainDriver): Be conservative on our command line
20394         handling.
20395
20396         Catch DirectoryNotFoundException when calling GetFiles.
20397
20398         (SplitPathAndPattern): Used to split the input specification into
20399         a path and a pattern that we can feed to Directory.GetFiles.
20400
20401 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20402
20403         * statement.cs (Fixed): Implement the last case of the Fixed
20404         statement (string handling).
20405
20406         * expression.cs (StringPtr): New class used to return a char * to
20407         a string;  Used by the Fixed statement.
20408
20409         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20410
20411         * expression.cs (Binary.ResolveOperator): Remove redundant
20412         MemberLookup pn parent type.
20413         Optimize union call, we do not need a union if the types are the same.
20414         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20415         type.
20416
20417         Specialize the use of MemberLookup everywhere, instead of using
20418         the default settings. 
20419
20420         (StackAlloc): Implement stackalloc keyword.
20421
20422         * cs-parser.jay: Add rule to parse stackalloc.
20423
20424         * driver.cs: Handle /h, /help, /?
20425
20426         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20427         before we supported unsafe code.
20428
20429         * makefile: add --unsafe to the self compilation of mcs.
20430
20431 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20432
20433         * expression.cs (PointerArithmetic): New class that is used to
20434         perform pointer arithmetic.
20435         (Binary.Resolve): Handle pointer arithmetic
20436         Handle pointer comparission.
20437         (ArrayPtr): Utility expression class that is used to take the
20438         address of an array.
20439
20440         (ElementAccess): Implement array access for pointers
20441
20442         * statement.cs (Fixed): Implement fixed statement for arrays, we
20443         are missing one more case before we are done.
20444
20445         * expression.cs (Indirection): Implement EmitAssign and set the
20446         ExprClass to Variable.  This allows pointer dereferences to be
20447         treated as variables, and to have values assigned to them.
20448
20449         * ecore.cs (Expression.StoreFromPtr): New utility function to
20450         store values dereferencing.
20451
20452 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20453
20454         * expression.cs (Binary.ResolveOperator): Ensure that we are
20455         not trying to operate on a void type - this fixes the reported
20456         bug.
20457
20458         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20459         the parent implementation is sealed.
20460
20461         * ../errors/cs0239.cs : Add.
20462
20463         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20464
20465         * typemanager.cs (unverifiable_code_type): Corresponds to 
20466         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20467         which have unsafe code in them.
20468
20469         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20470         unsafe context.
20471
20472 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20473
20474         * cs-tokenizer.cs: Add support for @"litreal strings"
20475
20476         Make tokenizer accept pre-processor directives
20477         on any column (remove the old C-like limitation). 
20478
20479         * rootcontext.cs (EmitCode): Emit any global attributes.
20480         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20481
20482         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20483
20484         * cs-parser.jay: Add support for global attributes.  
20485
20486 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20487
20488         * expression.cs (Indirection): New helper class.  Unary will
20489         create Indirection classes to be able to implement the
20490         IMemoryLocation interface on it.
20491
20492 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20493
20494         * cs-parser.jay (fixed_statement): reference the right statement.
20495
20496         * statement.cs (Fixed.Emit): Finish implementing the fixed
20497         statement for the &x case.
20498
20499 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20500
20501         * class.cs (Property.Define, Method.Define): Remove newslot when
20502         `implementing'.  
20503
20504         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20505         wrong.  NewSlot should only be used if the `new' keyword is present.
20506
20507         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20508         locating our system dir.  Sorry about this.
20509
20510 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20511
20512         * driver.cs (GetSystemDir): Compute correctly the location of our
20513         system assemblies.  I was using the compiler directory instead of
20514         the library directory.
20515
20516 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20517
20518         * expression.cs (BetterFunction): Put back in what Miguel commented out
20519         since it is the correct fix. The problem is elsewhere ;-)
20520
20521         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20522         parameters of the parms method are themselves compatible or not !
20523
20524         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20525         to check that a class implements an interface before saying that an implicit
20526         conversion was allowed. Use ImplementsInterface to do the checking.
20527
20528 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20529
20530         * class.cs (Method.Define): Track whether we are an explicit
20531         implementation or not.  And only call DefineMethodOverride if we
20532         are an explicit implementation.
20533
20534         (Property.DefineMethod): Ditto.
20535
20536 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20537
20538         * expression.cs (BetterFunction): Catch hideous bug which was
20539          preventing us from detecting ambiguous calls due to implicit casts i.e
20540         cs0121.
20541
20542 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20543
20544         * support.cs (Pair): Remove un-needed method.  I figured why I was
20545         getting the error in cs-parser.jay, the variable in a foreach loop
20546         is readonly, and the compiler does not really treat this as a variable.
20547
20548         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20549         instead of EQUALS in grammar.  
20550
20551         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20552
20553         * expression.cs (Unary.DoResolve): Check whether the argument is
20554         managed or not.
20555
20556 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20557
20558         * support.cs: Api for Pair to set a value.  Despite the fact that
20559         the variables are public the MS C# compiler refuses to compile
20560         code that accesses the field if the variable is part of a foreach
20561         statement. 
20562
20563         * statement.cs (Fixed): Begin implementation of the fixed
20564         statement.
20565
20566         (Block.AddVariable): Return the VariableInfo on success and null
20567         on failure instead of true/false. 
20568
20569         * cs-parser.jay (foreach): Catch errors on variables already
20570         defined (we were ignoring this value before) and properly unwind
20571         the block hierarchy
20572
20573         (fixed_statement): grammar for the fixed statement.
20574
20575 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20576
20577         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20578         pointer types to be incretemented.
20579
20580         (SizeOf): Implement.
20581
20582         * cs-parser.jay (pointer_member_access): Implement
20583         expr->IDENTIFIER production.
20584
20585         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20586         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20587         on safe contexts.
20588
20589         (Unary): Implement indirection.
20590
20591         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20592         use in non-unsafe context).
20593
20594         (SimpleName.DoResolve): Check for pointers in field access on safe
20595         contexts. 
20596
20597         (Expression.LoadFromPtr): Factor the load-indirect code in this
20598         function.  This was duplicated in UnboxCast and ParameterReference
20599
20600 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20601
20602         * expression.cs (ComposedCast): report an error if a pointer cast
20603         is used in a safe region.
20604
20605         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20606         pointer type casts in unsafe context.
20607
20608         * codegen.cs (EmitContext): Set up IsUnsafe.
20609
20610         * cs-parser.jay (non_expression_type): Add productions for pointer
20611         casts. 
20612
20613         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20614         code.  We should not use force into static mode if the method is
20615         not virtual.  Fixes bug in MIS
20616
20617         * statement.cs (Do.Emit, While.Emit, For.Emit,
20618         Statement.EmitBoolExpression): Add support to Do and While to
20619         propagate infinite loop as `I do return' semantics.
20620
20621         Improve the For case to also test for boolean constants.
20622
20623         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20624         to the list of attributes we can add.
20625
20626         Remove `EmitContext' argument.
20627
20628         * class.cs (Method.Define): Apply parameter attributes.
20629         (Constructor.Define): Apply parameter attributes.
20630         (MethodCore.LabelParameters): Move here the core of labeling
20631         parameters. 
20632
20633         * support.cs (ReflectionParameters.ParameterModifier,
20634         InternalParameters.ParameterModifier): Use IsByRef on the type and
20635         only return the OUT bit for these parameters instead of in/out/ref
20636         flags.
20637
20638         This is because I miss-understood things.  The ParameterInfo.IsIn
20639         and IsOut represent whether the parameter has the [In] and [Out]
20640         attributes set.  
20641
20642 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20643
20644         * ecore.cs (FieldExpr.Emit): Release temporaries.
20645
20646         * assign.cs (LocalTemporary.Release): new function.
20647
20648         * codegen.cs (EmitContext.GetTemporaryStorage,
20649         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20650         temporary storage.  Now we can "put back" localbuilders when we
20651         are done with them
20652
20653 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20654
20655         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20656         need to make a copy of the variable to generate verifiable code.
20657
20658 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20659
20660         * driver.cs: Compute dynamically the system directory.
20661
20662         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20663         Slower, but more generally useful.  Used by the abstract
20664         registering implementation. 
20665
20666         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20667         the rules for the special rule on Type/instances.  First check if
20668         we have the same name, and if so, try that special static path
20669         rather than the instance path.
20670
20671 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20672
20673         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20674         for, while and if.
20675
20676         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20677         Enum, ValueType, Delegate or Array for non-corlib compiles.
20678
20679         * cs-tokenizer.cs: Catch long identifiers (645)
20680
20681         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20682         piece of code.
20683
20684         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20685         fix, we were returning too early, so we were not registering
20686         pending methods from abstract classes.
20687
20688         Do not register pending methods if the class is abstract.
20689
20690         * expression.cs (Conditional.DoResolve): Report circular implicit
20691         conversions when we neecd to compute it for conditional
20692         expressions. 
20693
20694         (Is.DoResolve): If the expression is always of the provided type,
20695         flag warning 183.  If the expression can not ever be of the
20696         provided type flag warning 184.
20697
20698         * class.cs: Catch 169 as well.
20699
20700         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20701         read. 
20702
20703 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20704
20705         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20706
20707 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20708
20709         * interface.cs: (PopulateMethod): Check for pointers being defined
20710         only if the unsafe context is active.
20711         (PopulateProperty): ditto.
20712         (PopulateIndexer): ditto.
20713
20714         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20715         specified.  If pointers are present, make sure that they are
20716         present in an unsafe context.
20717         (Constructor, Constructor.Define): ditto.
20718         (Field, Field.Define): ditto.
20719         (Property, Property.Define): ditto.
20720         (Event, Event.Define): ditto.
20721
20722         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20723         hashtable if there are classes or structs defined.
20724
20725         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20726         code, as the constant resolution moved.
20727
20728         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20729         the metadata, so we can flag error 133. 
20730
20731         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20732         pointer is being declared in an unsafe context.
20733
20734 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20735
20736         * modifiers.cs (Modifiers.Check): Require a Location argument.
20737         Report error 227 for Unsafe use.
20738
20739         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20740
20741         * statement.cs (For.Emit): If the test is null, then report that
20742         we do `return', as we wont reach anything afterwards.
20743
20744         (Switch.SwitchGoverningType): Track the expression that matched
20745         the conversion.
20746
20747         * driver.cs: Allow negative numbers as an error code to flag.
20748
20749         * cs-parser.jay: Handle 1551.
20750
20751         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20752
20753 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20754
20755         * cs-parser.jay: Report 1518 (type declaration can only contain
20756         class, struct, interface, enum or delegate)
20757
20758         (switch_label): Report 1523 (keywords `case' or `default' must
20759         preced code)
20760
20761         (opt_switch_sections): Report 1522 (empty switch)
20762
20763         * driver.cs: Report 1515 (response file specified multiple times)
20764         Report 1516 (Source file specified multiple times).
20765
20766         * expression.cs (Argument.Resolve): Signal 1510
20767
20768         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20769         access not allowed in static code)
20770
20771 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20772
20773         * typemanager.cs (IsPointerType): Utility method which we are going
20774         to need a lot.
20775
20776         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20777         the object type, so we take care of that.
20778
20779         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20780
20781         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20782         added to non-params parameters :-)
20783
20784         * typemanager.cs (CSharpName): Include 'void' type too. 
20785
20786         (void_ptr_type): Include in the set of core types.
20787
20788         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20789         duplicating code.
20790
20791         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20792         an unsafe context.
20793
20794         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20795         completely forgotten about it.
20796
20797 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20798
20799         * cs-parser.jay (pointer_type): Add. This begins our implementation
20800         of parsing rules for unsafe code.
20801
20802         (unsafe_statement): Implement.
20803
20804         (embedded_statement): Modify to include the above.
20805
20806         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20807
20808         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20809         if the current context is an unsafe one.
20810
20811         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20812         are handled differently, we need separate rules for them.
20813
20814         (local_variable_declaration): Update to use local_variable_pointer_type
20815         to allow variable declarations of unmanaged pointer types.
20816
20817         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20818         in unsafe contexts.
20819
20820         * ../errors/cs0214.cs : Add.
20821
20822 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20823
20824         * makefile: remove 'response' file when cleaning.
20825
20826 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20827
20828         * cs-parser.jay: Report 1524.
20829
20830 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20831
20832         * typemanager.cs (RegisterMethod): drop checking if we have
20833         registered this from here
20834
20835 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20836
20837         * class.cs (Method.EmitDestructor): Implement calling our base
20838         destructor. 
20839
20840         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20841         value of InFinally.
20842
20843         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20844         this routine and will wrap the call in a try/catch block.  Deal
20845         with the case.
20846
20847 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20848
20849         * ecore.cs (Expression.MemberLookup): instead of taking a
20850         parameter `same_type' that was used to tell whether we could
20851         access private members we compute our containing type from the
20852         EmitContext.
20853
20854         (FieldExpr): Added partial support for volatile fields.  This does
20855         not work for volatile fields exposed from assemblies, as I can not
20856         figure out how to extract the modreq from it.
20857
20858         Updated all the source files to use this.
20859
20860         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20861         because it is referenced by MemberLookup very often. 
20862
20863 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20864
20865         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20866         TypeBuilder.GetCustomAttributes to retrieve what we need.
20867
20868         Get rid of redundant default_member_attr_type as this is the same as
20869         default_member_type which already exists.
20870
20871         * interface.cs, attribute.cs : Update accordingly.
20872
20873 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20874
20875         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20876         work for TYpeBuilders though.  Ravi, can you please fix this?
20877
20878         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20879
20880         * expression.cs (Argument.Emit): Handle the case of ref objects
20881         being passed to ref functions;  
20882
20883         (ParameterReference.EmitLoad): Loads the content of the pointer
20884         without dereferencing.
20885
20886 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20887
20888         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20889
20890 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20891
20892         * class.cs (Indexer.DefineMethod): Incorporate the interface
20893         type in the name of the method if we are doing explicit interface
20894         implementation.
20895
20896         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20897
20898         (BetterConversion): Fix extremely trivial bug where we were referring to
20899         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20900         again !
20901
20902         * ../errors/bug16.cs : Add although we have fixed it.
20903
20904 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20905
20906         * expression.cs (BaseIndexer): Begin implementation.
20907
20908         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20909
20910         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20911         production directly to remove a shift/reduce, and implement
20912         explicit interface implementation.
20913
20914         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20915         after a floating point suffix.
20916
20917         * expression.cs (DoNumericPromotions): Improved the conversion for
20918         uint/uint.  If we have a constant, we avoid doing a typecast to a
20919         larger type.
20920
20921         * class.cs (Indexer): Implement explicit interface implementation
20922         for indexers.
20923
20924 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20925
20926         * class.cs: make the default instance constructor public and hidebysig.
20927
20928 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20929
20930         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20931         so we can call it from elsewhere.
20932
20933         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20934         we emit it internally if the class has a defined indexer; otherwise the user
20935         emits it by decorating the class definition with the DefaultMemberAttribute.
20936
20937         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20938         attribute is not used on a type which defines an indexer.
20939
20940         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20941         character when we skip whitespace.
20942
20943         * ../errors/cs0646.cs : Add.
20944
20945 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20946
20947         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20948         again. 
20949
20950         * makefile: Add practical target `mcs3.exe' which builds the third
20951         generation compiler. 
20952
20953         * expression.cs (New): Fix structures constructor calling.
20954
20955         * class.cs (Property, Method, Indexer): Emit Final flag on the
20956         method if we are an interface implementation and we are not
20957         abstract. 
20958
20959         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20960         whether this property is referencing a `base' method.
20961
20962         * expression.cs (Invocation.EmitCall): take an extra argument:
20963         is_base, this is used to determine whether the `call' or
20964         `callvirt' opcode should be used.
20965
20966
20967         * delegate.cs: update EmitCall.
20968
20969         * class.cs (Method.Define): Set NewSlot for the cases where we are
20970         not implementing an interface method.
20971
20972         (Property.Define): ditto.
20973
20974 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20975
20976         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20977         'r'.  Allows mcs to parse itself fully.
20978
20979 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20980
20981         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20982         of the number of initializers that require the InitializeArray method.
20983
20984         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20985         update the above field where necessary.
20986
20987         (MakeByteBlob): Update accordingly.
20988
20989         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20990         greater than 2.
20991
20992         (EmitDynamicInitializers): Update in accordance with the new optimization.
20993
20994         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20995         same OpCode applies.
20996
20997         * cs-parser.jay : Fix some glaring errors I introduced.
20998
20999 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21000
21001         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21002         so that we can check for name clashes there too.
21003
21004         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21005         for interface indexers.
21006
21007         * interfaces.cs (Define): Emit the default member attribute.
21008
21009         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21010         variable was being referred to while setting the value ;-)
21011
21012 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21013
21014         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21015         byte-by-byte information when we know the data is zero.
21016
21017         Make the block always a multiple of 4, because
21018         DefineInitializedData has a bug.
21019
21020         * assign.cs: Fix, we should assign from the temporary, not from
21021         the source. 
21022
21023         * expression.cs (MakeByteBlob): Fix my incorrect code.
21024
21025 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21026
21027         * typemanager.cs (EnumToUnderlying): This function is used to get
21028         the underlying type from an enumeration, because it does not
21029         always work. 
21030
21031         * constant.cs: Use the I4_S form for values between -128 and 127.
21032
21033         * statement.cs (Block.LookupLabel): Looks up a label.
21034         (Block): Drop support for labeled blocks.
21035
21036         (LabeledStatement): New kind of statement that represents a label
21037         only.
21038
21039         (Goto): Finally implement this bad boy.
21040
21041         * cs-parser.jay: Update to reflect new mechanism to implement
21042         labels.
21043
21044 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21045
21046         * codegen.cs (EmitContext.This): a codegen property that keeps the
21047         a single instance of this instead of creating many different this
21048         instances. 
21049
21050         * delegate.cs (Delegate.DoResolve): Update to use the property;
21051
21052         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21053
21054         * expression.cs (BaseAccess.DoResolve): Ditto.
21055
21056 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21057
21058         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21059         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21060
21061         (InitCoreTypes): Update accordingly.
21062
21063         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21064         so we can quickly store the state.
21065
21066         (ApplyAttributes): Set the correct implementation flags
21067         for InternalCall methods.
21068
21069 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21070
21071         * expression.cs (EmitCall): if a method is not virtual, then do
21072         not use callvirt on it.
21073
21074         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21075         user defined stuff) requires the use of stobj, which takes an
21076         address on the stack instead of an array and an index.  So emit
21077         the Ldelema operation for it.
21078
21079         (EmitStoreOpcode): Use stobj for valuetypes.
21080
21081         (UnaryMutator.EmitCode): Use the right 1 value depending on
21082         whether we are dealing with int64/uint64, float or doubles.
21083
21084         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21085         constructors that I implemented last night.
21086
21087         (Constructor.IsDefault): Fix to work properly for static
21088         constructors.
21089
21090         * cs-parser.jay (CheckDef): report method signature errors.
21091         Update error number 103 to be 132.
21092
21093         * decl.cs: New AdditionResult enumeration value: MethodExists.
21094         Although we do this check for methods later on in the semantic
21095         analysis, catching repeated default constructors is so easy that
21096         we catch these here. 
21097
21098         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21099         promotions code.
21100
21101         (ParameterReference.EmitAssign, Emit): handle
21102         bools as bytes.
21103
21104         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21105         (ArrayAccess.EmitStoreOpcode): ditto.
21106
21107         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21108
21109         * expression.cs (MakeByteBlob): Complete all the missing types
21110         (uint, short, ushort, byte, sbyte)
21111
21112         * class.cs: Only init instance field initializers on instance
21113         constructors. 
21114
21115         Rename `constructors' to instance_constructors. 
21116
21117         (TypeContainer.AddConstructor): Only add constructors to the list
21118         if it is not static.
21119
21120         Make sure that we handle default_static_constructor independently
21121         everywhere where we handle instance_constructors
21122
21123 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21124
21125         * class.cs: Do not lookup or create a base initializer for a
21126         static constructor.
21127
21128         (ConstructorInitializer.Resolve): use the proper type to lookup
21129         for constructors.
21130
21131         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21132
21133         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21134         in DeclSpace. 
21135
21136         * decl.cs: CloseType is now an virtual method, the default
21137         implementation just closes this type.
21138
21139 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21140
21141         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21142         to PreserveSig by default. Also emit HideBySig on such methods.
21143
21144         Basically, set the defaults to standard values.
21145
21146         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21147         argument, if candidate is better, it can't be worse than the best !
21148
21149         (Invocation): Re-write bits to differentiate between methods being
21150         applicable in their expanded form and their normal form - for params
21151         methods of course.
21152
21153         Get rid of use_standard everywhere as only standard conversions are allowed
21154         in overload resolution. 
21155
21156         More spec conformance.
21157
21158 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21159
21160         * driver.cs: Add --timestamp, to see where the compiler spends
21161         most of its time.
21162
21163         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21164         `this' in static code.
21165
21166         (SimpleName.DoResolve): Implement in terms of a helper function
21167         that allows static-references to be passed upstream to
21168         MemberAccess.
21169
21170         (Expression.ResolveWithSimpleName): Resolve specially simple
21171         names when called by MemberAccess to implement the special
21172         semantics. 
21173
21174         (Expression.ImplicitReferenceConversion): Handle conversions from
21175         Null to reference types before others, as Null's type is
21176         System.Object. 
21177
21178         * expression.cs (Invocation.EmitCall): Handle the special case of
21179         calling methods declared on a reference type from a ValueType
21180         (Base classes System.Object and System.Enum)
21181
21182         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21183         the left hand side is a TypeExpr, not on every enumeration. 
21184
21185         (Binary.Resolve): If types are reference types, then do a cast to
21186         object on operators != and == of both arguments.
21187
21188         * typemanager.cs (FindMembers): Extract instance and static
21189         members if requested.
21190
21191         * interface.cs (PopulateProperty): Use void_type instead of null
21192         as the return type for the setter method.
21193
21194         (PopulateIndexer): ditto.
21195
21196 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21197
21198         * support.cs (ReflectionParameters): Fix minor bug where we
21199         were examining the wrong parameter for the ParamArray attribute.
21200
21201         Cope with requests for the type of the parameter at position
21202         greater than the params parameter's. We now return the element
21203         type of the params array as that makes more sense.
21204
21205         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21206         accordingly as we no longer have to extract the element type
21207         ourselves.
21208
21209         (Invocation.OverloadResolve): Update.
21210
21211 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21212
21213         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21214         against IEnumerator, test whether the return value is a descendant
21215         of the IEnumerator interface.
21216
21217         * class.cs (Indexer.Define): Use an auxiliary method to implement
21218         the other bits of the method definition.  Begin support for
21219         explicit interface implementation.
21220
21221         (Property.DefineMethod): Use TypeManager.void_type instead of null
21222         for an empty return value.
21223
21224 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21225
21226         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21227         dealing with a FieldExpr which is composed of a FieldBuilder, in
21228         the code path we did extract the constant, but we should have
21229         obtained the underlying value to be able to cast it (otherwise we
21230         end up in an infinite loop, this is what Ravi was running into).
21231
21232         (ArrayCreation.UpdateIndices): Arrays might be empty.
21233
21234         (MemberAccess.ResolveMemberAccess): Add support for section
21235         14.5.4.1 that deals with the special case of E.I when E is a type
21236         and something else, that I can be a reference to a static member.
21237
21238         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21239         handle a particular array type to create byte blobs, it is just
21240         something we dont generate byteblobs for.
21241
21242         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21243         arguments. 
21244
21245         * location.cs (Push): remove the key from the hashtable that we
21246         are about to add.   This happens for empty files.
21247
21248         * driver.cs: Dispose files after we have parsed them.
21249
21250         (tokenize): new function that only runs the tokenizer on its
21251         input, for speed testing.
21252
21253 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21254
21255         * class.cs (Event.Define): Define the private field only if there
21256         are no accessors defined.
21257
21258         * expression.cs (ResolveMemberAccess): If there is no associated
21259         field with the event, that means we have an event defined with its
21260         own accessors and we should flag error cs0070 since transforming
21261         ourselves into a field is not valid in that case.
21262
21263         * ecore.cs (SimpleName.DoResolve): Same as above.
21264
21265         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21266         and charset to sane values.
21267
21268 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21269
21270         * assign.cs (DoResolve): Perform check on events only if they 
21271         are being accessed outside the declaring type.
21272
21273         * cs-parser.jay (event_declarations): Update rules to correctly
21274         set the type of the implicit parameter etc.
21275
21276         (add_accessor, remove_accessor): Set current local parameters.
21277
21278         * expression.cs (Binary): For delegate addition and subtraction,
21279         cast the return value from the method into the appropriate delegate
21280         type.
21281
21282 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21283
21284         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21285         of these as the workaround is unnecessary.
21286
21287         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21288         delegate data - none of that is needed at all.
21289
21290         Re-write bits to extract the instance expression and the delegate method
21291         correctly.
21292
21293         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21294         on delegates too.
21295
21296         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21297         of attaching attributes instead of duplicating code everywhere.
21298
21299         * everywhere : Update code to do attribute emission using the above method.
21300
21301 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21302
21303         * expression.cs (IsParamsMethodApplicable): if there are not
21304         parameters, return immediately.
21305
21306         * ecore.cs: The 0 literal can be implicity converted to an enum
21307         type. 
21308
21309         (SimpleName.DoResolve): First lookup the type, then lookup the
21310         members. 
21311
21312         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21313         want to get its address.  If the InstanceExpression is not
21314         addressable, store the result in a temporary variable, then get
21315         the address of it.
21316
21317         * codegen.cs: Only display 219 errors on warning level or above. 
21318
21319         * expression.cs (ArrayAccess): Make it implement the
21320         IMemoryLocation interface.
21321
21322         (Binary.DoResolve): handle the operator == (object a, object b)
21323         and operator != (object a, object b) without incurring into a
21324         BoxedCast (because 5 != o should never be performed).
21325
21326         Handle binary enumerator operators.
21327
21328         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21329         value type, otherwise use Ldelem_ref.
21330
21331         Use precomputed names;
21332
21333         (AddressOf): Implement address of
21334
21335         * cs-parser.jay (labeled_statement): Fix recursive block
21336         addition by reworking the production.
21337
21338         * expression.cs (New.DoEmit): New has a special case:
21339                 
21340                  If we are dealing with a ValueType, we have a few
21341                  situations to deal with:
21342                 
21343                     * The target of New is a ValueType variable, that is
21344                       easy, we just pass this as the variable reference
21345                 
21346                     * The target of New is being passed as an argument,
21347                       to a boxing operation or a function that takes a
21348                       ValueType.
21349                 
21350                       In this case, we need to create a temporary variable
21351                       that is the argument of New.
21352
21353
21354 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21355
21356         * rootcontext.cs (LookupType): Check that current_type is not null before
21357         going about looking at nested types.
21358
21359         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21360         not implement the IAssignMethod interface any more.
21361
21362         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21363         where we tranform them into FieldExprs if they are being resolved from within
21364         the declaring type.
21365
21366         * ecore.cs (SimpleName.DoResolve): Do the same here.
21367
21368         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21369
21370         * ../errors/bug10.cs : Add.
21371
21372         * ../errors/cs0070.cs : Add.
21373
21374         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21375
21376         * assign.cs : Get rid of EventIsLocal everywhere.
21377
21378 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21379
21380         * ecore.cs (ConvertIntLiteral): finished the implementation.
21381
21382         * statement.cs (SwitchLabel): Convert the value we are using as a
21383         key before looking up the table.
21384
21385 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21386
21387         * codegen.cs (EmitTopBlock): Require a Location argument now.
21388
21389         * cs-parser.jay (constructor_declarator): We need to setup
21390         current_local_parameters before we parse the
21391         opt_constructor_initializer, to allow the variables to be bound
21392         to the constructor arguments.
21393
21394         * rootcontext.cs (LookupType): First lookup nested classes in our
21395         class and our parents before we go looking outside our class.
21396
21397         * expression.cs (ConstantFold): Extract/debox the values at the
21398         beginnning. 
21399
21400         * rootcontext.cs (EmitCode): Resolve the constants first before we
21401         resolve the types.  This is not really needed, but it helps debugging.
21402
21403         * statement.cs: report location.
21404
21405         * cs-parser.jay: pass location to throw statement.
21406
21407         * driver.cs: Small bug fix.
21408
21409         * report.cs: Updated format to be 4-zero filled digits.
21410
21411 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21412
21413         * expression.cs (CheckIndices): Fix minor bug where the wrong
21414         variable was being referred to ;-)
21415
21416         (DoEmit): Do not call EmitStaticInitializers when the 
21417         underlying type is System.Object.
21418
21419 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21420
21421         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21422         and do the usual workaround for SRE.
21423
21424         * class.cs (MyEventBuilder.EventType): New member to get at the type
21425         of the event, quickly.
21426
21427         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21428
21429         * assign.cs (Assign.DoResolve): Handle the case when the target
21430         is an EventExpr and perform the necessary checks.
21431
21432         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21433         interface.
21434
21435         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21436
21437         (EventExpr): Set the type in the constructor itself since we 
21438         are meant to be born fully resolved.
21439
21440         (EventExpr.Define): Revert code I wrote earlier.
21441                 
21442         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21443         instance expression is null. The instance expression is a This in that case
21444         or a null, depending on whether it is a static method or not.
21445
21446         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21447         refers to more than one method.
21448
21449         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21450         and accordingly flag errors.
21451
21452 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21453
21454         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21455
21456 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21457
21458         * location.cs (ToString): Provide useful rutine.
21459
21460 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21461
21462         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21463         objects, return the actual integral boxed.
21464
21465         * statement.cs (SwitchLabel): define an ILLabel for each
21466         SwitchLabel. 
21467
21468         (Switch.CheckSwitch): If the value is a Literal, extract
21469         the underlying literal.
21470
21471         Also in the unused hashtable we had, add the SwitchLabel so we can
21472         quickly look this value up.
21473
21474         * constant.cs: Implement a bunch of new constants.  Rewrite
21475         Literal based on this.  Made changes everywhere to adapt to this.
21476
21477         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21478         dereferencing array only once, and also copes with enumrations.
21479
21480         bytes are two bytes wide, not one.
21481
21482         (Cast): Perform constant conversions.
21483
21484         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21485         wrappers to the literals here.
21486
21487         * expression.cs (DoNumericPromotions): long literals can converted
21488         to ulong implicity (this is taken care of elsewhere, but I was
21489         missing this spot).
21490
21491         * ecore.cs (Expression.Literalize): Make the return type Literal,
21492         to improve type checking.
21493
21494         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21495
21496 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21497
21498         * literal.cs: Revert code from ravi that checked the bounds.  The
21499         bounds are sane by the definition of the type itself. 
21500
21501         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21502         need to actually look up in our parent hierarchy for interfaces
21503         implemented. 
21504
21505         * const.cs: Use the underlying type for enumerations
21506
21507         * delegate.cs: Compute the basename for the delegate creation,
21508         that should fix the delegate test case, and restore the correct
21509         Type Lookup semantics in rootcontext
21510
21511         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21512         referencing a nested type with the Reflection API is using the "+"
21513         sign. 
21514
21515         * cs-parser.jay: Do not require EOF token at the end.
21516
21517 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21518
21519         * rootcontext.cs (LookupType): Concatenate type names with
21520         a '.' instead of a '+' The test suite passes again.
21521
21522         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21523         field of the enumeration.
21524
21525         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21526         the case when the member is an EventExpr.
21527
21528         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21529         static has an associated instance expression.
21530
21531         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21532
21533         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21534
21535         * class.cs (Event.Define): Register event and perform appropriate checks
21536         for error #111.
21537
21538         We define the Add and Remove methods even if the use provides none because
21539         in that case, we provide default implementations ourselves.
21540
21541         Define a private field of the type of the event. This is done by the CSC compiler
21542         and we should be doing it too ;-)
21543
21544         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21545         More methods we use in code we generate.
21546
21547         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21548         is important.
21549
21550         (InitCoreTypes): Update accordingly for the above.
21551
21552         * class.cs (Event.Emit): Generate code for default accessors that we provide
21553
21554         (EmitDefaultMethod): Do the job in the above.
21555
21556         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21557         appropriate place.
21558
21559 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21560
21561         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21562         builders even if we were missing one.
21563
21564         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21565         pass the Basename as our class name instead of the Name.  The
21566         basename will be correctly composed for us.
21567
21568         * parameter.cs (Paramters): Now takes a Location argument.
21569
21570         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21571         make all the code call directly LookupType in RootContext and take
21572         this chance to pass the Location information everywhere.
21573
21574         * Everywhere: pass Location information.
21575
21576 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21577
21578         * class.cs (Constructor.Define): Updated way of detecting the
21579         length of the parameters.
21580
21581         (TypeContainer.DefineType): Use basename as the type name for
21582         nested types.
21583
21584         (TypeContainer.Define): Do not recursively define types here, as
21585         definition is taken care in order by the RootContext.
21586
21587         * tree.cs: Keep track of namespaces in a per-file basis.
21588
21589         * parameter.cs (Parameter.ComputeSignature): Update to use
21590         DeclSpace. 
21591
21592         (Parameters.GetSignature): ditto.
21593
21594         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21595         instead of a TypeContainer.
21596
21597         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21598         resolve names.  Because we need to be resolve in our context, not
21599         our parents.
21600
21601         * driver.cs: Implement response files.
21602
21603         * class.cs (TypeContainer.DefineType): If we are defined, do not
21604         redefine ourselves.
21605
21606         (Event.Emit): Emit the code for add/remove handlers.
21607         (Event.Define): Save the MethodBuilders for add/remove.
21608
21609         * typemanager.cs: Use pair here too.
21610
21611         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21612         DictionaryEntry requires the first argument to be non-null.  
21613
21614         (enum_declaration): Compute full name for registering the
21615         enumeration.
21616
21617         (delegate_declaration): Instead of using
21618         formal_parameter_list, use opt_formal_parameter_list as the list
21619         can be empty.
21620
21621         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21622         (EventParsing): New property that controls whether `add' and
21623         `remove' are returned as tokens or identifiers (for events);
21624
21625 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21626
21627         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21628         use MyEventBuilder only and let it wrap the real builder for us.
21629
21630         (MyEventBuilder): Revamp constructor etc.
21631
21632         Implement all operations that we perform on EventBuilder in precisely the same
21633         way here too.
21634
21635         (FindMembers): Update to use the EventBuilder member.
21636
21637         (Event.Emit): Update accordingly.
21638
21639 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21640
21641         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21642         by calling the appropriate methods.
21643
21644         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21645         useful.
21646
21647         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21648
21649 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21650
21651         * delegate.cs (Delegate.Populate): Check that the return type
21652         and various parameters types are indeed accessible.
21653
21654         * class.cs (Constructor.Define): Same here.
21655
21656         (Field.Define): Ditto.
21657
21658         (Event.Define): Ditto.
21659
21660         (Operator.Define): Check that the underlying Method defined itself
21661         correctly - so it's MethodBuilder should not be null.
21662
21663         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21664         expression happens to be null.
21665
21666         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21667         members but as of now we don't seem to be able to do anything really useful with it.
21668
21669         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21670         not the EventBuilder.
21671
21672 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21673
21674         * cs-tokenizer.cs: Add support for defines.
21675         Add support for #if, #elif, #else, #endif
21676
21677         (eval_var): evaluates a variable.
21678         (eval): stubbed for evaluating functions.
21679
21680         * cs-parser.jay: Pass the defines information
21681
21682         * driver.cs: Add --define command line option.
21683
21684         * decl.cs: Move MemberCore here.
21685
21686         Make it the base class for DeclSpace.  This allows us to catch and
21687         report 108 and 109 for everything now.
21688
21689         * class.cs (TypeContainer.Define): Extract all the members
21690         before populating and emit the warning 108 (new keyword required
21691         to override) instead of having each member implement this.
21692
21693         (MemberCore.Define): New abstract method, we will be using this in
21694         the warning reporting engine in Populate.
21695
21696         (Operator.Define): Adjust to new MemberCore protocol. 
21697
21698         * const.cs (Const): This does not derive from Expression, it is a
21699         temporary object we use to create fields, it is a MemberCore. 
21700
21701         * class.cs (Method.Define): Allow the entry point to be in a
21702         specific class.
21703
21704         * driver.cs: Rewrite the argument handler to clean it up a bit.
21705
21706         * rootcontext.cs: Made it just an auxiliary namespace feature by
21707         making everything static.
21708
21709         * driver.cs: Adapt code to use RootContext type name instead of
21710         instance variable.
21711
21712         * delegate.cs: Remove RootContext argument.
21713
21714         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21715         argument. 
21716
21717         * class.cs (Event.Define): The lookup can fail.
21718
21719         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21720
21721         * expression.cs: Resolve the this instance before invoking the code.
21722
21723 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21724
21725         * cs-parser.jay: Add a production in element_access that allows
21726         the thing to become a "type" reference.  This way we can parse
21727         things like "(string [])" as a type.
21728
21729         Note that this still does not handle the more complex rules of
21730         casts. 
21731
21732
21733         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21734
21735         * ecore.cs: (CopyNewMethods): new utility function used to
21736         assemble the list of methods from running FindMembers.
21737
21738         (MemberLookup): Rework FindMembers so that 
21739
21740 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21741
21742         * class.cs (TypeContainer): Remove Delegates who fail to be
21743         defined.
21744
21745         * delegate.cs (Populate): Verify that we dont get null return
21746         values.   TODO: Check for AsAccessible.
21747
21748         * cs-parser.jay: Use basename to emit error 574 (destructor should
21749         have the same name as container class), not the full name.
21750
21751         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21752         possible representation.  
21753
21754         Also implements integer type suffixes U and L.
21755
21756 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21757
21758         * expression.cs (ArrayCreation.DoResolve): We need to do the
21759         argument resolution *always*.
21760
21761         * decl.cs: Make this hold the namespace.  Hold the root context as
21762         well.
21763         (LookupType): Move here.
21764
21765         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21766
21767         * location.cs (Row, Name): Fixed the code, it was always returning
21768         references to the first file.
21769
21770         * interface.cs: Register properties defined through interfaces.
21771
21772         * driver.cs: Add support for globbing on the command line
21773
21774         * class.cs (Field): Make it derive from MemberCore as well.
21775         (Event): ditto.
21776
21777 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21778
21779         * class.cs (Event::Define): Check that the type of the event is a delegate
21780         type else flag error #66.
21781
21782         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21783         same.
21784
21785         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21786         values of EntryPoint, CharSet etc etc.
21787
21788         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21789
21790         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21791         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21792         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21793         which needs this to do its work.
21794
21795         * ../errors/cs0066.cs : Add.
21796
21797 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21798
21799         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21800         helper functions.
21801
21802         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21803         clears out the parameters field.
21804         (MemberSignatureCompare): Cleanup
21805
21806         (MemberCore): New base class used to share code between MethodCore
21807         and Property.
21808
21809         (RegisterRequiredImplementations) BindingFlags.Public requires
21810         either BindingFlags.Instace or Static.  Use instance here.
21811
21812         (Property): Refactored code to cope better with the full spec.
21813
21814         * parameter.cs (GetParameterInfo): Return an empty array instead
21815         of null on error.
21816
21817         * class.cs (Property): Abstract or extern properties have no bodies.
21818
21819         * parameter.cs (GetParameterInfo): return a zero-sized array.
21820
21821         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21822         method modifier validation to the typecontainer so we can reuse
21823         this on properties.
21824
21825         (MethodCore.ParameterTypes): return an empty sized array of types.
21826
21827         (Property.Define): Test property modifier validity.
21828
21829         Add tests for sealed/override too.
21830
21831         (Method.Emit): abstract or extern methods have no bodies.
21832
21833 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21834
21835         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21836         thing.
21837
21838         (Method::Define, ::Emit): Modify accordingly.
21839
21840         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21841
21842         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21843
21844         * makefile: Pass in /unsafe.
21845
21846 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21847
21848         * class.cs (MakeKey): Kill routine.
21849
21850         * class.cs (TypeContainer.Define): Correctly define explicit
21851         method implementations (they require the full interface name plus
21852         the method name).
21853
21854         * typemanager.cs: Deply the PtrHashtable here and stop using the
21855         lame keys.  Things work so much better.
21856
21857         This of course broke everyone who depended on `RegisterMethod' to
21858         do the `test for existance' test.  This has to be done elsewhere.
21859
21860         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21861         the object stupid Equals method (because, that like fails all over
21862         the place).  We still do not use it.
21863
21864         * class.cs (TypeContainer.SetRequiredInterface,
21865         TypeContainer.RequireMethods): Killed these two routines and moved
21866         all the functionality to RegisterRequiredImplementations.
21867
21868         (TypeContainer.RegisterRequiredImplementations): This routine now
21869         registers all the implementations required in an array for the
21870         interfaces and abstract methods.  We use an array of structures
21871         which can be computed ahead of time to reduce memory usage and we
21872         also assume that lookups are cheap as most classes will not
21873         implement too many interfaces.
21874
21875         We also avoid creating too many MethodSignatures.
21876
21877         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21878         clear the "pending" bit if we find that there are problems with
21879         the declaration.
21880
21881         (TypeContainer.VerifyPendingMethods): Update to report errors of
21882         methods that look like implementations but are not.
21883
21884         (TypeContainer.Define): Add support for explicit interface method
21885         implementation. 
21886
21887 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21888
21889         * typemanager.cs: Keep track of the parameters here instead of
21890         being a feature of the TypeContainer.
21891
21892         * class.cs: Drop the registration of parameters here, as
21893         InterfaceMethods are also interface declarations.
21894
21895         * delegate.cs: Register methods with the TypeManager not only with
21896         the TypeContainer.  This code was buggy.
21897
21898         * interface.cs: Full registation here.
21899
21900 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21901
21902         * expression.cs: Remove reducer for binary expressions, it can not
21903         be done this way.
21904
21905         * const.cs: Put here the code that used to go into constant.cs
21906
21907         * constant.cs: Put here the code for constants, this is a new base
21908         class for Literals.
21909
21910         * literal.cs: Make Literal derive from Constant.
21911
21912 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21913
21914         * statement.cs (Return.Emit): Report error 157 if the user
21915         attempts to return from a finally block.
21916
21917         (Return.Emit): Instead of emitting a return, jump to the end of
21918         the function.
21919
21920         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21921         LocalBuilder to store the result of the function.  ReturnLabel is
21922         the target where we jump.
21923
21924
21925 2001-12-09  Radek Doulik  <rodo@ximian.com>
21926
21927         * cs-parser.jay: remember alias in current namespace
21928
21929         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21930         namespaces
21931
21932         * class.cs (LookupAlias): lookup alias in my_namespace
21933
21934         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21935         aliases hashtable
21936         (LookupAlias): lookup alias in this and if needed in parent
21937         namespaces
21938
21939 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21940
21941         * support.cs: 
21942
21943         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21944         making things static.  I need this to avoid passing the
21945         TypeContainer when calling ParameterType.
21946
21947         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21948         that did string manipulation to compute the type and then call
21949         GetType.  Use Parameter.ParameterType instead.
21950
21951         * cs-tokenizer.cs: Consume the suffix for floating values.
21952
21953         * expression.cs (ParameterReference): figure out whether this is a
21954         reference parameter or not.  Kill an extra variable by computing
21955         the arg_idx during emission.
21956
21957         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21958         function that returns whether a parameter is an out/ref value or not.
21959
21960         (Parameter.ParameterType): The type of the parameter (base,
21961         without ref/out applied).
21962
21963         (Parameter.Resolve): Perform resolution here.
21964         (Parameter.ExternalType): The full type (with ref/out applied).
21965
21966         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21967         support for expressions on the using statement.
21968
21969 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21970
21971         * statement.cs (Using.EmitLocalVariableDecls): Split the
21972         localvariable handling of the using statement.
21973
21974         (Block.EmitMeta): Keep track of variable count across blocks.  We
21975         were reusing slots on separate branches of blocks.
21976
21977         (Try.Emit): Emit the general code block, we were not emitting it. 
21978
21979         Check the type of the declaration to be an IDisposable or
21980         something that can be implicity converted to it. 
21981
21982         Emit conversions if required.
21983
21984         * ecore.cs (EmptyExpression): New utility class.
21985         (Expression.ImplicitConversionExists): New utility function.
21986
21987 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21988
21989         * statement.cs (Using): Implement.
21990
21991         * expression.cs (LocalVariableReference): Support read only variables.
21992
21993         * statement.cs: Remove the explicit emit for the Leave opcode.
21994         (VariableInfo): Add a readonly field.
21995
21996 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21997
21998         * ecore.cs (ConvCast): new class used to encapsulate the various
21999         explicit integer conversions that works in both checked and
22000         unchecked contexts.
22001
22002         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22003         properly generate the overflow opcodes.
22004
22005 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22006
22007         * statement.cs: The correct type for the EmptyExpression is the
22008         element_type, not the variable type.  Ravi pointed this out.
22009
22010 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22011
22012         * class.cs (Method::Define): Handle PInvoke methods specially
22013         by using DefinePInvokeMethod instead of the usual one.
22014
22015         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22016         above to do the task of extracting information and defining the method.
22017
22018 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22019
22020         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22021         of the condition for string type.
22022
22023         (Emit): Move that here. 
22024
22025         (ArrayCreation::CheckIndices): Keep string literals in their expression
22026         form.
22027
22028         (EmitDynamicInitializers): Handle strings appropriately.
22029
22030 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22031
22032         * codegen.cs (EmitContext): Replace multiple variables with a
22033         single pointer to the current Switch statement.
22034
22035         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22036         EmitContext.
22037
22038 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22039
22040         * statement.cs 
22041
22042         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22043         default'.
22044
22045         (Foreach.Emit): Foreach on arrays was not setting
22046         up the loop variables (for break/continue).
22047
22048         (GotoCase): Semi-implented.
22049
22050 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22051
22052         * attribute.cs (CheckAttribute): Handle system attributes by using
22053         Attribute.GetAttributes to examine information we need.
22054
22055         (GetValidPlaces): Same here.
22056
22057         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22058
22059         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22060
22061         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22062
22063         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22064
22065         (Method::Emit): Handle the case when we are a PInvoke method.
22066
22067 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22068
22069         * expression.cs: Use ResolveWithSimpleName on compound names.
22070
22071 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22072
22073         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22074         before trying to reduce it.
22075
22076         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22077
22078         * constant.cs (LookupConstantValue): Implement.
22079
22080         (EmitConstant): Use the above in emitting the constant.
22081
22082         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22083         that are user-defined by doing a LookupConstantValue on them.
22084
22085         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22086         too, like above.
22087
22088 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22089
22090         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22091
22092         (BaseAccess.DoResolve): Implement.
22093
22094         (MemberAccess.DoResolve): Split this routine into a
22095         ResolveMemberAccess routine that can be used independently
22096
22097 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22098
22099         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22100         As that share bits of the implementation.  Is returns a boolean,
22101         while As returns the Type that is being probed.
22102
22103 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22104
22105         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22106         instead of a Literal - much easier.
22107
22108         (EnumInTransit): Remove - utterly useless :-)
22109
22110         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22111
22112         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22113
22114         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22115         chain when we have no associated expression.
22116
22117 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22118
22119         * constant.cs (Define): Use Location while reporting the errror.
22120
22121         Also emit a warning when 'new' is used and there is no inherited
22122         member to hide.
22123
22124         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22125         populated.
22126
22127         (LookupEnumValue): Implement to lookup an enum member's value and define it
22128         if necessary.
22129
22130         (Populate): Re-write accordingly to use the above routine.
22131
22132 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22133
22134         * expression.cs (This): Fix prototype for DoResolveLValue to
22135         override the base class DoResolveLValue.
22136
22137         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22138         declarations) 
22139
22140         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22141         (we need to load the address of the field here).  This fixes
22142         test-22. 
22143
22144         (FieldExpr.DoResolveLValue): Call the DoResolve
22145         function to initialize the Instance expression.
22146
22147         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22148         correctly the GetEnumerator operation on a value type.
22149
22150         * cs-parser.jay: Add more simple parsing error catches.
22151
22152         * statement.cs (Switch): Add support for string switches.
22153         Handle null specially.
22154
22155         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22156
22157 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22158
22159         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22160
22161         (declare_local_constant): New helper function.
22162
22163         * statement.cs (AddConstant): Keep a separate record of constants
22164
22165         (IsConstant): Implement to determine if a variable is a constant.
22166
22167         (GetConstantExpression): Implement.
22168
22169         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22170
22171         * statement.cs (IsVariableDefined): Re-write.
22172
22173 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22174
22175         * class.cs (TypeContainer::FindMembers): Look for constants
22176         in the case when we are looking for MemberTypes.Field
22177
22178         * expression.cs (MemberAccess::DoResolve): Check that in the
22179         case we are a FieldExpr and a Literal, we are not being accessed
22180         by an instance reference.
22181
22182         * cs-parser.jay (local_constant_declaration): Implement.
22183
22184         (declaration_statement): Implement for constant declarations.
22185
22186 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22187
22188         * statement.cs (Switch): Catch double defaults.
22189
22190         (Switch): More work on the switch() statement
22191         implementation.  It works for integral values now, need to finish
22192         string support.
22193
22194
22195 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22196
22197         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22198         integer literals into other integer literals.  To be used by
22199         switch. 
22200
22201 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22202
22203         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22204         some memory.
22205
22206         (EmitDynamicInitializers): Cope with the above since we extract data
22207         directly from ArrayData now.
22208
22209         (ExpectInitializers): Keep track of whether initializers are mandatory
22210         or not.
22211
22212         (Bounds): Make it a hashtable to prevent the same dimension being 
22213         recorded for every element in that dimension.
22214
22215         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22216         from being found.
22217
22218         Also fix bug which was causing the indices to be emitted in the reverse
22219         order.
22220
22221 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22222
22223         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22224         unfinished.  They do not work, because the underlying code is
22225         sloppy.
22226
22227 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22228
22229         * cs-parser.jay: Remove bogus fixme.
22230
22231         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22232         on Switch statement.
22233
22234 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22235
22236         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22237         the same. 
22238
22239         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22240         parameter. Apparently, any expression is allowed. 
22241
22242         (ValidateInitializers): Update accordingly.
22243
22244         (CheckIndices): Fix some tricky bugs thanks to recursion.
22245
22246         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22247         I was being completely brain-dead.
22248
22249         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22250         and re-write acordingly.
22251
22252         (DelegateInvocation): Re-write accordingly.
22253
22254         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22255
22256         (MakeByteBlob): Handle types more correctly.
22257
22258         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22259         initialization from expressions but it is incomplete because I am a complete
22260         Dodo :-|
22261
22262 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22263
22264         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22265         on If.  Basically, we have to return `true' (ie, we do return to
22266         our caller) only if both branches of the if return.
22267
22268         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22269         short-circuit operators, handle them as short circuit operators. 
22270
22271         (Cast.DoResolve): Resolve type.
22272         (Cast.Cast): Take an expression as the target type.
22273
22274         * cs-parser.jay (cast_expression): Remove old hack that only
22275         allowed a limited set of types to be handled.  Now we take a
22276         unary_expression and we resolve to a type during semantic
22277         analysis.
22278
22279         Use the grammar productions from Rhys to handle casts (this is
22280         not complete like Rhys syntax yet, we fail to handle that corner
22281         case that C# has regarding (-x), but we will get there.
22282
22283 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22284
22285         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22286         field which is an array type.
22287
22288         * cs-parser.jay (declare_local_variables): Support array initialization too.
22289
22290         * typemanager.cs (MakeKey): Implement.
22291
22292         (everywhere): Use the above appropriately.
22293
22294         * cs-parser.jay (for_statement): Update for array initialization while
22295         declaring variables.
22296
22297         * ecore.cs : The error message was correct, it's the variable's names that
22298         were misleading ;-) Make the code more readable.
22299
22300         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22301         the correct type etc.
22302
22303         (ConvertExplicit): Handle Enum types by examining the underlying type.
22304
22305 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22306
22307         * parameter.cs (GetCallingConvention): Always return
22308         CallingConventions.Standard for now.
22309
22310 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22311
22312         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22313         and `r' after calling DoNumericPromotions.
22314
22315         * ecore.cs: Fix error message (the types were in the wrong order).
22316
22317         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22318         BindingFlags.Instance as well 
22319
22320         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22321         implicit int literal conversion in an empty cast so that we
22322         propagate the right type upstream.
22323
22324         (UnboxCast): new class used to unbox value types.
22325         (Expression.ConvertExplicit): Add explicit type conversions done
22326         by unboxing.
22327
22328         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22329         the target type before applying the implicit LongLiterals to ULong
22330         literal cast.
22331
22332 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22333
22334         * cs-parser.jay (for_statement): Reworked the way For works: now
22335         we declare manually any variables that are introduced in
22336         for_initializer to solve the problem of having out-of-band code
22337         emition (that is what got for broken).
22338
22339         (declaration_statement): Perform the actual variable declaration
22340         that used to be done in local_variable_declaration here.
22341
22342         (local_variable_declaration): Do not declare anything, just pass
22343         the information on a DictionaryEntry
22344
22345 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22346
22347         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22348         re-write of the logic to now make it recursive.
22349
22350         (UpdateIndices): Re-write accordingly.
22351
22352         Store element data in a separate ArrayData list in the above methods.
22353
22354         (MakeByteBlob): Implement to dump the array data into a byte array.
22355
22356 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22357
22358         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22359         into CheckIndices.
22360
22361         * constant.cs (Define): Implement.
22362
22363         (EmitConstant): Re-write fully.
22364
22365         Pass in location info.
22366
22367         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22368         respectively.
22369
22370         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22371         DictionaryEntry since we need location info too.
22372
22373         (constant_declaration): Update accordingly.
22374
22375         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22376         code into another method : UpdateIndices.
22377
22378 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22379
22380         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22381         some type checking etc.
22382
22383 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22384
22385         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22386         bits to provide dimension info if the user skips doing that.
22387
22388         Update second constructor to store the rank correctly.
22389
22390 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22391
22392         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22393         and try to implement.
22394
22395         * ../errors/cs0150.cs : Add.
22396
22397         * ../errors/cs0178.cs : Add.
22398
22399 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22400
22401         * statement.cs: Implement foreach on multi-dimensional arrays. 
22402
22403         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22404         name of the params argument.
22405
22406         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22407         initializing the array.
22408
22409         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22410         we can use this elsewhere.
22411
22412         * statement.cs: Finish implementation of foreach for single
22413         dimension arrays.
22414
22415         * cs-parser.jay: Use an out-of-band stack to pass information
22416         around, I wonder why I need this.
22417
22418         foreach_block: Make the new foreach_block the current_block.
22419
22420         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22421         function used to return a static Parameters structure.  Used for
22422         empty parameters, as those are created very frequently.
22423
22424         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22425
22426 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22427
22428         * interface.cs : Default modifier is private, not public. The
22429         make verify test passes again.
22430
22431 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22432
22433         * support.cs (ReflectionParameters): Fix logic to determine
22434         whether the last parameter is a params one. Test 9 passes again.
22435
22436         * delegate.cs (Populate): Register the builders we define with
22437         RegisterParameterForBuilder. Test 19 passes again.
22438
22439         * cs-parser.jay (property_declaration): Reference $6 instead
22440         of $$ to get at the location.
22441
22442         (indexer_declaration): Similar stuff.
22443
22444         (attribute): Ditto.
22445
22446         * class.cs (Property): Register parameters for the Get and Set methods
22447         if they exist. Test 23 passes again.
22448
22449         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22450         call to EmitArguments as we are sure there aren't any params arguments. 
22451         Test 32 passes again.
22452
22453         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22454         IndexOutOfRangeException. 
22455
22456         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22457         Test 33 now passes again.
22458
22459 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22460
22461         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22462         broke a bunch of things.  Will have to come up with a better way
22463         of tracking locations.
22464
22465         * statement.cs: Implemented foreach for single dimension arrays.
22466
22467 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22468
22469         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22470         an error.  This removes the lookup from the critical path.
22471
22472         * cs-parser.jay: Removed use of temporary_loc, which is completely
22473         broken. 
22474
22475 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22476
22477         * support.cs (ReflectionParameters.ParameterModifier): Report
22478         whether the argument is a PARAMS argument or not.
22479
22480         * class.cs: Set the attribute `ParamArrayAttribute' on the
22481         parameter argument.
22482
22483         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22484         and cons_param_array_attribute (ConstructorInfo for
22485         ParamArrayAttribute)., 
22486
22487         * codegen.cs: Emit the return using the `Return' statement, that
22488         way we can report the error correctly for missing return values. 
22489
22490         * class.cs (Method.Emit): Clean up.
22491
22492         * expression.cs (Argument.Resolve): Take another argument: the
22493         location where this argument is used.  Notice that this is not
22494         part of the "Argument" class as to reduce the size of the
22495         structure (we know the approximate location anyways).
22496
22497         Test if the argument is a variable-reference, if not, then
22498         complain with a 206.
22499
22500         (Argument.Emit): Emit addresses of variables.
22501
22502         (Argument.FullDesc): Simplify.
22503
22504         (Invocation.DoResolve): Update for Argument.Resolve.
22505
22506         (ElementAccess.DoResolve): ditto.
22507
22508         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22509         method should be virtual, as this method is always virtual.
22510
22511         (NewDelegate.DoResolve): Update for Argument.Resolve.
22512
22513         * class.cs (ConstructorInitializer.DoResolve): ditto.
22514
22515         * attribute.cs (Attribute.Resolve): ditto.
22516
22517 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22518
22519         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22520
22521         * expression.cs (ParameterReference): Drop IStackStorage and implement
22522         IAssignMethod instead. 
22523
22524         (LocalVariableReference): ditto.
22525
22526         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22527         IAssignMethod instead. 
22528
22529 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22530
22531         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22532         enumerations that are used in heavily used structures derive from
22533         byte in a laughable and pathetic attempt to reduce memory usage.
22534         This is the kind of pre-optimzations that you should not do at
22535         home without adult supervision.
22536
22537         * expression.cs (UnaryMutator): New class, used to handle ++ and
22538         -- separatedly from the other unary operators.  Cleans up the
22539         code, and kills the ExpressionStatement dependency in Unary.
22540
22541         (Unary): Removed `method' and `Arguments' from this class, making
22542         it smaller, and moving it all to SimpleCall, so I can reuse this
22543         code in other locations and avoid creating a lot of transient data
22544         strucutres when not required.
22545
22546         * cs-parser.jay: Adjust for new changes.
22547
22548 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22549
22550         * enum.cs (Enum.Populate): If there is a failure during
22551         definition, return
22552
22553         * cs-parser.jay (opt_enum_base): we used to catch type errors
22554         here, but this is really incorrect.  The type error should be
22555         catched during semantic analysis.
22556
22557 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22558
22559         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22560         current_local_parameters as expected since I, in my stupidity, had forgotten
22561         to do this :-)
22562
22563         * attribute.cs (GetValidPlaces): Fix stupid bug.
22564
22565         * class.cs (Method::Emit): Perform check on applicability of attributes.
22566
22567         (Constructor::Emit): Ditto.
22568
22569         (Field::Emit): Ditto.
22570
22571         (Field.Location): Store location information.
22572
22573         (Property, Event, Indexer, Operator): Ditto.
22574
22575         * cs-parser.jay (field_declaration): Pass in location for each field.
22576
22577         * ../errors/cs0592.cs : Add.
22578
22579 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22580
22581         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22582
22583         (InitCoreTypes): Update accordingly.
22584
22585         (RegisterAttrType, LookupAttr): Implement.
22586
22587         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22588         info about the same.
22589
22590         (Resolve): Update to populate the above as necessary.
22591
22592         (Error592): Helper.
22593
22594         (GetValidPlaces): Helper to the above.
22595
22596         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22597
22598         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22599
22600 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22601
22602         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22603
22604         * ../errors/cs0617.cs : Add.
22605
22606 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22607
22608         * enum.cs (Emit): Rename to Populate to be more consistent with what
22609         we expect it to do and when exactly it is called.
22610
22611         * class.cs, rootcontext.cs : Update accordingly.
22612
22613         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22614         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22615
22616         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22617
22618         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22619         of a fieldinfo using the above, when dealing with a FieldBuilder.
22620
22621 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22622
22623         * ../errors/cs0031.cs : Add.
22624
22625         * ../errors/cs1008.cs : Add.
22626
22627         * ../errrors/cs0543.cs : Add.
22628
22629         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22630         enum type.
22631
22632         (FindMembers): Implement.
22633
22634         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22635         enums and delegates too.
22636
22637         (enum_types): Rename to builder_to_enum.
22638
22639         (delegate_types): Rename to builder_to_delegate.
22640
22641         * delegate.cs (FindMembers): Implement.
22642
22643 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22644
22645         * typemanager.cs (IsEnumType): Implement.
22646
22647         * enum.cs (Emit): Re-write parts to account for the underlying type
22648         better and perform checking etc.
22649
22650         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22651         of the underlying type.
22652
22653         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22654         value
22655
22656         * enum.cs (error31): Helper to report error #31.
22657
22658         * cs-parser.jay (enum_declaration): Store location of each member too.
22659
22660         * enum.cs (member_to_location): New hashtable. 
22661
22662         (AddEnumMember): Update location hashtable.
22663
22664         (Emit): Use the location of each member while reporting errors.
22665
22666 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22667
22668         * cs-parser.jay: A for_initializer if is a
22669         local_variable_declaration really ammount to have an implicit
22670         block with the variable declaration and no initializer for for.
22671
22672         * statement.cs (For.Emit): Cope with null initializers.
22673
22674         This fixes the infinite loop on for initializers.
22675
22676 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22677
22678         * enum.cs: More cleanup.
22679
22680         * ecore.cs: Remove dead code.
22681
22682         * class.cs (Property.Emit): More simplification.
22683         (Event.Emit): ditto.
22684
22685         Reworked to have less levels of indentation.
22686
22687 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22688
22689         * class.cs (Property): Emit attributes.
22690
22691         (Field): Ditto.
22692
22693         (Event): Ditto.
22694
22695         (Indexer): Ditto.
22696
22697         (Operator): Ditto.
22698
22699         * enum.cs (Emit): Ditto.
22700
22701         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22702         Enums too.
22703
22704         * class.cs (Field, Event, etc.): Move attribute generation into the
22705         Emit method everywhere.
22706
22707         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22708         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22709         as we had no way of defining nested enums !
22710
22711         * rootcontext.cs : Adjust code accordingly.
22712
22713         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22714
22715 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22716
22717         * expression.cs (EvalConstantExpression): Move into ecore.cs
22718
22719         * enum.cs (Enum): Rename some members and make them public and readonly
22720         according to our convention.
22721
22722         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22723         nothing else.
22724
22725         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22726
22727         (Enum::Emit): Write a simple version for now which doesn't try to compute
22728         expressions. I shall modify this to be more robust in just a while.
22729
22730         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22731
22732         (TypeContainer::CloseType): Create the Enum types too.
22733
22734         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22735
22736         * expression.cs (EvalConstantExpression): Get rid of completely.
22737
22738         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22739         user-defined values and other cases.
22740
22741         (IsValidEnumLiteral): Helper function.
22742
22743         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22744         out there in the case we had a literal FieldExpr.
22745
22746         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22747
22748         (Literalize): Revamp a bit to take two arguments.
22749
22750         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22751
22752 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22753
22754         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22755
22756         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22757
22758         (Resolve): Use the above to ensure we have proper initializers.
22759
22760 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22761
22762         * expression.cs (Expression::EvalConstantExpression): New method to 
22763         evaluate constant expressions.
22764
22765         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22766
22767 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22768
22769         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22770         in an array.
22771
22772         (Binary.ResolveOperator): Handle operator != (object a, object b)
22773         and operator == (object a, object b);
22774
22775         (Binary.DoNumericPromotions): Indicate whether the numeric
22776         promotion was possible.
22777
22778         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22779         Implement.  
22780
22781         Made the ArrayAccess implement interface IAssignMethod instead of
22782         IStackStore as the order in which arguments are passed reflects
22783         this.
22784
22785         * assign.cs: Instead of using expr.ExprClass to select the way of
22786         assinging, probe for the IStackStore/IAssignMethod interfaces.
22787
22788         * typemanager.cs: Load InitializeArray definition.
22789
22790         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22791         static data that can be used to initialize arrays. 
22792
22793 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22794
22795         * expression.cs: Handle operator== and operator!= for booleans.
22796
22797         (Conditioal.Reduce): Implement reducer for the ?: operator.
22798
22799         (Conditional.Resolve): Implement dead code elimination.
22800
22801         (Binary.Resolve): Catch string literals and return a new
22802         concatenated string.
22803
22804         (Unary.Reduce): Implement reduction of unary expressions.
22805
22806         * ecore.cs: Split out the expression core handling here.
22807
22808         (Expression.Reduce): New method used to perform constant folding
22809         and CSE.  This is needed to support constant-expressions. 
22810
22811         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22812         targets, and optimize for !x.
22813
22814 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22815
22816         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22817         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22818         set custom atttributes.
22819
22820         * literal.cs (Literal::GetValue): New abstract method to return the actual
22821         value of the literal, cast as an object.
22822
22823         (*Literal): Implement GetValue method.
22824
22825         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22826         expressions to the arraylist but objects of type Argument.
22827
22828         * class.cs (TypeContainer::Emit): Emit our attributes too.
22829
22830         (Method::Emit, Constructor::Emit): Ditto.
22831
22832         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22833         to be ignoring earlier.
22834
22835 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22836
22837         * attribute.cs (AttributeSection::Define): Implement to do the business
22838         of constructing a CustomAttributeBuilder.
22839
22840         (Attribute): New trivial class. Increases readability of code.  
22841
22842         * cs-parser.jay : Update accordingly.
22843
22844         (positional_argument_list, named_argument_list, named_argument): New rules
22845
22846         (attribute_arguments): Use the above so that we are more correct.
22847
22848 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22849
22850         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22851         to perform all checks for a method with a params parameter.
22852
22853         (Invocation::OverloadResolve): Update to use the above method and therefore
22854         cope correctly with params method invocations.
22855
22856         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22857         params too.
22858
22859         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22860         constructors in our parent too because we can't afford to miss out on 
22861         protected ones ;-)
22862
22863         * attribute.cs (AttributeSection): New name for the class Attribute
22864
22865         Other trivial changes to improve readability.
22866
22867         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22868         use the new class names.
22869
22870 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22871
22872         * class.cs (Method::Define): Complete definition for params types too
22873
22874         (Indexer::Define): Ditto.
22875
22876         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22877         Cope everywhere with a request for info about the array parameter.
22878
22879 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22880
22881         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22882
22883         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22884         local_variable_type to extract the string corresponding to the type.
22885
22886         (local_variable_type): Fixup the action to use the new helper method.
22887
22888         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22889         go.
22890
22891         * expression.cs : Clean out code which uses the above.
22892
22893 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22894
22895         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22896         and bale out if necessary by returning a false.
22897
22898         (RegisterProperty): Ditto.
22899
22900         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22901         and print out appropriate error messages.
22902
22903         * interface.cs (everywhere): Ditto.
22904
22905         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22906         location to constructor.
22907
22908         * class.cs (Property, Event, Indexer): Update accordingly.
22909
22910         * ../errors/cs111.cs : Added.
22911
22912         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22913         of a method, as laid down by the spec.
22914
22915         (Invocation::OverloadResolve): Use the above method.
22916
22917 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22918
22919         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22920         now take a TypeContainer and a Parameters object.
22921
22922         (ParameterData): Modify return type of ParameterModifier method to be 
22923         Parameter.Modifier and not a string.
22924
22925         (ReflectionParameters, InternalParameters): Update accordingly.
22926
22927         * expression.cs (Argument::GetParameterModifier): Same here.
22928
22929         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22930         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22931         symbol in it at all so maybe this is only for now.
22932
22933 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22934
22935         * support.cs (InternalParameters): Constructor now takes an extra argument 
22936         which is the actual Parameters class.
22937
22938         (ParameterDesc): Update to provide info on ref/out modifiers.
22939
22940         * class.cs (everywhere): Update call to InternalParameters to pass in
22941         the second argument too.
22942
22943         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22944         to return the modifier info [ref/out etc]
22945
22946         (InternalParameters, ReflectionParameters): Implement the above.
22947
22948         * expression.cs (Argument::ParameterModifier): Similar function to return
22949         info about the argument's modifiers.
22950
22951         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22952         too.
22953
22954         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22955         a new SetFormalParameters object which we pass to InternalParameters.
22956
22957 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22958
22959         * expression.cs (NewArray): Merge into the ArrayCreation class.
22960
22961 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22962
22963         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22964         NewUserdefinedArray into one as there wasn't much of a use in having
22965         two separate ones.
22966
22967         * expression.cs (Argument): Change field's name to ArgType from Type.
22968
22969         (Type): New readonly property which returns the proper type, taking into 
22970         account ref/out modifiers.
22971
22972         (everywhere): Adjust code accordingly for the above.
22973
22974         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22975         whether we are emitting for a ref or out parameter.
22976
22977         * expression.cs (Argument::Emit): Use the above field to set the state.
22978
22979         (LocalVariableReference::Emit): Update to honour the flag and emit the
22980         right stuff.
22981
22982         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22983
22984         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22985
22986         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22987
22988         (ReflectionParameters, InternalParameters): Implement the above method.
22989
22990         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22991         reporting errors.
22992
22993         (Invocation::FullMethodDesc): Ditto. 
22994
22995 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22996
22997         * cs-parser.jay: Add extra production for the second form of array
22998         creation. 
22999
23000         * expression.cs (ArrayCreation): Update to reflect the above
23001         change. 
23002
23003         * Small changes to prepare for Array initialization.
23004
23005 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23006
23007         * typemanager.cs (ImplementsInterface): interface might be null;
23008         Deal with this problem;
23009
23010         Also, we do store negative hits on the cache (null values), so use
23011         this instead of calling t.GetInterfaces on the type everytime.
23012
23013 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23014
23015         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23016
23017         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23018         split functionality out into different classes.
23019
23020         (New::FormArrayType): Move into NewBuiltinArray.
23021
23022         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23023         quite useless.
23024
23025         (NewBuiltinArray): New class to handle creation of built-in arrays.
23026
23027         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23028         account creation of one-dimensional arrays.
23029
23030         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23031
23032         (NewUserdefinedArray::DoResolve): Implement.
23033
23034         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23035
23036         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23037         we maintain inside the TypeManager. This is necessary to perform lookups on the
23038         module builder.
23039
23040         (LookupType): Update to perform GetType on the module builders too.     
23041
23042         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23043
23044         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23045
23046 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23047
23048         * expression.cs (New::DoResolve): Implement guts of array creation.
23049
23050         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23051
23052 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23053
23054         * expression.cs: Fix bug I introduced lsat night that broke
23055         Delegates. 
23056
23057         (Expression.Resolve): Report a 246 error (can not resolve name)
23058         if we find a SimpleName in the stream.
23059
23060         (Expression.ResolveLValue): Ditto.
23061
23062         (Expression.ResolveWithSimpleName): This function is a variant of
23063         ResolveName, this one allows SimpleNames to be returned without a
23064         warning.  The only consumer of SimpleNames is MemberAccess
23065
23066 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23067
23068         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23069         might arrive here.  I have my doubts that this is correct.
23070
23071         * statement.cs (Lock): Implement lock statement.
23072
23073         * cs-parser.jay: Small fixes to support `lock' and `using'
23074
23075         * cs-tokenizer.cs: Remove extra space
23076
23077         * driver.cs: New flag --checked, allows to turn on integer math
23078         checking. 
23079
23080         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23081         Threading.Monitor.Exit 
23082
23083 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23084
23085         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23086         Expression Class to be IndexerAccess.
23087
23088         Notice that Indexer::DoResolve sets the eclass to Value.
23089
23090 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23091
23092         * class.cs (TypeContainer::Emit): Emit code for indexers.
23093
23094         * assign.cs (IAssignMethod): New interface implemented by Indexers
23095         and Properties for handling assignment.
23096
23097         (Assign::Emit): Simplify and reuse code. 
23098
23099         * expression.cs (IndexerAccess, PropertyExpr): Implement
23100         IAssignMethod, clean up old code. 
23101
23102 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23103
23104         * typemanager.cs (ImplementsInterface): New method to determine if a type
23105         implements a given interface. Provides a nice cache too.
23106
23107         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23108         method.
23109
23110         (ConvertReferenceExplicit): Ditto.
23111
23112         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23113         various methods, with correct names etc.
23114
23115         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23116         Operator.UnaryNegation.
23117
23118         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23119         we have a unary plus or minus operator.
23120
23121         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23122         UnaryMinus.
23123
23124         * everywhere : update accordingly.
23125
23126         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23127         respectively.
23128
23129         * class.cs (Method::Define): For the case where we are implementing a method
23130         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23131         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23132
23133 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23134
23135         * interface.cs (FindMembers): Implement to work around S.R.E
23136         lameness.
23137
23138         * typemanager.cs (IsInterfaceType): Implement.
23139
23140         (FindMembers): Update to handle interface types too.
23141
23142         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23143         use IsAssignableFrom as that is not correct - it doesn't work.
23144
23145         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23146         and accordingly override EmitStatement.
23147
23148         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23149         using the correct logic :-)
23150
23151 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23152
23153         * ../errors/cs-11.cs : Add to demonstrate error -11 
23154
23155 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23156
23157         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23158         then pass this as a hint to ResolveLValue.
23159
23160         * expression.cs (FieldExpr): Add Location information
23161
23162         (FieldExpr::LValueResolve): Report assignment to readonly
23163         variable. 
23164
23165         (Expression::ExprClassFromMemberInfo): Pass location information.
23166
23167         (Expression::ResolveLValue): Add new method that resolves an
23168         LValue. 
23169
23170         (Expression::DoResolveLValue): Default invocation calls
23171         DoResolve. 
23172
23173         (Indexers): New class used to keep track of indexers in a given
23174         Type. 
23175
23176         (IStackStore): Renamed from LValue, as it did not really describe
23177         what this did.  Also ResolveLValue is gone from this interface and
23178         now is part of Expression.
23179
23180         (ElementAccess): Depending on the element access type
23181
23182         * typemanager.cs: Add `indexer_name_type' as a Core type
23183         (System.Runtime.CompilerServices.IndexerNameAttribute)
23184
23185         * statement.cs (Goto): Take a location.
23186
23187 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23188
23189         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23190         if two delegates are compatible.
23191
23192         (NewDelegate::DoResolve): Update to take care of the case when
23193         we instantiate a delegate from another delegate.
23194
23195         * typemanager.cs (FindMembers): Don't even try to look up members
23196         of Delegate types for now.
23197
23198 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23199
23200         * delegate.cs (NewDelegate): New class to take care of delegate
23201         instantiation.
23202
23203         * expression.cs (New): Split the delegate related code out into 
23204         the NewDelegate class.
23205
23206         * delegate.cs (DelegateInvocation): New class to handle delegate 
23207         invocation.
23208
23209         * expression.cs (Invocation): Split out delegate related code into
23210         the DelegateInvocation class.
23211
23212 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23213
23214         * expression.cs (New::DoResolve): Implement delegate creation fully
23215         and according to the spec.
23216
23217         (New::DoEmit): Update to handle delegates differently.
23218
23219         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23220         because of which we were printing out arguments in reverse order !
23221
23222         * delegate.cs (VerifyMethod): Implement to check if the given method
23223         matches the delegate.
23224
23225         (FullDelegateDesc): Implement.
23226
23227         (VerifyApplicability): Implement.
23228
23229         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23230         delegate invocations too.
23231
23232         (Invocation::Emit): Ditto.
23233
23234         * ../errors/cs1593.cs : Added.
23235
23236         * ../errors/cs1594.cs : Added.
23237
23238         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23239
23240 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23241
23242         * typemanager.cs (intptr_type): Core type for System.IntPtr
23243
23244         (InitCoreTypes): Update for the same.
23245
23246         (iasyncresult_type, asynccallback_type): Ditto.
23247
23248         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23249         correct.
23250
23251         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23252         too.
23253
23254         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23255         the builders for the 4 members of a delegate type :-)
23256
23257         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23258         type.
23259
23260         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23261
23262         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23263
23264 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23265
23266         * statement.cs (Break::Emit): Implement.   
23267         (Continue::Emit): Implement.
23268
23269         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23270         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23271         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23272         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23273         end loop
23274
23275         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23276         properties that track the label for the current loop (begin of the
23277         loop and end of the loop).
23278
23279 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23280
23281         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23282         use of emitting anything at all.
23283
23284         * class.cs, rootcontext.cs : Get rid of calls to the same.
23285
23286         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23287
23288         (Populate): Define the constructor correctly and set the implementation
23289         attributes.
23290
23291         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23292         have been defined.
23293
23294         (AddDelegateType): Implement.
23295
23296         (IsDelegateType): Implement helper method.
23297
23298         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23299
23300         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23301         and accordingly handle it.
23302
23303         * delegate.cs (Populate): Take TypeContainer argument.
23304         Implement bits to define the Invoke method. However, I still haven't figured out
23305         how to take care of the native int bit :-(
23306
23307         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23308         Qualify the name of the delegate, not its return type !
23309
23310         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23311         conversion.
23312
23313         (StandardConversionExists): Checking for array types turns out to be recursive.
23314
23315         (ConvertReferenceExplicit): Implement array conversion.
23316
23317         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23318
23319 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23320
23321         * cs-parser.jay (delegate_declaration): Store the fully qualified
23322         name as it is a type declaration.
23323
23324         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23325         readonly.
23326
23327         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23328         as TypeContainer::DefineType.
23329
23330         (Populate): Method in which all the definition of the various methods (Invoke)
23331         etc is done.
23332
23333         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23334         see.
23335
23336         (CloseDelegate): Finally creates the delegate.
23337
23338         * class.cs (TypeContainer::DefineType): Update to define delegates.
23339         (Populate, Emit and CloseType): Do the same thing here too.
23340
23341         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23342         delegates in all these operations.
23343
23344 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23345
23346         * expression.cs: LocalTemporary: a new expression used to
23347         reference a temporary that has been created.
23348
23349         * assign.cs: Handle PropertyAccess back here, so that we can
23350         provide the proper semantic access to properties.
23351
23352         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23353         a few more explicit conversions. 
23354
23355         * modifiers.cs: `NEW' modifier maps to HideBySig.
23356
23357         * expression.cs (PropertyExpr): Make this into an
23358         ExpressionStatement, and support the EmitStatement code path. 
23359
23360         Perform get/set error checking, clean up the interface.
23361
23362         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23363         them into toplevel access objects.
23364
23365 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23366
23367         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23368         SRE.
23369
23370         * typemanager.cs: Keep track here of our PropertyBuilders again to
23371         work around lameness in SRE.
23372
23373 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23374
23375         * expression.cs (LValue::LValueResolve): New method in the
23376         interface, used to perform a second resolution pass for LValues. 
23377
23378         (This::DoResolve): Catch the use of this in static methods.
23379
23380         (This::LValueResolve): Implement.
23381
23382         (This::Store): Remove warning, assigning to `this' in structures
23383         is 
23384
23385         (Invocation::Emit): Deal with invocation of
23386         methods on value types.  We need to pass the address to structure
23387         methods rather than the object itself.  (The equivalent code to
23388         emit "this" for structures leaves the entire structure on the
23389         stack instead of a pointer to it). 
23390
23391         (ParameterReference::DoResolve): Compute the real index for the
23392         argument based on whether the method takes or not a `this' pointer
23393         (ie, the method is static).
23394
23395         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23396         value types returned from functions when we need to invoke a
23397         method on the sturcture.
23398
23399
23400 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23401
23402         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23403         defining the type in the Modulebuilder or Typebuilder. This is to take
23404         care of nested types which need to be defined on the TypeBuilder using
23405         DefineNestedMethod.
23406
23407         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23408         methods in RootContext, only ported to be part of TypeContainer.
23409
23410         (TypeContainer::GetInterfaceOrClass): Ditto.
23411
23412         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23413
23414         * interface.cs (Interface::DefineInterface): New method. Does exactly
23415         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23416         too.
23417
23418         (Interface::GetInterfaces): Move from RootContext here and port.
23419
23420         (Interface::GetInterfaceByName): Same here.
23421
23422         * rootcontext.cs (ResolveTree): Re-write.
23423
23424         (PopulateTypes): Re-write.
23425
23426         * class.cs (TypeContainer::Populate): Populate nested types too.
23427         (TypeContainer::Emit): Emit nested members too.
23428
23429         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23430         instead just use the name argument passed in as it is already fully
23431         qualified.
23432
23433         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23434         to TypeContainer mapping to see if a type is user-defined.
23435
23436         * class.cs (TypeContainer::CloseType): Implement. 
23437
23438         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23439         the default constructor.
23440
23441         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23442         twice.
23443
23444         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23445
23446         * interface.cs (CloseType): Create the type here.
23447
23448         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23449         the hierarchy.
23450
23451         Remove all the methods which are now in TypeContainer.
23452
23453 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23454
23455         * delegate.cs (Define): Re-write bits to define the delegate
23456         correctly.
23457
23458 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23459
23460         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23461
23462         * expression.cs (ImplicitReferenceConversion): handle null as well
23463         as a source to convert to any reference type.
23464
23465         * statement.cs (Return): Perform any implicit conversions to
23466         expected return type.  
23467
23468         Validate use of return statement.  
23469
23470         * codegen.cs (EmitContext): Pass the expected return type here.
23471
23472         * class.cs (Method, Constructor, Property): Pass expected return
23473         type to EmitContext.
23474
23475 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23476
23477         * expression.cs: Make DoResolve take an EmitContext instead of a
23478         TypeContainer.
23479
23480         Replaced `l' and `location' for `loc', for consistency.
23481
23482         (Error, Warning): Remove unneeded Tc argument.
23483
23484         * assign.cs, literal.cs, constant.cs: Update to new calling
23485         convention. 
23486
23487         * codegen.cs: EmitContext now contains a flag indicating whether
23488         code is being generated in a static method or not.
23489
23490         * cs-parser.jay: DecomposeQI, new function that replaces the old
23491         QualifiedIdentifier.  Now we always decompose the assembled
23492         strings from qualified_identifier productions into a group of
23493         memberaccesses.
23494
23495 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23496
23497         * rootcontext.cs: Deal with field-less struct types correctly now
23498         by passing the size option to Define Type.
23499
23500         * class.cs: Removed hack that created one static field. 
23501
23502 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23503
23504         * statement.cs: Moved most of the code generation here. 
23505
23506 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23507
23508         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23509         seem very right.
23510
23511         (ElementAccess): Remove useless bits for now - keep checks as the spec
23512         says.
23513
23514 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23515
23516         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23517         and start performing checks according to the spec.
23518
23519 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23520
23521         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23522         rank_specifiers instead.
23523
23524         (rank_specifiers): Change the order in which the rank specifiers are stored
23525
23526         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23527
23528         * expression.cs (ElementAccess): Implement the LValue interface too.
23529
23530 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23531
23532         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23533         except that user defined conversions are not included.
23534
23535         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23536         perform the conversion of the return type, if necessary.
23537
23538         (New::DoResolve): Check whether we are creating an array or an object
23539         and accordingly do the needful.
23540
23541         (New::Emit): Same here.
23542
23543         (New::DoResolve): Implement guts of array creation.
23544
23545         (New::FormLookupType): Helper function.
23546
23547 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23548
23549         * codegen.cs: Removed most of the code generation here, and move the
23550         corresponding code generation bits to the statement classes. 
23551
23552         Added support for try/catch/finalize and throw.
23553
23554         * cs-parser.jay: Added support for try/catch/finalize.
23555
23556         * class.cs: Catch static methods having the flags override,
23557         virtual or abstract.
23558
23559         * expression.cs (UserCast): This user cast was not really doing
23560         what it was supposed to do.  Which is to be born in fully resolved
23561         state.  Parts of the resolution were being performed at Emit time! 
23562
23563         Fixed this code.
23564
23565 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23566
23567         * expression.cs: Implicity convert the result from UserCast.
23568
23569 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23570
23571         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23572         prevented it from working correctly. 
23573
23574         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23575         merely ConvertImplicit.
23576
23577 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23578
23579         * typemanager.cs: Make the LookupTypeContainer function static,
23580         and not per-instance.  
23581
23582         * class.cs: Make static FindMembers (the one that takes a Type
23583         argument). 
23584
23585         * codegen.cs: Add EmitForeach here.
23586
23587         * cs-parser.jay: Make foreach a toplevel object instead of the
23588         inline expansion, as we need to perform semantic analysis on it. 
23589
23590 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23591
23592         * expression.cs (Expression::ImplicitUserConversion): Rename to
23593         UserDefinedConversion.
23594
23595         (Expression::UserDefinedConversion): Take an extra argument specifying 
23596         whether we look for explicit user conversions too.
23597
23598         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23599
23600         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23601
23602         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23603         with the appropriate arguments.
23604
23605         * cs-parser.jay (cast_expression): Record location too.
23606
23607         * expression.cs (Cast): Record location info.
23608
23609         (Expression::ConvertExplicit): Take location argument.
23610
23611         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23612         to determine if we are doing explicit conversions.
23613
23614         (UserCast::Emit): Update accordingly.
23615
23616         (Expression::ConvertExplicit): Report an error if everything fails.
23617
23618         * ../errors/cs0030.cs : Add.
23619
23620 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23621
23622         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23623         virtual and newslot bits. 
23624
23625         * class.cs (TypeContainer::RegisterRequiredImplementations):
23626         Record methods we need.
23627
23628         (TypeContainer::MakeKey): Helper function to make keys for
23629         MethodBases, since the Methodbase key is useless.
23630
23631         (TypeContainer::Populate): Call RegisterRequiredImplementations
23632         before defining the methods.   
23633
23634         Create a mapping for method_builders_to_methods ahead of time
23635         instead of inside a tight loop.
23636
23637         (::RequireMethods):  Accept an object as the data to set into the
23638         hashtable so we can report interface vs abstract method mismatch.
23639
23640 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23641
23642         * report.cs: Make all of it static.
23643
23644         * rootcontext.cs: Drop object_type and value_type computations, as
23645         we have those in the TypeManager anyways.
23646
23647         Drop report instance variable too, now it is a global.
23648
23649         * driver.cs: Use try/catch on command line handling.
23650
23651         Add --probe option to debug the error reporting system with a test
23652         suite. 
23653
23654         * report.cs: Add support for exiting program when a probe
23655         condition is reached.
23656
23657 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23658
23659         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23660         we do a forcible conversion regardless of type, to check if 
23661         ForceConversion returns a null.
23662
23663         (Binary::error19): Use location to report error.
23664
23665         (Unary::error23): Use location here too.
23666
23667         * ../errors/cs0019.cs : Check in.
23668
23669         * ../errors/cs0023.cs : Check in.
23670
23671         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23672         case of a non-null MethodInfo object with a length of 0 !
23673
23674         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23675         an applicable member - according to the spec :-)
23676         Also fix logic to find members in base types.
23677
23678         (Unary::ResolveOperator): Same here.
23679
23680         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23681         as I was getting thoroughly confused between this and error19 :-)
23682
23683         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23684         (::FindMostEncompassedType): Implement.
23685         (::FindMostEncompassingType): Implement.
23686         (::StandardConversionExists): Implement.
23687
23688         (UserImplicitCast): Re-vamp. We now need info about most specific
23689         source and target types so that we can do the necessary conversions.
23690
23691         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23692         mathematical union with no duplicates.
23693
23694 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23695
23696         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23697         in order from base classes to child classes, so that we can in
23698         child classes look up in our parent for method names and
23699         attributes (required for handling abstract, virtual, new, override
23700         constructs: we need to instrospect our base class, and if we dont
23701         populate the classes in order, the introspection might be
23702         incorrect.  For example, a method could query its parent before
23703         the parent has any methods and would determine that the parent has
23704         no abstract methods (while it could have had them)).
23705
23706         (RootContext::CreateType): Record the order in which we define the
23707         classes.
23708
23709 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23710
23711         * class.cs (TypeContainer::Populate): Also method definitions can
23712         fail now, keep track of this.
23713
23714         (TypeContainer::FindMembers): Implement support for
23715         DeclaredOnly/noDeclaredOnly flag.
23716
23717         (Constructor::Emit) Return the ConstructorBuilder.
23718
23719         (Method::Emit) Return the MethodBuilder. 
23720         Check for abstract or virtual methods to be public.
23721
23722         * rootcontext.cs (RootContext::CreateType): Register all the
23723         abstract methods required for the class to be complete and the
23724         interface methods that must be implemented. 
23725
23726         * cs-parser.jay: Report error 501 (method requires body if it is
23727         not marked abstract or extern).
23728
23729         * expression.cs (TypeOf::Emit): Implement.
23730
23731         * typemanager.cs: runtime_handle_type, new global type.
23732
23733         * class.cs (Property::Emit): Generate code for properties.
23734
23735 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23736
23737         * expression.cs (Unary::ResolveOperator): Find operators on base type
23738         too - we now conform exactly to the spec.
23739
23740         (Binary::ResolveOperator): Same here.
23741
23742         * class.cs (Operator::Define): Fix minor quirk in the tests.
23743
23744         * ../errors/cs0215.cs : Added.
23745
23746         * ../errors/cs0556.cs : Added.
23747
23748         * ../errors/cs0555.cs : Added.
23749
23750 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23751
23752         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23753         single integer which is really efficient
23754
23755 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23756
23757         *  expression.cs (Expression::ImplicitUserConversion): Use location
23758         even in the case when we are examining True operators.
23759  
23760         * class.cs (Operator::Define): Perform extensive checks to conform
23761         with the rules for operator overloading in the spec.
23762
23763         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23764         some of the other conversions mentioned in the spec.
23765
23766         * typemanager.cs (array_type): New static member for the System.Array built-in
23767         type.
23768
23769         (cloneable_interface): For System.ICloneable interface.
23770
23771         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23772         we start resolving the tree and populating types.
23773
23774         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23775  
23776 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23777
23778         * expression.cs (Expression::ExprClassFromMemberInfo,
23779         Expression::Literalize): Create literal expressions from
23780         FieldInfos which are literals.
23781
23782         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23783         type casts, because they were wrong.  The test suite in tests
23784         caught these ones.
23785
23786         (ImplicitNumericConversion): ushort to ulong requires a widening
23787         cast. 
23788
23789         Int32 constant to long requires widening cast as well.
23790
23791         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23792         for integers because the type on the stack is not i4.
23793
23794 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23795
23796         * expression.cs (report118): require location argument. 
23797
23798         * parameter.cs: Do not dereference potential null value.
23799
23800         * class.cs: Catch methods that lack the `new' keyword when
23801         overriding a name.  Report warnings when `new' is used without
23802         anything being there to override.
23803
23804         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23805
23806         * class.cs: Only add constructor to hashtable if it is non-null
23807         (as now constructors can fail on define).
23808
23809         (TypeManager, Class, Struct): Take location arguments.
23810
23811         Catch field instance initialization in structs as errors.
23812
23813         accepting_filter: a new filter for FindMembers that is static so
23814         that we dont create an instance per invocation.
23815
23816         (Constructor::Define): Catch errors where a struct constructor is
23817         parameterless 
23818
23819         * cs-parser.jay: Pass location information for various new
23820         constructs. 
23821
23822         * delegate.cs (Delegate): take a location argument.
23823
23824         * driver.cs: Do not call EmitCode if there were problesm in the
23825         Definition of the types, as many Builders wont be there. 
23826
23827         * decl.cs (Decl::Decl): Require a location argument.
23828
23829         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23830         into integers, and find the most appropiate integer for it.
23831
23832         * literal.cs: Implement ULongLiteral.
23833
23834         * rootcontext.cs: Provide better information about the location of
23835         failure when CreateType fails.
23836
23837 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23838
23839         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23840         as well.
23841
23842         * expression.cs (Binary::CheckShiftArguments): Add missing type
23843         computation.
23844         (Binary::ResolveOperator): Add type to the logical and and logical
23845         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23846         before.
23847
23848         (Binary::DoNumericPromotions): In the case where either argument
23849         is ulong (and most signed types combined with ulong cause an
23850         error) perform implicit integer constant conversions as well.
23851
23852 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23853
23854         * expression.cs (UserImplicitCast): Method should always be
23855         non-null. 
23856         (Invocation::BetterConversion): Simplified test for IntLiteral.
23857
23858         (Expression::ImplicitNumericConversion): Split this routine out.
23859         Put the code that performs implicit constant integer conversions
23860         here. 
23861
23862         (Expression::Resolve): Become a wrapper around DoResolve so we can
23863         check eclass and type being set after resolve.
23864
23865         (Invocation::Badness): Remove this dead function
23866
23867         (Binary::ResolveOperator): Do not compute the expensive argumnets
23868         unless we have a union for it.
23869
23870         (Probe::Emit): Is needs to do an isinst and then
23871         compare against null.
23872
23873         (::CanConvert): Added Location argument.  If the Location argument
23874         is null (Location.Null), then we do not report errors.  This is
23875         used by the `probe' mechanism of the Explicit conversion.  We do
23876         not want to generate an error for something that the user
23877         explicitly requested to be casted.  But the pipeline for an
23878         explicit cast first tests for potential implicit casts.
23879
23880         So for now, if the Location is null, it means `Probe only' to
23881         avoid adding another argument.   Might have to revise this
23882         strategy later.
23883
23884         (ClassCast): New class used to type cast objects into arbitrary
23885         classes (used in Explicit Reference Conversions).
23886
23887         Implement `as' as well.
23888
23889         Reverted all the patches from Ravi below: they were broken:
23890
23891                 * The use of `level' as a mechanism to stop recursive
23892                   invocations is wrong.  That was there just to catch the
23893                   bug with a strack trace but not as a way of addressing
23894                   the problem.
23895
23896                   To fix the problem we have to *understand* what is going
23897                   on and the interactions and come up with a plan, not
23898                   just get things going.
23899
23900                 * The use of the type conversion cache that I proposed
23901                   last night had an open topic: How does this work across
23902                   protection domains.  A user defined conversion might not
23903                   be public in the location where we are applying the
23904                   conversion, a different conversion might be selected
23905                   (ie, private A->B (better) but public B->A (worse),
23906                   inside A, A->B applies, but outside it, B->A will
23907                   apply).
23908
23909                 * On top of that (ie, even if the above is solved),
23910                   conversions in a cache need to be abstract.  Ie, `To
23911                   convert from an Int to a Short use an OpcodeCast', not
23912                   `To convert from an Int to a Short use the OpcodeCast on
23913                   the variable 5' (which is what this patch was doing).
23914
23915 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23916
23917         * expression.cs (Invocation::ConversionExists): Re-write to use
23918         the conversion cache
23919
23920         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23921         cache all conversions done, not just user-defined ones.
23922
23923         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23924         to determine if a conversion exists instead of acutually trying to 
23925         perform the conversion. It's faster too.
23926
23927         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23928         and only then attempt the implicit conversion.
23929
23930 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23931
23932         * expression.cs (ConvertImplicit): Use a cache for conversions
23933         already found. Check level of recursion and bail out if necessary.
23934
23935 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23936
23937         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23938         Export standard methods that we expect for string operations.
23939
23940         * statement.cs (Block::UsageWarning): Track usage of variables and
23941         report the errors for not used variables.
23942
23943         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23944         operator. 
23945
23946 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23947
23948         * codegen.cs: remove unnneded code 
23949
23950         * expression.cs: Removed BuiltinTypeAccess class
23951
23952         Fix the order in which implicit conversions are
23953         done.  
23954
23955         The previous fixed dropped support for boxed conversions (adding a
23956         test to the test suite now)
23957
23958         (UserImplicitCast::CanConvert): Remove test for source being null,
23959         that code is broken.  We should not feed a null to begin with, if
23960         we do, then we should track the bug where the problem originates
23961         and not try to cover it up here.
23962
23963         Return a resolved expression of type UserImplicitCast on success
23964         rather than true/false.  Ravi: this is what I was talking about,
23965         the pattern is to use a static method as a "constructor" for
23966         objects. 
23967
23968         Also, do not create arguments until the very last minute,
23969         otherwise we always create the arguments even for lookups that
23970         will never be performed. 
23971
23972         (UserImplicitCast::Resolve): Eliminate, objects of type
23973         UserImplicitCast are born in a fully resolved state. 
23974
23975         * typemanager.cs (InitCoreTypes): Init also value_type
23976         (System.ValueType). 
23977
23978         * expression.cs (Cast::Resolve): First resolve the child expression.
23979
23980         (LValue): Add new method AddressOf to be used by
23981         the `&' operator.  
23982
23983         Change the argument of Store to take an EmitContext instead of an
23984         ILGenerator, because things like FieldExpr need to be able to call
23985         their children expression to generate the instance code. 
23986
23987         (Expression::Error, Expression::Warning): Sugar functions for
23988         reporting errors.
23989
23990         (Expression::MemberLookup): Accept a TypeContainer instead of a
23991         Report as the first argument.
23992
23993         (Expression::ResolvePrimary): Killed.  I still want to improve
23994         this as currently the code is just not right.
23995
23996         (Expression::ResolveMemberAccess): Simplify, but it is still
23997         wrong. 
23998
23999         (Unary::Resolve): Catch errors in AddressOf operators.
24000
24001         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24002         index to a byte for the short-version, or the compiler will choose
24003         the wrong Emit call, which generates the wrong data.
24004
24005         (ParameterReference::Emit, ::Store): same.
24006
24007         (FieldExpr::AddressOf): Implement.
24008
24009         * typemanager.cs: TypeManager: made public variable instead of
24010         property.
24011
24012         * driver.cs: document --fatal.
24013
24014         * report.cs (ErrorMessage, WarningMessage): new names for the old
24015         Error and Warning classes.
24016
24017         * cs-parser.jay (member_access): Turn built-in access to types
24018         into a normal simplename
24019
24020 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24021
24022         * expression.cs (Invocation::BetterConversion): Fix to cope
24023         with q being null, since this was introducing a bug.
24024
24025         * expression.cs (ConvertImplicit): Do built-in conversions first.
24026
24027 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24028
24029         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24030
24031 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24032
24033         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24034         I had introduced long ago (what's new ?).
24035
24036         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24037         the work of all the checking. 
24038         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24039         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24040
24041         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24042         that is the right way. 
24043
24044         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24045         overloading resolution. Use everywhere instead of cutting and pasting code.
24046
24047         (Binary::ResolveOperator): Use MakeUnionSet.
24048
24049         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24050         we have to convert to bool types. Not complete yet.
24051
24052 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24053
24054         * typemanager.cs (TypeManager::CSharpName): support ushort.
24055
24056         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24057         to provide an expression that performsn an implicit constant int
24058         conversion (section 6.1.6).
24059         (Expression::ConvertImplicitRequired): Reworked to include
24060         implicit constant expression conversions.
24061
24062         (Expression::ConvertNumericExplicit): Finished.
24063
24064         (Invocation::Emit): If InstanceExpression is null, then it means
24065         that we perform a call on this.
24066
24067 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24068
24069         * expression.cs (Unary::Emit): Remove some dead code.
24070         (Probe): Implement Resolve and Emit for `is'.
24071         (Expression::ConvertImplicitRequired): Attempt to do constant
24072         expression conversions here.  Maybe should be moved to
24073         ConvertImplicit, but I am not sure.
24074         (Expression::ImplicitLongConstantConversionPossible,
24075         Expression::ImplicitIntConstantConversionPossible): New functions
24076         that tell whether is it possible to apply an implicit constant
24077         expression conversion.
24078
24079         (ConvertNumericExplicit): Started work on explicit numeric
24080         conversions.
24081
24082         * cs-parser.jay: Update operator constants.
24083
24084         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24085         (Parameters::GetSignature): Hook up VerifyArgs here.
24086         (Parameters::VerifyArgs): Verifies that no two arguments have the
24087         same name. 
24088
24089         * class.cs (Operator): Update the operator names to reflect the
24090         ones that the spec expects (as we are just stringizing the
24091         operator names).
24092
24093         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24094         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24095         previous usage did only work for our methods.
24096         (Expression::ConvertImplicit): Handle decimal implicit numeric
24097         conversions as well.
24098         (Expression::InternalTypeConstructor): Used to invoke constructors
24099         on internal types for default promotions.
24100
24101         (Unary::Emit): Implement special handling for the pre/post
24102         increment/decrement for overloaded operators, as they need to have
24103         the same semantics as the other operators.
24104
24105         (Binary::ResolveOperator): ditto.
24106         (Invocation::ConversionExists): ditto.
24107         (UserImplicitCast::Resolve): ditto.
24108
24109 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24110
24111         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24112         operator, return after emitting body. Regression tests pass again !
24113
24114         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24115         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24116         (Invocation::OverloadResolve): Ditto.
24117         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24118
24119         * everywhere : update calls to the above methods accordingly.
24120
24121 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24122
24123         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24124
24125         * expression.cs (ExpressionStatement): New base class used for
24126         expressions that can appear in statements, so that we can provide
24127         an alternate path to generate expression that do not leave a value
24128         on the stack.
24129
24130         (Expression::Emit, and all the derivatives): We no longer return
24131         whether a value is left on the stack or not.  Every expression
24132         after being emitted leaves a single value on the stack.
24133
24134         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24135         facilties of ExpressionStatement if possible.
24136
24137         * cs-parser.jay: Update statement_expression.
24138
24139 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24140
24141         * driver.cs: Change the wording of message
24142
24143 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24144
24145         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24146         the type of the expression to the return type of the method if
24147         we have an overloaded operator match ! The regression tests pass again !
24148         (Unary::ResolveOperator): Ditto.
24149
24150         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24151         to find "op_Implicit", not "implicit" ;-)
24152         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24153         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24154
24155         * everywhere : Correct calls to the above accordingly.
24156
24157         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24158         (ConvertImplicit): Do user-defined conversion if it exists.
24159
24160 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24161
24162         * assign.cs: track location.
24163         (Resolve): Use implicit conversions on assignment.
24164
24165         * literal.cs: Oops.  Not good, Emit of short access values should
24166         pass (Bytes) or the wrong argument will be selected.
24167
24168         * expression.cs (Unary::Emit): Emit code for -expr.
24169
24170         (Unary::ResolveOperator): Handle `Substract' for non-constants
24171         (substract from zero from the non-constants).
24172         Deal with Doubles as well. 
24173
24174         (Expression::ConvertImplicitRequired): New routine that reports an
24175         error if no implicit conversion exists. 
24176
24177         (Invocation::OverloadResolve): Store the converted implicit
24178         expressions if we make them
24179
24180 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24181
24182         * class.cs (ConstructorInitializer): Take a Location argument.
24183         (ConstructorBaseInitializer): Same here.
24184         (ConstructorThisInitializer): Same here.
24185
24186         * cs-parser.jay : Update all calls accordingly.
24187
24188         * expression.cs (Unary, Binary, New): Take location argument.
24189         Update accordingly everywhere.
24190
24191         * cs-parser.jay : Update all calls to the above to take a location
24192         argument.
24193
24194         * class.cs : Ditto.
24195
24196 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24197
24198         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24199         (Invocation::BetterConversion): Same here
24200         (Invocation::ConversionExists): Ditto.
24201
24202         (Invocation::ConversionExists): Implement.
24203
24204 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24205
24206         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24207         Also take an additional TypeContainer argument.
24208
24209         * All over : Pass in TypeContainer as argument to OverloadResolve.
24210
24211         * typemanager.cs (CSharpName): Update to check for the string type and return
24212         that too.
24213
24214         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24215         a given method.
24216
24217 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24218
24219         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24220         (Invocation::BetterFunction): Implement.
24221         (Invocation::BetterConversion): Implement.
24222         (Invocation::ConversionExists): Skeleton, no implementation yet.
24223
24224         Okay, things work fine !
24225
24226 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24227
24228         * typemanager.cs: declare and load enum_type, delegate_type and
24229         void_type. 
24230
24231         * expression.cs (Expression::Emit): Now emit returns a value that
24232         tells whether a value is left on the stack or not.  This strategy
24233         might be reveted tomorrow with a mechanism that would address
24234         multiple assignments.
24235         (Expression::report118): Utility routine to report mismatches on
24236         the ExprClass.
24237
24238         (Unary::Report23): Report impossible type/operator combination
24239         utility function.
24240
24241         (Unary::IsIncrementableNumber): Whether the type can be
24242         incremented or decremented with add.
24243         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24244         complemented. 
24245         (Unary::ResolveOperator): Implement ++, !, ~,
24246
24247         (Invocation::Emit): Deal with new Emit convetion.
24248
24249         * All Expression derivatives: Updated their Emit method to return
24250         whether they leave values on the stack or not.
24251
24252         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24253         stack for expressions that are statements. 
24254
24255 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24256
24257         * expression.cs (LValue): New interface.  Must be implemented by
24258         LValue objects.
24259         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24260         LValue interface.
24261
24262         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24263         interface for generating code, simplifies the code.
24264
24265 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24266
24267         * expression.cs (everywhere): Comment out return statements in ::Resolve
24268         methods to avoid the warnings.
24269
24270 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24271
24272         * driver.cs (parse): Report error 2001 if we can not open the
24273         source file.
24274
24275         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24276         not resolve it.
24277
24278         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24279         object. 
24280
24281         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24282         otherwise nested blocks end up with the same index.
24283
24284         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24285
24286         * expression.cs:  Instead of having FIXMEs in the Resolve
24287         functions, throw exceptions so it is obvious that we are facing a
24288         bug. 
24289
24290         * cs-parser.jay (invocation_expression): Pass Location information.
24291
24292         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24293         Use a basename for those routines because .NET does not like paths
24294         on them. 
24295
24296         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24297         already defined.
24298
24299 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24300
24301         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24302         are loading the correct data types (throws an exception if not).
24303         (TypeManager::InitCoreTypes): Use CoreLookupType
24304
24305         * expression.cs (Unary::ResolveOperator): return the child
24306         expression for expressions which are just +expr.
24307         (Unary::ResolveOperator): Return negative literals for -LITERAL
24308         expressions (otherwise they are Unary {Literal}).
24309         (Invocation::Badness): Take into account `Implicit constant
24310         expression conversions'.
24311
24312         * literal.cs (LongLiteral): Implement long literal class.
24313         (IntLiteral): export the `Value' of the intliteral. 
24314
24315 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24316
24317         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24318
24319         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24320         instead of 'Operator'
24321
24322         * expression.cs (Binary::ResolveOperator): Update accordingly.
24323         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24324         and 'Minus'
24325
24326         * cs-parser.jay (unary_expression): Update to use the new names.
24327
24328         * gen-treedump.cs (GetUnary): Same here.
24329
24330         * expression.cs (Unary::Resolve): Implement.
24331         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24332         operators are found instead of making noise ;-)
24333         (Unary::ResolveOperator): New method to do precisely the same thing which
24334         Binary::ResolveOperator does for Binary expressions.
24335         (Unary.method, .Arguments): Add.
24336         (Unary::OperName): Implement.   
24337         (Unary::ForceConversion): Copy and Paste !
24338
24339         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24340         a unary operator.
24341
24342         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24343         for the inbuilt operators. Only overloading works for now ;-)
24344
24345 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24346
24347         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24348         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24349
24350         * expression.cs (This::Emit): Implement. 
24351         (This::Resolve): Implement.
24352         (TypeOf:Resolve): Implement.
24353         (Expression::ResolveSimpleName): Add an implicit this to instance
24354         field references. 
24355         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24356         Bind instance variable to Field expressions.
24357         (FieldExpr::Instance): New field used to track the expression that
24358         represents the object instance.
24359         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24360         binding 
24361         (FieldExpr::Emit): Implement.
24362
24363         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24364         the last instruction contains a return opcode to avoid generating
24365         the last `ret' instruction (this generates correct code, and it is
24366         nice to pass the peverify output).
24367
24368         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24369         initializer for static and instance variables.
24370         (Constructor::Emit): Allow initializer to be null in the case of
24371         static constructors.  Only emit initializer for instance
24372         constructors. 
24373
24374         (TypeContainer::FindMembers): Return a null array if there are no
24375         matches.
24376
24377         Also fix the code for the MemberTypes.Method branch, as it was not
24378         scanning that for operators (or tried to access null variables before).
24379
24380         * assign.cs (Assign::Emit): Handle instance and static fields. 
24381
24382         * TODO: Updated.
24383
24384         * driver.cs: Stop compilation if there are parse errors.
24385
24386         * cs-parser.jay (constructor_declaration): Provide default base
24387         initializer for non-static constructors.
24388         (constructor_declarator): Do not provide a default base
24389         initializers if none was specified.
24390         Catch the fact that constructors should not have parameters.
24391
24392         * class.cs: Do not emit parent class initializers for static
24393         constructors, that should be flagged as an error.
24394
24395 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24396
24397         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24398         Move back code into TypeContainer::Populate.
24399
24400 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24401
24402         * class.cs (TypeContainer::AddConstructor): Fix the check to
24403         compare against Name, not Basename. 
24404         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24405
24406         * cs-parser.jay : Update accordingly.
24407
24408         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24409         for methods, don't forget to look into the operators too.
24410         (RegisterMethodBuilder): Helper method to take care of this for
24411         methods, constructors and operators.
24412         (Operator::Define): Completely revamp.
24413         (Operator.OperatorMethod, MethodName): New fields.
24414         (TypeContainer::Populate): Move the registering of builders into
24415         RegisterMethodBuilder.
24416         (Operator::Emit): Re-write.
24417
24418         * expression.cs (Binary::Emit): Comment out code path to emit method
24419         invocation stuff for the case when we have a user defined operator. I am
24420         just not able to get it right !
24421
24422 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24423
24424         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24425         argument. 
24426
24427         (Expression::MemberLookup): Provide a version that allows to
24428         specify the MemberTypes and BindingFlags. 
24429
24430         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24431         so it was not fetching variable information from outer blocks.
24432
24433         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24434         Beforefieldinit as it was buggy.
24435
24436         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24437         that Ravi put here.  
24438
24439         * class.cs (Constructor::Emit): Only emit if block is not null.
24440         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24441         deal with this by semantically definining it as if the user had
24442         done it.
24443
24444         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24445         constructors as we now "emit" them at a higher level.
24446
24447         (TypeContainer::DefineDefaultConstructor): Used to define the
24448         default constructors if none was provided.
24449
24450         (ConstructorInitializer): Add methods Resolve and Emit. 
24451
24452         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24453
24454 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24455
24456         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24457         the default constructor builder with our hashtable for methodbuilders
24458         to methodcores.
24459
24460         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24461         and argument_count is 0 in which case we have a match.
24462         (Binary::ResolveOperator): More null checking and miscellaneous coding
24463         style cleanup.
24464
24465 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24466
24467         * rootcontext.cs (IsNameSpace): Compare against null.
24468
24469         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24470
24471         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24472         and Unary::Operator.
24473
24474         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24475         accordingly.
24476
24477         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24478         we have overloaded operators.
24479         (Binary::ResolveOperator): Implement the part which does the operator overload
24480         resolution.
24481
24482         * class.cs (Operator::Emit): Implement.
24483         (TypeContainer::Emit): Emit the operators we have too.
24484
24485         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24486         the case when we have a user-defined operator.
24487
24488 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24489
24490         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24491
24492 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24493
24494         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24495         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24496         (Constructor::Emit): Implement.
24497         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24498         if we have no work to do. 
24499         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24500         Emit method.
24501
24502         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24503         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24504
24505         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24506         of parent.parent.
24507
24508 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24509
24510         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24511         in the source.
24512         (Tree::RecordNamespace): Method to do what the name says ;-)
24513         (Tree::Namespaces): Property to get at the namespaces hashtable.
24514
24515         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24516         keep track.
24517
24518         * rootcontext.cs (IsNamespace): Fixed it :-)
24519
24520 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24521
24522         * class.cs (TypeContainer::FindMembers): Add support for
24523         constructors. 
24524         (MethodCore): New class that encapsulates both the shared aspects
24525         of a Constructor and a Method.  
24526         (Method, Constructor): Factored pieces into MethodCore.
24527
24528         * driver.cs: Added --fatal which makes errors throw exceptions.
24529         Load System assembly as well as part of the standard library.
24530
24531         * report.cs: Allow throwing exceptions on errors for debugging.
24532
24533         * modifiers.cs: Do not use `parent', instead use the real type
24534         container to evaluate permission settings.
24535
24536         * class.cs: Put Ravi's patch back in.  He is right, and we will
24537         have to cope with the
24538
24539 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24540
24541         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24542         FamORAssem, not FamANDAssem.
24543
24544 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24545
24546         * driver.cs: Added --parse option that only parses its input files
24547         and terminates.
24548
24549         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24550         incorrect.  IsTopLevel is not used to tell whether an object is
24551         root_types or not (that can be achieved by testing this ==
24552         root_types).  But to see if this is a top-level *class* (not
24553         necessarly our "toplevel" container). 
24554
24555 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24556
24557         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24558         parent instead of a direct call to GetType.
24559
24560 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24561
24562         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24563         Modifiers.TypeAttr. This should just be a call to that method.
24564
24565         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24566         object so that we can determine if we are top-level or not.
24567
24568         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24569         TypeContainer too.
24570
24571         * enum.cs (Enum::Define): Ditto.
24572
24573         * modifiers.cs (FieldAttr): Re-write.
24574
24575         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24576         (TypeContainer::HaveStaticConstructor): New property to provide access
24577         to precisely that info.
24578
24579         * modifiers.cs (MethodAttr): Re-write.
24580         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24581
24582         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24583         of top-level types as claimed.
24584
24585 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24586
24587         * expression.cs (MemberLookup): Fruitless attempt to lookup
24588         constructors.  Maybe I need to emit default constructors?  That
24589         might be it (currently .NET emits this for me automatically).
24590         (Invocation::OverloadResolve): Cope with Arguments == null.
24591         (Invocation::EmitArguments): new function, shared by the new
24592         constructor and us.
24593         (Invocation::Emit): Handle static and instance methods.  Emit
24594         proper call instruction for virtual or non-virtual invocations.
24595         (New::Emit): Implement.
24596         (New::Resolve): Implement.
24597         (MemberAccess:Resolve): Implement.
24598         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24599         to track instances.
24600         (FieldExpr::Resolve): Set type.
24601
24602         * support.cs: Handle empty arguments.
24603                 
24604         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24605         SimpleLookup): Auxiliary routines to help parse a qualifier
24606         identifier.  
24607
24608         Update qualifier_identifier rule.
24609
24610         * codegen.cs: Removed debugging messages.
24611
24612         * class.cs: Make this a global thing, this acts just as a "key" to
24613         objects that we might have around.
24614
24615         (Populate): Only initialize method_builders_to_methods once.
24616
24617         * expression.cs (PropertyExpr): Initialize type from the
24618         PropertyType. 
24619
24620         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24621         Resolve pattern.  Attempt to implicitly convert value to boolean.
24622         Emit code.
24623
24624         * expression.cs: Set the type for the int32/int32 argument case.
24625         (Binary::ResolveOperator): Set the return type to boolean for
24626         comparission operators
24627
24628         * typemanager.cs: Remove debugging print code.
24629
24630         (Invocation::Resolve): resolve type.
24631
24632         * class.cs: Allocate a MemberInfo of the correct size, as the code
24633         elsewhere depends on the test to reflect the correct contents.
24634
24635         (Method::) Keep track of parameters, due to System.Reflection holes
24636
24637         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24638         mapping here.
24639
24640         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24641         of the exact size and return that.
24642
24643         (Class::LookupMethodByBuilder): New function that maps
24644         MethodBuilders to its methods.  Required to locate the information
24645         on methods because System.Reflection bit us again.
24646
24647         * support.cs: New file, contains an interface ParameterData and
24648         two implementations: ReflectionParameters and InternalParameters
24649         used to access Parameter information.  We will need to grow this
24650         as required.
24651
24652         * expression.cs (Invocation::GetParameterData): implement a cache
24653         and a wrapper around the ParameterData creation for methods. 
24654         (Invocation::OverloadResolve): Use new code.
24655
24656 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24657
24658         * class.cs (TypeContainer::EmitField): Remove and move into 
24659         (Field::Define): here and modify accordingly.
24660         (Field.FieldBuilder): New member.
24661         (TypeContainer::Populate): Update accordingly.
24662         (TypeContainer::FindMembers): Implement.
24663
24664 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24665
24666         * statement.cs: (VariableInfo::VariableType): New field to be
24667         initialized with the full type once it is resolved. 
24668
24669 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24670
24671         * parameter.cs (GetParameterInfo): Use a type cache to compute
24672         things only once, and to reuse this information
24673
24674         * expression.cs (LocalVariableReference::Emit): Implement.
24675         (OpcodeCast::Emit): fix.
24676
24677         (ParameterReference::Resolve): Implement.
24678         (ParameterReference::Emit): Implement.
24679
24680         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24681         that are expressions need to stay as Expressions.
24682
24683         * typemanager.cs (CSharpName): Returns the C# name of a type if
24684         possible. 
24685
24686         * expression.cs (Expression::ConvertImplicit): New function that
24687         implements implicit type conversions.
24688
24689         (Expression::ImplicitReferenceConversion): Implements implicit
24690         reference conversions.
24691
24692         (EmptyCast): New type for transparent casts.
24693
24694         (OpcodeCast): New type for casts of types that are performed with
24695         a sequence of bytecodes.
24696
24697         (BoxedCast): New type used for casting value types into reference
24698         types.  Emits a box opcode.
24699
24700         (Binary::DoNumericPromotions): Implements numeric promotions of
24701         and computation of the Binary::Type.
24702
24703         (Binary::EmitBranchable): Optimization.
24704
24705         (Binary::Emit): Implement code emission for expressions.
24706
24707         * typemanager.cs (TypeManager): Added two new core types: sbyte
24708         and byte.
24709
24710 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24711
24712         * class.cs (TypeContainer::FindMembers): Method which does exactly
24713         what Type.FindMembers does, only we don't have to use reflection. No
24714         implementation yet.
24715
24716         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24717         typecontainer objects as we need to get at them.
24718         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24719
24720         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24721         typecontainer object.
24722
24723         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24724         of just a Report object.
24725
24726 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24727
24728         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24729         "remove_"
24730         (TypeContainer::Populate): Now define the delegates of the type too.
24731         (TypeContainer.Delegates): Property to access the list of delegates defined
24732         in the type.
24733
24734         * delegates.cs (Delegate::Define): Implement partially.
24735
24736         * modifiers.cs (TypeAttr): Handle more flags.
24737
24738 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24739
24740         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24741         and not <=
24742         (Operator::Define): Re-write logic to get types by using the LookupType method
24743         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24744         (Indexer::Define): Ditto.
24745         (Event::Define): Ditto.
24746         (Property::Define): Ditto.
24747
24748 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24749
24750         * class.cs (TypeContainer::Populate): Now define operators too. 
24751         (TypeContainer.Operators): New property to access the list of operators
24752         in a type.
24753         (Operator.OperatorMethodBuilder): New member to hold the method builder
24754         for the operator we are defining.
24755         (Operator::Define): Implement.
24756
24757 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24758
24759         * class.cs (Event::Define): Make the prefixes of the accessor methods
24760         addOn_ and removeOn_ 
24761
24762         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24763         of the location being passed in too. Ideally, this should go later since all
24764         error reporting should be done through the Report object.
24765
24766         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24767         (Populate): Iterate thru the indexers we have and define them too.
24768         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24769         for the get and set accessors.
24770         (Indexer::Define): Implement.
24771
24772 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24773
24774         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24775         my previous implementation, did not work.
24776
24777         * typemanager.cs: Add a couple of missing types (the longs).
24778
24779         * literal.cs: Use TypeManager.bool_type instead of getting it.
24780
24781         * expression.cs (EventExpr): New kind of expressions.
24782         (Expressio::ExprClassFromMemberInfo): finish
24783
24784 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24785
24786         * assign.cs: Emit stores to static fields differently.
24787
24788 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24789
24790         * Merge in changes and adjust code to tackle conflicts. Backed out my
24791         code in Assign::Resolve ;-) 
24792
24793 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24794
24795         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24796         instead Report.Error and also pass in the location.
24797         (CSharpParser::Lexer): New readonly property to return the reference
24798         to the Tokenizer object.
24799         (declare_local_variables): Use Report.Error with location instead of plain 
24800         old error.
24801         (CheckDef): Ditto.
24802
24803         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24804         (Operator.CheckBinaryOperator): Ditto.
24805
24806         * cs-parser.jay (operator_declarator): Update accordingly.
24807
24808         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24809         (CheckBinaryOperator): Same here.
24810
24811         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24812         on the name without any prefixes of namespace names etc. This is because we
24813         already might have something already fully qualified like 
24814         'System.Console.WriteLine'
24815
24816         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24817
24818 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24819
24820         * cs-tokenizer.cs (location): Return a string which also contains
24821         the file name.
24822
24823         * expression.cs (ElementAccess): New class for expressions of the
24824         type 'element access.'
24825         (BaseAccess): New class for expressions of the type 'base access.'
24826         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24827         respectively.
24828
24829         * cs-parser.jay (element_access): Implement action.
24830         (base_access): Implement actions.
24831         (checked_expression, unchecked_expression): Implement.
24832
24833         * cs-parser.jay (local_variable_type): Correct and implement.
24834         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24835
24836         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24837
24838         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24839         name and the specifiers.
24840
24841         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24842
24843         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24844         making them all public ;-)
24845
24846         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24847         class anyways.
24848
24849 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24850
24851         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24852         PropertyExprs.
24853         (FieldExpr, PropertyExprs): New resolved expressions.
24854         (SimpleName::MemberStaticCheck): Perform static checks for access
24855         to non-static fields on static methods. Maybe this should be
24856         generalized for MemberAccesses. 
24857         (SimpleName::ResolveSimpleName): More work on simple name
24858         resolution. 
24859
24860         * cs-parser.jay (primary_expression/qualified_identifier): track
24861         the parameter index.
24862
24863         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24864         (EmitContext::EmitBoolExpression): Chain to expression generation
24865         instead of temporary hack.
24866         (::EmitStatementExpression): Put generic expression code generation.
24867
24868         * assign.cs (Assign::Emit): Implement variable assignments to
24869         local variables, parameters and fields.
24870
24871 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24872
24873         * statement.cs (Block::GetVariableInfo): New method, returns the
24874         VariableInfo for a variable name in a block.
24875         (Block::GetVariableType): Implement in terms of GetVariableInfo
24876
24877         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24878         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24879
24880 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24881
24882         * cs-parser.jay (operator_declaration): Continue on my quest : update
24883         to take attributes argument.
24884         (event_declaration): Ditto.
24885         (enum_declaration): Ditto.
24886         (indexer_declaration): Ditto.
24887
24888         * class.cs (Operator::Operator): Update constructor accordingly.
24889         (Event::Event): Ditto.
24890
24891         * delegate.cs (Delegate::Delegate): Same here.
24892
24893         * enum.cs (Enum::Enum): Same here.
24894
24895 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24896
24897         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24898
24899         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24900
24901         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24902         being passed around as an arraylist.
24903         (Attributes::AddAttribute): Method to add attribute sections.
24904
24905         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24906         (struct_declaration): Update accordingly.
24907         (constant_declaration): Update.
24908         (field_declaration): Update.
24909         (method_header): Update.
24910         (fixed_parameter): Update.
24911         (parameter_array): Ditto.
24912         (property_declaration): Ditto.
24913         (destructor_declaration): Ditto.
24914
24915         * class.cs (Struct::Struct): Update constructors accordingly.
24916         (Class::Class): Ditto.
24917         (Field::Field): Ditto.
24918         (Method::Method): Ditto.
24919         (Property::Property): Ditto.
24920         (TypeContainer::OptAttribute): update property's return type.
24921
24922         * interface.cs (Interface.opt_attributes): New member.
24923         (Interface::Interface): Update to take the extra Attributes argument.
24924
24925         * parameter.cs (Parameter::Parameter): Ditto.
24926
24927         * constant.cs (Constant::Constant): Ditto.
24928
24929         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24930         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24931         the attributes as a parameter.
24932         (InterfaceProperty): Update constructor call.
24933         (InterfaceEvent): Ditto.
24934         (InterfaceMethod): Ditto.
24935         (InterfaceIndexer): Ditto.
24936
24937         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24938         pass the attributes too.
24939         (interface_event_declaration): Ditto.
24940         (interface_property_declaration): Ditto.
24941         (interface_method_declaration): Ditto.
24942         (interface_declaration): Ditto.
24943
24944 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24945
24946         * class.cs (Method::Define): Track the "static Main" definition to
24947         create an entry point. 
24948
24949         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24950         EntryPoint if we find it. 
24951
24952         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24953         (EmitContext::ig): Make this variable public.
24954
24955         * driver.cs: Make the default output file be the first file name
24956         with the .exe extension.  
24957
24958         Detect empty compilations
24959
24960         Handle various kinds of output targets.  Handle --target and
24961         rename -t to --dumper.
24962
24963         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24964         methods inherited from Expression return now an Expression.  This
24965         will is used during the tree rewriting as we resolve them during
24966         semantic analysis.
24967
24968         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24969         the spec.  Missing entirely is the information about
24970         accessability of elements of it.
24971
24972         (Expression::ExprClassFromMemberInfo): New constructor for
24973         Expressions that creates a fully initialized Expression based on
24974         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24975         a Type.
24976
24977         (Invocation::Resolve): Begin implementing resolution of invocations.
24978
24979         * literal.cs (StringLiteral):  Implement Emit.
24980
24981 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24982
24983         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24984         member.
24985
24986 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24987
24988         * cs-parser.jay (attribute_arguments): Implement actions.
24989         (attribute): Fix bug in production. Implement action.
24990         (attribute_list): Implement.
24991         (attribute_target): Implement.
24992         (attribute_target_specifier, opt_target_specifier): Implement
24993         (CheckAttributeTarget): New method to check if the attribute target
24994         is valid.
24995         (attribute_section): Implement.
24996         (opt_attributes): Implement.
24997
24998         * attribute.cs : New file to handle attributes.
24999         (Attribute): Class to hold attribute info.
25000
25001         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25002         (attribute_section): Modify production to use 2 different rules to 
25003         achieve the same thing. 1 s/r conflict down !
25004         Clean out commented, useless, non-reducing dimension_separator rules.
25005
25006         * class.cs (TypeContainer.attributes): New member to hold list
25007         of attributes for a type.
25008         (Struct::Struct): Modify to take one more argument, the attribute list.
25009         (Class::Class): Ditto.
25010         (Field::Field): Ditto.
25011         (Method::Method): Ditto.
25012         (Property::Property): Ditto.
25013
25014         * cs-parser.jay (struct_declaration): Update constructor call to
25015         pass in the attributes too.
25016         (class_declaration): Ditto.
25017         (constant_declaration): Ditto.
25018         (field_declaration): Ditto.
25019         (method_header): Ditto.
25020         (fixed_parameter): Ditto.
25021         (parameter_array): Ditto.
25022         (property_declaration): Ditto.
25023
25024         * constant.cs (Constant::Constant): Update constructor similarly.
25025         Use System.Collections.
25026
25027         * parameter.cs (Parameter::Parameter): Update as above.
25028
25029 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25030
25031         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25032         (TypeContainer.delegates): New member to hold list of delegates.
25033
25034         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25035         this time as I seem to be on crack ;-)
25036
25037 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25038
25039         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25040         tell whether an identifier represents a namespace.
25041
25042         * expression.cs (NamespaceExpr): A namespace expression, used only
25043         temporarly during expression resolution.
25044         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25045         utility functions to resolve names on expressions.
25046
25047 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25048
25049         * codegen.cs: Add hook for StatementExpressions. 
25050
25051         * class.cs: Fix inverted test for static flag in methods.
25052
25053 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25054
25055         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25056         to make it coincide with MS' number.
25057         (Operator::CheckBinaryOperator): Ditto.
25058
25059         * ../errors/errors.txt : Remove error numbers added earlier.
25060
25061         * ../errors/cs1019.cs : Test case for error # 1019
25062
25063         * ../errros/cs1020.cs : Test case for error # 1020
25064
25065         * cs-parser.jay : Clean out commented cruft.
25066         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25067         used anywhere - non-reducing rule.
25068         (namespace_declarations): Non-reducing rule - comment out.
25069
25070         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25071         with TypeContainer::AddEnum.
25072
25073         * delegate.cs : New file for delegate handling classes.
25074         (Delegate): Class for declaring delegates.
25075
25076         * makefile : Update.
25077
25078         * cs-parser.jay (delegate_declaration): Implement.
25079
25080 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25081
25082         * class.cs (Event::Define): Implement.
25083         (Event.EventBuilder): New member.
25084
25085         * class.cs (TypeContainer::Populate): Update to define all enums and events
25086         we have.
25087         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25088         readonly fields for all these cases ?
25089
25090 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25091
25092         * class.cs (Property): Revamp to use the convention of making fields readonly.
25093         Accordingly modify code elsewhere.
25094
25095         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25096         the Define method of the Property class.
25097
25098         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25099         trivial bug.
25100         (TypeContainer::Populate): Update to define all the properties we have. Also
25101         define all enumerations.
25102
25103         * enum.cs (Define): Implement.
25104
25105 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25106
25107         * cs-parser.jay (overloadable_operator): The semantic value is an
25108         enum of the Operator class.
25109         (operator_declarator): Implement actions.
25110         (operator_declaration): Implement.
25111
25112         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25113         validity of definitions.
25114         (Operator::CheckBinaryOperator): Static method to check for binary operators
25115         (TypeContainer::AddOperator): New method to add an operator to a type.
25116
25117         * cs-parser.jay (indexer_declaration): Added line to actually call the
25118         AddIndexer method so it gets added ;-)
25119
25120         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25121         already taken care of by the MS compiler ?  
25122
25123 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25124
25125         * class.cs (Operator): New class for operator declarations.
25126         (Operator::OpType): Enum for the various operators.
25127
25128 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25129
25130         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25131         ostensibly handle this in semantic analysis.
25132
25133         * cs-parser.jay (general_catch_clause): Comment out
25134         (specific_catch_clauses, specific_catch_clause): Ditto.
25135         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25136         (catch_args, opt_catch_args): New productions.
25137         (catch_clause): Rewrite to use the new productions above
25138         (catch_clauses): Modify accordingly.
25139         (opt_catch_clauses): New production to use in try_statement
25140         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25141         and re-write the code in the actions to extract the specific and
25142         general catch clauses by being a little smart ;-)
25143
25144         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25145         Hooray, try and catch statements parse fine !
25146
25147 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25148
25149         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25150         string from the hashtable of variables.
25151
25152         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25153         I end up making that mistake ;-)
25154         (catch_clauses): Fixed gross error which made Key and Value of the 
25155         DictionaryEntry the same : $1 !!
25156
25157 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25158
25159         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25160
25161         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25162         when the add and remove accessors are specified. 
25163
25164 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25165
25166         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25167         information about indexer_declarator.
25168         (indexer_declarator): Implement actions.
25169         (parsing_indexer): New local boolean used to keep track of whether
25170         we are parsing indexers or properties. This is necessary because 
25171         implicit_parameters come into picture even for the get accessor in the 
25172         case of an indexer.
25173         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25174
25175         * class.cs (Indexer): New class for indexer declarations.
25176         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25177         (TypeContainer::indexers): New member to hold list of indexers for the
25178         type.
25179
25180 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25181
25182         * cs-parser.jay (add_accessor_declaration): Implement action.
25183         (remove_accessor_declaration): Implement action.
25184         (event_accessors_declaration): Implement
25185         (variable_declarators): swap statements for first rule - trivial.
25186
25187         * class.cs (Event): New class to hold information about event
25188         declarations.
25189         (TypeContainer::AddEvent): New method to add an event to a type
25190         (TypeContainer::events): New member to hold list of events.
25191
25192         * cs-parser.jay (event_declaration): Implement actions.
25193
25194 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25195
25196         * cs-parser.jay (dim_separators): Implement. Make it a string
25197         concatenating all the commas together, just as they appear.
25198         (opt_dim_separators): Modify accordingly
25199         (rank_specifiers): Update accordingly. Basically do the same
25200         thing - instead, collect the brackets here.
25201         (opt_rank_sepcifiers): Modify accordingly.
25202         (array_type): Modify to actually return the complete type string
25203         instead of ignoring the rank_specifiers.
25204         (expression_list): Implement to collect the expressions
25205         (variable_initializer): Implement. We make it a list of expressions
25206         essentially so that we can handle the array_initializer case neatly too.
25207         (variable_initializer_list): Implement.
25208         (array_initializer): Make it a list of variable_initializers
25209         (opt_array_initializer): Modify accordingly.
25210
25211         * expression.cs (New::NType): Add enumeration to help us
25212         keep track of whether we have an object/delegate creation
25213         or an array creation.
25214         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25215         members to hold data about array creation.
25216         (New:New): Modify to update NewType
25217         (New:New): New Overloaded contructor for the array creation
25218         case.
25219
25220         * cs-parser.jay (array_creation_expression): Implement to call
25221         the overloaded New constructor.
25222
25223 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25224
25225         * class.cs (TypeContainer::Constructors): Return member
25226         constructors instead of returning null.
25227
25228 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25229
25230         * typemanager.cs (InitCoreTypes): Initialize the various core
25231         types after we have populated the type manager with the user
25232         defined types (this distinction will be important later while
25233         compiling corlib.dll)
25234
25235         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25236         on Expression Classification.  Now all expressions have a method
25237         `Resolve' and a method `Emit'.
25238
25239         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25240         generation from working.     Also add some temporary debugging
25241         code. 
25242
25243 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25244
25245         * codegen.cs: Lots of code generation pieces.  This is only the
25246         beginning, will continue tomorrow with more touches of polish.  We
25247         handle the fundamentals of if, while, do, for, return.  Others are
25248         trickier and I need to start working on invocations soon.
25249
25250         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25251         s.InitStatement. 
25252
25253         * codegen.cs (EmitContext): New struct, used during code
25254         emission to keep a context.   Most of the code generation will be
25255         here. 
25256
25257         * cs-parser.jay: Add embedded blocks to the list of statements of
25258         this block.  So code generation proceeds in a top down fashion.
25259
25260 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25261
25262         * statement.cs: Add support for multiple child blocks.
25263
25264 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25265
25266         * codegen.cs (EmitCode): New function, will emit the code for a
25267         Block of code given a TypeContainer and its ILGenerator. 
25268
25269         * statement.cs (Block): Standard public readonly optimization.
25270         (Block::Block constructors): Link children. 
25271         (Block::Child): Child Linker.
25272         (Block::EmitVariables): Emits IL variable declarations.
25273
25274         * class.cs: Drop support for MethodGroups here, delay until
25275         Semantic Analysis.
25276         (Method::): Applied the same simplification that I did before, and
25277         move from Properties to public readonly fields.
25278         (Method::ParameterTypes): Returns the parameter types for the
25279         function, and implements a cache that will be useful later when I
25280         do error checking and the semantic analysis on the methods is
25281         performed.
25282         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25283         and made a method, optional argument tells whether this is a class
25284         or a structure to apply the `has-this' bit.
25285         (Method::GetCallingConvention): Implement, returns the calling
25286         convention. 
25287         (Method::Define): Defines the type, a second pass is performed
25288         later to populate the methods.
25289
25290         (Constructor::ParameterTypes): implement a cache similar to the
25291         one on Method::ParameterTypes, useful later when we do semantic
25292         analysis. 
25293
25294         (TypeContainer::EmitMethod):  New method.  Emits methods.
25295
25296         * expression.cs: Removed MethodGroup class from here.
25297
25298         * parameter.cs (Parameters::GetCallingConvention): new method.
25299
25300 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25301
25302         * class.cs (TypeContainer::Populate): Drop RootContext from the
25303         argument. 
25304
25305         (Constructor::CallingConvention): Returns the calling convention.
25306         (Constructor::ParameterTypes): Returns the constructor parameter
25307         types. 
25308
25309         (TypeContainer::AddConstructor): Keep track of default constructor
25310         and the default static constructor.
25311
25312         (Constructor::) Another class that starts using `public readonly'
25313         instead of properties. 
25314
25315         (Constructor::IsDefault): Whether this is a default constructor. 
25316
25317         (Field::) use readonly public fields instead of properties also.
25318
25319         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25320         track of static constructors;  If none is used, turn on
25321         BeforeFieldInit in the TypeAttributes. 
25322
25323         * cs-parser.jay (opt_argument_list): now the return can be null
25324         for the cases where there are no arguments. 
25325
25326         (constructor_declarator): If there is no implicit `base' or
25327         `this', then invoke the default parent constructor. 
25328
25329         * modifiers.cs (MethodAttr): New static function maps a set of
25330         modifiers flags into a MethodAttributes enum
25331         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25332         MethodAttr, TypeAttr to represent the various mappings where the
25333         modifiers are used.
25334         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25335
25336 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25337
25338         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25339         method arguments.
25340
25341         * interface.cs (PopulateIndexer): Implemented the code generator
25342         for interface indexers.
25343
25344 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25345
25346         * interface.cs (InterfaceMemberBase): Now we track the new status
25347         here.  
25348
25349         (PopulateProperty): Implement property population.  Woohoo!  Got
25350         Methods and Properties going today. 
25351
25352         Removed all the properties for interfaces, and replaced them with
25353         `public readonly' fields. 
25354
25355 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25356
25357         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25358         initialize their hashtables/arraylists only when they are needed
25359         instead of doing this always.
25360
25361         * parameter.cs: Handle refs and out parameters.
25362
25363         * cs-parser.jay: Use an ArrayList to construct the arguments
25364         instead of the ParameterCollection, and then cast that to a
25365         Parameter[] array.
25366
25367         * parameter.cs: Drop the use of ParameterCollection and use
25368         instead arrays of Parameters.
25369
25370         (GetParameterInfo): Use the Type, not the Name when resolving
25371         types. 
25372
25373 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25374
25375         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25376         and instead use public readonly fields.
25377
25378         * class.cs: Put back walking code for type containers.
25379
25380 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25381
25382         * class.cs (MakeConstant): Code to define constants.
25383
25384         * rootcontext.cs (LookupType): New function.  Used to locate types 
25385
25386
25387 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25388
25389         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25390         this System.Reflection code is.  Kudos to Microsoft
25391
25392         * typemanager.cs: Implement a type cache and avoid loading all
25393         types at boot time.  Wrap in LookupType the internals.  This made
25394         the compiler so much faster.  Wow.  I rule!
25395
25396         * driver.cs: Make sure we always load mscorlib first (for
25397         debugging purposes, nothing really important).
25398
25399         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25400         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25401
25402         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25403         on namespaces that have been imported using the `using' keyword.
25404
25405         * class.cs (TypeContainer::TypeAttr): Virtualize.
25406         (Class::TypeAttr): Return attributes suitable for this bad boy.
25407         (Struct::TypeAttr): ditto.
25408         Handle nested classes.
25409         (TypeContainer::) Remove all the type visiting code, it is now
25410         replaced with the rootcontext.cs code
25411
25412         * rootcontext.cs (GetClassBases): Added support for structs. 
25413
25414 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25415
25416         * interface.cs, statement.cs, class.cs, parameter.cs,
25417         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25418         Drop use of TypeRefs, and use strings instead.
25419
25420 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25421
25422         * rootcontext.cs: 
25423
25424         * class.cs (Struct::Struct): set the SEALED flags after
25425         checking the modifiers.
25426         (TypeContainer::TypeAttr): new property, returns the
25427         TypeAttributes for a class.  
25428
25429         * cs-parser.jay (type_list): Oops, list production was creating a
25430         new list of base types.
25431
25432         * rootcontext.cs (StdLib): New property.
25433         (GetInterfaceTypeByName): returns an interface by type name, and
25434         encapsulates error handling here.
25435         (GetInterfaces): simplified.
25436         (ResolveTree): Encapsulated all the tree resolution here.
25437         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25438         types. 
25439
25440         * driver.cs: Add support for --nostdlib, to avoid loading the
25441         default assemblies.
25442         (Main): Do not put tree resolution here. 
25443
25444         * rootcontext.cs: Beginning of the class resolution.
25445
25446 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25447
25448         * rootcontext.cs: Provide better error reporting. 
25449
25450         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25451
25452         * rootcontext.cs (CreateInterface): Handle the case where there
25453         are no parent interfaces.
25454
25455         (CloseTypes): Routine to flush types at the end.
25456         (CreateInterface): Track types.
25457         (GetInterfaces): Returns an array of Types from the list of
25458         defined interfaces.
25459
25460         * typemanager.c (AddUserType): Mechanism to track user types (puts
25461         the type on the global type hash, and allows us to close it at the
25462         end). 
25463
25464 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25465
25466         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25467         RecordInterface instead.
25468
25469         * cs-parser.jay: Updated to reflect changes above.
25470
25471         * decl.cs (Definition): Keep track of the TypeBuilder type that
25472         represents this type here.  Not sure we will use it in the long
25473         run, but wont hurt for now.
25474
25475         * driver.cs: Smaller changes to accomodate the new code.
25476
25477         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25478         when done. 
25479
25480         * rootcontext.cs (CreateInterface):  New method, used to create
25481         the System.TypeBuilder type for interfaces.
25482         (ResolveInterfaces): new entry point to resolve the interface
25483         hierarchy. 
25484         (CodeGen): Property, used to keep track of the code generator.
25485
25486 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25487
25488         * cs-parser.jay: Add a second production for delegate_declaration
25489         with `VOID'.
25490
25491         (enum_body): Put an opt_comma here instead of putting it on
25492         enum_body or enum_member_declarations so we can handle trailing
25493         commas on enumeration members.  Gets rid of a shift/reduce.
25494
25495         (type_list): Need a COMMA in the middle.
25496
25497         (indexer_declaration): Tell tokenizer to recognize get/set
25498
25499         * Remove old targets.
25500
25501         * Re-add the parser target.
25502
25503 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25504
25505         * cs-parser.jay: Add precendence rules for a number of operators
25506         ot reduce the number of shift/reduce conflicts in the grammar.
25507
25508 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25509
25510         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25511         and put it here.
25512
25513         Get rid of old crufty code.
25514
25515         * rootcontext.cs: Use this to keep track of the parsed
25516         representation and the defined types available to the program. 
25517
25518         * gen-treedump.cs: adjust for new convention.
25519
25520         * type.cs: Split out the type manager, and the assembly builder
25521         from here. 
25522
25523         * typemanager.cs: the type manager will live here now.
25524
25525         * cil-codegen.cs: And the code generator here. 
25526
25527 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25528
25529         * makefile: Fixed up for easy making.
25530
25531 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25532
25533         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25534         the 
25535
25536         (unary_expression): Expand pre_increment_expression and
25537         post_decrement_expression to reduce a shift/reduce.
25538
25539 2001-07-11  Simon Cozens
25540
25541         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25542
25543         Improve allow_keyword_as_indent name.
25544
25545 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25546
25547         * Adjustments for Beta2. 
25548
25549 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25550
25551         * decl.cs: Added `Define' abstract method.
25552         (InTransit): new property, used to catch recursive definitions. 
25553
25554         * interface.cs: Implement `Define'. 
25555
25556         * modifiers.cs: Map Modifiers.constants to
25557         System.Reflection.TypeAttribute flags.
25558
25559         * class.cs: Keep track of types and user-defined types.
25560         (BuilderInit): New method for creating an assembly
25561         (ResolveType): New function to launch the resolution process, only
25562         used by interfaces for now.
25563
25564         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25565         that are inserted into the name space. 
25566
25567 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25568
25569         * ARGH.  I have screwed up my tree so many times due to the use of
25570         rsync rather than using CVS.  Going to fix this at once. 
25571
25572         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25573         load types.
25574
25575 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25576
25577         * Experiment successful: Use System.Type rather that our own
25578         version of Type.  
25579
25580 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25581
25582         * cs-parser.jay: Removed nsAliases from here.
25583
25584         Use new namespaces, handle `using XXX;' 
25585
25586         * namespace.cs: Reimplemented namespace handling, use a recursive
25587         definition of the class.  Now we can keep track of using clauses
25588         and catch invalid using clauses.
25589
25590 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25591
25592         * gen-treedump.cs: Adapted for all the renaming.
25593
25594         * expression.cs (Expression): this class now has a Type property
25595         which returns an expression Type.
25596
25597         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25598         `Type', as this has a different meaning now in the base
25599
25600 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25601
25602         * interface.cs, class.cs: Removed from all the sources the
25603         references to signature computation, as we can not do method
25604         signature computation during the parsing time, as we are not
25605         trying to solve at that point distinguishing:
25606
25607         class X {
25608                 void a (Blah x) {}
25609                 void a (NS.Blah x) {}
25610         }
25611
25612         Which depending on the context might be valid or not, as we do not
25613         know if Blah is the same thing as NS.Blah at that point.
25614
25615         * Redid everything so the code uses TypeRefs now instead of
25616         Types.  TypeRefs are just temporary type placeholders, that need
25617         to be resolved.  They initially have a pointer to a string and the
25618         current scope in which they are used.  This is used later by the
25619         compiler to resolve the reference to an actual Type. 
25620
25621         * DeclSpace is no longer a CIR.Type, and neither are
25622         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25623         are all DeclSpaces, but no Types. 
25624
25625         * type.cs (TypeRefManager): This implements the TypeRef manager,
25626         which keeps track of all the types that need to be resolved after
25627         the parsing has finished. 
25628
25629 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25630
25631         * ARGH.  We are going to have to store `foreach' as a class rather
25632         than resolving it, as we need to verify error 1579 after name
25633         resolution.   *OR* we could keep a flag that says `This request to
25634         IEnumerator comes from a foreach statement' which we can then use
25635         to generate the error.
25636
25637 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25638
25639         * class.cs (TypeContainer.AddMethod): we now add methods to the
25640         MethodGroup instead of the method hashtable.  
25641
25642         * expression.cs: Add MethodGroup abstraction, which gets us one
25643         step closer to the specification in the way we handle method
25644         declarations.  
25645
25646         * cs-parser.jay (primary_expression): qualified_identifier now
25647         tried to match up an identifier to a local variable reference or
25648         to a parameter reference.
25649
25650         current_local_parameters is now a parser global variable that
25651         points to the current parameters for the block, used during name
25652         lookup.
25653
25654         (property_declaration): Now creates an implicit `value' argument to
25655         the set accessor.
25656
25657 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25658
25659         * parameter.cs: Do not use `param' arguments as part of the
25660         signature, per the spec.
25661
25662 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25663
25664         * decl.cs: Base class for classes, structs and interfaces.  This
25665         is the "Declaration Space" 
25666
25667         * cs-parser.jay: Use CheckDef for checking declaration errors
25668         instead of having one on each function.
25669
25670         * class.cs: Factor out some code for handling error handling in
25671         accordance to the "Declarations" section in the "Basic Concepts"
25672         chapter in the ECMA C# spec.
25673
25674         * interface.cs: Make all interface member classes derive from
25675         InterfaceMemberBase.
25676
25677 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25678
25679         * Many things: all interfaces are parsed and generated in
25680         gen-treedump.  Support for member variables, constructors,
25681         destructors, properties, constants is there.
25682
25683         Beginning of the IL backend, but very little done, just there for
25684         testing purposes. 
25685
25686 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25687
25688         * cs-parser.jay: Fix labeled statement.
25689
25690         * cs-tokenizer.cs (escape): Escape " and ' always.
25691         ref_line, ref_name: keep track of the line/filename as instructed
25692         by #line by the compiler.
25693         Parse #line.
25694
25695 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25696
25697         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25698         to match the values in System.CodeDOM.
25699
25700         Divid renamed to Divide.
25701
25702         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25703         statements. 
25704         (Statements.set): remove.
25705
25706         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25707         statements. 
25708
25709         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25710         falseStatements always have valid values. 
25711
25712         * cs-parser.jay: Use System.CodeDOM now.
25713